hadara 0.2.0-rc.0 → 0.2.0-rc.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 (189) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +23 -14
  3. package/dist/agent/evidence.js +0 -0
  4. package/dist/agent/loop.js +0 -0
  5. package/dist/cli/actor.js +0 -0
  6. package/dist/cli/args.js +0 -0
  7. package/dist/cli/dashboard.js +0 -0
  8. package/dist/cli/debt.js +0 -0
  9. package/dist/cli/dev.js +0 -0
  10. package/dist/cli/doctor.js +2 -2
  11. package/dist/cli/errors.js +0 -0
  12. package/dist/cli/evidence-json.js +0 -0
  13. package/dist/cli/evidence.js +0 -0
  14. package/dist/cli/handoff.js +7 -2
  15. package/dist/cli/harness.js +0 -0
  16. package/dist/cli/hermes-json.js +0 -0
  17. package/dist/cli/hermes.js +0 -0
  18. package/dist/cli/init.js +231 -25
  19. package/dist/cli/install.js +0 -0
  20. package/dist/cli/main.js +2 -2
  21. package/dist/cli/mcp.js +0 -0
  22. package/dist/cli/package-smoke.js +0 -0
  23. package/dist/cli/policy-json.js +0 -0
  24. package/dist/cli/policy.js +0 -0
  25. package/dist/cli/protocol.js +0 -0
  26. package/dist/cli/release-artifact.js +0 -0
  27. package/dist/cli/release-dry-run.js +0 -0
  28. package/dist/cli/release-gate.js +0 -0
  29. package/dist/cli/release-publish.js +0 -0
  30. package/dist/cli/run-scaffold.js +1 -1
  31. package/dist/cli/run-state.js +0 -0
  32. package/dist/cli/run.js +0 -0
  33. package/dist/cli/smoke.js +0 -0
  34. package/dist/cli/status-json.js +0 -0
  35. package/dist/cli/status.js +0 -0
  36. package/dist/cli/task-json.js +0 -0
  37. package/dist/cli/task.js +0 -0
  38. package/dist/cli/tools.js +0 -0
  39. package/dist/cli/tui.js +0 -0
  40. package/dist/cli/version.js +0 -0
  41. package/dist/cli/write-preflight.js +0 -0
  42. package/dist/core/actor-context.js +0 -0
  43. package/dist/core/audit.js +0 -0
  44. package/dist/core/events.js +0 -0
  45. package/dist/core/fs.js +0 -0
  46. package/dist/core/next-action.js +0 -0
  47. package/dist/core/paths.js +0 -0
  48. package/dist/core/plan-context.js +0 -0
  49. package/dist/core/redaction.js +0 -0
  50. package/dist/core/schema.js +0 -0
  51. package/dist/core/workspace.js +0 -0
  52. package/dist/dev/docker-check.js +5 -3
  53. package/dist/evidence/evidence.js +0 -0
  54. package/dist/evidence/normalizer.js +0 -0
  55. package/dist/evidence/private-manifest.js +0 -0
  56. package/dist/evidence/semantics.js +0 -0
  57. package/dist/handoff/handoff-suggestion.js +2 -2
  58. package/dist/handoff/handoff.js +15 -1
  59. package/dist/harness/replay.js +0 -0
  60. package/dist/harness/validate.js +0 -0
  61. package/dist/hermes/context-export.js +0 -0
  62. package/dist/index.js +0 -0
  63. package/dist/mcp/server.js +0 -0
  64. package/dist/mcp/tool-dispatch.js +0 -0
  65. package/dist/mcp/tool-registry.js +0 -0
  66. package/dist/mcp/tool-schemas.js +0 -0
  67. package/dist/policy/command-risk.js +0 -0
  68. package/dist/policy/permission-matrix.js +0 -0
  69. package/dist/policy/policy.js +0 -0
  70. package/dist/policy/preflight.js +0 -0
  71. package/dist/policy/presets.js +0 -0
  72. package/dist/policy/tokenizer.js +0 -0
  73. package/dist/providers/fallback-executor.js +0 -0
  74. package/dist/providers/mock-provider.js +0 -0
  75. package/dist/providers/provider-contract.js +0 -0
  76. package/dist/providers/provider-preparation.js +0 -0
  77. package/dist/providers/scripted-provider.js +0 -0
  78. package/dist/schemas/active-run-projection.schema.json +0 -0
  79. package/dist/schemas/active-run-resume.schema.json +0 -0
  80. package/dist/schemas/actor-context.schema.json +0 -0
  81. package/dist/schemas/clean-checkout-smoke.schema.json +0 -0
  82. package/dist/schemas/context-export.schema.json +0 -0
  83. package/dist/schemas/dashboard-bootstrap.schema.json +0 -0
  84. package/dist/schemas/dashboard-core.schema.json +0 -0
  85. package/dist/schemas/dashboard-task-detail.schema.json +0 -0
  86. package/dist/schemas/dashboard-timeline.schema.json +0 -0
  87. package/dist/schemas/dev-docker-check.schema.json +15 -1
  88. package/dist/schemas/event.schema.json +0 -0
  89. package/dist/schemas/evidence-lint.schema.json +0 -0
  90. package/dist/schemas/evidence-list.schema.json +0 -0
  91. package/dist/schemas/evidence-migration-preview.schema.json +0 -0
  92. package/dist/schemas/feature-smoke.schema.json +0 -0
  93. package/dist/schemas/handoff-suggestion.schema.json +0 -0
  94. package/dist/schemas/install-plan.schema.json +0 -0
  95. package/dist/schemas/next-action.schema.json +0 -0
  96. package/dist/schemas/package-smoke.schema.json +0 -0
  97. package/dist/schemas/plan-context.schema.json +0 -0
  98. package/dist/schemas/private-evidence.schema.json +0 -0
  99. package/dist/schemas/protocol-consistency.schema.json +0 -0
  100. package/dist/schemas/protocol-remediation.schema.json +0 -0
  101. package/dist/schemas/provider-call.schema.json +0 -0
  102. package/dist/schemas/provider-config.schema.json +0 -0
  103. package/dist/schemas/release-artifact-manifest.schema.json +0 -0
  104. package/dist/schemas/release-artifact.schema.json +0 -0
  105. package/dist/schemas/release-dry-run.schema.json +0 -0
  106. package/dist/schemas/release-gate.schema.json +0 -0
  107. package/dist/schemas/release-publish.schema.json +0 -0
  108. package/dist/schemas/runtime-version.schema.json +0 -0
  109. package/dist/schemas/schema-index.json +0 -0
  110. package/dist/schemas/smoke-evidence-summary.schema.json +0 -0
  111. package/dist/schemas/task-audit-close.schema.json +0 -0
  112. package/dist/schemas/task-close.schema.json +0 -0
  113. package/dist/schemas/task-complete-flow.schema.json +0 -0
  114. package/dist/schemas/task-create.schema.json +0 -0
  115. package/dist/schemas/task-finish.schema.json +0 -0
  116. package/dist/schemas/task-next.schema.json +0 -0
  117. package/dist/schemas/task-ready.schema.json +0 -0
  118. package/dist/schemas/task-upgrade-scaffold.schema.json +0 -0
  119. package/dist/schemas/task-workbench.schema.json +12 -0
  120. package/dist/schemas/tools-list.schema.json +0 -0
  121. package/dist/schemas/write-preflight.schema.json +0 -0
  122. package/dist/services/active-run-state.js +0 -0
  123. package/dist/services/capability-registry.js +0 -0
  124. package/dist/services/clean-checkout-smoke.js +0 -0
  125. package/dist/services/dashboard-bootstrap.js +0 -0
  126. package/dist/services/dashboard-cache.js +0 -0
  127. package/dist/services/dashboard-core.js +0 -0
  128. package/dist/services/dashboard-heavy-projection.js +0 -0
  129. package/dist/services/dashboard-projection-store.js +0 -0
  130. package/dist/services/dashboard-refresh.js +0 -0
  131. package/dist/services/dashboard-task-detail.js +2 -0
  132. package/dist/services/dashboard-task-projection.js +0 -0
  133. package/dist/services/dashboard-timeline.js +0 -0
  134. package/dist/services/evidence-lint.js +1 -1
  135. package/dist/services/evidence-list.js +1 -1
  136. package/dist/services/evidence-migration.js +0 -0
  137. package/dist/services/feature-smoke.js +0 -0
  138. package/dist/services/handoff-summary-parser.js +0 -0
  139. package/dist/services/harness-service.js +0 -0
  140. package/dist/services/install-plan.js +0 -0
  141. package/dist/services/markdown-table.js +0 -0
  142. package/dist/services/operational-debt.js +0 -0
  143. package/dist/services/operations-status-service.js +5 -1
  144. package/dist/services/package-smoke.js +0 -0
  145. package/dist/services/policy-service.js +0 -0
  146. package/dist/services/project-read-model.js +0 -0
  147. package/dist/services/protocol-consistency.js +0 -0
  148. package/dist/services/protocol-profile.js +0 -0
  149. package/dist/services/protocol-remediation.js +0 -0
  150. package/dist/services/release-artifact-evidence.js +0 -0
  151. package/dist/services/release-artifact.js +0 -0
  152. package/dist/services/release-diagnostics.js +0 -0
  153. package/dist/services/release-dry-run.js +0 -0
  154. package/dist/services/release-evidence-validation.js +0 -0
  155. package/dist/services/release-evidence.js +0 -0
  156. package/dist/services/release-provider-advisories.js +0 -0
  157. package/dist/services/release-publish.js +0 -0
  158. package/dist/services/release-readiness-summary.js +0 -0
  159. package/dist/services/release-target-configuration.js +0 -0
  160. package/dist/services/release-targets.js +0 -0
  161. package/dist/services/runtime-version.js +0 -0
  162. package/dist/services/smoke-evidence.js +0 -0
  163. package/dist/services/task-read-model.js +2 -2
  164. package/dist/services/task-workbench.js +39 -0
  165. package/dist/services/tools-list.js +0 -0
  166. package/dist/services/workbench-next-actions.js +0 -0
  167. package/dist/services/write-preflight.js +0 -0
  168. package/dist/task/lifecycle-next-actions.js +0 -0
  169. package/dist/task/task-capsule.js +29 -0
  170. package/dist/task/task-close.js +0 -0
  171. package/dist/task/task-complete-flow.js +0 -0
  172. package/dist/task/task-create.js +0 -0
  173. package/dist/task/task-finish.js +1 -1
  174. package/dist/task/task-next.js +0 -0
  175. package/dist/task/task-ready.js +0 -0
  176. package/dist/task/task-templates.js +0 -0
  177. package/dist/task/task-upgrade-scaffold.js +0 -0
  178. package/dist/tools/fake-shell.js +0 -0
  179. package/dist/tui/cache.js +0 -0
  180. package/dist/tui/constants.js +0 -0
  181. package/dist/tui/layout.js +0 -0
  182. package/dist/tui/markdown.js +0 -0
  183. package/dist/tui/read-model-worker.js +0 -0
  184. package/dist/tui/read-model.js +4 -1
  185. package/dist/tui/snapshot.js +0 -0
  186. package/dist/tui/state.js +0 -0
  187. package/dist/tui/terminal.js +0 -0
  188. package/dist/tui/theme.js +0 -0
  189. package/package.json +1 -1
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # HADARA
2
2
 
3
3
  <p align="center">
4
- <img src="https://raw.githubusercontent.com/ictseoyoungmin/HADARA-dev/main/docs/assets/hadara_sub_right_name.png" alt="HADARA" width="720">
4
+ <img src="https://raw.githubusercontent.com/ictseoyoungmin/HADARA/main/docs/assets/hadara_sub_right_name.png" alt="HADARA" width="720">
5
5
  </p>
6
6
 
7
7
  <p align="center">
8
- <img alt="Release candidate" src="https://img.shields.io/badge/release-0.2.0--rc.0-blue">
8
+ <img alt="Release candidate" src="https://img.shields.io/badge/release-0.2.0--rc.2-blue">
9
9
  <img alt="Node.js" src="https://img.shields.io/badge/node-%3E%3D22-brightgreen">
10
10
  <img alt="License" src="https://img.shields.io/badge/license-MIT-lightgrey">
11
11
  </p>
@@ -23,10 +23,10 @@ This repository is both the HADARA source checkout and the HADARA protocol works
23
23
  The current source checkout targets:
24
24
 
25
25
  ```text
26
- hadara@0.2.0-rc.0
26
+ hadara@0.2.0-rc.2
27
27
  ```
28
28
 
29
- T-0268 refreshed package smoke, clean-checkout smoke, release artifact, release dry-run, and publish dry-run evidence for `0.2.0-rc.0`. T-0269 is the approval-gated publish capsule for this RC.
29
+ T-0282 refreshes the npm release-candidate source state for `0.2.0-rc.2` after the init scaffold protocol guidance follow-up. T-0275 published the previous `0.2.0-rc.1` RC after the installed-package recycle fixes.
30
30
 
31
31
  Current publish boundaries:
32
32
 
@@ -34,10 +34,12 @@ Current publish boundaries:
34
34
  |---|---|
35
35
  | npm package | Primary release target. |
36
36
  | `hadara@0.1.0-rc.0` | Published first RC. |
37
- | `hadara@0.2.0-rc.0` | Current source and publish-candidate version. |
37
+ | `hadara@0.2.0-rc.0` | Superseded internal publish candidate after recycle findings. |
38
+ | `hadara@0.2.0-rc.1` | Current published npm RC until rc.2 is operator-published. |
39
+ | `hadara@0.2.0-rc.2` | Current source version and next npm RC target. |
38
40
  | GitHub Release | Secondary target, still approval-gated. |
39
41
  | Docker image | Deferred. |
40
- | PyPI/Python package | Advisory preview only. |
42
+ | PyPI/Python package | `hadara==0.2.0rc1` published preview bridge. |
41
43
  | Installer scripts / USB launchers | Deferred. |
42
44
 
43
45
  No release command should publish, create a GitHub Release, build Docker images, upload artifacts, or load token values unless an operator explicitly approves the mutation path for the active release capsule.
@@ -49,7 +51,7 @@ Requires Node.js 22.
49
51
  Install the current RC:
50
52
 
51
53
  ```bash
52
- npm install -g hadara@0.2.0-rc.0
54
+ npm install -g hadara@0.2.0-rc.2
53
55
  hadara doctor --json
54
56
  hadara task list --json
55
57
  hadara tools list --json
@@ -58,11 +60,11 @@ hadara tools list --json
58
60
  Run without a global install:
59
61
 
60
62
  ```bash
61
- npx hadara@0.2.0-rc.0 doctor --json
62
- npx hadara@0.2.0-rc.0 tools list --json
63
+ npx hadara@0.2.0-rc.2 doctor --json
64
+ npx hadara@0.2.0-rc.2 tools list --json
63
65
  ```
64
66
 
65
- Previous RC: `hadara@0.1.0-rc.0` remains available on npm for comparison or rollback, but new installs should use the current RC once it is published.
67
+ Previous published RCs: `hadara@0.2.0-rc.1` and `hadara@0.1.0-rc.0` remain available on npm for comparison or rollback, but new installs should use the current RC after the operator publishes it.
66
68
 
67
69
  ## What HADARA Gives You
68
70
 
@@ -98,9 +100,9 @@ Task workflow:
98
100
  hadara task next --json
99
101
  hadara task create "implement a focused change" --json
100
102
  hadara task status --task T-0001 --json
101
- hadara task ready --task T-0001 --level done --json
102
103
  hadara task finish --task T-0001 --json
103
104
  hadara task finish --task T-0001 --execute --json
105
+ hadara task ready --task T-0001 --level done --json
104
106
  hadara task close --task T-0001 --json
105
107
  hadara task close --task T-0001 --execute --json
106
108
  hadara task audit-close --task T-0001 --json
@@ -150,14 +152,17 @@ hadara task status --task T-XXXX --json
150
152
  # Do the scoped work.
151
153
 
152
154
  hadara evidence add-command --task T-XXXX --summary "..." --result passed --json
155
+
156
+ hadara task finish --task T-XXXX --json
157
+ hadara task finish --task T-XXXX --execute --json
158
+
159
+ # Finalize Task Capsule docs and tracked state docs before closing.
160
+
153
161
  hadara task ready --task T-XXXX --level done --json
154
162
 
155
163
  # Optional workflow compression / next action preview:
156
164
  hadara task complete --task T-XXXX --json
157
165
 
158
- hadara task finish --task T-XXXX --json
159
- hadara task finish --task T-XXXX --execute --json
160
-
161
166
  hadara task close --task T-XXXX --json
162
167
  hadara task close --task T-XXXX --execute --json
163
168
 
@@ -174,6 +179,8 @@ Important distinctions:
174
179
  | `task close --execute` | Appends close evidence only. |
175
180
  | `task audit-close` | Read-only close proof audit. |
176
181
 
182
+ Before `task close --execute`, finish Task Capsule docs, acceptance/tests/handoff notes, evidence summaries, Task Board updates, and tracked state docs. After close execute, changing those close-source docs intentionally invalidates the previous close proof and requires rerunning ready/close/audit. Use stable wording for close results instead of pasting volatile close evidence ids into close-source docs.
183
+
177
184
  ## Initialize a Project
178
185
 
179
186
  ```bash
@@ -183,6 +190,8 @@ hadara init --profile standard
183
190
  hadara init --profile governed
184
191
  ```
185
192
 
193
+ Every profile generates `docs/TASK_WORKFLOW_COMMANDS.md` so fresh projects get the current evidence, ready, finish, close, and audit-close loop.
194
+
186
195
  | Profile | Use When |
187
196
  |---|---|
188
197
  | `basic` | Small project, only task/handoff discipline needed. |
File without changes
File without changes
package/dist/cli/actor.js CHANGED
File without changes
package/dist/cli/args.js CHANGED
File without changes
File without changes
package/dist/cli/debt.js CHANGED
File without changes
package/dist/cli/dev.js CHANGED
File without changes
@@ -11,7 +11,7 @@ function createDoctorReport(paths, nodeVersion = process.version) {
11
11
  const checks = [
12
12
  pathCheck('docs', paths.projectDocsDir),
13
13
  pathCheck('tasks', paths.projectTasksDir),
14
- pathCheck('project-context', paths.projectHadaraDir)
14
+ pathCheck('project-context', `${paths.projectContextDir}/HADARA_CONTEXT.md`)
15
15
  ];
16
16
  return {
17
17
  schemaVersion: 'hadara.doctor.v1',
@@ -63,6 +63,6 @@ function formatCheckLabel(id) {
63
63
  if (id === 'tasks')
64
64
  return 'tasks/: ';
65
65
  if (id === 'project-context')
66
- return '.hadara/: ';
66
+ return '.hadara/context/HADARA_CONTEXT.md: ';
67
67
  return `${id}: `;
68
68
  }
File without changes
File without changes
File without changes
@@ -27,7 +27,12 @@ function handleHandoffCommand(input) {
27
27
  const taskId = (0, args_1.getStringOption)(input.args, '--task');
28
28
  const summary = (0, args_1.getStringOption)(input.args, '--summary');
29
29
  const nextStep = (0, args_1.getStringOption)(input.args, '--next');
30
- const filePath = (0, handoff_1.updateHandoff)({ projectRoot: input.projectRoot, taskId, summary, nextStep });
31
- console.log(`[HADARA] Handoff updated: ${filePath}`);
30
+ const report = (0, handoff_1.updateHandoff)({ projectRoot: input.projectRoot, taskId, summary, nextStep });
31
+ if (input.jsonOutput) {
32
+ console.log(JSON.stringify(report, null, 2));
33
+ }
34
+ else {
35
+ console.log(`[HADARA] Handoff updated: ${report.target.path}`);
36
+ }
32
37
  return true;
33
38
  }
File without changes
File without changes
File without changes
package/dist/cli/init.js CHANGED
@@ -14,9 +14,9 @@ const args_1 = require("./args");
14
14
  const INIT_PROFILE_SPECS = {
15
15
  basic: {
16
16
  profile: 'basic',
17
- generatedDocsDescription: 'Core session docs only',
17
+ generatedDocsDescription: 'Core session docs plus task workflow commands',
18
18
  intendedUse: 'Small projects that need Task Capsules, evidence, and handoff discipline without planning overhead.',
19
- specialNotes: 'SOP required reading references only core docs plus active Task Capsule docs.',
19
+ specialNotes: 'SOP required reading references core docs, task workflow docs, and active Task Capsule docs.',
20
20
  docs: {
21
21
  architecture: false,
22
22
  developmentSlices: false,
@@ -58,17 +58,37 @@ const INIT_PROFILE_SPECS = {
58
58
  }
59
59
  }
60
60
  };
61
- function initProject(projectRoot, profile = 'standard') {
61
+ function initProject(projectRoot, profile = 'standard', options = {}) {
62
62
  const normalizedProfile = parseInitProfile(profile);
63
63
  const spec = INIT_PROFILE_SPECS[normalizedProfile];
64
64
  const paths = (0, paths_1.resolveHadaraPaths)({ projectRoot });
65
65
  (0, fs_1.ensureDir)(paths.projectDocsDir);
66
66
  (0, fs_1.ensureDir)(paths.projectTasksDir);
67
+ const actions = [];
67
68
  for (const file of createGeneratedScaffoldFiles(normalizedProfile)) {
69
+ const absolutePath = node_path_1.default.join(projectRoot, file.path);
70
+ const existed = node_fs_1.default.existsSync(absolutePath);
68
71
  (0, fs_1.writeFileIfMissing)(node_path_1.default.join(projectRoot, file.path), file.content);
72
+ actions.push({
73
+ action: 'init-doc',
74
+ path: file.path,
75
+ status: existed ? 'exists' : 'created',
76
+ summary: existed ? `${file.path} already existed and was not overwritten.` : `${file.path} was created.`
77
+ });
78
+ }
79
+ const report = {
80
+ schemaVersion: 'hadara.init.v1',
81
+ command: 'init',
82
+ ok: true,
83
+ profile: normalizedProfile,
84
+ actions,
85
+ issues: []
86
+ };
87
+ if (!options.silent) {
88
+ console.log(`[HADARA] Initialized project: ${projectRoot}`);
89
+ console.log(`[HADARA] Init profile: ${normalizedProfile}`);
69
90
  }
70
- console.log(`[HADARA] Initialized project: ${projectRoot}`);
71
- console.log(`[HADARA] Init profile: ${normalizedProfile}`);
91
+ return report;
72
92
  }
73
93
  function parseInitProfile(value) {
74
94
  if (value === 'basic' || value === 'standard' || value === 'governed')
@@ -106,7 +126,9 @@ function handleInitCommand(input) {
106
126
  printInitFollowUpReport(report, input.jsonOutput);
107
127
  return true;
108
128
  }
109
- initProject(input.projectRoot, (0, args_1.getStringOption)(input.args, '--profile', 'standard') ?? 'standard');
129
+ const report = initProject(input.projectRoot, (0, args_1.getStringOption)(input.args, '--profile', 'standard') ?? 'standard', { silent: input.jsonOutput });
130
+ if (input.jsonOutput)
131
+ console.log(JSON.stringify(report, null, 2));
110
132
  return true;
111
133
  }
112
134
  function getInitFollowUpMode(args) {
@@ -119,6 +141,7 @@ function createGeneratedScaffoldFiles(profile) {
119
141
  { path: 'docs/TASK_BOARD.md', content: '# TASK_BOARD\n\n| ID | Title | Status | Capsule | Notes |\n|---|---|---|---|---|\n' },
120
142
  { path: 'docs/AGENT_HANDOFF.md', content: createAgentHandoffDoc() },
121
143
  { path: 'docs/IMPLEMENTATION_SOP.md', content: createImplementationSopDoc(spec) },
144
+ { path: 'docs/TASK_WORKFLOW_COMMANDS.md', content: createTaskWorkflowCommandsDoc() },
122
145
  { path: 'AGENTS.md', content: createAgentsDoc(spec) },
123
146
  { path: '.gitignore', content: createGitignoreDoc() }
124
147
  ];
@@ -141,7 +164,7 @@ function createGeneratedScaffoldFiles(profile) {
141
164
  function createInitDoctorReport(projectRoot) {
142
165
  const issues = [];
143
166
  const actions = [];
144
- const requiredCore = ['AGENTS.md', '.gitignore', 'docs/PROJECT_STATE.md', 'docs/AGENT_HANDOFF.md', 'docs/TASK_BOARD.md', 'docs/IMPLEMENTATION_SOP.md'];
167
+ const requiredCore = ['AGENTS.md', '.gitignore', 'docs/PROJECT_STATE.md', 'docs/AGENT_HANDOFF.md', 'docs/TASK_BOARD.md', 'docs/IMPLEMENTATION_SOP.md', 'docs/TASK_WORKFLOW_COMMANDS.md'];
145
168
  for (const relativePath of requiredCore) {
146
169
  if (!node_fs_1.default.existsSync(node_path_1.default.join(projectRoot, relativePath))) {
147
170
  issues.push({ severity: 'error', code: 'INIT_CORE_DOC_MISSING', path: relativePath, message: `${relativePath} is missing from the init scaffold.` });
@@ -160,7 +183,7 @@ function createInitDoctorReport(projectRoot) {
160
183
  issues.push({ severity: 'warning', code: 'INIT_BROAD_DATA_IGNORE', path: '.gitignore', message: 'Top-level data/ is ignored; generated init should only ignore HADARA local/private state.' });
161
184
  }
162
185
  const sop = readProjectText(projectRoot, 'docs/IMPLEMENTATION_SOP.md');
163
- if (sop !== null && /minimal|full|hadara-protocol/.test(sop)) {
186
+ if (sop !== null && mentionsLegacyInitProfile(sop)) {
164
187
  issues.push({ severity: 'warning', code: 'INIT_OLD_PROFILE_NAME', path: 'docs/IMPLEMENTATION_SOP.md', message: 'SOP mentions old init profile names.' });
165
188
  }
166
189
  issues.push(...detectProfileMetadataMismatches(projectRoot));
@@ -185,6 +208,9 @@ function createInitDoctorReport(projectRoot) {
185
208
  issues
186
209
  };
187
210
  }
211
+ function mentionsLegacyInitProfile(content) {
212
+ return /(?:initialized with|profile(?:\s+name)?|init profile)\s+(?:the\s+)?`?(minimal|full|hadara-protocol)`?/i.test(content);
213
+ }
188
214
  function createInitUpgradeReport(projectRoot, profile, mode) {
189
215
  const actions = [];
190
216
  const issues = [];
@@ -366,6 +392,7 @@ const CANONICAL_TABLE_HEADERS = {
366
392
  'docs/AGENT_HANDOFF.md': ['| Area | State | Notes |', '| Task | Summary | Evidence |', '| Issue | Impact | Next Step |', '| Step | Reason | Done Evidence |', '| Check | Latest Evidence | Notes |', '| History Type | Path | When to Use |'],
367
393
  'docs/TASK_BOARD.md': ['| ID | Title | Status | Capsule | Notes |'],
368
394
  'docs/IMPLEMENTATION_SOP.md': ['| Document | When to Read | Purpose |', '| Profile | Scale | Generated Docs | Intended Use | Special Notes |', '| Document | Required Structure |'],
395
+ 'docs/TASK_WORKFLOW_COMMANDS.md': ['| Command | Default Write Behavior | Notes |'],
369
396
  'docs/ARCHITECTURE.md': ['| Field | Value |', '| Boundary | Rule | Notes |', '| Component | Path / Surface | Responsibility | Status |'],
370
397
  'docs/DEVELOPMENT_SLICES.md': ['| Order | Slice | Capsule | Purpose | Done Evidence |'],
371
398
  'docs/DECISIONS.md': ['| ID | Date | Decision | Status | Rationale | Evidence |'],
@@ -468,7 +495,8 @@ function sopRequiredReadingRowsForProfile(profile) {
468
495
  ['`docs/PROJECT_STATE.md`', 'Every session', 'Current product state and source-of-truth map.'],
469
496
  ['`docs/AGENT_HANDOFF.md`', 'Every session', 'Compact handoff and next recommended step.'],
470
497
  ['`docs/TASK_BOARD.md`', 'Every session', 'Work queue and task status.'],
471
- ['`docs/IMPLEMENTATION_SOP.md`', 'Every session', 'Local HADARA workflow rules and project-specific required-reading registry.']
498
+ ['`docs/IMPLEMENTATION_SOP.md`', 'Every session', 'Local HADARA workflow rules and project-specific required-reading registry.'],
499
+ ['`docs/TASK_WORKFLOW_COMMANDS.md`', 'Starting, finishing, closing, auditing, or explaining task workflow commands', 'Standard task loop, dry-run boundaries, and command `ok` semantics.']
472
500
  ];
473
501
  if (profile === 'standard' || profile === 'governed') {
474
502
  rows.push(['`docs/ARCHITECTURE.md`', 'Architecture, component, or boundary work', 'Current system shape and ownership boundaries.'], ['`docs/DEVELOPMENT_SLICES.md`', 'Starting, completing, or reclassifying slices', 'Roadmap ordering and completion evidence.'], ['`docs/DECISIONS.md`', 'Project-level decision work', 'Durable decisions that affect architecture or workflow.'], ['`docs/TEST_STRATEGY.md`', 'Validation planning or completion checks', 'Routine suites and special-case smoke boundaries.']);
@@ -483,7 +511,8 @@ function agentsRequiredReadingRowsForProfile(profile) {
483
511
  { document: '`docs/PROJECT_STATE.md`', when: 'Every session', purpose: 'Current product and capability state.' },
484
512
  { document: '`docs/AGENT_HANDOFF.md`', when: 'Every session', purpose: 'Compact continuation state.' },
485
513
  { document: '`docs/TASK_BOARD.md`', when: 'Every session', purpose: 'Current task queue and status.' },
486
- { document: '`docs/IMPLEMENTATION_SOP.md`', when: 'Every session', purpose: 'Local workflow and required-reading registry.' }
514
+ { document: '`docs/IMPLEMENTATION_SOP.md`', when: 'Every session', purpose: 'Local workflow and required-reading registry.' },
515
+ { document: '`docs/TASK_WORKFLOW_COMMANDS.md`', when: 'Starting, finishing, closing, auditing, or explaining task workflow commands', purpose: 'Standard task loop, dry-run boundaries, and command `ok` semantics.' }
487
516
  ];
488
517
  if (profile === 'standard' || profile === 'governed') {
489
518
  rows.push({ document: '`docs/ARCHITECTURE.md`', when: 'Architecture, component, or boundary work', purpose: 'Current system shape and ownership boundaries.' }, { document: '`docs/DEVELOPMENT_SLICES.md`', when: 'Starting, completing, or reclassifying a development slice', purpose: 'Roadmap ordering, prerequisites, and completion evidence.' }, { document: '`docs/DECISIONS.md`', when: 'Project-level decision work', purpose: 'Durable project decisions.' }, { document: '`docs/TEST_STRATEGY.md`', when: 'Validation planning or completion checks', purpose: 'Routine suites and special-case checks.' });
@@ -607,7 +636,7 @@ function inferProfileFromGeneratedDocs(projectRoot) {
607
636
  return 'basic';
608
637
  }
609
638
  function requiredDocsForProfile(profile) {
610
- const docs = ['docs/PROJECT_STATE.md', 'docs/AGENT_HANDOFF.md', 'docs/TASK_BOARD.md', 'docs/IMPLEMENTATION_SOP.md'];
639
+ const docs = ['docs/PROJECT_STATE.md', 'docs/AGENT_HANDOFF.md', 'docs/TASK_BOARD.md', 'docs/IMPLEMENTATION_SOP.md', 'docs/TASK_WORKFLOW_COMMANDS.md'];
611
640
  if (profile === 'standard' || profile === 'governed') {
612
641
  docs.push('docs/ARCHITECTURE.md', 'docs/DEVELOPMENT_SLICES.md', 'docs/DECISIONS.md', 'docs/TEST_STRATEGY.md');
613
642
  }
@@ -740,7 +769,7 @@ function createAgentHandoffDoc() {
740
769
  | Area | State | Notes |
741
770
  |---|---|---|
742
771
  | Scaffold | Initialized | HADARA protocol scaffold is initialized. |
743
- | Required Reading | Pending | Read \`PROJECT_STATE\`, \`TASK_BOARD\`, and \`IMPLEMENTATION_SOP\` before starting. |
772
+ | Required Reading | Pending | Read \`PROJECT_STATE\`, \`AGENT_HANDOFF\`, \`TASK_BOARD\`, \`IMPLEMENTATION_SOP\`, and \`TASK_WORKFLOW_COMMANDS\` before starting. |
744
773
 
745
774
  ## Last 3 Completed Tasks
746
775
 
@@ -818,7 +847,8 @@ function createImplementationSopDoc(spec) {
818
847
  ['`docs/PROJECT_STATE.md`', 'Every session', 'Current product state and source-of-truth map.'],
819
848
  ['`docs/AGENT_HANDOFF.md`', 'Every session', 'Compact handoff and next recommended step.'],
820
849
  ['`docs/TASK_BOARD.md`', 'Every session', 'Work queue and task status.'],
821
- ['`docs/IMPLEMENTATION_SOP.md`', 'Every session', 'Local HADARA workflow rules and project-specific required-reading registry.']
850
+ ['`docs/IMPLEMENTATION_SOP.md`', 'Every session', 'Local HADARA workflow rules and project-specific required-reading registry.'],
851
+ ['`docs/TASK_WORKFLOW_COMMANDS.md`', 'Starting, finishing, closing, auditing, or explaining task workflow commands', 'Standard task loop, dry-run boundaries, and command `ok` semantics.']
822
852
  ];
823
853
  if (spec.docs.architecture) {
824
854
  requiredReadingRows.push(['`docs/ARCHITECTURE.md`', 'Architecture, component, or boundary work', 'Current system shape and ownership boundaries.']);
@@ -847,7 +877,8 @@ function createImplementationSopDoc(spec) {
847
877
  ['`docs/PROJECT_STATE.md`', 'Product, Current Phase, Current Status, and Single Source of Truth sections.'],
848
878
  ['`docs/AGENT_HANDOFF.md`', 'Current State, Last 3 Completed Tasks, Current Known Problems, Next Recommended Step, Validation Baseline, and Historical Index sections.'],
849
879
  ['`docs/TASK_BOARD.md`', 'One task table with ID, Title, Status, Capsule, and Notes columns.'],
850
- ['`docs/IMPLEMENTATION_SOP.md`', 'Session Start, Required Reading, Init Profile Matrix, Scaffold Document Structure, Implementation, Validation, Session End, and Handoff Compaction sections.']
880
+ ['`docs/IMPLEMENTATION_SOP.md`', 'Session Start, Required Reading, Project-Specific Documents, Init Profile Matrix, Scaffold Document Structure, Implementation, Standard Task Workflow Loop, Validation, Evidence Records, Session End, and Handoff Compaction sections.'],
881
+ ['`docs/TASK_WORKFLOW_COMMANDS.md`', 'Standard Task Loop, Command Semantics, Non-Overlap Rules, and State Documents sections.']
851
882
  ];
852
883
  if (spec.docs.architecture)
853
884
  structureRows.push(['`docs/ARCHITECTURE.md`', 'Overview, Boundaries, and Current Components sections.']);
@@ -880,14 +911,23 @@ ${numberedList(sessionStart)}
880
911
  |---|---|---|
881
912
  ${requiredReadingRows.map(formatTableRow).join('\n')}
882
913
 
883
- When adding project-specific specs, contracts, or roadmap files, add them to this table and explain when agents must read them. Use \`hadara init register-doc --path <path> --when <text> --purpose <text> --json\` to preview registration, and add \`--execute\` to update this table.
914
+ ## Project-Specific Documents
915
+
916
+ When adding project-specific specs, contracts, roadmap files, or human/agent operating notes, register them in the Required Reading table before expecting people or agents to rely on them. Each row must explain when to read the document and what decision or workflow boundary it owns.
917
+
918
+ \`\`\`bash
919
+ hadara init register-doc --path docs/specs/example.md --when "When changing example behavior" --purpose "Example behavior contract" --json
920
+ hadara init register-doc --path docs/specs/example.md --when "When changing example behavior" --purpose "Example behavior contract" --execute --json
921
+ \`\`\`
922
+
923
+ Use \`--require-exists\` when the document must already exist before registration. Keep local-only notes out of committed required reading unless they are intentionally part of the project handoff.
884
924
 
885
925
  ## Init Profile Matrix
886
926
 
887
927
  | Profile | Scale | Generated Docs | Intended Use | Special Notes |
888
928
  |---|---|---|---|---|
889
- | \`basic\` | Small | Core session docs only | Small projects that need Task Capsules, evidence, and handoff discipline without planning overhead. | SOP required reading references only core docs plus active Task Capsule docs. |
890
- | \`standard\` | Medium, default | Core docs plus planning, architecture, decision, and validation docs | Most multi-session projects that need roadmap slices and repeatable validation. | Optional integrations must be registered before agents rely on them. |
929
+ | \`basic\` | Small | Core session docs plus task workflow commands | Small projects that need Task Capsules, evidence, and handoff discipline without planning overhead. | SOP required reading references core docs, task workflow docs, and active Task Capsule docs. |
930
+ | \`standard\` | Medium, default | Basic docs plus planning, architecture, decision, and validation docs | Most multi-session projects that need roadmap slices and repeatable validation. | Optional integrations must be registered before agents rely on them. |
891
931
  | \`governed\` | Heavy | Standard docs plus security, refactor log, and roadmap docs | Long-lived projects with stronger governance, security boundaries, refactor history, or roadmap-level planning. | Project-specific contracts still must be manually registered in Required Reading. |
892
932
 
893
933
  ## Scaffold Document Structure
@@ -907,12 +947,71 @@ Prefer tables for repeated records and \`##\`/\`###\` headings for durable secti
907
947
  3. Make the smallest coherent change that satisfies acceptance criteria.
908
948
  4. Update task-local docs when scope changes.
909
949
 
950
+ ## Standard Task Workflow Loop
951
+
952
+ The authoritative command semantics live in \`docs/TASK_WORKFLOW_COMMANDS.md\`. For ordinary implementation capsules, use this loop:
953
+
954
+ \`\`\`bash
955
+ hadara task next --json
956
+
957
+ # If a matching capsule already exists:
958
+ hadara task status --task T-XXXX --json
959
+
960
+ # If no matching capsule exists, create one first:
961
+ hadara task create "task title" --json
962
+ hadara task status --task T-XXXX --json
963
+
964
+ # Do the scoped work.
965
+
966
+ hadara evidence add-command --task T-XXXX --summary "..." --result passed --json
967
+
968
+ hadara task finish --task T-XXXX --json
969
+ hadara task finish --task T-XXXX --execute --json
970
+
971
+ # Finalize Task Capsule docs and tracked state docs before closing.
972
+
973
+ hadara task ready --task T-XXXX --level done --json
974
+
975
+ # Optional workflow compression / next action preview:
976
+ hadara task complete --task T-XXXX --json
977
+
978
+ hadara task close --task T-XXXX --json
979
+ hadara task close --task T-XXXX --execute --json
980
+
981
+ hadara task audit-close --task T-XXXX --json
982
+ \`\`\`
983
+
984
+ | Command | Default Write Behavior | Notes |
985
+ |---|---|---|
986
+ | \`task next\` | Read-only | Recommends work; does not create tasks. |
987
+ | \`task status\` | Read-only | \`ok\` means report generation succeeded; readiness is in \`state.ready\`, \`summary.blockers\`, and \`issues\`. |
988
+ | \`evidence add-command\` | Write | Appends command-log evidence; does not execute shell commands. |
989
+ | \`task ready\` | Read-only | Checks readiness; does not mutate evidence or status docs. |
990
+ | \`task finish\` | Dry-run by default; writes only with \`--execute\` | Bounded to \`TASK.md\` and \`docs/TASK_BOARD.md\`. |
991
+ | \`task close\` | Dry-run by default; writes only with \`--execute\` | Bounded to close evidence append. |
992
+ | \`task audit-close\` | Read-only | Verifies close evidence after close. |
993
+
994
+ Before running \`task ready\` and \`task close\`, finish all close-source edits: Task Capsule docs, acceptance/tests/handoff notes, evidence summaries, \`docs/TASK_BOARD.md\`, and tracked state docs such as \`docs/PROJECT_STATE.md\`, \`docs/AGENT_HANDOFF.md\`, and roadmap/slice docs when they apply. After \`task close --execute --json\`, do not edit those close-source documents unless you intend to rerun \`task ready\`, \`task close\`, and \`task audit-close\`. Avoid writing volatile close evidence ids into close-source docs; use stable wording such as "close evidence appended; audit returned closed-valid".
995
+
910
996
  ## Validation
911
997
 
912
998
  1. Run relevant tests.
913
- 2. Run \`hadara harness validate --task <task-id> --json\`.
914
- 3. Record evidence in \`EVIDENCE.md\` and \`evidence.jsonl\`.
915
- 4. Add project-specific integration or deployment smoke checks only after those surfaces exist and are documented for this project.
999
+ 2. Record meaningful evidence in \`EVIDENCE.md\` and \`evidence.jsonl\`.
1000
+ 3. Preview and execute \`hadara task finish --task <task-id> --json\` and \`hadara task finish --task <task-id> --execute --json\`.
1001
+ 4. Finalize Task Capsule docs and tracked state docs before close so the close source hash remains stable.
1002
+ 5. Run \`hadara task ready --task <task-id> --level done --json\` after finish and before close.
1003
+ 6. Preview and execute \`hadara task close --task <task-id> --json\` and \`hadara task close --task <task-id> --execute --json\`, then run \`hadara task audit-close --task <task-id> --json\`.
1004
+ 7. Add project-specific integration or deployment smoke checks only after those surfaces exist and are documented for this project.
1005
+
1006
+ \`task ready\` and \`task close\` include done-level Task Capsule validation. Use \`hadara harness validate --task <task-id> --level done --json\` directly when you need to debug capsule format or done-level validation failures.
1007
+
1008
+ ## Evidence Records
1009
+
1010
+ 1. Do not hand-edit Task Capsule \`evidence.jsonl\`.
1011
+ 2. Append evidence through HADARA commands so schema, visibility, and artifact-safety checks run consistently.
1012
+ 3. Record failed or blocked checks honestly. Do not replace them later with optimistic summaries; add newer evidence that explains the fix or residual risk.
1013
+ 4. Use \`hadara evidence add-command --task <task-id> --summary <text> --result passed|failed|blocked|unknown --json\` for command results when no artifact file is attached.
1014
+ 5. Use \`hadara evidence lint --task <task-id> --json\` when evidence drift is suspected or before close if evidence files were touched manually by mistake.
916
1015
 
917
1016
  ## Session End
918
1017
 
@@ -1017,8 +1116,18 @@ function createTestStrategyDoc() {
1017
1116
  | Step | Check | Evidence Location |
1018
1117
  |---|---|---|
1019
1118
  | 1 | Run the relevant suite from the table above. | Task Capsule \`EVIDENCE.md\` |
1020
- | 2 | Run \`hadara harness validate --task <task-id> --json\`. | Task Capsule \`EVIDENCE.md\` and \`evidence.jsonl\` |
1021
- | 3 | Record meaningful evidence in the Task Capsule. | Task Capsule files |
1119
+ | 2 | Record meaningful evidence in the Task Capsule. | Task Capsule \`EVIDENCE.md\` and \`evidence.jsonl\` |
1120
+ | 3 | Preview and execute \`task finish\` to synchronize status bookkeeping. | Task Capsule \`TASK.md\` and \`docs/TASK_BOARD.md\` |
1121
+ | 4 | Finalize Task Capsule docs and tracked state docs before close. | Task Capsule docs and tracked state docs |
1122
+ | 5 | Run \`hadara task ready --task <task-id> --level done --json\` after finish and before close. | Task Capsule \`EVIDENCE.md\` and \`evidence.jsonl\` |
1123
+ | 6 | Preview and execute \`task close\`, then run \`task audit-close\`. | Task Capsule close evidence |
1124
+
1125
+ ## Diagnostic Checks
1126
+
1127
+ | Check | Command | When To Use |
1128
+ |---|---|---|
1129
+ | Task Capsule format | \`hadara harness validate --task <task-id> --level done --json\` | \`task ready\` or \`task close\` reports done-level validation failures. |
1130
+ | Evidence index | \`hadara evidence lint --task <task-id> --json\` | Evidence files were touched manually by mistake or evidence drift is suspected. |
1022
1131
 
1023
1132
  ## Special-Case Checks
1024
1133
 
@@ -1047,14 +1156,94 @@ function createRoadmapDoc() {
1047
1156
  |---|---|---|
1048
1157
  `;
1049
1158
  }
1159
+ function createTaskWorkflowCommandsDoc() {
1160
+ return `# TASK_WORKFLOW_COMMANDS
1161
+
1162
+ HADARA task workflow commands are split by responsibility. Similar-looking commands are not interchangeable: some only report state, some check readiness, some perform bounded bookkeeping writes, and some append close evidence.
1163
+
1164
+ ## Standard Task Loop
1165
+
1166
+ Use this loop for ordinary implementation capsules:
1167
+
1168
+ \`\`\`bash
1169
+ hadara task next --json
1170
+
1171
+ # If a matching capsule already exists:
1172
+ hadara task status --task T-XXXX --json
1173
+
1174
+ # If no matching capsule exists, create one first:
1175
+ hadara task create "task title" --json
1176
+ hadara task status --task T-XXXX --json
1177
+
1178
+ # Do the scoped work.
1179
+
1180
+ hadara evidence add-command --task T-XXXX --summary "..." --result passed --json
1181
+
1182
+ hadara task finish --task T-XXXX --json
1183
+ hadara task finish --task T-XXXX --execute --json
1184
+
1185
+ # Finalize Task Capsule docs and tracked state docs before closing.
1186
+
1187
+ hadara task ready --task T-XXXX --level done --json
1188
+
1189
+ # Optional workflow compression / next action preview:
1190
+ hadara task complete --task T-XXXX --json
1191
+
1192
+ hadara task close --task T-XXXX --json
1193
+ hadara task close --task T-XXXX --execute --json
1194
+
1195
+ hadara task audit-close --task T-XXXX --json
1196
+ \`\`\`
1197
+
1198
+ \`task finish\`, \`task ready\`, and \`task close\` are intentionally separate. \`finish\` synchronizes bounded status bookkeeping first. \`ready\` then validates the Done-level state. \`close\` records close evidence after validation succeeds. \`audit-close\` checks the resulting close evidence after the write.
1199
+
1200
+ The close model has three separate phases: validation proves readiness, close records the proof, and audit checks the already-recorded close evidence. Close evidence is excluded from the current validation loop because it is appended after validation; requiring it as a same-run precondition would create a fixed-point loop.
1201
+
1202
+ \`task ready\` and \`task close\` include done-level Task Capsule validation. Use \`hadara harness validate --task T-XXXX --level done --json\` directly when debugging capsule format, status-history, acceptance, evidence, or handoff validation failures.
1203
+
1204
+ Before close, finish all close-source edits: Task Capsule docs, acceptance/tests/handoff notes, evidence summaries, \`docs/TASK_BOARD.md\`, and tracked state docs such as \`docs/PROJECT_STATE.md\`, \`docs/AGENT_HANDOFF.md\`, and roadmap/slice docs when they apply. After \`task close --execute --json\`, changing those documents changes the close source hash and requires rerunning \`task ready\`, \`task close\`, and \`task audit-close\`. Do not paste volatile close evidence ids into close-source docs; prefer stable wording such as "close evidence appended; audit returned closed-valid".
1205
+
1206
+ ## Command Semantics
1207
+
1208
+ | Command | Default Write Behavior | Notes |
1209
+ |---|---|---|
1210
+ | \`task next\` | Read-only | Recommends work; does not create tasks. |
1211
+ | \`task status\` | Read-only | \`ok\` means report generation succeeded; readiness is in \`state.ready\`, \`summary.blockers\`, and \`issues\`. |
1212
+ | \`task create\` | Write | Creates a Draft Task Capsule and Task Board row. It does not imply the task is ready or done. |
1213
+ | \`evidence add-command\` | Write | Appends operator-supplied command-log evidence. It does not execute shell commands or capture stdout/stderr. |
1214
+ | \`task finish\` | Dry-run by default; writes only with \`--execute\` | Updates only \`TASK.md\` status bookkeeping and the matching \`docs/TASK_BOARD.md\` row. |
1215
+ | \`task ready\` | Read-only | Checks whether the task can satisfy the requested readiness level after finish. |
1216
+ | \`task complete\` | Read-only | Summarizes the current completion stage and next command; it does not execute lifecycle writes. |
1217
+ | \`task close\` | Dry-run by default; writes only with \`--execute\` | Appends only canonical close evidence after close preconditions pass. |
1218
+ | \`task audit-close\` | Read-only | Verifies close evidence after close. |
1219
+
1220
+ ## Non-Overlap Rules
1221
+
1222
+ - \`task next\` chooses work; it does not create a capsule or infer completion.
1223
+ - \`task status\` is an operator console; \`ok: true\` means report generation succeeded, not that the task is ready.
1224
+ - \`task ready\` checks readiness; it does not write evidence or status.
1225
+ - \`harness validate\` is a direct diagnostic for Task Capsule structure and done-level gates; it is not a replacement for close evidence.
1226
+ - \`task complete\` is a read-only workflow compressor. It may report the next lifecycle command, but it must not execute finish, ready, close, or audit commands.
1227
+ - \`evidence add-command\` records an operator-supplied command result; it does not run the command.
1228
+ - \`task finish\` may update only the Task Capsule \`TASK.md\` status and matching \`docs/TASK_BOARD.md\` status/path row.
1229
+ - \`task close\` may append only close evidence. It must not update status docs, Task Board rows, handoff, Project State, roadmap docs, or arbitrary evidence.
1230
+ - After \`task close --execute --json\`, close-source document edits intentionally invalidate the previous close proof. Make those edits before close, or rerun ready/close/audit if the edit is unavoidable.
1231
+ - \`task audit-close\` is read-only and should be run after \`task close --execute --json\`.
1232
+
1233
+ ## State Documents
1234
+
1235
+ \`task finish --execute --json\` deliberately does not update broad prose state. Operators still update \`docs/PROJECT_STATE.md\`, \`docs/AGENT_HANDOFF.md\`, and any roadmap/slice docs generated for the selected profile when the task changes project state.
1236
+ `;
1237
+ }
1050
1238
  function createAgentsDoc(spec) {
1051
1239
  const requiredReadingRows = [
1052
1240
  ['1', '`docs/PROJECT_STATE.md`', 'Every session', 'Current product and capability state.'],
1053
1241
  ['2', '`docs/AGENT_HANDOFF.md`', 'Every session', 'Compact continuation state.'],
1054
1242
  ['3', '`docs/TASK_BOARD.md`', 'Every session', 'Current task queue and status.'],
1055
- ['4', '`docs/IMPLEMENTATION_SOP.md`', 'Every session', 'Local workflow and required-reading registry.']
1243
+ ['4', '`docs/IMPLEMENTATION_SOP.md`', 'Every session', 'Local workflow and required-reading registry.'],
1244
+ ['5', '`docs/TASK_WORKFLOW_COMMANDS.md`', 'Starting, finishing, closing, auditing, or explaining task workflow commands', 'Standard task loop, dry-run boundaries, and command `ok` semantics.']
1056
1245
  ];
1057
- let order = 5;
1246
+ let order = 6;
1058
1247
  if (spec.docs.architecture)
1059
1248
  requiredReadingRows.push([String(order++), '`docs/ARCHITECTURE.md`', 'Architecture, component, or boundary work', 'Current system shape and ownership boundaries.']);
1060
1249
  if (spec.docs.developmentSlices)
@@ -1074,7 +1263,8 @@ function createAgentsDoc(spec) {
1074
1263
  const ruleRows = [
1075
1264
  ['Task boundary', 'Keep work inside one Task Capsule whenever possible.', 'Active Task Capsule'],
1076
1265
  ['Task creation', 'If no suitable capsule exists, create one with `hadara task create <title>`.', '`docs/TASK_BOARD.md`'],
1077
- ['Evidence', 'Do not mark work done without evidence.', '`EVIDENCE.md`, `evidence.jsonl`'],
1266
+ ['Evidence', 'Do not mark work done without evidence. Do not hand-edit `evidence.jsonl`; record failed or blocked checks honestly instead of replacing them with optimistic summaries.', '`EVIDENCE.md`, `evidence.jsonl`'],
1267
+ ['Task workflow', 'For task workflow commands, follow `docs/TASK_WORKFLOW_COMMANDS.md`: record evidence, preview and execute `task finish`, finalize close-source docs, run `task ready`, preview and execute `task close`, then run `task audit-close`.', 'Task Capsule evidence'],
1078
1268
  ['Safety', 'Do not execute dangerous commands without explicit user approval.', 'Task Capsule evidence'],
1079
1269
  ['Secrets', 'Do not write secrets, private logs, or machine-local state into committed files.', 'Changed-file review'],
1080
1270
  ['Store boundary', 'Preserve the portable/project store boundary.', spec.docs.architecture ? '`.gitignore`, `docs/ARCHITECTURE.md`' : '`.gitignore`'],
@@ -1118,6 +1308,22 @@ dist/
1118
1308
  coverage/
1119
1309
  *.log
1120
1310
 
1311
+ # Python and test artifacts
1312
+ __pycache__/
1313
+ *.py[cod]
1314
+ *$py.class
1315
+ .pytest_cache/
1316
+ .mypy_cache/
1317
+ .ruff_cache/
1318
+ .coverage
1319
+ htmlcov/
1320
+ .venv/
1321
+ venv/
1322
+ env/
1323
+ *.db
1324
+ *.sqlite
1325
+ *.sqlite3
1326
+
1121
1327
  # HADARA local/private state
1122
1328
  .hadara/local/
1123
1329
  .hadara/tmp/
File without changes
package/dist/cli/main.js CHANGED
@@ -41,7 +41,7 @@ function printHelp() {
41
41
  console.log(`HADARA bootstrap CLI
42
42
 
43
43
  Usage:
44
- hadara init [--project <path>] [--profile basic|standard|governed]
44
+ hadara init [--project <path>] [--profile basic|standard|governed] [--json]
45
45
  hadara init doctor [--json]
46
46
  hadara init upgrade --profile basic|standard|governed [--execute] [--json]
47
47
  hadara init register-doc --path <path> --when <text> --purpose <text> [--require-exists] [--execute] [--json]
@@ -73,7 +73,7 @@ Usage:
73
73
  hadara protocol doctor --scope docs|profile|all [--json]
74
74
  hadara protocol remediate --fix task-board-row|decisions-table-frame|project-state-profile|evidence-jsonl [--task <task-id>] [--profile basic|standard|governed] [--execute --before-hash <hash>] [--json]
75
75
  hadara tools list [--json]
76
- hadara handoff update --task <task-id> [--summary <text>] [--next <text>]
76
+ hadara handoff update --task <task-id> [--summary <text>] [--next <text>] [--json]
77
77
  hadara handoff suggest --task <task-id> [--json]
78
78
  hadara write preflight <command...> [--json]
79
79
  hadara policy check-shell <command> [--mode readonly|assisted|trusted|auto|release]
package/dist/cli/mcp.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes