--- name: cto-case-stage3-copied-repo-issues tier: local status: draft owner: jp source: .sot/03-PROTOCOLS/CTO-CASE-STAGE3-COPIED-REPO-PRD.md created: 2026-06-01 last_reviewed: 2026-06-01 lifecycle_classification: planning core_promotion_status: not-promoted description: Child-local issue sequence for Stage 3 Case copied-repo fixture proof. --- # CTO Case Stage 3 Copied Repo Issues Local planning SOT only. Not a Core Protocol. Not active Core authority. ## Issue Sequence ### CTO-WORK-033 - Stage 3 Copied Repo PRD Type: AFK Status: validated. Blocked by: CTO-WORK-012 User stories covered: CTO Case Candidate Backend PRD stories 4, 5, 7, 8, 9, 10, 11, 13. What to build: Define the Stage 3 copied-repo fixture proof before implementation starts. Acceptance criteria: - [ ] PRD states Stage 3 allowed mutation scope is `copied local repository fixture only`. - [ ] PRD requires Stage 2 validation before Stage 3. - [ ] PRD requires `CTO_HARNESS_ALLOW_CASE=1` and `CTO_HARNESS_CASE_STAGE=3`. - [ ] PRD requires source repository ownership and local source classification. - [ ] PRD requires source repository HEAD and status before and after Case execution. - [ ] PRD requires copied fixture clean start and clean end proof. - [ ] PRD forbids Target Repository, source repository, Case source, vendor source, Hermes WebUI, and Cortex Core mutation. - [ ] PRD requires full Harness Evidence Interface artifacts. - [ ] PRD requires dirty-starting-tree, dirty-ending-tree, timeout, artifact-write-failure, disallowed-file, failed-tests, and missing-required-event failure fixtures. - [ ] Local CTO validator checks Stage 3 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-034 - Stage 3 Harness Copied Repo Fixture Route Type: AFK Status: validated. Blocked by: CTO-WORK-033 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 3 copied-repo 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=3` is required before copied-repo Case execution. - [ ] Missing Stage 3 gate emits blocked evidence and does not run Case. - [ ] Source repository is copied before Case starts. - [ ] Source repository HEAD and status before/after proof match. - [ ] Case mutates only the copied fixture. - [ ] Copied fixture starts clean and ends clean after harness post-processing. - [ ] No Target Repository path is inspected or copied. - [ ] Required artifacts include source non-mutation proof, clean-start proof, clean-end proof, `report.json`, `report.md`, `events.normalized.jsonl`, `trace.jsonl`, `patch.diff`, `test.log`, and backend logs. - [ ] Failure fixtures fail closed for dirty source start, dirty copied fixture start, dirty copied fixture end, timeout, artifact write failure, disallowed file, failed tests, and missing required event. - [ ] Fake remains the default validation lane and broad health remains green after focused Stage 3 validation. Allowed files: Hermes CTO harness engine, copied-repo fixtures, focused Stage 3 validator, harness docs, and tests. WebUI, Core, Case source, vendor source, source repository, Target Repository, and external developer repositories are forbidden. Validator: `python3 harness/runner/validate-case-stage3.py --harness-root harness --json`, then `harness/evals/health.sh --json`. Done evidence: - Hermes commit: `4edf5f1 Add Case Stage 3 copied repo harness proof`. - Stage 3 pass report: `/home/svrnty/.hermes/profiles/cto-planb/harness-runs/20260601T031903Z-r1-string-slugify-3018046/report.json`. - Stage 3 source proof: `/home/svrnty/.hermes/profiles/cto-planb/harness-runs/20260601T031903Z-r1-string-slugify-3018046/stage3-copied-repo-proof.json`. - Final post-merge focused validator: `python3 harness/runner/validate-case-stage3.py --harness-root harness --json`. - Final post-merge aggregate validator: `harness/evals/health.sh --json`. - Hermes main worktree clean after fast-forward merge. ## Granularity Check This is intentionally two slices: one planning route and one executable harness route. It is not over-granular because Stage 3 introduces source repository copy and non-mutation proof, which are distinct from Stage 2 artificial fixture proof.