--- name: cto-case-stage2-artificial-fixture-issues tier: local status: draft owner: jp source: sot/03-PROTOCOLS/CTO-CASE-STAGE2-ARTIFICIAL-FIXTURE-PRD.md created: 2026-05-31 last_reviewed: 2026-05-31 lifecycle_classification: planning core_promotion_status: not-promoted description: Child-local issue sequence for Stage 2 Case artificial fixture proof. --- # CTO Case Stage 2 Artificial Fixture Issues Local planning SOT only. Not a Core Protocol. Not active Core authority. ## Issue Sequence ### CTO-WORK-011 - Stage 2 Artificial Fixture PRD Type: AFK Blocked by: CTO-WORK-010 User stories covered: CTO Case Candidate Backend PRD stories 4, 5, 7, 8, 9, 10, 11, 13. What to build: Define the Stage 2 artificial fixture proof before implementation starts. Acceptance criteria: - [ ] PRD states Stage 2 allowed mutation scope is `copied artificial case only`. - [ ] PRD requires Stage 1 validation before Stage 2. - [ ] PRD requires `CTO_HARNESS_ALLOW_CASE=1` and `CTO_HARNESS_CASE_STAGE=2`. - [ ] PRD defines allowed roots as `runtime_workspace_root` and `run_artifact_dir`. - [ ] PRD keeps fake as the default validation lane. - [ ] PRD forbids Target Repository, Case source, vendor source, external developer repo, Hermes WebUI, and Cortex Core mutation. - [ ] PRD requires no-target-inspection proof from task contract, command arguments, runtime inputs, environment, and config. - [ ] PRD requires full Harness Evidence Interface artifacts, digests, freshness proof, and allowed-write proof. - [ ] PRD requires same-run fake baseline comparison. - [ ] PRD requires no-diff, disallowed-file, failed-tests, missing-test-command, missing-required-event, and provider-unavailable failure fixtures. - [ ] Local CTO validator checks Stage 2 PRD and issue artifact. Allowed files: CTO child workspace planning docs and local validator only. Validator: `python3 tools/validate_cto_child.py` Done evidence: PRD, issue artifact, validator JSON, clean worktree, commit. ### CTO-WORK-012 - Stage 2 Harness Artificial Fixture Route Type: AFK Blocked by: CTO-WORK-011 User stories covered: CTO Case Candidate Backend PRD stories 4, 5, 7, 8, 9, 10, 11, 13. What to build: In `/home/svrnty/workspaces/hermes/cto/harness`, implement the Stage 2 Case artificial fixture route behind the existing `case` engine seam. Acceptance criteria: - [ ] `case` remains disabled by default. - [ ] `CTO_HARNESS_ALLOW_CASE=1` remains required. - [ ] `CTO_HARNESS_CASE_STAGE=2` is required before artificial fixture Case execution. - [ ] Missing Stage 2 gate emits blocked evidence and does not run Case. - [ ] Passing Stage 2 run mutates only the copied artificial runtime workspace. - [ ] No Target Repository path is inspected or copied. - [ ] Task contract, command arguments, runtime inputs, environment, and config expose no Target Repository path. - [ ] Writable roots are limited to `runtime_workspace_root` and `run_artifact_dir`. - [ ] No files under harness source checkout, target repo, Case source, vendor source, external developer repositories, or Cortex Core are changed during execution. - [ ] Required artifacts include `report.json`, `report.md`, `events.normalized.jsonl`, `trace.jsonl`, `patch.diff`, `test.log`, and backend raw logs under `backend/`. - [ ] `report.json` records `backend: case`, `source_admission_status: not_admitted`, `case_process_started`, `allowed_writes_passed`, changed files, blockers, artifact digests, and freshness proof. - [ ] Pass events include `run.started`, `task.contract.created`, `plan.updated`, `patch.applied`, `git.diff.checked`, `verification.completed`, and `run.completed`. - [ ] Same-run fake baseline comparison records fake and Case artifact paths. - [ ] Failure fixtures fail closed for no diff, disallowed file, failed tests, missing test command, missing required event, and provider unavailable. - [ ] Fake remains the default validation lane and broad health remains green after focused Stage 2 validation. Allowed files: Hermes CTO harness engine, artificial fixtures, focused Stage 2 validator, harness docs, and tests. WebUI, Core, Case source, vendor source, and Target Repositories are forbidden. Validator: `python3 harness/runner/validate-case-stage2.py --harness-root harness --json`, then `harness/evals/health.sh --json`. Done evidence: Stage 2 pass report, failure fixture reports, artifact digests, no-mutation proof, clean worktree, commit. ## Granularity Check This is intentionally two slices: one planning route and one executable harness route. It is not over-granular because Stage 2 is the first Case execution boundary and must be reviewed before any copied-repo work.