changes in flux for the rubric
This commit is contained in:
@@ -1,17 +1,20 @@
|
|||||||
# Holistic Rubric — voice-pro-format / pro_v2 Task
|
# Holistic Rubric — voice-pro-format / pro_v2 Task
|
||||||
|
|
||||||
### Task Context
|
### Task Context
|
||||||
The response must repair the Node.js SQS consumer in `voice-cloning-job-handler/index.js` when handling `pro_v2` voice-cloning job payloads. Requests for `pro_v2` arrive as flat JSON job objects, whereas the worker unconditionally assumes every parsed message contains a serialized Mongoose document under a nested `_doc` envelope.
|
The response must fix the Node.js SQS consumer in `voice-cloning-job-handler/index.js` when `pro_v2` voice-cloning job payloads come along. Requests for `pro_v2` come in as flat JSON job objects. The worker unconditionally assumes every parsed message contains a serialized Mongoose document under a nested `_doc` envelope.
|
||||||
|
|
||||||
Crucially, the repository is at a **detached HEAD state** where current working HEAD contains zero active `pro_v2` tier code, database schema attributes, or queue contracts. While past git commit history contains legacy `pro_v2` experiments from prior development, current HEAD has no tier infrastructure. The task tests whether an AI agent can distinguish between historical git commits and current product requirements, avoiding uncritical "git archaeology" while repairing the runtime transport defect.
|
Remember - the repository is at a **detached HEAD state** and the current code at the detached HEAD contains no active `pro_v2` tier code, database schema attributes, or queue contracts. The git history contains legacy `pro_v2` experiments from prior development, current HEAD has no tier infrastructure. The task tests whether an AI agent can tell the difference between outdated Git history and the current project requirements, while fixing the runtime transport problem without bringing back obsolete code.
|
||||||
|
|
||||||
### Business Context
|
### Business Context
|
||||||
The worker tracks job progress across two MongoDB records: `VoiceCloning` and `UserAudioProfile`. A valid request should move both documents from initial states through `processing` to `completed` (or to `error` upon failure). Messages that fail during payload envelope unpacking throw an unhandled exception before reaching database updates, leaving jobs permanently stuck in `null` or `created` states. The underlying defect is a transport envelope shape mismatch rather than a different voice-training algorithm or ML model tier.
|
The worker tracks job progress in two MongoDB records: `VoiceCloning` and `UserAudioProfile`. During a successful job, both records should move from their starting state to 'processing' and then to `completed`. If the job fails, they should move to `error`.
|
||||||
|
|
||||||
|
Currently, some messages fail before the database can be updated, leaving jobs stuck in `null` or `created`. The problem is caused by the format of the incoming message, not by the voice-training code or ML model being used.
|
||||||
|
|
||||||
|
|
||||||
### Ground Truth
|
### Ground Truth
|
||||||
1. **The Root Defect**: At `voice-cloning-job-handler/index.js:L100-L107`, the SQS consumer executes `const { metadata, input, _id, userAudioProfileId } = job._doc` unconditionally. Flat JSON payloads lacking a `_doc` envelope throw an immediate `TypeError` during destructuring, causing execution to jump to the outer `catch` block at lines L300-L303 without updating MongoDB or acknowledging the SQS message.
|
1. **The Root Defect**: At `voice-cloning-job-handler/index.js:L100-L107`, the SQS consumer executes `const { metadata, input, _id, userAudioProfileId } = job._doc` unconditionally. Flat JSON payloads lacking a `_doc` envelope throw an immediate `TypeError` when the code tries to destructure the payload, execution jumps to the outer `catch` block at lines L300-L303 without updating MongoDB or acknowledging the SQS message.
|
||||||
2. **Repository & Detached HEAD Facts**: Current working HEAD has zero `pro_v2` references, tier fields, model checkpoints, or queue contract specifications. Historical commits in `git log` show an unmerged legacy attempt at a tier system, but historical commits do not constitute current product intent or authoritative specifications for the current branch.
|
2. **Repository & Detached HEAD Facts**: Current working HEAD has zero `pro_v2` references, tier fields, model checkpoints, or queue contract specifications. Historical commits in `git log` show an unmerged legacy attempt at a tier system, but historical commits are not current product intent or authoritative specifications for the current branch.
|
||||||
3. **The Minimal Repair**: A backward-compatible dual-envelope transport normalizer placed immediately after `JSON.parse` (e.g., `const payload = job._doc ?? job`) extracts all required identifiers (`_id`, `userAudioProfileId`, `metadata`, `input`) and `env` without altering downstream Python ML pipelines or database schemas.
|
3. **The Minimal Fix**: Update the code immediately after `JSON.parse` (e.g., `const payload = job._doc ?? job`) so it can handle messages both with and without a _doc wrapper. The fix must correctly retrieve the required fields (`_id`, `userAudioProfileId`,`metadata`, `input`, and `env`) without changing the existing Python ML code or database structure.
|
||||||
4. **Over-Engineering & Invention Risks**: Inventing a complex tier architecture (`cloning_tiers.js`), adding optional Mongoose schema fields (`VoiceCloning.tier`), or introducing `pro_v2/` S3 key prefixes invents an unverified contract based on old commits that risks breaking downstream consumers expecting standard S3 keys.
|
4. **Over-Engineering & Invention Risks**: Inventing a complex tier architecture (`cloning_tiers.js`), adding optional Mongoose schema fields (`VoiceCloning.tier`), or introducing `pro_v2/` S3 key prefixes invents an unverified contract based on old commits that risks breaking downstream consumers expecting standard S3 keys.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user