Operant Studio
OPER-185

D-29: autogen confidence-tier auto-promote DRAFT->READY

Suggested
Justin Cooke

Body

---
feature_id: FEAT-studio-qa
---

> D-29 ticket 2: autogen confidence-tier auto-promote. Target FEAT-studio-qa-autogen-auto-promote (child added via feature-map PR).

## Context

(PDT decision-memo lineage; see source line below.)

**Source: PDT D-29 (coverage by construction), ticket 2 of 5.**

## What
Add `confidence: "high" | "low"` field to `TestCaseCandidate` type in `packages/qa/src/autogen-candidates.ts`. Wire into scanners:
- `apiRoot` scanner emits `confidence: high` when the route exports typed request/response schemas
- All other cases emit `confidence: low`

In `packages/qa/src/autogen-writer.ts`, threshold on the confidence:
- `high` -> writes `status: READY` (auto-promotes past DRAFT)
- `low` -> writes `status: DRAFT` (stays gated for human review)

Existing DRAFTs from prior autogen runs stay DRAFT; no backfill script.

## Jordan mitigation
Auto-promote only fires on `confidence: high`. False-positive risk from shallow happy-path tests is bounded by the scanner's ability to detect typed schemas. `low` confidence tests still route via ticket 3 (WRITE_TEST) to a human.

## Acceptance Criteria
- [ ] `TestCaseCandidate.confidence` field exists as "high" | "low"
- [ ] `apiRoot` scanner emits confidence based on typed-schema presence
- [ ] `autogen-writer.ts` respects the tier: high -> READY, low -> DRAFT
- [ ] Unit test covering both paths

## Feature
FEAT-studio-qa-autogen-auto-promote (add via feature-map + depmap two-PR sequence FIRST)

## Blocked-by
None (independent, dispatches in parallel with ticket 1).

## Size / Band
SMALL / assurance.

Attachments

Loading attachments…

Comments

Loading comments…