pre-trial detector run 05
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
detector: detector-answer-obviousness
|
||||
verdict: obvious
|
||||
confidence: HIGH
|
||||
verdict: partial
|
||||
confidence: MEDIUM
|
||||
---
|
||||
# Answer-obviousness check: potion-voice-user-ownership
|
||||
|
||||
@@ -9,22 +9,34 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
|
||||
|
||||
## What the prompt asks
|
||||
|
||||
The prompt requests tenant-scoped cloning and synthesis reads and updates, profile-derived tenant identity for synthesis, halting after failed tenant checks, resilient worker polling, and an accurate description of the refactor. It does not dictate helper design or the exact code edits.
|
||||
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.
|
||||
|
||||
## Per-expectation assessment
|
||||
|
||||
### Query isolation and profile source — obvious
|
||||
### Tenant-scoped queries and updates — obvious
|
||||
|
||||
The two handler filter rules and the initial profile lookup exemption follow the prompt directly. The agent still has to locate every active query and update.
|
||||
- **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.
|
||||
|
||||
### Preflight side-effect gate — obvious
|
||||
### Preflight side-effect halting — obvious
|
||||
|
||||
The prompt explicitly asks the agent to halt rendering and database mutations if tenant validation fails or records do not match the tenant context. The rubric's primary stop requirement is therefore inferable.
|
||||
- **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.
|
||||
|
||||
### Polling and accurate summary — obvious
|
||||
### Worker-loop error handling — obvious
|
||||
|
||||
Try-catch resilience is explicit in the prompt. Accurately describing implemented changes is ordinary professional communication. Neither adds a hidden behavior choice.
|
||||
- **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.
|
||||
|
||||
### Null checks on database updates — not-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.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
The positively scored expectations are reasonable from the prompt. The atomic package's stronger update-result answer key has a separate coverage finding; this detector finds no mind-reading requirement in the holistic rubric.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,16 +5,24 @@ confidence: MEDIUM
|
||||
---
|
||||
# Broken-dev-env 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, the materialized workspace, task.toml, and available run artifacts
|
||||
|
||||
## Verbatim grounding
|
||||
|
||||
> “A recent security audit revealed a critical multi-tenant data isolation vulnerability: background job handlers retrieve, update, and process MongoDB records using only document identifiers (e.g., `_id`, `userAudioProfileId`, `salutationId`) provided in queue message payloads, without validating tenant ownership (`userId`).”
|
||||
> “These handlers lack proper tenant ownership isolation.”
|
||||
|
||||
The cloning worker uses `voiceCloningService.update({ _id, status: 'processing' })` and an ID-only profile update. The synthesis worker reads recording records by ID. Both worker entry files pass `node --check`.
|
||||
> “You must audit and refactor both handlers to enforce strict multi-tenant isolation.”
|
||||
|
||||
The active cloning code contains an ID-only update:
|
||||
|
||||
> await voiceCloningService.update({ _id, status: 'processing' })
|
||||
|
||||
The root package manifest contains:
|
||||
|
||||
> “scripts”: {}
|
||||
|
||||
## Rationale
|
||||
|
||||
The ownership weakness in the workspace is the subject of the prompt, not incidental environment breakage. The declared source commit resolves locally, both workers are present, and the baseline has no failing test script.
|
||||
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 reference-runs directory is currently empty, as expected for a pretrial check. Infrastructure completion and prompt/rubric coherence across future scored runs therefore cannot yet be assessed. No current workspace premise mismatch is evident.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
---
|
||||
detector: detector-credential-leakage
|
||||
verdict: not-applicable
|
||||
verdict: clean
|
||||
confidence: HIGH
|
||||
---
|
||||
# Credential-leakage check: potion-voice-user-ownership
|
||||
|
||||
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
|
||||
Assessed: authored Dockerfile, instruction.md, tests markdown, and the materialized source workspace; environment/workspace.patch is absent
|
||||
|
||||
## Findings
|
||||
|
||||
No `environment/workspace.patch` exists. There are no task-authored added source lines to scan for credentials or checkout paths.
|
||||
### 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.
|
||||
|
||||
No credential pattern survived the placeholder/provenance checks on a task-authored surface, and no authored absolute checkout path exists.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
`not-applicable` for the detector's authored-surface check.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,16 @@ confidence: HIGH
|
||||
---
|
||||
# Cross-task-reference 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, instruction.md, and authored workspace additions
|
||||
|
||||
## Verbatim grounding
|
||||
|
||||
> “Refactor Background Handlers for Multi-Tenant Data Isolation”
|
||||
> “Task-Specific Holistic Rubric: Multi-Tenant Worker Isolation (potion-voice-user-ownership)”
|
||||
|
||||
> “Voice Cloning Handler (voice-cloning-job-handler)”
|
||||
|
||||
These names identify this task and its own source directories.
|
||||
|
||||
## Rationale
|
||||
|
||||
The named handlers are source directories in this task's workspace. Neither the prompt nor the holistic rubric cites another graded task or assumes access to a sibling task's prompt, workspace, or rubric.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,14 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
|
||||
|
||||
## Verbatim grounding
|
||||
|
||||
> “Failing preflight tenant validation and executing unauthorized side effects (audio rendering or database writes) incurs a heavy penalty on **Narrow Correctness** and a heavy penalty on the **Overall Score**.”
|
||||
> “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 to check if an update returned `null` on an already `userId`-scoped query is a minor defensive programming defect evaluated under **Broader Correctness / the craft of software engineering**, not a Crux security breach.”
|
||||
> “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.”
|
||||
|
||||
> “Charge query syntax omissions under Narrow Correctness.”
|
||||
|
||||
## Rationale
|
||||
|
||||
A code path that renders or mutates before checking tenant ownership fails the requested deliverable and belongs to Narrow Correctness. The combined Narrow and overall penalty is the shared standard's supported pattern. A scoped write whose result is not checked is routed to craft rather than Integrity or the security Crux.
|
||||
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.
|
||||
|
||||
Polling-loop resilience is also a Broader Correctness concern. The rubric places inaccurate or unverified implementation claims under Verification & Thoroughness. All named dimensions are canonical, and the charge-once rule prevents reusing one omission as two deductions.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,48 +6,87 @@ claims:
|
||||
- id: c01
|
||||
verdict: pass
|
||||
loadBearing: true
|
||||
summary: "Cloning worker uses ID-only model updates"
|
||||
rubricQuote: "All reads and updates to `VoiceCloning` and `UserAudioProfile` must incorporate `userId` alongside record `_id`."
|
||||
sourceEvidence: "await voiceCloningService.update({ _id, status: 'processing' })"
|
||||
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/index.js (line 139; ID-only profile update at lines 140-143)"
|
||||
note: "The baseline weakness the rubric asks to fix is visible in the active handler. The agent can inspect the worker and service locally."
|
||||
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."
|
||||
sourceEvidence: |-
|
||||
userId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: 'User',
|
||||
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."
|
||||
- id: c02
|
||||
verdict: pass
|
||||
loadBearing: true
|
||||
summary: "Synthesis downstream operations lack userId filters"
|
||||
rubricQuote: "All subsequent reads and updates to `RecordingSalutation` and `Recording` must be scoped by the profile-derived `userId`."
|
||||
sourceEvidence: "const recordingToUpdate = await recordingModel.findOne({\n _id: recordingId,\n deleted: false,\n })"
|
||||
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 157-160; salutation read lines 152-155; update lines 169-177)"
|
||||
note: "The baseline downstream reads and salutation update are ID-only. The agent can trace them in the workspace."
|
||||
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)."
|
||||
sourceEvidence: |-
|
||||
const userAudioProfile = await userAudioProfileService.find({
|
||||
_id: userAudioProfileId,
|
||||
status: 'completed',
|
||||
})
|
||||
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."
|
||||
- id: c03
|
||||
verdict: pass
|
||||
loadBearing: true
|
||||
summary: "Initial profile lookup resolves synthesis userId"
|
||||
rubricQuote: "The initial `UserAudioProfile` lookup by `_id: userAudioProfileId` is required to resolve `userId`."
|
||||
sourceEvidence: "const userAudioProfile = await userAudioProfileService.find({\n _id: userAudioProfileId,\n status: 'completed',\n })\n if (userAudioProfile) {\n const { training_model_path, userId } = userAudioProfile[0]"
|
||||
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 96-101)"
|
||||
note: "The handler obtains userId from the profile. The prompt also makes this first lookup reachable to the agent."
|
||||
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 scoped no-match update changes no document"
|
||||
rubricQuote: "A database query or update that already filters by `userId` but returns no matching record (0 documents modified) is a safe no-match that cannot corrupt or leak cross-tenant data."
|
||||
sourceEvidence: "const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n { ...filter },"
|
||||
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js (lines 89-90)"
|
||||
note: "Mongoose applies the complete filter to the operation, so a no-match result changes no matched record. This verifies the direct database operation only; it does not establish that any subsequent effects are safe."
|
||||
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."
|
||||
sourceEvidence: |-
|
||||
const updatedSalutation = await Salutation.findOneAndUpdate(
|
||||
{ _id: salutation._id, userId },
|
||||
salutation,
|
||||
{ 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
|
||||
verdict: pass
|
||||
loadBearing: true
|
||||
summary: "Both handlers contain polling loops"
|
||||
rubricQuote: "Unhandled exceptions during message processing must be caught in a `try-catch` block so the background worker polling loop remains active."
|
||||
sourceEvidence: "while (true) {\n await processQueue()"
|
||||
sourceProvenance: "harbor-tasks/potion-voice-user-ownership/environment/workspace/voice-synthsizer-job-handler/index.js (lines 259-260; cloning equivalent lines 324-325)"
|
||||
note: "Both worker loops are present. Exception handling is the target, not a claim that the baseline already handles every error."
|
||||
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."
|
||||
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
|
||||
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."
|
||||
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."
|
||||
---
|
||||
# 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/`, built from locally resolving `repos/potion-voice` commit `fcd8a9d0b00406bda1943c234a8f2fecaff9f774` without a workspace patch.
|
||||
Source: harbor-tasks/potion-voice-user-ownership/environment/workspace/ — materialized from locally resolving repos/potion-voice commit fcd8a9d0b00406bda1943c234a8f2fecaff9f774, with no workspace patch.
|
||||
|
||||
Checked five load-bearing claims; all are supported by locally reachable code or filtered-update semantics. The unsupported `voiceCloningId` assertion is in the atomic grader context, not the resolved holistic rubric, and is recorded in the rubric-coverage report.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,16 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
|
||||
|
||||
## Positive target present?
|
||||
|
||||
Yes. The rubric describes tenant-scoped reads and updates in both handlers, an allowed first profile lookup, preflight ownership gates before rendering or mutation, resilient polling, and an accurate summary.
|
||||
Yes. The rubric says:
|
||||
|
||||
> “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.”
|
||||
|
||||
The handler-specific sections also identify the models, tenant source, and permitted initial profile lookup.
|
||||
|
||||
## What the grader has to infer
|
||||
|
||||
Exact helper edits and control-flow structure remain open. The target behaviors themselves are affirmative and concrete. The high-quality-response section reinforces the positive target without assigning a fixed score.
|
||||
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.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
A grader can identify the broad shape of a strong implementation. The verdict is `defines-good`.
|
||||
A grader reading only the rubric has a concrete affirmative model of a strong response. The rubric therefore defines good.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,14 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and
|
||||
|
||||
## Plausible strong-response approaches
|
||||
|
||||
A strong implementation can put tenant predicates and ownership gates in handlers, helper services, or both. It can use a preflight read, conditional database operations with checked results, or both. The synthesis handler may use the initial profile read to establish tenant context. An honest disclosure of incomplete work remains a valid communication shape, though incomplete code earns less correctness credit.
|
||||
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.
|
||||
|
||||
## Coverage in the rubric
|
||||
|
||||
The rubric grades tenant filters and observable preflight behavior without prescribing helper architecture. It explicitly allows the initial profile lookup and ordinary SQS acknowledgment. It treats unchecked late null results as a separate craft issue, so a response that checks them can still receive credit. There are no current reference runs to test penalty-side edge cases.
|
||||
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.
|
||||
|
||||
No reference runs exist, so the run-evidenced penalty-side patterns cannot yet be assessed.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
No major reasonable implementation path is excluded. The atomic package now includes a scoped-update-null-handling criterion; coverage checks whether its answer key stays within the holistic rule.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
---
|
||||
detector: detector-offline-verifiability
|
||||
verdict: offline-verifiable
|
||||
confidence: MEDIUM
|
||||
confidence: HIGH
|
||||
---
|
||||
# Offline-verifiability check: potion-voice-user-ownership
|
||||
|
||||
Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md and tests/holistic-rubric.md
|
||||
Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md, tests/holistic-rubric.md, package manifests, and the materialized workspace
|
||||
|
||||
## Findings
|
||||
|
||||
The required changes concern local worker code: query filters, ownership gates, follow-through after database results, and polling error handling. Queue responses, model methods, uploads, and audio commands can be stubbed for targeted tests. Live AWS or MongoDB access is unnecessary to implement or verify those local behaviors.
|
||||
### MongoDB, SQS, and audio rendering — external-sounding context (cleared)
|
||||
|
||||
- **Where:** instruction.md, Overview.
|
||||
- **Quote:**
|
||||
|
||||
> “Our backend background workers ... currently process jobs by querying MongoDB records using document IDs provided in SQS queue messages.”
|
||||
|
||||
- **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.
|
||||
|
||||
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.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
The task is completable and checkable inside the supplied workspace.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
---
|
||||
detector: detector-over-hinting
|
||||
verdict: clean
|
||||
confidence: MEDIUM
|
||||
confidence: HIGH
|
||||
---
|
||||
# Over-hinting check: potion-voice-user-ownership
|
||||
|
||||
Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md and environment/workspace.patch (absent)
|
||||
Assessed: harbor-tasks/potion-voice-user-ownership/instruction.md, the absent workspace patch, and tests/holistic-rubric.md as calibration
|
||||
|
||||
## Findings
|
||||
|
||||
The prompt specifies tenant isolation, the initial profile tenant source, side-effect stopping after failed checks, try-catch resilience, and a written explanation. These are requested behavior and context for a code refactor. It does not point to the exact defective calls or provide a patch. No authored workspace patch adds explanatory comments.
|
||||
### Named tenant predicates — prompt-hint (cleared)
|
||||
|
||||
- **Where:** instruction.md, Key Requirements.
|
||||
- **Quote:**
|
||||
|
||||
> “Scope all database reads and updates on VoiceCloning and UserAudioProfile models using 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.
|
||||
|
||||
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.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
The prompt is detailed but does not leak a code-level solution. `clean`.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
detector: detector-rubric-clarity
|
||||
verdict: clear
|
||||
verdict: material-issues
|
||||
confidence: HIGH
|
||||
---
|
||||
# Rubric-clarity check: potion-voice-user-ownership
|
||||
@@ -9,14 +9,24 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
|
||||
|
||||
## Material ambiguities
|
||||
|
||||
None found. The high-quality and flawed-response descriptions are qualitative summaries, not fixed score pins. The Crux trigger specifies execution of rendering or writes before tenant validation, and its heavy penalties target Narrow Correctness and the overall score. The safe scoped no-match rule explicitly routes an unchecked null result to Broader Correctness instead of Crux. The charge-once rule separates filter omissions from side-effect execution.
|
||||
### A scoped preflight no-match is both Crux and minor
|
||||
|
||||
No current reference runs exist to test how borderline implementations would be graded.
|
||||
- **Where:** The handler-specific Crux rules say:
|
||||
|
||||
> “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.”
|
||||
|
||||
The scoped no-match rule later 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.”
|
||||
|
||||
- **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.
|
||||
- **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.
|
||||
|
||||
## Copy-edit issues
|
||||
|
||||
None that interrupt use. The repeated “standard” in the SQS sentence is readable but can be trimmed.
|
||||
None found. The prose otherwise reads professionally.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
The current holistic rubric gives a usable scoring boundary without numeric score pins or undefined criterion targets. `clear`.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
detector: detector-rubric-coverage
|
||||
verdict: material-issues
|
||||
verdict: clear
|
||||
confidence: HIGH
|
||||
---
|
||||
# Rubric-coverage check: potion-voice-user-ownership
|
||||
@@ -9,33 +9,35 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai
|
||||
|
||||
## Coverage map
|
||||
|
||||
| Holistic rule | Atomic entry | Status |
|
||||
| Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status |
|
||||
| --- | --- | --- |
|
||||
| Both handlers scope tenant-owned reads and updates by userId | Two tenant-isolation criteria | covered |
|
||||
| Initial synthesis profile lookup by ID is valid | `initial-profile-tenant-resolution` | covered |
|
||||
| Unauthorized preflight effects trigger heavy Narrow and overall penalties | Two handler-specific Crux criteria | covered |
|
||||
| A scoped update returning null is a minor craft finding, not Crux | `scoped-update-null-handling` and context | covered with extra condition |
|
||||
| Worker try-catch and SQS acknowledgment protection | `worker-loop-crash-prevention` | covered |
|
||||
| Accurate response or code documentation | `refactor-summary-accuracy` | covered |
|
||||
| Charge each defect once | Both Crux elaborations and context | covered |
|
||||
| “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 |
|
||||
| “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 |
|
||||
|
||||
## Coverage gaps
|
||||
|
||||
None. The new `scoped-update-null-handling` criterion fills the earlier omission.
|
||||
None found.
|
||||
|
||||
## Invented content
|
||||
|
||||
- **Stronger update-result test:** The holistic rubric grades “Failing to check if an update returned `null`” as a minor defect. The atomic answer key says the response should “verify that a record was matched and modified before assuming success.” A matched, idempotent write can modify zero fields while returning a record. Requiring proof of modification adds a condition not in the holistic rubric and could mark that valid case down.
|
||||
- **Unsupported queue-field context:** `tests/grader-context.md` says the cloning handler ingests payloads containing “`userId` and `voiceCloningId`.” Neither the holistic rubric nor instruction specifies a `voiceCloningId` payload field. The current handler destructures `_id` and `userAudioProfileId` from `job._doc` at lines 100–104, and has no `voiceCloningId` reference. This extra ground-truth statement can mislead the grader about the correct tenant source or record ID.
|
||||
None found. The atomic answer keys restate requirements or protections present in the holistic rubric.
|
||||
|
||||
## Context integrity
|
||||
|
||||
The architecture, profile-derived synthesis tenant source, preflight requirement, scoped no-match rule, and SQS allowance survive in the atomic context. The issue is added context, not missing context.
|
||||
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.
|
||||
|
||||
## Crux alignment
|
||||
|
||||
The two Crux criteria correspond to the holistic heavy penalties on Narrow Correctness and the overall score and stay within the two-Crux cap.
|
||||
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.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
The atomic package now captures all holistic requirements, but its extra update-result condition and unsupported cloning payload field change how a response could be graded. The verdict remains `material-issues` for invented content.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
detector: detector-rubric-form
|
||||
verdict: clear
|
||||
verdict: material-issues
|
||||
confidence: HIGH
|
||||
---
|
||||
# Rubric-form check: potion-voice-user-ownership
|
||||
@@ -9,29 +9,37 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml and
|
||||
|
||||
## Deterministic contract
|
||||
|
||||
1. **Pass:** YAML parses with top-level `task` and eight `criteria`.
|
||||
2. **Pass:** The task value matches the slug.
|
||||
3. **Pass:** All IDs are unique kebab-case.
|
||||
4. **Pass:** Categories use the allowed vocabulary.
|
||||
5. **Pass:** Severities use the allowed vocabulary and placement.
|
||||
6. **Pass:** Exactly two Crux criteria meet the cap.
|
||||
7. **Pass:** Every dimensions entry names an exact Grading Standard dimension.
|
||||
8. **Pass:** Guidelines are nonempty.
|
||||
9. **Pass:** Numeric-penalty sweeps found no penalty amount. “0 records modified” describes database behavior, not score arithmetic.
|
||||
11. **Pass:** Guidelines are positively phrased.
|
||||
1. **Pass:** The YAML parses with a top-level task string and eight criteria.
|
||||
2. **Pass:** The task value matches 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.
|
||||
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.
|
||||
|
||||
## Atomicity and self-containment
|
||||
|
||||
The eight criteria are independently judgeable. The new scoped-update-null-handling criterion stands alone as a defensive follow-through check.
|
||||
### Null-result carve-out makes each side-effect Crux criterion non-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.
|
||||
|
||||
The remaining criteria use sanctioned same-derivation bundles and are self-contained.
|
||||
|
||||
## Phrasing and answer keys
|
||||
|
||||
Bold inline answer keys are present. Elaborations explain penalty routing and the scoped no-match exemption without adding a separate response requirement.
|
||||
All guidelines are positively phrased and include bold inline answer keys. No elaboration adds an unrelated requirement.
|
||||
|
||||
## Fair-grading findings
|
||||
|
||||
No out-of-reach action, forced implementation approach, or built-in duplicate charge found. Whether “matched and modified” adds to the holistic rule is assessed by rubric coverage, not form.
|
||||
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.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
The deterministic and judgment-layer form checks pass. `clear`.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,16 +9,16 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
|
||||
|
||||
## Load-bearing run-dependence
|
||||
|
||||
None found. The rubric defines failure conditions without referring to scores or behavior in observed runs.
|
||||
None found.
|
||||
|
||||
## Run-anchored phrasings
|
||||
|
||||
None found. There are currently no reference runs.
|
||||
None found. The rubric defines response properties without referring to trials, captured behavior, expected score distributions, or predicted criterion signal.
|
||||
|
||||
## Infra-framework references
|
||||
|
||||
None found. The rubric does not invoke Harbor or another grading framework by name.
|
||||
None found. The rubric does not name Harbor, Pier, a sandbox, a runner, or another grading framework.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
The rubric states general response properties rather than calibration against specific trials.
|
||||
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.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-16T16:24:57.547Z",
|
||||
"capturedAt": "2026-10-16T16:40:41.259Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "965c8d7d9e6120dc351739c1b2453e6ec7249a585a63614dc9bc21f4b3568854",
|
||||
"prompt": "07a54de337f957f7559a703ae5aac8afbacdfaf5d31951c0b23f0224e9830aef",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "3b9ca74913311c5f4099505cff26067c1f4643f41bc77c59fcc24867f93b7320",
|
||||
"atomicRubric": "0e90e8531669c7d85963a3b42ad588646a55f0d59d37874cde3feb99cb6675cc",
|
||||
"holisticRubric": "9a06f9fafc489eb7167aea516de5c3f7163ad6937be9c0f72c1dc17fd876eed3",
|
||||
"atomicRubric": "5dd2c215f5e01e535fa3d6737c5d0094d4fdabda54283b343d8046a0bd01f2da",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "5a0bb9a1d526e9334cd5fdbf3e1e6b05246a2e6c4039f8166804b297fcc9e5bd"
|
||||
"graderContext": "d9d08c7a4d8d19dbc7b7fbc5c8226fe7e11703966b8a58c2e3ac6156c3ad62aa"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,16 +5,16 @@ confidence: HIGH
|
||||
---
|
||||
# Snapshot-leakage check: potion-voice-user-ownership
|
||||
|
||||
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and environment/
|
||||
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and the complete environment bundle
|
||||
|
||||
## Verbatim grounding
|
||||
|
||||
There is no `environment/session.jsonl`, `environment/session/`, or root `session-full.jsonl`. The task uses a manual prompt.
|
||||
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.
|
||||
|
||||
## Rationale
|
||||
|
||||
No injected conversation or sidechain can leak rubric facts to the test agent.
|
||||
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.
|
||||
|
||||
## Snapshot hygiene (advisory)
|
||||
|
||||
No snapshot artifacts are present.
|
||||
No snapshot artifacts or snapshot hygiene issues are present.
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
# Refactor Background Handlers for Multi-Tenant Data Isolation
|
||||
# Refactor Background Worker Handlers for Multi-Tenant Isolation
|
||||
|
||||
## Context
|
||||
Our backend background worker services process voice cloning and speech synthesis jobs asynchronously via SQS message queues. A recent security audit revealed a critical multi-tenant data isolation vulnerability: background job handlers retrieve, update, and process MongoDB records using only document identifiers (e.g., `_id`, `userAudioProfileId`, `salutationId`) provided in queue message payloads, without validating tenant ownership (`userId`).
|
||||
## 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.
|
||||
|
||||
## Requirements
|
||||
1. **Audit & Refactor Background Handlers**:
|
||||
- Inspect `voice-cloning-job-handler` and `voice-synthsizer-job-handler`.
|
||||
- Ensure all database reads and updates on tenant-owned models (`VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`) are strictly scoped by tenant identity (`userId`).
|
||||
- For `voice-synthsizer-job-handler`, derive the tenant identity (`userId`) from the initial `UserAudioProfile` lookup before executing downstream queries or updates on `RecordingSalutation` and `Recording`.
|
||||
You must audit and refactor both handlers to enforce strict multi-tenant isolation.
|
||||
|
||||
2. **Prevent Unauthorized Side Effects**:
|
||||
- If tenant ownership validation fails or a record does not belong to the expected tenant, immediately halt background job processing.
|
||||
- Do not perform audio generation rendering or mutate database records when tenant validation fails.
|
||||
## Key Requirements
|
||||
|
||||
3. **Maintain Worker Resilience & Log Accuracy**:
|
||||
- Ensure exceptions during message handling are caught gracefully so the worker polling loop does not crash.
|
||||
- Provide a clear, accurate summary of the refactoring changes made across both handlers in your final response or documentation.
|
||||
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. **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. **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.
|
||||
|
||||
@@ -46,7 +46,9 @@ criteria:
|
||||
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.'
|
||||
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.'
|
||||
- id: synthesis-prevent-unauthorized-side-effects
|
||||
name: Synthesis Prevent Unauthorized Side Effects
|
||||
category: primary_intent
|
||||
@@ -64,7 +66,10 @@ criteria:
|
||||
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.'
|
||||
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.'
|
||||
- id: initial-profile-tenant-resolution
|
||||
name: Initial Profile Tenant Resolution
|
||||
category: dodged_bullet
|
||||
@@ -88,14 +93,14 @@ criteria:
|
||||
- voice-cloning-job-handler
|
||||
- voice-synthsizer-job-handler
|
||||
severity: unlikely_dealbreaker
|
||||
guideline: 'The response should check and handle null or zero-match return values
|
||||
on tenant-scoped database updates before proceeding. **Answer key: Database update
|
||||
operations that filter by tenant userId should verify that a record was matched
|
||||
and modified before assuming success.**'
|
||||
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 matches 0 records
|
||||
cannot leak cross-tenant data; failing to check its return value is a minor defensive
|
||||
programming defect under Broader Correctness, not a Crux security breach.'
|
||||
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.'
|
||||
- id: worker-loop-crash-prevention
|
||||
name: Worker Loop Crash Prevention
|
||||
category: dodged_bullet
|
||||
|
||||
@@ -1,31 +1,24 @@
|
||||
# Grader Context: Potion Voice Multi-Tenant User Ownership
|
||||
# Grader Context: Multi-Tenant Worker Isolation (`potion-voice-user-ownership`)
|
||||
|
||||
## Architectural Reference Ground Truth
|
||||
## 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.
|
||||
|
||||
### 1. Handler Breakdown & Data Models
|
||||
* **`voice-cloning-job-handler`**:
|
||||
* Ingests voice cloning job payloads containing `userId` and `voiceCloningId`.
|
||||
* Models involved: `VoiceCloning` and `UserAudioProfile`.
|
||||
* Both read queries and update operations on `VoiceCloning` and `UserAudioProfile` must explicitly include `userId` in the query filter alongside record `_id`.
|
||||
## Key Verification Details for Graders
|
||||
|
||||
* **`voice-synthsizer-job-handler`**:
|
||||
* Ingests synthesis job payloads containing `userAudioProfileId` and `salutationId`.
|
||||
* Step 1: Reads `UserAudioProfile` by `_id: userAudioProfileId` to resolve the owning `userId`.
|
||||
* Step 2: Uses the resolved `userId` to scope all downstream queries and updates on `RecordingSalutation` and `Recording`.
|
||||
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. Security & Side-Effect Rules
|
||||
* **Crux Requirement (Preflight Halting)**:
|
||||
* Audio rendering operations and database mutations must be halted if tenant ownership checks fail.
|
||||
* Executing preflight side effects on unvalidated payloads triggers heavy penalties on Narrow Correctness and the Overall Score.
|
||||
* **Single-Deduction Rule**:
|
||||
* Charge query syntax omissions under the query isolation criteria (`cloning-tenant-isolation` or `synthesis-tenant-isolation-queries-updates`).
|
||||
* Charge execution of unauthorized preflight side effects under the handler-specific Crux 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.
|
||||
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.
|
||||
|
||||
### 3. Defensive Programming & Null Handling
|
||||
* **Scoped Update Null Handling**:
|
||||
* Queries and updates that filter by `userId` are inherently tenant-isolated (0 records modified if tenant ID does not match).
|
||||
* Missing a `null` check on an already `userId`-scoped update is a minor defensive programming defect evaluated under `scoped-update-null-handling` in **Broader Correctness / the craft of software engineering**, NOT a Crux security breach.
|
||||
* **Polling Loop Crash Prevention**:
|
||||
* Exceptions during message processing must be wrapped in a `try-catch` block to keep worker polling loops running.
|
||||
* Standard framework SQS message deletion and acknowledgment on completed and rejected jobs must not be penalized.
|
||||
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.
|
||||
|
||||
@@ -1,35 +1,26 @@
|
||||
# Holistic Evaluation Guidelines: Potion Voice Multi-Tenant User Ownership
|
||||
# Task-Specific Holistic Rubric: Multi-Tenant Worker Isolation (`potion-voice-user-ownership`)
|
||||
|
||||
## Scenario Overview
|
||||
The candidate is tasked with auditing and refactoring two asynchronous background job handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) to enforce strict multi-tenant data isolation across MongoDB collections (`VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, and `Recording`).
|
||||
## Primary Intent & Multi-Tenant Security
|
||||
|
||||
---
|
||||
### 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).
|
||||
|
||||
## Performance Expectations Across Standard Dimensions
|
||||
### 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).
|
||||
|
||||
### 1. Narrow Correctness
|
||||
* **Tenant-Scoped Queries & Updates**:
|
||||
* In `voice-cloning-job-handler`: All reads and updates to `VoiceCloning` and `UserAudioProfile` must incorporate `userId` alongside record `_id`.
|
||||
* In `voice-synthsizer-job-handler`: The initial `UserAudioProfile` lookup by `_id: userAudioProfileId` is required to resolve `userId`. All subsequent reads and updates to `RecordingSalutation` and `Recording` must be scoped by the profile-derived `userId`.
|
||||
* **Side-Effect Preflight Halting (Crux Requirement)**:
|
||||
* Audio rendering and database mutations must be halted if tenant ownership checks fail.
|
||||
* **Penalty Routing**: Failing preflight tenant validation and executing unauthorized side effects (audio rendering or database writes) incurs a heavy penalty on **Narrow Correctness** and a heavy penalty on the **Overall Score**.
|
||||
* **Single-Deduction Rule**: Charge query syntax omissions under tenant query isolation; charge execution of unauthorized side effects under side-effect halting. Do not double-charge a single code omission across multiple criteria.
|
||||
## 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.
|
||||
|
||||
### 2. Broader Correctness / the craft of software engineering
|
||||
* **Defensive Error & Null Handling**:
|
||||
* Unhandled exceptions during message processing must be caught in a `try-catch` block so the background worker polling loop remains active.
|
||||
* **Scoped Update Null Handling**: A database query or update that already filters by `userId` but returns no matching record (0 documents modified) is a safe no-match that cannot corrupt or leak cross-tenant data. Failing to check if an update returned `null` on an already `userId`-scoped query is a minor defensive programming defect evaluated under **Broader Correctness / the craft of software engineering**, not a Crux security breach.
|
||||
* **Framework Behavior**:
|
||||
* Standard SQS message deletion and acknowledgment on completed and rejected jobs inherited from the worker framework is standard behavior and must not be penalized.
|
||||
## 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.
|
||||
|
||||
### 3. Verification & Thoroughness
|
||||
* **Refactoring Summary & Documentation**:
|
||||
* Any written response or code documentation must accurately reflect the multi-tenant isolation logic without misleading or false claims about tenant checks that were not implemented.
|
||||
|
||||
---
|
||||
|
||||
## Summary Evaluation 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, and accurately summarizes the changes.
|
||||
* **Flawed Response**: Misses `userId` scoping on queries or updates, executes audio rendering or database writes without verifying tenant ownership (triggering overall score penalties), crashes the worker polling loop on errors, or misrepresents the refactoring in documentation.
|
||||
## 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.
|
||||
|
||||
@@ -41,6 +41,14 @@
|
||||
"Narrow Correctness"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "scoped-update-null-handling",
|
||||
"category": "dodged_bullet",
|
||||
"severity": "unlikely_dealbreaker",
|
||||
"dimensions": [
|
||||
"Broader Correctness / the craft of software engineering"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "worker-loop-crash-prevention",
|
||||
"category": "dodged_bullet",
|
||||
|
||||
@@ -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 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 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.
|
||||
|
||||
### 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 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 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.
|
||||
|
||||
### Criterion: initial-profile-tenant-resolution
|
||||
|
||||
@@ -28,6 +28,12 @@ The response should allow the initial UserAudioProfile lookup by _id: userAudioP
|
||||
|
||||
Prevents improperly docking points for the initial profile query needed to discover the tenant identity.
|
||||
|
||||
### 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.**
|
||||
|
||||
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.
|
||||
|
||||
### Criterion: worker-loop-crash-prevention
|
||||
|
||||
The response should catch and handle exceptions during message processing in a try-catch block to prevent background worker polling loops from crashing. **Answer key: Errors during job processing must be caught gracefully in a try-catch block so the worker polling loop remains active.**
|
||||
|
||||
Reference in New Issue
Block a user