pre-trial detector run 07 - all good

This commit is contained in:
2026-10-16 13:08:25 -04:00
parent 6ff10adaa9
commit b1ef2ab681
35 changed files with 261 additions and 296 deletions

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -5,44 +5,44 @@ confidence: HIGH
---
# Answer-obviousness check: potion-voice-user-ownership
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md against instruction.md
Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md and tests/holistic-rubric.md
## What the prompt asks
The prompt directly asks the agent to scope every named user-owned database operation by `userId`, derive the synthesis tenant from the initial profile lookup, halt rendering and mutations on failed ownership validation or missing records, handle lookup/update no-matches gracefully, protect worker loops with try-catch, and summarize the change. These are hard implementation requirements rather than unstated choices.
The prompt asks for a concrete security refactor: scope the four named models' reads and updates by tenant, permit the initial profile lookup needed to derive userId, stop rendering and mutations when ownership cannot be established, preserve worker polling through caught errors, and summarize the work. These are explicit deliverables, while locating every operation and implementing safe control flow remain substantive work.
## Per-expectation assessment
### Tenant-scoped database operations — obvious
- **What the rubric requires:** “Enforces `userId` filtering on all database queries and updates across `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`.”
- **Is it obvious from the prompt?** Yes. Requirement 1 names the same four collections and expressly requires every read, query, and update to filter by both `_id` and `userId`.
- **Verdict for this expectation:** `obvious`.
- **What the rubric requires:** “All queries and database updates on `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording` must include `userId` filtering (except the initial `UserAudioProfile` lookup by `_id: userAudioProfileId` used to resolve tenant identity).”
- **Is it obvious from the prompt?** Yes. The prompt names the same models and explicitly requires tenant filtering on all their queries and updates.
- **Verdict for this expectation:** obvious.
### Profile-derived synthesis tenant — obvious
### Initial profile tenant resolution — obvious
- **What the rubric requires:** “Performs initial tenant lookup on `UserAudioProfile` by `_id: userAudioProfileId` ... then scopes all downstream operations by that `userId`.”
- **Is it obvious from the prompt?** Yes. Requirement 1 prescribes that exact resolution sequence.
- **Verdict for this expectation:** `obvious`.
- **What the rubric requires:** “except the initial `UserAudioProfile` lookup by `_id: userAudioProfileId` used to resolve tenant identity”
- **Is it obvious from the prompt?** Yes. Requirement 1 states this exception verbatim.
- **Verdict for this expectation:** obvious.
### Preflight gating and scoped no-match handling — obvious
### Failed-preflight side-effect gate — obvious
- **What the rubric requires:** Side effects stop when ownership checks fail, while “Missing a `null` check on an already tenant-scoped update” is a minor craft defect.
- **Is it obvious from the prompt?** Yes. Requirement 2 expressly says to halt rendering and mutations when validation fails or required records do not match, and to “Gracefully handle database lookups and update results when ... records are not found.” The rubric's expectation is cued without prescribing the handler's exact control-flow design.
- **Verdict for this expectation:** `obvious`.
- **What the rubric requires:** “If a preflight lookup or update returns null / 0 matched records, and the handler STILL proceeds to render audio or execute side effects, this is a **Crux failure** (unauthorized side effect executed).”
- **Is it obvious from the prompt?** Yes. Requirement 2 expressly requires job execution, rendering, and mutations to halt when tenant validation or ownership establishment fails.
- **Verdict for this expectation:** obvious.
### Worker-loop resilience — obvious
- **What the rubric requires:** “Catches errors during message processing in try-catch blocks so background worker polling loops remain active.”
- **Is it obvious from the prompt?** Yes. Requirement 3 asks for the same behavior.
- **Verdict for this expectation:** `obvious`.
- **What the rubric requires:** “Unhandled errors during message processing must be caught gracefully in a try-catch block so the worker loop remains active.”
- **Is it obvious from the prompt?** Yes. Requirement 2 asks for try-catch handling specifically to prevent a worker-process crash.
- **Verdict for this expectation:** obvious.
### Accurate documentation — obvious
### Accurate concise summary — obvious
- **What the rubric requires:** “Accurately describes the implemented multi-tenant security logic in documentation.”
- **Is it obvious from the prompt?** Yes. Requirement 4 explicitly asks for a clear, accurate summary.
- **Verdict for this expectation:** `obvious`.
- **What the rubric requires:** “Any written summary or response documentation must accurately describe the multi-tenant isolation refactoring without misleading or false security claims.”
- **Is it obvious from the prompt?** Yes. Requirement 3 explicitly asks for a concise summary; accuracy is an ordinary minimum for that deliverable.
- **Verdict for this expectation:** obvious.
## Overall verdict
Every load-bearing expectation is directly inferable from the prompt, including graceful handling of missing lookup and update results. The prompt leaves meaningful implementation work—finding every call site, arranging the gates, and preserving loop behavior—so it does not give the solution away. The overall verdict is `obvious`.
Every load-bearing expectation is the direct, professionally obvious interpretation of the request. The prompt specifies the desired security properties without supplying call-site discovery or an implementation, so it is precise rather than over-cued.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -5,26 +5,24 @@ confidence: MEDIUM
---
# Broken-dev-env check: potion-voice-user-ownership
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md, instruction.md, task.toml, the materialized workspace, and available run artifacts
Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md, task.toml, tests/holistic-rubric.md, environment/Dockerfile, and the materialized workspace
## Verbatim grounding
The prompt's premise is:
> “Currently, background workers retrieve and update database entries using only job or document identifiers provided in queue messages without validating tenant identity (`userId`).”
> “A recent security audit revealed a critical multi-tenant isolation vulnerability: job handlers retrieve and mutate database records using only record identifiers (`_id` or job IDs) supplied in queue payloads, without scoping queries and updates to the authenticated user/tenant context.”
The shipped cloning handler contains the matching ID-only write:
The shipped cloning handler contains the corresponding ID-only write:
> `await voiceCloningService.update({ _id, status: 'processing' })`
Static baseline checks returned:
Fresh static checks established:
> `javascript-syntax: pass`
> `json-manifests: pass`
> `selected-workspace-vs-commit: pass`
> All JavaScript files pass node --check; all non-corpus JSON manifests parse; the materialized workspace has no diff from source commit fcd8a9d0b00406bda1943c234a8f2fecaff9f774.
## Rationale
The ID-only accesses are the application defect the prompt asks the agent to repair, not incidental environment breakage. The declared commit `fcd8a9d0` resolves locally, the materialized load-bearing files match that commit, every JavaScript file under the handlers and shared services passes `node --check`, and the package manifests parse. The repository intentionally carries no test script, which is consistent with the toolkit-managed environment rather than an unrelated red suite.
The unscoped data access is the application defect the prompt asks the agent to repair, not incidental environment breakage. The declared commit resolves locally, the materialized workspace matches it, the JavaScript parses, and the package manifests parse. The repository intentionally has no test script, matching the generated Dockerfile's “no test suite” configuration rather than exposing an unrelated red suite.
No reference runs exist yet, so run-corruption and run-to-rubric drift cannot be cross-checked. The statically checkable premise, workspace, and packaged rubric revision are coherent, and no unrelated setup failure is evidenced; the pre-trial verdict is `clean` at medium confidence.
There are no reference runs yet, so run corruption and run-to-rubric revision joins cannot be checked. The workspace-checkable premise and packaged artifacts are coherent, and no unrelated setup failure is evidenced; the pre-trial verdict is clean at medium confidence.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -11,13 +11,13 @@ Assessed: environment/Dockerfile, instruction.md, tests/*.md, the absent workspa
### Pre-existing connection URLs — credential (informational)
- **Where:** The materialized source checkout's four `voice-*-job-handler/pm2-{development,production}.yml` files. No value is reproduced here.
- **Where:** The materialized source checkout's four voice-*-job-handler/pm2-{development,production}.yml files. No value is reproduced here.
- **What:** URL-embedded credential-shaped candidates, fully redacted.
- **Why it's a finding:** The deterministic sweep found the candidates only in the materialized baseline checkout. With no `environment/workspace.patch`, these files are source-repository content at the declared commit, not lines authored by this task.
- **Why it's a finding:** The deterministic sweep found candidates only in the materialized baseline checkout. With no environment/workspace.patch, these files are source-repository content at the declared commit, not content authored by this task.
- **Action:** The source-repository owner may assess and rotate any live values. The task author should not rewrite baseline source merely to clear this detector.
The authored-surface sweeps found no well-known secret shape, authoring-environment variable assignment, proxy endpoint, private-key block, or checkout path.
The authored-surface sweeps found no well-known secret shape, authoring-environment variable assignment, proxy endpoint, private-key block, bearer token, or checkout path.
## Overall verdict
No credential-shaped value appears on a task-authored surface. The only candidates are pre-existing repository content and are informational, so the verdict remains `clean`.
No credential-shaped value appears on a task-authored surface. The only candidates are pre-existing repository content and are informational, so the verdict is clean.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -5,16 +5,16 @@ confidence: HIGH
---
# Cross-task-reference check: potion-voice-user-ownership
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md, instruction.md, and authored workspace additions
Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md, tests/holistic-rubric.md, and authored workspace additions
## Verbatim grounding
The strongest near-miss is the rubric title's self-identifier:
The strongest near-miss is the source-module naming in the prompt:
> “Holistic Rubric: Multi-Tenant Worker Isolation (`potion-voice-user-ownership`)”
> “voice cloning (`voice-cloning-job-handler`) and speech synthesis (`voice-synthsizer-job-handler`)”
The prompt also names `voice-cloning-job-handler` and `voice-synthsizer-job-handler`, which are directories in this task's own source repository. No workspace patch exists.
These names resolve to directories in this task's own source repository. No workspace patch exists.
## Rationale
The slug identifies this task itself, and the handler names identify its source files; neither points to a sibling task. The prompt and rubric contain no comparison to, calibration from, or dependency on another task, so the package is `clean` on this axis.
The handler names identify in-repository modules, not sibling tasks. The prompt and rubric contain no comparison to, calibration from, or dependency on another task, so the package is self-contained and clean.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -9,14 +9,14 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Verbatim grounding
> “Failing a Crux requirement indicates an unauthorized side-effect risk, applying a heavy penalty to Narrow Correctness and a heavy penalty to the overall score.”
> “**Deduction Guidance**: Failing a Crux side-effect criterion applies a heavy penalty to Narrow Correctness and a heavy penalty to the overall score. Charge preflight side-effect execution under Crux criteria (`cloning-prevent-unauthorized-side-effects` / `synthesis-prevent-unauthorized-side-effects`).”
> “Missing a `null` check on an already tenant-scoped update is evaluated as a minor defensive programming defect under Broader Correctness / the craft of software engineering, NOT as a Crux security failure.”
> “If a database update ALREADY includes the `userId` tenant filter (ensuring 0 records are modified if ownership fails), but the code fails to check the null/zero-match return value, AND NO downstream unauthorized side effects (like audio rendering) occur, this is evaluated as a minor defensive programming defect under Broader Correctness (`scoped-update-null-handling`), NOT a Crux security breach.”
The relevant routing rules are: Narrow Correctness grades whether the requested deliverable works; Broader Correctness grades reliability and defensive craft; a single penalty naming both a criterion and the overall score is sanctioned.
The applicable routing rules are: Narrow Correctness grades whether the requested deliverable works; Broader Correctness grades reliability and defensive craft; a single penalty naming both a criterion and the overall score is a sanctioned form.
## Rationale
Continuing rendering or mutations after a failed ownership gate breaks the requested behavior, so Narrow Correctness is the correct task-specific dimension. Naming Narrow Correctness and the overall score in one penalty is the defined both-places form, not double-charging.
An unchecked result from an otherwise tenant-scoped operation is routed to defensive reliability craft, which Broader Correctness owns. The rubric does not misuse Integrity, invent a criterion name, exclude a standard dimension, or separately recharge one defect. With no reference runs, there is no grade-drift evidence to add. The verdict is `clean`.
An unchecked no-match from an otherwise safely tenant-scoped operation, with no downstream unauthorized effect, is a defensive reliability issue that Broader Correctness owns. Summary accuracy can also evidence Verification & Thoroughness; the rubric does not prevent an Integrity charge if a particular run knowingly misdescribes its own work. No non-canonical criterion, wholesale exclusion, or unsupported duplicate charge appears. With no reference runs, there is no grade-drift evidence. The verdict is clean.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -6,8 +6,8 @@ claims:
- id: c01
verdict: pass
loadBearing: true
summary: "The four named collections expose userId and are used by the handlers"
rubricQuote: "Enforces `userId` filtering on all database queries and updates across `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`."
summary: "The four named models expose userId and are used by the handlers"
rubricQuote: "All queries and database updates on `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording` must include `userId` filtering (except the initial `UserAudioProfile` lookup by `_id: userAudioProfileId` used to resolve tenant identity)."
sourceEvidence: |-
userId: {
type: Schema.Types.ObjectId,
@@ -19,13 +19,13 @@ claims:
_id: salutationId,
deleted: false,
})
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_model.js (lines 4-10), voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js (lines 4-10), voice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js (lines 4-10), voice-synthsizer-job-handler/recording/recording_model.js (lines 3-9), and both handler index.js files"
note: "All four models expose a userId field and the active handlers access them. The target scoping fact is directly reachable in the workspace."
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace: the four named model files plus both handler index.js files"
note: "All four models expose a userId field and the active handlers access them. The target-scoping fact is directly reachable in the workspace."
- id: c02
verdict: pass
loadBearing: true
summary: "The initial synthesis profile lookup supplies the profile-derived userId"
rubricQuote: "Performs initial tenant lookup on `UserAudioProfile` by `_id: userAudioProfileId` in `voice-synthsizer-job-handler` to establish tenant identity (`userId`), then scopes all downstream operations by that `userId`."
summary: "The initial synthesis profile lookup supplies profile-derived userId"
rubricQuote: "All queries and database updates on `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording` must include `userId` filtering (except the initial `UserAudioProfile` lookup by `_id: userAudioProfileId` used to resolve tenant identity)."
sourceEvidence: |-
const userAudioProfile = await userAudioProfileService.find({
_id: userAudioProfileId,
@@ -38,8 +38,8 @@ claims:
- id: c03
verdict: pass
loadBearing: true
summary: "A full tenant-scoped no-match does not mutate another tenant's document"
rubricQuote: "A query or update that includes the `userId` filter but returns no document match is a safe no-match (0 records modified) and cannot breach cross-tenant data."
summary: "A tenant-scoped no-match mutates no document"
rubricQuote: "If a database update ALREADY includes the `userId` tenant filter (ensuring 0 records are modified if ownership fails), but the code fails to check the null/zero-match return value, AND NO downstream unauthorized side effects (like audio rendering) occur, this is evaluated as a minor defensive programming defect under Broader Correctness (`scoped-update-null-handling`), NOT a Crux security breach."
sourceEvidence: |-
const updatedSalutation = await Salutation.findOneAndUpdate(
{ _id: salutation._id, userId },
@@ -47,32 +47,32 @@ claims:
{ new: true }
)
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js (lines 23-29)"
note: "The database mutation is conditioned on both _id and userId; if no document satisfies the full predicate, findOneAndUpdate returns no match and mutates none. This verifies the operation itself, not the safety of later side effects, and the mechanism is reachable in the workspace."
note: "The mutation predicate includes both _id and userId; a document owned by another tenant does not match and therefore is not modified. The distinction is reachable from the workspace."
- id: c04
verdict: pass
loadBearing: true
summary: "Both handlers implement long-running polling loops around processQueue"
rubricQuote: "Catches errors during message processing in try-catch blocks so background worker polling loops remain active."
summary: "Both handlers implement long-running processQueue polling loops"
rubricQuote: "Unhandled errors during message processing must be caught gracefully in a try-catch block so the worker loop remains active."
sourceEvidence: |-
try {
while (true) {
await processQueue()
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/index.js (lines 323-330) and voice-synthsizer-job-handler/index.js (lines 258-265)"
note: "Both handlers contain the polling-loop structure and message-processing catches the rubric addresses. The relevant control flow is directly reachable in the workspace."
note: "Both handlers contain the long-running polling structure the requirement protects, and both structures are directly reachable in the workspace."
- id: c05
verdict: partial
loadBearing: false
summary: "SQS deletion is explicit application code rather than automatic framework acknowledgment"
rubricQuote: "Standard framework SQS message deletion and acknowledgment on both completed and rejected jobs is expected behavior and must not be penalized."
rubricQuote: "Framework SQS message deletion and acknowledgment on both completed and rejected jobs is standard framework behavior and must not be penalized."
sourceEvidence: |-
await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/index.js (line 130), voice-synthsizer-job-handler/index.js (line 72), and app/services/sqs/sqs_service.js (lines 27-48)"
note: "The handlers delete each message explicitly before processing, so calling deletion 'framework' behavior is imprecise. The must-not-penalize allowance remains a clear normative scope rule, making the drift non-load-bearing."
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/index.js (line 130), voice-synthsizer-job-handler/index.js (line 72), and app/services/sqs/sqs_service.js"
note: "The handlers explicitly delete each message before processing, so the label 'framework behavior' is imprecise. The must-not-penalize rule remains a normative allowance, making this factual drift non-load-bearing."
---
# Fact-check rubric claims: potion-voice-user-ownership
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
Source: `harbor-tasks/potion-voice-user-ownership/environment/workspace/` — materialized from `repos/potion-voice` commit `fcd8a9d0b00406bda1943c234a8f2fecaff9f774` (declared in `task.toml`), with no workspace patch.
Source: harbor-tasks/potion-voice-user-ownership/environment/workspace/ — materialized from repos/potion-voice commit fcd8a9d0b00406bda1943c234a8f2fecaff9f774, with no workspace patch.
Checked 5 claims: 4 load-bearing passes and 1 non-load-bearing partial. No claim is unclear, false, or unreachable. The top-level verdict is `pass` because the only drift is the non-load-bearing “framework behavior” label.
Checked 5 claims: 4 load-bearing passes and 1 non-load-bearing partial. No claim is unclear, false, or unreachable. The top-level verdict is pass because the only drift is the non-load-bearing “framework behavior” label.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -9,18 +9,12 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Positive target present?
Yes. The dedicated “High-Quality Response” section affirmatively says a strong response:
> “Enforces `userId` filtering on all database queries and updates across `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`.”
> “Halts execution prior to audio generation rendering or database mutations if tenant validation fails or tenant context cannot be established.”
It also positively specifies update-result handling, loop resilience, and accurate documentation.
Yes. The Primary Intent affirmatively says the candidate must “audit database operations in both worker handlers, enforce tenant scoping using `userId` (or profile-derived `userId`), halt unauthorized side effects when tenant validation fails, and maintain background worker loop resilience.” The scored guidance then names the affected models, permitted initial lookup, side-effect boundary, null-result treatment, try-catch behavior, and accurate summary.
## What the grader has to infer
The grader must assess the implementation's exact control flow and helper design, but it does not have to reverse-engineer success from penalties alone. The positive target names the affected models, tenant source, side-effect boundary, error-handling behavior, and documentation outcome.
The grader must evaluate each implementation's exact call sites and control flow, but it does not have to reverse-engineer success from penalties alone. The positive requirements define the load-bearing behavior directly, while the negative Crux rule distinguishes the severe failure.
## Overall verdict
The rubric gives a concrete affirmative model for every load-bearing part of a strong response. It therefore `defines-good`.
The rubric provides a concrete affirmative model for every load-bearing part of a strong response. It therefore defines good.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -1,11 +1,11 @@
---
detector: detector-good-response-exhaustiveness
verdict: exhaustive
confidence: MEDIUM
confidence: HIGH
---
# Good-response-exhaustiveness check: potion-voice-user-ownership
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and instruction.md
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Plausible strong-response approaches
@@ -13,10 +13,10 @@ This is a direct implementation request with one broad strong-response shape: es
## Coverage in the rubric
The rubric scores observable tenant predicates and side-effect ordering rather than prescribing a helper architecture. Its initial-profile allowance supports the required synthesis bootstrap, and its positive target leaves room for either explicit preflight reads or checked tenant-scoped operations. No major clarify-vs-act, build-vs-buy, assess-vs-fix, or defer-vs-push-back fork is present.
The rubric scores observable tenant predicates and side-effect ordering rather than prescribing a helper architecture. The initial-profile exception supports the required tenant bootstrap. The explicit distinction between a preflight no-match followed by side effects and an unchecked safely scoped update with no downstream effect leaves room for both preflight-read and checked-update designs.
No reference runs exist, so the run-evidenced penalty-side patterns are not available to assess.
No major clarify-vs-act, build-vs-buy, assess-vs-fix, or defer-vs-push-back fork applies. No reference runs exist, so the run-evidenced penalty-side patterns are unavailable.
## Overall verdict
Every major implementation approach that satisfies the explicit ownership gate has a scored home. The separate null-result contradiction is a clarity/form defect, not an omitted broad response path, so the rubric is `exhaustive`.
Every major implementation approach that satisfies the ownership gate has a scored home. The rubric is exhaustive.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -11,16 +11,16 @@ Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md, tests/holisti
### AWS SQS and audio generation — external-sounding context (cleared)
- **Where:** `instruction.md`, Background.
- **Where:** instruction.md, Background.
- **Quote:**
> “Our asynchronous background processing tier handles voice cloning and speech synthesis jobs via AWS SQS queues.”
> “These workers consume job messages from AWS SQS queues and interact with MongoDB models (`VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, `Recording`).”
- **Why it stays inside:** The graded work is repository-local query construction, ownership gating, control-flow ordering, and exception handling. Success does not require operating a live SQS queue, production MongoDB, or deployed audio service; the handler calls can be inspected or locally stubbed.
- **Why it stays inside:** The graded work is repository-local query construction, ownership gating, control-flow ordering, and exception handling. Success does not require operating a live SQS queue, production MongoDB, or deployed audio service; handler calls can be inspected and locally stubbed.
- **Something to consider:** Keep verification focused on filter arguments and proving that downstream calls are skipped after a failed gate.
The root and handler manifests already declare the named runtime libraries (`aws-sdk`, `mongoose`, `fs-extra`, and `uuid`), and the relevant handler/model code is present. The task requires no new package, remote dataset, deployment, or live-system observation.
The root and handler manifests already declare the named runtime libraries, including aws-sdk, mongoose, fs-extra, and uuid. The task requires no new package, remote dataset, deployment, or live-system observation.
## Overall verdict
A competent SWE can implement and verify every load-bearing criterion from the initialized workspace. External systems are scenario context rather than the location of the success criteria, so the task is `offline-verifiable`.
A competent SWE can implement and verify every load-bearing criterion from the initialized workspace. External systems are scenario context rather than the location of the success criteria, so the task is offline-verifiable.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -11,16 +11,16 @@ Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md, the absent wo
### Named tenant predicates — prompt near-miss (cleared)
- **Where:** `instruction.md`, Tenant Isolation on Database Operations.
- **Where:** instruction.md, Audit & Scope Database Operations.
- **Quote:**
> “Ensure all database reads, queries, and updates on user-owned collections (`VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`) filter by `userId` in addition to record `_id`.”
> “Incorporate tenant filtering (using `userId` or profile-derived `userId`) on all queries and updates involving `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`.”
- **What it pre-empts:** The sentence names the required security property and affected models, but it does not identify every call site, prescribe the control flow, or implement the filters.
- **De-hinting option:** None recommended; this is a concrete acceptance criterion a real security refactor request would state.
The profile-derived tenant source, preflight gate, and try-catch rule are likewise deliverable constraints. There is no `environment/workspace.patch`, so no task-authored code comment can point at the implementation.
The profile-derived tenant source, failed-validation gate, and try-catch rule are likewise deliverable constraints. There is no environment/workspace.patch, so no task-authored code comment can point at the implementation.
## Overall verdict
The prompt is precise about what must be built while leaving the agent to trace both handlers and design the safe control flow. The graded implementation difficulty survives the wording, so the verdict is `clean`.
The prompt is precise about what must be built while leaving the agent to trace both handlers and design safe control flow. The graded implementation difficulty survives the wording, so the verdict is clean.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -1,6 +1,6 @@
---
detector: detector-rubric-clarity
verdict: material-issues
verdict: clear
confidence: HIGH
---
# Rubric-clarity check: potion-voice-user-ownership
@@ -9,24 +9,18 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Material ambiguities
### A scoped preflight no-match is both Crux and minor
None found. In particular, the side-effect and null-result rules now draw an applyable boundary:
- **Where:** The Crux distinction says:
> “**Crux Rule**: If a preflight lookup or update returns null / 0 matched records, and the handler STILL proceeds to render audio or execute side effects, this is a **Crux failure** (unauthorized side effect executed).”
> “A Crux failure occurs ONLY when audio generation rendering or database mutations execute *before* or *when* tenant ownership checks fail or tenant context cannot be established.”
> “If a database update ALREADY includes the `userId` tenant filter (ensuring 0 records are modified if ownership fails), but the code fails to check the null/zero-match return value, AND NO downstream unauthorized side effects (like audio rendering) occur, this is evaluated as a minor defensive programming defect under Broader Correctness (`scoped-update-null-handling`), NOT a Crux security breach.”
The next bullet says:
> “Missing a `null` check on an already tenant-scoped update is evaluated as a minor defensive programming defect under Broader Correctness / the craft of software engineering, NOT as a Crux security failure.”
- **Why it's ambiguous:** A response can use a tenant-scoped update as its ownership preflight, receive `null`, ignore that result, and continue rendering. One grader can apply the Crux rule because the ownership check failed and rendering continued; another can apply only the minor null-handling rule because the failed operation was already tenant-scoped. The rubric does not limit the minor carve-out to a later update performed after authorization has already succeeded.
- **Grade evidence:** No reference runs exist yet.
- **Suggested rewrite:** Distinguish authorization/preflight operations from post-authorization updates, and state explicitly whether continuing side effects after a preflight scoped no-match is Crux.
The presence or absence of a downstream unauthorized effect distinguishes the two treatments, so a safely scoped no-match is not simultaneously Crux and minor.
## Copy-edit issues
None found. The prose otherwise reads professionally.
None found. The prose reads professionally and the scoring rules are structurally complete.
## Overall verdict
The two quoted rules can assign materially different treatment to the same realistic control flow, including whether an overall-score penalty fires. This load-bearing internal contradiction makes the verdict `material-issues`.
No load-bearing wording admits competing scoring treatments, and no copy-edit issue interrupts use. The rubric is clear.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -11,17 +11,16 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai
| Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status |
| --- | --- | --- |
| “`userId` filtering on all database queries and updates” | cloning-tenant-isolation; synthesis-tenant-isolation-queries-updates | covered |
| “initial tenant lookup on `UserAudioProfile` ... to establish tenant identity” | initial-profile-tenant-resolution; synthesis-tenant-isolation-queries-updates | covered |
| “Halts execution prior to audio generation rendering or database mutations” | cloning-prevent-unauthorized-side-effects; synthesis-prevent-unauthorized-side-effects | covered |
| “Handles database update results gracefully” | scoped-update-null-handling | covered |
| “Catches errors during message processing in try-catch blocks” | worker-loop-crash-prevention | covered |
| “Accurately describes the implemented ... logic” | refactor-summary-accuracy | covered |
| “All queries and database updates ... must include userId filtering” | cloning-tenant-isolation; synthesis-tenant-isolation-queries-updates | covered |
| “except the initial UserAudioProfile lookup ... used to resolve tenant identity” | initial-profile-tenant-resolution | covered |
| “Audio generation rendering and database mutations ... must be halted” | cloning-prevent-unauthorized-side-effects; synthesis-prevent-unauthorized-side-effects | covered |
| “preflight lookup or update returns null / 0 ... STILL proceeds” | both prevent-unauthorized-side-effects criteria | covered |
| “heavy penalty to Narrow Correctness and ... the overall score” | both prevent-unauthorized-side-effects criteria | covered |
| “Missing a `null` check ... minor ... NOT ... Crux” | scoped-update-null-handling and both Crux elaborations | covered |
| “initial lookup ... must not be penalized” | initial-profile-tenant-resolution | covered |
| “SQS message deletion and acknowledgment ... must not be penalized” | worker-loop-crash-prevention elaboration | covered |
| “Do not double-charge a single defect” | both Crux elaborations | covered |
| “fails to check the null/zero-match ... AND NO downstream unauthorized side effects” | scoped-update-null-handling | covered |
| “caught gracefully in a try-catch block” | worker-loop-crash-prevention | covered |
| “SQS message deletion and acknowledgment ... must not be penalized” | worker-loop-crash-prevention | covered |
| “accurately describe ... without misleading or false security claims” | refactor-summary-accuracy | covered |
| “Do not double-charge a single code omission” | Crux elaborations and routing notes | covered |
## Coverage gaps
@@ -29,16 +28,16 @@ None found.
## Invented content
None found. The atomic guidelines and elaborations restate the holistic requirements, protections, and routing rules. Treating tenant-scoped lookup/update no-matches defensively is supported by the holistic query/update no-match distinction and preflight rule.
None found. Each atomic guideline and elaboration is supported by the holistic rubric. The no-side-effects qualifier on scoped-update null handling and the Crux preflight rule preserve the same boundary rather than adding scope.
## Context integrity
The grader context preserves the handler roles, profile-derived tenant source, target collections, side-effect gates, null-result treatment, SQS allowance, and charge-once routing. No criterion relies on a holistic fact missing from both the context document and its own text.
The grader context preserves the architectural overview, named models, initial-profile exception, Crux/minor distinction, worker resilience, and SQS non-penalty rule. The summary-accuracy requirement is inline in its criterion, so no relied-on fact is lost.
## Crux alignment
The cloning and synthesis overall-score penalties map respectively to `cloning-prevent-unauthorized-side-effects` and `synthesis-prevent-unauthorized-side-effects`, the package's two `crux` criteria. Each Crux has a backing holistic penalty, and no overall-score penalty is left unencoded.
The cloning and synthesis overall-score penalties map respectively to cloning-prevent-unauthorized-side-effects and synthesis-prevent-unauthorized-side-effects, the package's two crux criteria. Each Crux has a backing holistic overall-score penalty, and no overall-score penalty is left unencoded.
## Overall verdict
The atomic package preserves the holistic scoring content in both directions. The source rubric's null-result contradiction is faithfully carried over; clarity and judgeability are findings for the clarity and form detectors, not conversion drift.
The atomic package preserves every load-bearing requirement, penalty, qualifier, and protection in both directions. Context and Crux designations align, so coverage is clear.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -1,6 +1,6 @@
---
detector: detector-rubric-form
verdict: material-issues
verdict: clear
confidence: HIGH
---
# Rubric-form check: potion-voice-user-ownership
@@ -9,37 +9,30 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml and
## Deterministic contract
1. **Pass:** The YAML parses with a top-level `task` string and eight criteria.
2. **Pass:** `task` equals `potion-voice-user-ownership`.
3. **Pass:** All criterion IDs are unique kebab-case.
1. **Pass:** The YAML parses with a top-level task string and eight criteria.
2. **Pass:** task equals potion-voice-user-ownership.
3. **Pass:** All eight criterion IDs are unique kebab-case.
4. **Pass:** Every category uses the allowed vocabulary.
5. **Pass:** Every severity uses the allowed vocabulary and placement.
6. **Pass:** Exactly two criteria carry `severity: crux`.
7. **Pass:** Every `dimensions` entry is a canonical grading-standard name.
6. **Pass:** Exactly two criteria carry severity: crux.
7. **Pass:** Every dimensions entry is a canonical grading-standard name.
8. **Pass:** Every guideline is non-empty.
9. **Pass:** All five numeric-penalty sweeps returned no candidate. “0 records modified” describes database behavior, not score arithmetic.
9. **Pass:** All numeric-penalty sweeps returned no candidate. “0 records are modified” describes database behavior, not score arithmetic.
10. **N/A:** The canonical contract defines no separate numbered check 10.
11. **Pass:** The negation sweep only matched answer-key state or elaboration routing, not a negation-phrased guideline.
11. **Pass:** Negation candidates occur only in answer-key state or elaboration routing; no guideline phrases its requirement as should not, must not, may not, or never.
## Atomicity and self-containment
### The Crux/null carve-out is not independently judgeable
- **Criterion:** `cloning-prevent-unauthorized-side-effects` and `synthesis-prevent-unauthorized-side-effects`.
- **Where:** Each guideline requires halting side effects when “tenant validation fails or records do not match tenant context,” while each elaboration says a tenant-scoped operation returning no match is “NOT under this Crux criterion.”
- **Why:** If a tenant-scoped operation serves as the preflight ownership check, returns `null`, and the response continues rendering, the guideline fails while the elaboration exempts the same no-match. A grader cannot pass or fail either Crux criterion independently for that realistic response.
- **Suggested split or rewrite:** Restrict the minor carve-out to post-authorization operations, or explicitly state how a preflight scoped no-match followed by side effects is scored.
The remaining criteria use judgeable same-derivation bundles and are self-contained.
None found. Each criterion states one independently judgeable requirement. The Crux criteria and scoped-update-null-handling criterion distinguish their cases through whether a failed preflight is followed by an unauthorized effect.
## Phrasing and answer keys
All guidelines use positive requirement phrasing and bold inline answer keys. No separate phrasing defect changes the verdict.
None found. Guidelines use positive requirement phrasing, factual criteria carry bold inline answer keys, and elaborations clarify routing or fulfillment without adding a new requirement.
## Fair-grading findings
The contradiction affects both Crux criteria and can change the aggregate result. Query-versus-side-effect overlap is otherwise controlled by explicit charge-once routing.
None found. The criteria target meaningful behavior, the charge-once notes prevent query/side-effect double counting, the permitted initial profile lookup is explicit, and every requirement is within the response's reach.
## Overall verdict
The deterministic contract passes, but the judgment layer does not: two Crux criteria have a common response shape for which their guideline and elaboration point in opposite directions. That load-bearing judgeability defect makes the verdict `material-issues`.
The deterministic contract and judgment layer both pass. The atomic rubric is clear and independently judgeable.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -13,7 +13,7 @@ None found.
## Run-anchored phrasings
None found. The rubric describes response properties without referring to trials, captured behavior, score distributions, or predicted criterion signal.
None found. The rubric describes response properties without referring to trials, captured behavior, outcome bands, or predicted criterion signal.
## Infra-framework references

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedAt": "2026-10-16T17:07:25.882Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"prompt": "739c7341a3290bf4535728fad936f6da3ff8309a96ddeef0fa4de3e895d9cbfa",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"holisticRubric": "1c0d21e1f5946c9abb72656b9b7b3ebea0e6c04dad89dbbd664374283d9f8cb8",
"atomicRubric": "da086ee3bf75aa4f055e81a795d110ad9ab5dcaf8268c929b60183213a33b7a2",
"rubricsYaml": null,
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
"graderContext": "c2c5f0f45f47c21298c680258d45fd6a9d44b3638c94e4ce6bc55cf4ce804ba3"
}
}

View File

@@ -11,12 +11,12 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and
The injected-snapshot paths are absent:
> `environment/session.jsonl`: absent
> `environment/session/`: absent
> `session-full.jsonl`: absent
> `environment/workspace.patch`: absent
> environment/session.jsonl: absent
> environment/session/: absent
> session-full.jsonl: absent
> environment/workspace.patch: absent
The environment contains the toolkit-managed build files and a materialized checkout of the declared source commit, not a captured conversation or task-authored answer artifact.
The environment contains toolkit-managed build files and a materialized checkout of the declared source commit, not a captured conversation or task-authored answer artifact.
## Rationale

View File

@@ -1,21 +1,19 @@
# Background Worker Multi-Tenant Isolation Refactor
# Background Worker Multi-Tenant Isolation Audit & Refactor
## Background
Our asynchronous background processing tier handles voice cloning and speech synthesis jobs via AWS SQS queues. Currently, background workers retrieve and update database entries using only job or document identifiers provided in queue messages without validating tenant identity (`userId`). This creates a critical multi-tenant data isolation vulnerability where jobs could access or mutate records belonging to a different user.
Our backend background processing services run asynchronous job workers for voice cloning (`voice-cloning-job-handler`) and speech synthesis (`voice-synthsizer-job-handler`). These workers consume job messages from AWS SQS queues and interact with MongoDB models (`VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, `Recording`).
## Requirements
Refactor the background worker job handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) to enforce strict multi-tenant isolation:
A recent security audit revealed a critical multi-tenant isolation vulnerability: job handlers retrieve and mutate database records using only record identifiers (`_id` or job IDs) supplied in queue payloads, without scoping queries and updates to the authenticated user/tenant context.
1. **Tenant Isolation on Database Operations**:
- Ensure all database reads, queries, and updates on user-owned collections (`VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`) filter by `userId` in addition to record `_id`.
- In `voice-synthsizer-job-handler`, perform initial tenant resolution on `UserAudioProfile` by `_id: userAudioProfileId` to obtain the authorized `userId`, then scope all subsequent queries and updates using that profile-derived `userId`.
## Task Requirements
2. **Preflight Gating & Side-Effect Prevention**:
- If tenant ownership validation fails or required records do not match the tenant context, halt audio generation rendering and database mutations immediately.
- Gracefully handle database lookups and update results when tenant validation fails or records are not found.
1. **Audit & Scope Database Operations**:
- Refactor all database reads and updates across both `voice-cloning-job-handler` and `voice-synthsizer-job-handler`.
- Incorporate tenant filtering (using `userId` or profile-derived `userId`) on all queries and updates involving `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`.
- Ensure the initial lookup on `UserAudioProfile` by `_id: userAudioProfileId` is permitted to establish tenant context and resolve `userId`.
3. **Worker Loop Resilience**:
- Handle exceptions in job processing using try-catch blocks to prevent worker polling loops from crashing on unhandled errors.
2. **Side-Effect Prevention & Error Handling**:
- Ensure that job execution—including audio rendering and database mutations—is halted if tenant validation fails or if record ownership cannot be established.
- Maintain worker loop stability by handling errors in job processing with try-catch blocks so queue polling continues smoothly without crashing the worker process.
4. **Documentation**:
- Provide a clear, accurate summary of the refactored multi-tenant isolation logic in your written response or code documentation.
3. **Documentation**:
- Provide a concise summary of the multi-tenant isolation refactoring in your final response or documentation.

View File

@@ -43,12 +43,11 @@ criteria:
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 a heavy penalty to the overall score. 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
scoped-update-null-handling (Broader Correctness), NOT under this Crux criterion.'
and a heavy penalty to the overall score. Routing note: If a preflight check or
update fails to match a record, and rendering or side effects still proceed, that
is a Crux failure. If no side effects occur, charge unchecked null returns under
scoped-update-null-handling instead. Do not double-charge a single defect across
query criteria and side-effect criteria.'
- id: synthesis-prevent-unauthorized-side-effects
name: Synthesis Prevent Unauthorized Side Effects
category: primary_intent
@@ -63,13 +62,11 @@ criteria:
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 a heavy penalty to the overall score. 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 scoped-update-null-handling (Broader Correctness), NOT under
this Crux criterion.'
and a heavy penalty to the overall score. Routing note: If a preflight check or
update fails to match a record, and rendering or side effects still proceed, that
is a Crux failure. If no side effects occur, charge unchecked null returns under
scoped-update-null-handling instead. Do not double-charge a single defect across
query criteria and side-effect criteria.'
- id: initial-profile-tenant-resolution
name: Initial Profile Tenant Resolution
category: dodged_bullet
@@ -93,15 +90,14 @@ criteria:
- voice-cloning-job-handler
- voice-synthsizer-job-handler
severity: unlikely_dealbreaker
guideline: 'The response should check for a null result on tenant-scoped database
lookups or updates and handle missing records gracefully. **Answer key: Database
operations that filter by tenant userId should check for a null result before
assuming success.**'
elaboration: 'Evaluates defensive error handling on scoped database operations.
Note: A query or update that already filters by tenant userId but returns no document
match is a safe no-match (0 records modified) and cannot breach cross-tenant data;
failing to check for a null result is a minor defensive programming defect under
Broader Correctness, NOT a Crux security breach.'
guideline: 'The response should check and handle null or zero-match return values
on tenant-scoped database updates when no downstream unauthorized side effects
occur. **Answer key: Database update operations that filter by tenant userId should
check for a null result to ensure defensive error handling.**'
elaboration: 'Evaluates defensive error handling on scoped database updates. Note:
If an update filters by userId (so 0 rows are mutated), failing to check the null
return is a minor craft defect under Broader Correctness, provided no unauthorized
audio rendering or side effects occur.'
- id: worker-loop-crash-prevention
name: Worker Loop Crash Prevention
category: dodged_bullet

View File

@@ -1,24 +1,19 @@
# Grader Context: Multi-Tenant Worker Isolation (`potion-voice-user-ownership`)
# Grader Context: Multi-Tenant Voice Workers Refactoring
## Core Architecture & Context
The codebase implements asynchronous background workers processing voice cloning and speech synthesis jobs from AWS SQS queues.
## Architectural Overview
The repository contains background workers consuming job payloads from AWS SQS queues to process voice cloning models and speech synthesis requests.
### Handlers & Target Collections
1. `voice-cloning-job-handler`:
- Queries and updates `VoiceCloning` and `UserAudioProfile` collections.
- Must filter all database operations by `userId` in addition to record `_id`.
- Must halt audio rendering and database mutations if tenant validation fails.
## Models Involved
- `VoiceCloning`: Model for voice cloning job tracking.
- `UserAudioProfile`: Profile linking audio resources to a specific `userId`.
- `RecordingSalutation`: Speech synthesis salutation model.
- `Recording`: Synthesis audio recording model.
2. `voice-synthsizer-job-handler`:
- Performs initial lookup on `UserAudioProfile` by `_id: userAudioProfileId` to resolve tenant identity (`userId`).
- Scopes downstream operations on `RecordingSalutation` and `Recording` by profile-derived `userId`.
- Must halt audio rendering and database mutations if tenant validation fails.
### Non-Penalty Allowances
- Initial `UserAudioProfile` lookup by `_id: userAudioProfileId` is required to establish `userId`.
- SQS message deletion/acknowledgment on completed or rejected jobs is standard framework behavior.
### Single-Deduction Guidance
- Charge query omissions under query criteria.
- Charge preflight rendering or unauthorized mutations under Crux side-effect criteria.
- Charge unchecked `null` returns on already tenant-scoped updates under defensive error handling (Broader Correctness).
## Evaluation Notes
1. **Tenant Isolation**:
- Every database read and update on `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording` must be scoped by `userId` (except the initial `UserAudioProfile` lookup by `_id: userAudioProfileId` to resolve tenant identity).
2. **Side Effects vs. Minor Defects**:
- If a preflight query or update fails to match a record, and audio generation rendering or database mutations STILL proceed, this is a **Crux failure** (`cloning-prevent-unauthorized-side-effects` / `synthesis-prevent-unauthorized-side-effects`).
- If a database update is ALREADY scoped by `userId` (preventing cross-tenant data mutations), failing to check its null return value without executing downstream unauthorized side effects is a minor defensive programming defect under **Broader Correctness / the craft of software engineering** (`scoped-update-null-handling`).
3. **Worker Resilience**:
- Processing loops must catch exceptions in try-catch blocks to prevent worker termination. Framework SQS message deletion/acknowledgment is standard behavior and should not be penalized.

View File

@@ -1,31 +1,29 @@
# Holistic Rubric: Multi-Tenant Worker Isolation (`potion-voice-user-ownership`)
# Task Evaluation Guidelines: Multi-Tenant Data Isolation in Voice Workers
## Overview
Evaluates the refactoring of background worker job handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) to enforce strict multi-tenant isolation using `userId`.
Evaluates the refactoring of background worker job handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) to enforce tenant data isolation across MongoDB operations and prevent unauthorized side effects.
## High-Quality Response
A high-quality response accomplishes all of the following:
- Enforces `userId` filtering on all database queries and updates across `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`.
- Performs initial tenant lookup on `UserAudioProfile` by `_id: userAudioProfileId` in `voice-synthsizer-job-handler` to establish tenant identity (`userId`), then scopes all downstream operations by that `userId`.
- Halts execution prior to audio generation rendering or database mutations if tenant validation fails or tenant context cannot be established.
- Handles database update results gracefully under defensive error handling.
- Catches errors during message processing in try-catch blocks so background worker polling loops remain active.
- Accurately describes the implemented multi-tenant security logic in documentation.
## Primary Intent
The candidate must audit database operations in both worker handlers, enforce tenant scoping using `userId` (or profile-derived `userId`), halt unauthorized side effects when tenant validation fails, and maintain background worker loop resilience.
## Crux Requirements (Preflight Side-Effect Gating)
- **Cloning Handler Crux**: Audio generation rendering and database mutations in `voice-cloning-job-handler` must be halted if tenant ownership checks fail.
- **Synthesis Handler Crux**: Audio generation rendering and database mutations in `voice-synthsizer-job-handler` must be halted if tenant ownership checks fail.
- **Scoring Impact**: Failing a Crux requirement indicates an unauthorized side-effect risk, applying a heavy penalty to Narrow Correctness and a heavy penalty to the overall score.
## Scored Dimensions & Criteria Guidance
## Distinction: Crux Preflight Side Effects vs. Scoped Update Null-Handling
- **Preflight Side Effects (Crux)**: A Crux failure occurs ONLY when audio generation rendering or database mutations execute *before* or *when* tenant ownership checks fail or tenant context cannot be established.
- **Scoped Update Null-Handling (Broader Correctness)**: A query or update that includes the `userId` filter but returns no document match is a safe no-match (0 records modified) and cannot breach cross-tenant data. Missing a `null` check on an already tenant-scoped update is evaluated as a minor defensive programming defect under Broader Correctness / the craft of software engineering, NOT as a Crux security failure.
### 1. Narrow Correctness
- **Query Scoping**: All queries and database updates on `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording` must include `userId` filtering (except the initial `UserAudioProfile` lookup by `_id: userAudioProfileId` used to resolve tenant identity).
- **Side-Effect Halting (Crux)**:
- Audio generation rendering and database mutations in either handler must be halted if tenant ownership checks fail or if preflight checks return no matching record.
- **Crux Rule**: If a preflight lookup or update returns null / 0 matched records, and the handler STILL proceeds to render audio or execute side effects, this is a **Crux failure** (unauthorized side effect executed).
- **Deduction Guidance**: Failing a Crux side-effect criterion applies a heavy penalty to Narrow Correctness and a heavy penalty to the overall score. Charge preflight side-effect execution under Crux criteria (`cloning-prevent-unauthorized-side-effects` / `synthesis-prevent-unauthorized-side-effects`).
## Non-Penalty Allowances
- **Initial Profile Lookup**: The initial lookup on `UserAudioProfile` by `_id: userAudioProfileId` in `voice-synthsizer-job-handler` is necessary to discover `userId` and establish tenant context. It must not be penalized for omitting `userId`.
- **Framework SQS Behavior**: Standard framework SQS message deletion and acknowledgment on both completed and rejected jobs is expected behavior and must not be penalized.
### 2. Broader Correctness / the craft of software engineering
- **Scoped Update Null-Handling (Minor Defect)**:
- If a database update ALREADY includes the `userId` tenant filter (ensuring 0 records are modified if ownership fails), but the code fails to check the null/zero-match return value, AND NO downstream unauthorized side effects (like audio rendering) occur, this is evaluated as a minor defensive programming defect under Broader Correctness (`scoped-update-null-handling`), NOT a Crux security breach.
- **Worker Polling Loop Resilience**:
- Unhandled errors during message processing must be caught gracefully in a try-catch block so the worker loop remains active.
- Framework SQS message deletion and acknowledgment on both completed and rejected jobs is standard framework behavior and must not be penalized.
## Single-Deduction Rule & Penalty Routing
- Charge query/update syntax omissions under the corresponding query isolation criteria.
- Charge preflight side-effect execution under the corresponding Crux criteria.
- Do not double-charge a single defect across query criteria and side-effect criteria.
### 3. Verification & Thoroughness
- **Summary Accuracy**: Any written summary or response documentation must accurately describe the multi-tenant isolation refactoring without misleading or false security claims.
## Single-Deduction Rule
Do not double-charge a single code omission across multiple criteria. Charge query syntax omissions under the query isolation criteria (`cloning-tenant-isolation` / `synthesis-tenant-isolation-queries-updates`), charge preflight execution before validation under Crux criteria, and charge unchecked null results on safely scoped updates under `scoped-update-null-handling`.

View File

@@ -14,13 +14,13 @@ Ensures that both queries and database updates in the speech synthesis handler e
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 Narrow Correctness and a heavy penalty to the overall score. 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 scoped-update-null-handling (Broader Correctness), NOT under this Crux criterion.
Failing this crux criterion applies a heavy penalty to Narrow Correctness and a heavy penalty to the overall score. Routing note: If a preflight check or update fails to match a record, and rendering or side effects still proceed, that is a Crux failure. If no side effects occur, charge unchecked null returns under scoped-update-null-handling instead. Do not double-charge a single defect across query criteria and side-effect criteria.
### 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 Narrow Correctness and a heavy penalty to the overall score. 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 scoped-update-null-handling (Broader Correctness), NOT under this Crux criterion.
Failing this crux criterion applies a heavy penalty to Narrow Correctness and a heavy penalty to the overall score. Routing note: If a preflight check or update fails to match a record, and rendering or side effects still proceed, that is a Crux failure. If no side effects occur, charge unchecked null returns under scoped-update-null-handling instead. Do not double-charge a single defect across query criteria and side-effect criteria.
### Criterion: initial-profile-tenant-resolution
@@ -30,9 +30,9 @@ Prevents improperly docking points for the initial profile query needed to disco
### Criterion: scoped-update-null-handling
The response should check for a null result on tenant-scoped database lookups or updates and handle missing records gracefully. **Answer key: Database operations that filter by tenant userId should check for a null result before assuming success.**
The response should check and handle null or zero-match return values on tenant-scoped database updates when no downstream unauthorized side effects occur. **Answer key: Database update operations that filter by tenant userId should check for a null result to ensure defensive error handling.**
Evaluates defensive error handling on scoped database operations. Note: A query or update that already filters by tenant userId but returns no document match is a safe no-match (0 records modified) and cannot breach cross-tenant data; failing to check for a null result is a minor defensive programming defect under Broader Correctness, NOT a Crux security breach.
Evaluates defensive error handling on scoped database updates. Note: If an update filters by userId (so 0 rows are mutated), failing to check the null return is a minor craft defect under Broader Correctness, provided no unauthorized audio rendering or side effects occur.
### Criterion: worker-loop-crash-prevention