new atomic-rubric
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-14T18:03:52.282Z",
|
||||
"capturedAt": "2026-10-14T18:38:21.252Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "f2ae35d66777eea943d5169748d79ce3c3b59717ecfe84341c22e51c62894d39",
|
||||
@@ -10,8 +10,8 @@
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "0eb82f568598af36cbf94be5d2d9bcea436124e6f1e1c3bb63fcbb58cfe41ebd",
|
||||
"atomicRubric": "160e8e1e9f60ee6723570a4b96a92addafd6ade6c31210ae386b747fd483ac4c",
|
||||
"atomicRubric": "115a906280331e673e301d37382b1cdabea96bbca7b51f2f641085e014ab3579",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "1ff97b7d5697855e47d3715269ce0e32f03215d8587a4d0eaf3684d4441c7a16"
|
||||
"graderContext": "29dce8f3926dd640892d9ab555ea8166c26b47d8c170082e22ffe49db7a6d7ef"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
detector: detector-rubric-coverage
|
||||
verdict: clear
|
||||
confidence: MEDIUM
|
||||
verdict: material-issues
|
||||
confidence: HIGH
|
||||
---
|
||||
# Rubric-coverage check: potion-voice-user-ownership
|
||||
|
||||
@@ -9,33 +9,35 @@ Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md agai
|
||||
|
||||
## Coverage map
|
||||
|
||||
| Holistic clause | Atomic criterion | Status |
|
||||
| Holistic clause (short, verbatim key phrase) | Criterion id(s) | Status |
|
||||
| --- | --- | --- |
|
||||
| Cloning operations use `userId` alongside record IDs | cloning-tenant-isolation | covered |
|
||||
| Synthesis recording operations use profile-derived `userId` | synthesis-tenant-isolation-queries-updates | covered |
|
||||
| Initial profile ID lookup is allowed | initial-profile-tenant-resolution | covered |
|
||||
| Downstream effects halt on ownership failure | prevent-unauthorized-side-effects | covered |
|
||||
| Filter syntax and executed effects route separately | prevent-unauthorized-side-effects guideline | covered |
|
||||
| Polling loop survives validation/database exceptions | worker-loop-crash-prevention | covered |
|
||||
| Requesting-job failed/error status is allowed | error-status-lifecycle-logging | covered |
|
||||
| Clear concise refactor explanation | refactor-summary-clarity | covered |
|
||||
| "All database operations in `voice-cloning-job-handler` ... must enforce `userId` scoping" | cloning-tenant-isolation | covered |
|
||||
| "All queries and updates to `RecordingSalutation` and `Recording` ... scoped by ... `userId`" | synthesis-tenant-isolation-queries-updates | covered |
|
||||
| "Looking up `UserAudioProfile` by `_id: userAudioProfileId` ... must not be penalized" | initial-profile-tenant-resolution | covered |
|
||||
| "all downstream audio generation, file creation, and database mutations must be immediately halted" | prevent-unauthorized-side-effects | covered |
|
||||
| "Syntax omissions ... charged under ... handler scoping ... execution ... under side-effect prevention" | cloning-tenant-isolation; synthesis-tenant-isolation-queries-updates; prevent-unauthorized-side-effects | covered |
|
||||
| "Exceptions during message validation or database operations must be caught gracefully" | worker-loop-crash-prevention | covered |
|
||||
| "Updating `status: 'failed'` or `'error'` on the requesting job record ... is permitted" | error-status-lifecycle-logging | covered |
|
||||
| "clearly and concisely describe how multi-tenant isolation is enforced" | refactor-summary-clarity | covered |
|
||||
|
||||
## Coverage gaps
|
||||
|
||||
None found. The side-effect criterion's guideline explicitly covers both handlers. Its call-site key points to synthesis, but the text supplies the general pass condition.
|
||||
None found in the behavior requirements or protected cases.
|
||||
|
||||
## Invented content
|
||||
|
||||
None found. The atomic criteria describe the same behaviors and allowances as the holistic rubric.
|
||||
### Unsupported Crux designation
|
||||
|
||||
`prevent-unauthorized-side-effects` carries `severity: crux`, but the holistic rubric contains no Heavy penalties section or instruction applying a heavy penalty to the overall score. Its Narrow Correctness bullet calls side-effect prevention "(CRUX)" without defining the penalty target or non-trigger. Under the conversion contract, that label alone does not establish an overall-score penalty. The severity can change the score materially.
|
||||
|
||||
## Context integrity
|
||||
|
||||
The context document retains the model matrix, profile lookup, downstream filter target, and side-effect requirement. The charge-routing language is preserved in the side-effect guideline.
|
||||
`tests/grader-context.md` preserves the source's Task Overview paragraph verbatim. The source has no separate Business context or Ground truth section. The answer-key facts used by the criteria appear in their guidelines.
|
||||
|
||||
## Crux alignment
|
||||
|
||||
The holistic side-effect prevention requirement is marked CRUX, and `prevent-unauthorized-side-effects` carries the atomic `crux` severity. No unsupported crux or missing heavy-penalty mapping was found.
|
||||
The holistic rubric states no heavy penalty targeting the overall score. The atomic rubric has one Crux criterion, `prevent-unauthorized-side-effects`, based on the source's parenthetical "(CRUX)" label. The source needs an explicit overall-score Heavy penalties rule with its non-trigger, or the atomic severity needs to be lowered.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
The atomic package retains the load-bearing holistic content. The rubric-form detector independently checks whether the YAML artifact parses and meets schema rules.
|
||||
The behavioral mapping is complete, but the unsupported Crux designation creates a material scoring difference. Resolve the source's penalty intent before treating the conversion as final.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 1,
|
||||
"capturedAt": "2026-10-14T18:03:52.282Z",
|
||||
"capturedAt": "2026-10-14T18:38:21.243Z",
|
||||
"capturedBy": "stamp",
|
||||
"inputs": {
|
||||
"prompt": "f2ae35d66777eea943d5169748d79ce3c3b59717ecfe84341c22e51c62894d39",
|
||||
@@ -10,8 +10,8 @@
|
||||
"gitref": "fcd8a9d0",
|
||||
"graderGuidanceConsolidated": null,
|
||||
"holisticRubric": "0eb82f568598af36cbf94be5d2d9bcea436124e6f1e1c3bb63fcbb58cfe41ebd",
|
||||
"atomicRubric": "160e8e1e9f60ee6723570a4b96a92addafd6ade6c31210ae386b747fd483ac4c",
|
||||
"atomicRubric": "115a906280331e673e301d37382b1cdabea96bbca7b51f2f641085e014ab3579",
|
||||
"rubricsYaml": null,
|
||||
"graderContext": "1ff97b7d5697855e47d3715269ce0e32f03215d8587a4d0eaf3684d4441c7a16"
|
||||
"graderContext": "29dce8f3926dd640892d9ab555ea8166c26b47d8c170082e22ffe49db7a6d7ef"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,38 @@
|
||||
---
|
||||
detector: detector-rubric-form
|
||||
verdict: clear
|
||||
confidence: MEDIUM
|
||||
confidence: HIGH
|
||||
---
|
||||
# Rubric-form check: potion-voice-user-ownership
|
||||
|
||||
Assessed: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
|
||||
|
||||
Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml and tests/grader-context.md
|
||||
Assessed: harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml
|
||||
|
||||
## Deterministic contract
|
||||
|
||||
The YAML parses. The task slug, seven unique kebab-case IDs, category and severity vocabularies, one-crux cap, exact dimension names, nonempty guidelines, positive phrasing, and absence of numeric penalty amounts pass. No extra-credit criterion carries severity.
|
||||
1. YAML parsing and top-level `task` and `criteria`: pass; the staging command parsed seven criteria.
|
||||
2. Task slug: pass.
|
||||
3. Unique kebab-case IDs: pass.
|
||||
4. Category vocabulary: pass.
|
||||
5. Severity vocabulary and placement: pass.
|
||||
6. Crux cap: pass; one criterion carries Crux.
|
||||
7. Dimension names: pass.
|
||||
8. Nonempty guidelines: pass.
|
||||
9. Numeric penalty language: pass; the pattern sweep found none.
|
||||
10. Positive phrasing: pass. The sweep matched `does not require` inside an answer key and `do not belong` in a condition, rather than a negated instruction.
|
||||
11. Each guideline begins with a positive `The response should ...` requirement: pass.
|
||||
|
||||
## Atomicity and self-containment
|
||||
|
||||
Each criterion has one response behavior or allowance. The side-effect criterion states its pass condition for both handlers before its routing note; the routing note governs grading of distinct syntax and executed-effect failures rather than adding a response requirement.
|
||||
None found. The two handler-specific scoping rules are independently judgeable. The side-effect criterion covers one stop condition across both handlers, and its elaboration routes filter syntax to the corresponding handler criterion.
|
||||
|
||||
## Phrasing and answer keys
|
||||
|
||||
The factual answer keys are inline and bold. The formerly unquoted colon-space strings are now parsed as YAML strings. No material phrasing issue was found.
|
||||
None found. Factual answer keys are bold and inline. Elaborations clarify fulfillment and charge routing.
|
||||
|
||||
## Fair-grading findings
|
||||
|
||||
The side-effect criterion is distinct from handler-specific query-filter criteria; its routing note says which failure each charges. No material bundle, unreachable requirement, or double-counting instruction was found.
|
||||
None found. The allowed initial profile lookup and error-status update are represented as protected behaviors, so the rubric does not charge them as isolation violations.
|
||||
|
||||
## Overall verdict
|
||||
|
||||
The artifact satisfies the deterministic contract and remains independently judgeable. The routing note inside one guideline is slightly dense but does not alter the pass condition.
|
||||
The atomic artifact parses and follows the criterion form rules. The source-to-atomic Crux alignment is assessed separately in detector-rubric-coverage.
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"created": [
|
||||
"rubric-criteria.md",
|
||||
"rubric-criteria.json"
|
||||
]
|
||||
}
|
||||
151
worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml
Executable file → Normal file
151
worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/atomic-rubric.yaml
Executable file → Normal file
@@ -1,86 +1,69 @@
|
||||
task: potion-voice-user-ownership
|
||||
source: harbor-tasks/potion-voice-user-ownership/tests/holistic-rubric.md
|
||||
context: grader-context.md
|
||||
criteria:
|
||||
- id: cloning-tenant-isolation
|
||||
category: primary_intent
|
||||
dimensions:
|
||||
- Narrow Correctness
|
||||
severity: certain_dealbreaker
|
||||
call_site_key: voice-cloning-job-handler
|
||||
guideline: The response should enforce tenant isolation using userId on all VoiceCloning
|
||||
and UserAudioProfile queries and updates in the voice cloning handler. **Answer
|
||||
key:** All database reads and updates in voice-cloning-job-handler must filter
|
||||
by userId in addition to record _id.
|
||||
elaboration: Verifies that voice cloning queries and updates incorporate userId
|
||||
to prevent unauthorized cross-tenant operations.
|
||||
- id: synthesis-tenant-isolation-queries-updates
|
||||
category: primary_intent
|
||||
dimensions:
|
||||
- Narrow Correctness
|
||||
severity: certain_dealbreaker
|
||||
call_site_key: voice-synthsizer-job-handler
|
||||
guideline: The response should scope all synthesis queries and database updates
|
||||
by tenant identity (userId) across RecordingSalutation and Recording records.
|
||||
**Answer key:** Downstream reads and updates to RecordingSalutation and Recording
|
||||
in voice-synthsizer-job-handler must be scoped by the profile-derived userId.
|
||||
elaboration: Ensures that both queries and database updates in the speech synthesis
|
||||
handler enforce tenant isolation using userId.
|
||||
- id: prevent-unauthorized-side-effects
|
||||
category: primary_intent
|
||||
dimensions:
|
||||
- Narrow Correctness
|
||||
severity: crux
|
||||
call_site_key: voice-synthsizer-job-handler
|
||||
guideline: 'The response should prevent unauthorized side effects, including audio
|
||||
generation and database mutations across both voice cloning and speech synthesis
|
||||
handlers, when tenant validation fails or records do not match tenant context.
|
||||
Routing note: Charge syntax omissions under cloning-tenant-isolation or synthesis-tenant-isolation-queries-updates;
|
||||
charge side-effect execution under this criterion. **Answer key:** Synthesis audio
|
||||
generation and database mutations must be halted if tenant ownership checks fail.'
|
||||
elaboration: Guarantees that unauthorized jobs do not trigger audio rendering, file
|
||||
creation, or database updates.
|
||||
- id: initial-profile-tenant-resolution
|
||||
category: dodged_bullet
|
||||
dimensions:
|
||||
- Narrow Correctness
|
||||
severity: possible_dealbreaker
|
||||
call_site_key: voice-synthsizer-job-handler
|
||||
guideline: 'The response should allow the initial UserAudioProfile lookup by _id:
|
||||
userAudioProfileId as a valid tenant-resolution step without requiring userId
|
||||
in that initial query. **Answer key:** The initial lookup on UserAudioProfile
|
||||
by ID is necessary to resolve userId and establish tenant context.'
|
||||
elaboration: Prevents improperly docking points for the initial profile query needed
|
||||
to discover the tenant identity.
|
||||
- id: worker-loop-crash-prevention
|
||||
category: primary_intent
|
||||
dimensions:
|
||||
- Broader Correctness / the craft of software engineering
|
||||
severity: possible_dealbreaker
|
||||
call_site_key: voice-synthsizer-job-handler
|
||||
guideline: The response should catch and handle exceptions during message processing
|
||||
to prevent background worker polling loops from crashing. **Answer key:** Errors
|
||||
during job processing must be caught gracefully so the worker polling loop remains
|
||||
active.
|
||||
elaboration: Ensures background worker loops remain resilient against unhandled
|
||||
errors.
|
||||
- id: error-status-lifecycle-logging
|
||||
category: dodged_bullet
|
||||
dimensions:
|
||||
- Broader Correctness / the craft of software engineering
|
||||
severity: unlikely_dealbreaker
|
||||
call_site_key: voice-synthsizer-job-handler
|
||||
guideline: The response should permit updating job status to failed or error on
|
||||
the requesting job record for error tracking when an unauthorized job is rejected.
|
||||
**Answer key:** Setting status to failed on the requesting job record for error
|
||||
logging is acceptable lifecycle tracking.
|
||||
elaboration: Clarifies that setting job status to failed on the requesting job record
|
||||
does not constitute an unauthorized cross-tenant mutation.
|
||||
- id: refactor-summary-clarity
|
||||
category: primary_intent
|
||||
dimensions:
|
||||
- Communication
|
||||
severity: unlikely_dealbreaker
|
||||
call_site_key: voice-synthsizer-job-handler
|
||||
guideline: The response should clearly articulate how tenant isolation is enforced
|
||||
across the refactored handlers in its written explanations. **Answer key:** The
|
||||
written explanation must clearly describe the multi-tenant isolation approach.
|
||||
elaboration: Evaluates the clarity and structure of the written refactoring summary.
|
||||
- id: cloning-tenant-isolation
|
||||
category: primary_intent
|
||||
severity: certain_dealbreaker
|
||||
dimensions:
|
||||
- Narrow Correctness
|
||||
guideline: |
|
||||
The response should scope every `VoiceCloning` and `UserAudioProfile` database operation in `voice-cloning-job-handler` by `userId` alongside the record ID. **Answer key: Both reads and updates must include the relevant `userId` and record ID.**
|
||||
elaboration: |
|
||||
Judge query and update filters here. The execution of downstream work after an ownership failure belongs to `prevent-unauthorized-side-effects`.
|
||||
|
||||
- id: synthesis-tenant-isolation-queries-updates
|
||||
category: primary_intent
|
||||
severity: certain_dealbreaker
|
||||
dimensions:
|
||||
- Narrow Correctness
|
||||
guideline: |
|
||||
The response should scope every `RecordingSalutation` and `Recording` query and update in `voice-synthsizer-job-handler` by the `userId` derived from the initial `UserAudioProfile` lookup. **Answer key: Downstream reads and updates must use the profile-derived `userId` alongside each record ID.**
|
||||
elaboration: |
|
||||
Judge query and update filters here. The execution of downstream work after an ownership failure belongs to `prevent-unauthorized-side-effects`.
|
||||
|
||||
- id: initial-profile-tenant-resolution
|
||||
category: dodged_bullet
|
||||
severity: possible_dealbreaker
|
||||
dimensions:
|
||||
- Narrow Correctness
|
||||
guideline: |
|
||||
The response should allow the initial `UserAudioProfile` lookup by `_id: userAudioProfileId` to establish tenant context. **Answer key: This lookup resolves `userAudioProfile.userId` and does not require a `userId` filter.**
|
||||
elaboration: |
|
||||
The first profile lookup is the stated exception to downstream tenant scoping. Do not treat that lookup alone as a tenant isolation failure.
|
||||
|
||||
- id: prevent-unauthorized-side-effects
|
||||
category: primary_intent
|
||||
severity: crux
|
||||
dimensions:
|
||||
- Narrow Correctness
|
||||
guideline: |
|
||||
The response should halt downstream audio generation, file creation, and database mutations in both handlers when tenant ownership checks fail or records do not belong to the requesting tenant. **Answer key: Rejected or unauthorized jobs must stop before those side effects execute.**
|
||||
elaboration: |
|
||||
This criterion covers execution after a failed ownership check. Charge missing `userId` predicates under the respective handler scoping criterion. Updating `status: 'failed'` or `'error'` on the requesting job record for error tracking is allowed.
|
||||
|
||||
- id: worker-loop-crash-prevention
|
||||
category: primary_intent
|
||||
severity: possible_dealbreaker
|
||||
dimensions:
|
||||
- Broader Correctness / the craft of software engineering
|
||||
guideline: |
|
||||
The response should catch exceptions during message validation or database operations so the worker polling loops remain active after rejected or unauthorized jobs. **Answer key: The polling loops continue after those failures.**
|
||||
|
||||
- id: error-status-lifecycle-logging
|
||||
category: dodged_bullet
|
||||
severity: unlikely_dealbreaker
|
||||
dimensions:
|
||||
- Broader Correctness / the craft of software engineering
|
||||
guideline: |
|
||||
The response should allow `status: 'failed'` or `'error'` updates on the requesting job record for error tracking after rejection. **Answer key: This lifecycle update is permitted.**
|
||||
elaboration: |
|
||||
Do not treat this permitted update as an unauthorized downstream mutation.
|
||||
|
||||
- id: refactor-summary-clarity
|
||||
category: primary_intent
|
||||
severity: unlikely_dealbreaker
|
||||
dimensions:
|
||||
- Communication
|
||||
guideline: |
|
||||
The response should clearly and concisely describe how multi-tenant isolation is enforced across both handlers.
|
||||
|
||||
16
worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/grader-context.md
Executable file → Normal file
16
worker-toolkit-potion-polyglot-v1.0.1/harbor-tasks/potion-voice-user-ownership/tests/grader-context.md
Executable file → Normal file
@@ -1,14 +1,4 @@
|
||||
# Grader Context & Reference Answer Key
|
||||
# Grader Context — potion-voice-user-ownership
|
||||
|
||||
## Background & Architecture
|
||||
The repository processes background jobs using AWS SQS queue messages and MongoDB models (`VoiceCloning`, `UserAudioProfile`, `RecordingSalutation`, `Recording`).
|
||||
|
||||
### Voice Cloning Handler (`voice-cloning-job-handler`)
|
||||
* Receives a job payload containing job ID (`job._doc._id` / `job._id`) and `userId`.
|
||||
* Must scope all database reads and updates on `VoiceCloning` and `UserAudioProfile` by `{ _id, userId }`.
|
||||
|
||||
### Speech Synthesis Handler (`voice-synthsizer-job-handler`)
|
||||
* Receives SQS message payload containing `userAudioProfileId`, `recordingId`, and `salutationId`.
|
||||
* **Trust Anchor Resolution**: Executes an initial query on `UserAudioProfile` by `_id: userAudioProfileId` to resolve `userAudioProfile.userId`.
|
||||
* **Downstream Scoping**: All subsequent queries and updates to `RecordingSalutation` and `Recording` must include `{ _id, userId: userAudioProfile.userId }`.
|
||||
* **Side-Effect Prevention**: If any record is missing or does not match `userId`, speech synthesis audio rendering and database writes must be halted immediately.
|
||||
## Task Overview
|
||||
This task evaluates the candidate agent's ability to audit and refactor asynchronous background worker handlers (`voice-cloning-job-handler` and `voice-synthsizer-job-handler`) to enforce strict multi-tenant data isolation (`userId`) while maintaining worker polling resilience.
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"task": "potion-voice-user-ownership",
|
||||
"criteria": [
|
||||
{
|
||||
"id": "cloning-tenant-isolation",
|
||||
"category": "primary_intent",
|
||||
"severity": "certain_dealbreaker",
|
||||
"dimensions": [
|
||||
"Narrow Correctness"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "synthesis-tenant-isolation-queries-updates",
|
||||
"category": "primary_intent",
|
||||
"severity": "certain_dealbreaker",
|
||||
"dimensions": [
|
||||
"Narrow Correctness"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "initial-profile-tenant-resolution",
|
||||
"category": "dodged_bullet",
|
||||
"severity": "possible_dealbreaker",
|
||||
"dimensions": [
|
||||
"Narrow Correctness"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "prevent-unauthorized-side-effects",
|
||||
"category": "primary_intent",
|
||||
"severity": "crux",
|
||||
"dimensions": [
|
||||
"Narrow Correctness"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "worker-loop-crash-prevention",
|
||||
"category": "primary_intent",
|
||||
"severity": "possible_dealbreaker",
|
||||
"dimensions": [
|
||||
"Broader Correctness / the craft of software engineering"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "error-status-lifecycle-logging",
|
||||
"category": "dodged_bullet",
|
||||
"severity": "unlikely_dealbreaker",
|
||||
"dimensions": [
|
||||
"Broader Correctness / the craft of software engineering"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "refactor-summary-clarity",
|
||||
"category": "primary_intent",
|
||||
"severity": "unlikely_dealbreaker",
|
||||
"dimensions": [
|
||||
"Communication"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
### Criterion: cloning-tenant-isolation
|
||||
|
||||
The response should scope every `VoiceCloning` and `UserAudioProfile` database operation in `voice-cloning-job-handler` by `userId` alongside the record ID. **Answer key: Both reads and updates must include the relevant `userId` and record ID.**
|
||||
|
||||
Judge query and update filters here. The execution of downstream work after an ownership failure belongs to `prevent-unauthorized-side-effects`.
|
||||
|
||||
### Criterion: synthesis-tenant-isolation-queries-updates
|
||||
|
||||
The response should scope every `RecordingSalutation` and `Recording` query and update in `voice-synthsizer-job-handler` by the `userId` derived from the initial `UserAudioProfile` lookup. **Answer key: Downstream reads and updates must use the profile-derived `userId` alongside each record ID.**
|
||||
|
||||
Judge query and update filters here. The execution of downstream work after an ownership failure belongs to `prevent-unauthorized-side-effects`.
|
||||
|
||||
### Criterion: initial-profile-tenant-resolution
|
||||
|
||||
The response should allow the initial `UserAudioProfile` lookup by `_id: userAudioProfileId` to establish tenant context. **Answer key: This lookup resolves `userAudioProfile.userId` and does not require a `userId` filter.**
|
||||
|
||||
The first profile lookup is the stated exception to downstream tenant scoping. Do not treat that lookup alone as a tenant isolation failure.
|
||||
|
||||
### Criterion: prevent-unauthorized-side-effects
|
||||
|
||||
The response should halt downstream audio generation, file creation, and database mutations in both handlers when tenant ownership checks fail or records do not belong to the requesting tenant. **Answer key: Rejected or unauthorized jobs must stop before those side effects execute.**
|
||||
|
||||
This criterion covers execution after a failed ownership check. Charge missing `userId` predicates under the respective handler scoping criterion. Updating `status: 'failed'` or `'error'` on the requesting job record for error tracking is allowed.
|
||||
|
||||
### Criterion: worker-loop-crash-prevention
|
||||
|
||||
The response should catch exceptions during message validation or database operations so the worker polling loops remain active after rejected or unauthorized jobs. **Answer key: The polling loops continue after those failures.**
|
||||
|
||||
### Criterion: error-status-lifecycle-logging
|
||||
|
||||
The response should allow `status: 'failed'` or `'error'` updates on the requesting job record for error tracking after rejection. **Answer key: This lifecycle update is permitted.**
|
||||
|
||||
Do not treat this permitted update as an unauthorized downstream mutation.
|
||||
|
||||
### Criterion: refactor-summary-clarity
|
||||
|
||||
The response should clearly and concisely describe how multi-tenant isolation is enforced across both handlers.
|
||||
Reference in New Issue
Block a user