Operant Studio
OPER-129

[OPER-QA-2] Assignment notification — new RUN_TEST Ledger Task on assignment materialization

Band
MEDIUM
Suggested
Justin Cooke

Body

feature_id: FEAT-studio-qa-projects

## Context

When `resolveAssignmentsForProject` (OPER-115) materializes a new `TestAssignment`, this module creates a corresponding Ledger Task labeled `RUN_TEST` in the tester's team, so it surfaces in the tester's Portico QATaskInbox (POR-QA-2).

Ratified: [REDACTED-DOB] QA-primitive PDT ("tester actions surface as ordinary Ledger Task labels — RUN_TEST, RETEST_BUG, REVIEW_FAILURE, ANSWER_CLARIFICATION, REVIEW_EVIDENCE, ATTEST_PHASE_COMPLETE").

## Acceptance Criteria

- `packages/qa/src/notify.ts` exports `notifyOnAssignment(assignment: TestAssignment): Promise<{ task: Task }>`
- Creates a Ledger Task with `title = [RUN_TEST] <testCase.title>`, `labels = ['qa', 'run-test', 'assignment:' + assignment.id]`, `assigneeId = assignment.assigneeId`, body carries `feature_id: <testCase.featureId>`, `## Context` (assignment metadata), `## Acceptance Criteria` (test case checklist)
- Idempotent by `assignment.id` label match — re-resolving the same assignment is a no-op
- Called from OPER-115's `resolveAssignmentsForProject` in the same transaction (or same batch) that inserts TestAssignment rows
- Vitest coverage: (a) new assignment → new Task; (b) re-materialize → no duplicate; (c) assignment CANCELED → corresponding Task CANCELED

Attachments

Loading attachments…

Comments

Loading comments…