after stage-atomic-rubric

This commit is contained in:
2026-10-22 13:08:38 -04:00
parent 1419191f0b
commit e750b1ad6b
4 changed files with 129 additions and 7 deletions

View File

@@ -0,0 +1,6 @@
{
"created": [
"rubric-criteria.md",
"rubric-criteria.json"
]
}

View File

@@ -42,15 +42,15 @@ criteria:
tenant validation fails or records do not match tenant context. **Answer key:
Audio generation rendering and database mutations in voice-cloning-job-handler
must be halted if tenant ownership checks fail.**'
elaboration: 'Failing this crux criterion applies a heavy penalty to Narrow Correctness
elaboration: "Failing this crux criterion applies a heavy penalty to Narrow Correctness
and a heavy penalty to the overall score. Routing note: If a preflight check or
update fails to match a record **before tenant context is established**, and rendering
or side effects still proceed, that is a Crux failure. **Exception**: `userId`-scoped
status updates (e.g., setting `status: \'error\'`) in catch blocks **after a successful
initial preflight** are NOT Crux failures. These writes target the job\'s own records
status updates (e.g., setting `status: 'error'`) in catch blocks **after a successful
initial preflight** are NOT Crux failures. These writes target the job's own records
and cannot mutate cross-tenant data; charge unchecked null returns under
scoped-update-null-handling instead. Do not double-charge a single defect across
query criteria and side-effect criteria.'
query criteria and side-effect criteria."
- id: synthesis-prevent-unauthorized-side-effects
name: Synthesis Prevent Unauthorized Side Effects
category: primary_intent
@@ -64,14 +64,14 @@ criteria:
tenant validation fails or records do not match tenant context. **Answer key:
Audio generation rendering and database mutations in voice-synthsizer-job-handler
must be halted if tenant ownership checks fail.**'
elaboration: 'Failing this crux criterion applies a heavy penalty to Narrow Correctness
elaboration: "Failing this crux criterion applies a heavy penalty to Narrow Correctness
and a heavy penalty to the overall score. Routing note: If a preflight check or
update fails to match a record **before tenant context is established**, and rendering
or side effects still proceed, that is a Crux failure. **Exception**: `userId`-scoped
status updates in catch blocks **after a successful initial preflight** are NOT Crux
failures. These writes target the job\'s own records and cannot mutate cross-tenant
failures. These writes target the job's own records and cannot mutate cross-tenant
data; charge unchecked null returns under scoped-update-null-handling instead.
Do not double-charge a single defect across query criteria and side-effect criteria.'
Do not double-charge a single defect across query criteria and side-effect criteria."
- id: initial-profile-tenant-resolution
name: Initial Profile Tenant Resolution
category: dodged_bullet

View File

@@ -0,0 +1,69 @@
{
"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": "cloning-prevent-unauthorized-side-effects",
"category": "primary_intent",
"severity": "crux",
"dimensions": [
"Narrow Correctness"
]
},
{
"id": "synthesis-prevent-unauthorized-side-effects",
"category": "primary_intent",
"severity": "crux",
"dimensions": [
"Narrow Correctness"
]
},
{
"id": "initial-profile-tenant-resolution",
"category": "dodged_bullet",
"severity": "possible_dealbreaker",
"dimensions": [
"Narrow Correctness"
]
},
{
"id": "scoped-update-null-handling",
"category": "dodged_bullet",
"severity": "unlikely_dealbreaker",
"dimensions": [
"Broader Correctness / the craft of software engineering"
]
},
{
"id": "worker-loop-crash-prevention",
"category": "dodged_bullet",
"severity": "possible_dealbreaker",
"dimensions": [
"Broader Correctness / the craft of software engineering"
]
},
{
"id": "refactor-summary-accuracy",
"category": "dodged_bullet",
"severity": "unlikely_dealbreaker",
"dimensions": [
"Verification & Thoroughness"
]
}
]
}

View File

@@ -0,0 +1,47 @@
### Criterion: cloning-tenant-isolation
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 on VoiceCloning and UserAudioProfile must filter by userId in addition to record _id.**
Verifies that voice cloning queries and updates incorporate userId to prevent unauthorized cross-tenant operations.
### Criterion: synthesis-tenant-isolation-queries-updates
The response should scope all synthesis queries and database updates by tenant identity (profile-derived 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.**
Ensures that both queries and database updates in the speech synthesis handler enforce tenant isolation using profile-derived userId.
### Criterion: cloning-prevent-unauthorized-side-effects
The response should prevent unauthorized side effects, including audio generation rendering and database mutations in the voice cloning handler, when tenant validation fails or records do not match tenant context. **Answer key: Audio generation rendering and database mutations in voice-cloning-job-handler must be halted if tenant ownership checks fail.**
Failing this crux criterion applies a heavy penalty to Narrow Correctness and a heavy penalty to the overall score. Routing note: If a preflight check or update fails to match a record **before tenant context is established**, and rendering or side effects still proceed, that is a Crux failure. **Exception**: `userId`-scoped status updates (e.g., setting `status: 'error'`) in catch blocks **after a successful initial preflight** are NOT Crux failures. These writes target the job's own records and cannot mutate cross-tenant data; charge unchecked null returns under scoped-update-null-handling instead. Do not double-charge a single defect across query criteria and side-effect criteria.
### Criterion: synthesis-prevent-unauthorized-side-effects
The response should prevent unauthorized side effects, including audio generation rendering and database mutations in the speech synthesis handler, when tenant validation fails or records do not match tenant context. **Answer key: Audio generation rendering and database mutations in voice-synthsizer-job-handler must be halted if tenant ownership checks fail.**
Failing this crux criterion applies a heavy penalty to Narrow Correctness and a heavy penalty to the overall score. Routing note: If a preflight check or update fails to match a record **before tenant context is established**, and rendering or side effects still proceed, that is a Crux failure. **Exception**: `userId`-scoped status updates in catch blocks **after a successful initial preflight** are NOT Crux failures. These writes target the job's own records and cannot mutate cross-tenant data; charge unchecked null returns under scoped-update-null-handling instead. Do not double-charge a single defect across query criteria and side-effect criteria.
### Criterion: initial-profile-tenant-resolution
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: userAudioProfileId is necessary to resolve userId and establish tenant context.**
Prevents improperly docking points for the initial profile query needed to discover the tenant identity.
### Criterion: scoped-update-null-handling
The response should check and handle null or zero-match return values on tenant-scoped database updates when no downstream unauthorized side effects occur. **Answer key: Database update operations that filter by tenant userId should check for a null result to ensure defensive error handling.**
Evaluates defensive error handling on scoped database updates. Note: If an update filters by userId (so 0 rows are mutated), failing to check the null return is a minor craft defect under Broader Correctness, provided no unauthorized audio rendering or side effects occur. **Rendering audio after a tenant-scoped update returns null / 0 matched records is a moderate Broader Correctness defect** (the preflight passed, but the subsequent scoped update failed to match).
### Criterion: worker-loop-crash-prevention
The response should catch and handle exceptions during message processing in a try-catch block to prevent background worker polling loops from crashing. **Answer key: Errors during job processing must be caught gracefully in a try-catch block so the worker polling loop remains active.**
Ensures background worker loops remain resilient against unhandled errors. Non-penalty note: Framework SQS message deletion and acknowledgment on both completed and rejected jobs is standard behavior and must not be penalized.
### Criterion: refactor-summary-accuracy
The response should accurately summarize the refactored multi-tenant isolation changes across background worker handlers in any written explanations or code documentation. **Answer key: Any written summary, response message, or code documentation must accurately describe the multi-tenant isolation logic without misleading claims.**
Evaluates the factual accuracy and structure of the written refactoring summary and code documentation.