From c36a181ef834e93f3b454e2bcf18efcc42221f64 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Fri, 16 Oct 2026 12:15:27 -0400 Subject: [PATCH] pre-trial detector run 02 --- .../detector-answer-obviousness.inputs.json | 10 +- .../detectors/detector-answer-obviousness.md | 18 ++-- .../detector-broken-dev-env.inputs.json | 10 +- .../detectors/detector-broken-dev-env.md | 2 +- .../detector-credential-leakage.inputs.json | 10 +- .../detector-cross-task-reference.inputs.json | 10 +- .../detector-cross-task-reference.md | 2 +- ...ector-dimension-misapplication.inputs.json | 10 +- .../detector-dimension-misapplication.md | 16 ++-- ...ector-fact-check-rubric-claims.inputs.json | 10 +- .../detector-fact-check-rubric-claims.md | 36 +++---- ...detector-good-response-defined.inputs.json | 10 +- .../detector-good-response-defined.md | 2 +- ...r-good-response-exhaustiveness.inputs.json | 10 +- ...detector-offline-verifiability.inputs.json | 10 +- .../detector-over-hinting.inputs.json | 10 +- .../detectors/detector-over-hinting.md | 2 +- .../detector-rubric-clarity.inputs.json | 10 +- .../detectors/detector-rubric-clarity.md | 18 ++-- .../detector-rubric-coverage.inputs.json | 10 +- .../detectors/detector-rubric-coverage.md | 32 +++---- .../detector-rubric-form.inputs.json | 10 +- .../detectors/detector-rubric-form.md | 28 +++--- .../detector-rubric-generality.inputs.json | 10 +- .../detectors/detector-rubric-generality.md | 2 +- .../detector-snapshot-leakage.inputs.json | 10 +- .../instruction.md | 26 +++-- .../tests/.rubric-staged.json | 6 ++ .../tests/atomic-rubric.yaml | 96 +++++++++++++------ .../tests/grader-context.md | 31 +++--- .../tests/holistic-rubric.md | 42 ++++---- .../tests/rubric-criteria.json | 61 ++++++++++++ .../tests/rubric-criteria.md | 41 ++++++++ 33 files changed, 379 insertions(+), 232 deletions(-) create mode 100644 worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/.rubric-staged.json create mode 100644 worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/rubric-criteria.json create mode 100644 worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/rubric-criteria.md diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.md index 8fad86cb..5a79ba67 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-answer-obviousness.md @@ -1,7 +1,7 @@ --- detector: detector-answer-obviousness verdict: obvious -confidence: MEDIUM +confidence: HIGH --- # Answer-obviousness check: potion-voice-user-ownership @@ -9,22 +9,22 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## What the prompt asks -The prompt requests tenant-scoped worker reads and mutations, profile-derived tenant identity for synthesis, immediate halting on failed ownership, polling resilience, and documentation. These are explicit implementation goals; the call sites and safe ordering remain for the agent to work out. +The prompt requests tenant-scoped cloning and synthesis reads and updates, profile-derived tenant identity for synthesis, preflight halting before unauthorized effects, and resilient worker polling. It does not dictate helper design or the exact code edits. ## Per-expectation assessment -### Tenant scoping and profile lookup — obvious +### Query isolation and profile source — obvious -The rubric's handler filters and initial profile exemption follow the prompt's stated model and tenant-source requirements. Neither forces an unrequested architectural approach. +The two handler filter rules and the initial profile lookup exemption follow the prompt directly. The agent still has to locate every active query and update. -### Preflight gating — obvious +### Preflight side-effect gate — obvious -The prompt asks the workers to halt before unauthorized rendering or mutation. The rubric's preflight requirement is therefore inferable. Its reduced treatment of late null results may undergrade an incomplete stop condition, but it does not penalize an agent for implementing the stronger prompt requirement; that scoring-boundary issue is recorded by rubric clarity. +The prompt explicitly asks the agent to halt before rendering or database mutations if tenant context cannot be established or validation fails. The rubric's primary stop requirement is therefore inferable. -### Resilience and documentation — obvious +### Polling and accurate summary — obvious -Try-catch protection and a clear description are requested in the prompt. +Try-catch resilience is explicit in the prompt. Accurately describing implemented changes is ordinary professional communication. Neither adds a hidden behavior choice. ## Overall verdict -All positively scored actions are reasonable and inferable from the prompt. The disputed late-null allowance is a severity and wording issue, rather than a hidden expectation the agent must guess. +The positively scored expectations are reasonable from the prompt. Scoring arithmetic and the scoped no-match exception have separate clarity and form findings, but this detector finds no mind-reading requirement or unrequested implementation approach. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.md index 7ac500eb..8a958a75 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-broken-dev-env.md @@ -9,7 +9,7 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Verbatim grounding -> “Currently, these background processes retrieve and update database entries using document identifiers without consistently enforcing multi-tenant isolation.” +> “Currently, database operations on Mongoose models (`VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`) rely solely on document ObjectIds” The cloning worker uses `voiceCloningService.update({ _id, status: 'processing' })` and an ID-only profile update. The synthesis worker reads recording records by ID. Both worker entry files pass `node --check`. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-credential-leakage.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.md index b689ea8c..5bc43480 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-cross-task-reference.md @@ -9,7 +9,7 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and ## Verbatim grounding -> “Audit `voice-cloning-job-handler` and `voice-synthsizer-job-handler`” +> “Audit and refactor all database reads and updates across both background handlers” ## Rationale diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.md index e4f7c4a4..9747257e 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-dimension-misapplication.md @@ -1,7 +1,7 @@ --- detector: detector-dimension-misapplication -verdict: clean -confidence: MEDIUM +verdict: clear-misapplication +confidence: HIGH --- # Dimension-misapplication check: potion-voice-user-ownership @@ -9,16 +9,12 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Verbatim grounding -> “## Narrow Correctness” +> “A Crux failure ... results in 0 credit for the corresponding Crux criterion and incurs a heavy penalty on the overall score” -> “## Broader Correctness / The Craft of Software Engineering” - -> “## Verification & Thoroughness” - -> “Unchecked Scoped Writes ... treat this as a minor Broader Correctness finding rather than a Crux security breach.” +> “Charge query syntax omissions under query isolation criteria; charge unauthorized preflight side-effect execution under the Crux criteria.” ## Rationale -Tenant filters and preflight side-effect behavior are routed to Narrow Correctness, while loop reliability and a failed scoped write's follow-through are routed to Broader Correctness. The written-summary clause focuses on unsupported or misleading claims about what the refactor achieved, a Verification & Thoroughness concern. A buried, accurately disclosed limitation would instead be a Communication issue, but the rubric does not instruct graders to penalize that shape here. +The holistic grader scores the eight Grading Standard dimensions. A handler-specific “Crux criterion” is an atomic-rubric item, not one of those dimensions. The rubric directs a load-bearing failure to that noncanonical target without saying how the standard's Narrow Correctness score should be affected. That is Shape X2, a clear criterion misapplication; the overall-score penalty is a separately supported target. -All named axes are canonical. The rubric's uncertain Crux arithmetic is a clarity issue, not a wrong-axis routing finding. +Tenant filter defects otherwise belong to Narrow Correctness, and polling reliability belongs to Broader Correctness. Unverified or misleading claims about what was implemented can reasonably land in Verification & Thoroughness. The finding concerns the named Crux target, not those ordinary routes. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.md index a2eba23c..0828acb2 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-fact-check-rubric-claims.md @@ -6,43 +6,43 @@ claims: - id: c01 verdict: pass loadBearing: true - summary: "Baseline cloning updates lack tenant filters" - rubricQuote: "All database queries and updates on `VoiceCloning` and `UserAudioProfile` in `voice-cloning-job-handler` must be scoped by `userId` in addition to record `_id`." + summary: "Cloning baseline updates lack userId filters" + rubricQuote: "All reads and updates on `VoiceCloning` and `UserAudioProfile` within `voice-cloning-job-handler` must explicitly filter by `userId` in addition to document `_id`." sourceEvidence: "await voiceCloningService.update({ _id, status: 'processing' })" sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/index.js (line 139; profile update at lines 140-143)" - note: "The ID-only update demonstrates the problem the rubric asks the agent to repair. The handler and its helper service are available in the workspace." + note: "The ID-only update shows the baseline weakness. The agent can inspect the handler and service locally." - id: c02 verdict: pass loadBearing: true - summary: "Baseline synthesis reads lack downstream tenant filters" - rubricQuote: "Downstream database queries and updates on `RecordingSalutation` and `Recording` in `voice-synthsizer-job-handler` must be scoped by the profile-derived `userId`." + summary: "Synthesis downstream reads lack tenant filters" + rubricQuote: "downstream queries and updates on `RecordingSalutation` and `Recording` must be scoped by the profile-derived `userId`." sourceEvidence: "const recordingToUpdate = await recordingModel.findOne({\n _id: recordingId,\n deleted: false,\n })" - sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 157-160; salutation read at lines 152-155; update at lines 169-177)" - note: "The downstream model calls use IDs without userId. The agent can trace them directly." + sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 157-160; salutation read lines 152-155; update lines 169-177)" + note: "The baseline downstream operations are ID-only. The agent can trace the required change from this workspace." - id: c03 verdict: pass loadBearing: true - summary: "Profile lookup supplies synthesis tenant identity" - rubricQuote: "The initial query on `UserAudioProfile` by `_id: userAudioProfileId` in `voice-synthsizer-job-handler` is a valid tenant-resolution step" + summary: "Initial profile lookup resolves userId" + rubricQuote: "The initial query looking up `UserAudioProfile` by `_id: userAudioProfileId` is a valid tenant-resolution step" sourceEvidence: "const userAudioProfile = await userAudioProfileService.find({\n _id: userAudioProfileId,\n status: 'completed',\n })\n if (userAudioProfile) {\n const { training_model_path, userId } = userAudioProfile[0]" sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 96-101)" - note: "The first lookup resolves userId from the matched profile; the prompt also expressly tells the agent this tenant-resolution path." + note: "The worker derives userId from the profile selected by ID. The prompt also discloses this valid first step." - id: c04 verdict: pass loadBearing: true - summary: "A null scoped write modifies no matched record" - rubricQuote: "Unchecked `null` return values on queries that *already* contain `userId` in their filter do not cause cross-tenant data leaks (0 records are modified)" + summary: "A filtered no-match update mutates no document" + rubricQuote: "If a query includes the `userId` filter but matches no record (0 documents updated), no cross-tenant data is accessed or mutated." sourceEvidence: "const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n { ...filter }," sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js (lines 89-90)" - note: "The service uses a Mongoose filtered update. A no-match result changes no document; this narrow database fact is true. It does not prove that subsequent rendering or other writes are harmless, a scope ambiguity recorded by rubric clarity." + note: "Mongoose applies the full filter to the update. A null no-match result changes no matched document. This narrow claim does not establish whether later side effects are safe." - id: c05 verdict: pass loadBearing: true - summary: "Both handlers have polling loops" - rubricQuote: "Errors during message processing must be caught gracefully in a try-catch block so background worker polling loops remain active." + summary: "Both workers poll" + rubricQuote: "Job processing logic must be wrapped in a `try-catch` block so unhandled exceptions do not crash background worker polling loops." sourceEvidence: "while (true) {\n await processQueue()" - sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 259-260; cloning equivalent at lines 324-325)" - note: "Both workers poll. The rubric's resilience clause is a requested change, not a false claim that the baseline already catches errors per iteration." + sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 259-260; cloning equivalent lines 324-325)" + note: "Both loop structures exist. Error resilience is the requested result, not an assertion that the baseline already handles all failures." --- # Fact-check rubric claims: potion-voice-user-ownership @@ -50,4 +50,4 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md Source: `harbor-tasks/potion-voice-user-ownership/environment/workspace/`, built from locally resolving `repos/potion-voice` commit `fcd8a9d0b00406bda1943c234a8f2fecaff9f774` without a workspace patch. -Checked five load-bearing claims. All are supported by source available to the test agent. The scoped-write claim holds only for the matched database operation; it does not establish that later side effects are safe. +Checked five load-bearing facts. All are supported by locally reachable source or the ordinary semantics of a filtered Mongoose update. The no-match finding is limited to that query; the rubric's treatment of subsequent work is assessed by rubric clarity. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.md index 485cba00..175b35d7 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-defined.md @@ -13,7 +13,7 @@ Yes. The rubric describes tenant-scoped reads and updates in both handlers, an a ## What the grader has to infer -Exact helper edits and control-flow structure remain open. The target behaviors themselves are affirmative and concrete. The Crux consequence is unclear, but that is a scoring-clarity issue, not an absence of positive success states. +Exact helper edits and control-flow structure remain open. The target behaviors themselves are affirmative and concrete. The way the holistic rubric assigns zero credit to a handler-specific Crux item is unclear, but that is a scoring-clarity issue, not an absence of positive success states. ## Overall verdict diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-good-response-exhaustiveness.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-offline-verifiability.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.md index cb0d9bbf..d53f0a0d 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-over-hinting.md @@ -9,7 +9,7 @@ Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md and environmen ## Findings -The prompt specifies tenant isolation, the initial profile tenant source, side-effect stopping, try-catch resilience, and documentation. These are requested behavior and context for a code refactor. It does not point to the exact defective calls or provide a patch. No authored workspace patch adds explanatory comments. +The prompt specifies tenant isolation, the initial profile tenant source, preflight side-effect stopping, and try-catch resilience. These are requested behavior and context for a code refactor. It does not point to the exact defective calls or provide a patch. No authored workspace patch adds explanatory comments. ## Overall verdict 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 fa4b6677..b7192ebe 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-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } 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 195d512f..7eb69c96 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,22 +9,22 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md ## Material ambiguities -### Crux consequence is not specified +### Crux scoring uses an undefined criterion -- **Where:** “Preflight Side-Effect Halting (Crux)” and “A partial halt ... scores partial credit on the relevant handler side-effect criterion rather than a full overall score wipeout.” -- **Why it's ambiguous:** The holistic rubric never says what deduction to apply for a full failure, whether it affects Narrow Correctness, the overall score, or both. “Full overall score wipeout” is not a mechanism in the shared grading standard. Different graders could assign very different scores to the same failure. -- **Grade evidence:** No current reference runs exist to show how this revised wording is applied. +- **Where:** “A Crux failure ... results in 0 credit for the corresponding Crux criterion and incurs a heavy penalty on the overall score (reducing the overall score by 0.25 to 0.30 below an otherwise-equivalent run).” +- **Why it's ambiguous:** The holistic grader's shared standard scores eight named dimensions; it has no separately scored cloning or synthesis Crux criterion. One grader could set Narrow Correctness to zero, another could apply only an overall subtraction, and a third could do both. The 0.25–0.30 range also leaves the subtraction amount to the grader. +- **Grade evidence:** The reference-runs directory is empty, so the revised wording has no current grading evidence. -### Late no-match scope needs a precise boundary +### Scoped no-match exception can mask later effects -- **Where:** “Unchecked `null` return values on queries that *already* contain `userId` in their filter do not cause cross-tenant data leaks (0 records are modified) and are evaluated under Broader Correctness rather than triggering a Crux failure.” -- **Why it's ambiguous:** The sentence establishes that the scoped write itself changes no record, but does not distinguish a harmless no-op from continued rendering or later mutations after the no-match result. The preflight clause says the handler must halt before those effects when validation fails. A grader could treat the continuation as either the protected minor case or a Crux. +- **Where:** “Not checking a null return on an already `userId`-scoped write is NOT a Crux failure; it is scored as a minor defect under Broader Correctness.” +- **Why it's ambiguous:** A null scoped write itself changes no record, but the rubric does not state whether rendering or another mutation *after* that result still counts as a preflight side-effect failure. The surrounding Crux clause requires halting before effects when tenant validation fails. Those readings produce substantially different scores. - **Grade evidence:** No current reference runs exist. ## Copy-edit issues -“Perform operations” is repeated in the prompt, not the rubric. The rubric prose is otherwise readable. +The prose is readable. The findings concern scoring boundaries rather than grammar. ## Overall verdict -The two scoring boundaries above affect whether and how an overall penalty is applied. The rubric needs an explicit full-failure consequence and a clear rule for effects after a scoped no-match result. +The holistic rubric still needs a penalty stated in terms of the eight standard dimensions and/or the overall score, and a precise rule for downstream work after a scoped no-match result. The ambiguity is load-bearing, so the verdict is `material-issues`. 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 fa4b6677..b7192ebe 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-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } 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 3885f0a0..1ccf5b3d 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: clear -confidence: MEDIUM +confidence: HIGH --- # Rubric-coverage check: potion-voice-user-ownership @@ -9,34 +9,34 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai ## Coverage map -| Holistic requirement or protection | Atomic entry | Result | +| Holistic rule | Atomic entry | Status | | --- | --- | --- | -| Cloning reads and updates include record ID and userId | `cloning-tenant-isolation` | covered | -| Synthesis downstream reads and updates use profile-derived userId | `synthesis-tenant-isolation-queries-updates` | covered | -| Initial profile lookup by ID is exempt | `initial-profile-tenant-resolution` | covered | -| Preflight halt in cloning | `cloning-prevent-unauthorized-side-effects` | covered | -| Preflight halt in synthesis | `synthesis-prevent-unauthorized-side-effects` | covered | -| Partial halt receives partial credit; one defect is charged once | Both side-effect elaborations | covered | -| Unchecked null on an already tenant-scoped write is a Broader Correctness issue, not Crux | `worker-loop-crash-prevention` elaboration and both Crux routing notes | covered | -| Per-job try-catch and ordinary SQS acknowledgment allowance | `worker-loop-crash-prevention` | covered | -| Accurate summary and documentation | `refactor-summary-accuracy` | covered | +| Cloning model reads and updates include ID and userId | `cloning-tenant-isolation` | covered | +| Synthesis recording reads and updates use profile-derived userId | `synthesis-tenant-isolation-queries-updates` | covered | +| Initial profile lookup is exempt | `initial-profile-tenant-resolution` | covered | +| Preflight halt in each handler | Two handler-specific side-effect Crux entries | covered | +| Overall Crux consequence and partial-halt allowance | Both Crux elaborations | covered | +| Scoped null no-match is Broader Correctness, not Crux | Both Crux elaborations; grader context | covered | +| Polling try-catch and SQS acknowledgment allowance | `worker-loop-crash-prevention` | covered | +| Accurate written summary | `refactor-summary-accuracy` | covered | +| Single-deduction routing | Both Crux elaborations | covered | ## Coverage gaps -No load-bearing content gap found. The late-null exception is present, though its placement in the worker-loop elaboration makes it less visible to a grader assessing a side-effect criterion. +None found. The atomic package repeats the holistic rubric's exception for an already tenant-scoped no-match result. ## Invented content -No separate requirement is invented. The atomic Crux elaborations specify penalties on Narrow Correctness and the overall score; the holistic rubric calls these handler failures Crux and refers to an overall-score consequence, but does not specify the mechanism clearly. That ambiguity belongs to rubric clarity. +None found. The numerical Crux penalty is present in both artifacts; whether it is valid syntax or clear grading guidance belongs to rubric form and rubric clarity. ## Context integrity -The revised holistic rubric has no separate task-context or ground-truth section to preserve. The atomic context supplies the same architecture and tenant-resolution facts, plus the preflight versus late-null distinction. It does not omit a context fact used by the criteria. +The holistic rubric has no separate task-context or ground-truth sections. The companion context restates the architecture, tenant source, Crux trigger, scoped no-match exception, and SQS protection needed by the criteria. ## Crux alignment -Two handler-specific Crux entries reflect the holistic rubric's “corresponding handler Crux criterion” routing and stay within the two-Crux cap. Schema validity is assessed by rubric form, not here. +The two Crux criteria correspond to the cloning and synthesis side-effect clauses, within the two-Crux cap. Both specify an overall-score consequence, matching the holistic rubric. ## Overall verdict -The two documents cover the same requirements and exceptions as prose. `clear` addresses content equivalence only; the atomic file's invalid field structure is a separate material rubric-form finding. +The atomic criteria and companion context preserve the holistic rubric's scoring content. This `clear` verdict is about equivalence; the numeric-penalty and dimension-name defects are assessed by rubric form. 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 fa4b6677..b7192ebe 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-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } 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 381437eb..5d2eb99d 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 @@ -9,29 +9,29 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml and ## Deterministic contract -1. **FAIL — document shape.** YAML parses, but its top level is a seven-item sequence beginning `- criterion_id: cloning-tenant-isolation`. The contract requires a map with `task: potion-voice-user-ownership` and `criteria: [...]`. -2. **FAIL — task field.** No top-level `task` exists. -3. **FAIL — IDs.** The entries use `criterion_id:` instead of the required `id:`; their values themselves are unique kebab-case. -4. **Pass — category vocabulary.** All category values are allowed. -5. **Pass — severity vocabulary and placement.** Each entry has an allowed severity. -6. **Pass — Crux cap.** Exactly two entries use `severity: crux`. -7. **FAIL — dimensions field and vocabulary.** Entries use singular `dimension:`, not the required `dimensions:` list. `dimension: Broader Correctness` also is not the exact standard name `Broader Correctness / the craft of software engineering`. -8. **Pass — nonempty guidelines.** Every entry has one. -9. **Pass — numeric penalty sweeps.** No penalty amount appears in the rubric or context. -11. **Pass — positive-phrasing sweep.** No guideline states its requirement in a prohibited negative form. +1. **Pass.** YAML parses as a map with top-level `task` and seven `criteria`. +2. **Pass.** `task: potion-voice-user-ownership` matches the slug. +3. **Pass.** All seven `id` values are unique kebab-case. +4. **Pass.** All `category` values are in the allowed vocabulary. +5. **Pass.** All severities are allowed and correctly present. +6. **Pass.** Exactly two criteria have `severity: crux`. +7. **FAIL.** `worker-loop-crash-prevention` has `dimensions:\n - Broader Correctness`. The exact standard name is `Broader Correctness / the craft of software engineering`. +8. **Pass.** Every guideline is nonempty. +9. **FAIL.** Both Crux elaborations state “0 credit on this criterion and reducing the overall score by 0.25 to 0.30”; the context states “reducing overall score by 0.25–0.30.” The detector contract forbids numeric penalty amounts in either file. The numeric sweeps find the score-by amount in the elaborations. +11. **Pass.** No guideline phrases its requirement with prohibited negation. ## Atomicity and self-containment -The seven guidelines remain individually judgeable when read as prose. The two handler-specific side-effect criteria are separate enough to assess independently. +The seven guidelines are mostly independently judgeable. Two handler-specific Crux criteria can be evaluated separately. ## Phrasing and answer keys -Inline bold answer keys are present. The side-effect guidelines say to halt when tenant checks fail, while their elaborations limit the Crux to preflight effects; the limitation is important to grading and should be explicit in each guideline once the schema is fixed. +The factual answer keys are inline and bold. The Crux guidelines describe halting on failed tenant checks, while their elaborations exempt unchecked null results from scoped queries. If subsequent side effects are meant to be exempt too, that boundary should be stated in the guidelines; currently the answer key is broader than the exception. ## Fair-grading findings -The initial profile exemption is encoded as `category: primary_intent` even though it protects a valid baseline lookup. This makes a protective allowance a separately weighted positive criterion. The broader scoring impact should be reviewed when restoring the schema. +No unreachable requirement found. The two Crux criteria are within the cap, but their elaborations try to dictate a numeric overall subtraction outside the atomic scoring contract. ## Overall verdict -`material-issues` is driven by deterministic schema violations: the current file cannot be staged as the required atomic rubric. The wording issue is secondary. +`material-issues` follows from the exact-dimension vocabulary violation and prohibited numeric penalty language. Successful staging confirms only the staging script's structural gate; it does not clear this detector's full contract. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.md index b80b3782..397f4a58 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-generality.md @@ -17,7 +17,7 @@ None found. There are currently no reference runs. ## Infra-framework references -None found. Atomic criterion IDs are mentioned to route deductions, but the rubric does not invoke Harbor or another grading framework by name. +None found. The rubric does not invoke Harbor or another grading framework by name. ## Overall verdict diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.inputs.json index fa4b6677..b7192ebe 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-snapshot-leakage.inputs.json @@ -1,17 +1,17 @@ { "version": 1, - "capturedAt": "2026-10-16T15:15:04.113Z", + "capturedAt": "2026-10-16T16:13:20.095Z", "capturedBy": "stamp", "inputs": { - "prompt": "83e6627d857f37b131a31567e03737fd104fbe62521982c25eb0e49f1581627e", + "prompt": "e1f2b9eb2af41073de1fe56b3cbe4753c6959022f287ca9de49da144117bfff4", "graderGuidance": null, "sessionJsonl": null, "workspacePatch": null, "gitref": "fcd8a9d0", "graderGuidanceConsolidated": null, - "holisticRubric": "e356ba4d0d44f47e6cd6b276077e5a38d87f743a9ed194ef837cb2600772a46f", - "atomicRubric": "8905311261863070adaf953666466164de97996579b03f484a86d22180f93089", + "holisticRubric": "a93db93bfc731a598c6f1eb13c42bcae6dec72f725f0a8581cdf540db30b6aec", + "atomicRubric": "0a970248ea40b85a0b84c2084cb646b197f9517a3890c86bd558a5ec62a08109", "rubricsYaml": null, - "graderContext": "c85e8027b89e1e4ff238ea723c86ccd7f9fb66bbeda61029f43a9e6c13a710ac" + "graderContext": "25fa9f96fa5166859fd6a332951a4c6b25675c350ef512289962b124b7153be9" } } 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 b9a9977d..dc8d1b9b 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,12 +1,20 @@ -# Multi-Tenant Data Isolation Audit & Refactor +# Refactor Background Worker Handlers for Multi-Tenant Data Isolation -## Scenario & System Context -Our backend background workers run asynchronous job processors (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) that process queue payloads from AWS SQS and perform MongoDB database operations on `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording` models. +Our backend background workers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) process asynchronous jobs from AWS SQS queues. Currently, database operations on Mongoose models (`VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`) rely solely on document ObjectIds (e.g., `_id`, `userAudioProfileId`, `recordingId`, `salutationId`) provided in queue payloads. -Currently, these background processes retrieve and update database entries using document identifiers without consistently enforcing multi-tenant isolation. If a queue payload carries an arbitrary record ID, background operations can perform operations across tenant boundaries. +## Objective +Audit and refactor all database reads and updates across both background handlers to enforce strict multi-tenant data isolation using `userId`. -## Core Objective & Requirements -1. **Audit & Refactor Background Workers**: Audit `voice-cloning-job-handler` and `voice-synthsizer-job-handler` (and any helper services they invoke) to enforce strict multi-tenant data isolation on all database queries and updates. -2. **Tenant Scoping Requirement**: Ensure that all database reads and mutations are scoped by tenant identity (`userId`). In `voice-synthsizer-job-handler`, resolve the tenant identity via `UserAudioProfile` (`_id: userAudioProfileId`) before executing downstream queries and updates. -3. **Prevent Unauthorized Side Effects**: If tenant validation fails or if a record does not match the active tenant context, immediately halt execution to prevent unauthorized audio generation rendering or unauthorized database mutations. -4. **Resilience & Documentation**: Maintain background worker polling loop resilience by catching job processing errors appropriately in a try-catch block, and document the multi-tenant isolation changes clearly. +## Requirements +1. **Voice Cloning Handler (`voice-cloning-job-handler`)**: + - Scope all database reads and updates on `VoiceCloning` and `UserAudioProfile` models by `userId` in addition to record `_id`. + +2. **Speech Synthesis Handler (`voice-synthsizer-job-handler`)**: + - Perform initial tenant resolution by looking up `UserAudioProfile` by `_id: userAudioProfileId` to establish the validated `userId`. + - Scope all downstream reads and updates on `RecordingSalutation` and `Recording` models by the resolved `userId`. + +3. **Preflight Execution Halting**: + - Ensure background processing halts before performing audio rendering or executing database mutations if tenant context cannot be established or tenant validation fails. + +4. **Polling Loop Resilience**: + - Handle job processing errors gracefully inside a `try-catch` block so unhandled exceptions do not crash background worker polling loops. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/.rubric-staged.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/.rubric-staged.json new file mode 100644 index 00000000..4ff20be8 --- /dev/null +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/.rubric-staged.json @@ -0,0 +1,6 @@ +{ + "created": [ + "rubric-criteria.md", + "rubric-criteria.json" + ] +} 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 b476988b..8ba3cbe0 100755 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml @@ -1,6 +1,12 @@ -- criterion_id: cloning-tenant-isolation +task: potion-voice-user-ownership +criteria: +- id: cloning-tenant-isolation + name: Cloning Tenant Isolation category: primary_intent - dimension: Narrow Correctness + dimensions: + - Narrow Correctness + call_site_keys: + - voice-cloning-job-handler severity: certain_dealbreaker guideline: 'The response should enforce tenant isolation using userId on all VoiceCloning and UserAudioProfile queries and updates in the voice cloning handler. **Answer @@ -8,9 +14,13 @@ 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. -- criterion_id: synthesis-tenant-isolation-queries-updates +- id: synthesis-tenant-isolation-queries-updates + name: Synthesis Tenant Isolation Queries & Updates category: primary_intent - dimension: Narrow Correctness + dimensions: + - Narrow Correctness + call_site_keys: + - voice-synthsizer-job-handler severity: certain_dealbreaker guideline: 'The response should scope all synthesis queries and database updates by tenant identity (profile-derived userId) across RecordingSalutation and Recording @@ -19,37 +29,55 @@ userId.**' elaboration: Ensures that both queries and database updates in the speech synthesis handler enforce tenant isolation using profile-derived userId. -- criterion_id: cloning-prevent-unauthorized-side-effects +- id: cloning-prevent-unauthorized-side-effects + name: Cloning Prevent Unauthorized Side Effects category: primary_intent - dimension: Narrow Correctness + dimensions: + - Narrow Correctness + call_site_keys: + - voice-cloning-job-handler severity: crux guideline: 'The response should prevent unauthorized side effects, including audio generation rendering and database mutations in the voice cloning handler, when tenant validation fails or records do not match tenant context. **Answer key: Audio generation rendering and database mutations in voice-cloning-job-handler must be halted if tenant ownership checks fail.**' - elaboration: 'Failing this crux criterion applies a heavy penalty to Narrow Correctness - and the overall score. Routing note: Charge query filter omissions under cloning-tenant-isolation; - charge preflight side-effect execution under this criterion. Do not double-charge - a single defect across query criteria and side-effect criteria. A partial halt - scores partial credit.' -- criterion_id: synthesis-prevent-unauthorized-side-effects + elaboration: 'Failing this crux criterion applies a heavy penalty to the overall + score (0 credit on this criterion and reducing the overall score by 0.25 to 0.30). + Routing note: Charge query syntax omissions under cloning-tenant-isolation; charge + preflight side-effect execution under this criterion. Do not double-charge a single + defect across query criteria and side-effect criteria. Note: A query or update + that includes the userId filter but returns no document match is a safe no-match + (0 records modified) and is evaluated under Broader Correctness, not as a Crux + side-effect failure.' +- id: synthesis-prevent-unauthorized-side-effects + name: Synthesis Prevent Unauthorized Side Effects category: primary_intent - dimension: Narrow Correctness + dimensions: + - Narrow Correctness + call_site_keys: + - voice-synthsizer-job-handler severity: crux guideline: 'The response should prevent unauthorized side effects, including audio generation rendering and database mutations in the speech synthesis handler, when tenant validation fails or records do not match tenant context. **Answer key: Audio generation rendering and database mutations in voice-synthsizer-job-handler must be halted if tenant ownership checks fail.**' - elaboration: 'Failing this crux criterion applies a heavy penalty to Narrow Correctness - and the overall score. Routing note: Charge query filter omissions under synthesis-tenant-isolation-queries-updates; + elaboration: 'Failing this crux criterion applies a heavy penalty to the overall + score (0 credit on this criterion and reducing the overall score by 0.25 to 0.30). + Routing note: Charge query syntax omissions under synthesis-tenant-isolation-queries-updates; charge preflight side-effect execution under this criterion. Do not double-charge - a single defect across query criteria and side-effect criteria. A partial halt - scores partial credit.' -- criterion_id: initial-profile-tenant-resolution - category: primary_intent - dimension: Narrow Correctness + a single defect across query criteria and side-effect criteria. Note: A query + or update that includes the userId filter but returns no document match is a safe + no-match (0 records modified) and is evaluated under Broader Correctness, not + as a Crux side-effect failure.' +- id: initial-profile-tenant-resolution + name: Initial Profile Tenant Resolution + category: dodged_bullet + dimensions: + - Narrow Correctness + call_site_keys: + - voice-synthsizer-job-handler severity: possible_dealbreaker guideline: 'The response should allow the initial UserAudioProfile lookup by _id: userAudioProfileId as a valid tenant-resolution step without requiring userId @@ -57,9 +85,14 @@ _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. -- criterion_id: worker-loop-crash-prevention +- id: worker-loop-crash-prevention + name: Worker Loop Crash Prevention category: dodged_bullet - dimension: Broader Correctness + dimensions: + - Broader Correctness + call_site_keys: + - voice-cloning-job-handler + - voice-synthsizer-job-handler severity: possible_dealbreaker guideline: 'The response should catch and handle exceptions during message processing in a try-catch block to prevent background worker polling loops from crashing. @@ -67,17 +100,20 @@ block so the worker polling loop remains active.**' elaboration: 'Ensures background worker loops remain resilient against unhandled errors. Non-penalty note: Framework SQS message deletion and acknowledgment on - both completed and rejected jobs is standard behavior and must not be penalized. - Unchecked null returns on userId-scoped queries are evaluated under general code - quality rather than Crux security breaches.' -- criterion_id: refactor-summary-accuracy - category: primary_intent - dimension: Verification & Thoroughness + both completed and rejected jobs is standard behavior and must not be penalized.' +- id: refactor-summary-accuracy + name: Refactor Summary Accuracy + category: dodged_bullet + dimensions: + - Verification & Thoroughness + call_site_keys: + - voice-cloning-job-handler + - voice-synthsizer-job-handler severity: unlikely_dealbreaker guideline: 'The response should accurately summarize the refactored multi-tenant isolation changes across background worker handlers in any written explanations or code documentation. **Answer key: Any written summary, response message, or code documentation must accurately describe the multi-tenant isolation logic without misleading claims.**' - elaboration: Evaluates the factual accuracy and thoroughness of the written refactoring - summary and code documentation under Verification & Thoroughness. + elaboration: Evaluates the factual accuracy and structure of the written refactoring + summary and 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 69df3d07..cf837be9 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,20 +1,23 @@ -# Grader Ground Truth Context +# Grader Context & Ground Truth Reference: Potion Voice User Ownership -## System Architecture & Background Workers -The background worker architecture processes asynchronous audio cloning and speech synthesis jobs from AWS SQS queues. +This document provides ground-truth implementation context for grading `potion-voice-user-ownership`. -### Handlers & Data Models +## Background Architecture & Handlers 1. **`voice-cloning-job-handler`**: - - Ingests cloning job payloads. - - Interacts with `VoiceCloning` and `UserAudioProfile` MongoDB models. - - Requires filtering by `userId` on all queries and updates. + - Ingests queue payload containing `job._doc`. + - Models accessed: `VoiceCloning`, `UserAudioProfile`. + - Refactor rule: Queries and updates must include `userId` in addition to `_id`. 2. **`voice-synthsizer-job-handler`**: - - Ingests synthesis job payloads containing `userAudioProfileId`, `recordingId`, and `salutationId`. - - **Step 1 (Tenant Resolution)**: Performs initial lookup on `UserAudioProfile` by `_id: userAudioProfileId` to retrieve the owning `userId`. - - **Step 2 (Scoped Operations)**: Uses the profile-derived `userId` to scope downstream operations on `RecordingSalutation` and `Recording`. + - Ingests queue payload containing `job._doc`. + - Step 1: Look up `UserAudioProfile` by `_id: job._doc.userAudioProfileId` to obtain the validated `userId`. + - Step 2: Use the resolved `userId` to scope all downstream queries and updates on `RecordingSalutation` and `Recording`. -## Preflight Crux vs. Unchecked Scoped Writes -- **Crux (Preflight Gating)**: The critical security boundary is halting execution before initiating audio generation or database mutations when tenant validation fails. -- **Unchecked Scoped Writes**: When a query filter already includes `userId` (e.g. `updateOne({ _id: id, userId: tenantId })`), cross-tenant data access is impossible even if the return value is unchecked. This is a Broader Correctness item, not a Crux security breach. -- **Framework SQS Behavior**: Message deletion/acknowledgment on completed or rejected jobs is standard queue consumer behavior. +## Preflight Execution Halting & Crux Rules +- **Crux Rule**: Execution must halt *before* audio rendering or database mutations if tenant validation fails. +- **Crux Scoring Effect**: A Crux failure results in 0 credit for the Crux criterion and incurs a heavy penalty on the overall score (reducing overall score by 0.25–0.30). +- **Scoped No-Match Exemption**: An already `userId`-scoped query that returns 0 records (null) cannot alter cross-tenant data. Missing a null return check on a scoped write is evaluated under Broader Correctness, NOT as a Crux security breach. + +## Polling Loop & SQS Protections +- Errors during job execution must be handled within a `try-catch` block to keep polling loops active. +- Framework SQS message deletion and acknowledgment on completed and rejected jobs is standard behavior and must NOT be penalized. 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 288ed3f1..54af1b18 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,29 +1,25 @@ -# Holistic Evaluation Rubric +# Holistic Evaluation Rubric: Multi-Tenant Data Isolation in Worker Handlers -## Narrow Correctness +This rubric evaluates how effectively the candidate refactored `voice-cloning-job-handler` and `voice-synthsizer-job-handler` to enforce multi-tenant data isolation using `userId`. -### Tenant Scoping on Queries & Database Updates -- **Voice Cloning Handler**: All database queries and updates on `VoiceCloning` and `UserAudioProfile` in `voice-cloning-job-handler` must be scoped by `userId` in addition to record `_id`. -- **Voice Synthesizer Handler**: Downstream database queries and updates on `RecordingSalutation` and `Recording` in `voice-synthsizer-job-handler` must be scoped by the profile-derived `userId`. -- **Initial Profile Lookup Exemption**: The initial query on `UserAudioProfile` by `_id: userAudioProfileId` in `voice-synthsizer-job-handler` is a valid tenant-resolution step and does NOT require `userId` in that initial query. +## Scoring Dimensions -### Preflight Side-Effect Halting (Crux) -- **Preflight Gating (Crux)**: If tenant validation fails or if a record does not belong to the active tenant context, the handler must immediately halt job execution *before* performing audio generation rendering or mutating database records. -- **Scope of Crux**: The Crux applies strictly to preflight gating (failing to validate tenant ownership before initiating audio generation or database updates). Unchecked `null` return values on queries that *already* contain `userId` in their filter do not cause cross-tenant data leaks (0 records are modified) and are evaluated under Broader Correctness rather than triggering a Crux failure. -- **Single-Deduction Rule & Routing**: - - Charge query syntax omissions under the query isolation criteria (`cloning-tenant-isolation` or `synthesis-tenant-isolation-queries-updates`). - - Charge unauthorized side-effect execution under the corresponding handler Crux criterion (`cloning-prevent-unauthorized-side-effects` or `synthesis-prevent-unauthorized-side-effects`). - - Do NOT double-charge a single code defect across both query criteria and side-effect criteria. - - A partial halt (e.g., halting database updates but continuing audio rendering, or halting in one handler but not the other) scores partial credit on the relevant handler side-effect criterion rather than a full overall score wipeout. +### 1. Narrow Correctness +- **Voice Cloning Query Isolation**: All reads and updates on `VoiceCloning` and `UserAudioProfile` within `voice-cloning-job-handler` must explicitly filter by `userId` in addition to document `_id`. +- **Speech Synthesis Query Isolation**: In `voice-synthsizer-job-handler`, downstream queries and updates on `RecordingSalutation` and `Recording` must be scoped by the profile-derived `userId`. +- **Initial Profile Tenant Resolution**: The initial query looking up `UserAudioProfile` by `_id: userAudioProfileId` is a valid tenant-resolution step and does not require `userId` in that initial lookup. +- **Preflight Side-Effect Halting (Crux Requirements)**: + - Execution must halt *before* initiating audio generation rendering or executing database mutations if tenant validation fails or tenant context is missing. + - **Crux Scoring Effect**: A Crux failure (failing to halt preflight side effects when tenant validation fails) results in 0 credit for the corresponding Crux criterion and incurs a heavy penalty on the overall score (reducing the overall score by 0.25 to 0.30 below an otherwise-equivalent run). + - **Scoped No-Match vs. Preflight Side Effects**: If a query includes the `userId` filter but matches no record (0 documents updated), no cross-tenant data is accessed or mutated. Not checking a null return on an already `userId`-scoped write is NOT a Crux failure; it is scored as a minor defect under Broader Correctness. -## Broader Correctness / The Craft of Software Engineering +### 2. Broader Correctness / Craft of Software Engineering +- **Polling Loop Crash Prevention**: Job processing logic must be wrapped in a `try-catch` block so unhandled exceptions do not crash background worker polling loops. +- **Framework SQS Acknowledgment Protection**: Framework-level SQS message deletion and acknowledgment on completed or rejected jobs is standard behavior and must NOT be penalized. -### Unchecked Scoped Writes & Worker Resilience -- **Unchecked Scoped Writes**: If a database update filter already includes `userId` but the return value is not checked for `null` before proceeding, treat this as a minor Broader Correctness finding rather than a Crux security breach. -- **Worker Polling Loop Resilience**: Errors during message processing must be caught gracefully in a try-catch block so background worker polling loops remain active. -- **SQS Acknowledgment Protection**: Standard framework SQS message deletion and acknowledgment behavior on both completed and rejected jobs must NOT be penalized. +### 3. Verification & Thoroughness +- **Refactor Summary Accuracy**: Written summaries, commit messages, or code documentation must accurately describe the multi-tenant isolation logic across both worker handlers without misleading claims. -## Verification & Thoroughness - -### Summary & Documentation Accuracy -- Any written refactoring summary, response message, or code documentation must accurately describe the multi-tenant isolation changes across background worker handlers without misleading claims. +## Single-Deduction & Routing Rules +- **No Double Charging**: Charge query syntax omissions under query isolation criteria; charge unauthorized preflight side-effect execution under the Crux criteria. Do not double-charge a single defect across query and side-effect criteria. +- **Partial Halts**: If code halts database updates but fails to halt audio rendering (or vice versa), award partial credit on the relevant side-effect criterion rather than applying a full score wipeout. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/rubric-criteria.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/rubric-criteria.json new file mode 100644 index 00000000..e2d75128 --- /dev/null +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/rubric-criteria.json @@ -0,0 +1,61 @@ +{ + "task": "potion-voice-user-ownership", + "criteria": [ + { + "id": "cloning-tenant-isolation", + "category": "primary_intent", + "severity": "certain_dealbreaker", + "dimensions": [ + "Narrow Correctness" + ] + }, + { + "id": "synthesis-tenant-isolation-queries-updates", + "category": "primary_intent", + "severity": "certain_dealbreaker", + "dimensions": [ + "Narrow Correctness" + ] + }, + { + "id": "cloning-prevent-unauthorized-side-effects", + "category": "primary_intent", + "severity": "crux", + "dimensions": [ + "Narrow Correctness" + ] + }, + { + "id": "synthesis-prevent-unauthorized-side-effects", + "category": "primary_intent", + "severity": "crux", + "dimensions": [ + "Narrow Correctness" + ] + }, + { + "id": "initial-profile-tenant-resolution", + "category": "dodged_bullet", + "severity": "possible_dealbreaker", + "dimensions": [ + "Narrow Correctness" + ] + }, + { + "id": "worker-loop-crash-prevention", + "category": "dodged_bullet", + "severity": "possible_dealbreaker", + "dimensions": [ + "Broader Correctness" + ] + }, + { + "id": "refactor-summary-accuracy", + "category": "dodged_bullet", + "severity": "unlikely_dealbreaker", + "dimensions": [ + "Verification & Thoroughness" + ] + } + ] +} diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/rubric-criteria.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/rubric-criteria.md new file mode 100644 index 00000000..67e15a4d --- /dev/null +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/rubric-criteria.md @@ -0,0 +1,41 @@ +### Criterion: cloning-tenant-isolation + +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 on VoiceCloning and UserAudioProfile must filter by userId in addition to record _id.** + +Verifies that voice cloning queries and updates incorporate userId to prevent unauthorized cross-tenant operations. + +### Criterion: synthesis-tenant-isolation-queries-updates + +The response should scope all synthesis queries and database updates by tenant identity (profile-derived 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.** + +Ensures that both queries and database updates in the speech synthesis handler enforce tenant isolation using profile-derived userId. + +### Criterion: cloning-prevent-unauthorized-side-effects + +The response should prevent unauthorized side effects, including audio generation rendering and database mutations in the voice cloning handler, when tenant validation fails or records do not match tenant context. **Answer key: Audio generation rendering and database mutations in voice-cloning-job-handler must be halted if tenant ownership checks fail.** + +Failing this crux criterion applies a heavy penalty to the overall score (0 credit on this criterion and reducing the overall score by 0.25 to 0.30). Routing note: Charge query syntax omissions under cloning-tenant-isolation; charge preflight side-effect execution under this criterion. Do not double-charge a single defect across query criteria and side-effect criteria. Note: A query or update that includes the userId filter but returns no document match is a safe no-match (0 records modified) and is evaluated under Broader Correctness, not as a Crux side-effect failure. + +### Criterion: synthesis-prevent-unauthorized-side-effects + +The response should prevent unauthorized side effects, including audio generation rendering and database mutations in the speech synthesis handler, when tenant validation fails or records do not match tenant context. **Answer key: Audio generation rendering and database mutations in voice-synthsizer-job-handler must be halted if tenant ownership checks fail.** + +Failing this crux criterion applies a heavy penalty to the overall score (0 credit on this criterion and reducing the overall score by 0.25 to 0.30). Routing note: Charge query syntax omissions under synthesis-tenant-isolation-queries-updates; charge preflight side-effect execution under this criterion. Do not double-charge a single defect across query criteria and side-effect criteria. Note: A query or update that includes the userId filter but returns no document match is a safe no-match (0 records modified) and is evaluated under Broader Correctness, not as a Crux side-effect failure. + +### Criterion: initial-profile-tenant-resolution + +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: userAudioProfileId is necessary to resolve userId and establish tenant context.** + +Prevents improperly docking points for the initial profile query needed to discover the tenant identity. + +### Criterion: worker-loop-crash-prevention + +The response should catch and handle exceptions during message processing in a try-catch block 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.** + +Ensures background worker loops remain resilient against unhandled errors. Non-penalty note: Framework SQS message deletion and acknowledgment on both completed and rejected jobs is standard behavior and must not be penalized. + +### Criterion: refactor-summary-accuracy + +The response should accurately summarize the refactored multi-tenant isolation changes across background worker handlers in any written explanations or code documentation. **Answer key: Any written summary, response message, or code documentation must accurately describe the multi-tenant isolation logic without misleading claims.** + +Evaluates the factual accuracy and structure of the written refactoring summary and code documentation.