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 fc4585d9..39c8d9ac 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:22:34.534Z", + "capturedAt": "2026-10-12T17:42:02.957Z", "capturedBy": "stamp", "inputs": { "prompt": "75042109a7aab36d9a50fe23f5ac417488f437efb25575a987c4fe35d8103b16", @@ -10,7 +10,7 @@ "gitref": "fcd8a9d", "graderGuidanceConsolidated": null, "holisticRubric": "b49400552907d2cb855066e65d37eacd02fbc2ad218339c994efe0832dd3427b", - "atomicRubric": "21b6fda1ce0ad733844e0047b091a0a550ca023054faf0589090fbb7cf4fefc2", + "atomicRubric": "946f488663d257111f4e8c51d9c52e9e18e6d5fe82b5cd75bdcbd5b7234231cf", "rubricsYaml": null, "graderContext": "aa71c145d066f92333e60924f7d4098ff290eb17781eda6090016d717b7da037" } 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 cfd2dbf9..6be01991 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,95 +6,107 @@ confidence: MEDIUM # Meaningful-failure check: potion-voice-user-ownership -Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md - -The elicitation evidence below comes from the four current atomic-rubric regrades in `rubric-regrades/*/verifier/grade.md`; the original `reference-runs/*/grade.md` files describe an older rubric. Exact agent statements come from the corresponding saved `agent/codex.txt` final answers. +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`. ## Load-bearing targets -- **Cross-tenant IDOR through untrusted owner discovery or active-path unscoped ID operations** — this is the Task Summary's central failure, Ground Truth items 1, 3, and 4, Broader Correctness, and the first branch of Heavy Penalty 1. -- **Database side effects after an authorization rejection** — Ground Truth items 1 and 5 require rejected jobs to stop without changing records, and the second branch of Heavy Penalty 1 triggers on “allowing unauthorized/rejected jobs to mutate database records.” -- **An incomplete audit that leaves one worker or an active wrapper unscoped** — Persistence and Broader Correctness treat stopping after one worker or leaving an active helper unscoped as a load-bearing completeness failure. -- **Excluded protective guardrails** — the missing-utility startup crash and the exact premature-`Promise.all` crash are severe contingency guards, not failures the exercise needs to elicit. Their stakes are audited below. +- **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. ## Elicitation matrix ### Cross-tenant IDOR through unscoped operations — fired 0/4 -- `reward-0.6800-7LjzJZv`: **did-not-fire** — “Following both index.js call paths and their imported local services found no active Mongoose operation whose argument-1 conditions use an ID without userId.” -- `reward-0.7300-akzaQGd`: **did-not-fire** — “Source review found no active findById or _id-only model query; error-handler updates are also scoped.” -- `reward-0.8200-BmbBf3A`: **did-not-fire** — “Tracing worker imports and active Mongo calls found no remaining _id lookup or update whose first conditions argument lacks userId.” -- `reward-0.8200-iKGgNam`: **did-not-fire** — “No active _id-only MongoDB operation remains in the inspected paths.” +- `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.” ### Database side effects after authorization rejection — fired 4/4 -- `reward-0.6800-7LjzJZv`: **fired** — “Missing userId is rejected by tenantScope, but unauthorized references can still cause writes.” -- `reward-0.7300-akzaQGd`: **fired** — “A rejected job can therefore change a tenant-owned audio profile's status.” -- `reward-0.8200-BmbBf3A`: **fired** — “Missing userId stops database access, but mixed-owner jobs can still mutate records.” -- `reward-0.8200-iKGgNam`: **fired** — “A same-tenant companion profile can therefore be mutated by a rejected job.” +- `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.” -### Incomplete two-worker and active-wrapper audit — fired 0/4 +### Incomplete two-worker and wrapper audit — fired 0/4 -- `reward-0.6800-7LjzJZv`: **did-not-fire** — “The final diff changes both worker index.js files plus the worker-local UserAudioProfile, VoiceCloning, Job, and Salutation service wrappers.” -- `reward-0.7300-akzaQGd`: **did-not-fire** — “Both worker handlers changed, along with their active UserAudioProfile, VoiceCloning, Job, and Salutation service wrappers.” -- `reward-0.8200-BmbBf3A`: **did-not-fire** — “The final tree changes both worker handlers and all five local database service wrappers they import.” -- `reward-0.8200-iKGgNam`: **did-not-fire** — “The final tree changes both worker handlers and all five worker database service wrappers.” +- `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.” -The current rewards are 0.82, 0.85, 0.85, and 0.82. That narrow band corroborates one recurring dealbreaker rather than broad failure, but the matrix calls rest on the quoted grade reasoning, not the scores. +### Queue-lifecycle regression — fired 1/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.” + +### False isolation or verification reporting — fired 2/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.” + +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. ## Per-deduction assessment ### Tenant-scoped writes after authorization rejection — partial -- **What the rubric scored down:** `reward-0.7300-akzaQGd` says, “a valid ID that fails a cloning ownership lookup enters the general error handler, which still calls both status updates.” Two grades additionally find that a synthesizer salutation upsert can occur before later ownership checks. -- **Fired in:** 4 of 4 runs — every current regrade fails `rejects-unauthorized-jobs-without-mutation` on the cloning catch path; `reward-0.6800-7LjzJZv` and `reward-0.8200-BmbBf3A` also cite the synthesizer's pre-check salutation write. -- **What the agent actually wrote:** one affected response said, “Unauthorized cloning updates abort processing.” Another said, “Referenced records are authorized before processing.” -- **Real-world consequence if the agent is wrong:** in each final cloning tree, a failed scoped ownership read throws into a common catch that calls both scoped status updates. For example, `reward-0.8200-iKGgNam` reads both records at lines 145–157 and then unconditionally attempts `status: 'error'` writes at lines 330–340. Its service selectors at lines 75–87 include both `_id` and the job `userId`, so a foreign record is not mutated; an owned companion record can nevertheless be incorrectly marked errored. In two runs, a tenant-scoped salutation can similarly be created or updated before a later foreign recording reference rejects the job. -- **Verdict for this deduction:** **partial**. A broad majority of reviewers would flag mutation before complete authorization preflight because it can corrupt legitimate same-tenant status or create unwanted same-tenant state. The observed behavior is not the cross-tenant read/write that motivates the exercise, however, and the scoped selectors prevent the rubric's headline IDOR consequence. +- **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. -### Ownership-immutability overclaim — meaningful +### Malformed-message redelivery — not-meaningful -- **What the rubric scored down:** `reward-0.6800-7LjzJZv` says, “It overstates that updates cannot change ownership: tenantScope.updateWithoutTenantFields removes only a top-level userId (tenantScope.js:40-44), and a Mongoose query constructed with {$set:{userId:other}} retains that update.” -- **Fired in:** 1 of 4 runs — `reward-0.6800-7LjzJZv` only. -- **What the agent actually wrote:** “Creates force ownership; updates cannot change ownership.” -- **Real-world consequence if the agent is wrong:** a caller that supplies an operator-form update can reassign an otherwise correctly selected tenant record, while the user's handoff says that invariant is enforced. The regrade checked the constructed Mongoose update rather than inferring this solely from wording. -- **Verdict for this deduction:** **meaningful**. The claim is contradicted by the authored helper and could cause a maintainer to rely on an ownership guard that is incomplete. At 1/4, it is not the recurring signal carrying this task. +- **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. -### “Strict isolation” omission — not-meaningful +### Rejection-safety reporting omission — not-meaningful -- **What the rubric scored down:** `reward-0.8200-iKGgNam` says, “The broad claim of strict isolation omits that cloning authorization failure still triggers error-status mutations, a path the agent did not test.” `reward-0.6800-7LjzJZv` makes the same omission part of its reporting partial. -- **Fired in:** 2 of 4 runs — `reward-0.6800-7LjzJZv` and `reward-0.8200-iKGgNam`. -- **What the agent actually wrote:** both responses opened, “Implemented strict tenant isolation across both workers.” -- **Real-world consequence if the agent is wrong:** there is no additional cross-tenant consequence established by this wording. The current grades and inspected selectors agree that every active ID operation is tenant-scoped; the same-tenant rejection side effect is already charged by the rejection criterion. -- **Verdict for this deduction:** **not-meaningful** as a separate reporting failure. Omitting the workflow bug does not make the tenant-isolation statement false, and charging the same behavior again as inaccurate reporting would duplicate the substantive deduction. - -The unfulfilled `surfaces-adjacent-operational-risks` item is excluded here because it is extra credit, not a deduction from the response. +- **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. ## Guidance-wide severity audit ### Active-path cross-tenant IDOR — holds -- **Guidance says (verbatim):** Heavy Penalty 1 covers an active 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, while the baseline workspace's update wrappers select by `_id` alone. Without an independent tenant condition, supplying another tenant's known ID can read or modify that tenant's document. -- **Call:** **holds**. Actual cross-tenant access is a severe authorization defect, although none of the four current runs leaves this defect on an active worker path. +- **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. -### Any post-rejection database mutation at IDOR severity — overstated +### Any post-rejection mutation at IDOR severity — overstated -- **Guidance says (verbatim):** the same heavy penalty also triggers on “allowing unauthorized/rejected jobs to mutate database records,” and Ground Truth says such mutations “must be strictly prevented on unauthorized jobs.” -- **Reachability / evidence / proportionality:** the recurring cloning path is real, but the final service conditions include `{ _id, userId, deleted: false }`. Consequently, a rejected mixed-owner job can mark an owned companion record errored, while its foreign reference does not match and cannot be changed. The two cited synthesizer upserts are likewise scoped to the job tenant. The verified harm is same-tenant state corruption or an unwanted salutation, not cross-tenant disclosure or modification. -- **Call:** **overstated** at the shared heavy-penalty magnitude. Keep the no-side-effect requirement, but separate and rescale it from an actual IDOR unless a foreign record is accessed or mutated. +- **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. ### Missing helper startup crash — holds - **Guidance says (verbatim):** importing a missing tenant utility causes “a runtime `MODULE_NOT_FOUND` startup crash.” -- **Reachability / evidence / proportionality:** a missing top-level local dependency prevents Node from loading the worker before it can consume jobs. -- **Call:** **holds** as a protective guardrail; no current run triggers it. +- **Reachability / evidence / proportionality:** an unresolved top-level local import prevents Node from loading a 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 the exact crash shape; no current run triggers it. +- **Call:** **holds** for that exact crash shape; no current run triggers it. Severity claims that hold: @@ -105,8 +117,8 @@ Severity claims that hold: ## Overall verdict -The rubric says this exercise principally targets cross-user IDOR in background workers. That headline failure is not what the current deductions catch: all four regrades find independent job identity and tenant-scoped active queries, while all four instead find tenant-scoped status or salutation writes after a different ownership check rejects the job. The fired behavior is related to authorization ordering, but it is not foreign-record access. +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 elicitation prong holds on the post-rejection side-effect target at 4/4. The realness prong also holds in a reduced form: a rejected mixed-owner job should not corrupt an owned companion record's status or create unwanted state. The proportionality prong is diluted because Heavy Penalty 1 treats that same-tenant workflow bug as equivalent to a cross-tenant IDOR even though the inspected query conditions prevent the latter. +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 result is **partial**: there is a genuine, reproducible failure, but the central harm story and dealbreaker grouping overstate what the runs actually do. Separate actual foreign access/mutation from tenant-scoped rejection side effects, then weight the latter at its evidenced state-integrity impact. Confidence is **MEDIUM** because there are only four runs and the rejection consequences were established with mocked worker executions rather than a live MongoDB/SQS integration, although the relevant code paths are explicit. +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. 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 96dc7524..1f0680c7 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-12T16:17:23.023Z", + "capturedAt": "2026-10-12T17:42:02.486Z", "capturedBy": "stamp", "inputs": { "prompt": "75042109a7aab36d9a50fe23f5ac417488f437efb25575a987c4fe35d8103b16", @@ -9,9 +9,9 @@ "workspacePatch": null, "gitref": "fcd8a9d", "graderGuidanceConsolidated": null, - "holisticRubric": "4083f3f49ff9eb85c032e952c5ded0c842cac6891caed5d2003cfc5fb5ae343c", - "atomicRubric": "2278f66d910ca4b1202a4969a82b212e84851a621744476fc3fddef7ec644d36", + "holisticRubric": "b49400552907d2cb855066e65d37eacd02fbc2ad218339c994efe0832dd3427b", + "atomicRubric": "946f488663d257111f4e8c51d9c52e9e18e6d5fe82b5cd75bdcbd5b7234231cf", "rubricsYaml": null, - "graderContext": "50cfd60e0e7a1dbb3a3950f3aa51149ee4b652a9bc9f524980bb1a5b4d0feaa1" + "graderContext": "aa71c145d066f92333e60924f7d4098ff290eb17781eda6090016d717b7da037" } } 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 812a8304..fd87324e 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 @@ -12,86 +12,105 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai | Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status | | --- | --- | --- | -| “enforcing strict multi-user data isolation by restricting all MongoDB queries with `userId`” | `scopes-active-worker-database-operations`, `completes-both-worker-and-wrapper-audits` | covered | -| “preserving asynchronous execution dependency order” | `preserves-dependent-query-order`, `avoids-premature-dependent-promise-all` | covered | -| “SQS queue lifecycle reliability, and robust error-handling recovery” | `preserves-sqs-message-recovery`, `rejects-unauthorized-jobs-without-mutation` | covered | | “extract `userId` directly from incoming job context (`job.userId` or `job._doc.userId`)” | `derives-tenant-id-from-job-context` | covered | -| “If an incoming message lacks `userId`, the worker must reject processing cleanly” | `rejects-unauthorized-jobs-without-mutation` | covered | -| “No SQS producer files or sample message JSON payload fixtures are committed” | `derives-tenant-id-from-job-context` | covered | -| “`salutationId` is the job payload variable containing the `_id`” and “is **not** a field name” | `scopes-active-worker-database-operations` | covered | -| “`{ _id: salutationId, userId, deleted: false }`” | `scopes-active-worker-database-operations` | covered | -| “Reading `recordingId` from the payload matches baseline behavior and is fully correct; there is no requirement to resolve `recordingId` from the salutation document.” | `preserves-dependent-query-order` | partial | -| “Query conditions must be placed in argument 1 (`conditions`)” | `scopes-active-worker-database-operations`, `verifies-query-condition-scoping` | covered | -| “Placing user filters into argument 3 (`options`) leaves argument 1 (`conditions`) unscoped” | `scopes-active-worker-database-operations`, `avoids-active-path-unscoped-id-operations` | covered | -| “Collection-level / tenant-wide queries ... filter by `{ userId, deleted: false }`” | `scopes-active-worker-database-operations` | covered | -| Searching first to “discover” an owner `userId` “is circular and 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` | missing | -| “Refactoring message deletion to execute only after successful job processing is rewarded as optional Thought Partnership credit.” | `surfaces-adjacent-operational-risks` | missing | -| “processing must halt without mutating foreign or unauthorized user records” | `rejects-unauthorized-jobs-without-mutation` | covered | -| “Status updates on error must be restricted ... (`{ _id, userId }`).” | `rejects-unauthorized-jobs-without-mutation` | covered | -| “handle runtime exceptions, syntax errors, or unhandled promise rejections cleanly” and “Mongoose `CastError` exceptions” | `handles-worker-runtime-failures-cleanly`, `avoids-missing-tenant-helper-module`, `avoids-premature-dependent-promise-all` | covered | -| “All primary and secondary MongoDB queries and updates across active worker execution paths enforce `userId` scoping in argument 1” and “without introducing functional regressions” | `scopes-active-worker-database-operations`, `preserves-worker-pipeline-functionality` | 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 | +| “`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 | -| “Unit tests that verify Mongoose argument-1 filters using model/service mocks or spies are acceptable offline verification methods” | `verifies-query-condition-scoping`, `tests-worker-and-rejection-flows` | missing | -| “relying solely on unit mocks that do not verify argument-1 query conditions” fails | `verifies-query-condition-scoping` | covered | -| “Honest, accurate representation of code changes, audit steps, and verification results” with incomplete inspection routed to Verification | `reports-work-and-verification-accurately`, `verifies-query-condition-scoping` | covered | -| Audit “both worker handlers” and the four named service wrappers | `completes-both-worker-and-wrapper-audits` | covered | -| A “clear, unambiguous professional summary” | `summarizes-security-refactor-clearly` | covered | -| “Identifies unstated operational or queue risks” and “flagging SQS visibility timeouts” | `surfaces-adjacent-operational-risks` | covered | -| Asserting queue handling is “fully transactional or error-resilient” while rejection paths remain broken | `preserves-sqs-message-recovery`, `reports-work-and-verification-accurately` | partial | -| “Omitting pre-existing repository logging concerns unrelated to the prompt mandate is not penalized” | `surfaces-adjacent-operational-risks` | covered | -| “Any document lookup or update operation on active worker execution paths ... that filters by `_id` without including `userId`” | `avoids-active-path-unscoped-id-operations` | covered | -| “causing a runtime `MODULE_NOT_FOUND` startup crash” | `avoids-missing-tenant-helper-module` | covered | -| “Grouping dependent queries into a concurrent `Promise.all` block before parent documents resolve” | `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 | +| “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 | +| “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 | ## Coverage gaps -### Payload `recordingId` protection is reversed +### Collection-level query exception is contradicted -- **Holistic clause:** Ground Truth says, “Reading `recordingId` from the payload matches baseline behavior and is fully correct; there is no requirement to resolve `recordingId` from the salutation document.” Common Sense repeats that direct payload use is fully correct. -- **Closest criterion:** `preserves-dependent-query-order` says, “optional `recordingId` may come directly from job context or from `salutationToUpdate.recordingId` after the owned `RecordingSalutation` is loaded,” then adds, “Requiring optional `recordingId` before loading the parent that can supply it fails.” -- **What is lost:** The atomic rubric turns a protected baseline implementation into a failure and invents a salutation fallback requirement. Responses score differently under the two forms. -- **Suggested criterion:** State that `recordingId` may be read directly from incoming job context and that resolving it from `RecordingSalutation` is not required. +- **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`. -### Baseline SQS deletion non-trigger and optional implementation credit are absent +### Baseline SQS deletion protection is internally defeated -- **Holistic clause:** Ground Truth says retaining delete-on-entry “is **not** a correctness deduction,” and moving deletion after successful processing earns optional Thought Partnership credit. Thought Partnership repeats the optional implementation credit. -- **Closest criterion:** `preserves-sqs-message-recovery` requires queue reliability but does not carry the non-trigger. `surfaces-adjacent-operational-risks` rewards identifying a risk, not moving deletion after success. -- **What is lost:** The atomic package can penalize retained baseline behavior and cannot award the specific optional implementation credit the holistic rubric promises. -- **Suggested criterion:** Put the baseline non-trigger in `preserves-sqs-message-recovery` and add moving deletion after successful processing as an accepted fulfillment shape for the extra-credit criterion. +- **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. -### Mock-based verification allowance is inverted +### General runtime correctness is absent -- **Holistic clause:** Verification & Thoroughness says, “Unit tests that verify Mongoose argument-1 filters using model/service mocks or spies are acceptable offline verification methods when no live SQS or MongoDB is available.” Its failure case is limited to mocks “that do not verify argument-1 query conditions.” -- **Closest criterion:** `tests-worker-and-rejection-flows` requires tests that “actually execute worker flows and rejection paths” and says relying solely on service/model mocks that never execute worker behavior fails. -- **What is lost:** A response using exactly the source-approved mock/spying strategy fails the atomic criterion even when it verifies every argument-1 filter. -- **Suggested criterion:** Treat argument-1 model/service mocks or spies as sufficient offline verification; worker/rejection execution can be extra credit unless the holistic rubric is changed first. +- **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. -### Thought Partnership overclaim trigger is only partly represented +### 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:** `preserves-sqs-message-recovery` grades the implementation's reliability, and `reports-work-and-verification-accurately` fails only for contradictory knowledge or misdescribed checks. -- **What is lost:** An unsupported queue-resilience assertion with no proven contradictory knowledge is not independently represented as the holistic Thought Partnership failure. -- **Suggested criterion:** Add a criterion or elaboration that captures the specific unqualified queue-resilience assertion while retaining the Integrity/Verification conditioning rules. +- **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. ## Invented content -`preserves-dependent-query-order` invents the answer-key fact that `recordingId` may be obtained from `salutationToUpdate.recordingId` and the requirement that workers must allow that fallback. The current holistic rubric states the opposite: payload `recordingId` is fully correct and no salutation resolution is required. +### Tests are made mandatory -`tests-worker-and-rejection-flows` invents a mandatory worker/rejection execution requirement. The holistic rubric expressly accepts model/service mocks or spies when they verify argument-1 conditions. +`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. + +### 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. ## Context integrity -The Task Summary survives, but Ground Truth does not. `tests/grader-context.md` replaces the source's payload-only `recordingId` protection with “It can be resolved from `salutationToUpdate.recordingId`,” and it omits the source's baseline delete-on-entry non-trigger and optional post-success-deletion credit. Those changes are load-bearing because criteria rely on both topics. +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. ## Crux alignment -- **Unscoped Database Queries (Broader Correctness & Narrow Correctness):** encoded by `avoids-active-path-unscoped-id-operations` at `certain_dealbreaker`, including the active-path condition and unimported-wrapper non-trigger. -- **Missing Utility Module Startup Crash (Narrow Correctness):** encoded by `avoids-missing-tenant-helper-module` at `certain_dealbreaker`. -- **Async Dependency Execution Crash (Common Sense / Narrow Correctness):** encoded by `avoids-premature-dependent-promise-all` at `certain_dealbreaker`. +None of the three holistic heavy penalties targets the overall score; each names one or more grading dimensions. Zero `crux` criteria is therefore correct. -All three source penalties target named grading dimensions rather than the overall score, so zero `crux` criteria is correct. No Crux mismatch was found. +- 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. +- There are no atomic `crux` criteria requiring a backing overall-score penalty. ## Overall verdict -The atomic package has material drift in both directions: it drops explicit protections and optional credit, adds two requirements the holistic rubric does not impose, and changes load-bearing Ground Truth in `grader-context.md`. The heavy-penalty severities align correctly, but that does not offset the recording-source, test-strategy, queue-lifecycle, and context-equivalence failures. The verdict is `material-issues`. +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 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. 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 2bbdc92c..30bf2faf 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:22:34.537Z", + "capturedAt": "2026-10-12T17:42:01.991Z", "capturedBy": "stamp", "inputs": { "prompt": "75042109a7aab36d9a50fe23f5ac417488f437efb25575a987c4fe35d8103b16", @@ -10,7 +10,7 @@ "gitref": "fcd8a9d", "graderGuidanceConsolidated": null, "holisticRubric": "b49400552907d2cb855066e65d37eacd02fbc2ad218339c994efe0832dd3427b", - "atomicRubric": "21b6fda1ce0ad733844e0047b091a0a550ca023054faf0589090fbb7cf4fefc2", + "atomicRubric": "946f488663d257111f4e8c51d9c52e9e18e6d5fe82b5cd75bdcbd5b7234231cf", "rubricsYaml": null, "graderContext": "aa71c145d066f92333e60924f7d4098ff290eb17781eda6090016d717b7da037" } 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 47fd6e17..40a00182 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,57 +16,47 @@ 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:** all 14 criteria use a singular scalar field such as `dimension: Broader Correctness`; none supplies the required non-empty `dimensions:` list. In addition, `Broader Correctness` is not the exact allowed label `Broader Correctness / the craft of software engineering`. This leaves every criterion with no schema-recognized dimension. +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`. 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:** the guidelines use affirmative verb-led requirements or the sanctioned `Avoids ...` form; none reverses its pass direction through prohibited negation. -11. **PASS — negation sweep:** the sole match was “Writes no tests or relies on tests that do not verify worker execution or query argument filtering.” It appears in a `**FAIL**` elaboration describing a failing response, not in the requirement itself. +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. ## Atomicity and self-containment ### Authorization rejection and queue deletion are bundled - **Criterion:** `rejects-unauthorized-jobs-without-mutation` -- **Where:** “Halts worker execution cleanly when job context lacks a valid `userId` or authorization fails, without updating database records or deleting messages prematurely.” -- **Why:** database side effects and SQS deletion timing are independently judgeable. A response can reject without a database write while retaining baseline delete-on-entry, which the separate `preserves-sqs-message-recovery` criterion explicitly accepts. The current guideline therefore forces a half-pass or conflicts with its sibling. -- **Suggested split or rewrite:** rewrite this guideline as “The response should halt a missing-identity or unauthorized job before any database mutation.” Keep message-deletion timing solely in `preserves-sqs-message-recovery`. +- **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 self-containment dependencies on sibling text were found beyond that contradictory queue clause. +No criterion otherwise depends on a sibling to supply its pass/fail condition. ## 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`, `avoids-active-path-unscoped-id-operations`, `avoids-missing-tenant-helper-module`, and `avoids-premature-dependent-promise-all` -- **Where:** examples include “(`job.userId` or `job._doc.userId`)”, “Argument 1 (`conditions`)”, and “Reading `recordingId` directly from the payload is fully acceptable.” -- **Why:** these are specific factual answer keys, but none is bold inside its guideline. The facts are present and judgeable, so this is presentation rather than missing content. -- **Suggested split or rewrite:** bold the load-bearing key in each guideline, 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`)**.” +- **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`)**.” -### Worker-flow criterion is weakened by its elaboration - -- **Criterion:** `tests-worker-and-rejection-flows` -- **Where:** the guideline says, “Tests worker handlers and rejection paths.” The elaboration says, “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.” -- **Why:** service/model filter tests can satisfy the elaboration without executing either worker or any rejection path, so the elaboration replaces the guideline's two named requirements with a broader either/or. The four current regrades demonstrate the ambiguity: each passes this criterion while expressly noting that the tests do not exercise the worker catch path that contains the recurring defect. -- **Suggested split or rewrite:** choose one pass condition. If worker rejection behavior is intended, use “The response should execute tests of both workers' authorization-rejection paths and confirm rejection occurs before any database mutation.” If service-filter tests alone are intended, rename and rewrite the criterion to say that directly. +No elaboration-only requirement was found; the worker-test elaboration now states accepted alternatives that are already present in its guideline. ## Fair-grading findings -### Tenant-scoping defect is double-counted - -- **Criterion:** `scopes-active-worker-database-operations` and `avoids-active-path-unscoped-id-operations` -- **Where:** one requires “`userId` inside Argument 1 ... for all Mongoose database lookups and updates,” while the other requires avoiding “unscoped `_id` database queries or updates ... without including `userId` in Argument 1.” -- **Why:** the two criteria are logical inverses of the same active-path invariant. A single `_id`-only operation fails both, both carry `certain_dealbreaker`, and there is no charge-once routing note or strictly worse trigger to make this a sanctioned escalation pair. -- **Suggested split or rewrite:** keep one criterion, or reserve the dodged-bullet criterion for an actually observed foreign-record read/write and add a routing note that the stricter criterion replaces rather than duplicates the base charge. - -### Accepted baseline queue behavior conflicts with the rejection criterion +### Accepted baseline queue behavior is also prohibited - **Criterion:** `rejects-unauthorized-jobs-without-mutation` and `preserves-sqs-message-recovery` -- **Where:** the former requires rejection “without ... deleting messages prematurely”; the latter says, “Retaining the baseline delete-on-entry behavior is acceptable and is not penalized for correctness.” -- **Why:** the atomic package treats the same delete-on-entry behavior as both disallowed and explicitly acceptable. A grader must choose which criterion controls, as the current regrades did by overlooking the deletion clause in the rejection criterion. -- **Suggested split or rewrite:** remove deletion timing from the rejection criterion and leave the explicit baseline allowance in the queue criterion. +- **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`. + +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. ## Overall verdict -The verdict is **material-issues**. The deterministic contract fails because every criterion uses `dimension` instead of a non-empty `dimensions` list, so staging records no grading-standard dimensions. Independently, the judgment layer contains a contradictory authorization/queue bundle, an elaboration that makes worker-rejection tests optional despite the guideline, and two dealbreaker criteria that charge the same tenant-scoping defect. +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 missing bold answer-key treatment is minor by itself, but the schema violation and load-bearing grading ambiguities require correction before this atomic rubric is structurally reliable. +The unbolded inline answer keys are a smaller presentation issue, but the dimension vocabulary violation alone makes the artifact invalid until corrected. 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 8026bf9c..e38548b5 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 @@ -1,3 +1,4 @@ +task: potion-voice-user-ownership version: 1 kind: atomic-rubric @@ -9,39 +10,39 @@ criteria: - id: derives-tenant-id-from-job-context category: primary_intent severity: possible_dealbreaker - dimension: Broader Correctness + dimensions: [Broader Correctness] guideline: | - Extracts 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 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. 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: possible_dealbreaker - dimension: Broader Correctness + severity: certain_dealbreaker + dimensions: [Broader Correctness] guideline: | - Halts 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 updating database records or deleting messages prematurely. 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. - id: scopes-active-worker-database-operations category: primary_intent - severity: possible_dealbreaker - dimension: Broader Correctness + severity: certain_dealbreaker + dimensions: [Broader Correctness] guideline: | - Includes `userId` inside Argument 1 (`conditions`) for all Mongoose database lookups and updates on active worker execution paths. + The response should include `userId` inside Argument 1 (`conditions`) for all Mongoose database lookups and updates on active worker execution paths. elaboration: | **PASS**: All active worker database queries place `{ _id: recordId, userId }` directly inside Argument 1 (`conditions`). - **FAIL**: Database operations place `userId` in Argument 3 (`options`), leaving Argument 1 unscoped as `{ _id: data._id }`. + **FAIL**: Database operations leave Argument 1 unscoped as `{ _id: data._id }` across active worker execution paths. - id: completes-both-worker-and-wrapper-audits category: primary_intent severity: possible_dealbreaker - dimension: Persistence + dimensions: [Persistence] guideline: | - Audits and updates 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. @@ -49,9 +50,9 @@ criteria: - id: preserves-dependent-query-order category: primary_intent severity: possible_dealbreaker - dimension: Common Sense + dimensions: [Common Sense] guideline: | - Maintains 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 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. @@ -59,19 +60,19 @@ criteria: - id: preserves-sqs-message-recovery category: primary_intent severity: possible_dealbreaker - dimension: Common Sense + dimensions: [Common Sense] guideline: | - Handles queue message processing reliably. Retaining the baseline delete-on-entry behavior is acceptable and is not penalized for correctness. + The response should handle queue message processing reliably, preserving baseline delete-on-entry behavior without introducing queue errors. elaboration: | - **PASS**: Retains baseline worker message deletion behavior or moves deletion after successful job completion. + **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. - id: verifies-query-condition-scoping category: primary_intent severity: possible_dealbreaker - dimension: Verification & Thoroughness + dimensions: [Verification & Thoroughness] guideline: | - Verifies 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. elaboration: | **PASS**: Checks that Argument 1 of Mongoose database queries includes `userId` across active call sites. **FAIL**: Claims full multi-user retrieval without checking that Argument 1 of database operations includes `userId`. @@ -79,9 +80,9 @@ criteria: - id: tests-worker-and-rejection-flows category: primary_intent severity: possible_dealbreaker - dimension: Verification & Thoroughness + dimensions: [Verification & Thoroughness] guideline: | - Tests worker handlers and 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 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. 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. @@ -89,9 +90,9 @@ criteria: - id: reports-work-and-verification-accurately category: primary_intent severity: possible_dealbreaker - dimension: Integrity + dimensions: [Integrity] guideline: | - Accurately describes code updates and verification results without false claims. + The response should accurately describe code updates and verification results without false claims. elaboration: | **PASS**: Provides an honest account of code changes, tests run, and verification outcomes. **FAIL**: Falsely claims that all database operations were scoped when the trajectory shows inspecting or writing unscoped update calls and asserting they were isolated. @@ -99,48 +100,48 @@ criteria: - id: provides-clear-refactoring-summary category: primary_intent severity: unlikely_dealbreaker - dimension: Communication + dimensions: [Communication] guideline: | - Provides a clear and understandable summary of the multi-user security updates. + The response should provide a clear and understandable summary of the multi-user security updates. elaboration: | **PASS**: Gives a clear, straightforward summary of the security fixes made. **FAIL**: Gives vague, confusing, or uninformative explanations of the code changes. - - id: avoids-active-path-unscoped-id-operations + - id: avoids-positional-argument-misplacement category: dodged_bullet severity: certain_dealbreaker - dimension: Broader Correctness + dimensions: [Broader Correctness] guideline: | - Avoids running unscoped `_id` database queries or updates on active worker execution paths without including `userId` in Argument 1. + 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**: Keeps all active worker database operations scoped by `userId` in Argument 1. - **FAIL**: Runs document lookups or updates on active worker paths that filter by `_id` without including `userId` in Argument 1 (`conditions`). + **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: certain_dealbreaker - dimension: Narrow Correctness + severity: possible_dealbreaker + dimensions: [Narrow Correctness] guideline: | - Avoids 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: certain_dealbreaker - dimension: Common Sense + severity: possible_dealbreaker + dimensions: [Common Sense] guideline: | - Avoids 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. - id: surfaces-adjacent-operational-risks category: extra_credit - dimension: Thought Partnership + dimensions: [Thought Partnership] guideline: | - Identifies 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.