4 flagging detectors

This commit is contained in:
2026-10-14 15:22:32 -04:00
parent d57be346c4
commit d18ba5e3fe
12 changed files with 277 additions and 207 deletions

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T19:13:49.755Z",
"capturedAt": "2026-10-14T19:20:10.926Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "f2ae35d66777eea943d5169748d79ce3c3b59717ecfe84341c22e51c62894d39",
"prompt": "ee07c715924bc9e7aef3de9b1c84c7c98875a3afb27f0d2c2aef2e72e9df4a38",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "0eb82f568598af36cbf94be5d2d9bcea436124e6f1e1c3bb63fcbb58cfe41ebd",
"atomicRubric": "115a906280331e673e301d37382b1cdabea96bbca7b51f2f641085e014ab3579",
"holisticRubric": "a25781d9cd6cf87d6179b3edb2dd78f4716d7c7a97355f56c02dd39132ab5762",
"atomicRubric": "3458e39b312a6a2416d968080498848d70a2cfc1f916ac2792be124fe0059e1e",
"rubricsYaml": null,
"graderContext": "29dce8f3926dd640892d9ab555ea8166c26b47d8c170082e22ffe49db7a6d7ef"
"graderContext": "3c601fa5d23099b81e17ef3427f1eda60f13fc67c86bdfbc36553c50eb9a9c41"
}
}

View File

@@ -1,6 +1,6 @@
---
detector: detector-meaningful-failure
verdict: partial
verdict: meaningful
confidence: MEDIUM
---
# Meaningful-failure check: potion-voice-user-ownership
@@ -9,82 +9,74 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and
## Load-bearing targets
- **Tenant isolation and tenant source:** The Narrow Correctness section requires cloning filters to use `userId` and synthesis filters to use `userId` derived from the first `UserAudioProfile` lookup. The initial profile lookup is explicitly allowed.
- **Stop after failed ownership checks:** The Narrow Correctness section labels immediate cessation of audio, file, and database effects as its Crux behavior.
- **Polling resilience:** The Broader Correctness section requires validation and database exceptions to leave the polling loop active.
- **Tenant-source and filter isolation:** The Narrow Correctness section requires `userId` scoping on cloning operations and synthesis operations, with the synthesizer's initial profile lookup resolving tenant context.
- **Stop unauthorized downstream work:** The Narrow Correctness section calls halting database mutations or audio rendering after failed ownership validation the Crux Requirement.
- **Worker resilience:** The Broader Correctness section requires polling loops to survive message-processing exceptions.
The permitted failed/error status update and concise final summary are protective or communication rules, not central failure targets.
The optional failed/error status update and inherited SQS acknowledgment order are now explicit non-penalty rules. The written summary is peripheral to the central security failure.
## Elicitation matrix
### Wrong synthesis tenant source and payload regression — fired 4/4
### Wrong synthesis tenant source — fired 4/4
- `reward-0.6200-2WLWKV8`: fired — “requires job.userId instead of deriving it from the initial UserAudioProfile lookup” and an original-format message is acknowledged without a profile lookup.
- `reward-0.6200-2WLWKV8`: fired — “requires job.userId instead of deriving it from the initial UserAudioProfile lookup.”
- `reward-0.6600-vw3sDhc`: fired — “takes userId from the queue payload ... instead of deriving it from the initial UserAudioProfile record.”
- `reward-0.6800-7prhyuz`: fired — “requires userId from the queue instead of deriving it from the initial UserAudioProfile lookup.”
- `reward-0.7300-btsikGq`: fired — “requires userId in the queue payload instead of deriving it from the initial UserAudioProfile lookup.”
### Side effects after a later failed ownership check — fired 3/4
### Downstream effects after later failed ownership checks — fired 3/4
- `reward-0.6200-2WLWKV8`: fired — “a failed processing update occurs after directory creation and another record update.”
- `reward-0.6600-vw3sDhc`: fired — “cloning ignores a null result from its tenant-scoped processing updates and proceeds to file/download work.”
- `reward-0.6800-7prhyuz`: fired-partially — “Cloning also ignores a null result from its scoped processing updates, so work can continue if ownership changes after preflight.”
- `reward-0.7300-btsikGq`: did-not-fire in the original grade; it credits early ownership checks and does not discuss later null updates.
- `reward-0.6800-7prhyuz`: fired-partially — “Cloning also ignores a null result from its scoped processing updates.”
- `reward-0.7300-btsikGq`: did-not-fire in the original grade, which credits early ownership checks and does not discuss later null updates.
### Polling-loop crash — fired 0/4
All four grades credit per-message exception handling or continued polling. The target is a guardrail that agents met in this run set.
All four original grades credit per-message exception handling or continued polling. This guardrail was met across the run set.
The original rewards span 0.62–0.73. Their scores corroborate substantive misses but are not the basis for the fire counts.
The original rewards span 0.62–0.73. They were graded against an earlier holistic revision, so they establish observed agent behavior rather than scores under the current zero-cap clause.
## Per-deduction assessment
### Synthesizer payload regression — meaningful
### Baseline synthesis messages rejected — meaningful
- **What the rubric scored down:** The 0.62 grade says a message “accepted by the original handler was verified to be acknowledged without any profile lookup when that new field is absent.” All four grades identify this regression.
- **Fired in:** 4/4 reference runs.
- **What the agent actually wrote:** The 0.73 run stated, “Queue producers must now include `userId`; legacy messages without it will fail closed.” The other three final messages also require the new queue field.
- **Real-world consequence if the agent is wrong:** Existing synthesis messages lose their processing path. The shipped baseline handler destructures `userAudioProfileId` but no queue `userId`, then reads `UserAudioProfile` by ID and extracts its stored `userId`; the 0.62 grade reproduced rejection of that baseline message shape.
- **Verdict for this deduction:** `meaningful`. A broad majority of SWEs would treat dropping previously valid jobs without a producer change or migration as a real defect.
### Continuing after a null scoped update — meaningful
- **What the rubric scored down:** The 0.66 grade observed a download after two tenant-scoped processing updates returned null.
- **Fired in:** 3/4 original grades; the 0.73 original grade does not mention it.
- **What the agent actually wrote:** The 0.66 run claimed, “Referenced records are authorized before processing.” That preflight claim does not cover a later failed update.
- **Real-world consequence if the agent is wrong:** Audio or file work and earlier mutations can remain after a later ownership failure. The 0.66 grade reports a mocked download after null updates; the 0.62 grade notes directory creation and another update before a failed processing update.
- **Verdict for this deduction:** `meaningful`. Checking only the initial read does not establish the task's stop condition after a later mismatch.
### Acknowledgment before later database success — partial
- **What the rubric scored down:** The 0.68 grade says the synthesis worker “acknowledges messages before database validation, so a transient database failure can lose a valid job”; the 0.73 grade makes a similar cloning observation.
- **Fired in:** 3/4 grades (0.66, 0.68, and 0.73).
- **What the agent actually wrote:** The 0.68 run claimed, “Invalid/unauthorized jobs are rejected safely without stopping polling.”
- **Real-world consequence if the agent is wrong:** A valid job could be lost after an early SQS deletion and a transient DB failure. The baseline synthesis handler already deletes its message before connecting to MongoDB, so some of this behavior is inherited rather than introduced by the tenant-isolation change.
- **Verdict for this deduction:** `partial`. The consequence is real, but penalizing an inherited acknowledgment order as though it were a new failure of this scoped request overstates the agent's responsibility.
### Verification omitted the baseline payload — meaningful
- **What the rubric scored down:** Every grade notes that tests or checks missed the original synthesis message shape; the 0.73 grade says its eight passing tests omit that path.
- **What the rubric scored down:** The 0.62 grade says a message “accepted by the original handler was verified to be acknowledged without any profile lookup when that new field is absent.” All four grades identify the changed queue contract.
- **Fired in:** 4/4 grades.
- **What the agent actually wrote:** The 0.73 run reported, “`npm test` passes all 8 tests. Queue producers must now include `userId`; legacy messages without it will fail closed.”
- **Real-world consequence if the agent is wrong:** Green tests could accompany the job-loss regression above. The original handler's payload fields are visible in the shipped workspace, and the grades reproduce the incompatible validator behavior.
- **Verdict for this deduction:** `meaningful` as a verification gap tied to a demonstrated functional failure, rather than a generic demand for more tests.
- **What the agent actually wrote:** The 0.73 final message says, “Queue producers must now include `userId`; legacy messages without it will fail closed.” The other final messages also announce the new queue field.
- **Real-world consequence if the agent is wrong:** Existing synthesis messages are discarded without generating their recordings. The shipped baseline handler destructures `userAudioProfileId` but no top-level queue `userId`, reads the profile by ID, and extracts its stored `userId`; the 0.62 run grade reports a reproduced rejection of that original message shape.
- **Verdict for this deduction:** `meaningful`. A broad majority of SWEs would flag a dropped valid-job path without a compatible producer or migration.
Other deductions about broad formatting churn and deployment-note wording are secondary to these concrete failures; neither determines the target fire counts.
### Continuing after a null tenant-scoped update — meaningful
- **What the rubric scored down:** The 0.66 grade observed a download after two scoped processing updates returned null.
- **Fired in:** 3/4 original grades; the 0.73 original grade does not mention it.
- **What the agent actually wrote:** The 0.66 final response says, “Referenced records are authorized before processing.” A preflight read does not establish that a later scoped update still matched.
- **Real-world consequence if the agent is wrong:** File and audio work can continue after a later ownership failure. The 0.66 grade reports the mocked download, and the 0.62 grade reports directory creation and another update before a failed processing update.
- **Verdict for this deduction:** `meaningful`. It directly violates the task's stop condition, even though the current cap's arithmetic is a separate rubric-form issue.
### Missing baseline-payload verification — meaningful
- **What the rubric scored down:** The 0.73 grade says eight passing tests omit the original synthesizer payload shape; the other grades make the same omission point.
- **Fired in:** 4/4 grades.
- **What the agent actually wrote:** The 0.73 final message says, “`npm test` passes all 8 tests. Queue producers must now include `userId`; legacy messages without it will fail closed.”
- **Real-world consequence if the agent is wrong:** The tests give false reassurance about compatibility while an existing job shape is rejected. The baseline handler and reproduced validator behavior establish the missed path.
- **Verdict for this deduction:** `meaningful` as a verification miss tied to a demonstrated regression.
The old grades also discuss acknowledgment before database success and, in one run, broad formatting churn. The current holistic rubric explicitly protects inherited acknowledgment behavior; those old deductions no longer describe a current rubric target. The formatting observation is secondary to the recurring functional failures.
## Guidance-wide severity audit
### Unauthorized effects after failed ownership — holds
### Unauthorized effects after ownership failure — holds
- **Guidance says:** “all downstream audio generation, file creation, and database mutations must be immediately halted.”
- **Reachability / evidence / proportionality:** The handlers call file, audio, and model-update paths after record lookups. The 0.62 and 0.66 grades describe concrete side effects following later failed scoped updates.
- **Call:** The security stop condition is proportionate. The rubric's parenthetical “(CRUX)” still needs an explicit penalty target to make its *scoring weight* unambiguous; that separate defect is reported by rubric clarity and coverage.
- **Guidance says:** “Candidates must halt job execution before executing database mutations or audio rendering when tenant ownership validation fails or records do not match the tenant context.”
- **Reachability / evidence / proportionality:** Both workers perform model writes and audio work after record lookups. The 0.62 and 0.66 grades describe concrete later side effects after scoped-update failures. Preventing cross-tenant effects is a proportionate core security requirement.
- **Call:** The consequence is real. The new “overall score cap of 0% on Narrow Correctness” is a scoring-mechanism defect assessed by rubric clarity and form; the reference grades predate it and cannot calibrate that cap.
The tenant-source compatibility failure and polling-loop resilience target also have plausible stakes. The former fired in all runs; the latter was met in all runs.
The tenant-source compatibility target and polling-loop resilience target have plausible stakes. The former manifested in every run; the latter was met.
## Overall verdict
The task elicits a real synthesis compatibility regression in 4/4 runs and a later ownership-stop gap in 3/4 original grades. Those defects have concrete consequences supported by the baseline handler and run checks. The central real, proportionate, and elicited bar holds.
The current rubric targets a real compatibility regression and a real ownership-stop gap. The first appears in all four reference runs, and the second in three original grades. The shipped baseline and reproduced run checks support their consequences. The new protection for inherited SQS acknowledgment removes the mixed-deduction reason for the earlier `partial` verdict.
The verdict is `partial` because the grades also penalize early message acknowledgment that the baseline already performs. That secondary craft deduction should distinguish an introduced regression from an inherited behavior; the central task remains meaningful.
The verdict is `meaningful` with medium confidence because the four reference grades were produced under an earlier holistic revision. They support elicitation and impact, but they do not show how the current zero-cap scoring clause would grade those same responses.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T19:13:49.755Z",
"capturedAt": "2026-10-14T19:20:10.926Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "f2ae35d66777eea943d5169748d79ce3c3b59717ecfe84341c22e51c62894d39",
"prompt": "ee07c715924bc9e7aef3de9b1c84c7c98875a3afb27f0d2c2aef2e72e9df4a38",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "0eb82f568598af36cbf94be5d2d9bcea436124e6f1e1c3bb63fcbb58cfe41ebd",
"atomicRubric": "115a906280331e673e301d37382b1cdabea96bbca7b51f2f641085e014ab3579",
"holisticRubric": "a25781d9cd6cf87d6179b3edb2dd78f4716d7c7a97355f56c02dd39132ab5762",
"atomicRubric": "3458e39b312a6a2416d968080498848d70a2cfc1f916ac2792be124fe0059e1e",
"rubricsYaml": null,
"graderContext": "29dce8f3926dd640892d9ab555ea8166c26b47d8c170082e22ffe49db7a6d7ef"
"graderContext": "3c601fa5d23099b81e17ef3427f1eda60f13fc67c86bdfbc36553c50eb9a9c41"
}
}

View File

@@ -9,16 +9,22 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Material ambiguities
### Unspecified Crux effect
### Conflicting score-cap target
- **Where:** Narrow Correctness says `**Side-Effect Prevention (CRUX)**` and the routing note says unauthorized effects are charged `strictly under side-effect prevention (Crux)`.
- **Why it's ambiguous:** One grader can treat Crux as emphasis within Narrow Correctness; another can treat it as a separate overall-score heavy penalty. The rubric has no Heavy penalties section specifying the target or the non-trigger. Those readings produce different scores.
- **Grade evidence:** The four original `grade.md` files report the mean of eight criteria and no overall penalty. The later atomic regrades give the side-effect criterion Crux weight, illustrating the other reading; these are different grading regimes, not evidence that the original grader itself varied.
- **Where:** The Narrow Correctness section says, “Failing this crux requirement results in an overall score cap of 0% on Narrow Correctness.”
- **Why it's ambiguous:** An “overall score cap” applies to the task score, while “on Narrow Correctness” names one criterion. The sentence permits an overall-zero reading and a Narrow-Correctness-zero reading. It also does not use the Grading Standard's qualitative heavy-penalty mechanism, so graders cannot apply it consistently as written.
- **Grade evidence:** The four original reference grades report the mean of eight dimensions without an overall cap; they were graded under the earlier rubric revision. They cannot settle how the new cap should apply.
### Crux trigger and non-trigger
- **Where:** The same section calls the stop rule a “Crux Requirement” and says it fires when “tenant ownership validation fails or records do not match the tenant context.”
- **Why it's ambiguous:** The cap is categorical, but the source does not say whether a later tenant-scoped update returning no record after valid preflight reads counts as the validation failure that triggers it. This matters for the behavior described in the 0.62, 0.66, and 0.68 original grades.
- **Grade evidence:** Those grades discuss later failed updates without applying any cap, because the cap was absent from their rubric revision.
## Copy-edit issues
None found that interrupts application.
None found that interrupt reading. The defect is in the scoring instruction rather than prose mechanics.
## Overall verdict
The prose is readable, but the Crux label leaves a load-bearing scoring choice unresolved. The author needs to specify an overall-score heavy penalty with its non-trigger or remove the Crux designation.
The cap's target and trigger allow materially different scores for the same response. Replace it with a qualitative penalty naming the intended target and an explicit non-trigger before grading with this holistic rubric.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T19:13:49.755Z",
"capturedAt": "2026-10-14T19:20:10.926Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "f2ae35d66777eea943d5169748d79ce3c3b59717ecfe84341c22e51c62894d39",
"prompt": "ee07c715924bc9e7aef3de9b1c84c7c98875a3afb27f0d2c2aef2e72e9df4a38",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "0eb82f568598af36cbf94be5d2d9bcea436124e6f1e1c3bb63fcbb58cfe41ebd",
"atomicRubric": "115a906280331e673e301d37382b1cdabea96bbca7b51f2f641085e014ab3579",
"holisticRubric": "a25781d9cd6cf87d6179b3edb2dd78f4716d7c7a97355f56c02dd39132ab5762",
"atomicRubric": "3458e39b312a6a2416d968080498848d70a2cfc1f916ac2792be124fe0059e1e",
"rubricsYaml": null,
"graderContext": "29dce8f3926dd640892d9ab555ea8166c26b47d8c170082e22ffe49db7a6d7ef"
"graderContext": "3c601fa5d23099b81e17ef3427f1eda60f13fc67c86bdfbc36553c50eb9a9c41"
}
}

View File

@@ -11,37 +11,49 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai
| Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status |
| --- | --- | --- |
| "All database operations in `voice-cloning-job-handler` ... must enforce `userId` scoping" | cloning-tenant-isolation | covered |
| "All queries and updates to `RecordingSalutation` and `Recording` ... scoped by ... `userId`" | synthesis-tenant-isolation-queries-updates | covered |
| "Looking up `UserAudioProfile` by `_id: userAudioProfileId` ... must not be penalized" | initial-profile-tenant-resolution | covered |
| "all downstream audio generation, file creation, and database mutations must be immediately halted" | prevent-unauthorized-side-effects | covered |
| "Syntax omissions ... charged under ... handler scoping ... execution ... under side-effect prevention" | cloning-tenant-isolation; synthesis-tenant-isolation-queries-updates; prevent-unauthorized-side-effects | covered |
| "Exceptions during message validation or database operations must be caught gracefully" | worker-loop-crash-prevention | covered |
| "Updating `status: 'failed'` or `'error'` on the requesting job record ... is permitted" | error-status-lifecycle-logging | covered |
| "clearly and concisely describe how multi-tenant isolation is enforced" | refactor-summary-clarity | covered |
| “halt job execution before executing database mutations or audio rendering” | prevent-unauthorized-side-effects | covered |
| “overall score cap of 0% on Narrow Correctness” | prevent-unauthorized-side-effects | partial |
| “Charge syntax omissions under query scoping criteria ... Do not double-charge” | cloning-tenant-isolation; synthesis-tenant-isolation-queries-updates; prevent-unauthorized-side-effects | covered |
| “All database reads and updates in `voice-cloning-job-handler` ... `userId` ... `_id`” | cloning-tenant-isolation | covered |
| “Downstream queries and updates to `RecordingSalutation` and `Recording` ... `userId`” | synthesis-tenant-isolation-queries-updates | covered |
| “initial `UserAudioProfile` lookup by `_id: userAudioProfileId` ... exempt” | initial-profile-tenant-resolution | covered |
| “Unhandled exceptions during message processing must be caught gracefully” | worker-loop-crash-prevention | covered |
| “Omitting this status update MUST NOT incur any score deduction” | error-status-lifecycle-logging | covered |
| “SQS message deletion/acknowledgment behavior inherited from baseline ... must not be penalized” | none | missing |
| “written summaries ... clearly articulate” isolation and worker stability | refactor-summary-clarity | partial |
## Coverage gaps
None found in the behavior requirements or protected cases.
### Baseline acknowledgment protection
- **Holistic clause:** The Broader Correctness section says, “SQS message deletion/acknowledgment behavior inherited from baseline worker framework code is standard infrastructure functionality and must not be penalized as a security defect.”
- **Closest criterion:** None. The sentence appears only in `tests/grader-context.md`.
- **What is lost:** A grader using criteria alone can charge inherited acknowledgment order as a security or resilience failure. Three original grade files discuss early acknowledgment, although they predate this new protection.
### Summary of worker stability
- **Holistic clause:** The Communication section requires summaries to say how “tenant isolation and worker stability are achieved across the refactored handlers.”
- **Closest criterion:** `refactor-summary-clarity` requires only an isolation explanation.
- **What is lost:** A final response that explains tenant scoping but says nothing about loop resilience passes the atomic criterion and falls short of the holistic clause.
### Cap encoding
- **Holistic clause:** The Narrow Correctness section specifies an “overall score cap of 0% on Narrow Correctness.”
- **Closest criterion:** `prevent-unauthorized-side-effects` repeats that text and carries `severity: crux`.
- **What is lost:** The cap cannot be represented by the atomic severity scheme; a Crux criterion is reserved for a qualitative heavy penalty targeting the overall score. The source's cap target is itself ambiguous, so the source must be corrected before this mapping can be completed.
## Invented content
### Unsupported Crux designation
`prevent-unauthorized-side-effects` carries `severity: crux`, but the holistic rubric contains no Heavy penalties section or instruction applying a heavy penalty to the overall score. Its Narrow Correctness bullet calls side-effect prevention "(CRUX)" without defining the penalty target or non-trigger. Under the conversion contract, that label alone does not establish an overall-score penalty. The severity can change the score materially.
### Permitted status update treated as required
The holistic rubric says updating the requesting job to `status: 'failed'` or `'error'` on rejection is **permitted**. The separate `error-status-lifecycle-logging` criterion says the response should "allow" it, which the rubric-trinary regrade of `reward-0.7300-btsikGq` interpreted as a requirement to perform that update: it marked the criterion PARTIAL because rejection paths only log and return. Keep the permission as a non-trigger in the side-effect criterion's elaboration; it should not add a scored implementation requirement.
`prevent-unauthorized-side-effects` elaboration adds “file creation” as a forbidden effect, while the current holistic stop clause names database mutations and audio rendering. This is an added scoring example, even if file creation is a plausible downstream effect. The extra architectural facts in `tests/grader-context.md`, including a claim about `voiceCloningService.update` ignoring `userId` in an update payload, are not extracted from the source's Overview and need their own source grounding before use as privileged context.
## Context integrity
`tests/grader-context.md` preserves the source's Task Overview paragraph verbatim. The source has no separate Business context or Ground truth section. The answer-key facts used by the criteria appear in their guidelines.
The holistic Overview's basic task purpose survives in the context file, but the context file is expanded with code facts and scoring rules not present in the source context. The synthesis profile-lookup fact also appears in the atomic answer key, so its core meaning survives.
## Crux alignment
The holistic rubric states no heavy penalty targeting the overall score. The atomic rubric has one Crux criterion, `prevent-unauthorized-side-effects`, based on the source's parenthetical "(CRUX)" label. The source needs an explicit overall-score Heavy penalties rule with its non-trigger, or the atomic severity needs to be lowered.
The holistic rubric has no qualitative heavy penalty against the overall score. Its new zero cap mentions the overall score and Narrow Correctness in one sentence. The atomic rubric has one Crux criterion, `prevent-unauthorized-side-effects`; that severity cannot faithfully encode a score cap or resolve which score the cap targets.
## Overall verdict
The behavioral mapping is otherwise complete, but the unsupported Crux designation and status-update criterion create material scoring differences. Resolve the source's penalty intent and encode the status rule only as a protected behavior before treating the conversion as final.
The missing acknowledgment non-trigger and worker-stability summary requirement change what an atomic grader can credit or penalize. The cap and Crux mismatch is a second material difference. Fix the source's scoring rule first, then reconvert the atomic rubric and context.

View File

@@ -1,17 +1,17 @@
{
"version": 1,
"capturedAt": "2026-10-14T19:13:49.755Z",
"capturedAt": "2026-10-14T19:20:10.926Z",
"capturedBy": "stamp",
"inputs": {
"prompt": "f2ae35d66777eea943d5169748d79ce3c3b59717ecfe84341c22e51c62894d39",
"prompt": "ee07c715924bc9e7aef3de9b1c84c7c98875a3afb27f0d2c2aef2e72e9df4a38",
"graderGuidance": null,
"sessionJsonl": null,
"workspacePatch": null,
"gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null,
"holisticRubric": "0eb82f568598af36cbf94be5d2d9bcea436124e6f1e1c3bb63fcbb58cfe41ebd",
"atomicRubric": "115a906280331e673e301d37382b1cdabea96bbca7b51f2f641085e014ab3579",
"holisticRubric": "a25781d9cd6cf87d6179b3edb2dd78f4716d7c7a97355f56c02dd39132ab5762",
"atomicRubric": "3458e39b312a6a2416d968080498848d70a2cfc1f916ac2792be124fe0059e1e",
"rubricsYaml": null,
"graderContext": "29dce8f3926dd640892d9ab555ea8166c26b47d8c170082e22ffe49db7a6d7ef"
"graderContext": "3c601fa5d23099b81e17ef3427f1eda60f13fc67c86bdfbc36553c50eb9a9c41"
}
}

View File

@@ -9,37 +9,44 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml
## Deterministic contract
1. YAML parsing and top-level `task` and `criteria`: pass; the staging command parsed seven criteria.
2. Task slug: pass.
3. Unique kebab-case IDs: pass.
4. Category vocabulary: pass.
5. Severity vocabulary and placement: pass.
6. Crux cap: pass; one criterion carries Crux.
7. Dimension names: pass.
8. Nonempty guidelines: pass.
9. Numeric penalty language: pass; the pattern sweep found none.
10. Positive phrasing: pass. The sweep matched `does not require` inside an answer key and `do not belong` in a condition, rather than a negated instruction.
11. Each guideline begins with a positive `The response should ...` requirement: pass.
1. YAML parses with `task` and seven criteria: pass.
2. The task slug matches: pass.
3. Criterion IDs are unique kebab-case: pass.
4. Categories use the allowed vocabulary: pass.
5. Severities use the allowed vocabulary and placement: pass.
6. One Crux is within the two-Crux cap: pass.
7. Dimensions name standard criteria: pass.
8. Guidelines are nonempty: pass.
9. Numeric penalty language: **FAIL**. `prevent-unauthorized-side-effects` says, “Failing this crux criterion results in an overall score cap of 0% on Narrow Correctness.” `tests/grader-context.md` repeats, “Failing to halt unauthorized side effects caps Narrow Correctness at 0%.” These sentences prescribe a numeric score adjustment and a cap, which the atomic criterion scheme cannot express. The regex sweeps for subtraction and point-value phrases do not match the word “cap”; the manual contract check catches it.
10. Positive phrasing: pass for the behavioral guidelines; the cap and routing instructions embedded in the side-effect guideline are grading mechanics, not response properties.
## Atomicity and self-containment
### Permitted status update as a graded criterion
### Scoring mechanics inside the side-effect guideline
- **Criterion:** `error-status-lifecycle-logging`.
- **Where:** "The response should allow `status: 'failed'` or `'error'` updates on the requesting job record for error tracking after rejection."
- **Why:** A response that simply logs and rejects an unauthorized job has not disallowed the permitted update. The criterion cannot be judged as a positive implementation requirement without inventing one. The regrade of `reward-0.7300-btsikGq` marked it PARTIAL solely because the agent omitted the optional update.
- **Suggested rewrite:** Remove this criterion and retain the allowance in the side-effect criterion's elaboration.
The two handler-specific scoping rules remain independently judgeable. The side-effect criterion covers one stop condition across both handlers, and its elaboration routes filter syntax to the corresponding handler criterion.
- **Criterion:** `prevent-unauthorized-side-effects`.
- **Where:** “Failing this crux criterion results in an overall score cap of 0% on Narrow Correctness. Routing note: Charge syntax omissions under query criteria; charge unauthorized side-effect execution under this criterion.”
- **Why:** This adds a scoring rule and cross-criterion charge directions to the same guideline that should state one response behavior. The cap is unsupported; the charge routing belongs in the elaboration.
- **Suggested rewrite:** Keep the stop-condition sentence as the guideline and move charge routing to elaboration after the holistic source defines a valid heavy penalty.
## Phrasing and answer keys
None found. Factual answer keys are bold and inline. Elaborations clarify fulfillment and charge routing.
### Answer-key facts lack bold formatting
- **Criterion:** The factual guidelines, including `synthesis-tenant-isolation-queries-updates`.
- **Where:** “**Answer key:** Downstream reads and updates to RecordingSalutation and Recording ... must be scoped by the profile-derived userId.”
- **Why:** The label is bold, but the answer-key fact is not. The key exists inline, so this is a formatting issue rather than missing ground truth.
- **Suggested rewrite:** Bold the fact itself inside each factual guideline.
## Fair-grading findings
The initial profile lookup is a necessary tenant-resolution step and is judgeable. The status-update criterion is not a valid protected-behavior test because it can penalize omission of an optional action, as the regrade shows.
### Optional status update cannot earn a meaningful verdict
- **Criterion:** `error-status-lifecycle-logging`.
- **Where:** “The response should permit updating job status ... while treating this action as entirely optional so that omitting it incurs no deduction.”
- **Why:** Both performing a permitted update and omitting it satisfy this criterion, so it adds an almost automatic pass and can dilute meaningful failures. The permission belongs in a relevant criterion's elaboration as a non-trigger.
- **Suggested rewrite:** Remove the separate scored criterion and preserve the omission and permitted-update protections in side-effect judgment guidance.
## Overall verdict
The deterministic artifact contract passes. The status-update criterion is a material judgment-layer defect because a grader can use it to penalize a response that merely omits a permitted action. Source-to-atomic Crux alignment is assessed separately in detector-rubric-coverage.
The YAML parses, but the numeric zero cap breaks the atomic scoring contract. The guideline also embeds grading mechanics, and the optional status criterion is not a meaningful scored response behavior. These are material form issues independent of content coverage.

View File

@@ -1,9 +1,11 @@
# Multi-Tenant Data Isolation Audit for Background Workers
# Background Worker Multi-Tenant Isolation Audit & Refactor
## Context
Our backend processing tier utilizes AWS SQS queues and MongoDB to execute asynchronous tasks, such as voice cloning and speech synthesis. A security evaluation revealed that background workers process jobs using document IDs provided in queue message payloads without validating tenant ownership (`userId`).
Our backend background worker tier currently suffers from a critical security vulnerability regarding multi-tenant data isolation. Specifically, processes handling voice cloning and speech synthesis jobs retrieve and mutate database records using document identifiers provided in queue messages without verifying that the records belong to the authorized tenant context.
## Requirements
1. **Audit Database Queries**: Review database access patterns in background worker job handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`).
2. **Enforce Multi-Tenant Isolation**: Ensure all database queries and mutations scope records by the relevant tenant identifier (`userId`) to prevent unauthorized cross-tenant data access or modification.
3. **Maintain Worker Resilience**: Handle validation failures gracefully so that rejected or unauthorized jobs do not crash the background worker polling loops.
## Task Objective
Audit and refactor the background worker job handlers to enforce strict multi-tenant data separation and maintain background worker loop stability:
1. **Audit Database Access**: Review database queries and updates across `voice-cloning-job-handler` and `voice-synthsizer-job-handler`. Ensure all record lookups and mutations filter strictly by tenant context (`userId`) in addition to document IDs.
2. **Prevent Unauthorized Side Effects**: Guarantee that unauthorized or cross-tenant jobs halt execution immediately before triggering downstream mutations or audio rendering.
3. **Ensure Worker Resilience**: Gracefully catch and handle processing exceptions so that individual job failures or rejection events do not crash the background worker polling loop.

View File

@@ -1,69 +1,88 @@
task: potion-voice-user-ownership
source: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
context: grader-context.md
criteria:
- id: cloning-tenant-isolation
category: primary_intent
severity: certain_dealbreaker
dimensions:
- Narrow Correctness
guideline: |
The response should scope every `VoiceCloning` and `UserAudioProfile` database operation in `voice-cloning-job-handler` by `userId` alongside the record ID. **Answer key: Both reads and updates must include the relevant `userId` and record ID.**
elaboration: |
Judge query and update filters here. The execution of downstream work after an ownership failure belongs to `prevent-unauthorized-side-effects`.
- id: synthesis-tenant-isolation-queries-updates
category: primary_intent
severity: certain_dealbreaker
dimensions:
- Narrow Correctness
guideline: |
The response should scope every `RecordingSalutation` and `Recording` query and update in `voice-synthsizer-job-handler` by the `userId` derived from the initial `UserAudioProfile` lookup. **Answer key: Downstream reads and updates must use the profile-derived `userId` alongside each record ID.**
elaboration: |
Judge query and update filters here. The execution of downstream work after an ownership failure belongs to `prevent-unauthorized-side-effects`.
- id: initial-profile-tenant-resolution
category: dodged_bullet
severity: possible_dealbreaker
dimensions:
- Narrow Correctness
guideline: |
The response should allow the initial `UserAudioProfile` lookup by `_id: userAudioProfileId` to establish tenant context. **Answer key: This lookup resolves `userAudioProfile.userId` and does not require a `userId` filter.**
elaboration: |
The first profile lookup is the stated exception to downstream tenant scoping. Do not treat that lookup alone as a tenant isolation failure.
- id: prevent-unauthorized-side-effects
category: primary_intent
severity: crux
dimensions:
- Narrow Correctness
guideline: |
The response should halt downstream audio generation, file creation, and database mutations in both handlers when tenant ownership checks fail or records do not belong to the requesting tenant. **Answer key: Rejected or unauthorized jobs must stop before those side effects execute.**
elaboration: |
This criterion covers execution after a failed ownership check. Charge missing `userId` predicates under the respective handler scoping criterion. Updating `status: 'failed'` or `'error'` on the requesting job record for error tracking is allowed.
- id: worker-loop-crash-prevention
category: primary_intent
severity: possible_dealbreaker
dimensions:
- Broader Correctness / the craft of software engineering
guideline: |
The response should catch exceptions during message validation or database operations so the worker polling loops remain active after rejected or unauthorized jobs. **Answer key: The polling loops continue after those failures.**
- id: error-status-lifecycle-logging
category: dodged_bullet
severity: unlikely_dealbreaker
dimensions:
- Broader Correctness / the craft of software engineering
guideline: |
The response should allow `status: 'failed'` or `'error'` updates on the requesting job record for error tracking after rejection. **Answer key: This lifecycle update is permitted.**
elaboration: |
Do not treat this permitted update as an unauthorized downstream mutation.
- id: refactor-summary-clarity
category: primary_intent
severity: unlikely_dealbreaker
dimensions:
- Communication
guideline: |
The response should clearly and concisely describe how multi-tenant isolation is enforced across both handlers.
- id: cloning-tenant-isolation
category: primary_intent
dimensions:
- Narrow Correctness
severity: certain_dealbreaker
call_site_key: voice-cloning-job-handler
guideline: The response should enforce tenant isolation using userId on all VoiceCloning
and UserAudioProfile queries and updates in the voice cloning handler. **Answer
key:** All database reads and updates in voice-cloning-job-handler must filter
by userId in addition to record _id.
elaboration: Verifies that voice cloning queries and updates incorporate userId
to prevent unauthorized cross-tenant operations.
- id: synthesis-tenant-isolation-queries-updates
category: primary_intent
dimensions:
- Narrow Correctness
severity: certain_dealbreaker
call_site_key: voice-synthsizer-job-handler
guideline: The response should scope all synthesis queries and database updates
by tenant identity (userId) across RecordingSalutation and Recording records.
**Answer key:** Downstream reads and updates to RecordingSalutation and Recording
in voice-synthsizer-job-handler must be scoped by the profile-derived userId.
elaboration: Ensures that both queries and database updates in the speech synthesis
handler enforce tenant isolation using userId.
- id: prevent-unauthorized-side-effects
category: primary_intent
dimensions:
- Narrow Correctness
severity: crux
call_site_key: voice-synthsizer-job-handler
guideline: 'The response should prevent unauthorized side effects, including audio
generation and database mutations across both handlers, when tenant validation
fails or records do not match tenant context. Failing this crux criterion results
in an overall score cap of 0% on Narrow Correctness. Routing note: Charge syntax
omissions under query criteria; charge unauthorized side-effect execution under
this criterion. **Answer key:** Audio generation and unauthorized database mutations
must be halted if tenant ownership checks fail.'
elaboration: Guarantees that unauthorized jobs do not trigger audio rendering, file
creation, or database updates.
- id: initial-profile-tenant-resolution
category: dodged_bullet
dimensions:
- Narrow Correctness
severity: possible_dealbreaker
call_site_key: voice-synthsizer-job-handler
guideline: 'The response should allow the initial UserAudioProfile lookup by _id:
userAudioProfileId as a valid tenant-resolution step without requiring userId
in that initial query. **Answer key:** The initial lookup on UserAudioProfile
by ID is necessary to resolve userId and establish tenant context.'
elaboration: Prevents improperly docking points for the initial profile query needed
to discover the tenant identity.
- id: worker-loop-crash-prevention
category: primary_intent
dimensions:
- Broader Correctness / the craft of software engineering
severity: possible_dealbreaker
call_site_key: voice-synthsizer-job-handler
guideline: The response should catch and handle exceptions during message processing
to prevent background worker polling loops from crashing. **Answer key:** Errors
during job processing must be caught gracefully so the worker polling loop remains
active.
elaboration: Ensures background worker loops remain resilient against unhandled
errors.
- id: error-status-lifecycle-logging
category: dodged_bullet
dimensions:
- Broader Correctness / the craft of software engineering
severity: unlikely_dealbreaker
call_site_key: voice-synthsizer-job-handler
guideline: The response should permit updating job status to failed or error on
the requesting job record for error tracking when an unauthorized job is rejected,
while treating this action as entirely optional so that omitting it incurs no
deduction. **Answer key:** Setting job status to failed on the requesting job
record is optional; omitting it must not be penalized.
elaboration: Ensures that omitting an optional error status update on the requesting
job record is not penalized.
- id: refactor-summary-clarity
category: primary_intent
dimensions:
- Communication
severity: unlikely_dealbreaker
call_site_key: voice-synthsizer-job-handler
guideline: The response should clearly articulate how tenant isolation is enforced
across the refactored handlers in its written explanations. **Answer key:** The
written explanation must clearly describe the multi-tenant isolation approach.
elaboration: Evaluates the clarity and structure of the written refactoring summary.

View File

@@ -1,4 +1,19 @@
# Grader Context — potion-voice-user-ownership
# Grader Context & Reference Answer Key
## Task Overview
This task evaluates the candidate agent's ability to audit and refactor asynchronous background worker handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) to enforce strict multi-tenant data isolation (`userId`) while maintaining worker polling resilience.
## Architecture & Codebase Facts
### 1. Voice Cloning Handler (`voice-cloning-job-handler`)
* **Queue Ingestion**: Consumes job payload data directly from SQS messages (`job._doc`).
* **Database Model**: Operates on the `VoiceCloning` Mongoose model.
* **Multi-Tenant Requirement**: All queries and updates to `VoiceCloning` and `UserAudioProfile` must incorporate `userId: job._doc.userId` alongside `_id`. Note that `voiceCloningService.update` ignores `userId` if passed only in the update payload; graders must verify that query filters actively include `{ _id, userId }`.
### 2. Speech Synthesis Handler (`voice-synthsizer-job-handler`)
* **Queue Ingestion**: Parses `userAudioProfileId`, `recordingId`, and `salutationId` from incoming SQS messages.
* **Tenant Resolution Anchor**: Resolves `UserAudioProfile.findById(userAudioProfileId)` first to obtain `userAudioProfile.userId`. This initial lookup by ID is required to discover the tenant context and is explicitly exempt from requiring `userId` in its own query filter.
* **Downstream Tenant Scoping**: All subsequent queries and updates on `RecordingSalutation` and `Recording` must use `{ _id, userId: userAudioProfile.userId }`.
* **Side-Effect Prevention**: If any record is missing or unowned, synthesis audio rendering and database updates must be halted.
### 3. Grading Guidance & Allowances
* **Crux Penalty**: Failing to halt unauthorized side effects caps Narrow Correctness at 0%.
* **Optional Status Logging**: Updating status to `failed` or `error` on the requesting job record is permitted for tracking, but **omitting it is completely acceptable and must not be penalized**.
* **Baseline Queue Acknowledgment**: Message deletion/acknowledgment behavior inherited from baseline SQS handlers is standard and must not be docked.

View File

@@ -1,27 +1,44 @@
# Holistic Evaluation Rubric
# Holistic Evaluation Rubric: potion-voice-user-ownership
## Task Overview
This task evaluates the candidate agent's ability to audit and refactor asynchronous background worker handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) to enforce strict multi-tenant data isolation (`userId`) while maintaining worker polling resilience.
## Overview
This rubric evaluates candidate refactors of background worker job handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) for multi-tenant data isolation and background worker loop resilience.
---
## Grading Standard Dimensions
## Grading Dimensions
### 1. Narrow Correctness
* **Tenant Isolation in Voice Cloning**: All database operations in `voice-cloning-job-handler` (using `VoiceCloning` and `UserAudioProfile`) must enforce `userId` scoping alongside record IDs.
* **Tenant Isolation in Speech Synthesis**: All queries and updates to `RecordingSalutation` and `Recording` in `voice-synthsizer-job-handler` must be scoped by the tenant identifier (`userId`) derived from the initial `UserAudioProfile` lookup.
* **Initial Profile Tenant Resolution**: Looking up `UserAudioProfile` by `_id: userAudioProfileId` to resolve `userAudioProfile.userId` is a valid and necessary tenant-resolution step and must not be penalized.
* **Side-Effect Prevention (CRUX)**: If tenant ownership checks fail or records do not belong to the requesting tenant, all downstream audio generation, file creation, and database mutations must be immediately halted.
### Narrow Correctness
> **Routing Note**: Syntax omissions in query filters must be charged under the respective handler scoping criteria (`Narrow Correctness`). The execution of unauthorized side effects (audio rendering or mutations) when checks fail must be charged strictly under side-effect prevention (`Crux`).
- **Crux Requirement (Side-Effect Halting)**:
- Candidates must halt job execution before executing database mutations or audio rendering when tenant ownership validation fails or records do not match the tenant context.
- **Penalty**: Failing this crux requirement results in an overall score cap of 0% on Narrow Correctness.
- *Routing Note*: Charge syntax omissions under query scoping criteria (`cloning-tenant-isolation` or `synthesis-tenant-isolation-queries-updates`). Charge execution of unauthorized side effects (rendering audio or writing to database for unowned records) strictly under this crux criterion. Do not double-charge.
- **Voice Cloning Scoping (`cloning-tenant-isolation`)**:
- All database reads and updates in `voice-cloning-job-handler` (using the `VoiceCloning` and `UserAudioProfile` models) must incorporate `userId` in query filters alongside record `_id`.
- **Speech Synthesis Scoping (`synthesis-tenant-isolation-queries-updates`)**:
- Downstream queries and updates to `RecordingSalutation` and `Recording` records in `voice-synthsizer-job-handler` must be scoped by the tenant context (`userId`).
- **Tenant Resolution Exemption (`initial-profile-tenant-resolution`)**:
- In `voice-synthsizer-job-handler`, the initial `UserAudioProfile` lookup by `_id: userAudioProfileId` is recognized as a valid and necessary tenant-resolution step to discover `userId`. It is explicitly exempt from requiring a `userId` parameter in its own initial query filter.
---
### 2. Broader Correctness / the craft of software engineering
* **Worker Loop Crash Prevention**: Exceptions during message validation or database operations must be caught gracefully to keep the worker polling loop active.
* **Error Status Lifecycle Logging**: Updating `status: 'failed'` or `'error'` on the requesting job record itself for error tracking upon rejection is permitted and must not be penalized.
### Broader Correctness / the craft of software engineering
- **Worker Polling Loop Resilience (`worker-loop-crash-prevention`)**:
- Unhandled exceptions during message processing must be caught gracefully to ensure background worker polling loops remain active.
- **Optional Error Lifecycle Logging (`error-status-lifecycle-logging`)**:
- Updating job status to `'failed'` or `'error'` on the requesting job record for error tracking when an unauthorized job is rejected is an optional lifecycle tracking step. Omitting this status update MUST NOT incur any score deduction.
- **Baseline Framework Infrastructure**:
- SQS message deletion/acknowledgment behavior inherited from baseline worker framework code is standard infrastructure functionality and must not be penalized as a security defect.
---
### 3. Communication
* **Refactor Summary Clarity**: The written explanation should clearly and concisely describe how multi-tenant isolation is enforced across both handlers.
### Communication
- **Written Summary Clarity (`refactor-summary-clarity`)**:
- Accompanied written summaries or explanations must clearly articulate how tenant isolation and worker stability are achieved across the refactored handlers.