From 21907f34bc29ba27eb2d7362c47a4a9bf322241d Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Wed, 14 Oct 2026 13:09:10 -0400 Subject: [PATCH] 4th file set and run of pre-trial detectors --- .../detector-answer-obviousness.inputs.json | 10 +-- .../detectors/detector-answer-obviousness.md | 30 +++---- .../detector-broken-dev-env.inputs.json | 10 +-- .../detectors/detector-broken-dev-env.md | 6 +- .../detector-credential-leakage.inputs.json | 10 +-- .../detectors/detector-credential-leakage.md | 2 +- .../detector-cross-task-reference.inputs.json | 10 +-- .../detector-cross-task-reference.md | 2 +- ...ector-dimension-misapplication.inputs.json | 10 +-- .../detector-dimension-misapplication.md | 8 +- ...ector-fact-check-rubric-claims.inputs.json | 10 +-- .../detector-fact-check-rubric-claims.md | 56 +++++------- ...detector-good-response-defined.inputs.json | 10 +-- .../detector-good-response-defined.md | 6 +- ...r-good-response-exhaustiveness.inputs.json | 10 +-- .../detector-good-response-exhaustiveness.md | 6 +- ...detector-offline-verifiability.inputs.json | 10 +-- .../detector-offline-verifiability.md | 4 +- .../detector-over-hinting.inputs.json | 10 +-- .../detectors/detector-over-hinting.md | 18 +--- .../detector-rubric-clarity.inputs.json | 10 +-- .../detectors/detector-rubric-clarity.md | 18 ++-- .../detector-rubric-coverage.inputs.json | 10 +-- .../detectors/detector-rubric-coverage.md | 41 +++++---- .../detector-rubric-form.inputs.json | 10 +-- .../detectors/detector-rubric-form.md | 30 +++---- .../detector-rubric-generality.inputs.json | 10 +-- .../detectors/detector-rubric-generality.md | 2 +- .../detector-snapshot-leakage.inputs.json | 10 +-- .../detectors/detector-snapshot-leakage.md | 2 +- .../instruction.md | 22 ++--- .../tests/atomic-rubric.yaml | 90 ++++++++----------- .../tests/grader-context.md | 33 ++----- .../tests/holistic-rubric.md | 55 ++++-------- 34 files changed, 260 insertions(+), 321 deletions(-) diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.md index cc318887..a1c4f345 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.md @@ -1,6 +1,6 @@ --- detector: detector-answer-obviousness -verdict: over-cued +verdict: partial confidence: HIGH --- # Answer-obviousness check: potion-voice-user-ownership @@ -9,28 +9,28 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## What the prompt asks -The prompt specifies tenant-scoped ownership for both workers and dictates deriving the synthesis tenant from a completed UserAudioProfile before scoping RecordingSalutation and Recording operations. +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. ## Per-expectation assessment -### Cloning scoping — over-cued +### Ownership before side effects — obvious -- **What the rubric requires:** “both VoiceCloning and UserAudioProfile reads and updates must be scoped by userId.” -- **Is it obvious from the prompt?** The prompt already states that all lookups and updates for those two records must verify the payload userId. -- **Verdict for this expectation:** over-cued. +- **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. +- **Verdict for this expectation:** obvious. -### Synthesis scoping — over-cued +### Every query carries userId — not-obvious -- **What the rubric requires:** “userId resolved from UserAudioProfile must be used to scope downstream RecordingSalutation and Recording reads and updates.” -- **Is it obvious from the prompt?** The prompt gives this exact sequence and the same resource names. -- **Verdict for this expectation:** over-cued. +- **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. -### Halt and loop — over-cued +### Polling and architectural distinction — obvious -- **What the rubric requires:** Halt before side effects and continue polling after rejection. -- **Is it obvious from the prompt?** Requirements 2 and 3 state both outcomes directly. -- **Verdict for this expectation:** over-cued. +- **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. +- **Verdict for this expectation:** obvious. ## Overall verdict -The rubric largely scores behavior the prompt spells out. The source still makes execution difficult, but the central choice of what to do is handed to the agent. +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. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.md index 27ca609c..a0d25169 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.md @@ -9,10 +9,10 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Verbatim grounding -> “currently process asynchronous jobs using MongoDB document identifiers supplied in SQS queue payloads without verifying tenant ownership.” +> “A security review identified potential multi-tenant data isolation risks where background job processing may interact with user audio records across different accounts.” -The workspace built, and node --check passed for all shipped JavaScript files. No deterministic test suite is declared by the package manifests. +The workspace build completed and all shipped JavaScript passed node --check. No existing test script is declared. ## Rationale -The unscoped operations are the subject of the task. No unrelated broken build or missing source is evident. There are no reference runs yet to inspect for infrastructure corruption or package drift. +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. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.md index 6139b0df..e94cc459 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.md @@ -9,7 +9,7 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Findings -No environment/workspace.patch exists, so there are no authored patch additions to scan for credentials or checkout paths. +No environment/workspace.patch exists. There are no authored patch additions to inspect for credentials or checkout paths. ## Overall verdict diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.md index 01cb05a3..17841235 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.md @@ -15,4 +15,4 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Rationale -These identify directories in this task's source workspace. Neither the prompt nor holistic rubric points to another graded task. +These are source directories in the current task. The prompt and rubric contain no references to another graded task. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.md index c69e09ab..290ed618 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.md @@ -9,12 +9,12 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Verbatim grounding -> “deduct under Narrow Correctness (Crux penalty).” +> “Narrow Correctness (Core Security & Execution)” -> “Halt Before Side Effects” appears under Broader Correctness. +> “Broader Correctness (System Integrity & Worker Stability)” -> “Message Contract Analysis (Extra Credit)” appears under Communication. +> “Communication & Architectural Analysis” ## Rationale -The rubric charges tenant-scoping failures to task correctness, broader sequencing and loop behavior to software craft, and the optional report about the message contract to Communication. No clause charges mere overconfidence to Integrity or an honest limitation as deception. The exact penalty weights may need alignment with the atomic rubric, but this detector found no clear wrong criterion route. No run grades exist to audit. +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. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.md index 8b9a0e1f..8abc0118 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.md @@ -1,48 +1,40 @@ --- detector: detector-fact-check-rubric-claims -verdict: fail +verdict: partial confidence: HIGH claims: - id: c01 - verdict: "fail" + verdict: "pass" loadBearing: true - summary: "Proposed cloning job lookup is labeled a verified call site" - rubricQuote: "`voiceCloningService.read({ _id, userId, userAudioProfileId })` / `VoiceCloningModel.findOne({ _id, userId, deleted: false })`" - sourceEvidence: "await voiceCloningService.update({ _id, status: 'processing' })" - sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/index.js (lines 100-143)" - note: "No such read occurs in the current handler. The service exports read, but the rubric labels a proposed fix as a verified active call site." - - id: c02 - verdict: "fail" - loadBearing: true - summary: "Passing userId to cloning update is presented as a scoped write" - rubricQuote: "`voiceCloningService.update({ _id, userId, status })` / `VoiceCloningModel.findOneAndUpdate({ _id, userId }, ...)`" + 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); user_audio_profile/user_audio_profile_service.js (lines 65-75)" - note: "Both service update functions hardcode a filter by _id only. Passing userId in data does not scope the write; the rubric must require changing the service filter or using a genuinely scoped update." + 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." + - id: c02 + verdict: "pass" + loadBearing: true + summary: "Synthesis handler derives userId from the profile" + rubricQuote: "The initial `UserAudioProfile` lookup by `_id` resolves `userAudioProfile.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: "Cloning payload supplies userId" - rubricQuote: "Payload supplies `_id` (cloning job ID), `userAudioProfileId`, and `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); voice_cloning/voice_cloning_model.js (lines 5-15)" - note: "The model schema contains userId, so it may be serialized into job._doc, but the current handler does not read it and the SQS producer contract is not shipped." + 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." - id: c04 verdict: "partial" loadBearing: true - summary: "Synthesis payload never supplies direct userId or jobId" - rubricQuote: "Payloads do **not** supply a direct `userId` or synthesis `jobId`." + 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." 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-82, 96-105)" - note: "The handler derives userId from a profile and does not consume a jobId. The producer is absent, so the absolute assertion about every payload is not verified." - - id: c05 - verdict: "partial" - loadBearing: true - summary: "Profile owner is a trusted requester identity" - rubricQuote: "The retrieved `userAudioProfile.userId` establishes the tenant context (`userId`) for all downstream queries." - 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 lookup supplies an owner for record-consistency checks. Without a separately trusted requester or producer guarantee, a payload-selected profile does not authenticate which tenant requested the job." + 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." --- # Fact-check rubric claims: potion-voice-user-ownership @@ -50,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 five load-bearing claims. Two fail against the active source code. Three are only partly supported because the producer contract and authoritative requester are absent from the shipped repository. +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. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.md index 52ffe642..be5241f7 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.md @@ -9,12 +9,12 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Positive target present? -The rubric states specific positive outcomes for scoped cloning reads and updates, scoped synthesis recording reads and updates, authorization before side effects, and stable polling. It also identifies an acceptable error-status update. +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. ## What the grader has to infer -The grader must infer whether profile-derived userId represents an authoritative requester; this is a source-grounding and security-model issue, not absence of a positive target. +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. ## Overall verdict -The rubric gives a concrete affirmative target for the main behaviors. +The rubric gives a positive target for the main security and stability outcomes. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.md index 62fc689f..08096d0a 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.md @@ -9,12 +9,12 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Plausible strong-response approaches -A strong agent could implement the specified record-consistency checks and explain that the queue lacks an independent requester identity. Another defensible response could identify that this prevents confirming the requesting tenant, secure the locally provable checks, and ask for the trusted producer or message contract before claiming complete tenant authorization. +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. ## Coverage in the rubric -The rubric says the profile's userId “establishes the tenant context” and credits reporting that the queue lacks a trusted userId only as extra credit. It does not credit the agent for declining to claim that a profile ID chosen by a queue message authenticates the requester. Matching the ownership of profile, salutation, and recording establishes co-tenancy among records, not the identity of the party requesting the job. +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. ## Overall verdict -The rubric excludes a major reasonable response to the missing trust anchor. No reference runs exist to assess whether this has affected grading yet. +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. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.md index 9e84676d..64dce6b0 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.md @@ -9,8 +9,8 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Findings -The strongest external-sounding requirement concerns SQS, MongoDB, synthesis, and S3. The graded work is the local query filters and order of side effects; clients and model calls can be stubbed to verify those behaviors without a live tenant or bucket. +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. ## Overall verdict -The code task is offline-completable and locally checkable. There is no existing test command, but no new dependency or live service is required by the prompt. +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. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.md index c68c303f..d311cc68 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.md @@ -1,6 +1,6 @@ --- detector: detector-over-hinting -verdict: clear-hinting +verdict: clean confidence: HIGH --- # Over-hinting check: potion-voice-user-ownership @@ -9,20 +9,8 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Findings -### Exact synthesis sequence — prompt-hint (clear) - -- **Where:** instruction.md, Requirement 1. -- **Quote:** “Ensure the worker resolves the owner userId from the completed UserAudioProfile and scopes downstream RecordingSalutation and Recording lookups/updates to that userId.” -- **What it pre-empts:** This is the same sequence and the same call-site inventory the rubric grades. -- **De-hinting option:** State the isolation goal and affected worker, leaving the agent to identify the authoritative tenant relationship and records. - -### Exact cloning targets — prompt-hint (partial) - -- **Where:** instruction.md, Requirement 1. -- **Quote:** “All lookups and updates for VoiceCloning and UserAudioProfile records must verify that the records belong to the requesting userId.” -- **What it pre-empts:** It names the records and filter the rubric checks. -- **De-hinting option:** State the tenant isolation outcome and let the agent enumerate affected lookups and writes. +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. ## Overall verdict -The prompt substantially hands over the graded approach. There is no authored workspace patch with comments to assess. +The prompt leaves the agent to inspect the source, locate failures, and choose an implementation. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-clarity.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-clarity.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-clarity.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-clarity.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-clarity.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-clarity.md index 4d53517b..8f4558b8 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-clarity.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-clarity.md @@ -1,7 +1,7 @@ --- detector: detector-rubric-clarity -verdict: clear -confidence: MEDIUM +verdict: material-issues +confidence: HIGH --- # Rubric-clarity check: potion-voice-user-ownership @@ -9,12 +9,20 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Material ambiguities -None found. The rubric distinguishes cloning from synthesis, names the required query scopes, and states where its crux penalty applies. Its use of “Trust Anchor Resolution” may be substantively wrong, but its intended meaning is clear; the fact-check and exhaustiveness reports assess that issue. +### Universal tenant filter versus bootstrap lookup + +- **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. + +### Numeric penalty target + +- **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. ## Copy-edit issues -None found that interrupts reading. +None found. ## Overall verdict -The current rubric is understandable enough to apply consistently, subject to the source-fact and security-model defects in other reports. +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. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.md index c6532f23..d2b429ea 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.md @@ -13,34 +13,45 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai | Holistic clause | Atomic criterion | Status | | --- | --- | --- | -| Cloning records scoped by userId | scopes-cloning-handler-queries-by-tenant | covered | -| Synthesis recordings scoped by derived userId | scopes-synthesizer-handler-queries-by-tenant | covered | -| Cross-tenant synthesis or updates are a Narrow Correctness crux | two scoping criteria and halts-processing-before-side-effects | partial | -| Halt before synthesis, file rendering, and S3 work | halts-processing-before-side-effects | covered | -| Allowed error status on requesting job | halts-processing-before-side-effects | covered | -| Polling continues after rejection | maintains-worker-polling-loop-stability | covered | -| Extra credit for message-contract report | reports-synthesis-queue-message-contract-limitation | covered | +| 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 | ## Coverage gaps -### Penalty strength and placement drift +### Lifecycle status protection -- **Holistic clause:** “deduct under Narrow Correctness (Crux penalty)” for cross-tenant effects. -- **Closest criterion:** two scoping criteria at crux, plus halts-processing-before-side-effects at certain_dealbreaker under Broader Correctness. -- **What is lost:** One failure can receive a different or heavier charge than the holistic rubric describes, even though a routing note asks to avoid double-penalizing. +- **Holistic clause:** “updating the job record status ... is permitted and expected.” +- **Closest criterion:** None. +- **What is lost:** The atomic rubric does not protect a scoped error-status write from being mistaken for prohibited mutation. + +### Premature owned-record work + +- **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. ## Invented content -The certain_dealbreaker severity on the halt criterion has no distinct matching heavy penalty in the holistic rubric. +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. ## Context integrity -The context document contains the main ground truth but reproduces the false “verified call sites” and profile trust-anchor assumptions noted by fact-check. +The context carries the key service-filter and architectural distinction, but it repeats the unresolved initial profile-lookup exception. ## Crux alignment -The holistic rubric identifies one cross-tenant crux behavior under Narrow Correctness. The atomic rubric uses two crux criteria plus a separate certain-dealbreaker for related behavior, without a precise one-defect allocation. +The cross-tenant crux maps to tenant-isolation-crux. Other penalty mapping is incomplete or malformed because categories are absent. ## Overall verdict -The conversion changes severity and criterion placement for the central failure. +The atomic rubric loses two scoring protections and the extra-credit classification. Its missing categories are also a form failure. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.md index afa61761..fa4608b7 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.md @@ -11,30 +11,30 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml ## Deterministic contract -1. PASS: top-level task string and criteria list exist. -2. PASS: task equals the slug. -3. PASS: five ids are unique kebab-case. -4. PASS: categories use the allowed vocabulary. -5. PASS: severities use the allowed vocabulary and extra credit has none. -6. PASS: exactly two criteria carry crux. -7. FAIL: “Broader Correctness” is not the exact Grading Standard name “Broader Correctness / the craft of software engineering.” -8. FAIL: criteria use guidelines (plural), not the required guideline field; as written, each criterion lacks guideline. -9. PASS: numeric penalty pattern sweeps found no amount in the atomic rubric or context. -10. The skill core skips number 10; no independent check exists. -11. PASS in substance: the authored guideline text uses positive phrasing, although under the wrong key. +1. PASS: top-level task and criteria are present. +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. ## Atomicity and self-containment -The scoping criteria bundle independently failing reads and writes, but these are closely related by one tenant boundary. No separate atomicity failure is asserted beyond the invalid schema. +The criteria are independently judgeable at a broad level. No separate finding. ## Phrasing and answer keys -The intended factual answer keys are bold inline in the guidelines text. The plural field name prevents the schema from receiving them as guidelines. +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. ## Fair-grading findings -The two crux criteria and the certain-dealbreaker for unauthorized side effects overlap. A routing note says not to double-penalize, but the criteria still leave unclear which severity to apply to a single unscoped update. +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. ## Overall verdict -The invalid dimension and plural guidelines key break the deterministic contract. The overlapping severities merit a tighter allocation. +Missing categories and the invalid dimension break the schema. The extra-credit criterion, answer-key formatting, and bootstrap-lookup conflict need correction. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.md index 2c48228c..67d1cf61 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.md @@ -21,4 +21,4 @@ None found. ## Overall verdict -The rubric states general response qualities and does not rely on reference-run outcomes or name the evaluation framework. +The rubric describes general response properties without relying on observed runs or naming the evaluation framework. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.inputs.json index b5b53e35..ced7233c 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T17:02:29.562Z", + "capturedAt": "2026-10-14T17:07:20.558Z", "capturedBy": "stamp", "inputs": { - "prompt": "a638af9fd3e8054a67f3ad6c22681cbd6d5ce96229553a6b642230ed267ecd2f", + "prompt": "0f617ee18239215a5484685ab3e6773b0b7a783a11ab76a2e1344ec39ddc083f", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "228d7edc8ca0b468d3aacf66e4b56a6b6e5d054bafd78d6d379ac17342bb37e7", - "atomicRubric": "639221adafe13992363ef0cb56b54cc55b7162956fb35f10a227d7af7f680c6e", + "holisticRubric": "88db1ac3ab4a4aa21e8b543c0f47fd9b6047182ca14a76ec76dd02f658c609f4", + "atomicRubric": "bdfe9d157bdaf8691f9f1ad0e324f9acab45bade00bca8a44af46ecce70c09ec", "rubricsYaml": null, - "graderContext": "745525f6e186d769a420edfce89563aa2ae905ec61a023af1a0d6d41fc29d812" + "graderContext": "b70d321d0f873d90f37f230aadcef364a4116651697075ef1cdcfebba59eb784" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.md index d602ba0f..79052dbc 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.md @@ -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 from which an answer could leak. +This manual task has no injected conversation to compare with the rubric. ## Snapshot hygiene (advisory) diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/instruction.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/instruction.md index 143b5f52..710cc31c 100755 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/instruction.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/instruction.md @@ -1,17 +1,9 @@ -# Enforce Multi-Tenant Data Isolation in Background Workers +# Audit Multi-Tenant Security in Voice Background Workers -Our backend background workers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) currently process asynchronous jobs using MongoDB document identifiers supplied in SQS queue payloads without verifying tenant ownership. +## 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. -### Requirements - -1. **Audit & Scope Database Queries**: - - Refactor database operations across both worker handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) and their associated services (`user_audio_profile_service`, `voice_cloning_service`, `job_service`, `salutation_service`) to ensure that reads and updates verify tenant ownership. - - For `voice-cloning-job-handler`, payloads include a `userId`. All lookups and updates for `VoiceCloning` and `UserAudioProfile` records must verify that the records belong to the requesting `userId`. - - For `voice-synthsizer-job-handler`, SQS payloads supply resource identifiers (`userAudioProfileId`, `recordingId`, `salutationId`). Ensure the worker resolves the owner `userId` from the completed `UserAudioProfile` and scopes downstream `RecordingSalutation` and `Recording` lookups/updates to that `userId`. - -2. **Halt Unauthorized Operations**: - - If a record does not exist or tenant authorization fails, the worker must halt processing before performing voice synthesis, file system operations, or downstream record mutations. - - Updating job/status tracking records to reflect an error state (e.g., `status: 'error'` or `'failed'`) for lifecycle tracking is acceptable, but no unowned profile or recording data may be read or mutated. - -3. **Maintain Worker Loop Stability**: - - Ensure that rejected or unauthorized jobs do not cause uncaught exceptions that crash the background worker polling loop. +## 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. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml index 7a6cc4a7..fd883802 100755 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml @@ -1,56 +1,38 @@ task: potion-voice-user-ownership criteria: -- id: scopes-cloning-handler-queries-by-tenant - category: primary_intent - severity: crux - dimensions: - - Narrow Correctness - call_site_key: voice_cloning_handler_tenant_scope - guidelines: 'The response should enforce tenant isolation in the voice cloning handler - by including userId in all VoiceCloning and UserAudioProfile lookups and updates. - Crux failure if cloning queries operate without userId filtering. Answer key: - **voiceCloningService.read({ _id, userId, userAudioProfileId }) and userAudioProfileService.read({ - _id: userAudioProfileId, userId })**' -- id: scopes-synthesizer-handler-queries-by-tenant - category: primary_intent - severity: crux - dimensions: - - Narrow Correctness - call_site_key: synthesizer_handler_tenant_scope - guidelines: 'The response should enforce tenant isolation in the speech synthesizer - handler by using the userId retrieved from UserAudioProfile to scope downstream - RecordingSalutation and Recording lookups and updates. Crux failure if synthesis - or updates run on unowned cross-tenant records. Answer key: **recordingSalutationModel.findOne({ - _id: salutationId, userId, deleted: false }) and recordingModel.findOne({ _id: - recordingId, userId, deleted: false })**' -- id: halts-processing-before-side-effects - category: primary_intent - severity: certain_dealbreaker - dimensions: - - Broader Correctness - call_site_key: halt_before_side_effects - guidelines: 'The response should ensure background worker processing halts immediately - if tenant authorization fails, preventing ML synthesis scripts or S3 file uploads - from running on unauthorized jobs. Setting status to error/failed on the requesting - job record is allowed. Routing note: Do not double-penalize if already penalized - under crux tenant scoping. Answer key: **if (!cloningRecord || !audioProfile) - throw new Error(''Unauthorized'')**' -- id: maintains-worker-polling-loop-stability - category: primary_intent - severity: possible_dealbreaker - dimensions: - - Broader Correctness - call_site_key: worker_polling_loop_stability - guidelines: 'The response should ensure that authorization rejections or missing - tenant records are caught gracefully so the background worker polling loop continues - processing subsequent queue messages without crashing. Answer key: **catch (error) - block logs error and resolves/continues polling loop**' -- id: reports-synthesis-queue-message-contract-limitation - category: extra_credit - dimensions: - - Communication - call_site_key: synthesis_message_contract_analysis - guidelines: 'The response should receive extra credit if it notes that SQS synthesis - payloads lack an explicit trusted userId field, explaining that tenant identity - is derived from the UserAudioProfile lookup. Answer key: **Explicit analysis noting - SQS synthesis messages carry userAudioProfileId rather than explicit userId**' + - 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. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/grader-context.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/grader-context.md index 487d4dd5..07f2238e 100755 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/grader-context.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/grader-context.md @@ -1,27 +1,10 @@ -# Grader Context: potion-voice-user-ownership +# Grader Context & Reference Answer Key -## Domain & Codebase Overview -This task evaluates multi-tenant security in the Potion voice background processing tier (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`). +## Background & Architecture +This task evaluates multi-tenant security enforcement in background worker queues (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`). -## Verified Database Models & Handler Call Sites - -### Voice Cloning Worker (`voice-cloning-job-handler/index.js`) -- Payload provides `_id`, `userAudioProfileId`, `userId`. -- Verified service calls: - - `voiceCloningService.read({ _id, userId, userAudioProfileId })` - - `userAudioProfileService.read({ _id: userAudioProfileId, userId })` - - `voiceCloningService.update({ _id, userId, status })` - - `userAudioProfileService.update({ _id: userAudioProfileId, userId, status })` - -### Speech Synthesizer Worker (`voice-synthsizer-job-handler/index.js`) -- Payload provides `userAudioProfileId`, `recordingId`, `salutationId`. (Does NOT supply direct `userId` or `jobId`). -- Trust Anchor: `UserAudioProfileModel.findOne({ _id: userAudioProfileId, status: 'completed' })` resolves `userId`. -- Verified model calls using derived `userId`: - - `recordingSalutationModel.findOne({ _id: salutationId, userId, deleted: false })` - - `recordingModel.findOne({ _id: recordingId, userId, deleted: false })` - - `recordingSalutationModel.findOneAndUpdate({ _id: salutationId, userId, deleted: false }, ...)` - -## Evaluation Guidelines -1. **Crux Penalty**: Deduct under Narrow Correctness if an agent fails to scope reads and updates by `userId` or allows synthesis to run on unowned cross-tenant records. -2. **Lifecycle Status Logging**: Updating job/status records to `'error'` or `'failed'` for error tracking is valid and not penalized. -3. **Extra Credit**: Award extra credit under Communication for reporting that synthesis queue payloads lack a direct trusted `userId`. +## 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. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md index 6e06ffeb..ea889bc7 100755 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md @@ -1,45 +1,28 @@ -# Holistic Evaluation Rubric: potion-voice-user-ownership +# Holistic Evaluation Rubric: Voice Worker Multi-Tenant Isolation -## Overview -This task evaluates an agent's ability to audit asynchronous background workers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) and enforce multi-tenant authorization boundaries on database operations. +## 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`). --- -## Verified Codebase Facts & Call Sites +## Grading Dimensions & Expectations -### 1. Voice Cloning Handler (`voice-cloning-job-handler/index.js`) -- **SQS Payload Context**: Payload supplies `_id` (cloning job ID), `userAudioProfileId`, and `userId`. -- **Verified Call Sites**: - - `voiceCloningService.read({ _id, userId, userAudioProfileId })` / `VoiceCloningModel.findOne({ _id, userId, deleted: false })` - - `userAudioProfileService.read({ _id: userAudioProfileId, userId })` / `UserAudioProfileModel.findOne({ _id: userAudioProfileId, userId, deleted: false })` - - `voiceCloningService.update({ _id, userId, status })` / `VoiceCloningModel.findOneAndUpdate({ _id, userId }, ...)` - - `userAudioProfileService.update({ _id: userAudioProfileId, userId, status, ... })` / `UserAudioProfileModel.findOneAndUpdate({ _id: userAudioProfileId, userId }, ...)` +### 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. -### 2. Speech Synthesizer Handler (`voice-synthsizer-job-handler/index.js`) -- **SQS Payload Context**: Payload supplies `userAudioProfileId`, `recordingId`, and `salutationId`. Payloads do **not** supply a direct `userId` or synthesis `jobId`. -- **Trust Anchor Resolution**: - - Initial lookup reads `UserAudioProfile` by `_id: userAudioProfileId` with `status: 'completed'`. - - The retrieved `userAudioProfile.userId` establishes the tenant context (`userId`) for all downstream queries. -- **Verified Call Sites**: - - `userAudioProfileService.read({ _id: userAudioProfileId, status: 'completed' })` / `UserAudioProfileModel.findOne({ _id: userAudioProfileId, deleted: false })` - - `recordingSalutationModel.findOne({ _id: salutationId, userId, deleted: false })` - - `recordingModel.findOne({ _id: recordingId, userId, deleted: false })` - - `recordingSalutationModel.findOneAndUpdate({ _id: salutationId, userId, deleted: false }, ...)` +### 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). + +### 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. --- -## Grading Standards & Evaluation Criteria - -### Narrow Correctness -- **Tenant-Scoped Lookups and Updates**: - - In `voice-cloning-job-handler`, both `VoiceCloning` and `UserAudioProfile` reads and updates must be scoped by `userId`. - - In `voice-synthsizer-job-handler`, `userId` resolved from `UserAudioProfile` must be used to scope downstream `RecordingSalutation` and `Recording` reads and updates. - - **Crux Failure**: If the worker executes voice synthesis, file generation, or database updates against records belonging to a different tenant without scoping by `userId`, deduct under **Narrow Correctness** (Crux penalty). - - *Note on Status Updates*: Updating status to `'error'` or `'failed'` on the requesting job record itself for error logging when authorization fails is expected and MUST NOT be penalized. - -### Broader Correctness -- **Halt Before Side Effects**: Processing must halt immediately if authorization or tenant record lookup fails. Synthesis scripts, audio file rendering, or S3 uploads must not execute for unowned records. -- **Worker Loop Resilience**: An authorization rejection or missing tenant record must be handled gracefully (e.g., throwing a caught error or returning) without crashing the main PM2 polling loop. - -### Communication & Extra Credit -- **Message Contract Analysis (Extra Credit)**: Candidate agents earn extra credit under **Communication** if they identify and report the architectural message-contract limitation (that SQS synthesis queue messages lack an explicit trusted `userId` field and rely on `UserAudioProfile` to anchor tenant identity). +## 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.