repo-harness 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/AGENTS.md +4 -1
  2. package/CLAUDE.md +4 -1
  3. package/README.es.md +3 -3
  4. package/README.fr.md +3 -3
  5. package/README.ja.md +3 -3
  6. package/README.md +3 -3
  7. package/README.zh-CN.md +3 -3
  8. package/assets/hooks/pre-edit-guard.sh +2 -2
  9. package/assets/hooks/prompt-guard.sh +6 -6
  10. package/assets/hooks/session-start-context.sh +1 -1
  11. package/assets/hooks/stop-orchestrator.sh +1 -1
  12. package/assets/partials/08-orchestration.partial.md +4 -2
  13. package/assets/partials-agents/02-operating-mode.partial.md +1 -1
  14. package/assets/partials-agents/03-orchestration.partial.md +1 -1
  15. package/assets/partials-agents/04-task-protocol.partial.md +5 -5
  16. package/assets/reference-configs/agentic-development-flow.md +7 -6
  17. package/assets/reference-configs/document-generation.md +1 -0
  18. package/assets/reference-configs/harness-overview.md +6 -4
  19. package/assets/reference-configs/sprint-contracts.md +4 -1
  20. package/assets/reference-configs/workflow-orchestration.md +12 -0
  21. package/assets/skill-commands/repo-harness-gptpro/SKILL.md +2 -1
  22. package/assets/skill-commands/repo-harness-sprint/SKILL.md +8 -7
  23. package/assets/skill-version.json +6 -2
  24. package/assets/templates/helpers/archive-workflow.sh +36 -0
  25. package/assets/templates/helpers/capture-plan.sh +159 -6
  26. package/assets/templates/helpers/check-task-workflow.sh +206 -0
  27. package/assets/templates/helpers/contract-worktree.sh +36 -1
  28. package/assets/templates/helpers/ensure-task-workflow.sh +16 -2
  29. package/assets/templates/helpers/new-plan.sh +13 -0
  30. package/assets/templates/helpers/plan-to-todo.sh +151 -0
  31. package/assets/templates/helpers/ship-worktrees.sh +36 -1
  32. package/assets/templates/helpers/sprint-backlog.sh +60 -40
  33. package/assets/templates/plan.template.md +13 -0
  34. package/assets/templates/sprint.template.md +3 -2
  35. package/package.json +2 -2
  36. package/scripts/archive-workflow.sh +36 -0
  37. package/scripts/capture-plan.sh +159 -6
  38. package/scripts/check-task-workflow.sh +206 -0
  39. package/scripts/contract-worktree.sh +36 -1
  40. package/scripts/ensure-task-workflow.sh +16 -2
  41. package/scripts/lib/project-init-lib.sh +18 -2
  42. package/scripts/new-plan.sh +13 -0
  43. package/scripts/plan-to-todo.sh +151 -0
  44. package/scripts/ship-worktrees.sh +36 -1
  45. package/scripts/sprint-backlog.sh +60 -40
  46. package/scripts/sync-codex-installed-copies.sh +2 -0
  47. package/src/cli/mcp/setup.ts +3 -3
  48. package/src/cli/mcp/tools.ts +101 -14
  49. package/src/core/adoption/gitignore-plan.ts +2 -0
package/AGENTS.md CHANGED
@@ -30,11 +30,14 @@ This repository self-hosts the `repo-harness` contract; the former `repo-harness
30
30
  - Keep `assets/workflow-contract.v1.json` and `.ai/harness/workflow-contract.json` in sync.
31
31
  - Keep `CLAUDE.md` and `AGENTS.md` short; put detailed guidance in `docs/reference-configs/`.
32
32
  - Treat Codex auto-compact as a fallback only; use `.ai/harness/handoff/current.md` and `.ai/harness/handoff/resume.md` for long-task rollover.
33
+ - Treat `.ai/harness/checks/*.latest.{json,md}` and `.ai/harness/runs/` as ignored runtime evidence cache; commit durable conclusions in `tasks/reviews/`, `tasks/contracts/`, `tasks/notes/`, or `docs/researches/` instead.
34
+ - Treat architecture/spec/research docs as the human reading entrypoint. Before closing a workflow, promote durable conclusions into `docs/architecture/`, `docs/researches/`, `docs/spec.md`, or `tasks/lessons.md`; then archive fulfilled plan/contract/review/notes/todo artifacts so root workflow surfaces represent active work only. `.rgignore` hides archived workflow artifacts and runtime evidence from default `rg` searches; use explicit paths or `rg -uu` for audits.
33
35
  - Treat `_ref/` as an occasional ignored external reference checkout cache, not a commit surface or daily workflow. Agents may read or refresh it for comparison; when it influences a decision, cite the source repo plus commit/tag and path in `tasks/notes/` or `docs/researches/`.
34
36
  - Treat `deploy/` as the trackable deployment and operations surface for runbooks, submission materials, release checklists, helper scripts, ordered SQL files under `deploy/sql/`, and env examples.
35
37
  - Treat `_ops/` as ignored local operations state for secrets, real env files, provider state, artifacts, logs, and scratch files; do not commit or agent-edit `_ops/*`.
36
38
  - Treat contract-level task execution as worktree-first: `scripts/plan-to-todo.sh --plan <approved-plan>` starts `scripts/contract-worktree.sh start --plan <approved-plan>` when policy enables it, and completed blocks finish through Waza `/check` plus `scripts/contract-worktree.sh finish`.
37
- - After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete plan, capture it with `scripts/capture-plan.sh --slug <slug> --title <title>` so `plans/` becomes the file-backed source of truth; if the user has already approved implementation, capture with `--status Approved --execute` or run `scripts/plan-to-todo.sh --plan <active-plan>`.
39
+ - After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete work-package plan, capture it with `scripts/capture-plan.sh --artifact-level work-package --slug <slug> --title <title>` so `plans/` becomes the file-backed source of truth; if the user has already approved implementation, capture with `--status Approved --execute --promotion-reason <merge_boundary|rollback_boundary|verification_boundary|risk_boundary|human_decision_boundary|worktree_boundary>` or run `scripts/plan-to-todo.sh --plan <active-plan>`.
40
+ - Promote work into a top-level `plans/plan-*.md` only when `Artifact Level: work-package` is justified by a merge/PR unit, rollback surface, independent verification boundary, review/acceptance boundary, high-risk surface, or otherwise cannot remain a checklist item in the current active plan or sprint backlog. Inline sprint rows and checklist rows stay in the sprint backlog or active plan `## Task Breakdown`; contract rows may expand into plan -> contract -> review -> notes only through the work-package gate.
38
41
  - If current repo state conflicts with the task, open an isolated `codex/<task-slug>` worktree, finish there, run Waza `/check`-style validation, then merge back to `main` without absorbing unrelated dirty changes.
39
42
  - Route product discovery to gstack `office-hours`, complex engineering plans to gstack `plan-eng-review`, design plans to gstack `plan-design-review`, and daily small/medium planning, bug hunts, and checks to Waza `/think`, `/hunt`, and `/check`.
40
43
  - Codex automation profile is runtime-referenced, not vendored: required skills are `health`, `check`, and `diagram-design` from `~/.codex/skills`.
package/CLAUDE.md CHANGED
@@ -30,11 +30,14 @@ This repository self-hosts the `repo-harness` contract; the former `repo-harness
30
30
  - Keep `assets/workflow-contract.v1.json` and `.ai/harness/workflow-contract.json` in sync.
31
31
  - Keep `CLAUDE.md` and `AGENTS.md` short; put detailed guidance in `docs/reference-configs/`.
32
32
  - Treat Codex auto-compact as a fallback only; use `.ai/harness/handoff/current.md` and `.ai/harness/handoff/resume.md` for long-task rollover.
33
+ - Treat `.ai/harness/checks/*.latest.{json,md}` and `.ai/harness/runs/` as ignored runtime evidence cache; commit durable conclusions in `tasks/reviews/`, `tasks/contracts/`, `tasks/notes/`, or `docs/researches/` instead.
34
+ - Treat architecture/spec/research docs as the human reading entrypoint. Before closing a workflow, promote durable conclusions into `docs/architecture/`, `docs/researches/`, `docs/spec.md`, or `tasks/lessons.md`; then archive fulfilled plan/contract/review/notes/todo artifacts so root workflow surfaces represent active work only. `.rgignore` hides archived workflow artifacts and runtime evidence from default `rg` searches; use explicit paths or `rg -uu` for audits.
33
35
  - Treat `_ref/` as an occasional ignored external reference checkout cache, not a commit surface or daily workflow. Agents may read or refresh it for comparison; when it influences a decision, cite the source repo plus commit/tag and path in `tasks/notes/` or `docs/researches/`.
34
36
  - Treat `deploy/` as the trackable deployment and operations surface for runbooks, submission materials, release checklists, helper scripts, ordered SQL files under `deploy/sql/`, and env examples.
35
37
  - Treat `_ops/` as ignored local operations state for secrets, real env files, provider state, artifacts, logs, and scratch files; do not commit or agent-edit `_ops/*`.
36
38
  - Treat contract-level task execution as worktree-first: `scripts/plan-to-todo.sh --plan <approved-plan>` starts `scripts/contract-worktree.sh start --plan <approved-plan>` when policy enables it, and completed blocks finish through Waza `/check` plus `scripts/contract-worktree.sh finish`.
37
- - After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete plan, capture it with `scripts/capture-plan.sh --slug <slug> --title <title>` so `plans/` becomes the file-backed source of truth; if the user has already approved implementation, capture with `--status Approved --execute` or run `scripts/plan-to-todo.sh --plan <active-plan>`.
39
+ - After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete work-package plan, capture it with `scripts/capture-plan.sh --artifact-level work-package --slug <slug> --title <title>` so `plans/` becomes the file-backed source of truth; if the user has already approved implementation, capture with `--status Approved --execute --promotion-reason <merge_boundary|rollback_boundary|verification_boundary|risk_boundary|human_decision_boundary|worktree_boundary>` or run `scripts/plan-to-todo.sh --plan <active-plan>`.
40
+ - Promote work into a top-level `plans/plan-*.md` only when `Artifact Level: work-package` is justified by a merge/PR unit, rollback surface, independent verification boundary, review/acceptance boundary, high-risk surface, or otherwise cannot remain a checklist item in the current active plan or sprint backlog. Inline sprint rows and checklist rows stay in the sprint backlog or active plan `## Task Breakdown`; contract rows may expand into plan -> contract -> review -> notes only through the work-package gate.
38
41
  - If current repo state conflicts with the task, open an isolated `codex/<task-slug>` worktree, finish there, run Waza `/check`-style validation, then merge back to `main` without absorbing unrelated dirty changes.
39
42
  - Route product discovery to gstack `office-hours`, complex engineering plans to gstack `plan-eng-review`, design plans to gstack `plan-design-review`, and daily small/medium planning, bug hunts, and checks to Waza `/think`, `/hunt`, and `/check`.
40
43
  - Codex automation profile is runtime-referenced, not vendored: required skills are `health`, `check`, and `diagram-design` from `~/.codex/skills`.
package/README.es.md CHANGED
@@ -85,7 +85,7 @@ artifacts.
85
85
  ## Novedades
86
86
 
87
87
  Las notas de versión viven en [`docs/CHANGELOG.md`](docs/CHANGELOG.md). La línea
88
- actual es `0.8.1`.
88
+ actual es `0.8.2`.
89
89
 
90
90
  ## Cómo funciona
91
91
 
@@ -419,8 +419,8 @@ Guards habituales:
419
419
 
420
420
  ## Release actual
421
421
 
422
- - npm package: `repo-harness@0.8.1`
423
- - Generated workflow stamp: `repo-harness@0.8.1+template@0.8.1`
422
+ - npm package: `repo-harness@0.8.2`
423
+ - Generated workflow stamp: `repo-harness@0.8.2+template@0.8.2`
424
424
  - GitHub repository: `Ancienttwo/repo-harness`
425
425
  - Release history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
426
426
 
package/README.fr.md CHANGED
@@ -85,7 +85,7 @@ l'emportent.
85
85
  ## Nouveautés
86
86
 
87
87
  Les notes de version vivent dans [`docs/CHANGELOG.md`](docs/CHANGELOG.md). La
88
- ligne actuelle est `0.8.1`.
88
+ ligne actuelle est `0.8.2`.
89
89
 
90
90
  ## Comment ça marche
91
91
 
@@ -424,8 +424,8 @@ Guards courants :
424
424
 
425
425
  ## Release actuelle
426
426
 
427
- - npm package : `repo-harness@0.8.1`
428
- - Generated workflow stamp : `repo-harness@0.8.1+template@0.8.1`
427
+ - npm package : `repo-harness@0.8.2`
428
+ - Generated workflow stamp : `repo-harness@0.8.2+template@0.8.2`
429
429
  - GitHub repository : `Ancienttwo/repo-harness`
430
430
  - Release history : [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
431
431
 
package/README.ja.md CHANGED
@@ -75,7 +75,7 @@ review、checks、handoff と食い違う場合は、source artifacts を優先
75
75
  ## What's New
76
76
 
77
77
  リリースノートは [`docs/CHANGELOG.md`](docs/CHANGELOG.md) にあります。現在の
78
- ラインは `0.8.1` です。
78
+ ラインは `0.8.2` です。
79
79
 
80
80
  ## 仕組み
81
81
 
@@ -398,8 +398,8 @@ hook がブロックしたときは、まず terminal の構造化された出
398
398
 
399
399
  ## 現在の Release
400
400
 
401
- - npm package:`repo-harness@0.8.1`
402
- - Generated workflow stamp:`repo-harness@0.8.1+template@0.8.1`
401
+ - npm package:`repo-harness@0.8.2`
402
+ - Generated workflow stamp:`repo-harness@0.8.2+template@0.8.2`
403
403
  - GitHub repository:`Ancienttwo/repo-harness`
404
404
  - Release history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
405
405
 
package/README.md CHANGED
@@ -79,7 +79,7 @@ active plan, contract, review, checks, or handoff, the source artifacts win.
79
79
  ## What's New
80
80
 
81
81
  Release notes live in [`docs/CHANGELOG.md`](docs/CHANGELOG.md). The current line
82
- is `0.8.1`.
82
+ is `0.8.2`.
83
83
 
84
84
  ## How It Works
85
85
 
@@ -599,8 +599,8 @@ Most common guards:
599
599
 
600
600
  ## Current Release
601
601
 
602
- - npm package: `repo-harness@0.8.1`
603
- - Generated workflow stamp: `repo-harness@0.8.1+template@0.8.1`
602
+ - npm package: `repo-harness@0.8.2`
603
+ - Generated workflow stamp: `repo-harness@0.8.2+template@0.8.2`
604
604
  - GitHub repository: `Ancienttwo/repo-harness`
605
605
  - Release history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
606
606
 
package/README.zh-CN.md CHANGED
@@ -69,7 +69,7 @@ review、checks 或 handoff 冲突,以 source artifacts 为准。
69
69
 
70
70
  ## What's New
71
71
 
72
- Release notes 见 [`docs/CHANGELOG.md`](docs/CHANGELOG.md),当前版本线是 `0.8.1`。
72
+ Release notes 见 [`docs/CHANGELOG.md`](docs/CHANGELOG.md),当前版本线是 `0.8.2`。
73
73
 
74
74
  ## 工作原理
75
75
 
@@ -445,8 +445,8 @@ hook block 工作时,先看 terminal 里的结构化输出。核心字段是
445
445
 
446
446
  ## 当前 Release
447
447
 
448
- - npm package:`repo-harness@0.8.1`
449
- - Generated workflow stamp:`repo-harness@0.8.1+template@0.8.1`
448
+ - npm package:`repo-harness@0.8.2`
449
+ - Generated workflow stamp:`repo-harness@0.8.2+template@0.8.2`
450
450
  - GitHub repository:`Ancienttwo/repo-harness`
451
451
  - Release history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
452
452
 
@@ -115,12 +115,12 @@ run_edit_plan_gate() {
115
115
  if [[ -z "$gate_plan" || ! -f "$gate_plan" ]]; then
116
116
  echo "[PlanStatusGuard] No active plan covers implementation edit: $FILE_PATH"
117
117
  if [[ "$mode" == "advice" ]]; then
118
- echo "[PlanStatusGuard] Advisory: capture the approved plan with bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --execute"
118
+ echo "[PlanStatusGuard] Advisory: capture the approved plan with bash scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --execute"
119
119
  else
120
120
  hook_structured_error \
121
121
  "PlanStatusGuard" \
122
122
  "Implementation edit to $FILE_PATH without an active plan." \
123
- "Capture the approved planning output with bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --execute, or set policy .guards.edit_plan_gate to advice/off for this repo." \
123
+ "Capture the approved planning output with bash scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --execute, or set policy .guards.edit_plan_gate to advice/off for this repo." \
124
124
  "missing_artifact"
125
125
  exit 2
126
126
  fi
@@ -530,8 +530,8 @@ emit_pending_orchestration_capture_gate() {
530
530
  [[ -n "$source_ref" ]] && source_arg=" --source-ref <source-ref>"
531
531
  echo "[PlanCaptureGate] Implementation requested while a pending plan/orchestration discussion has not been captured."
532
532
  echo "[PlanCaptureGate] $(workflow_pending_orchestration_summary)"
533
- echo "[PlanCaptureGate] Capture the final plan body first; if implementation is already approved, use --status Approved --execute:"
534
- echo " printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --source ${kind:-host-plan} --orchestration-kind ${kind:-host-plan} --route planning --execute${source_arg}"
533
+ echo "[PlanCaptureGate] Capture the final plan body first; if implementation is already approved, use --status Approved --execute with a work-package promotion reason:"
534
+ echo " printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --source ${kind:-host-plan} --orchestration-kind ${kind:-host-plan} --route planning --execute${source_arg}"
535
535
  return 0
536
536
  }
537
537
 
@@ -662,7 +662,7 @@ maybe_capture_embedded_approved_plan() {
662
662
  fi
663
663
 
664
664
  echo "[PlanCaptureGate] Embedded approved plan detected. Capturing and projecting before implementation."
665
- if ! capture_output="$(printf '%s\n' "$body" | bash "scripts/capture-plan.sh" --slug "$slug" --title "$title" --status Approved --source user-approved-plan --route planning --execute 2>&1)"; then
665
+ if ! capture_output="$(printf '%s\n' "$body" | bash "scripts/capture-plan.sh" --slug "$slug" --title "$title" --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --source user-approved-plan --route planning --execute 2>&1)"; then
666
666
  printf '%s\n' "$capture_output"
667
667
  hook_structured_error \
668
668
  "PlanCaptureGate" \
@@ -906,18 +906,18 @@ render_prompt_guard_action() {
906
906
  echo "[PlanCaptureGate] Approval detected before an active plan artifact exists."
907
907
  echo "[PlanCaptureGate] Let the agent run the approved-plan capture path now:"
908
908
  echo " git status --short --branch -uall"
909
- echo " printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --source waza-think --route planning --execute"
909
+ echo " printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --source waza-think --route planning --execute"
910
910
  exit 0
911
911
  ;;
912
912
  plan_status_no_active_block)
913
913
  echo "[PlanStatusGuard] Advisory: No active plan found in plans/. Implementation edits will be blocked at the edit layer until a plan is captured."
914
- echo "[PlanStatusGuard] Capture the approved planning output with: bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --execute"
914
+ echo "[PlanStatusGuard] Capture the approved planning output with: bash scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --execute"
915
915
  echo "[PlanStatusGuard] If there is no captured planning output yet, run: bash scripts/ensure-task-workflow.sh --slug <slug> --title <title>"
916
916
  exit 0
917
917
  ;;
918
918
  plan_capture_draft_advice)
919
919
  echo "[PlanCaptureGate] Approval detected for $plan_status plan: $active_plan"
920
- echo "[PlanCaptureGate] Recapture the exact approved plan body with --status Approved --execute, or mark this plan Approved and run:"
920
+ echo "[PlanCaptureGate] Recapture the exact approved plan body with --artifact-level work-package --promotion-reason <reason> --status Approved --execute, or mark this plan Approved and run:"
921
921
  echo " bash scripts/plan-to-todo.sh --plan $active_plan"
922
922
  exit 0
923
923
  ;;
@@ -378,7 +378,7 @@ printf '%s\n' '<decision-complete plan body>' | bash ${capture_script} --slug ${
378
378
  If the user has already approved implementation:
379
379
 
380
380
  \`\`\`bash
381
- printf '%s\n' '<approved plan body>' | bash ${capture_script} --slug ${prompt_slug:-<slug>} --title <title> --status Approved --source ${capture_source} --orchestration-kind ${capture_source} --route planning --execute${source_arg}
381
+ printf '%s\n' '<approved plan body>' | bash ${capture_script} --slug ${prompt_slug:-<slug>} --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --source ${capture_source} --orchestration-kind ${capture_source} --route planning --execute${source_arg}
382
382
  \`\`\`
383
383
  EOF_CONTEXT
384
384
  }
@@ -152,7 +152,7 @@ If the planning answer is decision-complete, capture the final plan body before
152
152
  printf '%s\n' '<decision-complete plan body>' | bash scripts/capture-plan.sh --slug $(plan_completeness_shell_quote "$prompt_slug") --title ${title_arg} --status Draft --source $(plan_completeness_shell_quote "$kind") --orchestration-kind $(plan_completeness_shell_quote "$kind") --route planning${source_arg}
153
153
 
154
154
  If the user already approved implementation, use:
155
- printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug $(plan_completeness_shell_quote "$prompt_slug") --title ${title_arg} --status Approved --source $(plan_completeness_shell_quote "$kind") --orchestration-kind $(plan_completeness_shell_quote "$kind") --route planning --execute${source_arg}
155
+ printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug $(plan_completeness_shell_quote "$prompt_slug") --title ${title_arg} --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --source $(plan_completeness_shell_quote "$kind") --orchestration-kind $(plan_completeness_shell_quote "$kind") --route planning --execute${source_arg}
156
156
 
157
157
  Use a short English title/source-ref alias in these runtime instructions; do not paste non-ASCII prompt text into command arguments.
158
158
 
@@ -14,10 +14,12 @@
14
14
  ### 3. Plan Node Default
15
15
  - Enter plan mode for non-trivial tasks.
16
16
  - If no stable product truth exists, run `bash .ai/harness/scripts/new-spec.sh`.
17
- - When Codex Plan mode or Waza `/think` reaches a decision-complete plan, capture it with `bash .ai/harness/scripts/capture-plan.sh --slug <slug> --title <title>` and the plan text on stdin.
17
+ - When Codex Plan mode or Waza `/think` reaches a decision-complete work-package plan, capture it with `bash .ai/harness/scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason <merge_boundary|rollback_boundary|verification_boundary|risk_boundary|human_decision_boundary|worktree_boundary>` and the plan text on stdin.
18
+ - When the output is only the next checklist row for the current active plan, capture it with `bash .ai/harness/scripts/capture-plan.sh --artifact-level checklist-row --slug <slug> --title <title>` so the row stays in `## Task Breakdown`.
18
19
  - If no captured active execution plan exists, run `bash .ai/harness/scripts/new-plan.sh --slug <slug> --title <title>` or capture a finished planning note with `bash .ai/harness/scripts/capture-plan.sh`.
19
20
  - If the user asks for a Sprint backlog, run `bash .ai/harness/scripts/new-sprint.sh --slug <slug> --title <title>`; it writes `plans/sprints/*.sprint.md`, not `plans/plan-*.md`.
20
- - When the user approves implementation, run `bash .ai/harness/scripts/plan-to-todo.sh --plan <active-plan>` or capture the approved plan with `--status Approved --execute`; this creates contract/review/notes scaffolding and leaves plan tasks in `## Task Breakdown`.
21
+ - When the user approves implementation, run `bash .ai/harness/scripts/plan-to-todo.sh --plan <active-plan>` or capture the approved work-package plan with `--artifact-level work-package --promotion-reason <reason> --status Approved --execute`; this creates contract/review/notes scaffolding and leaves plan tasks in `## Task Breakdown`.
22
+ - Promote work into a top-level plan only when `Artifact Level: work-package` and the Promotion Gate are concrete: merge/PR unit, rollback surface, verification boundary, review/acceptance boundary, high-risk surface, and why it cannot stay a checklist row. Inline sprint rows stay in the sprint backlog or active plan `## Task Breakdown`.
21
23
  - Re-plan when execution drifts.
22
24
 
23
25
  ### 4. Research Delegation Strategy
@@ -38,7 +38,7 @@
38
38
  - After substantive repo changes, run `bash .ai/harness/scripts/check-task-sync.sh` and `bash .ai/harness/scripts/check-task-workflow.sh --strict`.
39
39
  - Primary worktree warns by default; enforce via `.claude/.require-worktree`.
40
40
  - Contract-level execution is worktree-first: `.ai/harness/scripts/plan-to-todo.sh --plan <approved-plan>` starts a linked `codex/<slug>` worktree when policy enables it, and `.ai/harness/scripts/contract-worktree.sh finish` merges back only after Waza `/check` and sprint verification pass.
41
- - After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete plan, capture it with `.ai/harness/scripts/capture-plan.sh --slug <slug> --title <title>`; if implementation is already approved, capture with `--status Approved --execute` or run `.ai/harness/scripts/plan-to-todo.sh --plan <active-plan>`.
41
+ - After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete work-package plan, capture it with `.ai/harness/scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason <merge_boundary|rollback_boundary|verification_boundary|risk_boundary|human_decision_boundary|worktree_boundary>` only when `Artifact Level: work-package` and the Promotion Gate are concrete; if implementation is already approved, capture with `--artifact-level work-package --promotion-reason <reason> --status Approved --execute` or run `.ai/harness/scripts/plan-to-todo.sh --plan <active-plan>`. Inline sprint rows stay in the sprint backlog or active plan `## Task Breakdown`; checklist-row captures should use `--artifact-level checklist-row` and must not expand into plan -> contract -> review -> notes.
42
42
  - If repo state conflicts with the task, use an isolated `codex/<task-slug>` worktree, validate with Waza `/check`, and merge back to `main` without unrelated dirty changes.
43
43
 
44
44
  ---
@@ -12,7 +12,7 @@
12
12
  ### 3. Plan Node Default
13
13
  - Enter plan mode for non-trivial tasks.
14
14
  - If `docs/spec.md` is missing, run `bash .ai/harness/scripts/new-spec.sh` first.
15
- - Capture decision-complete Codex Plan mode or Waza `/think` output with `bash .ai/harness/scripts/capture-plan.sh --slug <slug> --title <title>`; if no captured active execution plan exists, use `new-plan.sh`; after approval, run `plan-to-todo.sh` or capture with `--status Approved --execute`.
15
+ - Capture decision-complete work-package output from Codex Plan mode or Waza `/think` with `bash .ai/harness/scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason <merge_boundary|rollback_boundary|verification_boundary|risk_boundary|human_decision_boundary|worktree_boundary>`; if no captured active execution plan exists, use `new-plan.sh`; after approval, run `plan-to-todo.sh` or capture with `--artifact-level work-package --promotion-reason <reason> --status Approved --execute`.
16
16
  - Use `new-sprint.sh` only for Sprint backlogs; it writes `plans/sprints/*.sprint.md`, while PRDs stay in `plans/prds/`.
17
17
  - Keep active checklist items in the active plan's `## Task Breakdown`; record only deferred goals in `tasks/todos.md`.
18
18
 
@@ -9,7 +9,7 @@ TASK_SOURCES:
9
9
  - tasks/reviews/
10
10
  - tasks/notes/
11
11
  - tasks/lessons.md
12
- - .ai/harness/checks/latest.json
12
+ - .ai/harness/checks/latest.json (ignored runtime evidence)
13
13
  - .ai/harness/handoff/current.md
14
14
  - plans/
15
15
 
@@ -17,7 +17,7 @@ PHASES: research -> spec -> plan -> contract -> implement -> verify -> check ->
17
17
 
18
18
  ARCHIVE:
19
19
  PLAN: plans/archive/
20
- TODO: tasks/archive/
20
+ TASK_ARTIFACTS: tasks/archive/
21
21
 
22
22
  RULES:
23
23
  - Treat repo-local artifact files as the primary cross-agent workflow contract
@@ -28,7 +28,7 @@ RULES:
28
28
  - Treat .ai/harness/active-plan as authoritative only for this worktree; .ai/harness/active-worktree records the owner; .claude/.active-plan is a legacy fallback during transition
29
29
  - Keep multiple active plans in parallel worktrees when tasks diverge; fill workflow inventory before implementation: active plan, owning worktree, contract, review, notes, deferred ledger, checks, runs, scope owner, switching rule, and worktree path
30
30
  - Process annotation notes before implementing
31
- - Project approved plans with .ai/harness/scripts/plan-to-todo.sh; the execution checklist stays in the plan ## Task Breakdown
31
+ - Project approved plans with .ai/harness/scripts/plan-to-todo.sh only after a concrete Promotion Gate; the execution checklist stays in the plan ## Task Breakdown, inline sprint rows stay inline, and only contract rows generate contract/review/notes artifacts
32
32
  - Define task contracts in tasks/contracts/{plan-stem}.contract.md
33
33
  - Fill tasks/reviews/{plan-stem}.review.md from Waza /check after verification
34
34
  - Record only non-obvious implementation decisions, deviations, tradeoffs, and open questions in tasks/notes/{plan-stem}.notes.md
@@ -39,14 +39,14 @@ RULES:
39
39
  - Distill repeated corrections into tasks/lessons.md instead of keeping them in tasks/todos.md
40
40
  - Capture deep findings and hidden contracts in docs/researches/
41
41
  - Keep sprint-level verification notes, behavior diffs, and residual risks in tasks/reviews/{plan-stem}.review.md
42
- - Do not use implementation notes as durable memory or task logs; archive them on close and promote only after evidence shows the rule should outlive the sprint
42
+ - Do not use implementation notes as durable memory or task logs; before closeout, promote durable truth into docs/architecture/, docs/researches/, docs/spec.md, or tasks/lessons.md, then archive fulfilled plan/contract/review/notes/todo artifacts so root workflow surfaces represent active work only
43
43
  - Promote implementation-ready follow-up work into a new plans/plan-{timestamp}-{slug}.md file; keep deferred goals in tasks/todos.md only when intentionally postponed
44
44
  - Treat `.ai/hooks/` as the shared automation entrypoint when repo scripts reference hook-backed workflow checks
45
45
  - Treat user-level `~/.claude/settings.json` and `~/.codex/hooks.json` as host adapters; do not add repo-local project hook adapters unless explicitly migrating legacy config
46
46
  - For Codex sessions, treat `bash .ai/harness/scripts/check-task-sync.sh` and `bash .ai/harness/scripts/check-task-workflow.sh --strict` as required repo-local checks
47
47
  - Before ending a session, refresh `.ai/harness/handoff/current.md` when the task state changed
48
48
  - Update `tasks/workstreams/` only when durable capability progress changes
49
- - Archive completed/abandoned plans and todos with metadata
49
+ - Archive completed/abandoned plans, contracts, reviews, notes, and todos with metadata
50
50
  {{#IF FACTOR_FACTORY_ENABLED}}
51
51
  - Treat `tasks/factors/registry.json` as the source of truth for factor lifecycle state
52
52
  - Create factor candidates with `bash .ai/harness/scripts/factor-lab-new.sh --name <slug>`
@@ -70,17 +70,18 @@ work, or shared contracts, report the P1/P2/P3 evidence explicitly.
70
70
  1. Route the request by intent before reading broadly.
71
71
  2. Read the repo-local contract first: `AGENTS.md` or `CLAUDE.md`, `tasks/todos.md`, `tasks/lessons.md`, and `.ai/harness/policy.json`.
72
72
  3. Use the selected skill or mode to produce either an approved plan, a root cause, or a review verdict.
73
- 4. When Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete plan, capture it into `plans/` with `.ai/harness/scripts/capture-plan.sh --slug <slug> --title <title>` and the plan text on stdin.
73
+ 4. When Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete work-package plan, capture it into `plans/` with `.ai/harness/scripts/capture-plan.sh --artifact-level work-package --slug <slug> --title <title>` and the plan text on stdin.
74
74
  5. Approved plans must include `## Evidence Contract` with state/progress path, verification evidence, evaluator rubric, stop condition, and rollback surface before execution. `capture-plan.sh` supplies this contract for captured planning output.
75
- 6. Convert approved plans to execution scaffolding with `.ai/harness/scripts/plan-to-todo.sh --plan <plan>`; if approval is already explicit, use `.ai/harness/scripts/capture-plan.sh --status Approved --execute ...`. The plan's own `## Task Breakdown` remains the execution checklist; `tasks/todos.md` remains a deferred-goal ledger. Contract-level plans are projected into a linked `codex/<slug>` worktree when the policy enables it.
76
- 7. For Sprint execution, treat each row in `plans/sprints/*.sprint.md` as a long-task waypoint. Use `$think` to expand the row into a decision-complete `plans/plan-*.md` before coding; do not treat the sprint row itself as an implementation plan.
77
- 8. Use `.ai/harness/scripts/refresh-current-status.sh` for an explicit `tasks/current.md` preview or `--write` snapshot. In non-target worktrees, `git show <target>:tasks/current.md` reads the mainline snapshot, but it never replaces source artifacts.
78
- 9. After substantive changes, run project checks and record evidence in `tasks/`. For contract worktrees, run Waza `/check`, start host-aware external acceptance in parallel, fill the review artifact from both verdicts, then use `repo-harness-ship` for default PR closeout. It calls `.ai/harness/scripts/contract-worktree.sh finish --no-merge`, pushes the `codex/<slug>` branch, and opens a draft PR. Use `repo-harness-ship --local-merge` only when an explicit maintainer workflow wants the older fast-forward merge and cleanup path.
75
+ 6. Convert approved work-package plans to execution scaffolding with `.ai/harness/scripts/plan-to-todo.sh --plan <plan>`; if approval is already explicit, use `.ai/harness/scripts/capture-plan.sh --artifact-level work-package --status Approved --execute --promotion-reason <reason> ...`. The plan's own `## Task Breakdown` remains the execution checklist; `tasks/todos.md` remains a deferred-goal ledger. Contract-level plans are projected into a linked `codex/<slug>` worktree when the policy enables it.
76
+ 7. Approved work-package plans must also include `> **Artifact Level**: work-package`, `> **Promotion Reason**:`, and `## Promotion Gate` with the merge/PR unit, rollback surface, independent verification boundary, review/acceptance boundary, high-risk surface, and why the work cannot remain a checklist row.
77
+ 8. For Sprint execution, treat each row in `plans/sprints/*.sprint.md` as a long-task waypoint. `contract` rows may expand with `$think` into a decision-complete `plans/plan-*.md`; `inline` rows stay in the sprint backlog or active plan `## Task Breakdown` and must not create contract/review/notes artifacts.
78
+ 9. Use `.ai/harness/scripts/refresh-current-status.sh` for an explicit `tasks/current.md` preview or `--write` snapshot. In non-target worktrees, `git show <target>:tasks/current.md` reads the mainline snapshot, but it never replaces source artifacts.
79
+ 10. After substantive changes, run project checks and record evidence in `tasks/`. For contract worktrees, run Waza `/check`, start host-aware external acceptance in parallel, fill the review artifact from both verdicts, then use `repo-harness-ship` for default PR closeout. It calls `.ai/harness/scripts/contract-worktree.sh finish --no-merge`, pushes the `codex/<slug>` branch, and opens a draft PR. Use `repo-harness-ship --local-merge` only when an explicit maintainer workflow wants the older fast-forward merge and cleanup path.
79
80
 
80
81
  ## Passive Plan Capture
81
82
 
82
83
  - Codex Plan mode and Waza `/think` do not need the user to remember `new-sprint` or `plan-to-todo`.
83
- - The agent should capture decision-complete planning output with `.ai/harness/scripts/capture-plan.sh`; the script sets `.ai/harness/active-plan`, writes `.ai/harness/active-worktree`, mirrors `.claude/.active-plan`, and writes a timestamped `plans/plan-*.md` artifact.
84
+ - The agent should capture decision-complete work-package planning output with `.ai/harness/scripts/capture-plan.sh --artifact-level work-package`; the script sets `.ai/harness/active-plan`, writes `.ai/harness/active-worktree`, mirrors `.claude/.active-plan`, and writes a timestamped `plans/plan-*.md` artifact with a concrete Artifact Level and Promotion Gate. Use `--artifact-level checklist-row` when the captured output should only extend the active plan's `## Task Breakdown`.
84
85
  - Planning capture is allowed before implementation. Contract, review, notes, and worktree artifacts are generated only after explicit implementation approval; `tasks/todos.md` is not a duplicate of plan tasks.
85
86
  - Current-status capture is separate from planning capture: `tasks/current.md` is regenerated from artifacts for orientation, not edited as a plan or task list.
86
87
 
@@ -29,6 +29,7 @@ Create these only when the agent has concrete repo evidence or the user asks:
29
29
  - Do not create root `specs/`; use `docs/spec.md` for stable product intent, `interfaces/` for machine-consumed runtime boundaries, and tests for executable behavior.
30
30
  - Do not duplicate workflow rules already indexed in `docs/reference-configs/`.
31
31
  - Prefer short docs that name sources, owners, and verification commands.
32
+ - Use `plans/plan-*.md` plus contract/review/notes only for `Artifact Level: work-package` boundaries. Sprint rows, red/green steps, and local run traces stay in the active plan, sprint backlog, or ignored `.ai/harness/*` runtime state.
32
33
  - Let capability `CLAUDE.md` and `AGENTS.md` carry local contract projections; root docs stay concise.
33
34
  - Keep complete workstream TODOs in `tasks/workstreams/<domain>/<capability>/`; contract blocks should link to them instead of becoming task logs.
34
35
  - Keep onboarding docs split by reader: agents read active source artifacts first; humans review the Human Review Card, diff, latest trace, and rollback first.
@@ -11,8 +11,8 @@ or refreshes a repo. The harness gives agents three durable surfaces:
11
11
  `AGENTS.md`, and root `CLAUDE.md` explain stable product intent, coding
12
12
  rules, and local workflow boundaries.
13
13
  - **Task contracts**: `plans/`, `tasks/contracts/`, `tasks/reviews/`, and
14
- `.ai/harness/checks/` turn a request into scoped implementation work with
15
- evidence-backed completion.
14
+ the current `.ai/harness/checks/latest.json` pointer turn a request into
15
+ scoped implementation work with evidence-backed completion.
16
16
  - **Session journal**: `.ai/harness/handoff/`, `tasks/current.md`, and
17
17
  `.ai/harness/events.jsonl` let a new agent session resume from repo state
18
18
  without treating chat history as authority.
@@ -76,14 +76,16 @@ with the project.
76
76
 
77
77
  - Notes: `tasks/notes/<plan-stem>.notes.md` is task-local and auditable. It should not be treated as durable knowledge by default.
78
78
  - Current status: `tasks/current.md` is a tracked derived snapshot for orientation only. It must be regenerated from source artifacts and must not contain hand-written kanban/checklist state.
79
- - Evidence: `.ai/harness/checks/latest.json` is the current gate, while `.ai/harness/runs/*.json` keeps immutable verification snapshots for later audit.
79
+ - Evidence: `.ai/harness/checks/latest.json` is the current gate, while `.ai/harness/runs/*.json` keeps ignored local verification snapshots for the current workflow audit. Task-specific `.ai/harness/checks/*.latest.{json,md}` reports are ignored runtime cache; promote durable conclusions into reviews, contracts, notes, or research.
80
+ - Human reading surface: `docs/spec.md`, `docs/architecture/`, and durable `docs/researches/` conclusions are the default entrypoint. Root workflow artifacts should describe active work only; completed plan/contract/review/notes/todo artifacts move to `plans/archive/` or `tasks/archive/`, and `.rgignore` keeps those archives plus runtime evidence out of default `rg` results.
81
+ - Closeout order: promote durable truth first, then archive the workflow artifacts. If a fact only lives in a review/contract/checks file, the workflow is not ready to disappear from the active reading surface.
80
82
  - Memory: `docs/researches/`, `tasks/lessons.md`, and gbrain are advisory. Current repo state and evidence override summaries.
81
83
  - External knowledge: `brain/<project>/*` stores long-form explanations, runbooks, decisions, and patterns. Hooks may write only explicitly opted-in `repo-to-brain` manifest entries; checks must not require gbrain or MCP.
82
84
  - Assets: policies, hooks, scripts, templates, and reference configs only change when a pattern has evidence across tasks or fixtures.
83
85
 
84
86
  ## Trace Evidence
85
87
 
86
- `scripts/verify-sprint.sh` writes `.ai/harness/checks/latest.json` and an immutable `.ai/harness/runs/*.json` snapshot using `schema: repo-harness-run-trace.v1`. The trace is local evidence for workflow grading, not a cloud tracing dependency.
88
+ `scripts/verify-sprint.sh` writes `.ai/harness/checks/latest.json` and an ignored `.ai/harness/runs/*.json` snapshot using `schema: repo-harness-run-trace.v1`. The trace is local evidence for workflow grading, not a cloud tracing dependency or a committed durable artifact.
87
89
 
88
90
  Required v1 fields:
89
91
 
@@ -16,12 +16,14 @@ The word "sprint" historically named a single execution slice in this harness. T
16
16
  - A PRD decomposes `docs/spec.md` intent into product direction, users, success criteria, acceptance scenarios, module behavior, data model, performance targets, and developer handoff. `repo-harness-prd` writes PRDs with compact/standard tiers and evidence rules for `[UNKNOWN]` / `[UNVERIFIED]` facts.
17
17
  - A Sprint decomposes a PRD or `docs/spec.md` into an ordered backlog; each backlog task executes as one task-contract slice through the existing plan -> contract -> worktree -> verify flow.
18
18
  - `tasks/todos.md` stays the deferred-goal ledger; it never carries the sprint backlog or any active checklist.
19
+ - Backlog row mode is a granularity decision. `contract` rows are allowed to become a top-level plan plus task contract only when they are captured as `Artifact Level: work-package` and pass the plan Promotion Gate. `inline` and `checklist-row` work stays inside the sprint backlog or active plan `## Task Breakdown` and must not generate contract/review/notes artifacts.
19
20
  - Legacy filenames: `verify-sprint.sh` and `new-sprint.sh` predate the program layer and are kept for downstream compatibility. Read them as task-contract verification helpers. New generated artifact headings and plan metadata should use **Task Contract** and **Task Review**.
20
21
  - Sprint lifecycle: `Draft -> Approved -> Executing -> Done -> Archived`, tracked in the sprint file's `> **Status**:` line. Where the sprint layer is installed, `scripts/sprint-backlog.sh` is the compatibility command and delegates to the installed helper runtime under `.ai/harness/scripts/`; `.ai/harness/sprint/active-sprint` (runtime state, not committed) marks the single active sprint. Harness installs predating the sprint layer do not ship the helper, so check for the script before invoking it. `check-task-workflow.sh` rejects Approved/Executing sprints whose PRD/source section is placeholder-only or whose backlog rows lack a concrete acceptance line.
21
22
 
22
23
  ## Inventory First
23
24
 
24
- - Every execution-ready `plans/plan-*.md` should name the active plan, owning worktree, expected contract, review, notes file, deferred-goal ledger, `.ai/harness/checks/latest.json`, `.ai/harness/runs/`, scope authority, plan switching rule, and worktree isolation path.
25
+ - Every execution-ready `plans/plan-*.md` should name the active plan, owning worktree, expected contract, review, notes file, deferred-goal ledger, `.ai/harness/checks/latest.json`, `.ai/harness/runs/`, scope authority, plan switching rule, and worktree isolation path. Checks latest files are runtime evidence pointers/cache, not commit surface.
26
+ - Every execution-ready `plans/plan-*.md` should declare `> **Artifact Level**: work-package`, `> **Promotion Reason**:`, `> **Verification Boundary**:`, and `> **Rollback Surface**:`. It should also fill `## Promotion Gate` with the merge/PR unit, rollback surface, verification boundary, review/acceptance boundary, high-risk surface, and why this cannot remain a checklist row.
25
27
  - Every `tasks/contracts/*.contract.md` should repeat the source plan, deferred-goal ledger, review, notes, checks, run snapshots, scope gate, and completion gate.
26
28
  - If the inventory is incomplete, keep the plan in Draft or revise the contract before editing implementation files.
27
29
 
@@ -81,6 +83,7 @@ Existing contracts without this block remain valid. `.ai/harness/scripts/verify-
81
83
  - A contract is not truly done until the matching review file records a passing recommendation.
82
84
  - `tasks/reviews/<plan-stem>.review.md` should be filled from Waza `/check` after verification and cite the contract, implementation notes, checks file, run snapshot, `## External Acceptance Advice`, and any manual observations.
83
85
  - `tasks/notes/<plan-stem>.notes.md` captures task-local decisions and should be archived or promoted deliberately, not left as hidden long-term memory.
86
+ - Closeout is promote-then-archive: durable truths move into `docs/architecture/`, `docs/researches/`, `docs/spec.md`, or `tasks/lessons.md` before `archive-workflow.sh` moves fulfilled plan/contract/review/notes/todo artifacts into `plans/archive/` and `tasks/archive/`.
84
87
 
85
88
  ## Worktree Lifecycle
86
89
 
@@ -12,3 +12,15 @@
12
12
  Concrete project execution still flows through plans, contracts, tasks,
13
13
  workstreams, checks, and handoff files. The general multi-phase orchestration
14
14
  pattern belongs in the external pattern page.
15
+
16
+ ## Promotion Gate
17
+
18
+ Do not promote every sprint row or checklist step into a new `plans/plan-*.md`.
19
+ Create a top-level plan only when the slice is a coherent merge/PR unit, has a
20
+ separate rollback surface, needs independent verification, needs its own
21
+ review/acceptance boundary, touches a high-risk surface, or cannot remain a
22
+ checklist row in the active plan or sprint backlog.
23
+
24
+ Inline sprint rows stay in the sprint backlog or the active plan's
25
+ `## Task Breakdown`. Contract rows may expand through the full plan -> contract
26
+ -> review -> notes flow.
@@ -47,7 +47,8 @@ Use GPT Pro language with the user. Treat the `browser-*` command names as imple
47
47
  When asking GPT Pro to review repo updates, include an explicit acceptance requirement in the prompt:
48
48
 
49
49
  - Use the recorded ChatGPT MCP server name from `chatgpt.serverName` to read the current repo state before producing findings or a merge/readiness verdict.
50
- - Before a Pro MCP attempt, open ChatGPT Settings -> Connectors for the recorded server name, run Refresh or Scan Tools, verify the expected Action is listed, then start a fresh chat and select the Connector from `+` -> More.
50
+ - Before a Pro MCP attempt, open ChatGPT Settings -> Connectors for the recorded server name, run Refresh or Scan Tools, verify the expected Action is listed, then start a fresh chat with Deep research enabled when the review requires Pro research, and select the Connector from `+` -> More.
51
+ - For multi-repo or user-scope reads, first call `discover_harness_repos` with `query`, `name`, or `repo_path` for repo-like text such as `my-app/`; use the returned exact target for follow-up workflow reads. Do not rely on a literal relative path guess.
51
52
  - Read at least the changed-file list or status, the relevant diffs or changed files, and any requested session/handoff artifacts through that recorded MCP server; pasted summaries are context, not sufficient evidence.
52
53
  - Include a short `MCP Read Evidence` section in the final answer naming the recorded MCP server, the reads performed, and the files, diffs, or artifacts inspected.
53
54
  - If the recorded MCP server name is missing, or `mcp doctor --json` reports `chatgpt.serverNameConfigured:false`, route to `repo-harness:gptpro_setup` so initialization can record it before review.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: repo-harness-sprint
3
- description: Program-level sprint planning and execution entrypoint. Uses upper-layer PRDs from plans/prds/ when present, writes ordered sprint backlogs in plans/sprints/, then expands each row with $think before the existing plan, contract, and worktree flow.
3
+ description: Program-level sprint planning and execution entrypoint. Uses upper-layer PRDs from plans/prds/ when present, writes ordered sprint backlogs in plans/sprints/, expands contract rows with $think into plan/contract/worktree flow, and keeps inline rows inside the sprint backlog or active plan checklist.
4
4
  when_to_use: "repo-harness-sprint, plan a sprint, create sprint backlog, from-prd, PRD to sprint, sprint from PRD, run next sprint task, sprint status"
5
5
  ---
6
6
 
@@ -19,15 +19,16 @@ Use this command to plan a program-level Sprint from an upper-layer PRD or sourc
19
19
  - Read the PRD `Problem`, `Users`, `Success Criteria`, `Acceptance Scenarios`, and `Non-goals`; summarize them into the Sprint `## PRD` section and set `> **Source PRD**:` to the PRD path.
20
20
  - Derive backlog rows from `Module Behaviors (P0)` and acceptance scenario groups. Preserve dependency order and make every acceptance line traceable to a PRD acceptance scenario.
21
21
  - Keep discussion focused on ordering, slice granularity, and mode selection; do not re-decide the product intent unless the PRD has blocking contradictions.
22
- - Use one row for one plan -> contract -> worktree cycle. Split larger work at stable integration boundaries.
22
+ - Use `contract` rows for one plan -> contract -> worktree cycle. Split larger work at stable integration boundaries.
23
23
  - Acceptance lines must be machine-checkable, such as a test command, file existence assertion, grep pattern, or numeric assertion. Avoid subjective wording such as "works well".
24
24
  - Default mode is `contract`; use `inline` only for small isolated documentation, configuration, or single-file changes.
25
25
  4. Route `run` (incremental, one backlog task per invocation):
26
26
  - Run `bash .ai/harness/scripts/sprint-backlog.sh next` to resolve the next pending row; when it exits 3, report the backlog as complete and recommend setting the sprint Status to Done after review.
27
- - Treat the row as a long-task waypoint, not a detailed implementation plan. Invoke `$think` with the sprint path, row task, mode, and acceptance line so the coding agent expands it into a decision-complete plan.
28
- - Capture the approved `$think` output with `bash .ai/harness/scripts/capture-plan.sh --source waza-think --source-ref sprint:<sprint-file>#<task> --status Approved --execute` so the plan projects through the contract worktree flow.
29
- - `bash .ai/harness/scripts/sprint-backlog.sh start-task` remains a compatibility helper for reserving a row and generating a thin plan seed; its generated plan must still run `$think` before code edits.
30
- - Execute the slice as usual (implement, `/check`, external acceptance, `bash .ai/harness/scripts/contract-worktree.sh finish`); finish back-fills the backlog row warn-only.
27
+ - Treat the row as a long-task waypoint, not a detailed implementation plan.
28
+ - For `contract` rows, invoke `$think` with the sprint path, row task, mode, acceptance line, and Promotion Gate fields so the coding agent expands it into a decision-complete plan. Capture the approved `$think` output with `bash .ai/harness/scripts/capture-plan.sh --artifact-level work-package --promotion-reason worktree_boundary --source waza-think --source-ref sprint:<sprint-file>#<task> --status Approved --execute`.
29
+ - For `inline` rows, do not create a new `plans/plan-*.md` or task contract. Keep the work in the sprint backlog or the current active plan's `## Task Breakdown`, then complete the row when the acceptance line is verified.
30
+ - `bash .ai/harness/scripts/sprint-backlog.sh start-task` remains a compatibility helper for reserving a row. It captures a thin plan seed only for `contract` rows; inline rows append checklist-row content to the current active plan before recording an in-flight marker.
31
+ - Execute contract slices as usual (implement, `/check`, external acceptance, `bash .ai/harness/scripts/contract-worktree.sh finish`); finish back-fills the backlog row warn-only.
31
32
  5. Route `status`: report `bash .ai/harness/scripts/sprint-backlog.sh status` plus the Active Sprint section of `tasks/current.md`; mutate nothing.
32
33
  6. After each completed task, re-read the sprint file before starting the next one; user edits to the backlog override stale session memory.
33
34
 
@@ -40,7 +41,7 @@ Use this command to plan a program-level Sprint from an upper-layer PRD or sourc
40
41
 
41
42
  ## Boundaries
42
43
 
43
- - Does not implement backlog tasks itself; execution always flows through the existing plan -> contract -> worktree -> verify gates.
44
+ - Does not implement backlog tasks itself; contract rows flow through the existing plan -> contract -> worktree -> verify gates, while inline rows stay in sprint/active-plan checklist scope.
44
45
  - Does not set `> **Status**: Approved` without explicit user approval of the PRD and backlog.
45
46
  - Never bypasses `/check`, external acceptance, or `verify-sprint.sh` to mark a backlog row complete.
46
47
  - Goal mode (`run --goal`, autonomous continuation) is not part of this command yet; treat requests for it as future work and say so.
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.8.1",
3
- "templateVersion": "0.8.1",
2
+ "version": "0.8.2",
3
+ "templateVersion": "0.8.2",
4
4
  "skillName": "repo-harness",
5
5
  "contractId": "tasks-first-harness-v1",
6
6
  "compatibility": {
@@ -171,6 +171,10 @@
171
171
  {
172
172
  "version": "0.8.1",
173
173
  "description": "Adds General Repo MCP CodeGraph access, removes the ChatGPT extension bridge provider, and suppresses Codex Stop decision stdout"
174
+ },
175
+ {
176
+ "version": "0.8.2",
177
+ "description": "Hardens two-tier plan artifact gates, rejects transient and inline projection misuse, keeps CodeGraph tooling on latest, and reduces completed workflow artifact noise"
174
178
  }
175
179
  ],
176
180
  "generatedProjectStamp": {
@@ -256,6 +256,42 @@ if [[ -f "$notes_file" ]]; then
256
256
  rm -f "$notes_file"
257
257
  fi
258
258
 
259
+ contract_file="tasks/contracts/${artifact_stem}.contract.md"
260
+ if [[ ! -f "$contract_file" && -f "tasks/contracts/${slug}.contract.md" ]]; then
261
+ contract_file="tasks/contracts/${slug}.contract.md"
262
+ fi
263
+ if [[ -f "$contract_file" ]]; then
264
+ archive_contract="$(unique_archive_path "tasks/archive/contract-${timestamp}-${slug}.md")"
265
+ {
266
+ echo "> **Archived**: ${timestamp_human}"
267
+ echo "> **Related Plan**: ${archive_plan_path}"
268
+ echo "> **Outcome**: ${outcome}"
269
+ echo "> **Lifecycle**: contract"
270
+ echo "> **Parent Run ID**: ${parent_run_id}"
271
+ echo
272
+ cat "$contract_file"
273
+ } > "$archive_contract"
274
+ rm -f "$contract_file"
275
+ fi
276
+
277
+ review_file="tasks/reviews/${artifact_stem}.review.md"
278
+ if [[ ! -f "$review_file" && -f "tasks/reviews/${slug}.review.md" ]]; then
279
+ review_file="tasks/reviews/${slug}.review.md"
280
+ fi
281
+ if [[ -f "$review_file" ]]; then
282
+ archive_review="$(unique_archive_path "tasks/archive/review-${timestamp}-${slug}.md")"
283
+ {
284
+ echo "> **Archived**: ${timestamp_human}"
285
+ echo "> **Related Plan**: ${archive_plan_path}"
286
+ echo "> **Outcome**: ${outcome}"
287
+ echo "> **Lifecycle**: review"
288
+ echo "> **Parent Run ID**: ${parent_run_id}"
289
+ echo
290
+ cat "$review_file"
291
+ } > "$archive_review"
292
+ rm -f "$review_file"
293
+ fi
294
+
259
295
  if todo_is_deferred_ledger tasks/todos.md; then
260
296
  touch_deferred_ledger_update_marker tasks/todos.md
261
297
  else