pre-trial detector run 06

This commit is contained in:
2026-10-16 12:58:54 -04:00
parent e51d476186
commit 6ff10adaa9
35 changed files with 312 additions and 301 deletions

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -1,42 +1,48 @@
---
detector: detector-answer-obviousness
verdict: partial
confidence: MEDIUM
verdict: obvious
confidence: HIGH
---
# Answer-obviousness check: potion-voice-user-ownership
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md against instruction.md
## What the prompt asks
The prompt explicitly asks for userId-scoped reads and updates in both handlers, profile-derived tenant context in synthesis, preflight halting when ownership validation fails, and try-catch protection for the polling loops. Those are clear deliverables, while the exact control-flow and helper design remain open.
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.
## Per-expectation assessment
### Tenant-scoped queries and updates — obvious
### Tenant-scoped database operations — obvious
- **What the rubric requires:** “Every database operation on VoiceCloning and UserAudioProfile models must filter by userId alongside record _id,” with the analogous profile-derived rule for RecordingSalutation and Recording.
- **Is it obvious from the prompt?** Yes. These are direct restatements of Key Requirements 1 and 2.
- **Verdict for this expectation:** 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`.
### Preflight side-effect halting — obvious
### Profile-derived synthesis tenant — obvious
- **What the rubric requires:** “If tenant ownership checks fail or records do not match the tenant context, the handler must halt before performing audio rendering operations or database mutations.”
- **Is it obvious from the prompt?** Yes. Both handler requirements expressly demand this behavior.
- **Verdict for this expectation:** 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`.
### Worker-loop error handling — obvious
### Preflight gating and scoped no-match handling — obvious
- **What the rubric requires:** “Message processing must be wrapped in try-catch blocks to prevent worker polling loops from crashing on exceptions.”
- **Is it obvious from the prompt?** Yes. Key Requirement 3 asks for the same behavior.
- **Verdict for this expectation:** 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`.
### Null checks on database updates — not-obvious
### Worker-loop resilience — obvious
- **What the rubric requires:** A high-quality response “checks for a null result on database updates,” and an omitted check is scored as a minor craft defect.
- **Is it obvious from the prompt?** This is secondary unrequested scope. The prompt requires detecting failed ownership validation before side effects, but a competent implementation can satisfy that with explicit preflight reads and gates without checking every later tenant-scoped update result.
- **Verdict for this expectation:** not-obvious, because the holistic wording makes a general defensive-update practice part of the score even though the prompt only requires ownership validation.
- **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`.
### Accurate documentation — 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`.
## Overall verdict
The central security and resilience expectations are directly inferable from the prompt. The general null-result requirement is a smaller, defensible craft preference that the prompt does not clearly request, so the overall verdict is partial rather than not-obvious.
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`.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -5,24 +5,26 @@ confidence: MEDIUM
---
# Broken-dev-env check: potion-voice-user-ownership
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md, the materialized workspace, task.toml, and available run artifacts
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md, instruction.md, task.toml, the materialized workspace, and available run artifacts
## Verbatim grounding
> “These handlers lack proper tenant ownership isolation.”
The prompt's premise is:
> “You must audit and refactor both handlers to enforce strict multi-tenant isolation.”
> “Currently, background workers retrieve and update database entries using only job or document identifiers provided in queue messages without validating tenant identity (`userId`).”
The active cloning code contains an ID-only update:
The shipped cloning handler contains the matching ID-only write:
> await voiceCloningService.update({ _id, status: 'processing' })
> `await voiceCloningService.update({ _id, status: 'processing' })`
The root package manifest contains:
Static baseline checks returned:
> “scripts”: {}
> `javascript-syntax: pass`
> `json-manifests: pass`
> `selected-workspace-vs-commit: pass`
## 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 and matches the materialized handler files. Node syntax checks passed for both handler entry files and both cloning service files.
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.
This repository intentionally ships no test suite, as reflected by the empty scripts object and the toolkit-managed Dockerfile. No reference runs exist yet, so run corruption and future prompt/rubric package drift cannot be assessed pre-trial; the static workspace, premise, and available local checks are coherent.
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.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -5,19 +5,19 @@ confidence: HIGH
---
# Credential-leakage check: potion-voice-user-ownership
Assessed: authored Dockerfile, instruction.md, tests markdown, and the materialized source workspace; environment/workspace.patch is absent
Assessed: environment/Dockerfile, instruction.md, tests/*.md, the absent workspace patch, and the materialized source workspace
## Findings
### Pre-existing connection URLs — credential (informational)
- **Where:** Materialized source files voice-cloning-job-handler/pm2-development.yml, voice-cloning-job-handler/pm2-production.yml, voice-synthsizer-job-handler/pm2-development.yml, and voice-synthsizer-job-handler/pm2-production.yml contain URL-embedded credential-shaped strings. No values are reproduced here.
- **What:** URL-embedded credential candidates, fully redacted.
- **Why it is a finding:** The deterministic whole-workspace sweep found these candidates, but the task has no workspace patch and the files are byte-for-byte source-repository content at the declared commit. They are therefore informational repo-owner findings, not task-author leaks.
- **Action:** The source-repository owner should assess and rotate any live values. The task author should not rewrite baseline source merely to clear this detector.
- **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.
- **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.
No credential pattern survived the placeholder/provenance checks on a task-authored surface, and no authored absolute checkout path exists.
The authored-surface sweeps found no well-known secret shape, authoring-environment variable assignment, proxy endpoint, private-key block, or checkout path.
## Overall verdict
The authored Dockerfile, prompt, and test markdown contain no credential leak. The only candidates are pre-existing source-repository content in the materialized workspace, which does not change the clean 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`.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -9,12 +9,12 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md, ins
## Verbatim grounding
> “Task-Specific Holistic Rubric: Multi-Tenant Worker Isolation (potion-voice-user-ownership)”
The strongest near-miss is the rubric title's self-identifier:
> “Voice Cloning Handler (voice-cloning-job-handler)”
> “Holistic Rubric: Multi-Tenant Worker Isolation (`potion-voice-user-ownership`)”
These names identify this task and its own source directories.
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.
## Rationale
Neither the prompt nor the holistic rubric compares this task with a sibling task, borrows another task’s calibration, or assumes access to another prompt or rubric. There is no authored workspace patch carrying a sibling-task reference. The package is self-contained on this axis.
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.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -9,14 +9,14 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Verbatim grounding
> “Failing to halt preflight side effects when tenant validation fails applies a heavy penalty to Narrow Correctness and a heavy penalty to the Overall Score.”
> “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.”
> “Missing a check for a null result on an already-scoped update is evaluated as a minor defensive programming defect under Broader Correctness / the craft of software engineering, not as a Crux security breach.”
> “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.”
> “Charge query syntax omissions under Narrow Correctness.”
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.
## Rationale
Executing rendering or mutations despite a failed ownership gate breaks the requested deliverable, so Narrow Correctness is the right task-specific dimension. Naming Narrow Correctness and the overall score together is a sanctioned penalty shape, not double-charging.
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.
The already-scoped null-result behavior is assigned to craft, while query omissions remain on Narrow Correctness. The rubric does not route unverified claims to Integrity, penalize disclosed omissions as dishonesty, invent a criterion name, or exclude a standard dimension. No reference-run grades exist yet for a grade-drift cross-check.
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`.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -6,8 +6,8 @@ claims:
- id: c01
verdict: pass
loadBearing: true
summary: "The cloning models support userId scoping and active writes are ID-only"
rubricQuote: "Every database operation on VoiceCloning and UserAudioProfile models must filter by userId alongside record _id."
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`."
sourceEvidence: |-
userId: {
type: Schema.Types.ObjectId,
@@ -15,42 +15,31 @@ claims:
required: true,
}
await voiceCloningService.update({ _id, status: 'processing' })
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_model.js (lines 4-10) and voice-cloning-job-handler/index.js (lines 138-143)"
note: "Both relevant schemas expose userId, and the active baseline writes shown in the handler are keyed only by record ID. The fact is directly reachable in the patched workspace."
const salutationToUpdate = await recordingSalutationModel.findOne({
_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."
- id: c02
verdict: pass
loadBearing: true
summary: "The initial synthesis profile lookup yields the profile-derived userId"
rubricQuote: "The initial lookup on UserAudioProfile using _id: userAudioProfileId is valid for resolving tenant identity (userId)."
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`."
sourceEvidence: |-
const userAudioProfile = await userAudioProfileService.find({
_id: userAudioProfileId,
status: 'completed',
})
const { training_model_path, userId } = userAudioProfile[0]
if (userAudioProfile) {
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 active handler derives userId from the profile returned by the ID lookup. This is directly reachable from the workspace."
note: "The handler derives userId from the profile returned by the ID lookup. This scoring-gate fact is directly reachable at the cited workspace path."
- id: c03
verdict: pass
loadBearing: true
summary: "Synthesis RecordingSalutation and Recording accesses are presently ID-only"
rubricQuote: "All downstream database reads and updates on RecordingSalutation and Recording models must filter by the profile-derived userId."
sourceEvidence: |-
const salutationToUpdate = await recordingSalutationModel.findOne({
_id: salutationId,
deleted: false,
})
const recordingToUpdate = await recordingModel.findOne({
_id: recordingId,
deleted: false,
})
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 152-160; update at lines 169-177)"
note: "Both model schemas define userId, while the active downstream reads and salutation update shown here omit it. The fact is directly reachable."
- id: c04
verdict: pass
loadBearing: true
summary: "A tenant-scoped no-match operation directly changes no other document"
rubricQuote: "A query or update that includes the userId filter but returns a null result (0 records modified) cannot leak or corrupt cross-tenant data."
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."
sourceEvidence: |-
const updatedSalutation = await Salutation.findOneAndUpdate(
{ _id: salutation._id, userId },
@@ -58,35 +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: "A findOneAndUpdate call applies the full filter; a no-match result directly mutates no document. This verifies the database operation itself, not the safety of later side effects. The mechanism is reachable in the workspace."
- id: c05
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."
- id: c04
verdict: pass
loadBearing: true
summary: "Both handlers have polling loops protected by message-processing catches"
rubricQuote: "Message processing must be wrapped in try-catch blocks to prevent worker polling loops from crashing on exceptions."
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."
sourceEvidence: |-
try {
while (true) {
await processQueue()
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/index.js (lines 323-329), with equivalent synthesis loop at lines 258-264"
note: "The loops and try-catch control flow are present and locally inspectable. The rubric states a target behavior rather than falsely claiming every baseline error path is already safe."
- id: c06
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."
- id: c05
verdict: partial
loadBearing: false
summary: "SQS deletion is explicit application code, not automatic framework acknowledgment"
rubricQuote: "Framework SQS message deletion and acknowledgment on both completed and rejected jobs is standard framework behavior and must not be penalized."
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."
sourceEvidence: |-
await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)
const deleteMessageFromSQS = (sqsQueueUrl, receiptHandle) => {
...
sqs.deleteMessage(params, function (err, data) {
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/index.js (line 130) and app/services/sqs/sqs_service.js (lines 27-48)"
note: "The repository shows manual message deletion before processing, so calling it framework behavior is imprecise. The must-not-penalize instruction is a normative scope rule and remains independently clear, making this factual 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 (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."
---
# 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 locally resolving repos/potion-voice commit fcd8a9d0b00406bda1943c234a8f2fecaff9f774, with no workspace patch.
Source: `harbor-tasks/potion-voice-user-ownership/environment/workspace/` — materialized from `repos/potion-voice` commit `fcd8a9d0b00406bda1943c234a8f2fecaff9f774` (declared in `task.toml`), with no workspace patch.
Checked 6 claims: 5 load-bearing passes and 1 non-load-bearing partial. No claim was unclear or unreachable. The top-level verdict remains pass because the only drift is the rubric’s “framework behavior” label for explicit application code.
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:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -9,16 +9,18 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Positive target present?
Yes. The rubric says:
Yes. The dedicated “High-Quality Response” section affirmatively says a strong response:
> “High-Quality Response: Enforces tenant isolation across all database queries and updates in both handlers, halts execution before performing unauthorized side effects when tenant checks fail, catches errors to keep polling loops alive, checks for a null result on database updates, and accurately summarizes the changes.”
> “Enforces `userId` filtering on all database queries and updates across `VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`.”
The handler-specific sections also identify the models, tenant source, and permitted initial profile lookup.
> “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.
## What the grader has to infer
The grader must judge the implementation’s exact control-flow and helper design, but it does not have to reverse-engineer the intended result from penalties alone. The positive target covers the task’s central security and reliability behavior.
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.
## Overall verdict
A grader reading only the rubric has a concrete affirmative model of a strong response. The rubric therefore defines good.
The rubric gives 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:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -9,14 +9,14 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and
## Plausible strong-response approaches
The prompt is a direct implementation request with one broad strong shape: establish a trusted tenant context, scope every named operation, halt before unauthorized effects, and preserve the worker loop. A competent implementation may use preflight reads, conditional updates whose results are checked, helper-service changes, handler-local gates, or a combination.
This is a direct implementation request with one broad strong-response shape: establish trusted tenant context, scope the named operations, stop before unauthorized effects, preserve the polling loop, and report accurately. Within that shape, competent implementations may use explicit preflight reads, checked conditional updates, handler-local gates, service-layer filter changes, or combinations of those techniques.
## Coverage in the rubric
The rubric grades observable tenant filters and side-effect ordering without mandating a helper architecture. It expressly credits the initial profile lookup used to derive userId and protects ordinary SQS deletion from unrelated grading. Its high-quality description can accommodate preflight reads or checked conditional operations.
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.
No reference runs exist, so the run-evidenced penalty-side patterns cannot yet be assessed.
No reference runs exist, so the run-evidenced penalty-side patterns are not available to assess.
## Overall verdict
Every major implementation approach that satisfies the explicit ownership gate has a scored home. The rubric’s null-result ambiguity is a clarity/form defect, not an omitted broad response path, so this detector returns exhaustive.
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`.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -5,22 +5,22 @@ confidence: HIGH
---
# Offline-verifiability check: potion-voice-user-ownership
Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md, tests/holistic-rubric.md, package manifests, and the materialized workspace
Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md, tests/holistic-rubric.md, package manifests, lockfiles, and the materialized workspace
## Findings
### MongoDB, SQS, and audio rendering — external-sounding context (cleared)
### AWS SQS and audio generation — external-sounding context (cleared)
- **Where:** instruction.md, Overview.
- **Where:** `instruction.md`, Background.
- **Quote:**
> “Our backend background workers ... currently process jobs by querying MongoDB records using document IDs provided in SQS queue messages.”
> “Our asynchronous background processing tier handles voice cloning and speech synthesis jobs via AWS SQS queues.”
- **Why it stays local:** The graded work is query construction, ownership gating, control-flow ordering, and exception handling in repository code. It does not require live AWS, MongoDB, S3, or audio-model execution. These collaborators can be stubbed, and syntax/control-flow can be inspected locally.
- **Something to consider:** Keep verification focused on local filter arguments and the absence of downstream calls after a failed gate.
- **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.
- **Something to consider:** Keep verification focused on filter arguments and proving that downstream calls are skipped after a failed gate.
The manifests already declare the named JavaScript dependencies, including mongoose and aws-sdk, and all handler and model code is present. The task requires no new package or dataset fetch.
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.
## Overall verdict
A competent SWE can implement and verify the required repository behavior from the initialized workspace. External systems are scenario context rather than load-bearing 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:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -9,18 +9,18 @@ Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md, the absent wo
## Findings
### Named tenant predicates — prompt-hint (cleared)
### Named tenant predicates — prompt near-miss (cleared)
- **Where:** instruction.md, Key Requirements.
- **Where:** `instruction.md`, Tenant Isolation on Database Operations.
- **Quote:**
> “Scope all database reads and updates on VoiceCloning and UserAudioProfile models using userId in addition to record _id.”
> “Ensure all database reads, queries, and updates on user-owned collections (`VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`) filter by `userId` in addition to record `_id`.”
- **What it pre-empts:** The sentence specifies the required security property and affected models, but it does not identify every call site or supply the implementation.
- **De-hinting option:** None recommended; this is an acceptance criterion a real security ticket would state.
- **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 synthesis context, preflight halting rule, and try-catch requirement are likewise deliverable constraints. No environment/workspace.patch exists, so no task-authored code comment can leak the solution.
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.
## Overall verdict
The prompt is detailed because the requested refactor is specific. It leaves the agent to trace the handlers, choose the gates, and implement them, so the graded engineering work survives the wording and the verdict is clean.
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`.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -11,17 +11,17 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
### A scoped preflight no-match is both Crux and minor
- **Where:** The handler-specific Crux rules say:
- **Where:** The Crux distinction says:
> “If tenant ownership checks fail or records do not match the tenant context, the handler must halt before performing audio rendering operations or database mutations.”
> “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.”
The scoped no-match rule later says:
The next bullet says:
> “Missing a check for a null result on an already-scoped update is evaluated as a minor defensive programming defect under Broader Correctness / the craft of software engineering, not as a Crux security breach.”
> “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 is ambiguous:** Consider an initial tenant-scoped update that returns null and a handler that ignores the result, then continues into audio rendering. One reasonable grader applies the Crux rule because the record did not match and rendering continued; another applies only the minor null-check rule. The rubric does not distinguish preflight authorization operations from later, already-authorized updates, so the same realistic behavior receives materially different treatment.
- **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:** State that an ignored no-match on the operation used to authorize the job is a Crux failure when side effects continue, while an unchecked no-match on a later tenant-scoped update after authorization is only a minor craft defect—or explicitly choose the opposite treatment.
- **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.
## Copy-edit issues
@@ -29,4 +29,4 @@ None found. The prose otherwise reads professionally.
## Overall verdict
The conflicting Crux and minor rules govern a central, realistic implementation shape and can change both a criterion score and the overall penalty. That load-bearing ambiguity makes the verdict material-issues.
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`.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -5,22 +5,23 @@ confidence: HIGH
---
# Rubric-coverage check: potion-voice-user-ownership
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md against tests/atomic-rubric.yaml and tests/grader-context.md
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md against harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml and tests/grader-context.md
## Coverage map
| Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status |
| --- | --- | --- |
| “Every database operation on VoiceCloning and UserAudioProfile ... userId” | cloning-tenant-isolation | covered |
| “All downstream ... RecordingSalutation and Recording ... profile-derived userId” | synthesis-tenant-isolation-queries-updates | covered |
| “initial lookup ... is valid for resolving tenant identity” | initial-profile-tenant-resolution | covered |
| “halt before performing audio rendering operations or database mutations” (cloning) | cloning-prevent-unauthorized-side-effects | covered |
| “halt before performing audio rendering operations or database mutations” (synthesis) | synthesis-prevent-unauthorized-side-effects | covered |
| “Do not double-charge a single defect” | both side-effect Crux elaborations | covered |
| “Missing a check for a null result ... minor defensive programming defect” | scoped-update-null-handling | covered |
| “Message processing must be wrapped in try-catch blocks” | worker-loop-crash-prevention | covered |
| “`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 |
| “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 |
| “documentation or code comments must accurately describe” | refactor-summary-accuracy | covered |
| “Do not double-charge a single defect” | both Crux elaborations | covered |
## Coverage gaps
@@ -28,16 +29,16 @@ None found.
## Invented content
None found. The atomic answer keys restate requirements or protections present in the holistic rubric.
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.
## Context integrity
The grader context preserves the handler roles, tenant source, model scoping rules, side-effect gates, charge-once rule, scoped no-match treatment, and SQS non-penalty. No criterion depends on a holistic fact missing from both the context and its own text.
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.
## Crux alignment
The holistic rubric has two handler-specific heavy penalties targeting the overall score. They map to cloning-prevent-unauthorized-side-effects and synthesis-prevent-unauthorized-side-effects, the package’s two Crux criteria. No unsupported Crux exists. The numeric ranges are correctly omitted because atomic severity carries weight.
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.
## Overall verdict
The atomic package preserves the holistic requirements, penalties, conditions, and non-triggers in both directions. The null-result contradiction is faithfully preserved; its substantive clarity is assessed by the clarity and form detectors rather than treated as conversion drift. Coverage is clear.
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.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -9,37 +9,37 @@ 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:** The task value matches potion-voice-user-ownership.
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.
4. **Pass:** All categories use the allowed vocabulary.
5. **Pass:** All severities use the allowed vocabulary and placement.
6. **Pass:** Exactly two criteria carry Crux severity.
7. **Pass:** Every dimensions entry is one of the eight canonical names.
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.
8. **Pass:** Every guideline is non-empty.
9. **Pass:** Numeric-penalty sweeps found no penalty amount in the atomic rubric or grader context. “0 records modified” is database behavior, not score arithmetic.
10. **N/A:** The canonical contract defines no separate numbered item 10.
11. **Pass:** Guideline negation candidates describe an answer-key state (“records do not match”); the “Do not double-charge” and “must not be penalized” hits occur in elaborations, not as negation-phrased guidelines.
9. **Pass:** All five numeric-penalty sweeps returned no candidate. “0 records 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.
## Atomicity and self-containment
### Null-result carve-out makes each side-effect Crux criterion non-judgeable
### 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 rendering and mutations “when tenant validation fails or records do not match tenant context,” while its elaboration says a userId-scoped operation returning null is “not a Crux side-effect failure.”
- **Why:** A grader cannot independently verdict the realistic case where a preflight scoped operation returns null, the response does not check it, and rendering continues. The guideline says fail; the elaboration says route the missed null check only to the minor craft criterion.
- **Suggested split or rewrite:** Limit the minor carve-out to post-authorization updates, or state explicitly whether continuing side effects after a preflight no-match fails the Crux criterion.
- **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 sanctioned same-derivation bundles and are self-contained.
The remaining criteria use judgeable same-derivation bundles and are self-contained.
## Phrasing and answer keys
All guidelines are positively phrased and include bold inline answer keys. No elaboration adds an unrelated requirement.
All guidelines use positive requirement phrasing and bold inline answer keys. No separate phrasing defect changes the verdict.
## Fair-grading findings
The conflicting null-result treatment is load-bearing because the two affected criteria are Crux. Query-versus-side-effect duplication is otherwise handled by explicit charge-once routing.
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.
## Overall verdict
The deterministic schema contract passes, but the judgment layer does not: two Crux criteria cannot be consistently passed or failed for a common no-match continuation. That load-bearing judgeability defect makes the verdict material-issues.
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`.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -13,12 +13,12 @@ None found.
## Run-anchored phrasings
None found. The rubric defines response properties without referring to trials, captured behavior, expected score distributions, or predicted criterion signal.
None found. The rubric describes response properties without referring to trials, captured behavior, score distributions, or predicted criterion signal.
## Infra-framework references
None found. The rubric does not name Harbor, Pier, a sandbox, a runner, or another grading framework.
None found. The rubric does not name a harness, sandbox, runner, or grading framework.
## Overall verdict
The scoring guidance is expressed as general properties of any response to this task. A grader could apply it to behavior not represented in a reference run, so the rubric generalizes.
The requirements and penalties are stated as general properties of any response to this task. A grader can apply them to behavior not represented in a reference run, so the rubric generalizes.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-16T16:40:41.259Z",
"capturedAt": "2026-10-16T16:54:24.789Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
"prompt": "7d84c55c15284efc53d450a5724998dfc61b577b6991374f35f80765500e1602",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
"holisticRubric": "63fbe8eed4c2812abb9d731abdaf360db442578bada71df7b7dc91ae25c53b38",
"atomicRubric": "8f5cf65a2a5d4661cf217337a79ef7442c799cc9bffcd7e9e81403952fbcf5cb",
"rubricsYaml": null,
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
"graderContext": "46387249262f2bda366e3fd93e704f8672e10b94116fa2712ee55b7c16cedf04"
}
}

View File

@@ -9,12 +9,19 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and
## Verbatim grounding
There is no environment/session.jsonl, environment/session directory, root session-full.jsonl, or environment/workspace.patch. The environment contains the toolkit-managed Dockerfile and a materialized source checkout only.
The injected-snapshot paths are 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.
## Rationale
This is a manual, cold-prompt task. No injected conversation, subagent sidechain, session metadata, or task-authored workspace artifact can pre-supply the rubric’s answer. With no snapshot surface to compare against the rubric, the detector is not applicable.
This is a manual cold-prompt task. There is no injected conversation, subagent sidechain, session metadata, or workspace patch through which a snapshot could pre-supply the rubric's answer. The no-snapshot trigger therefore makes this detector not applicable.
## Snapshot hygiene (advisory)
No snapshot artifacts or snapshot hygiene issues are present.
No snapshot artifacts or snapshot-hygiene issues are present.

View File

@@ -1,20 +1,21 @@
# Refactor Background Worker Handlers for Multi-Tenant Isolation
# Background Worker Multi-Tenant Isolation Refactor
## Overview
Our backend background workers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) currently process jobs by querying MongoDB records using document IDs provided in SQS queue messages. However, these handlers lack proper tenant ownership isolation, creating potential security vulnerabilities where operations could inadvertently access or modify records belonging to other users.
## 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.
You must audit and refactor both handlers to enforce strict multi-tenant isolation.
## Requirements
Refactor the background worker job handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) to enforce strict multi-tenant isolation:
## Key Requirements
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`.
1. **Voice Cloning Handler (`voice-cloning-job-handler`)**:
- Scope all database reads and updates on `VoiceCloning` and `UserAudioProfile` models using `userId` in addition to record `_id`.
- Prevent execution of audio rendering or database modifications if tenant ownership validation fails.
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.
2. **Speech Synthesis Handler (`voice-synthsizer-job-handler`)**:
- Establish tenant context using the initial `UserAudioProfile` lookup (`_id: userAudioProfileId`).
- Scope all downstream database reads and updates on `RecordingSalutation` and `Recording` models using the profile-derived `userId`.
- Prevent execution of audio rendering or database modifications if tenant ownership validation fails.
3. **Worker Loop Resilience**:
- Handle exceptions in job processing using try-catch blocks to prevent worker polling loops from crashing on unhandled errors.
3. **Error Handling & Reliability**:
- Ensure all message processing is wrapped in graceful error handling (e.g., `try-catch`) so that worker polling loops remain active during unexpected errors.
4. **Documentation**:
- Provide a clear, accurate summary of the refactored multi-tenant isolation logic in your written response or code documentation.

View File

@@ -47,8 +47,8 @@ criteria:
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
a null result (0 records modified) is a safe no-match and is evaluated under Broader
Correctness / the craft of software engineering, not as a Crux side-effect failure.'
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.'
- id: synthesis-prevent-unauthorized-side-effects
name: Synthesis Prevent Unauthorized Side Effects
category: primary_intent
@@ -67,9 +67,9 @@ criteria:
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 a null result (0 records modified) is a safe no-match and is
evaluated under Broader Correctness / the craft of software engineering, not as
a Crux side-effect failure.'
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.'
- id: initial-profile-tenant-resolution
name: Initial Profile Tenant Resolution
category: dodged_bullet
@@ -93,14 +93,15 @@ criteria:
- voice-cloning-job-handler
- voice-synthsizer-job-handler
severity: unlikely_dealbreaker
guideline: 'The response should check for a null result when performing tenant-scoped
database updates before proceeding. **Answer key: Database update operations that
filter by tenant userId should check for a null result before assuming success.**'
elaboration: 'Evaluates defensive error handling on scoped database updates. Note:
A query or update that already filters by tenant userId but returns a null result
(0 records modified) cannot leak cross-tenant data; failing to check for a null
result is a minor defensive programming defect under Broader Correctness / the
craft of software engineering, not a Crux security breach.'
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.'
- id: worker-loop-crash-prevention
name: Worker Loop Crash Prevention
category: dodged_bullet

View File

@@ -1,24 +1,24 @@
# Grader Context: Multi-Tenant Worker Isolation (`potion-voice-user-ownership`)
## Codebase & Background Worker Context
The repository implements background job processing workers that handle voice cloning (`voice-cloning-job-handler`) and speech synthesis (`voice-synthsizer-job-handler`). Jobs are delivered via SQS messages containing job identifiers.
## Core Architecture & Context
The codebase implements asynchronous background workers processing voice cloning and speech synthesis jobs from AWS SQS queues.
## Key Verification Details for Graders
### 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.
1. **Voice Cloning Handler (`voice-cloning-job-handler`)**:
- Queries and updates on `VoiceCloning` and `UserAudioProfile` must incorporate `userId` alongside record `_id`.
- Audio rendering and database writes must be halted if tenant ownership checks fail.
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.
2. **Speech Synthesis Handler (`voice-synthsizer-job-handler`)**:
- The initial `UserAudioProfile` query uses `_id: userAudioProfileId` to resolve the tenant's `userId`.
- All subsequent queries and updates on `RecordingSalutation` and `Recording` must be scoped by the profile-derived `userId`.
- Audio rendering and database writes must be halted if tenant ownership checks fail.
### 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.
3. **Single-Deduction & Scoped No-Match Guidelines**:
- Charge query syntax omissions under query criteria (`cloning-tenant-isolation` or `synthesis-tenant-isolation-queries-updates`).
- Charge preflight side-effect execution under side-effect criteria (`cloning-prevent-unauthorized-side-effects` or `synthesis-prevent-unauthorized-side-effects`).
- A query or update that filters by `userId` but returns a null result (0 records modified) is safe from cross-tenant data leaks. Missing a check for a null result is a minor defensive error handling defect under Broader Correctness, not a Crux security failure.
4. **Reliability & SQS Behavior**:
- Exception handling via `try-catch` blocks prevents SQS worker loops from crashing on malformed payloads or job errors.
- Standard framework SQS message deletion and acknowledgment on both completed and rejected jobs must not be penalized.
### 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).

View File

@@ -1,26 +1,31 @@
# Task-Specific Holistic Rubric: Multi-Tenant Worker Isolation (`potion-voice-user-ownership`)
# Holistic Rubric: Multi-Tenant Worker Isolation (`potion-voice-user-ownership`)
## Primary Intent & Multi-Tenant Security
## 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`.
### Voice Cloning Handler (`voice-cloning-job-handler`)
- **Query & Update Isolation**: Every database operation on `VoiceCloning` and `UserAudioProfile` models must filter by `userId` alongside record `_id`.
- **Preflight Side-Effect Halting (Crux)**: If tenant ownership checks fail or records do not match the tenant context, the handler must halt before performing audio rendering operations or database mutations.
- *Crux Penalty*: Failing to halt preflight side effects when tenant validation fails applies a heavy penalty to **Narrow Correctness** and a heavy penalty to the **Overall Score** (reducing the overall score by 0.25 to 0.30 below an otherwise-equivalent run).
## 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.
### Speech Synthesis Handler (`voice-synthsizer-job-handler`)
- **Initial Profile Lookup**: The initial lookup on `UserAudioProfile` using `_id: userAudioProfileId` is valid for resolving tenant identity (`userId`).
- **Query & Update Isolation**: All downstream database reads and updates on `RecordingSalutation` and `Recording` models must filter by the profile-derived `userId`.
- **Preflight Side-Effect Halting (Crux)**: If tenant ownership checks fail or records do not match the tenant context, the handler must halt before performing audio rendering operations or database mutations.
- *Crux Penalty*: Failing to halt preflight side effects when tenant validation fails applies a heavy penalty to **Narrow Correctness** and a heavy penalty to the **Overall Score** (reducing the overall score by 0.25 to 0.30 below an otherwise-equivalent run).
## 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.
## Single-Deduction Routing & Scoped No-Match Rules
- **Single-Deduction Rule**: Charge query syntax omissions under query criteria (`cloning-tenant-isolation` or `synthesis-tenant-isolation-queries-updates`). Charge preflight side-effect execution under side-effect criteria (`cloning-prevent-unauthorized-side-effects` or `synthesis-prevent-unauthorized-side-effects`). Do not double-charge a single defect across query criteria and side-effect criteria.
- **Scoped No-Match (Non-Breach / Minor Defect)**: A query or update that includes the `userId` filter but returns a null result (0 records modified) cannot leak or corrupt cross-tenant data. Missing a check for a null result on an already-scoped update is evaluated as a minor defensive programming defect under **Broader Correctness / the craft of software engineering**, not as a Crux security breach.
## 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.
## Reliability & Summary
- **Worker Loop Resilience**: Message processing must be wrapped in `try-catch` blocks to prevent worker polling loops from crashing on exceptions. Framework SQS message deletion and acknowledgment on both completed and rejected jobs is standard framework behavior and must not be penalized.
- **Summary Accuracy**: Written refactoring documentation or code comments must accurately describe the multi-tenant isolation logic without misleading claims.
## 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.
## Holistic Scoring Guidance
- **High-Quality Response**: Enforces tenant isolation across all database queries and updates in both handlers, halts execution before performing unauthorized side effects when tenant checks fail, catches errors to keep polling loops alive, checks for a null result on database updates, and accurately summarizes the changes.
- **Deduction Guidance**: Apply heavy penalties to Narrow Correctness and the Overall Score for preflight side-effect execution failures when tenant validation fails. Charge query syntax omissions under Narrow Correctness. Evaluate missing null checks on scoped updates as minor Broader Correctness deductions.
## 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.

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 a null result (0 records modified) is a safe no-match and is evaluated under Broader Correctness / the craft of software engineering, not as a Crux side-effect failure.
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.
### 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 a null result (0 records modified) is a safe no-match and is evaluated under Broader Correctness / the craft of software engineering, not as a Crux side-effect failure.
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.
### 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 when performing tenant-scoped database updates before proceeding. **Answer key: Database update operations that filter by tenant userId should check for a null result before assuming success.**
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.**
Evaluates defensive error handling on scoped database updates. Note: A query or update that already filters by tenant userId but returns a null result (0 records modified) cannot leak cross-tenant data; failing to check for a null result is a minor defensive programming defect under Broader Correctness / the craft of software engineering, not a Crux security breach.
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.
### Criterion: worker-loop-crash-prevention