coding-agent-harness 1.0.1 → 1.0.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 (159) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.en-US.md +14 -0
  3. package/README.md +111 -86
  4. package/README.zh-CN.md +270 -0
  5. package/SKILL.md +116 -189
  6. package/docs-release/README.md +72 -5
  7. package/docs-release/architecture/overview.md +286 -28
  8. package/docs-release/architecture/overview.zh-CN.md +288 -0
  9. package/docs-release/assets/dashboard-overview-en.png +0 -0
  10. package/docs-release/assets/harness-architecture.svg +163 -0
  11. package/docs-release/assets/harness-workflow.svg +64 -0
  12. package/docs-release/guides/agent-installation.en-US.md +214 -0
  13. package/docs-release/guides/agent-installation.md +123 -26
  14. package/docs-release/guides/document-audience-and-surfaces.en-US.md +112 -0
  15. package/docs-release/guides/document-audience-and-surfaces.md +112 -0
  16. package/docs-release/guides/full-legacy-migration-subagent-strategy.md +334 -0
  17. package/docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md +334 -0
  18. package/docs-release/guides/legacy-migration-agent-prompt.md +384 -0
  19. package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +361 -0
  20. package/docs-release/guides/migration-playbook.en-US.md +325 -0
  21. package/docs-release/guides/migration-playbook.md +329 -0
  22. package/docs-release/guides/parent-control-repository-pattern.en-US.md +252 -0
  23. package/docs-release/guides/parent-control-repository-pattern.md +252 -0
  24. package/docs-release/guides/repository-operating-models.en-US.md +196 -0
  25. package/docs-release/guides/repository-operating-models.md +196 -0
  26. package/docs-release/intl/README.md +15 -0
  27. package/docs-release/intl/de-DE.md +18 -0
  28. package/docs-release/intl/en-US.md +18 -0
  29. package/docs-release/intl/es-ES.md +18 -0
  30. package/docs-release/intl/fr-FR.md +18 -0
  31. package/docs-release/intl/ja-JP.md +18 -0
  32. package/docs-release/intl/ko-KR.md +18 -0
  33. package/docs-release/intl/zh-CN.md +18 -0
  34. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/brief.md +13 -0
  35. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/lesson_candidates.md +24 -0
  36. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/progress.md +1 -1
  37. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/task_plan.md +4 -2
  38. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/{visual_roadmap.md → visual_map.md} +9 -1
  39. package/package.json +3 -1
  40. package/references/agents-md-pattern.md +3 -3
  41. package/references/docs-directory-standard.md +47 -3
  42. package/references/external-source-intake-standard.md +75 -0
  43. package/references/harness-ledger.md +5 -3
  44. package/references/legacy-12-phase-bootstrap.md +41 -0
  45. package/references/lessons-governance.md +23 -6
  46. package/references/planning-loop.md +41 -3
  47. package/references/project-onboarding-audit.md +10 -0
  48. package/references/repo-governance-standard.md +2 -0
  49. package/references/testing-standard.md +50 -0
  50. package/references/walkthrough-closeout.md +6 -5
  51. package/scripts/check-harness.mjs +76 -35
  52. package/scripts/harness.mjs +303 -12
  53. package/scripts/lib/capability-registry.mjs +533 -0
  54. package/scripts/lib/check-profiles.mjs +510 -0
  55. package/scripts/lib/core-shared.mjs +186 -0
  56. package/scripts/lib/dashboard-data.mjs +389 -0
  57. package/scripts/lib/dashboard-workbench.mjs +217 -0
  58. package/scripts/lib/dashboard-writer.mjs +93 -2
  59. package/scripts/lib/harness-core.mjs +10 -1318
  60. package/scripts/lib/lesson-maintenance.mjs +145 -0
  61. package/scripts/lib/markdown-utils.mjs +158 -0
  62. package/scripts/lib/migration-planner.mjs +478 -0
  63. package/scripts/lib/migration-support.mjs +312 -0
  64. package/scripts/lib/task-lifecycle.mjs +755 -0
  65. package/scripts/lib/task-scanner.mjs +682 -0
  66. package/scripts/smoke-dashboard.mjs +22 -0
  67. package/scripts/test-harness.mjs +926 -14
  68. package/templates/AGENTS.md.template +41 -30
  69. package/templates/architecture/Architecture-SSoT.md +21 -0
  70. package/templates/architecture/README.md +49 -0
  71. package/templates/architecture/critical-flows.md +22 -0
  72. package/templates/architecture/local-repo-context.md +20 -0
  73. package/templates/architecture/service-catalog.md +17 -0
  74. package/templates/architecture/services/service-template.md +31 -0
  75. package/templates/architecture/system-map.md +22 -0
  76. package/templates/dashboard/assets/app-src/00-state.js +41 -0
  77. package/templates/dashboard/assets/app-src/10-router.js +76 -0
  78. package/templates/dashboard/assets/app-src/20-overview.js +235 -0
  79. package/templates/dashboard/assets/app-src/30-tasks.js +563 -0
  80. package/templates/dashboard/assets/app-src/40-modules.js +58 -0
  81. package/templates/dashboard/assets/app-src/45-review.js +128 -0
  82. package/templates/dashboard/assets/app-src/50-migration.js +169 -0
  83. package/templates/dashboard/assets/app-src/60-shared.js +61 -0
  84. package/templates/dashboard/assets/app-src/90-bindings.js +382 -0
  85. package/templates/dashboard/assets/app.css +2575 -310
  86. package/templates/dashboard/assets/app.js +1498 -307
  87. package/templates/dashboard/assets/app.manifest.json +11 -0
  88. package/templates/dashboard/assets/i18n.js +429 -44
  89. package/templates/dashboard/assets/mermaid-renderer.js +58 -8
  90. package/templates/development/README.md +52 -0
  91. package/templates/development/codebase-map.md +11 -0
  92. package/templates/development/cross-repo-debugging.md +18 -0
  93. package/templates/development/external-context/service-template.md +33 -0
  94. package/templates/development/external-source-packs/README.md +24 -0
  95. package/templates/development/external-source-packs/digest-template.md +28 -0
  96. package/templates/development/local-setup.md +16 -0
  97. package/templates/development/stubs-and-mocks.md +11 -0
  98. package/templates/integrations/README.md +40 -0
  99. package/templates/integrations/api-contract.md +42 -0
  100. package/templates/integrations/event-contract.md +46 -0
  101. package/templates/integrations/third-party/vendor-template.md +42 -0
  102. package/templates/integrations/webhook-contract.md +41 -0
  103. package/templates/planning/brief.md +32 -0
  104. package/templates/planning/lesson_candidates.md +58 -0
  105. package/templates/planning/long-running-task-contract.md +7 -0
  106. package/templates/planning/module_brief.md +25 -0
  107. package/templates/planning/module_session_prompt.md +6 -0
  108. package/templates/planning/task_plan.md +7 -5
  109. package/templates/planning/{visual_roadmap.md → visual_map.md} +24 -2
  110. package/templates/reference/docs-library-standard.md +31 -0
  111. package/templates/reference/execution-workflow-standard.md +4 -2
  112. package/templates/reference/external-source-intake-standard.md +82 -0
  113. package/templates/reference/harness-ledger-standard.md +1 -0
  114. package/templates/reference/repo-governance-standard.md +6 -4
  115. package/templates/reference/walkthrough-standard.md +2 -1
  116. package/templates/walkthrough/walkthrough-template.md +2 -2
  117. package/templates-zh-CN/AGENTS.md.template +69 -70
  118. package/templates-zh-CN/architecture/Architecture-SSoT.md +21 -0
  119. package/templates-zh-CN/architecture/README.md +51 -0
  120. package/templates-zh-CN/architecture/critical-flows.md +24 -0
  121. package/templates-zh-CN/architecture/local-repo-context.md +20 -0
  122. package/templates-zh-CN/architecture/service-catalog.md +17 -0
  123. package/templates-zh-CN/architecture/services/service-template.md +31 -0
  124. package/templates-zh-CN/architecture/system-map.md +22 -0
  125. package/templates-zh-CN/development/README.md +54 -0
  126. package/templates-zh-CN/development/codebase-map.md +11 -0
  127. package/templates-zh-CN/development/cross-repo-debugging.md +18 -0
  128. package/templates-zh-CN/development/external-context/service-template.md +33 -0
  129. package/templates-zh-CN/development/external-source-packs/README.md +24 -0
  130. package/templates-zh-CN/development/external-source-packs/digest-template.md +28 -0
  131. package/templates-zh-CN/development/local-setup.md +16 -0
  132. package/templates-zh-CN/development/stubs-and-mocks.md +11 -0
  133. package/templates-zh-CN/integrations/README.md +42 -0
  134. package/templates-zh-CN/integrations/api-contract.md +42 -0
  135. package/templates-zh-CN/integrations/event-contract.md +46 -0
  136. package/templates-zh-CN/integrations/third-party/vendor-template.md +42 -0
  137. package/templates-zh-CN/integrations/webhook-contract.md +41 -0
  138. package/templates-zh-CN/planning/brief.md +32 -0
  139. package/templates-zh-CN/planning/lesson_candidates.md +58 -0
  140. package/templates-zh-CN/planning/long-running-task-contract.md +1 -1
  141. package/templates-zh-CN/planning/module_brief.md +25 -0
  142. package/templates-zh-CN/planning/module_plan.md +2 -2
  143. package/templates-zh-CN/planning/module_session_prompt.md +4 -3
  144. package/templates-zh-CN/planning/task_plan.md +10 -4
  145. package/templates-zh-CN/planning/{visual_roadmap.md → visual_map.md} +21 -2
  146. package/templates-zh-CN/reference/docs-library-standard.md +35 -0
  147. package/templates-zh-CN/reference/execution-workflow-standard.md +9 -2
  148. package/templates-zh-CN/reference/external-source-intake-standard.md +82 -0
  149. package/templates-zh-CN/reference/harness-ledger-standard.md +5 -2
  150. package/templates-zh-CN/reference/repo-governance-standard.md +2 -0
  151. package/templates-zh-CN/reference/walkthrough-standard.md +4 -4
  152. package/templates-zh-CN/walkthrough/Closeout-SSoT.md +2 -2
  153. package/templates-zh-CN/walkthrough/walkthrough-template.md +2 -2
  154. package/templates-zh-CN/dashboard/assets/app.css +0 -399
  155. package/templates-zh-CN/dashboard/assets/app.js +0 -435
  156. package/templates-zh-CN/dashboard/assets/i18n.js +0 -47
  157. package/templates-zh-CN/dashboard/assets/markdown-reader.js +0 -116
  158. package/templates-zh-CN/dashboard/assets/mermaid-renderer.js +0 -59
  159. package/templates-zh-CN/dashboard/index.html +0 -18
@@ -0,0 +1,384 @@
1
+ # Legacy Harness Migration Agent Prompt
2
+
3
+ Chinese mirror: `docs-release/guides/legacy-migration-agent-prompt.zh-CN.md`
4
+
5
+ Use this prompt when an agent must migrate an older Harness project into the v1.0 document kernel without destroying historical evidence.
6
+
7
+ ## Mission
8
+
9
+ You are migrating an existing project from a pre-v1 Harness layout to v1.0.
10
+
11
+ Your default job is not to rewrite the whole `docs/` tree. The default baseline preserves history, installs the v1.0 compatibility layer, identifies active work, and makes current work visible in the dashboard.
12
+
13
+ Migration is not a single strategy. The agent must scan the target project first, produce a migration plan, recommend a migration mode, and ask the user for confirmation before writing files.
14
+
15
+ If the user asks for proof that a legacy project is fully migrated, also follow:
16
+
17
+ - `docs-release/guides/full-legacy-migration-subagent-strategy.md`
18
+ - `docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md`
19
+
20
+ This prompt alone is enough for baseline safe-adoption. Full readable cutover has stricter gates.
21
+
22
+ ## Non-Negotiable Rules
23
+
24
+ 1. Do not overwrite `AGENTS.md`, `CLAUDE.md`, historical task folders, Harness Ledger, SSoTs, reviews, walkthroughs, or evidence files.
25
+ 2. Do not convert hundreds of old tasks into v1 tasks mechanically.
26
+ 3. Treat closed or unknown historical tasks as legacy residuals in baseline mode unless the user says they are active again.
27
+ 4. Add `module-parallel` only when the project has real module owners, write scopes, and integration rules. A large task count alone is not a module boundary.
28
+ 5. Keep the normal check as a migration signal. Use `--strict` only after active tasks are upgraded.
29
+ 6. Start with `migrate-run`, then prove the result with `migrate-verify`. Do not hand-roll the first adoption pass.
30
+ 7. Every migration action must be explainable from the generated `migrate-plan.json` and `session.json`.
31
+ 8. Do not stage, commit, push, or open a PR unless the user explicitly asks.
32
+ 9. Dashboard evidence must be an existing HTML dashboard path. A Markdown ledger or docs page is not a dashboard.
33
+ 10. Full readable cutover is stricter than baseline: it requires zero warnings/actions/residuals, strict pass, and dashboard brief coverage `total/total`.
34
+ 11. Before writing files, complete the scan, recommend a rewrite mode, and get user confirmation. Do not silently choose either fill-gaps-only or full rewrite.
35
+ 12. Keep state axes separate. Preserve legacy `task.state`, and read derived `lifecycleState`, `reviewStatus`, `closeoutStatus`, and `stateConflicts` from `status --json` instead of inventing local meanings.
36
+ 13. Do not treat `done`, `completed`, `merged`, or `shipped` as `closed`. A task is closed only when closeout evidence is recorded in the closeout SSoT or an explicit skipped-with-reason closeout path.
37
+ 14. Human review confirmation is a dashboard workbench action. Use `harness dev /path/to/project` as the normal local HTML entry. Static dashboard snapshots are read-only; CLI commands may support automation, but a migration that requires human confirmation must expose the action in the local HTML workbench.
38
+
39
+ ## Step 0: Scan, Then Ask the User
40
+
41
+ Scan first. Do not write files:
42
+
43
+ ```bash
44
+ git -C /path/to/project status --short --branch
45
+ harness status --json /path/to/project > /tmp/harness-status.json
46
+ harness migrate-plan --json --limit 1000 /path/to/project > /tmp/harness-migrate-plan.json
47
+ ```
48
+
49
+ Then return a short migration plan and ask for confirmation. The plan must include:
50
+
51
+ - task count, brief coverage, and canonical `visual_map.md` coverage;
52
+ - `migrate-plan.summary` warnings, taskActions, reviewSchemaGaps, legacyReferenceGaps, legacyResiduals, and fullCutoverEligible;
53
+ - dirty / untracked file explanation;
54
+ - whether the project is a microservice, multi-repo, split frontend/backend, or externally integrated project, and whether the user has been asked for external source material;
55
+ - recommended migration mode and rationale;
56
+ - estimated write scope, token / time cost, and whether subagents are needed;
57
+ - questions that need user confirmation.
58
+
59
+ The agent should recommend one of these modes instead of expecting the user to know them upfront:
60
+
61
+ | Mode | Recommend when | Write strategy |
62
+ | --- | --- | --- |
63
+ | `baseline-preserve` | The user only needs safe v1.0 adoption and has many historical tasks, without strict-clean as the immediate goal. | Do not rewrite historical tasks; add registry, dashboard, active tasks, required metadata, and warning queue only. |
64
+ | `status-aware-rewrite` | The user wants real current work migrated and wants rewrite depth decided by task state. | Rewrite current, reopened, or current-evidence tasks from SSoT / Ledger / progress / review / git evidence; historical tasks become readable index cards or residuals. |
65
+ | `full-semantic-rewrite` | The user wants proof that the old project can be rebuilt as a fully readable v1.0 Harness. | Rewrite every task into the v1.0 readable contract; rewrite existing briefs, execution strategies, and visual maps when they are too thin or old-format. |
66
+
67
+ Example confirmation prompt:
68
+
69
+ ```text
70
+ I recommend status-aware-rewrite because this project has 470+ historical tasks, but only a subset appears to be current evidence.
71
+ Please confirm:
72
+ 1. Use this mode, or choose baseline-preserve / full-semantic-rewrite?
73
+ 2. May I rewrite existing brief and visual_map files, or only add missing files?
74
+ 3. Does this project have external architecture docs, API docs, diagrams, meeting notes, links, source paths, or exported packets that should be organized during migration?
75
+ 4. May I start subagents split by date range or module?
76
+ ```
77
+
78
+ `visual_map.md` is a diagram collection, not a requirement to draw every possible diagram. It may contain phase flow, sequence, architecture, data-flow, state, topology, or decision maps only when the diagram improves human understanding. Do not generate empty or decorative diagrams just to satisfy a checker.
79
+
80
+ If the user provides external source material, first use `docs/11-REFERENCE/external-source-intake-standard.md` to create a `docs/04-DEVELOPMENT/external-source-packs/<source-key>/` index and digests, then project stable facts into `03-ARCHITECTURE`, `04-DEVELOPMENT/external-context`, or `06-INTEGRATIONS`. Do not dump raw external documents directly into `03/04/06`.
81
+
82
+ ## Step 1: Baseline
83
+
84
+ First check whether the target environment has the `harness` command. If it does not, do not silently install globally. Ask the user whether `npm install -g coding-agent-harness` is allowed. Run that global install only after explicit approval. If the user does not approve or does not respond, use `npx --yes coding-agent-harness <command>` for Harness CLI calls. If you are debugging from the source checkout, replace `harness` with `node scripts/harness.mjs`.
85
+
86
+ After user confirmation, run or reuse:
87
+
88
+ ```bash
89
+ git -C /path/to/project status --short --branch
90
+ harness migrate-plan --json --limit 50 /path/to/project > /tmp/harness-migrate-plan.json
91
+ ```
92
+
93
+ Read the migration plan and confirm the user-selected mode before editing anything.
94
+
95
+ Before writing files:
96
+
97
+ - Explain every dirty or untracked path from `git status`.
98
+ - Preserve `/tmp/harness-migrate-plan.json` as the baseline snapshot for this run.
99
+ - Stop if dirty files are unrelated and the owner is unclear.
100
+ - Decide locale. If the target mixes Chinese and English, choose explicitly:
101
+ - `--locale zh-CN` for Chinese users, Chinese project operating context, or Chinese-facing docs.
102
+ - `--locale en-US` for English teams or English-facing docs.
103
+ - Record concrete locale evidence from entry files or product-facing docs, such as `AGENTS.md`, `CLAUDE.md`, `README.md`, `docs/Harness-Ledger.md`, and active task docs. Stop and ask for a locale decision if those signals conflict.
104
+ - Run the migration rail:
105
+
106
+ ```bash
107
+ harness migrate-run \
108
+ --locale zh-CN \
109
+ --session-dir /tmp/cah-migration-project \
110
+ --out-dir /tmp/cah-migration-project/dashboard \
111
+ /path/to/project
112
+ ```
113
+
114
+ If `migrate-run` reports a dirty target, stop and explain the dirty files. Use `--allow-dirty` only after the user or repo owner accepts those files as part of the migration context.
115
+
116
+ The command writes:
117
+
118
+ - `session.json`
119
+ - `report.md`
120
+ - `migrate-plan.json`
121
+ - `status-normal.json`
122
+ - `status-strict.json`
123
+ - `dashboard/index.html`
124
+
125
+ After `migrate-verify` passes, create the migration task as a Complex Task preset:
126
+
127
+ ```bash
128
+ harness new-task \
129
+ --budget complex \
130
+ --preset legacy-migration \
131
+ --from-session /tmp/cah-migration-project/session.json
132
+ ```
133
+
134
+ This command only scaffolds the task and copies/references evidence. It does not run migration, rewrite history, stage files, or commit.
135
+
136
+ Classify the output:
137
+
138
+ | Output | Meaning | Action |
139
+ | --- | --- | --- |
140
+ | `taskActions` | Active or reopened tasks that should receive v1 files | Upgrade carefully |
141
+ | `legacyResiduals` | Historical task contract gaps | Do not rewrite by default |
142
+ | `reviewActions` | Reviews missing v1 schema | Upgrade only current release-blocking reviews |
143
+ | `legacyActions` | Missing older reference/governance files | Create only if the capability is intentionally adopted |
144
+ | `recommendedCapabilities` | Candidate capabilities | Evaluate against project facts |
145
+
146
+ Before you continue, choose the target completion mode:
147
+
148
+ | Mode | When to use | Final claim |
149
+ | --- | --- | --- |
150
+ | Baseline safe-adoption | User wants a first safe migration surface and warning queue. | "baseline usable" |
151
+ | Full readable cutover | User wants proof that another agent can migrate the old project fully. | "migration complete" only after all gates pass |
152
+
153
+ For full readable cutover, continue with subagents. Do not let a single agent silently patch every class of issue.
154
+
155
+ After generating the dashboard in Step 6, inspect `adoption.warnings` from the dashboard bundle. Treat every warning as a queue item with:
156
+
157
+ - `category`: human-facing bucket.
158
+ - `type`: stable issue type.
159
+ - `scope`: task, module, review, reference, capability, or project.
160
+ - `priority`: P1/P2/P3 cleanup order.
161
+ - `phase`: migration phase where the item should be handled.
162
+ - `fixability`: template, guided, human-evidence, decision, or manual.
163
+ - `status`: open, done, deferred, or accepted-residual.
164
+ - `confidence`: high, medium, or low classification confidence.
165
+ - `affected`: primary affected path.
166
+ - `affectedPaths`: files to inspect or assign.
167
+ - `requiredAction`: next action to execute.
168
+ - `detail`: original warning detail.
169
+
170
+ For cleanup reporting, every warning batch needs owner/action/status. Do not mark a warning done only because it was seen.
171
+
172
+ When `status --json` shows `reviewStatus: blocked-open-findings`, close or route all open P0/P1/P2 findings before asking a human to confirm review completion. When it shows `lifecycleState: closing`, do not call the task closed until closeout SSoT, walkthrough or skipped-with-reason evidence is present.
173
+
174
+ ## Step 2: Install Safe Adoption
175
+
176
+ This is normally done by `migrate-run`. Only use the lower-level commands when debugging the rail:
177
+
178
+ ```bash
179
+ harness add-capability safe-adoption --locale zh-CN /path/to/project
180
+ harness add-capability dashboard --locale zh-CN /path/to/project
181
+ ```
182
+
183
+ Expected behavior:
184
+
185
+ - Existing files should show `skip-existing`.
186
+ - `.harness-capabilities.json` should declare `core`, `safe-adoption`, and `dashboard`.
187
+ - No historical task content should be overwritten.
188
+
189
+ Stop if existing project docs are overwritten.
190
+
191
+ ## Step 3: Upgrade Active Work Only
192
+
193
+ Before editing task files, build the evidence map in this order:
194
+
195
+ 1. Read `docs/Harness-Ledger.md`, `docs/10-WALKTHROUGH/Closeout-SSoT.md`, `docs/05-TEST-QA/Regression-SSoT.md`, and any legacy project-specific regression SSoT.
196
+ 2. Cross-check candidate active tasks against their `progress.md`, walkthrough links, regression rows, and recent git commits.
197
+ 3. Classify each task as `current-active`, `closed-with-evidence`, `closed-with-residual`, `superseded`, or `unknown-history`.
198
+ 4. In baseline mode, repair only `current-active` and `unknown-history that is still referenced by SSoT as current evidence`. In a confirmed rewrite mode, rewrite existing v1 surfaces that evidence proves weak or stale.
199
+ 5. For closed historical tasks, route the residual in the migration report instead of adding fake current files.
200
+
201
+ If you use subagents for baseline triage, assign them evidence work, not list-making:
202
+
203
+ - Reviewer A: inspect SSoT and ledger rows for completion status.
204
+ - Reviewer B: inspect task `progress.md` / walkthrough / review evidence.
205
+ - Reviewer C: inspect git history and regression evidence for whether the task was actually completed.
206
+
207
+ Every repaired task must name the evidence used to decide it is active or reopened.
208
+
209
+ For every item in `taskActions`, add or adapt:
210
+
211
+ - `brief.md`
212
+ - `execution_strategy.md`
213
+ - `visual_map.md`
214
+
215
+ Do not write generic placeholder briefs. A useful `brief.md` must answer:
216
+
217
+ - What is this task trying to achieve?
218
+ - What is the execution flow?
219
+ - What should a human look at first?
220
+ - What is currently blocked or risky?
221
+ - Which SSoT, ledger, progress, walkthrough, regression row, review, or git evidence says this task is still current.
222
+
223
+ Use diagrams when they improve understanding:
224
+
225
+ ```mermaid
226
+ flowchart LR
227
+ A["Current state"] --> B["Migration action"]
228
+ B --> C["Dashboard visibility"]
229
+ C --> D["Verification"]
230
+ ```
231
+
232
+ After each upgrade, record evidence:
233
+
234
+ ```bash
235
+ harness task-log <task-id> \
236
+ --message "migrated active task to v1 visibility contract" \
237
+ --evidence "file:TARGET:docs/09-PLANNING/TASKS/<task>/brief.md:created" \
238
+ /path/to/project
239
+ ```
240
+
241
+ ## Step 4: Preserve Historical Backlog
242
+
243
+ If the project has hundreds of old task folders:
244
+
245
+ - Keep them searchable in dashboard metadata.
246
+ - Keep their old `task_plan.md`, `progress.md`, and review evidence intact.
247
+ - Do not add `brief.md` to every old task.
248
+ - Record the count and category as migration residuals.
249
+ - Use SSoT/ledger evidence to decide completion. Do not infer “unfinished” only because a v1 template file is missing.
250
+
251
+ A good residual entry says:
252
+
253
+ ```text
254
+ 470 historical tasks remain in legacy format. They are searchable in the dashboard, but not upgraded to v1 brief/strategy/visual_map unless reopened or reused as current release evidence.
255
+ ```
256
+
257
+ For full readable cutover, this baseline rule changes:
258
+
259
+ - Every task must have a standalone `brief.md` so the dashboard can be read by a human.
260
+ - Historical task briefs must not claim active execution unless evidence supports it.
261
+ - Write them as readable index cards: task goal, first human read, evidence flow, current status judgment, risks/residuals, evidence sources.
262
+ - Keep `execution_strategy.md` and `visual_map.md` focused on active/current tasks or user-confirmed semantic rewrite scope. `visual_map.md` should contain only useful diagrams, not empty diagrams for coverage.
263
+ - Split the work across subagents by date range, module, or migration bucket.
264
+
265
+ ## Step 5: Decide Whether Modules Exist
266
+
267
+ Only create `Module-Registry.md` and module plans when all are true:
268
+
269
+ - There are two or more stable product or engineering domains.
270
+ - Each domain has a clear owner or worker lane.
271
+ - Write scopes can be made non-overlapping.
272
+ - Shared files have coordinator ownership.
273
+ - Module status can be maintained after migration.
274
+
275
+ If these are not true, keep the project as a single-line Harness with `safe-adoption`.
276
+
277
+ Module classification order:
278
+
279
+ 1. Use explicit modules first: existing `docs/09-PLANNING/MODULES/<module>/` folders or maintained `Module-Registry.md`.
280
+ 2. Use dashboard inferred modules only for browsing, filtering, and cleanup routing. Inferred grouping is not a capability declaration.
281
+ 3. Keep uncertain history as `legacy-unclassified`.
282
+
283
+ Before creating module files, produce a classification summary:
284
+
285
+ - Candidate module name.
286
+ - Product or engineering domain rationale.
287
+ - Owner and non-overlapping write scope.
288
+ - Shared-file coordinator rule.
289
+ - Count of tasks left as `legacy-unclassified`.
290
+
291
+ Do not create modules from date buckets, file paths alone, or a desire to make the dashboard look tidy.
292
+
293
+ ## Step 6: Generate Dashboard
294
+
295
+ This is normally done by `migrate-run --out-dir`. If you need a standalone debug dashboard, generate both forms:
296
+
297
+ ```bash
298
+ harness dashboard --out /tmp/harness-dashboard.html /path/to/project
299
+ harness dashboard --out-dir /tmp/harness-dashboard /path/to/project
300
+ ```
301
+
302
+ The dashboard must show:
303
+
304
+ - A project flow for small projects, or an aggregate migration runway for large legacy projects.
305
+ - Active task briefs when active tasks exist.
306
+ - Searchable and paginated historical tasks.
307
+ - Migration attention as a warning workbench, not a fake all-green state.
308
+ - Legacy residuals separated from current blockers.
309
+
310
+ For projects with hundreds of tasks, use the dashboard like this:
311
+
312
+ 1. Start with the aggregate migration runway, not the raw task graph.
313
+ 2. In Task Index, group by migration bucket to separate active/current work from historical records.
314
+ 3. Switch to module grouping only after inferred or explicit modules are meaningful.
315
+ 4. Use warning filters to fix one warning class at a time.
316
+ 5. Regenerate the dashboard after each cleanup batch and compare counts.
317
+
318
+ ## Step 7: Verify
319
+
320
+ Run:
321
+
322
+ ```bash
323
+ harness migrate-verify /tmp/cah-migration-project/session.json
324
+ harness check --profile target-project /path/to/project
325
+ harness check --profile target-project --strict /path/to/project
326
+ harness status --json /path/to/project
327
+ harness migrate-plan --json /path/to/project
328
+ git -C /path/to/project diff --cached --name-only
329
+ ```
330
+
331
+ `migrate-verify` must pass before you report the migration as usable. It checks the capability registry, selected locale, dashboard HTML evidence, normal check status, staged files, and whether strict failures have an explicit `strictDeferred` owner/trigger/next action.
332
+
333
+ If you perform additional cleanup after the first session, regenerate the session and dashboard with `migrate-run` or clearly label the first session as baseline and provide fresh final check/dashboard evidence. Do not report a stale baseline dashboard as final evidence.
334
+
335
+ For full readable cutover, additionally verify:
336
+
337
+ ```bash
338
+ node -e '
339
+ const fs = require("fs");
340
+ const status = JSON.parse(fs.readFileSync("/tmp/cah-migration-project/dashboard/data/status.json", "utf8"));
341
+ console.log(status.summary.briefCoverage);
342
+ console.log(status.tasks.filter((task) => task.briefSource !== "standalone" || !task.briefPath).slice(0, 5));
343
+ '
344
+ ```
345
+
346
+ Expected:
347
+
348
+ - `ready == total`
349
+ - `missing == 0`
350
+ - no sample task missing `briefPath`
351
+
352
+ Also open the dashboard task index and confirm it shows `total / total`.
353
+
354
+ Do not claim strict migration is complete unless:
355
+
356
+ - Active tasks have v1 visibility files.
357
+ - Current release-blocking reviews use v1 review schema.
358
+ - Remaining historical gaps have owner/action/status or an accepted residual reason.
359
+ - `--strict` passes.
360
+
361
+ Do not claim full readable migration is complete unless:
362
+
363
+ - All strict-complete conditions above pass.
364
+ - `migrate-plan` has 0 warnings/actions/residuals.
365
+ - Dashboard brief coverage is 100%.
366
+ - Final adversarial review lanes pass: CLI/session, brief quality, and boundary/git state.
367
+
368
+ If the user accepts remaining residuals, report `strict deferred`, not `strict complete`. Include owner, expiry or trigger condition, and next action for every accepted residual.
369
+
370
+ ## Expected Final Report
371
+
372
+ Return:
373
+
374
+ - Files created and skipped.
375
+ - Capability registry state.
376
+ - Number of active task actions completed.
377
+ - Number of legacy residuals left untouched.
378
+ - Dashboard paths.
379
+ - `session.json` and `report.md` paths.
380
+ - Normal check result.
381
+ - Strict check result or explicit reason it remains deferred.
382
+ - Dashboard brief coverage result.
383
+ - Subagent worker roles used.
384
+ - Final adversarial review outcome.