4 flagging detectors 3rd time
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-14T19:24:36.016Z",
|
||||
"capturedAt": "2026-10-14T19:40:07.233Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "d3593e397434a174b641aadf38a74766fd24bfb817ec4531e86c340dcc4cb039",
|
||||
"prompt": "390623c31ce92c23a23d9dcef030214a58de013521829f23bcb767d6063ece41",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "61275af1ae934ecec0e90f607ebf56ecda2efd7e53f5fc9f734a6a307d1f4729",
|
||||
"atomicRubric": "c377cec1003b172bd02b81117151e82de24080ad6b9ce72535b23ad8fb75ca52",
|
||||
"holisticRubric": "a0b195ccea7467b0cb507c618a385335487ec567e166dae2f23dac69f804ff87",
|
||||
"atomicRubric": "b4b3bef2c7fcbda791147dae736290da4546034f89ca0fc1d2a51568c95da5d0",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "05086a9a8c35c30867f00f4ce1abfde6cc28f4b7c5b8c56c12ba59d909b9544c"
|
||||
"graderContext": "73ee1a5692675bff94eb0aeb40c189c7fdcf9e2fd805cef12139f21b2766d93f"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and
|
||||
## Load-bearing targets
|
||||
|
||||
- **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.
|
||||
- **Stop unauthorized downstream work:** The Narrow Correctness section calls halting database mutations or audio rendering after failed ownership validation the Crux Requirement and directs a heavy penalty at the overall score.
|
||||
- **Worker resilience:** The Broader Correctness section requires polling loops to survive message-processing exceptions.
|
||||
|
||||
Inherited SQS acknowledgment order is now an explicit non-penalty rule. The written summary is peripheral to the central security failure.
|
||||
@@ -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.
|
||||
- **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; the source's undefined Crux weighting is a separate rubric-coverage issue.
|
||||
- **Verdict for this deduction:** `meaningful`. It directly violates the task's stop condition; whether the source's Narrow Correctness parenthesis adds a second penalty is a separate rubric-clarity issue.
|
||||
|
||||
### Missing baseline-payload verification — meaningful
|
||||
|
||||
@@ -69,9 +69,9 @@ The old grades also discuss acknowledgment before database success and, in one r
|
||||
|
||||
### Unauthorized effects after ownership failure — holds
|
||||
|
||||
- **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:** “The candidate solution MUST immediately halt job execution before triggering audio synthesis rendering or modifying database records if tenant validation fails or if requested resources do not belong to the resolved tenant.” The source also directs a heavy overall-score penalty for failing this rule.
|
||||
- **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 current “Side-Effect Control (CRUX)” label lacks an explicit overall-score penalty target; rubric clarity and coverage assess that scoring issue separately.
|
||||
- **Call:** The consequence is real, and a heavy penalty is proportionate to actual cross-tenant rendering or writes. The phrase “docking all points under Narrow Correctness” leaves the arithmetic unclear; rubric clarity and coverage assess that 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.
|
||||
|
||||
@@ -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 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.
|
||||
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 combined overall-penalty and Narrow Correctness wording to those same responses.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-14T19:24:36.016Z",
|
||||
"capturedAt": "2026-10-14T19:40:07.233Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "d3593e397434a174b641aadf38a74766fd24bfb817ec4531e86c340dcc4cb039",
|
||||
"prompt": "390623c31ce92c23a23d9dcef030214a58de013521829f23bcb767d6063ece41",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "61275af1ae934ecec0e90f607ebf56ecda2efd7e53f5fc9f734a6a307d1f4729",
|
||||
"atomicRubric": "c377cec1003b172bd02b81117151e82de24080ad6b9ce72535b23ad8fb75ca52",
|
||||
"holisticRubric": "a0b195ccea7467b0cb507c618a385335487ec567e166dae2f23dac69f804ff87",
|
||||
"atomicRubric": "b4b3bef2c7fcbda791147dae736290da4546034f89ca0fc1d2a51568c95da5d0",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "05086a9a8c35c30867f00f4ce1abfde6cc28f4b7c5b8c56c12ba59d909b9544c"
|
||||
"graderContext": "73ee1a5692675bff94eb0aeb40c189c7fdcf9e2fd805cef12139f21b2766d93f"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
detector: detector-rubric-clarity
|
||||
verdict: material-issues
|
||||
confidence: MEDIUM
|
||||
confidence: HIGH
|
||||
---
|
||||
# Rubric-clarity check: potion-voice-user-ownership
|
||||
|
||||
@@ -9,16 +9,16 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
|
||||
|
||||
## Material ambiguities
|
||||
|
||||
### Crux has no scoring target
|
||||
### Overall penalty versus Narrow Correctness zeroing
|
||||
|
||||
- **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:** 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 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.
|
||||
- **Where:** The Crux Scoring Note says, “Failing this crux criterion applies a heavy penalty to the overall score (docking all points under Narrow Correctness).”
|
||||
- **Why it's ambiguous:** The Grading Standard treats an overall-score penalty and a reduced Narrow Correctness rating as different score operations. The parenthesis could mean zero Narrow Correctness *instead of* an overall penalty, zero Narrow Correctness *as well as* an overall penalty, or an attempted explanation of the penalty's size. Those readings change both the score and relative ordering of responses.
|
||||
- **Grade evidence:** The four original reference grades report the eight-criterion mean without an overall penalty; they were graded under an earlier rubric revision and cannot resolve this new wording.
|
||||
|
||||
## Copy-edit issues
|
||||
|
||||
None found that interrupts reading.
|
||||
None found that interrupts reading. The problem is the scoring instruction, not grammar.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
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.
|
||||
The source now names an overall-score heavy penalty, resolving the previous missing-target issue. Remove the Narrow Correctness docking parenthesis or state a separate, qualitative criterion penalty with its own trigger. The current sentence is materially ambiguous.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-14T19:24:36.016Z",
|
||||
"capturedAt": "2026-10-14T19:40:07.233Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "d3593e397434a174b641aadf38a74766fd24bfb817ec4531e86c340dcc4cb039",
|
||||
"prompt": "390623c31ce92c23a23d9dcef030214a58de013521829f23bcb767d6063ece41",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "61275af1ae934ecec0e90f607ebf56ecda2efd7e53f5fc9f734a6a307d1f4729",
|
||||
"atomicRubric": "c377cec1003b172bd02b81117151e82de24080ad6b9ce72535b23ad8fb75ca52",
|
||||
"holisticRubric": "a0b195ccea7467b0cb507c618a385335487ec567e166dae2f23dac69f804ff87",
|
||||
"atomicRubric": "b4b3bef2c7fcbda791147dae736290da4546034f89ca0fc1d2a51568c95da5d0",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "05086a9a8c35c30867f00f4ce1abfde6cc28f4b7c5b8c56c12ba59d909b9544c"
|
||||
"graderContext": "73ee1a5692675bff94eb0aeb40c189c7fdcf9e2fd805cef12139f21b2766d93f"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,42 +11,49 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai
|
||||
|
||||
| Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status |
|
||||
| --- | --- | --- |
|
||||
| “immediately halt job execution before triggering audio synthesis rendering or modifying database records” | prevent-unauthorized-side-effects | covered |
|
||||
| “heavy penalty to the overall score” | prevent-unauthorized-side-effects (`crux`) | covered |
|
||||
| “docking all points under Narrow Correctness” | prevent-unauthorized-side-effects | partial |
|
||||
| “query syntax omissions under the query scoping criteria ... actual execution ... under this crux requirement” | 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 database reads and updates ... profile-derived `userId`” | synthesis-tenant-isolation-queries-updates | covered |
|
||||
| “immediately halt further execution ... audio rendering or database updates” | prevent-unauthorized-side-effects | covered |
|
||||
| “initial `UserAudioProfile` lookup by `_id: userAudioProfileId` ... Do not penalize” | initial-profile-tenant-resolution | covered |
|
||||
| “Inherited Acknowledgment Protection ... must not be penalized as a security defect” | none | missing |
|
||||
| “Unhandled exceptions ... caught gracefully” | worker-loop-crash-prevention | covered |
|
||||
| “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 |
|
||||
| “All downstream reads and updates to `RecordingSalutation` and `Recording` ... profile-derived `userId`” | synthesis-tenant-isolation-queries-updates | covered |
|
||||
| “initial lookup on `UserAudioProfile` by `_id: userAudioProfileId` ... MUST NOT be penalized” | initial-profile-tenant-resolution | covered |
|
||||
| “Processing errors, tenant mismatch rejections, and database exceptions ... caught ... in a try-catch block” | worker-loop-crash-prevention | covered |
|
||||
| “Standard SQS message deletion and acknowledgment ... MUST NOT be penalized” | inherited-sqs-acknowledgment-protection | covered |
|
||||
| “If a written summary or code documentation is provided ... accurately describe ... without misleading claims” | refactor-summary-accuracy | partial |
|
||||
|
||||
## Coverage gaps
|
||||
|
||||
### Inherited acknowledgment protection
|
||||
### Narrow Correctness docking is not encoded
|
||||
|
||||
- **Holistic clause:** Narrow Correctness says inherited SQS deletion and acknowledgment “must not be penalized as a security defect.”
|
||||
- **Closest criterion:** None. `tests/grader-context.md` repeats the rule, but no criterion includes it as a non-trigger.
|
||||
- **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.
|
||||
- **Holistic clause:** The Crux Scoring Note adds “(docking all points under Narrow Correctness)” to an overall-score heavy penalty.
|
||||
- **Closest criterion:** `prevent-unauthorized-side-effects` encodes the overall penalty through `severity: crux`, but does not encode zeroing the Narrow Correctness dimension.
|
||||
- **What is lost:** If the parenthesis is intended as a second scoring action, the atomic rubric omits it. If it is merely an explanation of the overall penalty, the source is misleading. Resolve that ambiguity in the holistic source first; the atomic scoring scheme cannot directly encode a zero-score cap.
|
||||
|
||||
### Written-summary accuracy and condition
|
||||
### Code documentation condition
|
||||
|
||||
- **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 a clear isolation explanation but omits the accuracy qualifier and the conditional form.
|
||||
- **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.
|
||||
- **Holistic clause:** Communication applies “If a written summary or code documentation is provided.”
|
||||
- **Closest criterion:** `refactor-summary-accuracy` is conditional only on a written response summary; its guideline does not mention code documentation.
|
||||
- **What is lost:** Misleading documentation added in code can avoid this task-specific accuracy criterion even though the holistic clause covers it.
|
||||
|
||||
## Invented content
|
||||
|
||||
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.
|
||||
### Acknowledgment protection becomes a preservation requirement
|
||||
|
||||
The holistic rubric protects standard inherited acknowledgment from being penalized as a security flaw. `inherited-sqs-acknowledgment-protection` instead says the response “should preserve or rely on the framework's standard SQS message acknowledgment and deletion behavior.” A response that safely changes the acknowledgment order can fail this criterion despite the holistic rule making no such preservation demand.
|
||||
|
||||
### Unverified API in context
|
||||
|
||||
`tests/grader-context.md` says the initial synthesis lookup is `UserAudioProfile.findById(userAudioProfileId)`. The holistic rubric says only that the lookup uses `_id: userAudioProfileId`; the shipped baseline handler calls `userAudioProfileService.find(...)`, not `findById`. The context's exact API claim is neither a verbatim source fact nor a safe restatement.
|
||||
|
||||
## Context integrity
|
||||
|
||||
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.
|
||||
The holistic rubric has an Overview but no separate Task context, Business context, or Ground truth sections. The context document adds independent architecture prose rather than extracting source context verbatim. Its model and tenant-source summary mostly aligns with the holistic clauses, apart from the `findById` claim above.
|
||||
|
||||
## Crux alignment
|
||||
|
||||
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.
|
||||
The holistic Scoring Note now expressly names a heavy penalty targeting the overall score, and `prevent-unauthorized-side-effects` carries `severity: crux`. The main Crux designation is aligned. The parenthetical Narrow Correctness zeroing is a separate, unresolved scoring instruction, and the source still lacks an explicit non-trigger for that heavy penalty.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
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.
|
||||
Crux has an overall-score source now, but the parenthetical score operation is not encoded and needs clarification. The acknowledgment criterion adds a preservation requirement, the documentation condition is narrower than the source, and the context contains an unsupported exact API claim. These are material scoring differences.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-14T19:24:36.016Z",
|
||||
"capturedAt": "2026-10-14T19:40:07.233Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "d3593e397434a174b641aadf38a74766fd24bfb817ec4531e86c340dcc4cb039",
|
||||
"prompt": "390623c31ce92c23a23d9dcef030214a58de013521829f23bcb767d6063ece41",
|
||||
"graderGuidance": null,
|
||||
"sessionJsonl": null,
|
||||
"workspacePatch": null,
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "61275af1ae934ecec0e90f607ebf56ecda2efd7e53f5fc9f734a6a307d1f4729",
|
||||
"atomicRubric": "c377cec1003b172bd02b81117151e82de24080ad6b9ce72535b23ad8fb75ca52",
|
||||
"holisticRubric": "a0b195ccea7467b0cb507c618a385335487ec567e166dae2f23dac69f804ff87",
|
||||
"atomicRubric": "b4b3bef2c7fcbda791147dae736290da4546034f89ca0fc1d2a51568c95da5d0",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "05086a9a8c35c30867f00f4ce1abfde6cc28f4b7c5b8c56c12ba59d909b9544c"
|
||||
"graderContext": "73ee1a5692675bff94eb0aeb40c189c7fdcf9e2fd805cef12139f21b2766d93f"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
detector: detector-rubric-form
|
||||
verdict: minor-issues
|
||||
confidence: MEDIUM
|
||||
verdict: material-issues
|
||||
confidence: HIGH
|
||||
---
|
||||
# Rubric-form check: potion-voice-user-ownership
|
||||
|
||||
@@ -9,34 +9,44 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml
|
||||
|
||||
## Deterministic contract
|
||||
|
||||
1. YAML parses with the task slug and six criteria: pass.
|
||||
2. Task slug matches: pass.
|
||||
1. YAML parses with `task` and seven criteria: pass.
|
||||
2. The task slug matches: pass.
|
||||
3. 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. Dimension names match the Grading Standard: pass.
|
||||
7. Dimensions name standard criteria: pass.
|
||||
8. Guidelines are nonempty: pass.
|
||||
9. No numeric penalty language appears in the atomic rubric or grader context: pass.
|
||||
10. Guidelines use positive “The response should ...” phrasing: pass. Negation in the profile-resolution guideline describes an allowed lookup, not a negated instruction.
|
||||
9. Numeric penalty language: pass; the rubric and context give no numeric penalty amount.
|
||||
10. Positive requirement phrasing: pass for behavioral sentences. The answer-key phrase “must not be penalized” describes a protected behavior rather than an instruction to the response.
|
||||
|
||||
## Atomicity and self-containment
|
||||
|
||||
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.
|
||||
### Grading directions inside the Crux guideline
|
||||
|
||||
- **Criterion:** `prevent-unauthorized-side-effects`.
|
||||
- **Where:** “Routing note: Charge syntax omissions under cloning-tenant-isolation or synthesis-tenant-isolation-queries-updates; charge side-effect execution under this criterion. Failing this crux criterion applies a heavy penalty to the overall score.”
|
||||
- **Why:** The guideline mixes one response requirement with charge routing and score mechanics, then repeats the heavy-penalty rule inside its answer key and elaboration. A grader can identify the response behavior, but the criterion no longer has the required one-statement guideline shape.
|
||||
- **Suggested rewrite:** Leave only the stop condition and bold answer key in the guideline; place charge routing in the elaboration and let `severity: crux` carry the penalty weight.
|
||||
|
||||
## Phrasing and answer keys
|
||||
|
||||
### Answer-key facts are only partly bold
|
||||
### Factual answer-key relationships are only partly bold
|
||||
|
||||
- **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**.”
|
||||
- **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 full factual answer-key sentence, leaving the requirement itself unchanged.
|
||||
- **Criterion:** `synthesis-tenant-isolation-queries-updates`, among others.
|
||||
- **Where:** “**Answer key:** Downstream **reads** and **updates** to **RecordingSalutation** and **Recording** ... must be scoped by the profile-derived **userId**.”
|
||||
- **Why:** The label and nouns are bold, but the load-bearing relationship is not. The fact remains inline and judgeable, so this is a formatting issue.
|
||||
- **Suggested rewrite:** Bold the complete answer-key fact.
|
||||
|
||||
## Fair-grading findings
|
||||
|
||||
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.
|
||||
### Protected acknowledgment becomes required preservation
|
||||
|
||||
- **Criterion:** `inherited-sqs-acknowledgment-protection`.
|
||||
- **Where:** “The response should preserve or rely on the framework's standard SQS message acknowledgment and deletion behavior without treating standard message deletion on rejected or completed jobs as a security defect.”
|
||||
- **Why:** The source only protects inherited acknowledgment from a security deduction. This criterion can fail a safe response that changes timing rather than preserving or relying on it, and it spends a scored criterion on an exemption that belongs in another criterion's elaboration.
|
||||
- **Suggested rewrite:** Move the protection to the worker-loop or side-effect elaboration as a non-trigger; omit a separate scored preservation criterion.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
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`.
|
||||
The deterministic artifact contract passes. The acknowledgment criterion creates an unfair scored requirement, and the Crux guideline bundles a behavioral rule with grading mechanics. Those judgment-layer issues make the atomic artifact materially unsound; the answer-key formatting issue is minor.
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
# Data Isolation & Multi-Tenant Security Refactor
|
||||
# Refactor Background Workers for Multi-Tenant Data Isolation
|
||||
|
||||
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.
|
||||
## Context & Problem
|
||||
Our backend background worker services (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) process asynchronous jobs received via AWS SQS queue messages. Currently, these handlers retrieve database records—such as voice cloning jobs, user audio profiles, salutations, and synthesized audio recordings—using only the document identifiers (`_id`) supplied in the message payloads.
|
||||
|
||||
## Requirements
|
||||
Because incoming job payloads do not guarantee authenticated user context, retrieving records solely by `_id` creates a multi-tenant data isolation vulnerability. An unauthorized job message could potentially read or mutate another tenant's audio profiles, salutation records, or generated audio files.
|
||||
|
||||
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`.
|
||||
## Task Objective
|
||||
Audit and refactor all database queries and updates across the background worker job handlers to enforce strict multi-tenant data separation and ensure background processing stability:
|
||||
|
||||
2. **Side-Effect & Execution Control**:
|
||||
- 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. **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.
|
||||
1. **Multi-Tenant Data Isolation**: Ensure all database reads, updates, and side effects in `voice-cloning-job-handler` and `voice-synthsizer-job-handler` are strictly scoped by tenant identity (`userId`).
|
||||
2. **Tenant Context Resolution**: For operations where the message payload provides a resource identifier (e.g., `userAudioProfileId`), use the initial profile lookup to establish authoritative tenant context (`userId`), then enforce that `userId` on all downstream queries and database updates.
|
||||
3. **Prevent Unauthorized Side Effects**: Guarantee that if tenant validation fails or requested records do not belong to the resolved tenant, background processing halts immediately before triggering audio synthesis rendering or mutating database records.
|
||||
4. **Worker Loop Resilience**: Ensure that error handling within job handlers catches exceptions gracefully, preventing unhandled job failures from crashing the main background worker polling loops.
|
||||
|
||||
@@ -6,10 +6,10 @@ criteria:
|
||||
- Narrow Correctness
|
||||
severity: certain_dealbreaker
|
||||
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
|
||||
key:** All database queries and updates in **voice-cloning-job-handler** must
|
||||
filter by **userId** in addition to record **_id**.
|
||||
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
|
||||
@@ -18,10 +18,11 @@ criteria:
|
||||
- Narrow Correctness
|
||||
severity: certain_dealbreaker
|
||||
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.
|
||||
**Answer key:** Downstream reads and updates to **RecordingSalutation** and **Recording**
|
||||
in **voice-synthsizer-job-handler** must be scoped by the profile-derived **userId**.
|
||||
**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
|
||||
@@ -30,12 +31,18 @@ criteria:
|
||||
- Narrow Correctness
|
||||
severity: crux
|
||||
call_site_key: voice-synthsizer-job-handler
|
||||
guideline: The response should halt processing and prevent unauthorized side effects,
|
||||
including audio synthesis and database updates across both handlers, when tenant
|
||||
validation fails. **Answer key:** Speech synthesis audio rendering and database
|
||||
updates must be halted if tenant ownership checks fail for **userId**.
|
||||
elaboration: Guarantees that unauthorized jobs do not trigger audio rendering or
|
||||
database updates on unowned records.
|
||||
guideline: 'The response should prevent unauthorized side effects, including audio
|
||||
generation and database mutations across both voice cloning and speech synthesis
|
||||
handlers, when tenant validation fails or records do not match tenant context.
|
||||
Routing note: Charge syntax omissions under cloning-tenant-isolation or synthesis-tenant-isolation-queries-updates;
|
||||
charge side-effect execution under this criterion. Failing this crux criterion
|
||||
applies a heavy penalty to the overall score. **Answer key:** Synthesis **audio
|
||||
generation** and **database mutations** must be halted if **tenant ownership checks**
|
||||
fail. Failing this crux criterion applies a **heavy penalty** to the **overall
|
||||
score**.'
|
||||
elaboration: 'CRUX CRITERION: Halting unauthorized audio rendering and database
|
||||
side effects when tenant validation fails is the central security requirement.
|
||||
Failing this crux criterion applies a heavy penalty to the overall score.'
|
||||
- id: initial-profile-tenant-resolution
|
||||
category: dodged_bullet
|
||||
dimensions:
|
||||
@@ -45,28 +52,44 @@ criteria:
|
||||
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.'
|
||||
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: inherited-sqs-acknowledgment-protection
|
||||
category: dodged_bullet
|
||||
dimensions:
|
||||
- Broader Correctness / the craft of software engineering
|
||||
severity: possible_dealbreaker
|
||||
call_site_key: voice-synthsizer-job-handler
|
||||
guideline: 'The response should preserve or rely on the framework''s standard SQS
|
||||
message acknowledgment and deletion behavior without treating standard message
|
||||
deletion on rejected or completed jobs as a security defect. **Answer key:** **SQS
|
||||
message deletion** and **acknowledgment** inherited from the baseline consumer
|
||||
framework is standard queue processing behavior and must not be penalized.'
|
||||
elaboration: Protects candidate agents from being docked for standard framework
|
||||
queue message deletion and acknowledgment behavior.
|
||||
- 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
|
||||
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.
|
||||
during job processing must be caught gracefully in a **try-catch block** so the
|
||||
worker **polling loop** remains active.'
|
||||
elaboration: Ensures background worker loops remain resilient against unhandled
|
||||
errors.
|
||||
- id: refactor-summary-clarity
|
||||
- id: refactor-summary-accuracy
|
||||
category: primary_intent
|
||||
dimensions:
|
||||
- Communication
|
||||
severity: unlikely_dealbreaker
|
||||
call_site_key: voice-synthsizer-job-handler
|
||||
guideline: The response should clearly describe how multi-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.
|
||||
guideline: 'The response should accurately summarize the refactored multi-tenant
|
||||
isolation changes across the background worker handlers if a written response
|
||||
summary is provided. **Answer key:** Any written **summary** or **explanation**
|
||||
must **accurately reflect** the actual code refactoring and **multi-tenant security
|
||||
logic** without misleading claims.'
|
||||
elaboration: Evaluates whether written response explanations accurately reflect
|
||||
the underlying code refactoring.
|
||||
|
||||
@@ -1,24 +1,18 @@
|
||||
# Grader Context & Ground Truth: Potion Voice User Ownership Refactor
|
||||
# Grader Context & Reference Ground Truth
|
||||
|
||||
## Architecture & Codebase Facts
|
||||
## Repository Architecture & Code Mechanics
|
||||
The repository operates an asynchronous background worker tier processing voice cloning and speech synthesis tasks via AWS SQS queue consumers.
|
||||
|
||||
- **Queue Framework**: Background jobs arrive via AWS SQS queue messages processed by `voice-cloning-job-handler` and `voice-synthsizer-job-handler`.
|
||||
- **Mongoose Models**:
|
||||
- `VoiceCloning`: Model representing voice cloning jobs.
|
||||
- `UserAudioProfile`: Stores user audio profiles; contains the tenant identifier `userId`.
|
||||
- `RecordingSalutation` and `Recording`: Synthesis assets associated with user audio profiles.
|
||||
### Key Mongoose Models & Collections
|
||||
1. `VoiceCloning`: Model representing voice cloning training jobs. Key fields: `_id`, `userId`, `status`.
|
||||
2. `UserAudioProfile`: Model representing trained user voice profiles. Key fields: `_id`, `userId`, `profileName`.
|
||||
3. `RecordingSalutation`: Model for custom greeting voice synthesis. Key fields: `_id`, `userId`, `userAudioProfileId`, `status`.
|
||||
4. `Recording`: Model for standard audio generation. Key fields: `_id`, `userId`, `userAudioProfileId`, `status`.
|
||||
|
||||
## Handler Execution Details
|
||||
### Queue Payload Ingestion & Tenant Resolution
|
||||
* `voice-cloning-job-handler`: Receives job objects directly (`job._doc`). Ingestion must scope `VoiceCloning` and `UserAudioProfile` queries by `userId`.
|
||||
* `voice-synthsizer-job-handler`: Message payload provides `userAudioProfileId`, `recordingId`, and/or `salutationId`.
|
||||
* **Two-Step Resolution**: The handler performs an initial lookup `UserAudioProfile.findById(userAudioProfileId)` to resolve `userAudioProfile.userId`. This `userId` becomes the authoritative tenant context for all downstream `RecordingSalutation` and `Recording` reads and updates.
|
||||
|
||||
1. **Voice Cloning (`voice-cloning-job-handler`)**:
|
||||
- Receives job payload `job._doc` containing `_id`, `userId`, and `userAudioProfileId`.
|
||||
- Queries and updates must include `userId` alongside record `_id`.
|
||||
|
||||
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.
|
||||
### Queue Acknowledgment Framework
|
||||
The baseline worker framework manages SQS message deletion and acknowledgment upon job completion or handled rejection. This infrastructure behavior is standard queue consumer functionality and does not constitute an unauthorized database or queue mutation.
|
||||
|
||||
@@ -1,24 +1,35 @@
|
||||
# Holistic Evaluation Rubric: Potion Voice User Ownership Refactor
|
||||
# Holistic Evaluation Rubric: Multi-Tenant Data Isolation in Background Workers
|
||||
|
||||
## Narrow Correctness
|
||||
## Primary Goals & Overview
|
||||
This rubric evaluates candidate solutions refactoring background worker job handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) for multi-tenant data isolation and background worker stability.
|
||||
|
||||
### 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.
|
||||
---
|
||||
|
||||
### 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.
|
||||
## 1. Narrow Correctness
|
||||
|
||||
## Broader Correctness / the craft of software engineering
|
||||
### Crux Requirement: Unauthorized Side-Effect Prevention
|
||||
* **Evaluation Standard**: The candidate solution MUST immediately halt job execution before triggering audio synthesis rendering or modifying database records if tenant validation fails or if requested resources do not belong to the resolved tenant.
|
||||
* **Scoring Note**: Failing this crux criterion applies a heavy penalty to the overall score (docking all points under Narrow Correctness).
|
||||
* **Routing Note**: Charge query syntax omissions under the query scoping criteria below; charge actual execution of unauthorized audio rendering or database writes under this crux requirement.
|
||||
|
||||
- **Worker Loop Resilience**: Unhandled exceptions during individual message processing must be caught gracefully so that background worker polling loops remain active and stable.
|
||||
### Scoping Criteria: Database Query & Update Filtering
|
||||
* **Voice Cloning Handler**: All database reads and updates in `voice-cloning-job-handler` (`VoiceCloning` and `UserAudioProfile`) MUST incorporate `userId` in query filters alongside document `_id`.
|
||||
* **Speech Synthesis Handler**: All downstream reads and updates to `RecordingSalutation` and `Recording` in `voice-synthsizer-job-handler` MUST be scoped by the profile-derived `userId`.
|
||||
* **Initial Profile Lookup Exemption**: The initial lookup on `UserAudioProfile` by `_id: userAudioProfileId` is necessary to discover the tenant identity (`userId`). This initial lookup MUST NOT be penalized for lacking a `userId` parameter in its initial filter.
|
||||
|
||||
## Communication
|
||||
---
|
||||
|
||||
- **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.
|
||||
## 2. Broader Correctness / the craft of software engineering
|
||||
|
||||
## Deductions and Charge-Once Guidance
|
||||
### Worker Polling-Loop Crash Resilience
|
||||
* **Evaluation Standard**: Processing errors, tenant mismatch rejections, and database exceptions within worker handlers MUST be caught gracefully in a try-catch block so the background worker polling loop remains active and resilient.
|
||||
|
||||
- **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.
|
||||
### Inherited SQS Acknowledgment Protection
|
||||
* **Evaluation Standard**: Standard SQS message deletion and acknowledgment behavior inherited from the baseline consumer framework on completed or rejected jobs is expected queue processing functionality and MUST NOT be penalized as a security flaw or unauthorized mutation.
|
||||
|
||||
---
|
||||
|
||||
## 3. Communication
|
||||
|
||||
### Refactor Summary & Technical Clarity
|
||||
* **Evaluation Standard**: If a written summary or code documentation is provided, it MUST accurately describe the refactoring changes and multi-tenant security logic without misleading claims.
|
||||
|
||||
Reference in New Issue
Block a user