From 5ca38d3f49bb530d0832a67e082811c430717932 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Wed, 14 Oct 2026 15:44:31 -0400 Subject: [PATCH] 4 flagging detectors 4th time --- .../detector-meaningful-failure.inputs.json | 10 +-- .../detectors/detector-meaningful-failure.md | 10 +-- .../detector-rubric-clarity.inputs.json | 10 +-- .../detectors/detector-rubric-clarity.md | 12 ++-- .../detector-rubric-coverage.inputs.json | 10 +-- .../detectors/detector-rubric-coverage.md | 46 +++++------- .../detector-rubric-form.inputs.json | 10 +-- .../detectors/detector-rubric-form.md | 33 ++++----- .../instruction.md | 21 +++--- .../tests/atomic-rubric.yaml | 71 +++++++++---------- .../tests/grader-context.md | 30 ++++---- .../tests/holistic-rubric.md | 44 ++++-------- 12 files changed, 136 insertions(+), 171 deletions(-) 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 79803684..4ccefc70 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:40:07.233Z", + "capturedAt": "2026-10-14T19:42:51.859Z", "capturedBy": "stamp", "inputs": { - "prompt": "390623c31ce92c23a23d9dcef030214a58de013521829f23bcb767d6063ece41", + "prompt": "c1a9867d40b183f9475d6e0750bc7663c5648e17cae2cbbc72b3c6d3e5065429", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "a0b195ccea7467b0cb507c618a385335487ec567e166dae2f23dac69f804ff87", - "atomicRubric": "b4b3bef2c7fcbda791147dae736290da4546034f89ca0fc1d2a51568c95da5d0", + "holisticRubric": "1f89b01999d13694dbe98c0ef8e61ac0ab69b3d0687262e10bc6c5cccba80540", + "atomicRubric": "71d23eafe5164f53d0a918dbbcda902b285ce79daca556ac334d6d968b8acd8c", "rubricsYaml": null, - "graderContext": "73ee1a5692675bff94eb0aeb40c189c7fdcf9e2fd805cef12139f21b2766d93f" + "graderContext": "449ae99f24d0b403d88bac9137e7a0fa049089a134a6f3d705d0e474348bc610" } } 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 d071b3a2..467c542c 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 @@ -10,7 +10,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 `userId` scoping on cloning operations and synthesis operations, with the synthesizer's initial profile lookup resolving tenant context. -- **Stop unauthorized downstream work:** The Narrow Correctness section calls halting database mutations or audio rendering after failed ownership validation the Crux Requirement and directs a heavy penalty at the overall score. +- **Stop unauthorized downstream work:** The Narrow Correctness section calls halting audio generation or database updates after failed ownership validation its Crux requirement and says failure earns zero credit for an unspecified criterion under Narrow Correctness. - **Worker resilience:** The Broader Correctness section requires polling loops to survive message-processing exceptions. Inherited SQS acknowledgment order is now an explicit non-penalty rule. The written summary is peripheral to the central security failure. @@ -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; whether the source's Narrow Correctness parenthesis adds a second penalty is a separate rubric-clarity issue. +- **Verdict for this deduction:** `meaningful`. It directly violates the task's stop condition; the source's zero-credit target is a separate rubric-clarity issue. ### 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 candidate solution MUST immediately halt job execution before triggering audio synthesis rendering or modifying database records if tenant validation fails or if requested resources do not belong to the resolved tenant.” The source also directs a heavy overall-score penalty for failing this rule. +- **Guidance says:** “If tenant validation fails or requested records do not match the tenant context, the handler must immediately halt execution before performing audio generation or database updates.” The source then says failure gives “0 credit for this criterion under Narrow Correctness.” - **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 is proportionate to actual cross-tenant rendering or writes. The phrase “docking all points under Narrow Correctness” leaves the arithmetic unclear; rubric clarity and coverage assess that issue separately. +- **Call:** The consequence is real, and a severe Narrow Correctness deduction is proportionate to actual cross-tenant rendering or writes. Whether the source zeros the whole dimension or only the side-effect item remains unclear; rubric clarity and coverage assess that scoring issue separately. 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 combined overall-penalty and Narrow Correctness wording 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 zero-credit 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 79803684..4ccefc70 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:40:07.233Z", + "capturedAt": "2026-10-14T19:42:51.859Z", "capturedBy": "stamp", "inputs": { - "prompt": "390623c31ce92c23a23d9dcef030214a58de013521829f23bcb767d6063ece41", + "prompt": "c1a9867d40b183f9475d6e0750bc7663c5648e17cae2cbbc72b3c6d3e5065429", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "a0b195ccea7467b0cb507c618a385335487ec567e166dae2f23dac69f804ff87", - "atomicRubric": "b4b3bef2c7fcbda791147dae736290da4546034f89ca0fc1d2a51568c95da5d0", + "holisticRubric": "1f89b01999d13694dbe98c0ef8e61ac0ab69b3d0687262e10bc6c5cccba80540", + "atomicRubric": "71d23eafe5164f53d0a918dbbcda902b285ce79daca556ac334d6d968b8acd8c", "rubricsYaml": null, - "graderContext": "73ee1a5692675bff94eb0aeb40c189c7fdcf9e2fd805cef12139f21b2766d93f" + "graderContext": "449ae99f24d0b403d88bac9137e7a0fa049089a134a6f3d705d0e474348bc610" } } 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 fb699d05..1781db1f 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 @@ -9,16 +9,16 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Material ambiguities -### Overall penalty versus Narrow Correctness zeroing +### Zero-credit target is undefined -- **Where:** The Crux Scoring Note says, “Failing this crux criterion applies a heavy penalty to the overall score (docking all points under Narrow Correctness).” -- **Why it's ambiguous:** The Grading Standard treats an overall-score penalty and a reduced Narrow Correctness rating as different score operations. The parenthesis could mean zero Narrow Correctness *instead of* an overall penalty, zero Narrow Correctness *as well as* an overall penalty, or an attempted explanation of the penalty's size. Those readings change both the score and relative ordering of responses. -- **Grade evidence:** The four original reference grades report the eight-criterion mean without an overall penalty; they were graded under an earlier rubric revision and cannot resolve this new wording. +- **Where:** The Narrow Correctness Scoring note says, “This is a Crux requirement under Narrow Correctness. Failing to halt unauthorized side effects results in 0 credit for this criterion under Narrow Correctness.” +- **Why it's ambiguous:** The Grading Standard's scored criterion is Narrow Correctness; the side-effect bullet is a task-specific requirement inside it. “This criterion” could mean all of Narrow Correctness receives zero, or only the side-effect requirement receives no credit while other Narrow Correctness work still counts. Those readings give materially different scores. The explicit numeric zeroing also substitutes an unsupported cap-like rule for the standard's qualitative heavy-penalty mechanism. +- **Grade evidence:** The four original reference grades assign nonzero Narrow Correctness ratings and were produced under an earlier rubric revision. They do not resolve this new scoring sentence. ## Copy-edit issues -None found that interrupts reading. The problem is the scoring instruction, not grammar. +None found that interrupts reading. The issue is the scoring target and mechanism. ## Overall verdict -The source now names an overall-score heavy penalty, resolving the previous missing-target issue. Remove the Narrow Correctness docking parenthesis or state a separate, qualitative criterion penalty with its own trigger. The current sentence is materially ambiguous. +The previous overall-score double-target wording is gone, but the replacement still leaves the amount of Narrow Correctness credit ambiguous. State the failure's effect qualitatively on Narrow Correctness, or specify an overall-score heavy penalty with a clear trigger and non-trigger if that is the intended cliff. 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 79803684..4ccefc70 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:40:07.233Z", + "capturedAt": "2026-10-14T19:42:51.859Z", "capturedBy": "stamp", "inputs": { - "prompt": "390623c31ce92c23a23d9dcef030214a58de013521829f23bcb767d6063ece41", + "prompt": "c1a9867d40b183f9475d6e0750bc7663c5648e17cae2cbbc72b3c6d3e5065429", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "a0b195ccea7467b0cb507c618a385335487ec567e166dae2f23dac69f804ff87", - "atomicRubric": "b4b3bef2c7fcbda791147dae736290da4546034f89ca0fc1d2a51568c95da5d0", + "holisticRubric": "1f89b01999d13694dbe98c0ef8e61ac0ab69b3d0687262e10bc6c5cccba80540", + "atomicRubric": "71d23eafe5164f53d0a918dbbcda902b285ce79daca556ac334d6d968b8acd8c", "rubricsYaml": null, - "graderContext": "73ee1a5692675bff94eb0aeb40c189c7fdcf9e2fd805cef12139f21b2766d93f" + "graderContext": "449ae99f24d0b403d88bac9137e7a0fa049089a134a6f3d705d0e474348bc610" } } 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 85a41120..fc3f4aba 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 @@ -11,49 +11,41 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai | Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status | | --- | --- | --- | -| “immediately halt job execution before triggering audio synthesis rendering or modifying database records” | prevent-unauthorized-side-effects | covered | -| “heavy penalty to the overall score” | prevent-unauthorized-side-effects (`crux`) | covered | -| “docking all points under Narrow Correctness” | prevent-unauthorized-side-effects | partial | -| “query syntax omissions under the query scoping criteria ... actual execution ... under this crux requirement” | cloning-tenant-isolation; synthesis-tenant-isolation-queries-updates; prevent-unauthorized-side-effects | covered | -| “All database reads and updates in `voice-cloning-job-handler` ... `userId` ... `_id`” | cloning-tenant-isolation | covered | -| “All downstream reads and updates to `RecordingSalutation` and `Recording` ... profile-derived `userId`” | synthesis-tenant-isolation-queries-updates | covered | -| “initial lookup on `UserAudioProfile` by `_id: userAudioProfileId` ... MUST NOT be penalized” | initial-profile-tenant-resolution | covered | -| “Processing errors, tenant mismatch rejections, and database exceptions ... caught ... in a try-catch block” | worker-loop-crash-prevention | covered | -| “Standard SQS message deletion and acknowledgment ... MUST NOT be penalized” | inherited-sqs-acknowledgment-protection | covered | -| “If a written summary or code documentation is provided ... accurately describe ... without misleading claims” | refactor-summary-accuracy | partial | +| “All database queries and updates ... `VoiceCloning` and `UserAudioProfile` ... `userId` ... `_id`” | cloning-tenant-isolation | covered | +| “All downstream queries and updates ... `RecordingSalutation` and `Recording` ... `userId` resolved from `UserAudioProfile`” | synthesis-tenant-isolation-queries-updates | covered | +| “immediately halt execution before performing audio generation or database updates” | prevent-unauthorized-side-effects | covered | +| “0 credit for this criterion under Narrow Correctness” | prevent-unauthorized-side-effects | partial | +| “initial lookup ... `_id: userAudioProfileId` ... must not be penalized” | initial-profile-tenant-resolution | covered | +| “Unhandled exceptions ... caught gracefully in a `try-catch` block” | worker-loop-crash-prevention | covered | +| “SQS message deletion and acknowledgment inherited ... must not be penalized” | inherited-sqs-acknowledgment-protection | covered | +| “If a written summary or code documentation is provided ... accurately explain ... without false or misleading security claims” | refactor-summary-accuracy | covered | ## Coverage gaps -### Narrow Correctness docking is not encoded +### Narrow Correctness zero-credit instruction -- **Holistic clause:** The Crux Scoring Note adds “(docking all points under Narrow Correctness)” to an overall-score heavy penalty. -- **Closest criterion:** `prevent-unauthorized-side-effects` encodes the overall penalty through `severity: crux`, but does not encode zeroing the Narrow Correctness dimension. -- **What is lost:** If the parenthesis is intended as a second scoring action, the atomic rubric omits it. If it is merely an explanation of the overall penalty, the source is misleading. Resolve that ambiguity in the holistic source first; the atomic scoring scheme cannot directly encode a zero-score cap. - -### Code documentation condition - -- **Holistic clause:** Communication applies “If a written summary or code documentation is provided.” -- **Closest criterion:** `refactor-summary-accuracy` is conditional only on a written response summary; its guideline does not mention code documentation. -- **What is lost:** Misleading documentation added in code can avoid this task-specific accuracy criterion even though the holistic clause covers it. +- **Holistic clause:** The Scoring note says failure gives “0 credit for this criterion under Narrow Correctness.” +- **Closest criterion:** `prevent-unauthorized-side-effects` has `severity: crux` but no zero-credit effect on Narrow Correctness. +- **What is lost:** An atomic grader applies Crux severity to the aggregate; a holistic grader may zero the Narrow Correctness dimension or only the side-effect requirement. The source must first resolve that ambiguity before the atomic conversion can be equivalent. ## Invented content -### Acknowledgment protection becomes a preservation requirement +### Unsupported Crux severity -The holistic rubric protects standard inherited acknowledgment from being penalized as a security flaw. `inherited-sqs-acknowledgment-protection` instead says the response “should preserve or rely on the framework's standard SQS message acknowledgment and deletion behavior.” A response that safely changes the acknowledgment order can fail this criterion despite the holistic rule making no such preservation demand. +The holistic rubric has no heavy penalty targeting the overall score. Its Crux label and zero-credit instruction are attached to Narrow Correctness. `prevent-unauthorized-side-effects` carries `severity: crux`, which the atomic conversion contract reserves for an overall-score heavy penalty. This changes aggregate scoring materially. -### Unverified API in context +### Standalone acknowledgment criterion -`tests/grader-context.md` says the initial synthesis lookup is `UserAudioProfile.findById(userAudioProfileId)`. The holistic rubric says only that the lookup uses `_id: userAudioProfileId`; the shipped baseline handler calls `userAudioProfileService.find(...)`, not `findById`. The context's exact API claim is neither a verbatim source fact nor a safe restatement. +The holistic rubric protects inherited SQS acknowledgment from a deduction. `inherited-sqs-acknowledgment-protection` restates that protection as a scored dodged-bullet criterion. Its wording no longer demands preserving baseline timing, but it can still add an almost automatic pass; the protection belongs as a non-trigger in the relevant criterion's elaboration rather than as an independent scoring item. ## Context integrity -The holistic rubric has an Overview but no separate Task context, Business context, or Ground truth sections. The context document adds independent architecture prose rather than extracting source context verbatim. Its model and tenant-source summary mostly aligns with the holistic clauses, apart from the `findById` claim above. +The holistic rubric has no separate Task context, Business context, or Ground truth sections to extract verbatim. The context file supplies additional architectural details. Its core tenant-source and model facts broadly match the source's requirements, and the earlier unsupported `findById` API claim is gone. ## Crux alignment -The holistic Scoring Note now expressly names a heavy penalty targeting the overall score, and `prevent-unauthorized-side-effects` carries `severity: crux`. The main Crux designation is aligned. The parenthetical Narrow Correctness zeroing is a separate, unresolved scoring instruction, and the source still lacks an explicit non-trigger for that heavy penalty. +There is one atomic Crux, `prevent-unauthorized-side-effects`, and no holistic heavy penalty against the overall score to back it. The source's “0 credit” under Narrow Correctness is a different scoring instruction. The Crux mismatch is material. ## Overall verdict -Crux has an overall-score source now, but the parenthetical score operation is not encoded and needs clarification. The acknowledgment criterion adds a preservation requirement, the documentation condition is narrower than the source, and the context contains an unsupported exact API claim. These are material scoring differences. +Most behavioral clauses are represented, and the documentation and acknowledgment wording improved. The remaining zero-credit instruction and unsupported atomic Crux yield different scores between the two forms. Resolve the source penalty target, then reconvert and keep the acknowledgment allowance as a non-trigger. 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 79803684..4ccefc70 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:40:07.233Z", + "capturedAt": "2026-10-14T19:42:51.859Z", "capturedBy": "stamp", "inputs": { - "prompt": "390623c31ce92c23a23d9dcef030214a58de013521829f23bcb767d6063ece41", + "prompt": "c1a9867d40b183f9475d6e0750bc7663c5648e17cae2cbbc72b3c6d3e5065429", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "a0b195ccea7467b0cb507c618a385335487ec567e166dae2f23dac69f804ff87", - "atomicRubric": "b4b3bef2c7fcbda791147dae736290da4546034f89ca0fc1d2a51568c95da5d0", + "holisticRubric": "1f89b01999d13694dbe98c0ef8e61ac0ab69b3d0687262e10bc6c5cccba80540", + "atomicRubric": "71d23eafe5164f53d0a918dbbcda902b285ce79daca556ac334d6d968b8acd8c", "rubricsYaml": null, - "graderContext": "73ee1a5692675bff94eb0aeb40c189c7fdcf9e2fd805cef12139f21b2766d93f" + "graderContext": "449ae99f24d0b403d88bac9137e7a0fa049089a134a6f3d705d0e474348bc610" } } 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 b4ec1524..744fdd8c 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 @@ -1,7 +1,7 @@ --- detector: detector-rubric-form verdict: material-issues -confidence: HIGH +confidence: MEDIUM --- # Rubric-form check: potion-voice-user-ownership @@ -9,44 +9,39 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml ## Deterministic contract -1. YAML parses with `task` and seven criteria: pass. -2. The task slug matches: pass. +1. YAML parses with the task slug and seven criteria: pass. +2. Task slug matches: pass. 3. IDs are unique kebab-case: pass. 4. Categories use the allowed vocabulary: pass. 5. Severities use the allowed vocabulary and placement: pass. 6. One Crux is within the two-Crux cap: pass. 7. Dimensions name standard criteria: pass. 8. Guidelines are nonempty: pass. -9. Numeric penalty language: pass; the rubric and context give no numeric penalty amount. -10. Positive requirement phrasing: pass for behavioral sentences. The answer-key phrase “must not be penalized” describes a protected behavior rather than an instruction to the response. +9. Numeric penalty language is absent from the atomic rubric and grader context: pass. +10. Behavioral guidelines use positive phrasing: pass. “Must not be penalized” in the acknowledgment answer key describes the allowance rather than a negated implementation instruction. ## Atomicity and self-containment -### Grading directions inside the Crux guideline - -- **Criterion:** `prevent-unauthorized-side-effects`. -- **Where:** “Routing note: Charge 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.” -- **Why:** The guideline mixes one response requirement with charge routing and score mechanics, then repeats the heavy-penalty rule inside its answer key and elaboration. A grader can identify the response behavior, but the criterion no longer has the required one-statement guideline shape. -- **Suggested rewrite:** Leave only the stop condition and bold answer key in the guideline; place charge routing in the elaboration and let `severity: crux` carry the penalty weight. +None found in the handler-specific scoping and stop-condition criteria. The side-effect elaboration now carries the charge-routing note instead of putting it in the guideline. ## Phrasing and answer keys -### Factual answer-key relationships are only partly bold +### Factual answer keys are only partly bold - **Criterion:** `synthesis-tenant-isolation-queries-updates`, among others. - **Where:** “**Answer key:** Downstream **reads** and **updates** to **RecordingSalutation** and **Recording** ... must be scoped by the profile-derived **userId**.” -- **Why:** The label and nouns are bold, but the load-bearing relationship is not. The fact remains inline and judgeable, so this is a formatting issue. -- **Suggested rewrite:** Bold the complete answer-key fact. +- **Why:** The key terms are bold, but the full relationship is plain text. The answer remains inline and judgeable, making this a minor formatting issue. +- **Suggested rewrite:** Bold each full factual answer-key sentence. ## Fair-grading findings -### Protected acknowledgment becomes required preservation +### A permission is a scored criterion - **Criterion:** `inherited-sqs-acknowledgment-protection`. -- **Where:** “The response should preserve or rely on the framework's standard SQS message acknowledgment and deletion behavior without treating standard message deletion on rejected or completed jobs as a security defect.” -- **Why:** The source only protects inherited acknowledgment from a security deduction. This criterion can fail a safe response that changes timing rather than preserving or relying on it, and it spends a scored criterion on an exemption that belongs in another criterion's elaboration. -- **Suggested rewrite:** Move the protection to the worker-loop or side-effect elaboration as a non-trigger; omit a separate scored preservation criterion. +- **Where:** “The response should allow standard framework SQS message deletion and acknowledgment behavior without penalizing message deletion on completed or rejected jobs.” +- **Why:** The agent's code cannot penalize its own queue acknowledgment as a security defect; only a grader can. This criterion asks the grader to refrain from a deduction and then awards a separate scored pass for doing so. It is not an independently judgeable property of the response and can dilute the task's functional criteria. +- **Suggested rewrite:** Remove the separate criterion and put the allowance into the worker-loop or side-effect criterion's elaboration as a non-trigger. ## Overall verdict -The deterministic artifact contract passes. The acknowledgment criterion creates an unfair scored requirement, and the Crux guideline bundles a behavioral rule with grading mechanics. Those judgment-layer issues make the atomic artifact materially unsound; the answer-key formatting issue is minor. +The YAML passes deterministic checks, and the prior grading-directions bundle is gone. The standalone acknowledgment permission remains a material judgment-layer defect because it cannot fail on a meaningful response behavior. The answer-key bolding issue is minor. 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 c124160b..1f2f9517 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,14 +1,15 @@ -# Refactor Background Workers for Multi-Tenant Data Isolation +# Audit and Refactor Multi-Tenant Data Isolation in Background Workers -## Context & Problem -Our backend background worker services (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) process asynchronous jobs received via AWS SQS queue messages. Currently, these handlers retrieve database records—such as voice cloning jobs, user audio profiles, salutations, and synthesized audio recordings—using only the document identifiers (`_id`) supplied in the message payloads. +## Overview +Our backend processing pipeline handles voice cloning and speech synthesis jobs via background queue consumers. An audit revealed that background worker job handlers retrieve and mutate records using document IDs passed in SQS message payloads without verifying tenant ownership (`userId`). -Because incoming job payloads do not guarantee authenticated user context, retrieving records solely by `_id` creates a multi-tenant data isolation vulnerability. An unauthorized job message could potentially read or mutate another tenant's audio profiles, salutation records, or generated audio files. +You must refactor the job handlers to enforce strict multi-tenant data isolation and ensure background worker polling loops remain resilient against unhandled errors. -## Task Objective -Audit and refactor all database queries and updates across the background worker job handlers to enforce strict multi-tenant data separation and ensure background processing stability: +## Objectives +1. **Multi-Tenant Scoping**: Ensure all database queries, reads, and updates across voice cloning (`VoiceCloning`, `UserAudioProfile`) and speech synthesis (`Recording`, `RecordingSalutation`) filter by the tenant's `userId`. +2. **Side-Effect Prevention**: Immediately halt downstream processing (including audio generation rendering and database mutations) if tenant ownership validation fails or if requested records do not belong to the tenant. +3. **Worker Stability**: Catch and handle errors during message processing so that unhandled exceptions do not cause the background worker polling loop to crash. -1. **Multi-Tenant Data Isolation**: Ensure all database reads, updates, and side effects in `voice-cloning-job-handler` and `voice-synthsizer-job-handler` are strictly scoped by tenant identity (`userId`). -2. **Tenant Context Resolution**: For operations where the message payload provides a resource identifier (e.g., `userAudioProfileId`), use the initial profile lookup to establish authoritative tenant context (`userId`), then enforce that `userId` on all downstream queries and database updates. -3. **Prevent Unauthorized Side Effects**: Guarantee that if tenant validation fails or requested records do not belong to the resolved tenant, background processing halts immediately before triggering audio synthesis rendering or mutating database records. -4. **Worker Loop Resilience**: Ensure that error handling within job handlers catches exceptions gracefully, preventing unhandled job failures from crashing the main background worker polling loops. +## Target Handlers +- `voice-cloning-job-handler` +- `voice-synthsizer-job-handler` 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 3549576e..38ec9b92 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,43 +6,40 @@ 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 + 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. + must filter by **userId** in addition to record **_id**. + elaboration: Verifies that all database operations in the voice cloning handler + incorporate userId filtering. - 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 + 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 both queries and database updates in the speech synthesis - handler enforce tenant isolation using userId. + **userId**. + elaboration: Ensures downstream queries and 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. - Routing note: Charge 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. **Answer key:** Synthesis **audio - generation** and **database mutations** must be halted if **tenant ownership checks** - fail. Failing this crux criterion applies a **heavy penalty** to the **overall - score**.' - elaboration: 'CRUX CRITERION: Halting unauthorized audio rendering and database - side effects when tenant validation fails is the central security requirement. - Failing this crux criterion applies a heavy penalty to the overall score.' + guideline: The response should prevent unauthorized side effects, including audio + generation rendering and database mutations across both handlers, when tenant + validation fails or records do not match tenant context. **Answer key:** **Audio + generation rendering** and **database mutations** must be halted if **tenant ownership + checks** fail. + elaboration: 'Guarantees that unauthorized jobs do not trigger audio rendering or + unauthorized database writes. Routing note: Charge syntax omissions under query + scoping criteria; charge execution of unauthorized side effects under this crux + criterion.' - id: initial-profile-tenant-resolution category: dodged_bullet dimensions: @@ -61,23 +58,22 @@ criteria: - Broader Correctness / the craft of software engineering severity: possible_dealbreaker call_site_key: voice-synthsizer-job-handler - guideline: 'The response should preserve or rely on the framework''s standard SQS - message acknowledgment and deletion behavior without treating standard message - deletion on rejected or completed jobs as a security defect. **Answer key:** **SQS - message deletion** and **acknowledgment** inherited from the baseline consumer - framework is standard queue processing behavior and must not be penalized.' - elaboration: Protects candidate agents from being docked for standard framework - queue message deletion and acknowledgment behavior. + guideline: The response should allow standard framework SQS message deletion and + acknowledgment behavior without penalizing message deletion on completed or rejected + jobs. **Answer key:** **SQS message deletion** and **acknowledgment** inherited + from the baseline framework is standard queue functionality and must not be penalized. + elaboration: Ensures agents are not penalized for standard framework queue message + deletion or acknowledgment behavior. - 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.' + guideline: The response should catch and handle exceptions during message processing + to prevent background worker polling loops from crashing. **Answer key:** Unhandled + **exceptions** 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. - id: refactor-summary-accuracy @@ -86,10 +82,9 @@ criteria: - Communication severity: unlikely_dealbreaker call_site_key: voice-synthsizer-job-handler - guideline: 'The response should accurately summarize the refactored multi-tenant - isolation changes across the background worker handlers if a written response - summary is provided. **Answer key:** Any written **summary** or **explanation** - must **accurately reflect** the actual code refactoring and **multi-tenant security - logic** without misleading claims.' - elaboration: Evaluates whether written response explanations accurately reflect - the underlying code refactoring. + guideline: The response should accurately describe the multi-tenant isolation refactor + in its written summary or code documentation if provided. **Answer key:** Any + written **summary** or **documentation** must **accurately describe** the **multi-tenant + isolation** implementation without misleading claims. + elaboration: Evaluates that written explanations or documentation accurately reflect + the technical refactoring. 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 8ea0e449..968f39c4 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,18 +1,20 @@ -# Grader Context & Reference Ground Truth +# Grader Context & Ground Truth Reference -## Repository Architecture & Code Mechanics -The repository operates an asynchronous background worker tier processing voice cloning and speech synthesis tasks via AWS SQS queue consumers. +## Architecture & Codebase Facts +- **Voice Cloning Handler (`voice-cloning-job-handler`)**: + - Consumes SQS queue messages containing `job._doc` (or `job._id`). + - Mongoose model: `VoiceCloning`. + - Queries and updates on `VoiceCloning` and `UserAudioProfile` must filter by `userId`. -### Key Mongoose Models & Collections -1. `VoiceCloning`: Model representing voice cloning training jobs. Key fields: `_id`, `userId`, `status`. -2. `UserAudioProfile`: Model representing trained user voice profiles. Key fields: `_id`, `userId`, `profileName`. -3. `RecordingSalutation`: Model for custom greeting voice synthesis. Key fields: `_id`, `userId`, `userAudioProfileId`, `status`. -4. `Recording`: Model for standard audio generation. Key fields: `_id`, `userId`, `userAudioProfileId`, `status`. +- **Speech Synthesis Handler (`voice-synthsizer-job-handler`)**: + - Ingests queue messages containing `userAudioProfileId`, `recordingId`, and `salutationId`. + - Performs an initial query on `UserAudioProfile` using `_id: userAudioProfileId` to discover the tenant's `userId`. (This initial lookup establishes tenant context and is not a security flaw). + - Subsequent queries and updates on `RecordingSalutation` and `Recording` must be scoped by the resolved `userId`. -### Queue Payload Ingestion & Tenant Resolution -* `voice-cloning-job-handler`: Receives job objects directly (`job._doc`). Ingestion must scope `VoiceCloning` and `UserAudioProfile` queries by `userId`. -* `voice-synthsizer-job-handler`: Message payload provides `userAudioProfileId`, `recordingId`, and/or `salutationId`. -* **Two-Step Resolution**: The handler performs an initial lookup `UserAudioProfile.findById(userAudioProfileId)` to resolve `userAudioProfile.userId`. This `userId` becomes the authoritative tenant context for all downstream `RecordingSalutation` and `Recording` reads and updates. +- **Side-Effect Prevention**: + - If the initial profile lookup fails to return a record, or if downstream records (`Recording`, `RecordingSalutation`) do not match the resolved `userId`, job processing must abort immediately. + - Unowned jobs must not trigger speech synthesis audio rendering or perform unauthorized database updates. -### Queue Acknowledgment Framework -The baseline worker framework manages SQS message deletion and acknowledgment upon job completion or handled rejection. This infrastructure behavior is standard queue consumer functionality and does not constitute an unauthorized database or queue mutation. +- **Worker Resilience & Baseline Behavior**: + - Unhandled errors during job execution must be caught so the polling loop remains alive. + - Framework SQS message deletion/acknowledgment behavior upon job completion or rejection is standard queue infrastructure and must not be penalized as a 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 378decf8..485a1598 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,35 +1,15 @@ -# Holistic Evaluation Rubric: Multi-Tenant Data Isolation in Background Workers +# Holistic Evaluation Rubric -## Primary Goals & Overview -This rubric evaluates candidate solutions refactoring background worker job handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) for multi-tenant data isolation and background worker stability. +## Narrow Correctness +- **Tenant Isolation in Voice Cloning Handler**: All database queries and updates in `voice-cloning-job-handler` on `VoiceCloning` and `UserAudioProfile` must incorporate `userId` filtering in addition to record `_id`. +- **Tenant Isolation in Speech Synthesis Handler**: All downstream queries and updates in `voice-synthsizer-job-handler` on `RecordingSalutation` and `Recording` must be scoped using the `userId` resolved from `UserAudioProfile`. +- **CRUX: Side-Effect Halting on Validation Failure**: If tenant validation fails or requested records do not match the tenant context, the handler must immediately halt execution before performing audio generation or database updates. + - *Scoring note*: This is a Crux requirement under Narrow Correctness. Failing to halt unauthorized side effects results in 0 credit for this criterion under Narrow Correctness. +- **Initial Profile Lookup Exemption**: Performing an initial lookup on `UserAudioProfile` by `_id: userAudioProfileId` to resolve the tenant's `userId` is a valid, necessary step and must not be penalized. ---- +## Broader Correctness / the craft of software engineering +- **Worker Polling Loop Resilience**: Unhandled exceptions during message processing must be caught gracefully in a `try-catch` block so the background worker polling loop remains active and continues processing queue messages. +- **Framework Queue Message Acknowledgment**: Standard SQS message deletion and acknowledgment inherited from the consumer framework on completed or rejected jobs is acceptable infrastructure functionality and must not be penalized. -## 1. Narrow Correctness - -### Crux Requirement: Unauthorized Side-Effect Prevention -* **Evaluation Standard**: The candidate solution MUST immediately halt job execution before triggering audio synthesis rendering or modifying database records if tenant validation fails or if requested resources do not belong to the resolved tenant. -* **Scoring Note**: Failing this crux criterion applies a heavy penalty to the overall score (docking all points under Narrow Correctness). -* **Routing Note**: Charge query syntax omissions under the query scoping criteria below; charge actual execution of unauthorized audio rendering or database writes under this crux requirement. - -### Scoping Criteria: Database Query & Update Filtering -* **Voice Cloning Handler**: All database reads and updates in `voice-cloning-job-handler` (`VoiceCloning` and `UserAudioProfile`) MUST incorporate `userId` in query filters alongside document `_id`. -* **Speech Synthesis Handler**: All downstream reads and updates to `RecordingSalutation` and `Recording` in `voice-synthsizer-job-handler` MUST be scoped by the profile-derived `userId`. -* **Initial Profile Lookup Exemption**: The initial lookup on `UserAudioProfile` by `_id: userAudioProfileId` is necessary to discover the tenant identity (`userId`). This initial lookup MUST NOT be penalized for lacking a `userId` parameter in its initial filter. - ---- - -## 2. Broader Correctness / the craft of software engineering - -### Worker Polling-Loop Crash Resilience -* **Evaluation Standard**: Processing errors, tenant mismatch rejections, and database exceptions within worker handlers MUST be caught gracefully in a try-catch block so the background worker polling loop remains active and resilient. - -### Inherited SQS Acknowledgment Protection -* **Evaluation Standard**: Standard SQS message deletion and acknowledgment behavior inherited from the baseline consumer framework on completed or rejected jobs is expected queue processing functionality and MUST NOT be penalized as a security flaw or unauthorized mutation. - ---- - -## 3. Communication - -### Refactor Summary & Technical Clarity -* **Evaluation Standard**: If a written summary or code documentation is provided, it MUST accurately describe the refactoring changes and multi-tenant security logic without misleading claims. +## Communication +- **Refactor Summary and Documentation Accuracy**: If a written summary or code documentation is provided, it must accurately explain the multi-tenant isolation logic without false or misleading security claims.