4 flagging detectors 2nd time

This commit is contained in:
2026-10-14 15:38:56 -04:00
parent d18ba5e3fe
commit 5738c8d5d4
12 changed files with 127 additions and 176 deletions

View File

@@ -1,17 +1,17 @@
{ {
"version": 1, "version": 1,
"capturedAt": "2026-10-14T19:20:10.926Z", "capturedAt": "2026-10-14T19:24:36.016Z",
"capturedBy": "stamp", "capturedBy": "stamp",
"inputs": { "inputs": {
"prompt": "ee07c715924bc9e7aef3de9b1c84c7c98875a3afb27f0d2c2aef2e72e9df4a38", "prompt": "d3593e397434a174b641aadf38a74766fd24bfb817ec4531e86c340dcc4cb039",
"graderGuidance": null, "graderGuidance": null,
"sessionJsonl": null, "sessionJsonl": null,
"workspacePatch": null, "workspacePatch": null,
"gitref": "fcd8a9d0", "gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null, "graderGuidanceConsolidated": null,
"holisticRubric": "a25781d9cd6cf87d6179b3edb2dd78f4716d7c7a97355f56c02dd39132ab5762", "holisticRubric": "61275af1ae934ecec0e90f607ebf56ecda2efd7e53f5fc9f734a6a307d1f4729",
"atomicRubric": "3458e39b312a6a2416d968080498848d70a2cfc1f916ac2792be124fe0059e1e", "atomicRubric": "c377cec1003b172bd02b81117151e82de24080ad6b9ce72535b23ad8fb75ca52",
"rubricsYaml": null, "rubricsYaml": null,
"graderContext": "3c601fa5d23099b81e17ef3427f1eda60f13fc67c86bdfbc36553c50eb9a9c41" "graderContext": "05086a9a8c35c30867f00f4ce1abfde6cc28f4b7c5b8c56c12ba59d909b9544c"
} }
} }

View File

@@ -13,7 +13,7 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and
- **Stop unauthorized downstream work:** The Narrow Correctness section calls halting database mutations or audio rendering after failed ownership validation the Crux Requirement. - **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. - **Worker resilience:** The Broader Correctness section requires polling loops to survive message-processing exceptions.
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. Inherited SQS acknowledgment order is now an explicit non-penalty rule. The written summary is peripheral to the central security failure.
## Elicitation matrix ## Elicitation matrix
@@ -35,7 +35,7 @@ The optional failed/error status update and inherited SQS acknowledgment order a
All four original grades credit per-message exception handling or continued polling. This guardrail was met across the 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. They were graded against an earlier holistic revision, so they establish observed agent behavior rather than scores under the current zero-cap clause. 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 wording.
## Per-deduction assessment ## Per-deduction assessment
@@ -53,7 +53,7 @@ The original rewards span 0.62–0.73. They were graded against an earlier holis
- **Fired in:** 3/4 original grades; the 0.73 original grade does not mention it. - **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. - **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. - **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. - **Verdict for this deduction:** `meaningful`. It directly violates the task's stop condition; the source's undefined Crux weighting is a separate rubric-coverage issue.
### Missing baseline-payload verification — meaningful ### Missing baseline-payload verification — meaningful
@@ -71,7 +71,7 @@ The old grades also discuss acknowledgment before database success and, in one r
- **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.” - **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. - **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. - **Call:** The consequence is real. The current “Side-Effect Control (CRUX)” label lacks an explicit overall-score penalty target; rubric clarity and coverage assess that scoring issue separately.
The tenant-source compatibility target and polling-loop resilience target have plausible stakes. The former manifested in every run; the latter was met. The tenant-source compatibility target and polling-loop resilience target have plausible stakes. The former manifested in every run; the latter was met.
@@ -79,4 +79,4 @@ The tenant-source compatibility target and polling-loop resilience target have p
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 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 `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. 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 graders would apply the current Crux wording to those same responses.

View File

@@ -1,17 +1,17 @@
{ {
"version": 1, "version": 1,
"capturedAt": "2026-10-14T19:20:10.926Z", "capturedAt": "2026-10-14T19:24:36.016Z",
"capturedBy": "stamp", "capturedBy": "stamp",
"inputs": { "inputs": {
"prompt": "ee07c715924bc9e7aef3de9b1c84c7c98875a3afb27f0d2c2aef2e72e9df4a38", "prompt": "d3593e397434a174b641aadf38a74766fd24bfb817ec4531e86c340dcc4cb039",
"graderGuidance": null, "graderGuidance": null,
"sessionJsonl": null, "sessionJsonl": null,
"workspacePatch": null, "workspacePatch": null,
"gitref": "fcd8a9d0", "gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null, "graderGuidanceConsolidated": null,
"holisticRubric": "a25781d9cd6cf87d6179b3edb2dd78f4716d7c7a97355f56c02dd39132ab5762", "holisticRubric": "61275af1ae934ecec0e90f607ebf56ecda2efd7e53f5fc9f734a6a307d1f4729",
"atomicRubric": "3458e39b312a6a2416d968080498848d70a2cfc1f916ac2792be124fe0059e1e", "atomicRubric": "c377cec1003b172bd02b81117151e82de24080ad6b9ce72535b23ad8fb75ca52",
"rubricsYaml": null, "rubricsYaml": null,
"graderContext": "3c601fa5d23099b81e17ef3427f1eda60f13fc67c86bdfbc36553c50eb9a9c41" "graderContext": "05086a9a8c35c30867f00f4ce1abfde6cc28f4b7c5b8c56c12ba59d909b9544c"
} }
} }

View File

@@ -1,7 +1,7 @@
--- ---
detector: detector-rubric-clarity detector: detector-rubric-clarity
verdict: material-issues verdict: material-issues
confidence: HIGH confidence: MEDIUM
--- ---
# Rubric-clarity check: potion-voice-user-ownership # Rubric-clarity check: potion-voice-user-ownership
@@ -9,22 +9,16 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
## Material ambiguities ## Material ambiguities
### Conflicting score-cap target ### Crux has no scoring target
- **Where:** The Narrow Correctness section says, “Failing this crux requirement results in an overall score cap of 0% on Narrow Correctness.” - **Where:** Narrow Correctness labels the stop rule “Side-Effect Control (CRUX)” and says, “Failing to halt execution on unauthorized jobs is a central crux security failure.” The Deductions section says unauthorized effects are charged “strictly under the side-effect control crux criterion.”
- **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. - **Why it's ambiguous:** A grader can treat “crux” as emphasis within Narrow Correctness or as a heavy penalty against the overall score. The rubric never names an overall-score penalty, its trigger, or a non-trigger. The two readings can produce materially different rewards.
- **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. - **Grade evidence:** The four captured reference grades report a mean of eight dimensions and no overall penalty. They were graded under an earlier rubric revision, so they do not resolve the new wording's intended target.
### 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 ## Copy-edit issues
None found that interrupt reading. The defect is in the scoring instruction rather than prose mechanics. None found that interrupts reading.
## Overall verdict ## Overall verdict
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. The numeric cap from the prior revision is gone. The remaining Crux label still leaves a load-bearing scoring choice open. State a qualitative overall-score penalty with its non-trigger if that is intended, or describe the failure only under Narrow Correctness.

View File

@@ -1,17 +1,17 @@
{ {
"version": 1, "version": 1,
"capturedAt": "2026-10-14T19:20:10.926Z", "capturedAt": "2026-10-14T19:24:36.016Z",
"capturedBy": "stamp", "capturedBy": "stamp",
"inputs": { "inputs": {
"prompt": "ee07c715924bc9e7aef3de9b1c84c7c98875a3afb27f0d2c2aef2e72e9df4a38", "prompt": "d3593e397434a174b641aadf38a74766fd24bfb817ec4531e86c340dcc4cb039",
"graderGuidance": null, "graderGuidance": null,
"sessionJsonl": null, "sessionJsonl": null,
"workspacePatch": null, "workspacePatch": null,
"gitref": "fcd8a9d0", "gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null, "graderGuidanceConsolidated": null,
"holisticRubric": "a25781d9cd6cf87d6179b3edb2dd78f4716d7c7a97355f56c02dd39132ab5762", "holisticRubric": "61275af1ae934ecec0e90f607ebf56ecda2efd7e53f5fc9f734a6a307d1f4729",
"atomicRubric": "3458e39b312a6a2416d968080498848d70a2cfc1f916ac2792be124fe0059e1e", "atomicRubric": "c377cec1003b172bd02b81117151e82de24080ad6b9ce72535b23ad8fb75ca52",
"rubricsYaml": null, "rubricsYaml": null,
"graderContext": "3c601fa5d23099b81e17ef3427f1eda60f13fc67c86bdfbc36553c50eb9a9c41" "graderContext": "05086a9a8c35c30867f00f4ce1abfde6cc28f4b7c5b8c56c12ba59d909b9544c"
} }
} }

View File

@@ -11,49 +11,42 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai
| Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status | | Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status |
| --- | --- | --- | | --- | --- | --- |
| “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 | | “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 | | “Downstream database reads and updates ... profile-derived `userId`” | synthesis-tenant-isolation-queries-updates | covered |
| “initial `UserAudioProfile` lookup by `_id: userAudioProfileId` ... exempt” | initial-profile-tenant-resolution | covered | | “immediately halt further execution ... audio rendering or database updates” | prevent-unauthorized-side-effects | covered |
| “Unhandled exceptions during message processing must be caught gracefully” | worker-loop-crash-prevention | covered | | “initial `UserAudioProfile` lookup by `_id: userAudioProfileId` ... Do not penalize” | initial-profile-tenant-resolution | covered |
| “Omitting this status update MUST NOT incur any score deduction” | error-status-lifecycle-logging | covered | | “Inherited Acknowledgment Protection ... must not be penalized as a security defect” | none | missing |
| “SQS message deletion/acknowledgment behavior inherited from baseline ... must not be penalized” | none | missing | | “Unhandled exceptions ... caught gracefully” | worker-loop-crash-prevention | covered |
| “written summaries ... clearly articulate” isolation and worker stability | refactor-summary-clarity | partial | | “If a written summary or response is provided ... without making inaccurate claims” | refactor-summary-clarity | partial |
| “Query syntax omissions ... respective scoping criteria ... unauthorized side effects ... strictly under ... crux” | cloning-tenant-isolation; synthesis-tenant-isolation-queries-updates; prevent-unauthorized-side-effects | covered |
## Coverage gaps ## Coverage gaps
### Baseline acknowledgment protection ### Inherited 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.” - **Holistic clause:** Narrow Correctness says inherited SQS deletion and acknowledgment “must not be penalized as a security defect.”
- **Closest criterion:** None. The sentence appears only in `tests/grader-context.md`. - **Closest criterion:** None. `tests/grader-context.md` repeats the rule, but no criterion includes it as a non-trigger.
- **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. - **What is lost:** The atomic grader can penalize the inherited acknowledgment order while judging side-effect prevention or worker resilience. The original grades discuss early acknowledgment, although those grades predate this new protection.
- **Suggested criterion:** Add the exemption to the relevant side-effect or worker-loop elaboration rather than as a separate scored criterion.
### Summary of worker stability ### Written-summary accuracy and condition
- **Holistic clause:** The Communication section requires summaries to say how “tenant isolation and worker stability are achieved across the refactored handlers.” - **Holistic clause:** Communication says, “If a written summary or response is provided, it should clearly describe how tenant isolation is enforced across the refactored handlers without making inaccurate claims.”
- **Closest criterion:** `refactor-summary-clarity` requires only an isolation explanation. - **Closest criterion:** `refactor-summary-clarity` requires a clear isolation explanation but omits the accuracy qualifier and the conditional form.
- **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. - **What is lost:** An inaccurate but clearly written explanation can pass this atomic criterion. A response with no written summary can be judged as failing an unconditional criterion that the holistic rule makes conditional.
### 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 ## Invented content
`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. The atomic `prevent-unauthorized-side-effects` criterion has `severity: crux`, but the holistic rubric names no qualitative heavy penalty targeting the overall score. The parenthetical “(CRUX)” signals importance but does not define the overall-score subtraction that Crux severity encodes. The context file also states that the initial profile lookup is `UserAudioProfile.findById(userAudioProfileId)`; the holistic rubric only says lookup by `_id`, and the shipped baseline handler calls a service `find` method. This exact API claim should not appear as extracted ground truth.
## Context integrity ## Context integrity
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. The holistic document has no separate Task context, Business context, or Ground truth sections to extract verbatim. `tests/grader-context.md` supplies independent architecture prose instead. Core model and tenant-source facts are present in the criteria, but the context document is not a verbatim extraction of a source context section.
## Crux alignment ## Crux alignment
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. The holistic rubric has no Heavy penalties section and does not direct a heavy penalty at the overall score. The atomic rubric assigns `severity: crux` to `prevent-unauthorized-side-effects`. Under the conversion rule, that is an unsupported Crux designation until the source states an overall-score penalty and its non-trigger.
## Overall verdict ## Overall verdict
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. The two forms differ on acknowledgment protection and the summary's accuracy and condition. The unsupported Crux weighting is a further material scoring difference. Resolve the holistic penalty intent and carry every non-trigger into an atomic criterion's elaboration before treating the conversion as aligned.

View File

@@ -1,17 +1,17 @@
{ {
"version": 1, "version": 1,
"capturedAt": "2026-10-14T19:20:10.926Z", "capturedAt": "2026-10-14T19:24:36.016Z",
"capturedBy": "stamp", "capturedBy": "stamp",
"inputs": { "inputs": {
"prompt": "ee07c715924bc9e7aef3de9b1c84c7c98875a3afb27f0d2c2aef2e72e9df4a38", "prompt": "d3593e397434a174b641aadf38a74766fd24bfb817ec4531e86c340dcc4cb039",
"graderGuidance": null, "graderGuidance": null,
"sessionJsonl": null, "sessionJsonl": null,
"workspacePatch": null, "workspacePatch": null,
"gitref": "fcd8a9d0", "gitref": "fcd8a9d0",
"graderGuidanceConsolidated": null, "graderGuidanceConsolidated": null,
"holisticRubric": "a25781d9cd6cf87d6179b3edb2dd78f4716d7c7a97355f56c02dd39132ab5762", "holisticRubric": "61275af1ae934ecec0e90f607ebf56ecda2efd7e53f5fc9f734a6a307d1f4729",
"atomicRubric": "3458e39b312a6a2416d968080498848d70a2cfc1f916ac2792be124fe0059e1e", "atomicRubric": "c377cec1003b172bd02b81117151e82de24080ad6b9ce72535b23ad8fb75ca52",
"rubricsYaml": null, "rubricsYaml": null,
"graderContext": "3c601fa5d23099b81e17ef3427f1eda60f13fc67c86bdfbc36553c50eb9a9c41" "graderContext": "05086a9a8c35c30867f00f4ce1abfde6cc28f4b7c5b8c56c12ba59d909b9544c"
} }
} }

View File

@@ -1,7 +1,7 @@
--- ---
detector: detector-rubric-form detector: detector-rubric-form
verdict: material-issues verdict: minor-issues
confidence: HIGH confidence: MEDIUM
--- ---
# Rubric-form check: potion-voice-user-ownership # Rubric-form check: potion-voice-user-ownership
@@ -9,44 +9,34 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml
## Deterministic contract ## Deterministic contract
1. YAML parses with `task` and seven criteria: pass. 1. YAML parses with the task slug and six criteria: pass.
2. The task slug matches: pass. 2. Task slug matches: pass.
3. Criterion IDs are unique kebab-case: pass. 3. IDs are unique kebab-case: pass.
4. Categories use the allowed vocabulary: pass. 4. Categories use the allowed vocabulary: pass.
5. Severities use the allowed vocabulary and placement: pass. 5. Severities use the allowed vocabulary and placement: pass.
6. One Crux is within the two-Crux cap: pass. 6. One Crux is within the two-Crux cap: pass.
7. Dimensions name standard criteria: pass. 7. Dimension names match the Grading Standard: pass.
8. Guidelines are nonempty: 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. 9. No numeric penalty language appears in the atomic rubric or grader context: pass.
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. 10. Guidelines use positive “The response should ...” phrasing: pass. Negation in the profile-resolution guideline describes an allowed lookup, not a negated instruction.
## Atomicity and self-containment ## Atomicity and self-containment
### Scoring mechanics inside the side-effect guideline None found. Each criterion states one judgeable behavior. The handler scoping criteria cover parallel reads and updates under one tenant-isolation invariant; the side-effect criterion covers the stop condition across both handlers.
- **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 ## Phrasing and answer keys
### Answer-key facts lack bold formatting ### Answer-key facts are only partly bold
- **Criterion:** The factual guidelines, including `synthesis-tenant-isolation-queries-updates`. - **Criterion:** The factual criteria, 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.” - **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. - **Why:** The label and key terms are bold, while the load-bearing relationship between them is plain text. The fact is still present inline, so the grader can judge it; this is a formatting issue.
- **Suggested rewrite:** Bold the fact itself inside each factual guideline. - **Suggested rewrite:** Bold the full factual answer-key sentence, leaving the requirement itself unchanged.
## Fair-grading findings ## Fair-grading findings
### Optional status update cannot earn a meaningful verdict None found. The optional status-update criterion and numeric score cap from the prior revision are gone. Whether the Crux severity has a matching holistic penalty is the coverage detector's question.
- **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 ## Overall verdict
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. The deterministic contract passes and the criteria are independently judgeable. The only form issue is partial bold formatting of inline answer-key facts, so the verdict improves to `minor-issues`.

View File

@@ -1,11 +1,16 @@
# Background Worker Multi-Tenant Isolation Audit & Refactor # Data Isolation & Multi-Tenant Security Refactor
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. Our background queue workers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) process asynchronous jobs received via AWS SQS queue messages. Currently, these handlers fetch MongoDB documents (such as audio profiles, voice cloning jobs, recordings, and salutations) using document IDs provided in job message payloads without verifying whether those records belong to the requesting user.
## Task Objective ## Requirements
Audit and refactor the background worker job handlers to enforce strict multi-tenant data separation and maintain background worker loop stability: 1. **Multi-Tenant Scoping & Data Isolation**:
- Audit and refactor all database queries and updates across `voice-cloning-job-handler` and `voice-synthsizer-job-handler`.
- Ensure all database reads and updates verify tenant ownership using the tenant identity (`userId`).
- In `voice-synthsizer-job-handler`, the initial `UserAudioProfile` lookup by `_id: userAudioProfileId` is a valid tenant-resolution step to discover `userAudioProfile.userId`. All downstream queries (`RecordingSalutation`, `Recording`) must be strictly scoped by this profile-derived `userId`.
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. **Side-Effect & Execution Control**:
2. **Prevent Unauthorized Side Effects**: Guarantee that unauthorized or cross-tenant jobs halt execution immediately before triggering downstream mutations or audio rendering. - If tenant validation fails or requested records do not match the tenant context, immediately halt further processing. Do not execute speech synthesis audio rendering or perform unauthorized cross-tenant database mutations.
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.
3. **Worker Stability**:
- Ensure background worker polling loops handle errors gracefully during job processing so that unhandled exceptions do not cause the polling loop to crash.

View File

@@ -8,8 +8,8 @@ criteria:
call_site_key: voice-cloning-job-handler call_site_key: voice-cloning-job-handler
guideline: The response should enforce tenant isolation using userId on all VoiceCloning guideline: The response should enforce tenant isolation using userId on all VoiceCloning
and UserAudioProfile queries and updates in the voice cloning handler. **Answer and UserAudioProfile queries and updates in the voice cloning handler. **Answer
key:** All database reads and updates in voice-cloning-job-handler must filter key:** All database queries and updates in **voice-cloning-job-handler** must
by userId in addition to record _id. filter by **userId** in addition to record **_id**.
elaboration: Verifies that voice cloning queries and updates incorporate userId elaboration: Verifies that voice cloning queries and updates incorporate userId
to prevent unauthorized cross-tenant operations. to prevent unauthorized cross-tenant operations.
- id: synthesis-tenant-isolation-queries-updates - id: synthesis-tenant-isolation-queries-updates
@@ -20,8 +20,8 @@ criteria:
call_site_key: voice-synthsizer-job-handler call_site_key: voice-synthsizer-job-handler
guideline: The response should scope all synthesis queries and database updates guideline: The response should scope all synthesis queries and database updates
by tenant identity (userId) across RecordingSalutation and Recording records. by tenant identity (userId) across RecordingSalutation and Recording records.
**Answer key:** Downstream reads and updates to RecordingSalutation and Recording **Answer key:** Downstream reads and updates to **RecordingSalutation** and **Recording**
in voice-synthsizer-job-handler must be scoped by the profile-derived userId. 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 elaboration: Ensures that both queries and database updates in the speech synthesis
handler enforce tenant isolation using userId. handler enforce tenant isolation using userId.
- id: prevent-unauthorized-side-effects - id: prevent-unauthorized-side-effects
@@ -30,15 +30,12 @@ criteria:
- Narrow Correctness - Narrow Correctness
severity: crux severity: crux
call_site_key: voice-synthsizer-job-handler call_site_key: voice-synthsizer-job-handler
guideline: 'The response should prevent unauthorized side effects, including audio guideline: The response should halt processing and prevent unauthorized side effects,
generation and database mutations across both handlers, when tenant validation including audio synthesis and database updates across both handlers, when tenant
fails or records do not match tenant context. Failing this crux criterion results validation fails. **Answer key:** Speech synthesis audio rendering and database
in an overall score cap of 0% on Narrow Correctness. Routing note: Charge syntax updates must be halted if tenant ownership checks fail for **userId**.
omissions under query criteria; charge unauthorized side-effect execution under elaboration: Guarantees that unauthorized jobs do not trigger audio rendering or
this criterion. **Answer key:** Audio generation and unauthorized database mutations database updates on unowned records.
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 - id: initial-profile-tenant-resolution
category: dodged_bullet category: dodged_bullet
dimensions: dimensions:
@@ -47,8 +44,8 @@ criteria:
call_site_key: voice-synthsizer-job-handler call_site_key: voice-synthsizer-job-handler
guideline: 'The response should allow the initial UserAudioProfile lookup by _id: guideline: 'The response should allow the initial UserAudioProfile lookup by _id:
userAudioProfileId as a valid tenant-resolution step without requiring userId userAudioProfileId as a valid tenant-resolution step without requiring userId
in that initial query. **Answer key:** The initial lookup on UserAudioProfile in that initial query. **Answer key:** The initial lookup on **UserAudioProfile**
by ID is necessary to resolve userId and establish tenant context.' by **_id** is necessary to resolve **userId** and establish tenant context.'
elaboration: Prevents improperly docking points for the initial profile query needed elaboration: Prevents improperly docking points for the initial profile query needed
to discover the tenant identity. to discover the tenant identity.
- id: worker-loop-crash-prevention - id: worker-loop-crash-prevention
@@ -63,26 +60,13 @@ criteria:
active. active.
elaboration: Ensures background worker loops remain resilient against unhandled elaboration: Ensures background worker loops remain resilient against unhandled
errors. 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 - id: refactor-summary-clarity
category: primary_intent category: primary_intent
dimensions: dimensions:
- Communication - Communication
severity: unlikely_dealbreaker severity: unlikely_dealbreaker
call_site_key: voice-synthsizer-job-handler call_site_key: voice-synthsizer-job-handler
guideline: The response should clearly articulate how tenant isolation is enforced guideline: The response should clearly describe how multi-tenant isolation is enforced
across the refactored handlers in its written explanations. **Answer key:** The across the refactored handlers in its written explanations. **Answer key:** The
written explanation must clearly describe the multi-tenant isolation approach. written explanation must clearly describe the multi-tenant isolation approach.
elaboration: Evaluates the clarity and structure of the written refactoring summary. elaboration: Evaluates the clarity and structure of the written refactoring summary.

View File

@@ -1,19 +1,24 @@
# Grader Context & Reference Answer Key # Grader Context & Ground Truth: Potion Voice User Ownership Refactor
## Architecture & Codebase Facts ## Architecture & Codebase Facts
### 1. Voice Cloning Handler (`voice-cloning-job-handler`) - **Queue Framework**: Background jobs arrive via AWS SQS queue messages processed by `voice-cloning-job-handler` and `voice-synthsizer-job-handler`.
* **Queue Ingestion**: Consumes job payload data directly from SQS messages (`job._doc`). - **Mongoose Models**:
* **Database Model**: Operates on the `VoiceCloning` Mongoose model. - `VoiceCloning`: Model representing voice cloning jobs.
* **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 }`. - `UserAudioProfile`: Stores user audio profiles; contains the tenant identifier `userId`.
- `RecordingSalutation` and `Recording`: Synthesis assets associated with user audio profiles.
### 2. Speech Synthesis Handler (`voice-synthsizer-job-handler`) ## Handler Execution Details
* **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 1. **Voice Cloning (`voice-cloning-job-handler`)**:
* **Crux Penalty**: Failing to halt unauthorized side effects caps Narrow Correctness at 0%. - Receives job payload `job._doc` containing `_id`, `userId`, and `userAudioProfileId`.
* **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**. - Queries and updates must include `userId` alongside record `_id`.
* **Baseline Queue Acknowledgment**: Message deletion/acknowledgment behavior inherited from baseline SQS handlers is standard and must not be docked.
2. **Speech Synthesis (`voice-synthsizer-job-handler`)**:
- Payload provides `userAudioProfileId`, `recordingId`, and `salutationId`.
- **Tenant Resolution Step**: The initial lookup `UserAudioProfile.findById(userAudioProfileId)` resolves `userAudioProfile.userId`.
- **Downstream Scoping**: Subsequent queries and updates for `RecordingSalutation` and `Recording` must filter on `{ _id: id, userId: profile.userId }`.
- **Side-Effect Control**: If records do not match `profile.userId`, execution must halt immediately before audio synthesis rendering or database updates occur.
3. **Infrastructure Notes**:
- Baseline SQS queue message deletion and acknowledgment is standard worker framework behavior and must not be penalized as a security defect.

View File

@@ -1,44 +1,24 @@
# Holistic Evaluation Rubric: potion-voice-user-ownership # Holistic Evaluation Rubric: Potion Voice User Ownership Refactor
## Overview ## Narrow Correctness
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.
--- ### Primary Security Criteria
- **Voice Cloning Multi-Tenant Scoping**: All database reads and updates in `voice-cloning-job-handler` (`VoiceCloning` and `UserAudioProfile`) must enforce tenant isolation by filtering on `userId` in addition to document `_id`.
- **Speech Synthesis Multi-Tenant Scoping**: Downstream database reads and updates in `voice-synthsizer-job-handler` (`RecordingSalutation` and `Recording`) must be scoped by the profile-derived `userId`.
- **Side-Effect Control (CRUX)**: If tenant validation fails or records do not match the tenant context, the handler must immediately halt further execution. It must not perform audio rendering or database updates on unowned records. Failing to halt execution on unauthorized jobs is a central crux security failure.
## Grading Dimensions ### Allowed & Expected Behaviors
- **Initial Profile Lookup Exemption**: Looking up `UserAudioProfile` by `_id: userAudioProfileId` in `voice-synthsizer-job-handler` is the valid tenant-resolution step to discover `userId` and establish tenant context. Do not penalize this initial lookup for lacking `userId` in its query filter.
- **Inherited Acknowledgment Protection**: Baseline SQS queue message deletion and acknowledgment behavior inherited from the worker framework is standard infrastructure operation and must not be penalized as a security defect.
### Narrow Correctness ## Broader Correctness / the craft of software engineering
- **Crux Requirement (Side-Effect Halting)**: - **Worker Loop Resilience**: Unhandled exceptions during individual message processing must be caught gracefully so that background worker polling loops remain active and stable.
- 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`)**: ## Communication
- 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`)**: - **Refactoring Summary**: If a written summary or response is provided, it should clearly describe how tenant isolation is enforced across the refactored handlers without making inaccurate claims.
- 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`)**: ## Deductions and Charge-Once Guidance
- 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.
--- - **Single Deduction Rule**: Do not double-penalize. Query syntax omissions should be charged under their respective scoping criteria. Execution of unauthorized side effects (audio rendering or cross-tenant writes) must be charged strictly under the side-effect control crux criterion.
### 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.
---
### 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.