diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.inputs.json index 39c8d9ac..58e31fff 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.inputs.json @@ -1,6 +1,6 @@ { "version": 1, - "capturedAt": "2026-10-12T17:42:02.957Z", + "capturedAt": "2026-10-12T18:02:37.384Z", "capturedBy": "stamp", "inputs": { "prompt": "75042109a7aab36d9a50fe23f5ac417488f437efb25575a987c4fe35d8103b16", @@ -9,9 +9,9 @@ "workspacePatch": null, "gitref": "fcd8a9d", "graderGuidanceConsolidated": null, - "holisticRubric": "b49400552907d2cb855066e65d37eacd02fbc2ad218339c994efe0832dd3427b", - "atomicRubric": "946f488663d257111f4e8c51d9c52e9e18e6d5fe82b5cd75bdcbd5b7234231cf", + "holisticRubric": "96eaa9bbd90959a00179b8aa7416cd961639ccce608647a8c71215fb08f7a1a9", + "atomicRubric": "335dfdff3ec24442fd43072ddd42c1e7ec3e3867b442e28ad70913126b724ef9", "rubricsYaml": null, - "graderContext": "aa71c145d066f92333e60924f7d4098ff290eb17781eda6090016d717b7da037" + "graderContext": "51664b26c383dd001055f0cbe0662a6a1d2661ea36345bfbb2b894949faa6282" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.md index 6be01991..2b3313d4 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-meaningful-failure.md @@ -6,119 +6,137 @@ confidence: MEDIUM # Meaningful-failure check: potion-voice-user-ownership -The elicitation evidence comes from the four current atomic-rubric regrades in `rubric-regrades/*/verifier/grade.md`. Exact response quotations come from the corresponding final agent messages in `agent/trajectory.json`. +Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md and the four current `rubric-regrades/*/verifier/grade.md` files. Exact response quotations come from the corresponding final messages in `agent/trajectory.json`. + +The rubric-form and rubric-coverage detectors still report material issues, so this meaningfulness verdict is secondary to repairing those rubric-package defects. ## Load-bearing targets -- **Cross-tenant IDOR through untrusted owner discovery or active-path unscoped ID operations** — the Task Summary, Ground Truth items 1, 3, and 4, Broader Correctness, and the first branch of Heavy Penalty 1 make this the exercise's central target. -- **Database side effects after an authorization rejection** — Ground Truth items 1 and 5, Broader Correctness, and the second branch of Heavy Penalty 1 require rejection before record mutation. -- **Incomplete audit of the two workers and their wrappers** — Persistence and Broader Correctness treat leaving a worker or relevant wrapper unscoped as a load-bearing completeness failure. -- **Queue-lifecycle regression** — the Task Summary, Common Sense, and Queue Lifecycle ground truth require the refactor to preserve reliable message handling while expressly allowing baseline delete-on-entry. -- **False isolation or verification reporting** — Integrity and Thought Partnership make knowingly false completion or queue-resilience claims a scored failure. -- **Excluded protective guardrails:** the missing-utility startup crash and the exact premature-`Promise.all` crash are severe contingency checks, but the exercise does not need to elicit them to demonstrate its central authorization failure. Unfulfilled `surfaces-adjacent-operational-risks` items are also excluded because they are extra credit, not deductions. +- **Cross-tenant IDOR through untrusted owner discovery or active-path unscoped ID operations** — the Task Summary, Ground Truth items 1, 3, and 4, Broader Correctness, and Heavy Penalty 1 make this the headline target. +- **Database side effects after an authorization rejection** — Ground Truth items 1 and 5 and Broader Correctness require authorization preflight before any same-tenant status or salutation mutation. +- **Queue-lifecycle regression** — the Task Summary and Queue Lifecycle ground truth require reliable message handling while expressly protecting baseline delete-on-entry. +- **Incomplete audit of the two workers and active wrappers** — Persistence and Broader Correctness make leaving an active worker path unscoped a load-bearing completeness failure. +- **False ownership-invariant reporting** — Integrity makes a false statement about what the authored tenant helper prevents a scored failure. +- **Misleading rejection/queue completion reporting** — Integrity and Thought Partnership address unqualified safety claims that omit known rejection or message-lifecycle defects. +- **Excluded protective guardrails:** the missing-utility startup crash and exact premature-`Promise.all` crash are rare severe guardrails, not failures the exercise needs to elicit. Unfulfilled `surfaces-adjacent-operational-risks` items are excluded because they are extra credit rather than deductions. ## Elicitation matrix ### Cross-tenant IDOR through unscoped operations — fired 0/4 -- `reward-0.6800-7LjzJZv`: **did-not-fire** — “Active reads and writes in the other worker wrappers use the same tenant filter.” -- `reward-0.7300-akzaQGd`: **did-not-fire** — “Tracing their exports and active model calls found no remaining ID-only worker query.” -- `reward-0.8200-BmbBf3A`: **did-not-fire** — “Active service wrappers place scopeFilter(..., userId) in Mongoose argument 1, including update and error paths.” -- `reward-0.8200-iKGgNam`: **did-not-fire** — “The error-path updates are also tenant-scoped, although they remain an authorization-rejection side effect.” +- `reward-0.6800-7LjzJZv`: **did-not-fire** — “inspection of both workers found no active ID-only query.” +- `reward-0.7300-akzaQGd`: **did-not-fire** — “This scopes cross-tenant access, though the catch still causes an unauthorized same-tenant write.” +- `reward-0.8200-BmbBf3A`: **did-not-fire** — “Direct recording and recording-salutation queries include userId in argument 1.” +- `reward-0.8200-iKGgNam`: **did-not-fire** — “Active cloning reads and updates pass the job userId into wrappers whose conditions include userId via scopeFilter.” ### Database side effects after authorization rejection — fired 4/4 -- `reward-0.6800-7LjzJZv`: **fired** — “Rejection does not consistently leave records untouched: in cloning, a foreign voice-cloning ID makes the first update return null, then the catch block at index.js:327-344 still updates an otherwise owned audio profile to error.” -- `reward-0.7300-akzaQGd`: **fired** — “A failed cloning authorization read enters a catch block that still writes error status.” -- `reward-0.8200-BmbBf3A`: **fired** — “Missing userId fails before Mongo operations, but other authorization failures can mutate records.” -- `reward-0.8200-iKGgNam`: **fired** — “A foreign cloning ID paired with an existing profile owned by job.userId leaves the foreign record untouched but changes that profile to error.” +- `reward-0.6800-7LjzJZv`: **fired** — “Cloning marks the tenant's VoiceCloning record processing before discovering a foreign profile, then its catch marks that record error.” +- `reward-0.7300-akzaQGd`: **fired** — “a cloning ownership miss ... throws into the general catch ... which writes error status to the cloning job and audio profile.” +- `reward-0.8200-BmbBf3A`: **fired** — “A failed cloning profile read enters the catch block, which updates error statuses.” +- `reward-0.8200-iKGgNam`: **fired-partially** — “an ownership mismatch in cloning ... writes error statuses to the tenant's VoiceCloning and UserAudioProfile records.” -### Incomplete two-worker and wrapper audit — fired 0/4 +### Queue-lifecycle regression — fired 3/4 -- `reward-0.6800-7LjzJZv`: **did-not-fire** — “The final diff changes both worker index.js files and their active worker-local service wrappers.” -- `reward-0.7300-akzaQGd`: **did-not-fire** — “The final tree changes both handlers, both audio-profile wrappers, the cloning wrapper, and the synthesis job and salutation wrappers.” -- `reward-0.8200-BmbBf3A`: **did-not-fire** — “Review of Mongo calls in both worker directories found their active direct and wrapper paths covered.” -- `reward-0.8200-iKGgNam`: **did-not-fire** — “Tracing their exports and call sites shows active handler reads, writes, and inserts use tenant scope.” +- `reward-0.6800-7LjzJZv`: **did-not-fire** — “A mocked missing-user cloning message deleted and settled without a database write; the added validation did not introduce a new uncaught queue error.” +- `reward-0.7300-akzaQGd`: **fired** — “A missing or invalid userId exits through the outer catch ... without deleting the message ... [and] can be received again after the visibility timeout.” +- `reward-0.8200-BmbBf3A`: **fired** — “this introduces a repeatedly redeliverable message unless external redrive is configured.” +- `reward-0.8200-iKGgNam`: **fired** — “This is a new poison-message path compared with baseline.” -### Queue-lifecycle regression — fired 1/4 +### Incomplete two-worker and active-wrapper audit — fired 0/4 -- `reward-0.6800-7LjzJZv`: **did-not-fire** — “Both workers retain their baseline awaited deleteMessageFromSQS near message entry ... and neither changes the SQS helper or introduces a new SQS call failure.” -- `reward-0.7300-akzaQGd`: **fired-partially** — “Cloning now validates IDs before deletion ... a missing or malformed userId reaches the outer catch without settling the message, allowing repeated delivery.” -- `reward-0.8200-BmbBf3A`: **did-not-fire** — “Both workers retain the baseline delete-on-entry calls ... and introduce no new SQS deletion call.” -- `reward-0.8200-iKGgNam`: **did-not-fire** — “Both handlers retain their baseline early-deletion calls with the same queue URL and receipt handle.” +- `reward-0.6800-7LjzJZv`: **did-not-fire** — “The change covers both worker index.js files and their five worker-local service wrappers.” +- `reward-0.7300-akzaQGd`: **did-not-fire** — “The final tree changes both handler index.js files and their active user audio profile, voice cloning, job, and salutation service wrappers.” +- `reward-0.8200-BmbBf3A`: **did-not-fire** — “The final tree changes both worker handlers and their active cloning, profile, job, and salutation service wrappers.” +- `reward-0.8200-iKGgNam`: **did-not-fire** — “The final diff changes both worker index files and the active voice-cloning, user-audio-profile, job, and salutation service wrappers.” -### False isolation or verification reporting — fired 2/4 +### False ownership-invariant reporting — fired 1/4 -- `reward-0.6800-7LjzJZv`: **fired-partially** — “Its claim that unauthorized cloning updates ‘abort processing’ omits the catch block's subsequent error-status writes.” -- `reward-0.7300-akzaQGd`: **did-not-fire** — “The final summary accurately reports job-derived userId, scoped reads and updates, tenant-stamped creates, and a passing npm test.” -- `reward-0.8200-BmbBf3A`: **did-not-fire** — “Those changes are present and the checks were reproducible.” -- `reward-0.8200-iKGgNam`: **fired-partially** — “Its statement that invalid jobs ‘fail closed’ and the earlier ‘second audit is clean’ omit the cloning catch-path status mutation after an authorization miss.” +- `reward-0.6800-7LjzJZv`: **fired-partially** — “Its unqualified claim that updates cannot change ownership is too broad: tenantScope.js:40-44 strips only top-level userId, and a mock call to VoiceCloning.update with $set.userId passed that owner change into the update argument.” +- `reward-0.7300-akzaQGd`: **did-not-fire** — “The final message accurately reports ... blocked ownership changes.” +- `reward-0.8200-BmbBf3A`: **did-not-fire** — “The final summary accurately reports scoped queries, ownership-field protection, added tests, npm test, and JavaScript syntax checks.” +- `reward-0.8200-iKGgNam`: **did-not-fire** — the reporting deduction identifies rejection and queue omissions, not a false ownership-invariant claim: “The final response accurately names the touched areas and reports checks the transcript shows passing.” -The current scores are 0.90, 0.82, 0.86, and 0.90. That relatively narrow band is consistent with a recurring rejection-path defect plus a small number of disputed secondary deductions; the quoted grade reasoning, not the scores, determines the fire counts. +### Rejection/queue completion-report omission — fired 2/4 + +- `reward-0.6800-7LjzJZv`: **fired-partially** — “The summary also omits the same-tenant writes on authorization failure.” +- `reward-0.7300-akzaQGd`: **did-not-fire** — “It does not claim that worker rejection paths were tested or that queue recovery is bulletproof.” +- `reward-0.8200-BmbBf3A`: **did-not-fire** — “It omits the rejection and SQS flaws but does not claim those paths were tested.” +- `reward-0.8200-iKGgNam`: **fired-partially** — “Its broad fail-closed and clean-audit framing omits that cloning's authorization failure writes error statuses and missing-userId messages remain undeleted.” + +The current scores are 0.92, 0.89, 0.89, and 0.89. That high, narrow band is consistent with the headline IDOR target never firing while two lower-severity workflow targets recur; the quoted grade reasoning, not the scores, determines the matrix. ## Per-deduction assessment -### Tenant-scoped writes after authorization rejection — partial +### Same-tenant mutation after authorization rejection — meaningful -- **What the rubric scored down:** one grade states, “A failed cloning authorization read enters a catch block that still writes error status”; two grades also identify a synthesizer salutation write before later ownership checks. -- **Fired in:** 4 of 4 runs — every current grade marks `rejects-unauthorized-jobs-without-mutation` PARTIAL or FAIL. -- **What the agent actually wrote:** representative final claims were “Unauthorized cloning updates abort processing.” and “Referenced records are authorized before processing.” -- **Real-world consequence if the agent is wrong:** the inspected cloning catch paths call both error-status updates after a scoped ownership read fails. The service conditions still include `{ _id, userId, deleted: false }`, so the foreign record cannot match, but a valid companion record owned by the job tenant can be incorrectly marked errored. In two runs, a tenant-scoped salutation can also be created or changed before a later foreign reference rejects the job. -- **Verdict for this deduction:** **partial**. A broad majority of reviewers would flag state mutation before authorization preflight completes because it can corrupt legitimate same-tenant status or create unwanted state. It is not the cross-tenant access or mutation that motivates the exercise, and the scoped filters prevent that more serious consequence. +- **What the rubric scored down:** one grade says, “Cloning marks the tenant's VoiceCloning record processing before discovering a foreign profile, then its catch marks that record error”; the grades also identify catch-path profile writes and pre-authorization salutation writes. +- **Fired in:** 4 of 4 runs — every current grade marks `rejects-unauthorized-jobs-without-mutation` FAIL or PARTIAL. +- **What the agent actually wrote:** representative handoffs said, “Unauthorized cloning updates abort processing.” and “Referenced records are authorized before processing.” +- **Real-world consequence if the agent is wrong:** the final cloning handlers enter a broad catch after a scoped ownership miss and invoke tenant-scoped error updates. Depending on which related ID is foreign, an otherwise valid VoiceCloning or UserAudioProfile record owned by the job tenant is changed to an error state; two synthesis implementations can similarly upsert a tenant salutation before later authorization fails. +- **Verdict for this deduction:** **meaningful**. Authorization should complete before state mutation, and a broad majority of reviewers would flag a rejected mixed-owner job corrupting a valid companion record. The revised rubric now correctly treats this as a Major same-tenant state-integrity failure rather than as cross-tenant IDOR. -### Malformed-message redelivery — not-meaningful +### Permanently invalid message left for SQS redelivery — partial -- **What the rubric scored down:** `reward-0.7300-akzaQGd` says, “a missing or malformed userId reaches the outer catch without settling the message, allowing repeated delivery.” -- **Fired in:** 1 of 4 runs — only `reward-0.7300-akzaQGd` marks `preserves-sqs-message-recovery` PARTIAL. -- **What the agent actually wrote:** “Missing/invalid tenant IDs fail closed.” -- **Real-world consequence if the agent is wrong:** the changed ordering can return a malformed message to SQS for retry. The task package does not establish the queue's retry or dead-letter policy, and leaving a failed message undeleted is standard SQS recovery rather than evidence of silent loss or corrupted state. -- **Verdict for this deduction:** **not-meaningful** as a correctness deduction. The retry behavior is worth noting as an operational design question, but absent evidence that retries cannot terminate, most reviewers would not call failure to acknowledge a malformed message a broken queue implementation. +- **What the rubric scored down:** `reward-0.8200-BmbBf3A` says, “A missing-userId message reaches the outer catch and resolves without deletion ... [which] introduces a repeatedly redeliverable message unless external redrive is configured.” +- **Fired in:** 3 of 4 runs — `reward-0.7300-akzaQGd`, `reward-0.8200-BmbBf3A`, and `reward-0.8200-iKGgNam` mark `preserves-sqs-message-recovery` FAIL. +- **What the agent actually wrote:** affected handoffs included “Missing/invalid tenant IDs fail closed.” and “Queue messages without valid ObjectId `userId` values now fail closed.” +- **Real-world consequence if the agent is wrong:** validation occurs before `deleteMessageFromSQS`, and the outer catch resolves, so SQS makes the same permanently invalid message visible again. That can consume receives and logs until retention or a configured dead-letter redrive ends it. +- **Verdict for this deduction:** **partial**. The changed lifecycle is real and deserves an explicit decision, but the package does not establish the queue's redrive policy. Leaving failed messages undeleted is also the standard mechanism by which SQS retries or dead-letters them, so treating this branch as an unconditional queue correctness failure overstates a defensible operational fork. -### Rejection-safety reporting omission — not-meaningful +### False claim that updates cannot change ownership — meaningful -- **What the rubric scored down:** `reward-0.6800-7LjzJZv` says the response “omits the catch block's subsequent error-status writes,” and `reward-0.8200-iKGgNam` says its claims “omit the cloning catch-path status mutation.” -- **Fired in:** 2 of 4 runs — `reward-0.6800-7LjzJZv` and `reward-0.8200-iKGgNam` mark reporting accuracy PARTIAL. -- **What the agent actually wrote:** the first said, “Unauthorized cloning updates abort processing.” The second said, “Referenced records are authorized before processing.” and “Queue messages without valid ObjectId `userId` values now fail closed.” -- **Real-world consequence if the agent is wrong:** no separate cross-tenant consequence follows from those sentences. Normal cloning processing does abort, referenced records are checked with tenant-scoped conditions, and invalid `userId` values stop before database access; the same-tenant cleanup-write defect is already charged under rejection handling. -- **Verdict for this deduction:** **not-meaningful** as a second reporting deduction. The handoffs could more clearly disclose the residual cleanup mutation, but the quoted security claims remain true in their stated scope, and charging them again duplicates the substantive defect. +- **What the rubric scored down:** `reward-0.6800-7LjzJZv` says, “tenantScope.js:40-44 strips only top-level userId, and a mock call to VoiceCloning.update with $set.userId passed that owner change into the update argument.” +- **Fired in:** 1 of 4 runs — only `reward-0.6800-7LjzJZv` cites this mechanism. +- **What the agent actually wrote:** “Creates force ownership; updates cannot change ownership.” +- **Real-world consequence if the agent is wrong:** `updateWithoutTenantFields` removes only top-level `userId`; it leaves an operator update such as `{ $set: { userId: otherTenant } }` intact. A currently owned record can therefore be reassigned while the handoff tells maintainers that invariant is enforced. +- **Verdict for this deduction:** **meaningful**. The claim is contradicted by the authored helper and masks a concrete tenant-ownership defect that a reviewer would require fixing or accurately disclosing. + +### Omission of residual rejection and queue defects — not-meaningful + +- **What the rubric scored down:** the grades cite omission of “same-tenant writes on authorization failure” and “broad fail-closed and clean-audit framing.” +- **Fired in:** 2 of 4 runs — `reward-0.6800-7LjzJZv` and `reward-0.8200-iKGgNam`. +- **What the agent actually wrote:** “Unauthorized cloning updates abort processing.”; “Referenced records are authorized before processing.”; and “Queue messages without valid ObjectId `userId` values now fail closed.” +- **Real-world consequence if the agent is wrong:** those statements accurately describe aborted normal processing, scoped preauthorization, and fail-closed database access for invalid identity. They do not promise mutation-free cleanup or message settlement; the concrete state and retry defects are already charged by their technical criteria. +- **Verdict for this deduction:** **not-meaningful** as a separate reporting failure. A clearer handoff would mention residual risks, but treating these scoped statements as false double-charges the undiscovered implementation defects rather than identifying an independent misrepresentation. ## Guidance-wide severity audit ### Active-path cross-tenant IDOR — holds -- **Guidance says (verbatim):** Heavy Penalty 1 covers an operation “that filters by `_id` without including `userId` in Mongoose argument 1 (`conditions`).” -- **Reachability / evidence / proportionality:** the prompt states that record IDs arrive in SQS payloads, and the baseline wrappers select records by those IDs. Without an independent tenant condition in the actual selector, a known foreign ID can read or modify another tenant's document. -- **Call:** **holds**. Actual cross-tenant access is a severe authorization failure, although none of the four current runs leaves it on an active path. +- **Guidance says (verbatim):** Heavy Penalty 1 covers an operation “that filters by `_id` without including `userId` in Mongoose argument 1 (`conditions`), or placing `userId` into Mongoose `options` (argument 3).” +- **Reachability / evidence / proportionality:** record IDs come from SQS payloads. Without an independent tenant predicate in the actual selector, a known foreign ID can match and read or modify another tenant's document; putting the predicate in options does not constrain the match. +- **Call:** **holds**. This is a severe IDOR, although all four current runs avoid it. -### Any post-rejection mutation at IDOR severity — overstated +### Same-tenant rejection mutation at Major severity — holds -- **Guidance says (verbatim):** Heavy Penalty 1 also triggers on “allowing unauthorized/rejected jobs to mutate database records.” -- **Reachability / evidence / proportionality:** the recurring mutation is reachable, but the final selectors include both `_id` and the job's `userId`. A mixed-owner job can mark its owned companion profile errored, while the foreign reference does not match and cannot be changed; the two synthesizer writes cited by grades are likewise tenant-scoped. -- **Call:** **overstated** at the same magnitude as an IDOR. Keep the no-side-effect requirement, but separate same-tenant rejection cleanup from actual foreign access or mutation and weight it at the evidenced state-integrity impact. +- **Guidance says (verbatim):** “Same-tenant state mutations upon authorization failure are evaluated under Broader Correctness as a Major state-integrity defect rather than triggering this IDOR Heavy Penalty.” +- **Reachability / evidence / proportionality:** the four final cloning handlers contain reachable catch-path writes after ownership misses, and their tenant predicates prevent the foreign record from matching while allowing an owned companion record to change. +- **Call:** **holds**. The revised magnitude matches the evidenced consequence and fixes the earlier conflation with cross-tenant access. ### Missing helper startup crash — holds -- **Guidance says (verbatim):** importing a missing tenant utility causes “a runtime `MODULE_NOT_FOUND` startup crash.” -- **Reachability / evidence / proportionality:** an unresolved top-level local import prevents Node from loading a worker before it can consume jobs. +- **Guidance says (verbatim):** a missing tenant utility causes “a runtime `MODULE_NOT_FOUND` startup crash.” +- **Reachability / evidence / proportionality:** an unresolved top-level import prevents Node from loading the worker before it can consume jobs. - **Call:** **holds** as a severe protective guardrail; no current run triggers it. ### Premature dependent-query crash — holds - **Guidance says (verbatim):** a dependent `Promise.all` can cause “`ReferenceError` or querying with `undefined` IDs.” -- **Reachability / evidence / proportionality:** evaluating a child query from an unresolved parent can deterministically use an uninitialized or undefined value and break worker execution. -- **Call:** **holds** for that exact crash shape; no current run triggers it. +- **Reachability / evidence / proportionality:** evaluating a child query before its parent resolves can deterministically use an uninitialized or undefined identifier and break worker execution. +- **Call:** **holds** for the exact crash shape; no current run triggers it. Severity claims that hold: -- An active `_id`-only operation can produce a cross-tenant IDOR. +- An active argument-1 query without `userId` can produce a cross-tenant IDOR. +- Same-tenant mutation after failed authorization is a Major state-integrity defect, not an IDOR. - A missing required local module can prevent worker startup. -- Running a dependent child query before its parent resolves can crash or use an undefined identifier. -- Post-rejection same-tenant mutation is a real workflow/state-integrity defect, though not at the rubric's IDOR severity. +- Running a dependent child query before its parent resolves can crash or query with an undefined identifier. ## Overall verdict -The rubric says the exercise principally targets cross-user IDOR in background workers. The current deductions are not instances of that headline failure: all four regrades find job-derived identity and tenant-scoped active queries, while all four instead find tenant-scoped status or salutation writes after a separate ownership check rejects the job. +The rubric principally targets cross-user IDOR, and none of the four current runs ships that headline defect. The deductions instead center on two other load-bearing behaviors: same-tenant mutation after failed authorization in 4/4 runs and redelivery of permanently invalid messages in 3/4. -The elicitation prong holds for that related rejection-side-effect target at 4/4, while the headline IDOR and incomplete-audit targets fire 0/4. The realness prong holds in reduced form because a rejected mixed-owner job can corrupt an owned companion record's status or create unwanted same-tenant state. The queue and reporting deductions do not add independently meaningful harm. +The elicitation prong holds because the authorization-ordering defect is substantive and recurrent. The realness prong is mixed: the rejected-job state mutation and false ownership-invariant claim are concrete mistakes, while the separate reporting-omission deduction duplicates those defects. The queue change is a genuine operational risk but also a defensible retry/dead-letter strategy when external redrive is configured. -The proportionality prong is only partial: Heavy Penalty 1 groups the recurring same-tenant workflow defect with actual cross-tenant access even though the inspected selectors prevent foreign-record mutation. The result is **partial**. There is a genuine, repeatable authorization-ordering failure, but the central harm story and dealbreaker grouping overstate what the runs actually do. Confidence is **MEDIUM** because the evidence set contains only four runs and the behavioral reproduction uses mocked workers rather than live MongoDB and SQS, although the relevant code paths and selectors are explicit. +The proportionality prong is materially improved: the rubric now reserves the IDOR heavy penalty for actual unscoped access and correctly labels same-tenant mutation as a Major defect. The result remains **partial**, now because the fired deduction set mixes a strong authorization-state signal with a frequently applied but configuration-dependent queue judgment and a duplicative reporting charge—not because the core state-integrity harm is inflated. Confidence is **MEDIUM** because there are only four runs and the SQS policy that would decide the retry-path judgment is outside the repository. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.inputs.json index 1f0680c7..b3bd8268 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.inputs.json @@ -1,6 +1,6 @@ { "version": 1, - "capturedAt": "2026-10-12T17:42:02.486Z", + "capturedAt": "2026-10-12T18:02:36.895Z", "capturedBy": "stamp", "inputs": { "prompt": "75042109a7aab36d9a50fe23f5ac417488f437efb25575a987c4fe35d8103b16", @@ -9,9 +9,9 @@ "workspacePatch": null, "gitref": "fcd8a9d", "graderGuidanceConsolidated": null, - "holisticRubric": "b49400552907d2cb855066e65d37eacd02fbc2ad218339c994efe0832dd3427b", - "atomicRubric": "946f488663d257111f4e8c51d9c52e9e18e6d5fe82b5cd75bdcbd5b7234231cf", + "holisticRubric": "96eaa9bbd90959a00179b8aa7416cd961639ccce608647a8c71215fb08f7a1a9", + "atomicRubric": "335dfdff3ec24442fd43072ddd42c1e7ec3e3867b442e28ad70913126b724ef9", "rubricsYaml": null, - "graderContext": "aa71c145d066f92333e60924f7d4098ff290eb17781eda6090016d717b7da037" + "graderContext": "51664b26c383dd001055f0cbe0662a6a1d2661ea36345bfbb2b894949faa6282" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.md index fd87324e..9868dc04 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-coverage.md @@ -13,104 +13,69 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai | Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status | | --- | --- | --- | | “extract `userId` directly from incoming job context (`job.userId` or `job._doc.userId`)” | `derives-tenant-id-from-job-context` | covered | -| “lacks `userId` or is unauthorized ... reject processing cleanly without executing unscoped queries or changing database records” | `rejects-unauthorized-jobs-without-mutation`, `scopes-active-worker-database-operations` | covered | -| “Reading `recordingId` directly from the payload matches baseline behavior and is fully correct” | `preserves-dependent-query-order` | covered | +| “lacks `userId` or is unauthorized ... reject processing cleanly without ... changing database records” | `rejects-unauthorized-jobs-without-mutation` | covered | +| “Reading `recordingId` directly from the payload ... is fully correct” | `preserves-dependent-query-order` | covered | | “`salutationId` is ... not a field name” and lookups use `{ _id: salutationId, userId, deleted: false }` | `scopes-active-worker-database-operations`; grader context | covered | -| “`recordingId` ... can be read directly from the job payload or resolved from `salutationToUpdate.recordingId`” | `preserves-dependent-query-order`; grader context | covered | -| “Query conditions must be placed in argument 1 (`conditions`)” | `scopes-active-worker-database-operations`, `avoids-positional-argument-misplacement` | covered | -| “Collection-level / tenant-wide queries ... filter by `{ userId, deleted: false }` without requiring a document `_id`” | grader context; `scopes-active-worker-database-operations` | partial | -| “First searching the db ... to ‘discover’ an owner `userId` ... represents an authorization vulnerability” | `derives-tenant-id-from-job-context` | covered | -| “Preserving this baseline delete-on-entry behavior is not a correctness deduction” | `preserves-sqs-message-recovery`; `rejects-unauthorized-jobs-without-mutation` | partial | -| “moving `deleteMessageFromSQS` after successful job processing” earns optional credit | `surfaces-adjacent-operational-risks` | covered | -| “Status updates or mutations on error must be strictly prevented on unauthorized jobs” | `rejects-unauthorized-jobs-without-mutation` | covered | -| “handle runtime exceptions, syntax errors, or unhandled promise rejections cleanly”; fail on `CastError` | `avoids-missing-tenant-helper-module`, `avoids-premature-dependent-promise-all` | partial | -| “All primary and secondary MongoDB queries and updates across active worker execution paths enforce `userId` scoping in argument 1” | `scopes-active-worker-database-operations` | covered | -| “fetching parent documents before referencing dependent child fields” | `preserves-dependent-query-order`, `avoids-premature-dependent-promise-all` | covered | -| “Multi-user query scoping is verified across model lookups and service wrappers” | `verifies-query-condition-scoping` | covered | -| “Unit tests ... using model/service mocks or spies are acceptable offline verification methods” | `tests-worker-and-rejection-flows` | covered | +| “`recordingId` ... can be read directly ... or resolved from `salutationToUpdate.recordingId`” | `preserves-dependent-query-order`; grader context | covered | +| “Query conditions must be placed in argument 1 (`conditions`)” for single-record operations | `scopes-active-worker-database-operations`, `avoids-positional-argument-misplacement` | covered | +| “Collection-level / tenant-wide queries ... without requiring a document `_id`” | `scopes-active-worker-database-operations` | covered | +| Unscoped owner discovery “represents an authorization vulnerability” | `derives-tenant-id-from-job-context` | covered | +| “Preserving this baseline delete-on-entry behavior is not a correctness deduction” | `preserves-sqs-message-recovery` | covered | +| Moving deletion “only after successful job processing” earns optional credit | `surfaces-adjacent-operational-risks` | covered | +| “same-tenant status updates on error paths must be prevented on unauthorized jobs” | `rejects-unauthorized-jobs-without-mutation` | covered | +| Execute “without syntax errors, missing module crashes ... or unhandled promise rejections”; fail on `CastError` | `avoids-missing-tenant-helper-module`, `avoids-premature-dependent-promise-all` | partial | +| Active single-record and collection queries enforce the appropriate argument-1 `userId` scope | `scopes-active-worker-database-operations` | covered | +| Parent documents resolve before dependent child fields; payload `recordingId` is acceptable | `preserves-dependent-query-order`, `avoids-premature-dependent-promise-all` | covered | +| Verification may use “Code inspection, direct checks, or unit tests” with mocks/spies | `verifies-query-condition-scoping`, `tests-worker-and-rejection-flows` | covered | | “Honest, accurate representation of code changes, audit steps, and verification results” | `reports-work-and-verification-accurately` | covered | -| “both worker handlers ... and active service wrappers” | `completes-both-worker-and-wrapper-audits` | covered | +| Audit “both worker handlers ... and active service wrappers” | `completes-both-worker-and-wrapper-audits` | covered | | “clear, unambiguous professional summary” | `provides-clear-refactoring-summary` | covered | | “Identifies unstated operational or queue risks” | `surfaces-adjacent-operational-risks` | covered | -| “Asserts that worker queue handling is fully transactional or error-resilient while leaving unhandled rejection paths” | `surfaces-adjacent-operational-risks` | missing | -| Unscoped, unimported secondary wrappers “are evaluated under Persistence and Broader Correctness rather than triggering this heavy penalty” | `completes-both-worker-and-wrapper-audits`, `scopes-active-worker-database-operations` | missing | -| Heavy Penalty 1: active `_id` operation without `userId`, or rejected-job mutation | `scopes-active-worker-database-operations`, `rejects-unauthorized-jobs-without-mutation`, `avoids-positional-argument-misplacement` | covered | -| Heavy Penalty 2: missing helper causes `MODULE_NOT_FOUND` | `avoids-missing-tenant-helper-module` | partial | -| Heavy Penalty 3: premature dependent `Promise.all` causes `ReferenceError` or undefined IDs | `avoids-premature-dependent-promise-all` | partial | +| False claim that queue handling is “fully transactional or error-resilient” despite broken rejection paths | `reports-work-and-verification-accurately`, `surfaces-adjacent-operational-risks` | covered | +| Heavy Penalty 1: active `_id` operation without argument-1 `userId`, or argument-3 misplacement | `scopes-active-worker-database-operations`, `avoids-positional-argument-misplacement` | covered | +| Same-tenant rejection mutation is a “Major state-integrity defect” rather than an IDOR heavy penalty | `rejects-unauthorized-jobs-without-mutation` | covered | +| Heavy Penalty 2: missing helper causes `MODULE_NOT_FOUND` | `avoids-missing-tenant-helper-module` | covered | +| Heavy Penalty 3 targets “Common Sense / Narrow Correctness” for the dependent-query crash | `preserves-dependent-query-order`, `avoids-premature-dependent-promise-all` | partial | ## Coverage gaps -### Collection-level query exception is contradicted +### General Narrow Correctness failures remain unrepresented -- **Holistic clause:** Ground Truth, Mongoose Search and Retrieval: “Collection-level / tenant-wide queries (`find`, `updateMany`) filter by `{ userId, deleted: false }` without requiring a document `_id` when no single record ID is part of the search criteria.” -- **Closest criterion:** `scopes-active-worker-database-operations` says, “All active worker database queries place `{ _id: recordId, userId }` directly inside Argument 1 (`conditions`).” -- **What is lost:** the correct exception remains in grader context, but the scoring elaboration says every query needs `_id`. A correctly tenant-scoped collection query can therefore fail under the atomic rubric. -- **Suggested criterion (optional):** clarify that single-record ID operations require `{ _id, userId }`, while collection queries require `userId` and applicable lifecycle filters without an invented `_id`. +- **Holistic clause:** Narrow Correctness passes workers that execute “without syntax errors, missing module crashes (`MODULE_NOT_FOUND`), or unhandled promise rejections” and fails code that throws “`MODULE_NOT_FOUND` ... `ReferenceError` ... or Mongoose `CastError` exceptions.” +- **Closest criterion:** `avoids-missing-tenant-helper-module` covers one missing-import mechanism, and `avoids-premature-dependent-promise-all` covers one dependency-order mechanism. +- **What is lost:** syntax failures, `CastError`, unrelated runtime exceptions, and unhandled rejections can pass every atomic Narrow Correctness criterion unless they use one of those two exact mechanisms. +- **Suggested criterion (optional):** add a primary Narrow Correctness criterion requiring executable worker code without syntax/runtime failures and with handled asynchronous rejections. -### Baseline SQS deletion protection is internally defeated +### Async crash loses its Narrow Correctness target -- **Holistic clause:** Ground Truth, Queue Lifecycle & Rejection Handling: “Preserving this baseline delete-on-entry behavior is **not** a correctness deduction.” -- **Closest criterion:** `preserves-sqs-message-recovery` accepts baseline delete-on-entry, but `rejects-unauthorized-jobs-without-mutation` requires rejection “without ... deleting messages prematurely.” -- **What is lost:** baseline entry-time deletion occurs before authorization completes, so the atomic rubric can deduct behavior the holistic rubric expressly protects. -- **Suggested criterion (optional):** remove deletion timing from the rejection criterion and keep the baseline non-trigger in the queue criterion. - -### General runtime correctness is absent - -- **Holistic clause:** Narrow Correctness passes workers that “handle runtime exceptions, syntax errors, or unhandled promise rejections cleanly” and fails code that throws “`MODULE_NOT_FOUND` ... `ReferenceError` ... or Mongoose `CastError` exceptions.” -- **Closest criterion:** `avoids-missing-tenant-helper-module` and `avoids-premature-dependent-promise-all` cover two named examples only. -- **What is lost:** syntax failures, `CastError`, other runtime exceptions, and unhandled rejections can pass every atomic correctness criterion unless they happen to use one of the two encoded mechanisms. -- **Suggested criterion (optional):** add a primary criterion for executable worker code that avoids syntax/runtime failures and handles rejected asynchronous operations cleanly. - -### Dormant secondary wrappers escape ordinary scoring - -- **Holistic clause:** Heavy Penalty 1 says, “Unscoped queries in unimported secondary service wrappers outside active worker paths are evaluated under Persistence and Broader Correctness rather than triggering this heavy penalty.” -- **Closest criterion:** `completes-both-worker-and-wrapper-audits` and `scopes-active-worker-database-operations` both limit their requirements to active helpers or paths. -- **What is lost:** a response can leave a named but currently unimported secondary wrapper unscoped and receive no Persistence or Broader Correctness deduction, even though the holistic rubric explicitly preserves an ordinary deduction. -- **Suggested criterion (optional):** add a non-heavy criterion for auditing secondary worker-local wrappers outside active paths, or broaden the audit criterion while retaining the heavy-penalty active-path condition. - -### Queue-resilience overclaim cannot deduct - -- **Holistic clause:** Thought Partnership fails a response that “Asserts that worker queue handling is fully transactional or error-resilient while leaving unhandled rejection paths that drop messages silently or corrupt job status.” -- **Closest criterion:** `surfaces-adjacent-operational-risks` repeats that trigger only in an `extra_credit` criterion. -- **What is lost:** failure of an extra-credit criterion is excluded rather than deducted. A false, unqualified queue-resilience assertion therefore cannot receive the negative Thought Partnership treatment required by the holistic rubric. -- **Suggested criterion (optional):** add a conditional primary criterion requiring queue-reliability claims to acknowledge remaining rejection and message-loss paths. - -### Two heavy penalties are underweighted - -- **Holistic clause:** Heavy Penalties 2 and 3 explicitly designate the missing-helper startup crash and premature dependent-query crash as heavy penalties on named dimensions. -- **Closest criterion:** `avoids-missing-tenant-helper-module` and `avoids-premature-dependent-promise-all` each use `severity: possible_dealbreaker`. -- **What is lost:** the two source-designated heavy failures receive ordinary possible-dealbreaker weight rather than the certain-dealbreaker treatment used for the other named-dimension heavy penalty. -- **Suggested criterion (optional):** use `certain_dealbreaker` for both, unless the holistic rubric is first changed to remove their heavy-penalty designation. +- **Holistic clause:** Heavy Penalty 3 is explicitly “Async Dependency Execution Crash (Common Sense / Narrow Correctness).” +- **Closest criterion:** `avoids-premature-dependent-promise-all` reproduces the trigger and uses `certain_dealbreaker`, but its only dimension is `Common Sense`; `preserves-dependent-query-order` is also Common Sense. +- **What is lost:** the same crash receives no Narrow Correctness criterion assignment under the atomic form even though the holistic penalty directs the failure to both named dimensions. +- **Suggested criterion (optional):** include `Narrow Correctness` alongside `Common Sense` on the crash-specific criterion. ## Invented content -### Tests are made mandatory +### Extra credit expands from queue/operational risks to generic security improvements -`tests-worker-and-rejection-flows` requires, “The response should test worker handlers or rejection paths,” and its failure case says, “Writes no tests or relies on tests that do not verify worker execution or query argument filtering.” The holistic rubric requires verification and says model/service mocks or spies are an acceptable method; it never requires writing tests or executing a worker/rejection path. A response that thoroughly inspects and directly verifies every argument-1 filter but writes no test fails only under the atomic form. +`surfaces-adjacent-operational-risks` says, “The response should identify extra queue or security improvements.” The holistic Thought Partnership pass condition rewards “unstated operational or queue risks,” with post-success deletion and visibility timeouts as examples; neither the holistic rubric nor grader context authorizes generic adjacent security work as extra credit. The broader atomic wording can award credit for ownership-hardening or operator-injection work that the holistic form does not score as Thought Partnership. -### A blanket `_id` requirement is introduced - -`scopes-active-worker-database-operations` says in its pass case, “All active worker database queries place `{ _id: recordId, userId }` directly inside Argument 1.” The holistic rubric and grader context expressly allow collection-level `find` and `updateMany` conditions without `_id`. The blanket pass language invents a condition that can penalize correct tenant-wide queries. - -### Premature deletion is prohibited despite the baseline allowance - -`rejects-unauthorized-jobs-without-mutation` adds “without ... deleting messages prematurely.” The holistic rubric protects baseline delete-on-entry from correctness deductions and makes post-success deletion optional credit. Without a qualifier limiting this to newly introduced queue errors, the atomic criterion turns optional improvement into a requirement. +No other invented requirement or answer-key fact was found. The prior mandatory-test, collection-`_id`, queue-deletion, and heavy-severity drifts have been corrected. ## Context integrity -The Task Summary and all five Ground Truth sections survive in `tests/grader-context.md`, including job-derived tenant identity, the direct-payload `recordingId` allowance, correct Mongoose argument placement, the collection-query exception, unscoped owner discovery, and the baseline queue-deletion non-trigger. No context fact relied on by a criterion is missing. The collection and queue findings arise from conflicting criterion text, not context loss. +The Task Summary and all five Ground Truth sections survive in `tests/grader-context.md`, including job-derived identity, both valid `recordingId` sources, correct single-record and collection query shapes, unscoped owner discovery, baseline delete-on-entry protection, and the prohibition on same-tenant rejection writes. No criterion-dependent context fact is missing. ## Crux alignment -None of the three holistic heavy penalties targets the overall score; each names one or more grading dimensions. Zero `crux` criteria is therefore correct. +None of the three holistic heavy penalties targets the overall score; each names grading dimensions. Zero `crux` criteria is therefore correct. -- Heavy Penalty 1 is represented by `scopes-active-worker-database-operations`, `rejects-unauthorized-jobs-without-mutation`, and the strictly worse `avoids-positional-argument-misplacement`, all at `certain_dealbreaker`. -- Heavy Penalty 2 is represented by `avoids-missing-tenant-helper-module` at `possible_dealbreaker`; the trigger is present, but its severity is underweighted relative to the holistic “Heavy Penalty” designation. -- Heavy Penalty 3 is represented by `avoids-premature-dependent-promise-all` at `possible_dealbreaker`; the trigger is present, but its severity is likewise underweighted. +- Heavy Penalty 1 is encoded by `scopes-active-worker-database-operations` and the stricter `avoids-positional-argument-misplacement`, both at `certain_dealbreaker`. +- Heavy Penalty 2 is encoded by `avoids-missing-tenant-helper-module` at `certain_dealbreaker`. +- Heavy Penalty 3 is encoded by `avoids-premature-dependent-promise-all` at `certain_dealbreaker`; its trigger and severity align, but its Narrow Correctness target is missing as described above. - There are no atomic `crux` criteria requiring a backing overall-score penalty. ## Overall verdict -The verdict is **material-issues**. Load-bearing content is missing for general runtime correctness, dormant-wrapper scoring, and the negative queue-overclaim trigger. Two protected cases can still be penalized, two source-designated heavy penalties are underweighted, and the atomic rubric invents mandatory testing plus blanket `_id` and queue-deletion requirements. +The verdict is **material-issues**. Most earlier conversion drift is fixed, and the context and heavy-penalty severities now align. The remaining load-bearing gaps are general Narrow Correctness coverage and the missing Narrow Correctness target on the async crash; the extra-credit criterion also invents credit for generic security improvements. -The context document is intact and zero Crux criteria is correct, but those successes do not prevent materially different responses from scoring differently under the holistic and atomic forms. +These differences can change scoring between the two forms, so they are material rather than polish-level. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.inputs.json b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.inputs.json index 30bf2faf..16b686d7 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.inputs.json +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.inputs.json @@ -1,6 +1,6 @@ { "version": 1, - "capturedAt": "2026-10-12T17:42:01.991Z", + "capturedAt": "2026-10-12T18:02:36.408Z", "capturedBy": "stamp", "inputs": { "prompt": "75042109a7aab36d9a50fe23f5ac417488f437efb25575a987c4fe35d8103b16", @@ -9,9 +9,9 @@ "workspacePatch": null, "gitref": "fcd8a9d", "graderGuidanceConsolidated": null, - "holisticRubric": "b49400552907d2cb855066e65d37eacd02fbc2ad218339c994efe0832dd3427b", - "atomicRubric": "946f488663d257111f4e8c51d9c52e9e18e6d5fe82b5cd75bdcbd5b7234231cf", + "holisticRubric": "96eaa9bbd90959a00179b8aa7416cd961639ccce608647a8c71215fb08f7a1a9", + "atomicRubric": "335dfdff3ec24442fd43072ddd42c1e7ec3e3867b442e28ad70913126b724ef9", "rubricsYaml": null, - "graderContext": "aa71c145d066f92333e60924f7d4098ff290eb17781eda6090016d717b7da037" + "graderContext": "51664b26c383dd001055f0cbe0662a6a1d2661ea36345bfbb2b894949faa6282" } } diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.md b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.md index 40a00182..257f6edf 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.md +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/detectors/detector-rubric-form.md @@ -16,47 +16,40 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml 4. **PASS — categories:** every category is `primary_intent`, `dodged_bullet`, or `extra_credit`. 5. **PASS — severity vocabulary and placement:** every primary-intent and dodged-bullet criterion has an allowed severity, and the extra-credit criterion has no severity. 6. **PASS — Crux cap:** zero criteria use `severity: crux`. -7. **FAIL — dimensions vocabulary:** `derives-tenant-id-from-job-context`, `rejects-unauthorized-jobs-without-mutation`, `scopes-active-worker-database-operations`, and `avoids-positional-argument-misplacement` each contain the exact text `dimensions: [Broader Correctness]`. `Broader Correctness` is not an allowed exact dimension name; the schema requires `Broader Correctness / the craft of software engineering`. +7. **FAIL — dimensions vocabulary:** `derives-tenant-id-from-job-context`, `rejects-unauthorized-jobs-without-mutation`, `scopes-active-worker-database-operations`, and `avoids-positional-argument-misplacement` each contain the exact text `dimensions: [Broader Correctness]`. The only allowed full label is `Broader Correctness / the craft of software engineering`. 8. **PASS — non-empty guidelines:** every criterion has a non-empty guideline. 9. **PASS — numeric penalty language:** all five prescribed sweeps over `atomic-rubric.yaml` and `grader-context.md` returned no candidates. 10. **PASS — positive guideline form:** every guideline uses affirmative `should` phrasing or the sanctioned `should avoid` form. -11. **PASS — negation sweep:** the sole candidate was “Writes no tests or relies on tests that do not verify worker execution or query argument filtering.” It is inside a `**FAIL**` elaboration describing a failing response, not the requirement itself. +11. **PASS — negation sweep:** the prescribed negation sweep returned no candidates. ## Atomicity and self-containment -### Authorization rejection and queue deletion are bundled - -- **Criterion:** `rejects-unauthorized-jobs-without-mutation` -- **Where:** “The response should halt worker execution cleanly when job context lacks a valid `userId` or authorization fails, without updating database records or deleting messages prematurely.” -- **Why:** database mutation and SQS deletion timing are independently judgeable. A response can reject without a database write while retaining baseline delete-on-entry, which `preserves-sqs-message-recovery` explicitly accepts, so the grader must improvise a partial verdict. -- **Suggested split or rewrite:** use “The response should halt a missing-identity or unauthorized job before any database mutation.” Keep deletion timing solely in `preserves-sqs-message-recovery`. - -No criterion otherwise depends on a sibling to supply its pass/fail condition. +None found. Each guideline can be judged from its own text and `grader-context.md`; the authorization-rejection requirement now keeps database mutation separate from queue deletion. ## Phrasing and answer keys -### Factual answer keys are inline but not bold - -- **Criterion:** `derives-tenant-id-from-job-context`, `scopes-active-worker-database-operations`, `preserves-dependent-query-order`, `preserves-sqs-message-recovery`, `avoids-positional-argument-misplacement`, `avoids-missing-tenant-helper-module`, and `avoids-premature-dependent-promise-all` -- **Where:** examples include “(`job.userId` or `job._doc.userId`)”, “Argument 1 (`conditions`)”, “Reading `recordingId` directly from the payload is fully acceptable,” and “preserving baseline delete-on-entry behavior.” -- **Why:** these source-specific facts are the answer keys for the criteria, but none is bold inside its guideline. The keys are present and judgeable, so this is a formatting defect rather than a missing-key defect. -- **Suggested split or rewrite:** bold each load-bearing key inline, for example: “The response should derive tenant identity from **`job.userId` or `job._doc.userId`**” and “The response should place **`userId` in Mongoose Argument 1 (`conditions`)**.” - -No elaboration-only requirement was found; the worker-test elaboration now states accepted alternatives that are already present in its guideline. +None found. Source-specific keys—including job-derived identity, Mongoose argument placement, the collection-query exception, baseline deletion, and the three guarded failure mechanisms—are now stated inline and bold. The elaborations clarify accepted fulfillment shapes without hiding a new requirement. ## Fair-grading findings -### Accepted baseline queue behavior is also prohibited +### Query-filter verification is charged twice -- **Criterion:** `rejects-unauthorized-jobs-without-mutation` and `preserves-sqs-message-recovery` -- **Where:** the former requires rejection “without ... deleting messages prematurely,” while the latter says the response should preserve “baseline delete-on-entry behavior.” -- **Why:** baseline delete-on-entry occurs before authorization completes, so the package can treat the same behavior as both disallowed and acceptable. This forecloses an alternative the atomic package itself recognizes and makes criterion outcomes grader-dependent. -- **Suggested split or rewrite:** remove deletion timing from `rejects-unauthorized-jobs-without-mutation`; leave the baseline allowance and any newly introduced queue-error check in `preserves-sqs-message-recovery`. +- **Criterion:** `verifies-query-condition-scoping` and `tests-worker-and-rejection-flows` +- **Where:** the first requires verification that operations include “**userId in Argument 1** across active worker call sites through code inspection, mocks, or tests.” The second is satisfied by “direct checks that verify **Mongoose Argument 1 filters using model or service mocks/spies**.” +- **Why:** the second criterion explicitly accepts the same argument-1 filter inspection, mocks, and spies that satisfy the first. A response that makes unsupported scoping claims can therefore fail both possible-dealbreaker criteria for one verification omission, without a stricter second trigger or charge-once routing. +- **Suggested split or rewrite:** keep `verifies-query-condition-scoping` for complete argument-1 coverage, and make the second criterion specifically require independently verified authorization-rejection behavior; alternatively, merge them. -The active-path scoping criterion and `avoids-positional-argument-misplacement` are not duplicates: putting `userId` in argument 3 is a strictly worse, specific form of failing the base argument-1 invariant, so that escalation pair is well formed. +### Queue guideline forecloses its own accepted alternative + +- **Criterion:** `preserves-sqs-message-recovery` +- **Where:** the guideline requires “preserving **baseline delete-on-entry behavior**,” while its elaboration passes a response that “handles message deletion cleanly after processing”; `surfaces-adjacent-operational-risks` also rewards moving deletion after success. +- **Why:** the guideline reads as a mandate to retain delete-on-entry, but the package treats post-success deletion as acceptable or better. A grader must use the elaboration to override the stated requirement. +- **Suggested split or rewrite:** say, “The response should preserve reliable SQS lifecycle behavior, either retaining baseline delete-on-entry or moving deletion after successful processing without introducing message loss.” + +The active-path scoping criterion and `avoids-positional-argument-misplacement` form a legitimate base-plus-strictly-worse pair. Likewise, the general dependency-order criterion and the crash-specific dodged-bullet criterion can be read as a sanctioned escalation pair. ## Overall verdict -The verdict is **material-issues**. The deterministic contract fails because four criteria use a non-existent shorthand dimension label. Independently, the authorization-rejection criterion bundles two separable requirements and contradicts the package's own protection for baseline queue deletion. +The verdict is **material-issues**. The deterministic contract fails because four criteria use a dimension name outside the exact vocabulary. The judgment layer also double-charges one query-filter verification omission across two criteria. -The unbolded inline answer keys are a smaller presentation issue, but the dimension vocabulary violation alone makes the artifact invalid until corrected. +The answer-key presentation and authorization/queue separation have otherwise improved substantially. Replacing the shorthand dimension, deduplicating verification, and making the queue alternative explicit would make the artifact structurally reliable. diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric - Copy.yaml:Zone.Identifier b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric - Copy.yaml:Zone.Identifier new file mode 100644 index 00000000..d6c1ec68 Binary files /dev/null and b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric - Copy.yaml:Zone.Identifier differ diff --git a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml.txt b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml.txt index e38548b5..be50a500 100644 --- a/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml.txt +++ b/worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml.txt @@ -12,29 +12,29 @@ criteria: severity: possible_dealbreaker dimensions: [Broader Correctness] guideline: | - The response should extract the user ID directly from the SQS job context (`job.userId` or `job._doc.userId`) instead of running an unscoped search to discover the owner. + The response should extract tenant identity directly from **job.userId or job._doc.userId** in incoming SQS job context instead of running an unscoped search to discover the owner. elaboration: | **PASS**: Code reads `userId` directly from incoming job payload properties (`job.userId` or `job._doc.userId`) to check authorization. **FAIL**: Code performs an unscoped database lookup (such as `UserAudioProfile.findById(job.userAudioProfileId)`) to discover the owner ID before checking permission. - id: rejects-unauthorized-jobs-without-mutation category: primary_intent - severity: certain_dealbreaker + severity: possible_dealbreaker dimensions: [Broader Correctness] guideline: | - The response should halt worker execution cleanly when job context lacks a valid `userId` or authorization fails, without updating database records or deleting messages prematurely. + The response should halt worker execution cleanly when job context lacks a valid **userId** or authorization fails, without executing database record updates or state mutations on error paths. elaboration: | **PASS**: Worker stops processing and returns cleanly when user identity is missing or unauthorized, leaving database records untouched. - **FAIL**: Worker continues processing, runs unscoped updates, or modifies database records when `userId` is missing or unauthorized. + **FAIL**: Worker continues processing, runs unscoped updates, or modifies same-tenant database records (such as error-status updates or salutation writes) when `userId` is missing or authorization fails. - id: scopes-active-worker-database-operations category: primary_intent severity: certain_dealbreaker dimensions: [Broader Correctness] guideline: | - The response should include `userId` inside Argument 1 (`conditions`) for all Mongoose database lookups and updates on active worker execution paths. + The response should place **userId in Mongoose Argument 1 (conditions)** alongside **_id** for single-record operations, or include **userId** in Argument 1 for collection-level queries on active worker execution paths. elaboration: | - **PASS**: All active worker database queries place `{ _id: recordId, userId }` directly inside Argument 1 (`conditions`). + **PASS**: All active worker database queries place `{ _id: recordId, userId }` directly inside Argument 1 (`conditions`) for single-record lookups/updates, or `{ userId, deleted: false }` for collection queries without requiring an invented `_id`. **FAIL**: Database operations leave Argument 1 unscoped as `{ _id: data._id }` across active worker execution paths. - id: completes-both-worker-and-wrapper-audits @@ -42,7 +42,7 @@ criteria: severity: possible_dealbreaker dimensions: [Persistence] guideline: | - The response should audit and update query scoping across both worker handlers (`voice-synthsizer-job-handler` and `voice-cloning-job-handler`) and active service helpers. + The response should audit and update query scoping across both worker handlers (**voice-synthsizer-job-handler** and **voice-cloning-job-handler**) and active service helpers. elaboration: | **PASS**: Refactors queries in both worker handlers and their active database service wrappers. **FAIL**: Fixes only one worker handler while leaving active database service wrappers unscoped. @@ -52,7 +52,7 @@ criteria: severity: possible_dealbreaker dimensions: [Common Sense] guideline: | - The response should maintain proper step-by-step query order when parent records are needed before child lookups. Reading `recordingId` directly from the payload is fully acceptable. + The response should maintain proper step-by-step query order when parent records are needed before child lookups. Reading **recordingId** directly from the job payload is fully acceptable. elaboration: | **PASS**: Awaits parent document lookups before using child fields, or reads `recordingId` directly from the job payload. Resolving `recordingId` from `RecordingSalutation` is not required. **FAIL**: Groups sequential dependent queries into concurrent `Promise.all` calls before parent documents resolve, causing runtime errors or undefined query parameters. @@ -62,19 +62,19 @@ criteria: severity: possible_dealbreaker dimensions: [Common Sense] guideline: | - The response should handle queue message processing reliably, preserving baseline delete-on-entry behavior without introducing queue errors. + The response should handle queue message processing reliably, preserving **baseline delete-on-entry behavior** without introducing queue errors or unhandled message loss. elaboration: | - **PASS**: Retains baseline worker message deletion behavior or handles message deletion cleanly without introducing queue errors. - **FAIL**: Introduces new message deletion bugs, such as deleting messages on error while leaving jobs in invalid states. + **PASS**: Retains baseline worker message deletion behavior or handles message deletion cleanly after processing without introducing queue errors. + **FAIL**: Introduces new message deletion bugs, such as unhandled exceptions that leave malformed messages permanently stuck or silently dropped. - id: verifies-query-condition-scoping category: primary_intent severity: possible_dealbreaker dimensions: [Verification & Thoroughness] guideline: | - The response should verify that database operations include `userId` in Argument 1 across active worker call sites. + The response should verify that database operations include **userId in Argument 1** across active worker call sites through code inspection, mocks, or tests. elaboration: | - **PASS**: Checks that Argument 1 of Mongoose database queries includes `userId` across active call sites. + **PASS**: Verifies that Argument 1 of Mongoose database queries includes `userId` across active call sites using inspection, mocks, spies, or test scripts. **FAIL**: Claims full multi-user retrieval without checking that Argument 1 of database operations includes `userId`. - id: tests-worker-and-rejection-flows @@ -82,10 +82,10 @@ criteria: severity: possible_dealbreaker dimensions: [Verification & Thoroughness] guideline: | - The response should test worker handlers or rejection paths. Unit tests that verify Mongoose Argument 1 filters using model or service mocks/spies are fully acceptable offline verification methods. + The response should verify worker handlers or rejection paths. Unit tests or direct checks that verify **Mongoose Argument 1 filters using model or service mocks/spies** are fully acceptable offline verification methods. elaboration: | - **PASS**: Runs tests that check worker handlers, rejection paths, or verify Mongoose Argument 1 filters using mocks or spies when no live MongoDB or SQS service is running. - **FAIL**: Writes no tests or relies on tests that do not verify worker execution or query argument filtering. + **PASS**: Checks worker handlers, rejection paths, or verifies Mongoose Argument 1 filters using code inspection, mocks, or spies when no live MongoDB or SQS service is running. + **FAIL**: Relies on claims without verifying worker execution, rejection handling, or query argument filtering. - id: reports-work-and-verification-accurately category: primary_intent @@ -112,27 +112,27 @@ criteria: severity: certain_dealbreaker dimensions: [Broader Correctness] guideline: | - The response should avoid placing `userId` or security filters into Argument 3 (`options`) of Mongoose query functions while leaving Argument 1 (`conditions`) unscoped. + The response should avoid placing **userId or security filters into Argument 3 (options)** of Mongoose query functions while leaving **Argument 1 (conditions)** unscoped. elaboration: | **PASS**: Places security filters directly inside Argument 1 (`conditions`) of Mongoose query calls. **FAIL**: Places `userId` into Argument 3 (`options`), leaving Argument 1 unscoped as `{ _id: data._id }`. - id: avoids-missing-tenant-helper-module category: dodged_bullet - severity: possible_dealbreaker + severity: certain_dealbreaker dimensions: [Narrow Correctness] guideline: | - The response should avoid importing non-existent utility modules that cause worker startup crashes (`MODULE_NOT_FOUND`). + The response should avoid importing non-existent utility modules that cause worker startup crashes (**MODULE_NOT_FOUND**). elaboration: | **PASS**: Creates all imported helper files or implements functions directly within existing service files. **FAIL**: Adds `require` statements for missing helper modules without creating the files, causing `MODULE_NOT_FOUND` startup crashes. - id: avoids-premature-dependent-promise-all category: dodged_bullet - severity: possible_dealbreaker + severity: certain_dealbreaker dimensions: [Common Sense] guideline: | - The response should avoid running dependent queries concurrently in `Promise.all` before parent records resolve. + The response should avoid running dependent queries concurrently in **Promise.all** before parent records resolve. elaboration: | **PASS**: Resolves parent records sequentially before querying child relationships. **FAIL**: Wraps dependent queries in a concurrent `Promise.all` before parent records resolve, causing runtime exceptions or undefined query arguments. @@ -141,7 +141,7 @@ criteria: category: extra_credit dimensions: [Thought Partnership] guideline: | - The response should identify extra queue or security improvements, like moving `deleteMessageFromSQS` to run after successful processing or flagging visibility timeouts. + The response should identify extra queue or security improvements, like moving **deleteMessageFromSQS** to run after successful processing or flagging visibility timeouts. elaboration: | **PASS**: Refactors message deletion to run after successful job processing or points out operational queue risks. - **FAIL**: Asserts that queue processing is completely bulletproof while leaving unhandled rejection paths that drop messages silently. + **FAIL**: Asserts that queue processing is completely bulletproof while leaving unhandled rejection paths.