diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.inputs.json index dbf4721d..506cafa1 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-14T19:46:11.531Z", + "capturedAt": "2026-10-14T19:55:51.138Z", "capturedBy": "stamp", "inputs": { - "prompt": "e5a73f8bf200424137a9d965478d3f327249a0c634401bcf29a9eae57c44f9c5", + "prompt": "2ba0edbffb417a1f200b113d1197ccb0e68d6a5ac6aa732e4c94faf554ceaad7", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "cd72b3a3734588a3a9b2caf7164c77b06265c18e709f08d508c7257b2b87f1da", - "atomicRubric": "9f40ecfe36754f1d0c940eb203dab7494035f6b8aa2d12f26d8a437c190181b8", + "holisticRubric": "97545c66b57f59a4810ccffc06658fb9e1b49dccf8ca14bda4242b4ed5a5d1c7", + "atomicRubric": "a6715ef6b8c360cdc2c58b2081717196fbde6d43c3638ed71263bb1f6fcc0bd2", "rubricsYaml": null, - "graderContext": "d892e9cdb09122698e1473f377d4c2802c785cfc485de981d17a5e85185c0a21" + "graderContext": "780c5648cbb3fd098e9c88a639b156882ea5c55d02f222e7c430a777d1793556" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.md index 427ee210..1086d1fa 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.md @@ -9,7 +9,7 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and ## Load-bearing targets -- **Tenant-source and filter isolation:** The Narrow Correctness section requires tenant scoping on cloning and synthesis operations, with the synthesizer's initial profile lookup resolving tenant context. The relevant identifier slots are blank in this revision. +- **Tenant-source and filter isolation:** The Narrow Correctness section requires `userId` scoping on `VoiceCloning` and `UserAudioProfile` operations in cloning, and on `RecordingSalutation` and `Recording` operations downstream of the synthesizer's initial profile lookup. - **Stop unauthorized downstream work:** The Narrow Correctness section calls halting audio generation or database updates after failed ownership validation its Crux requirement and applies a heavy penalty to the overall score. - **Worker resilience:** The Broader Correctness section requires polling loops to survive message-processing exceptions. @@ -53,7 +53,7 @@ The original rewards span 0.62–0.73. They were graded against an earlier holis - **Fired in:** 3/4 original grades; the 0.73 original grade does not mention it. - **What the agent actually wrote:** The 0.66 final response says, “Referenced records are authorized before processing.” A preflight read does not establish that a later scoped update still matched. - **Real-world consequence if the agent is wrong:** File and audio work can continue after a later ownership failure. The 0.66 grade reports the mocked download, and the 0.62 grade reports directory creation and another update before a failed processing update. -- **Verdict for this deduction:** `meaningful`. It directly violates the task's stop condition. The current Crux penalty has an overall-score target, although the missing identifiers remain a separate clarity issue. +- **Verdict for this deduction:** `meaningful`. It directly violates the task's stop condition. The current Crux penalty has an overall-score target. ### Missing baseline-payload verification — meaningful @@ -69,9 +69,9 @@ The old grades also discuss acknowledgment before database success and, in one r ### Unauthorized effects after ownership failure — holds -- **Guidance says:** “The implementation must prevent unauthorized side effects, halting speech synthesis audio rendering and database updates whenever tenant validation fails or records do not match tenant context.” The source then says failure “applies a heavy penalty to the overall score.” +- **Guidance says:** “When tenant ownership checks fail or records do not match `userId`, the handler must halt immediately before triggering audio rendering or mutating database records.” The Crux rule says failure “applies a heavy penalty to the overall score.” - **Reachability / evidence / proportionality:** Both workers perform model writes and audio work after record lookups. The 0.62 and 0.66 grades describe concrete later side effects after scoped-update failures. Preventing cross-tenant effects is a proportionate core security requirement. -- **Call:** The consequence is real, and a heavy penalty for actual cross-tenant rendering or writes is proportionate. The current blank identifiers create a separate clarity and coverage defect. +- **Call:** The consequence is real, and a heavy penalty for actual cross-tenant rendering or writes is proportionate. The restored handler and field names make the rule concrete. The tenant-source compatibility target and polling-loop resilience target have plausible stakes. The former manifested in every run; the latter was met. @@ -79,4 +79,4 @@ The tenant-source compatibility target and polling-loop resilience target have p The current rubric targets a real compatibility regression and a real ownership-stop gap. The first appears in all four reference runs, and the second in three original grades. The shipped baseline and reproduced run checks support their consequences. The new protection for inherited SQS acknowledgment removes the mixed-deduction reason for the earlier `partial` verdict. -The verdict is `meaningful` with medium confidence because the four reference grades were produced under an earlier holistic revision. They support elicitation and impact, but they do not show how graders would apply the current wording with missing identifiers to those same responses. +The verdict is `meaningful` with medium confidence because the four reference grades were produced under an earlier holistic revision. They support elicitation and impact, but they do not show how graders would apply the current wording to those same responses. 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 dbf4721d..506cafa1 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-14T19:46:11.531Z", + "capturedAt": "2026-10-14T19:55:51.138Z", "capturedBy": "stamp", "inputs": { - "prompt": "e5a73f8bf200424137a9d965478d3f327249a0c634401bcf29a9eae57c44f9c5", + "prompt": "2ba0edbffb417a1f200b113d1197ccb0e68d6a5ac6aa732e4c94faf554ceaad7", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "cd72b3a3734588a3a9b2caf7164c77b06265c18e709f08d508c7257b2b87f1da", - "atomicRubric": "9f40ecfe36754f1d0c940eb203dab7494035f6b8aa2d12f26d8a437c190181b8", + "holisticRubric": "97545c66b57f59a4810ccffc06658fb9e1b49dccf8ca14bda4242b4ed5a5d1c7", + "atomicRubric": "a6715ef6b8c360cdc2c58b2081717196fbde6d43c3638ed71263bb1f6fcc0bd2", "rubricsYaml": null, - "graderContext": "d892e9cdb09122698e1473f377d4c2802c785cfc485de981d17a5e85185c0a21" + "graderContext": "780c5648cbb3fd098e9c88a639b156882ea5c55d02f222e7c430a777d1793556" } } 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 5e5fa3a7..a0bf91c3 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,6 +1,6 @@ --- detector: detector-rubric-clarity -verdict: material-issues +verdict: clear confidence: HIGH --- # Rubric-clarity check: potion-voice-user-ownership @@ -9,22 +9,14 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Material ambiguities -### Missing identifiers in the tenant-scoping rules +None found. The handler, model, tenant-field, record-field, and initial-lookup identifiers are restored. The Crux rule names the failed-ownership trigger and the overall-score penalty target. The routing note distinguishes omitted query filters from downstream side-effect execution. -- **Where:** Narrow Correctness says, “All database reads and updates in must filter by in addition to record .” It also says, “All downstream database reads and updates to and in must be scoped by the profile-derived .” -- **Why it's ambiguous:** The handler, model, tenant-field, and record-field names have vanished. One grader could credit any tenant predicate in either worker; another could require the specific handlers and fields evident elsewhere in the task package. The source rubric no longer defines that boundary. -- **Grade evidence:** All four original grades discuss userId and specific handlers, but they were produced under an earlier holistic revision. They cannot settle how the current blank clauses would be applied. - -### Missing identifiers in the profile-lookup exemption - -- **Where:** The allowed-behaviors section says, “Performing an initial lookup on by to resolve and establish tenant context is necessary and must not be penalized for omitting .” -- **Why it's ambiguous:** The model, lookup key, resolved field, and exempted predicate are blank. A grader cannot tell which initial lookup is protected or where the exemption ends. That can change whether the initial query earns a deduction. -- **Grade evidence:** The original grades discuss profile-derived ownership, but predate this revision and do not interpret the blank exemption. +The four captured grades were reviewed. They were produced under an earlier holistic revision, so they do not establish how graders would apply this revision; they do not expose a competing reading of its current wording. ## Copy-edit issues -- Empty inline slots interrupt multiple load-bearing sentences, including the isolation rules and initial-lookup exemption quoted above. These appear to be lost identifiers rather than intentional prose. +None found. ## Overall verdict -The Crux penalty now has a clear overall-score target, resolving the previous scoring-target finding. The missing identifiers make several core pass/fail rules materially ambiguous and leave the document visibly incomplete. +The current prose is readable and gives concrete pass/fail boundaries for tenant scoping, ownership-stop behavior, worker resilience, and inherited SQS acknowledgment. The earlier blank-identifier finding is resolved. 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 dbf4721d..506cafa1 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-14T19:46:11.531Z", + "capturedAt": "2026-10-14T19:55:51.138Z", "capturedBy": "stamp", "inputs": { - "prompt": "e5a73f8bf200424137a9d965478d3f327249a0c634401bcf29a9eae57c44f9c5", + "prompt": "2ba0edbffb417a1f200b113d1197ccb0e68d6a5ac6aa732e4c94faf554ceaad7", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "cd72b3a3734588a3a9b2caf7164c77b06265c18e709f08d508c7257b2b87f1da", - "atomicRubric": "9f40ecfe36754f1d0c940eb203dab7494035f6b8aa2d12f26d8a437c190181b8", + "holisticRubric": "97545c66b57f59a4810ccffc06658fb9e1b49dccf8ca14bda4242b4ed5a5d1c7", + "atomicRubric": "a6715ef6b8c360cdc2c58b2081717196fbde6d43c3638ed71263bb1f6fcc0bd2", "rubricsYaml": null, - "graderContext": "d892e9cdb09122698e1473f377d4c2802c785cfc485de981d17a5e85185c0a21" + "graderContext": "780c5648cbb3fd098e9c88a639b156882ea5c55d02f222e7c430a777d1793556" } } 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 90ea6d8a..0350e63c 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 @@ -1,7 +1,7 @@ --- detector: detector-rubric-coverage verdict: material-issues -confidence: HIGH +confidence: MEDIUM --- # Rubric-coverage check: potion-voice-user-ownership @@ -11,37 +11,37 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai | Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status | | --- | --- | --- | -| “All database reads and updates in must filter by in addition to record .” | cloning-tenant-isolation | partial | -| “All downstream database reads and updates to and in must be scoped by the profile-derived .” | synthesis-tenant-isolation-queries-updates | partial | -| “halting speech synthesis audio rendering and database updates whenever tenant validation fails” | prevent-unauthorized-side-effects | covered | +| “All queries and database updates in `voice-cloning-job-handler` ... filter by `userId` in addition to document `_id`” | cloning-tenant-isolation | covered | +| “initial `UserAudioProfile` lookup ... is valid to resolve `userId`” | initial-profile-tenant-resolution | covered | +| “All downstream reads and updates on `RecordingSalutation` and `Recording` ... filter by `userId`” | synthesis-tenant-isolation-queries-updates | covered | +| “halt immediately before triggering audio rendering or mutating database records” | prevent-unauthorized-side-effects | covered | | “applies a heavy penalty to the overall score” | prevent-unauthorized-side-effects | covered | -| “initial lookup on by to resolve ... must not be penalized for omitting .” | initial-profile-tenant-resolution | partial | -| “Standard SQS message deletion and acknowledgment behavior ... must not be penalized” | worker-loop-crash-prevention elaboration | covered | -| “caught gracefully in a try-catch block” | worker-loop-crash-prevention | covered | -| “accurately describe the multi-tenant isolation logic” | refactor-summary-accuracy | covered | +| “Do not double-charge single defects” | routing note in prevent-unauthorized-side-effects elaboration | partial | +| “wrapped in `try-catch` blocks ... without crashing ... polling loop” | worker-loop-crash-prevention | covered | +| “SQS message deletion and acknowledgment ... must not be penalized” | worker-loop-crash-prevention elaboration | covered | +| “summary or inline code comments must accurately reflect” | refactor-summary-accuracy | covered | ## Coverage gaps -### Tenant-scoping and initial-lookup clauses are underspecified in the source +### Count-once protection is not explicit in the atomic rubric -- **Holistic clause:** The three Narrow Correctness clauses quoted as partial above contain blank slots where handler names, models, and fields should be. -- **Closest criterion:** cloning-tenant-isolation, synthesis-tenant-isolation-queries-updates, and initial-profile-tenant-resolution provide specific names. -- **What is lost:** The atomic rubric can penalize a response for missing particular model and field predicates that the holistic rubric and grader context do not name. Restore the source facts, then recheck the conversion. +- **Holistic clause:** The Narrow Correctness routing note ends, “Do not double-charge single defects.” +- **Closest criterion:** The prevent-unauthorized-side-effects elaboration says, “Charge query syntax omissions under cloning-tenant-isolation or synthesis-tenant-isolation-queries-updates; charge side-effect execution under this criterion.” +- **What is lost:** That sentence routes two failure types but does not state what happens when one missing tenant predicate is itself the reason an unowned record is mutated. An atomic grader could charge both the query criterion and the Crux criterion for that one defect, while the holistic rubric explicitly forbids double-charging it. +- **Suggested criterion:** Add the holistic count-once instruction to the routing elaboration, preserving separate charges only for distinct defects. ## Invented content -### Specific answer keys have no counterpart in the current source documents - -The cloning criterion says, “All **database reads** and **updates** in **voice-cloning-job-handler** must filter by **userId** in addition to record **_id**.” The synthesis criterion names **RecordingSalutation**, **Recording**, **voice-synthsizer-job-handler**, and **userId**; the initial-profile criterion names **UserAudioProfile** and **_id**. The holistic rubric and grader context were checked for these identifiers; their corresponding slots are blank. These facts may be correct against the workspace, but the current source documents do not support their scoring specificity. +None found. The restored holistic rubric and grader context support the handler, model, and field names used in the atomic answer keys. ## Context integrity -The holistic rubric has no separate context sections to extract. The grader context's Handler & Model Ground Truth section has blank handler, model, queue-field, and tenant-field entries, including “1. ****: - Mongoose model: .” It does not preserve the factual context behind the atomic answer keys. The atomic guidelines contain many of these facts, so they remain individually judgeable, but the two rubric forms no longer carry equivalent ground truth. +The Evaluation Overview's handler and purpose facts survive in the grader context's architecture section. The tenant-source, model, ownership-stop, and SQS acknowledgment facts are present there or in the criteria. No needed ground-truth fact is missing from both. ## Crux alignment -The holistic Side-Effect Prevention clause explicitly applies a heavy penalty to the overall score. prevent-unauthorized-side-effects is the one atomic crux criterion and encodes that penalty. There is no Crux mismatch on this revision. +The holistic Side-Effect Prevention rule applies a heavy penalty to the overall score. The atomic prevent-unauthorized-side-effects criterion carries severity crux. No other holistic overall-score penalty or atomic Crux exists. ## Overall verdict -The main scoring behavior, protection for inherited SQS acknowledgment, and Crux penalty map to atomic criteria. The lost identifiers in both the holistic rubric and grader context make the atomic answer keys unsupported by those documents and create a material mismatch. +The source and atomic rubrics now agree on the substantive isolation targets and Crux severity. The remaining material gap is the source's explicit protection against charging a single defect twice; the atomic routing note does not fully preserve it. 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 dbf4721d..506cafa1 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-14T19:46:11.531Z", + "capturedAt": "2026-10-14T19:55:51.138Z", "capturedBy": "stamp", "inputs": { - "prompt": "e5a73f8bf200424137a9d965478d3f327249a0c634401bcf29a9eae57c44f9c5", + "prompt": "2ba0edbffb417a1f200b113d1197ccb0e68d6a5ac6aa732e4c94faf554ceaad7", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "cd72b3a3734588a3a9b2caf7164c77b06265c18e709f08d508c7257b2b87f1da", - "atomicRubric": "9f40ecfe36754f1d0c940eb203dab7494035f6b8aa2d12f26d8a437c190181b8", + "holisticRubric": "97545c66b57f59a4810ccffc06658fb9e1b49dccf8ca14bda4242b4ed5a5d1c7", + "atomicRubric": "a6715ef6b8c360cdc2c58b2081717196fbde6d43c3638ed71263bb1f6fcc0bd2", "rubricsYaml": null, - "graderContext": "d892e9cdb09122698e1473f377d4c2802c785cfc485de981d17a5e85185c0a21" + "graderContext": "780c5648cbb3fd098e9c88a639b156882ea5c55d02f222e7c430a777d1793556" } } 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 43a1d173..64cc46e3 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 @@ -19,7 +19,7 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml and 8. Guidelines are nonempty: pass. 9. Numeric-penalty pattern sweeps over the atomic rubric and grader context: pass; no candidates matched. 10. The detector contract defines no check numbered 10. -11. Positive-phrasing pattern sweep over guidelines: pass; no negated-requirement candidates matched. +11. Positive-phrasing pattern sweep over guidelines: pass. The phrase “records do not match” appears in the stop-condition criterion, but describes the failing ownership condition rather than phrasing the requirement negatively. ## Atomicity and self-containment @@ -34,10 +34,17 @@ None found. The handler-specific query criteria and stop-condition criterion eac - **Why:** The key facts are inline and readable, but the full factual relationship is plain text. This is a formatting issue rather than a missing answer key. - **Suggested rewrite:** Bold the full answer-key sentence in each factual guideline. +### Crux scoring direction is repeated inside the guideline + +- **Criterion:** prevent-unauthorized-side-effects. +- **Where:** “Failing this crux criterion applies a **heavy penalty** to the **overall score**.” The elaboration repeats the same direction. +- **Why:** This is grading machinery rather than part of the response behavior or factual answer key. The crux severity and elaboration already carry it, so the repetition adds clutter without changing the requirement. +- **Suggested rewrite:** Keep the stop-condition requirement and factual key in the guideline; keep the grading note in the elaboration. + ## Fair-grading findings -None found. The previous standalone acknowledgment-permission criterion has been removed. The blank identifiers in grader-context.md are a source-context problem covered by the coverage detector; the atomic guidelines themselves supply the facts needed to judge each criterion. +None found. The previous standalone acknowledgment-permission criterion has been removed, and the restored grader context and atomic guidelines supply the facts needed to judge each criterion. ## Overall verdict -The six-criterion file passes the deterministic checks and remains independently judgeable. Partial answer-key bolding is a minor judgment-layer issue. This verdict does not clear the missing source facts found by the coverage detector. +The six-criterion file passes the deterministic checks and remains independently judgeable. Partial answer-key bolding and a repeated Crux instruction are minor judgment-layer issues. The coverage detector separately assesses whether the count-once protection survives conversion. 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 553c7d40..ff98a50e 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,20 @@ -# Multi-Tenant Data Isolation Audit: Voice Cloning & Speech Synthesis Workers +# Refactor Voice Synthesis & Cloning Handlers for Multi-Tenant Data Isolation -## Background & Architecture -Our backend asynchronous processing pipeline processes voice cloning and speech synthesis jobs via AWS SQS message queues and MongoDB (). -Currently, background workers retrieve database entries using only a document identifier () provided in the queue message payload without verifying that the record belongs to the requesting tenant (). +## Overview +Our backend processing pipeline handles voice cloning and speech synthesis jobs via background queue consumers. Currently, these handlers query database records using only document identifiers (`_id`) passed in SQS message payloads, without validating that the requested records belong to the requesting user (`userId`). -## Task Requirements +You must audit and refactor the background job handlers in `voice-cloning-job-handler` and `voice-synthsizer-job-handler` to enforce strict tenant data isolation. -1. **Audit & Refactor Database Operations**: - - Update all database queries and updates in and to enforce strict multi-tenant isolation. - - Ensure every query filters by in addition to the record identifier (), resolving from the initial lookup where appropriate. +## Objectives +1. **Enforce Tenant Isolation in Voice Cloning Handler**: + - Update all database queries and updates in `voice-cloning-job-handler` on `VoiceCloning` and `UserAudioProfile` models to include `userId` scoping alongside record `_id`. -2. **Side-Effect Prevention**: - - Halt execution—preventing downstream audio rendering or database updates—whenever tenant ownership checks fail or records do not match the expected tenant context. +2. **Enforce Tenant Isolation in Speech Synthesis Handler**: + - In `voice-synthsizer-job-handler`, use the `userAudioProfileId` from the job payload to look up the target `UserAudioProfile` record by `_id` to establish the authenticated `userId` context. + - Scope all downstream database queries and updates on `RecordingSalutation` and `Recording` models by `userId`. -3. **Worker Loop Resilience**: - - Ensure exceptions during job processing are caught gracefully so background worker polling loops remain active and stable. +3. **Prevent Unauthorized Side Effects**: + - If tenant validation fails or record ownership does not match `userId`, halt execution immediately before performing audio synthesis rendering or database mutations. + +4. **Maintain Worker Loop Stability**: + - Ensure exceptions during job processing are caught in a `try-catch` block so worker polling loops do not crash. 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 879e6524..b4ff5f67 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 @@ -6,76 +6,45 @@ criteria: - Narrow Correctness severity: certain_dealbreaker call_site_key: voice-cloning-job-handler - guideline: The response should enforce tenant isolation using userId on all VoiceCloning - and UserAudioProfile queries and updates in the voice cloning handler. **Answer - key:** All **database reads** and **updates** in **voice-cloning-job-handler** - must filter by **userId** in addition to record **_id**. - elaboration: Verifies that voice cloning queries and updates incorporate userId - to prevent unauthorized cross-tenant operations. + guideline: The response should enforce tenant isolation using userId on all VoiceCloning and UserAudioProfile queries and updates in voice-cloning-job-handler. **Answer key:** All **database reads** and **updates** in **voice-cloning-job-handler** on **VoiceCloning** and **UserAudioProfile** must filter by **userId** in addition to record **_id**. + elaboration: Verifies that voice cloning queries and updates incorporate userId to prevent unauthorized cross-tenant operations. - id: synthesis-tenant-isolation-queries-updates category: primary_intent dimensions: - Narrow Correctness severity: certain_dealbreaker call_site_key: voice-synthsizer-job-handler - guideline: The response should scope all synthesis queries and database updates - by tenant identity (userId) across RecordingSalutation and Recording records. - **Answer key:** Downstream **reads** and **updates** to **RecordingSalutation** - and **Recording** in **voice-synthsizer-job-handler** must be scoped by the profile-derived - **userId**. - elaboration: Ensures that downstream queries and database updates in the speech - synthesis handler enforce tenant isolation using userId. + guideline: The response should scope all synthesis queries and database updates by tenant identity (userId) across RecordingSalutation and Recording records in voice-synthsizer-job-handler. **Answer key:** Downstream **reads** and **updates** to **RecordingSalutation** and **Recording** in **voice-synthsizer-job-handler** must be scoped by the profile-derived **userId**. + elaboration: Ensures that both queries and database updates in the speech synthesis handler enforce tenant isolation using userId. - id: prevent-unauthorized-side-effects category: primary_intent dimensions: - Narrow Correctness severity: crux call_site_key: voice-synthsizer-job-handler - guideline: The response should prevent unauthorized side effects, including audio - generation and database mutations across both voice cloning and speech synthesis - handlers, when tenant validation fails or records do not match tenant context. - **Answer key:** Synthesis **audio generation** and **database mutations** must - be halted if **tenant ownership checks** fail. - elaboration: 'Guarantees that unauthorized jobs do not trigger audio rendering or - database updates when tenant ownership checks fail. Routing note: Charge query - syntax omissions under cloning-tenant-isolation or synthesis-tenant-isolation-queries-updates; - charge side-effect execution under this criterion. Failing this crux criterion - applies a heavy penalty to the overall score.' + guideline: The response should prevent unauthorized side effects, including audio rendering and database mutations in voice-cloning-job-handler and voice-synthsizer-job-handler, when tenant validation fails or records do not match userId context. **Answer key:** Synthesis **audio rendering** and **database mutations** must be halted if **userId tenant ownership checks** fail. Failing this crux criterion applies a **heavy penalty** to the **overall score**. + elaboration: 'Routing note: Charge query syntax omissions under cloning-tenant-isolation or synthesis-tenant-isolation-queries-updates; charge side-effect execution under this criterion. Failing this crux criterion applies a heavy penalty to the overall score.' - id: initial-profile-tenant-resolution category: dodged_bullet dimensions: - Narrow Correctness severity: possible_dealbreaker call_site_key: voice-synthsizer-job-handler - guideline: 'The response should allow the initial UserAudioProfile lookup by _id: - userAudioProfileId as a valid tenant-resolution step without requiring userId - in that initial query. **Answer key:** The initial lookup on **UserAudioProfile** - by **_id** is necessary to resolve **userId** and establish **tenant context**.' - elaboration: Prevents improperly docking points for the initial profile query needed - to discover tenant identity. + guideline: 'The response should allow the initial UserAudioProfile lookup by _id: userAudioProfileId in voice-synthsizer-job-handler as a valid tenant-resolution step without requiring userId in that initial query. **Answer key:** The initial lookup on **UserAudioProfile** by **_id: userAudioProfileId** is necessary to resolve **userId** and establish **tenant context**.' + elaboration: Prevents improperly docking points for the initial profile query needed to discover the tenant identity. - id: worker-loop-crash-prevention category: primary_intent dimensions: - Broader Correctness / the craft of software engineering severity: possible_dealbreaker call_site_key: voice-synthsizer-job-handler - guideline: The response should catch and handle exceptions during message processing - to prevent background worker polling loops from crashing. **Answer key:** Errors - during job processing must be caught gracefully in a **try-catch block** so the - worker **polling loop** remains active. - elaboration: 'Ensures background worker loops remain resilient against unhandled - errors during message processing. Note: Standard SQS message acknowledgment inherited - from the consumer framework is standard queue behavior and must not be penalized.' + guideline: The response should catch and handle exceptions during message processing in voice-synthsizer-job-handler and voice-cloning-job-handler to prevent background worker polling loops from crashing. **Answer key:** Errors during job processing must be caught gracefully in a **try-catch block** so the worker **polling loop** remains active. + elaboration: Ensures background worker loops remain resilient against unhandled errors. Standard framework SQS message acknowledgment and deletion on completed or rejected jobs must not be penalized. - id: refactor-summary-accuracy category: primary_intent dimensions: - Communication severity: unlikely_dealbreaker call_site_key: voice-synthsizer-job-handler - guideline: The response should accurately describe the refactored multi-tenant isolation - changes across handlers in any written response summary or code documentation. - **Answer key:** Any written **summary**, **explanation**, or **code documentation** - must **accurately reflect** the actual code refactoring and **multi-tenant security - logic**. - elaboration: Evaluates whether written explanations or code comments accurately - describe the multi-tenant isolation refactor. + guideline: The response should accurately describe the multi-tenant isolation refactor across voice-cloning-job-handler and voice-synthsizer-job-handler in its written summary or code documentation if provided. **Answer key:** Any written **summary**, **explanation**, or **code documentation** must **accurately reflect** the actual code refactoring and **userId tenant isolation logic** without misleading claims. + elaboration: Evaluates the accuracy and clarity of written response summaries or code documentation. 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 46d7463b..82153487 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,19 +1,23 @@ -# Grader Context & Reference Material +# Grader Reference Context: Potion Voice User Ownership -## Task Overview -This task audits and refactors background worker handlers handling voice cloning and speech synthesis jobs to enforce multi-tenant isolation. +## Codebase Architecture & Background Workers +The background processing tier ingests SQS messages for voice cloning and speech synthesis: +1. **`voice-cloning-job-handler`**: Processes voice cloning tasks on `VoiceCloning` and `UserAudioProfile` models. +2. **`voice-synthsizer-job-handler`**: Processes speech synthesis tasks on `UserAudioProfile`, `RecordingSalutation`, and `Recording` models. -## Handler & Model Ground Truth -1. ****: - - Mongoose model: . - - Operations must filter queries and updates by . +## Key Identifiers & Data Models +- **Handlers**: `voice-cloning-job-handler`, `voice-synthsizer-job-handler` +- **Models**: `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, `Recording` +- **Fields**: `userId` (tenant identifier), `_id`, `userAudioProfileId`, `recordingId`, `salutationId` -2. ****: - - Ingests queue messages containing , , and . - - Performs an initial query on using to resolve . - - Downstream queries and updates on and must be scoped by . - - Execution (audio rendering and database writes) must be halted if tenant validation fails. - -3. **Infrastructure Notes**: - - Worker polling loops must handle exceptions in a try-catch block to remain active. - - Standard SQS message deletion and acknowledgment behavior inherited from the consumer framework is standard queue processing functionality and must not be penalized. +## Ground Truth Behavior & Verification Rules +1. **Tenant Isolation Flow in Speech Synthesis**: + - SQS message payload provides `userAudioProfileId`, `recordingId`, and `salutationId`. + - Initial lookup: `UserAudioProfile.findOne({ _id: userAudioProfileId })` (or `findById`) is permitted as a tenant resolution step to extract `userAudioProfile.userId`. + - Downstream operations: All subsequent queries and updates on `RecordingSalutation` and `Recording` must include `{ userId: userAudioProfile.userId }`. +2. **Tenant Isolation Flow in Voice Cloning**: + - Reads and updates on `VoiceCloning` and `UserAudioProfile` must incorporate `userId`. +3. **Side-Effect Control**: + - If `userId` validation fails, handlers must return/throw early to prevent audio generation rendering and database writes. +4. **Framework SQS Acknowledgment**: + - SQS message acknowledgment and deletion inherited from the consumer loop is standard framework behavior and is not a security defect. 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 952045f7..941eb255 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,24 +1,37 @@ -# Evaluation Rubric: Multi-Tenant Data Isolation +# Holistic Evaluation Rubric: Potion Voice User Ownership -## Narrow Correctness - -### Primary Intent & Crux Requirement -- **Side-Effect Prevention (CRUX)**: The implementation must prevent unauthorized side effects, halting speech synthesis audio rendering and database updates whenever tenant validation fails or records do not match tenant context. Failing to halt unauthorized side effects is a Crux failure that applies a heavy penalty to the overall score. -- **Voice Cloning Tenant Isolation**: All database reads and updates in must filter by in addition to record . -- **Speech Synthesis Tenant Isolation**: All downstream database reads and updates to and in must be scoped by the profile-derived . - -### Allowed Behaviors & Non-Penalization -- **Initial Profile Lookup Exemption**: Performing an initial lookup on by to resolve and establish tenant context is necessary and must not be penalized for omitting . -- **Inherited SQS Acknowledgment**: Standard SQS message deletion and acknowledgment behavior inherited from the baseline consumer framework is expected infrastructure functionality and must not be penalized. +## Evaluation Overview +This rubric evaluates backend refactoring changes in `voice-cloning-job-handler` and `voice-synthsizer-job-handler` to ensure multi-tenant data isolation and worker resilience. --- -## Broader Correctness / the craft of software engineering +## 1. Narrow Correctness -- **Worker Loop Resilience**: Errors and exceptions encountered during job processing must be caught gracefully in a try-catch block to keep background worker polling loops active. +### Primary Intent: Tenant Isolation & Side-Effect Controls +- **Voice Cloning Query Scoping**: + - All queries and database updates in `voice-cloning-job-handler` accessing `VoiceCloning` or `UserAudioProfile` models must filter by `userId` in addition to document `_id`. +- **Speech Synthesis Query Scoping**: + - The initial `UserAudioProfile` lookup in `voice-synthsizer-job-handler` using `_id: userAudioProfileId` is valid to resolve `userId`. + - All downstream reads and updates on `RecordingSalutation` and `Recording` models must filter by `userId`. +- **Side-Effect Prevention (Crux Requirement)**: + - When tenant ownership checks fail or records do not match `userId`, the handler must halt immediately before triggering audio rendering or mutating database records. + - *Crux Rule*: Failing to halt unauthorized audio rendering or database mutations when tenant validation fails applies a heavy penalty to the overall score. + +*Routing Note*: Missing query syntax filters should be charged under specific scoping criteria (`cloning-tenant-isolation` or `synthesis-tenant-isolation-queries-updates`). Executing unauthorized audio generation or database writes on unowned records must be charged under `prevent-unauthorized-side-effects`. Do not double-charge single defects. --- -## Communication +## 2. Broader Correctness / the craft of software engineering -- **Refactor Summary Accuracy**: Any written response summary or inline code documentation accompanying the refactor must accurately describe the multi-tenant isolation logic without misleading claims. +### Worker Polling Loop Stability +- Job processing within `voice-synthsizer-job-handler` and `voice-cloning-job-handler` must be wrapped in `try-catch` blocks to handle errors gracefully without crashing the background worker polling loop. + +### Framework Behavior Non-Penalization +- Standard SQS message deletion and acknowledgment behavior inherited from the consumer framework on completed or rejected jobs is standard infrastructure functionality and must not be penalized. + +--- + +## 3. Communication + +### Written Response & Code Documentation +- Any accompanying written summary or inline code comments must accurately reflect the multi-tenant isolation refactor across `voice-cloning-job-handler` and `voice-synthsizer-job-handler` without misleading claims.