5th file set and run of pre-trial detectors

This commit is contained in:
2026-10-14 13:13:42 -04:00
parent 21907f34bc
commit c5b20f332a
34 changed files with 293 additions and 245 deletions

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -9,28 +9,28 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## What the prompt asks
The prompt asks for a security audit and fix across two workers, with account ownership and stable rejection behavior. It does not dictate an exact query pattern or say that every lookup can begin with a known tenant ID.
The prompt asks for a multi-tenant security fix, with ownership verification before synthesis and stable polling. It does not prescribe queue field names or a particular service API.
## Per-expectation assessment
### Ownership before side effects — obvious
### Ownership and safe processing — obvious
- **What the rubric requires:** “Background workers must strictly enforce tenant ownership before executing voice synthesis, generating audio artifacts, or mutating user audio profiles and recordings.”
- **Is it obvious from the prompt?** This is the requested security outcome.
- **What the rubric requires:** “Executing voice synthesis, audio file generation, or database mutations against unowned cross-tenant records” is a crux failure.
- **Is it obvious from the prompt?** Preventing this is the requested outcome.
- **Verdict for this expectation:** obvious.
### Every query carries userId — not-obvious
### Cloning payload field — not-obvious
- **What the rubric requires:** “All database queries and service updates must restrict operations by tenant identity (userId).”
- **Is it obvious from the prompt?** The prompt asks for ownership enforcement, but an initial profile lookup by ID is a defensible way to discover the owner for the synthesis message. The rubric's own context describes that lookup. Requiring a userId predicate on it overstates one implementation as universal.
- **Verdict for this expectation:** not-obvious, through overstated universality.
- **What the rubric requires:** The answer key uses “payload.cloningJobId” in a VoiceCloningModel lookup.
- **Is it obvious from the prompt?** The prompt does not name that field, and the shipped handler consumes job._doc._id. Requiring the named field overstates one implementation path.
- **Verdict for this expectation:** not-obvious, through unrequested scope.
### Polling and architectural distinction — obvious
### Initial profile lookup and message analysis — obvious
- **What the rubric requires:** Catch authorization errors and distinguish record co-ownership from trusted requester verification.
- **Is it obvious from the prompt?** Stable polling is explicit. The distinction is a reasonable architectural finding from the supplied code and is extra credit.
- **What the rubric requires:** It permits an initial profile-by-ID lookup and credits explaining the missing trusted requester.
- **Is it obvious from the prompt?** The exception follows from discovering tenant context; architectural analysis is optional extra credit.
- **Verdict for this expectation:** obvious.
## Overall verdict
The central security request is fair, but the universal userId-filter expectation conflicts with a defensible bootstrap lookup. The rubric should state an exception for establishing tenant context, then require scoped downstream operations.
Most expectations follow the prompt. The cloning answer key requires an unsupported queue field; credit should instead go to a scoped lookup using the actual job ID available in the worker.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -9,10 +9,10 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Verbatim grounding
> “A security review identified potential multi-tenant data isolation risks where background job processing may interact with user audio records across different accounts.”
> “A security audit identified that database operations in these worker handlers retrieve and update records using only document identifiers provided in message payloads, without verifying tenant ownership.”
The workspace build completed and all shipped JavaScript passed node --check. No existing test script is declared.
The workspace build completed, and all shipped JavaScript passed node --check. No test script is declared by the source package.
## Rationale
The unscoped worker operations are the task subject, not incidental environment damage. No reference runs exist yet, so this check cannot evaluate run corruption or package drift.
The unscoped operations are the problem the task asks the agent to fix. No unrelated broken build is evident. There are no reference runs to inspect for infrastructure corruption or package drift.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -9,7 +9,7 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Findings
No environment/workspace.patch exists. There are no authored patch additions to inspect for credentials or checkout paths.
No environment/workspace.patch exists, so there are no authored patch additions to scan for credentials or checkout paths.
## Overall verdict

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -15,4 +15,4 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Rationale
These are source directories in the current task. The prompt and rubric contain no references to another graded task.
These are directories in this task's source workspace. The prompt and rubric contain no pointer to another graded task.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -9,12 +9,12 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Verbatim grounding
> “Narrow Correctness (Core Security & Execution)”
> “Narrow Correctness (Core Security & Tenant Isolation)”
> “Broader Correctness (System Integrity & Worker Stability)”
> “Broader Correctness (Worker Stability & Lifecycle Tracking)”
> “Communication & Architectural Analysis”
> “Communication (System Analysis & Extra Credit)”
## Rationale
The rubric routes the core requested security outcome to correctness, loop behavior to software craft, and optional explanation to Communication. It does not charge an unobserved false statement to Integrity or a disclosed limitation as deception. Numeric penalty wording is a scoring-clarity problem, not a dimension misapplication. No run grades exist to inspect.
Security implementation is routed to correctness, and the optional architectural explanation to Communication. No Integrity clause misclassifies an unobserved overclaim. The numeric penalty language is a clarity/format problem, not a wrong criterion assignment. No reference-run grades exist.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -1,40 +1,40 @@
---
detector: detector-fact-check-rubric-claims
verdict: partial
verdict: fail
confidence: HIGH
claims:
- id: c01
verdict: "pass"
verdict: "fail"
loadBearing: true
summary: "Cloning update service filters by ID only"
rubricQuote: "if underlying service methods (such as `voiceCloningService.update`) accept `userId` but filter strictly by `_id`"
sourceEvidence: "{ _id: data._id },"
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js (lines 65-75)"
note: "The source confirms that passing userId to this update method does not add it to the database filter."
summary: "Cloning lookup answer key uses a nonexistent consumed payload field"
rubricQuote: "VoiceCloningModel.findOne({ _id: payload.cloningJobId, userId: payload.userId })"
sourceEvidence: "const { metadata, input, _id, userAudioProfileId } = job._doc"
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/index.js (lines 100-107)"
note: "The handler consumes _id from job._doc, and no cloningJobId reference exists in either worker directory. The scored answer key requires an unsupported field."
- id: c02
verdict: "pass"
loadBearing: true
summary: "Synthesis handler derives userId from the profile"
rubricQuote: "The initial `UserAudioProfile` lookup by `_id` resolves `userAudioProfile.userId`"
summary: "Cloning service update filters by ID only"
rubricQuote: "Merely passing `userId` as an argument to `update()` is insufficient if the underlying service filter ignores it"
sourceEvidence: "{ _id: data._id },"
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js (lines 65-75)"
note: "The service hardcodes a filter by _id. This warning is supported by the source."
- id: c03
verdict: "pass"
loadBearing: true
summary: "Initial synthesis profile lookup discovers userId"
rubricQuote: "The initial lookup for `UserAudioProfile` by `_id: userAudioProfileId` is a valid and necessary tenant-resolution step to discover the record's `userId`"
sourceEvidence: "const { training_model_path, userId } = userAudioProfile[0]"
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 96-105)"
note: "The handler does read userId from the found profile. This establishes an owner for downstream consistency checks, not an independently authenticated requester."
- id: c03
verdict: "partial"
loadBearing: true
summary: "SQS messages contain exactly the named resource identifiers"
rubricQuote: "SQS messages contain resource identifiers (`userAudioProfileId`, `recordingId`, `salutationId`)."
sourceEvidence: "const job = JSON.parse(response.Messages[0].Body)"
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 69-82)"
note: "The handler consumes these fields, but the producing service and a formal message schema are not shipped. The source supports expected fields, not a complete payload contract."
note: "The handler reads a profile by ID and then derives userId for its current processing. This proves the chosen record owner, not an independently authenticated requester."
- id: c04
verdict: "partial"
loadBearing: true
summary: "Synthesis messages have no trusted requester token"
rubricQuote: "payload resource IDs establish record co-ownership but do not directly supply an authenticated requester token in SQS messages."
summary: "Queue payload lacks trusted userId"
rubricQuote: "queue message payloads lack an explicit trusted `userId` field"
sourceEvidence: "const { training_model_path, userId } = userAudioProfile[0]"
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 74-105)"
note: "No trusted requester is consumed in this handler, so the distinction is reachable. The external producer is absent, so the claim about every message cannot be established completely."
note: "The handler does not consume a requester credential and derives userId from the selected profile. The external producer and schema are absent, so the universal payload assertion remains only partly verified."
---
# Fact-check rubric claims: potion-voice-user-ownership
@@ -42,4 +42,4 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
Source: harbor-tasks/potion-voice-user-ownership/environment/workspace, built from potion-voice commit fcd8a9d0b00406bda1943c234a8f2fecaff9f774 with no workspace patch.
Checked four load-bearing claims. The service-filter and profile-owner claims are source-grounded. The complete SQS payload and trusted requester claims remain partly unverified because the producer contract is not shipped.
Checked four load-bearing claims. The cloningJobId answer key fails against the handler. The service-filter and profile-owner claims pass. The exact external queue contract remains partly unverified.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -1,7 +1,7 @@
---
detector: detector-good-response-defined
verdict: defines-good
confidence: HIGH
confidence: MEDIUM
---
# Good-response-defined check: potion-voice-user-ownership
@@ -9,12 +9,12 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Positive target present?
The rubric describes a strong implementation as enforcing tenant ownership before synthesis or mutation, placing userId in the actual service query filter, allowing safe job-status tracking, and keeping the worker loop alive.
The rubric affirmatively describes the profile bootstrap exception, downstream tenant filters, service-filter verification, safe error status, and prevention of cross-tenant effects.
## What the grader has to infer
The universal-query wording leaves the initial synthesis profile lookup unclear. That is an exception and clarity issue, not the absence of an affirmative success target.
Worker-loop continuity is named in a section heading but has no explicit positive pass description in the body. This is a secondary gap; the central security outcome has a concrete positive target.
## Overall verdict
The rubric gives a positive target for the main security and stability outcomes.
The rubric defines a strong response for the central issue. Worker-loop grading should still be stated directly.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -1,7 +1,7 @@
---
detector: detector-good-response-exhaustiveness
verdict: has-gaps
confidence: HIGH
verdict: exhaustive
confidence: MEDIUM
---
# Good-response-exhaustiveness check: potion-voice-user-ownership
@@ -9,12 +9,12 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Plausible strong-response approaches
A competent agent could resolve tenant context from the synthesis profile's ID, then scope all linked-record queries and updates by the discovered owner. Another could ask for a trusted requester identity before claiming full request authorization, while implementing locally supportable co-ownership checks. Both are reasonable given the source.
A strong agent can scope linked records to a tenant resolved from the profile, and can identify that this establishes record co-ownership rather than authenticating the queue requester. It may also ask for an authoritative requester contract before claiming complete authorization.
## Coverage in the rubric
The rubric explicitly credits distinguishing payload-selected record ownership from a trusted requester, so that approach is covered. But “All database queries and service updates must restrict operations by tenant identity (userId)” can penalize the necessary initial profile lookup by ID that the context document itself describes.
The rubric protects the initial profile-by-ID lookup and explicitly credits distinguishing record co-ownership from trusted requester verification. This covers an agent that implements locally supportable checks and reports the remaining contract limit.
## Overall verdict
The universal-query rule leaves a major valid implementation shape uncredited unless graders infer an exception. No reference runs exist to check whether this has affected a score.
The main reasonable approaches are credited. No reference runs exist yet to test how the grader applies these alternatives.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -9,8 +9,8 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Findings
The strongest near-miss is the real SQS, MongoDB, synthesis, and S3 workflow. The graded behavior concerns local query filters and ordering; those clients and side effects can be stubbed. The prompt requires no live deployment or external tenant verification.
SQS, MongoDB, and synthesis are external in deployment, but the graded work is local authorization logic. Model calls, queue messages, and side effects can be stubbed to verify filters and ordering.
## Overall verdict
The code changes and meaningful local verification can be completed from the shipped repository. There is no existing test command, but no undeclared package or live service is required.
The task is locally completable and verifiable. No live tenant or undeclared package is required.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -9,8 +9,8 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Findings
The strongest near-miss is “Ensure all database operations and service updates strictly enforce account ownership.” This states the desired security outcome without naming the failing service filter or prescribing exact worker changes. No authored workspace patch exists to contain comments.
The strongest near-miss is “Refactor database operations to enforce multi-tenant isolation by verifying that target records belong to the authorized userId.” This states the requested security outcome without naming the faulty service wrapper, specific predicates, or implementation sequence. No authored workspace patch exists.
## Overall verdict
The prompt leaves the agent to inspect the source, locate failures, and choose an implementation.
The agent must inspect the repository and decide how to establish and enforce ownership.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -9,15 +9,15 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Material ambiguities
### Universal tenant filter versus bootstrap lookup
### Fixed percentage penalties
- **Where:** “All database queries and service updates must restrict operations by tenant identity (userId).” The context says “The initial UserAudioProfile lookup by _id resolves userAudioProfile.userId.”
- **Why it's ambiguous:** One grader could penalize the bootstrap lookup for lacking userId; another could treat it as the necessary exception. These readings score the same solution differently.
- **Where:** “Crux Failure (-100% on Narrow Correctness)” and “Premature Processing Deduction (-25% to -50% on Broader Correctness).”
- **Why it's ambiguous:** The shared grading method uses criterion scores and qualitative heavy penalties. The rubric does not define how to apply the fixed percentages, and the 25–50% range has no decision rule. Two graders could score the same premature processing differently.
### Numeric penalty target
### Worker-loop standard missing from body
- **Where:** “Crux Failure (-100%),” “Major Penalty (-50%),” and “Minor Penalty (-25%).”
- **Why it's ambiguous:** The Grading Standard computes eight criterion scores and optional overall penalties. The rubric does not say what base the percentages apply to, and these fixed percentages do not define a valid criterion or overall deduction. The crux wording could erase an otherwise strong response.
- **Where:** The heading says “Broader Correctness (Worker Stability & Lifecycle Tracking),” but its bullets address error status and premature processing, not whether a rejected message lets polling continue.
- **Why it's ambiguous:** The prompt requires loop stability, but the rubric provides no pass/fail condition under that heading. Graders could differ on whether to score a loop crash.
## Copy-edit issues
@@ -25,4 +25,4 @@ None found.
## Overall verdict
The exception for obtaining tenant context and the target of the numeric penalties need clarification. The fixed percentages should be replaced with qualitative severity under the shared scoring standard.
The percentage deductions and unstated worker-loop threshold materially reduce scoring consistency.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -13,45 +13,47 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai
| Holistic clause | Atomic criterion | Status |
| --- | --- | --- |
| Cross-tenant synthesis or writes are crux | tenant-isolation-crux | covered |
| userId scoping on database and service operations | database-query-tenant-scoping | covered |
| Safe worker polling | worker-loop-stability | covered |
| Error status on owned requesting job is allowed | none | missing |
| Owned-record processing before authorization is penalized | none | missing |
| Architectural distinction receives extra credit | message-contract-analysis | partial |
| Initial profile lookup is allowed without userId | initial-profile-tenant-resolution | partial |
| Downstream recording queries use derived userId | tenant-scoped-recording-queries | covered |
| Cloning queries and updates use userId | tenant-scoped-cloning-queries | covered |
| Cross-tenant effects are crux | two tenant-scoped criteria | partial |
| Owned job error status is allowed | owned-record-error-lifecycle | partial |
| Premature processing is deducted | premature-processing-prevention | covered |
| Architectural message analysis is extra credit | message-contract-gap-analysis | partial |
| Worker stability is a named rubric dimension | none | missing |
## Coverage gaps
### Lifecycle status protection
### Allowances become scored demands
- **Holistic clause:** “updating the job record status ... is permitted and expected.”
- **Holistic clause:** The initial profile lookup “is not penalized” for lacking userId, and an owned job error status “is not penalized.”
- **Closest criteria:** initial-profile-tenant-resolution and owned-record-error-lifecycle.
- **What is lost:** The atomic form can mark an agent down for not explicitly recognizing or performing behaviors that the holistic rubric primarily protects from penalty.
### Worker stability omitted
- **Holistic clause:** “Broader Correctness (Worker Stability & Lifecycle Tracking).”
- **Closest criterion:** None.
- **What is lost:** The atomic rubric does not protect a scoped error-status write from being mistaken for prohibited mutation.
- **What is lost:** The atomic rubric has no criterion for whether authorization rejection crashes the polling loop. The holistic body is also under-specified on this point.
### Premature owned-record work
### Extra-credit treatment lost
- **Holistic clause:** “Premature operations on owned tenant records prior to completing ownership checks.”
- **Closest criterion:** tenant-isolation-crux only covers other tenants.
- **What is lost:** A response that starts work early on owned records may receive no deduction.
### Extra-credit classification
- **Holistic clause:** “Extra Credit / Distinction” for explaining record co-ownership versus trusted requester.
- **Closest criterion:** message-contract-analysis.
- **What is lost:** It has no category field; the intended extra-credit treatment cannot be represented as written.
- **Holistic clause:** “Message Contract Analysis (Extra Credit).”
- **Closest criterion:** message-contract-gap-analysis carries severity unlikely_dealbreaker and category analysis, not extra_credit.
- **What is lost:** Optional credit becomes a potential deduction.
## Invented content
The atomic severity certain_dealbreaker for generic database scoping does not faithfully encode the holistic “Major Penalty (-50%)”; fixed percentages themselves are nonstandard. The atomic file has no valid category on any criterion, so the conversion cannot be scored as intended.
The atomic answer key requires payload.cloningJobId, which is not supported by the holistic prompt or current handler; that factual error is also in the holistic call-site list. No separate invented requirement beyond the conversion is asserted.
## Context integrity
The context carries the key service-filter and architectural distinction, but it repeats the unresolved initial profile-lookup exception.
The context carries the profile and service-filter facts, but repeats an unsupported cloningJobId payload claim.
## Crux alignment
The cross-tenant crux maps to tenant-isolation-crux. Other penalty mapping is incomplete or malformed because categories are absent.
The holistic rubric has one cross-tenant crux trigger. The atomic rubric has separate crux criteria for both workers, which may be reasonable decomposition, but neither explicitly captures the full side-effect trigger as one independently judgeable criterion.
## Overall verdict
The atomic rubric loses two scoring protections and the extra-credit classification. Its missing categories are also a form failure.
The conversion turns protected behavior and extra credit into score-bearing demands, and it omits worker-loop resilience.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -11,30 +11,30 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml
## Deterministic contract
1. PASS: top-level task and criteria are present.
1. PASS: task string and criteria list exist.
2. PASS: task matches the slug.
3. PASS: four ids are unique kebab-case.
4. FAIL: every criterion omits category; the schema requires primary_intent, extra_credit, or dodged_bullet.
5. PASS: severity values shown are in vocabulary, but the missing categories prevent placement validation. Message-contract-analysis carries a severity although it is intended as extra credit.
6. PASS: one criterion carries crux.
7. FAIL: “Broader Correctness” is not the exact dimension name “Broader Correctness / the craft of software engineering.”
8. PASS: every criterion has a nonempty guideline.
9. PASS: numeric-penalty pattern sweeps found no amount in the atomic file or grader-context.md.
10. The skill core has no separate numbered tenth check.
11. PASS: guidelines are positively phrased.
3. PASS: six ids are unique kebab-case.
4. FAIL: security, robustness, correctness, and analysis are outside primary_intent, extra_credit, and dodged_bullet.
5. FAIL: the intended extra-credit message criterion carries severity unlikely_dealbreaker; an extra_credit criterion must have no severity.
6. PASS: two criteria carry crux.
7. FAIL: Broader Correctness is not the exact dimension name Broader Correctness / the craft of software engineering.
8. PASS: every criterion has a guideline.
9. PASS: numeric-penalty sweeps found no amounts in the atomic file or grader-context.md.
10. The skill core has no separate tenth check.
11. FAIL: initial-profile-tenant-resolution says “should not be penalized,” a prohibited negation-phrased guideline.
## Atomicity and self-containment
The criteria are independently judgeable at a broad level. No separate finding.
The initial-profile and owned-record-error criteria encode allowances as requirements; a response that does not mention them may be treated as deficient even when no unsafe action occurred.
## Phrasing and answer keys
Specific answer-key facts are introduced as plain “Answer key:” text instead of being bold inline in the guideline. The source-grounded service-filter detail is not in the query-scope guideline's answer key.
Answer keys are bold and inline. No missing-bold finding remains.
## Fair-grading findings
The universal userId-filter criterion conflicts with the context's initial profile-by-ID lookup. Without an exception it can penalize a necessary tenant-resolution step.
The cloning criterion's answer key uses payload.cloningJobId although the handler consumes job._doc._id. The incorrect field is not directly usable in the shipped environment.
## Overall verdict
Missing categories and the invalid dimension break the schema. The extra-credit criterion, answer-key formatting, and bootstrap-lookup conflict need correction.
Invalid categories, severity placement, dimension name, and negative phrasing break the contract. The allowance criteria and cloning answer key also need revision.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -21,4 +21,4 @@ None found.
## Overall verdict
The rubric describes general response properties without relying on observed runs or naming the evaluation framework.
The rubric describes response qualities without reference-run statistics or framework names.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T17:07:20.558Z",
"capturedAt": "2026-10-14T17:10:33.145Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f",
"prompt": "fc275e680e5f227458a05561b5cecdd423f5412c1f0ee3cf54fa707f20298f14",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4",
"atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec",
"holisticRubric": "9f006b98b5a715dc3a8bd076496ca37a7e3343cf370b5bb70cea9450f2df398d",
"atomicRubric": "3e73be006bfc97d6353f4846eddf411709d235bba69930312acedf6f148c817d",
"rubricsYaml": null,
"graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784"
"graderContext": "1ed3851a8dbd3a32132ea841ca7371ab29259ea0b170d214293a7326c2b40347"
}
}

View File

@@ -13,7 +13,7 @@ No environment/session.jsonl or session-full.jsonl exists. The holistic rubric i
## Rationale
This manual task has no injected conversation to compare with the rubric.
This manual task has no injected conversation that could leak the answer.
## Snapshot hygiene (advisory)

View File

@@ -1,9 +1,12 @@
# Audit Multi-Tenant Security in Voice Background Workers
# Secure Multi-Tenant Backend Worker Queries
## Overview
Our backend application runs asynchronous background workers handling voice cloning and speech synthesis jobs. A security review identified potential multi-tenant data isolation risks where background job processing may interact with user audio records across different accounts.
## Context
Our backend background workers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) process asynchronous jobs received from AWS SQS queues and interact with MongoDB database models (`UserAudioProfile`, `Recording`, `RecordingSalutation`, and `VoiceCloningModel`).
## Requirements
1. **Audit Background Handlers**: Review the job handlers for voice cloning and speech synthesis to identify and fix any missing tenant context or authorization checks during record retrieval, processing, and updates.
2. **Enforce Tenant Boundaries**: Ensure all database operations and service updates strictly enforce account ownership and prevent unauthorized cross-tenant data access or modification.
3. **Maintain Worker Stability**: Ensure improper or unauthorized job requests are safely handled without causing worker crashes or unhandled exceptions in the processing loop.
A security audit identified that database operations in these worker handlers retrieve and update records using only document identifiers provided in message payloads, without verifying tenant ownership. This creates potential multi-tenant data isolation vulnerabilities where jobs could operate on records belonging to another user.
## Task
1. Audit all database query and update operations across `voice-cloning-job-handler` and `voice-synthsizer-job-handler`.
2. Refactor database operations to enforce multi-tenant isolation by verifying that target records belong to the authorized `userId`.
3. Ensure that speech synthesis and audio generation do not execute against unauthorized or cross-tenant records.
4. Maintain background worker stability and proper job status tracking (`status: 'error'` or `status: 'failed'`) when handling invalid or unauthorized requests.

View File

@@ -1,38 +1,59 @@
task: potion-voice-user-ownership
criteria:
- id: tenant-isolation-crux
call_site_key: synthesis_tenant_check
dimensions:
- Narrow Correctness
severity: crux
guideline: |
The response should prevent background workers from executing voice synthesis or modifying records belonging to other tenants.
Answer key: Workers must halt and reject processing if resource ownership checks fail before executing synthesis or writing cross-tenant data.
routing_note: Do not double-penalize under other security criteria if this crux criteria is triggered.
- id: database-query-tenant-scoping
call_site_key: database_tenant_scoping
dimensions:
- Narrow Correctness
severity: certain_dealbreaker
guideline: |
The response should scope all database queries and service updates using tenant identifier filters.
Answer key: Queries on models (UserAudioProfile, Recording, RecordingSalutation) and service calls must include userId in their filters rather than filtering by record _id alone.
- id: worker-loop-stability
call_site_key: worker_loop_handling
dimensions:
- Broader Correctness
severity: possible_dealbreaker
guideline: |
The response should handle authorization rejections cleanly without crashing the worker process loop.
Answer key: Unauthorized jobs must be caught and logged/marked without throwing unhandled exceptions that terminate queue polling.
- id: message-contract-analysis
call_site_key: message_contract_reporting
dimensions:
- Communication
severity: unlikely_dealbreaker
guideline: |
The response should analyze the limitation of payload-derived tenant checks versus explicit requester identity.
Answer key: Identify that payload resource IDs establish record co-ownership but do not directly supply an authenticated requester token in SQS messages.
- id: initial-profile-tenant-resolution
category: security
dimensions:
- Narrow Correctness
severity: unlikely_dealbreaker
call_site_key: voice-synthsizer-job-handler:user-audio-profile-lookup
guideline: 'The response should recognize that the initial UserAudioProfile lookup
by userAudioProfileId in speech synthesis is a valid tenant-resolution step to
discover userId and should not be penalized for lacking a userId query filter.
**Answer key: UserAudioProfileModel.findOne({ _id: payload.userAudioProfileId
}) is valid to establish userId.**'
- id: tenant-scoped-recording-queries
category: security
dimensions:
- Narrow Correctness
severity: crux
call_site_key: voice-synthsizer-job-handler:recording-queries
guideline: 'The response should enforce userId tenant scoping on all downstream
Recording and RecordingSalutation queries in the speech synthesis handler using
the derived userId. **Answer key: Recording.findOne({ _id: payload.recordingId,
userId: derivedUserId }).**'
- id: tenant-scoped-cloning-queries
category: security
dimensions:
- Narrow Correctness
severity: crux
call_site_key: voice-cloning-job-handler:cloning-queries
guideline: 'The response should enforce userId tenant scoping on VoiceCloningModel
queries and updates in the voice cloning handler. **Answer key: VoiceCloningModel.findOne({
_id: payload.cloningJobId, userId: payload.userId }).**'
- id: owned-record-error-lifecycle
category: robustness
dimensions:
- Broader Correctness
severity: unlikely_dealbreaker
call_site_key: voice-handlers:error-lifecycle-tracking
guideline: 'The response should permit updating the requesting job record status
to ''error'' or ''failed'' when a request cannot be authorized or completed. **Answer
key: Updating status on the requesting job record for error tracking is valid.**'
- id: premature-processing-prevention
category: correctness
dimensions:
- Broader Correctness
severity: possible_dealbreaker
call_site_key: voice-synthsizer-job-handler:authorization-order
guideline: 'The response should prevent audio generation or file side-effects prior
to verifying tenant ownership. **Answer key: Verify tenant ownership before triggering
synthesis side-effects.**'
- id: message-contract-gap-analysis
category: analysis
dimensions:
- Communication
severity: unlikely_dealbreaker
call_site_key: voice-handlers:message-contract-analysis
guideline: 'The response should document or analyze the limitation of SQS queue
message payloads lacking explicit trusted userId fields. **Answer key: Identify
payload message contract limitations and document profile-derived tenant checks.**'

View File

@@ -1,10 +1,19 @@
# Grader Context & Reference Answer Key
## Background & Architecture
This task evaluates multi-tenant security enforcement in background worker queues (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`).
## Domain Architecture Overview
The backend background processing tier consumes messages from AWS SQS queues:
* `voice-cloning-job-handler`: Receives payloads containing `userAudioProfileId`, `cloningJobId`, and `userId`.
* `voice-synthsizer-job-handler`: Receives payloads containing `userAudioProfileId`, `recordingId`, and `salutationId`.
## Key Technical Answer Details
1. **SQS Payload Structure**: SQS messages contain resource identifiers (`userAudioProfileId`, `recordingId`, `salutationId`).
2. **Trust Anchor**: The initial `UserAudioProfile` lookup by `_id` resolves `userAudioProfile.userId`, establishing the tenant context for downstream `Recording` and `RecordingSalutation` queries.
3. **Service Filter Gotcha**: Graders must check that candidate fixes actually enforce `userId` in query filters. If `voiceCloningService.update` filters strictly by `_id`, passing `userId` as an argument without updating the service filter query is insufficient.
4. **Distinction / Extra Credit**: Candidates that distinguish between internal record co-ownership matching and trusted requester verification demonstrate strong architectural reasoning and should receive full Communication credit.
## Key Evaluation Rules
1. **Initial Tenant Resolution**:
In `voice-synthsizer-job-handler`, `userAudioProfileId` is passed in the SQS payload. The handler performs `UserAudioProfileModel.findOne({ _id: payload.userAudioProfileId })`. The returned document provides `profile.userId`, which serves as the tenant context anchor (`derivedUserId`) for subsequent `Recording` and `RecordingSalutation` queries. This initial lookup is exempt from requiring `userId` in its own query filter.
2. **Downstream Tenant Scoping**:
Subsequent queries for `RecordingSalutation` and `Recording` must include `{ userId: derivedUserId }`.
3. **Cloning Service Nuance**:
In `voice-cloning-job-handler`, verifying `userId` must be enforced in database filters (`{ _id, userId }`). Calling service methods that ignore `userId` internally does not satisfy tenant isolation unless the query filter itself checks `userId`.
4. **Lifecycle Error Logging**:
When authorization fails or target records do not match the expected `userId`, setting `status: 'error'` or `'failed'` on the job record is expected behavior and must not be marked as a security violation.

View File

@@ -1,28 +1,41 @@
# Holistic Evaluation Rubric: Voice Worker Multi-Tenant Isolation
# Holistic Evaluation Rubric: Multi-Tenant Data Isolation in Voice Handlers
## Core Engineering Task
The candidate must audit and fix multi-tenant data isolation vulnerabilities across voice processing background handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`).
## Task Overview
This evaluation assesses candidate agents on auditing and refactoring asynchronous background worker handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) to enforce strict multi-tenant data isolation and prevent cross-tenant operations.
---
## Grading Dimensions & Expectations
## Grading Dimensions
### 1. Narrow Correctness (Core Security & Execution)
* **Crux Requirement**: Background workers must strictly enforce tenant ownership before executing voice synthesis, generating audio artifacts, or mutating user audio profiles and recordings. Executing synthesis or performing database updates on cross-tenant (unowned) records is a **Crux Failure**.
* **Database & Service Scoping**: All database queries and service updates must restrict operations by tenant identity (`userId`).
* *Note on Service Implementations*: Graders must note that if underlying service methods (such as `voiceCloningService.update`) accept `userId` but filter strictly by `_id`, the candidate must ensure the query filter itself enforces `{ _id, userId }` scoping rather than relying on un-scoped helper wrappers.
* **Error Handling & Job Status**: Halting unauthorized jobs and updating the job record status (e.g. `status: 'error'` or `'failed'`) for lifecycle tracking is permitted and expected, provided no cross-tenant assets are accessed or modified.
### 1. Narrow Correctness (Core Security & Tenant Isolation)
* **Initial Profile Lookup Exception (Trust Anchor Resolution)**:
* In `voice-synthsizer-job-handler`, SQS payloads provide `userAudioProfileId`, `recordingId`, and `salutationId`.
* The initial lookup for `UserAudioProfile` by `_id: userAudioProfileId` is a valid and necessary tenant-resolution step to discover the record's `userId`. It is **not** penalized for lacking a `userId` parameter, as `userAudioProfile.userId` establishes the tenant context for downstream operations.
* **Tenant-Scoped Downstream Queries**:
* All downstream database operations on `RecordingSalutation`, `Recording`, and `VoiceCloningModel` must include `{ userId }` or `{ _id, userId }` in query filters.
* Note on `voiceCloningService.update`: Merely passing `userId` as an argument to `update()` is insufficient if the underlying service filter ignores it; query filters must actively enforce `{ _id, userId }`.
* **Crux Failure (-100% on Narrow Correctness)**:
* Executing voice synthesis, audio file generation, or database mutations against unowned cross-tenant records.
### 2. Broader Correctness (System Integrity & Worker Stability)
* The processing loop must catch authorization errors cleanly, preventing unhandled promise rejections or worker crashes during queue polling.
* Database operations on authorized records within the user's own tenant must be executed in proper sequence (authorizing before triggering downstream side effects).
### 2. Broader Correctness (Worker Stability & Lifecycle Tracking)
* **Error Status Tracking Allowance**:
* Marking a failed or unauthorized job as `status: 'error'` or `status: 'failed'` on the requesting job record itself is expected lifecycle logging and is **not** penalized.
* **Premature Processing Deduction (-25% to -50% on Broader Correctness)**:
* Executing audio synthesis or modifying records prior to completing tenant authorization checks.
### 3. Communication & Architectural Analysis
* **Extra Credit / Distinction**: Candidates should receive full credit for identifying and explaining the architectural message-contract boundary—specifically distinguishing between matching ownership among payload-selected resource IDs (`userAudioProfileId`, `recordingId`, `salutationId`) versus verifying the trusted requester identity from the original queue payload.
### 3. Communication (System Analysis & Extra Credit)
* **Message Contract Analysis (Extra Credit)**:
* Identifying and documenting that queue message payloads lack an explicit trusted `userId` field, and explaining how deriving tenant identity via `UserAudioProfile` establishes tenant scoping for downstream record operations.
---
## Heavy Penalty Mapping
* **Crux Failure (-100%)**: Executing synthesis or database writes against unowned cross-tenant records.
* **Major Penalty (-50%)**: Missing `userId` scoping on database operations for valid authorized jobs.
* **Minor Penalty (-25%)**: Premature operations on owned tenant records prior to completing ownership checks.
## Evaluated Call Sites & Verified Code Answers
1. **`voice-cloning-job-handler`**:
* `UserAudioProfileModel.findOne({ _id: payload.userAudioProfileId, userId: payload.userId })`
* `VoiceCloningModel.findOne({ _id: payload.cloningJobId, userId: payload.userId })` or updating with `{ _id: payload.cloningJobId, userId: payload.userId }`
2. **`voice-synthsizer-job-handler`**:
* Initial tenant resolution: `UserAudioProfileModel.findOne({ _id: payload.userAudioProfileId })` -> derives `derivedUserId = profile.userId`
* `RecordingSalutation.findOne({ _id: payload.salutationId, userId: derivedUserId })`
* `Recording.findOne({ _id: payload.recordingId, userId: derivedUserId })`