@hassangameryt/freeflow 0.7.3 → 0.8.0

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 (276) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/.cursor-plugin/plugin.json +1 -1
  5. package/NOTICE +14 -0
  6. package/README.md +26 -31
  7. package/capabilities/cognitive-routing/SKILL.md +106 -161
  8. package/capabilities/cognitive-routing/references/both-mode.md +36 -0
  9. package/capabilities/cognitive-routing/references/executor-mode.md +48 -0
  10. package/capabilities/cognitive-routing/references/helper-mode.md +47 -0
  11. package/capabilities/compaction/SKILL.md +49 -0
  12. package/capabilities/compaction/references/summary-format.md +239 -0
  13. package/command-surface.json +4 -0
  14. package/gemini-extension.json +1 -1
  15. package/hooks/shared/runtime-context.mjs +28 -30
  16. package/licenses/Apache-2.0.txt +55 -0
  17. package/package.json +22 -9
  18. package/pi-extension/README.md +41 -0
  19. package/pi-extension/dist/cognitive-routing/assembler.js +393 -0
  20. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/config.js +5 -2
  21. package/pi-extension/dist/cognitive-routing/economics.js +45 -0
  22. package/pi-extension/dist/cognitive-routing/event-schema.js +388 -0
  23. package/pi-extension/dist/{session-sources/events.js → cognitive-routing/event-store.js} +103 -40
  24. package/pi-extension/dist/cognitive-routing/gate.js +241 -0
  25. package/pi-extension/dist/cognitive-routing/handlers.js +899 -0
  26. package/pi-extension/dist/cognitive-routing/handoffs.js +350 -0
  27. package/pi-extension/dist/cognitive-routing/model-control.js +467 -0
  28. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/projection.js +229 -56
  29. package/pi-extension/dist/cognitive-routing/provenance.js +81 -0
  30. package/pi-extension/dist/cognitive-routing/runtime.js +396 -0
  31. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/schemas.js +43 -7
  32. package/pi-extension/dist/cognitive-routing/session.js +221 -0
  33. package/pi-extension/dist/{session-sources → cognitive-routing}/sources.js +99 -85
  34. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/state.js +37 -378
  35. package/pi-extension/dist/cognitive-routing/status.js +80 -0
  36. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/tools.js +12 -12
  37. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/types.js +5 -11
  38. package/pi-extension/dist/compaction/carry.js +191 -0
  39. package/pi-extension/dist/compaction/config.js +22 -0
  40. package/pi-extension/dist/compaction/controller.js +471 -0
  41. package/pi-extension/dist/compaction/harness.js +77 -0
  42. package/pi-extension/dist/compaction/results.js +158 -0
  43. package/pi-extension/dist/compaction/thresholds.js +35 -0
  44. package/pi-extension/dist/compaction/tool.js +57 -0
  45. package/pi-extension/dist/host/branch.js +13 -0
  46. package/pi-extension/dist/host/canonical.js +12 -0
  47. package/pi-extension/dist/host/catalog.js +77 -0
  48. package/pi-extension/dist/host/config.js +374 -0
  49. package/pi-extension/dist/host/projection-tags.js +60 -0
  50. package/pi-extension/dist/host/prompts.js +82 -0
  51. package/pi-extension/dist/{session-sources → host}/read-only-session.js +112 -1
  52. package/pi-extension/dist/{runtime → host}/request-history.js +121 -39
  53. package/pi-extension/dist/host/runtime-state.js +189 -0
  54. package/pi-extension/dist/{settings/settings-ui.js → host/settings/freeflow-command.js} +620 -410
  55. package/pi-extension/dist/{settings/settings-tui.js → host/settings/settings-view.js} +186 -73
  56. package/pi-extension/dist/host/staging.js +28 -0
  57. package/pi-extension/dist/host/status.js +101 -0
  58. package/pi-extension/dist/index.js +423 -173
  59. package/pi-extension/dist/provider-support/cache/anchor.js +21 -0
  60. package/pi-extension/dist/provider-support/cache/anthropic.js +102 -0
  61. package/pi-extension/dist/provider-support/cache/health.js +73 -0
  62. package/pi-extension/dist/provider-support/cache/index.js +58 -0
  63. package/pi-extension/dist/provider-support/cache/keepalive.js +210 -0
  64. package/pi-extension/dist/provider-support/cache/monitor.js +17 -0
  65. package/pi-extension/dist/provider-support/cache/openai-responses.js +48 -0
  66. package/pi-extension/dist/provider-support/effort.js +13 -0
  67. package/pi-extension/dist/provider-support/index.js +44 -3
  68. package/pi-extension/dist/provider-support/{astra → openai}/adapter.js +46 -29
  69. package/pi-extension/dist/provider-support/{astra → openai}/history.js +10 -8
  70. package/pi-extension/dist/provider-support/{astra → openai}/index.js +8 -4
  71. package/pi-extension/dist/provider-support/{astra → openai}/session-state.js +29 -38
  72. package/pi-extension/dist/provider-support/routes.js +17 -0
  73. package/pi-extension/dist/tool-execution/apply-patch/grammar.js +23 -0
  74. package/pi-extension/dist/tool-execution/apply-patch/match.js +38 -0
  75. package/pi-extension/dist/tool-execution/apply-patch/parser.js +177 -0
  76. package/pi-extension/dist/tool-execution/apply-patch/plan.js +201 -0
  77. package/pi-extension/dist/tool-execution/apply-patch/tool.js +84 -0
  78. package/pi-extension/dist/tool-execution/background.js +238 -0
  79. package/pi-extension/dist/tool-execution/bash-guard.js +23 -0
  80. package/pi-extension/dist/tool-execution/config.js +22 -0
  81. package/pi-extension/dist/tool-execution/edit-messages.js +120 -0
  82. package/pi-extension/dist/tool-execution/file-state.js +138 -0
  83. package/pi-extension/dist/tool-execution/file-tracking.js +143 -0
  84. package/pi-extension/dist/tool-execution/prompt.js +54 -0
  85. package/pi-extension/dist/tool-execution/tools.js +16 -0
  86. package/pi-extension/freeflow/README.md +9 -0
  87. package/plugin.json +1 -1
  88. package/runtime/prompts/cognitive-routing.md +4 -4
  89. package/runtime/prompts/core.md +22 -75
  90. package/runtime/prompts/interaction-contract.md +15 -8
  91. package/runtime/prompts/tool-execution.md +38 -0
  92. package/runtime/prompts/working-method.md +108 -0
  93. package/skills/action-selection/SKILL.md +39 -47
  94. package/skills/action-selection/references/trajectory-stalls.md +2 -0
  95. package/skills/bypass/SKILL.md +2 -2
  96. package/skills/commit-work/SKILL.md +31 -83
  97. package/skills/commit-work/references/git-state-edges.md +1 -1
  98. package/skills/commit-work/references/simple-push.md +2 -0
  99. package/skills/commit-work/references/staging-decisions.md +1 -1
  100. package/skills/decision-gate/SKILL.md +31 -50
  101. package/skills/design-for-depth/SKILL.md +44 -53
  102. package/skills/design-for-depth/references/design-pressure-signals.md +46 -144
  103. package/skills/design-for-depth/references/implementation-decisions.md +1 -1
  104. package/skills/design-for-depth/references/interface-design-loop.md +5 -36
  105. package/skills/design-for-depth/references/module-and-dependency-design.md +2 -32
  106. package/skills/design-for-depth/references/state-and-failure-boundaries.md +2 -13
  107. package/skills/diagnose-failure/SKILL.md +39 -24
  108. package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +2 -0
  109. package/skills/diagnose-failure/references/flaky-and-performance-diagnosis.md +2 -2
  110. package/skills/discuss/SKILL.md +35 -11
  111. package/skills/discuss/references/discussion-continuity.md +7 -27
  112. package/skills/evaluate-skill/SKILL.md +49 -80
  113. package/skills/evaluate-skill/references/evaluation-definition-schema.md +35 -5
  114. package/skills/evaluate-skill/references/evaluation-design.md +14 -14
  115. package/skills/evaluate-skill/references/execution-and-evidence.md +26 -5
  116. package/skills/evaluate-skill/references/review-and-revision.md +3 -1
  117. package/skills/evaluate-skill/scripts/lib/definitions.mjs +49 -8
  118. package/skills/evaluate-skill/scripts/lib/pi.mjs +14 -7
  119. package/skills/evaluate-skill/scripts/lib/review.mjs +196 -0
  120. package/skills/evaluate-skill/scripts/lib/runner.mjs +45 -8
  121. package/skills/evaluate-skill/scripts/lib/sandbox.mjs +2 -0
  122. package/skills/evaluate-skill/scripts/lib/trials.mjs +103 -0
  123. package/skills/evaluate-skill/scripts/lib/view.mjs +67 -1
  124. package/skills/evaluate-skill/scripts/pi-command-tool.mjs +144 -0
  125. package/skills/evaluate-skill/scripts/pi-guard.mjs +30 -13
  126. package/skills/evaluate-skill/scripts/skill-eval.mjs +114 -34
  127. package/skills/execute-work/SKILL.md +41 -9
  128. package/skills/execute-work/references/code-practices.md +2 -0
  129. package/skills/execute-work/references/execute-work-edges.md +11 -1
  130. package/skills/handoff/SKILL.md +1 -1
  131. package/skills/handoff/references/handoff-templates.md +1 -1
  132. package/skills/review-artifact/SKILL.md +42 -41
  133. package/skills/review-artifact/references/adjudicate-artifact-review.md +1 -1
  134. package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +1 -1
  135. package/skills/review-work/SKILL.md +38 -32
  136. package/skills/review-work/references/adjudicate-work-review.md +1 -1
  137. package/skills/review-work/references/independent-work-reviewer-contract.md +1 -1
  138. package/skills/review-work/references/security-risk-lens.md +2 -4
  139. package/skills/setup-freeflow/SKILL.md +3 -1
  140. package/skills/setup-freeflow/references/activation-contract.md +7 -13
  141. package/skills/setup-freeflow/references/host-setup.md +3 -3
  142. package/skills/track-work/SKILL.md +113 -161
  143. package/skills/track-work/references/working-record-format.md +189 -350
  144. package/skills/track-work/scripts/lib/document.mjs +62 -6
  145. package/skills/track-work/scripts/lib/format.mjs +16 -1
  146. package/skills/track-work/scripts/lib/store.mjs +9 -8
  147. package/skills/track-work/scripts/lib/transitions.mjs +79 -4
  148. package/skills/track-work/scripts/working-record.mjs +34 -12
  149. package/skills/verify-work/SKILL.md +29 -20
  150. package/skills/verify-work/references/browser-runtime-evidence.md +1 -5
  151. package/skills/verify-work/references/integration-evidence.md +2 -0
  152. package/skills/verify-work/references/performance-evidence.md +3 -1
  153. package/skills/verify-work/references/test-design.md +3 -1
  154. package/skills/workflow/SKILL.md +65 -21
  155. package/skills/workflow/references/domain-skill-composition.md +5 -3
  156. package/skills/write-docs/SKILL.md +83 -0
  157. package/skills/write-docs/references/documentation-shapes.md +119 -0
  158. package/skills/write-docs/scripts/docs-check.mjs +139 -0
  159. package/skills/write-plan/SKILL.md +40 -40
  160. package/skills/write-plan/references/plan-shapes.md +1 -1
  161. package/skills/write-skill/SKILL.md +107 -147
  162. package/skills/write-skill/references/activation-boundaries.md +2 -0
  163. package/skills/write-skill/references/agent-first-instructions.md +22 -10
  164. package/skills/write-skill/references/progressive-disclosure.md +4 -2
  165. package/skills/write-skill/references/skill-dependency-graphs.md +2 -0
  166. package/skills/write-skill/scripts/lib/similarity.mjs +56 -0
  167. package/skills/write-skill/scripts/skill-author.mjs +18 -2
  168. package/skills/write-spec/SKILL.md +34 -41
  169. package/skills/write-spec/references/artifact-standards.md +1 -1
  170. package/skills/write-spec/references/decision-records.md +2 -0
  171. package/skills/write-spec/references/spec-shapes.md +1 -1
  172. package/capabilities/context-virtualization/SKILL.md +0 -103
  173. package/capabilities/conversation-history/SKILL.md +0 -53
  174. package/hooks/tests/check-host-adapters.test.mjs +0 -82
  175. package/hooks/tests/check-runtime-context-hook.sh +0 -212
  176. package/pi-extension/dist/cognitive-routing-v2/runtime.js +0 -2181
  177. package/pi-extension/dist/context-virtualization/commands.js +0 -89
  178. package/pi-extension/dist/context-virtualization/projector.js +0 -42
  179. package/pi-extension/dist/context-virtualization/runtime.js +0 -378
  180. package/pi-extension/dist/context-virtualization/state.js +0 -57
  181. package/pi-extension/dist/context-virtualization/types.js +0 -10
  182. package/pi-extension/dist/conversation-history/passages.js +0 -66
  183. package/pi-extension/dist/conversation-history/ranking.js +0 -105
  184. package/pi-extension/dist/conversation-history/runtime.js +0 -226
  185. package/pi-extension/dist/conversation-history/search.js +0 -56
  186. package/pi-extension/dist/conversation-history/types.js +0 -1
  187. package/pi-extension/dist/freeflow-context/resolver.js +0 -120
  188. package/pi-extension/dist/freeflow-context/runtime.js +0 -80
  189. package/pi-extension/dist/freeflow-context/source-projector.js +0 -95
  190. package/pi-extension/dist/freeflow-context/tool.js +0 -314
  191. package/pi-extension/dist/freeflow-context/types.js +0 -12
  192. package/pi-extension/dist/freeflow-context/visibility.js +0 -28
  193. package/pi-extension/dist/integrations/mcp-config.js +0 -29
  194. package/pi-extension/dist/runtime/runtime-context.js +0 -754
  195. package/pi-extension/dist/runtime/runtime-identity.js +0 -5
  196. package/pi-extension/dist/session-sources/provenance.js +0 -32
  197. package/pi-extension/dist/ui/text-component.js +0 -57
  198. package/pi-extension/src/cognitive-routing-v2/budget.ts +0 -42
  199. package/pi-extension/src/cognitive-routing-v2/config.ts +0 -173
  200. package/pi-extension/src/cognitive-routing-v2/projection.ts +0 -375
  201. package/pi-extension/src/cognitive-routing-v2/render.ts +0 -277
  202. package/pi-extension/src/cognitive-routing-v2/runtime.ts +0 -2241
  203. package/pi-extension/src/cognitive-routing-v2/schemas.ts +0 -180
  204. package/pi-extension/src/cognitive-routing-v2/state.ts +0 -839
  205. package/pi-extension/src/cognitive-routing-v2/tools.ts +0 -62
  206. package/pi-extension/src/cognitive-routing-v2/types.ts +0 -254
  207. package/pi-extension/src/context-virtualization/commands.ts +0 -111
  208. package/pi-extension/src/context-virtualization/projector.ts +0 -62
  209. package/pi-extension/src/context-virtualization/runtime.ts +0 -428
  210. package/pi-extension/src/context-virtualization/state.ts +0 -79
  211. package/pi-extension/src/context-virtualization/types.ts +0 -92
  212. package/pi-extension/src/conversation-history/passages.ts +0 -81
  213. package/pi-extension/src/conversation-history/ranking.ts +0 -155
  214. package/pi-extension/src/conversation-history/runtime.ts +0 -250
  215. package/pi-extension/src/conversation-history/search.ts +0 -79
  216. package/pi-extension/src/conversation-history/types.ts +0 -31
  217. package/pi-extension/src/freeflow-context/resolver.ts +0 -139
  218. package/pi-extension/src/freeflow-context/runtime.ts +0 -100
  219. package/pi-extension/src/freeflow-context/source-projector.ts +0 -106
  220. package/pi-extension/src/freeflow-context/tool.ts +0 -366
  221. package/pi-extension/src/freeflow-context/types.ts +0 -70
  222. package/pi-extension/src/freeflow-context/visibility.ts +0 -53
  223. package/pi-extension/src/index.ts +0 -390
  224. package/pi-extension/src/integrations/mcp-config.ts +0 -32
  225. package/pi-extension/src/provider-support/astra/adapter.ts +0 -108
  226. package/pi-extension/src/provider-support/astra/history.ts +0 -145
  227. package/pi-extension/src/provider-support/astra/index.ts +0 -12
  228. package/pi-extension/src/provider-support/astra/session-state.ts +0 -113
  229. package/pi-extension/src/provider-support/index.ts +0 -5
  230. package/pi-extension/src/runtime/request-history.ts +0 -243
  231. package/pi-extension/src/runtime/runtime-context.ts +0 -860
  232. package/pi-extension/src/runtime/runtime-identity.ts +0 -8
  233. package/pi-extension/src/session-sources/events.ts +0 -230
  234. package/pi-extension/src/session-sources/provenance.ts +0 -39
  235. package/pi-extension/src/session-sources/read-only-session.ts +0 -170
  236. package/pi-extension/src/session-sources/sources.ts +0 -334
  237. package/pi-extension/src/settings/settings-tui.ts +0 -501
  238. package/pi-extension/src/settings/settings-ui.ts +0 -1652
  239. package/pi-extension/src/ui/text-component.ts +0 -66
  240. package/pi-extension/tests/cache-reuse/history.test.js +0 -117
  241. package/pi-extension/tests/cache-reuse/native.test.js +0 -91
  242. package/pi-extension/tests/cache-reuse/settings.test.js +0 -211
  243. package/pi-extension/tests/cognitive-routing-v2/communication.test.js +0 -577
  244. package/pi-extension/tests/cognitive-routing-v2/compaction-input.test.js +0 -183
  245. package/pi-extension/tests/cognitive-routing-v2/delegation.test.js +0 -557
  246. package/pi-extension/tests/cognitive-routing-v2/native.test.js +0 -474
  247. package/pi-extension/tests/cognitive-routing-v2/performance.test.js +0 -87
  248. package/pi-extension/tests/cognitive-routing-v2/persistence.test.js +0 -300
  249. package/pi-extension/tests/cognitive-routing-v2/projection.test.js +0 -241
  250. package/pi-extension/tests/cognitive-routing-v2/recovery.test.js +0 -1034
  251. package/pi-extension/tests/cognitive-routing-v2/render.test.js +0 -244
  252. package/pi-extension/tests/cognitive-routing-v2/runtime.test.js +0 -423
  253. package/pi-extension/tests/cognitive-routing-v2/stabilization.test.js +0 -521
  254. package/pi-extension/tests/cognitive-routing-v2/state.test.js +0 -586
  255. package/pi-extension/tests/context-virtualization/extension.test.js +0 -775
  256. package/pi-extension/tests/context-virtualization/projector.test.js +0 -110
  257. package/pi-extension/tests/context-virtualization/runtime.test.js +0 -230
  258. package/pi-extension/tests/conversation-history/runtime.test.js +0 -98
  259. package/pi-extension/tests/conversation-history/search.test.js +0 -97
  260. package/pi-extension/tests/fixtures/pi-host.js +0 -4
  261. package/pi-extension/tests/fixtures/routing-native.js +0 -191
  262. package/pi-extension/tests/integration/mode-free-core.test.js +0 -220
  263. package/pi-extension/tests/integration/pi-extension.test.js +0 -1447
  264. package/pi-extension/tests/integration/prompt-architecture.test.js +0 -447
  265. package/pi-extension/tests/integration/unaffected-regressions.test.js +0 -478
  266. package/pi-extension/tests/provider-support/astra-boundaries.test.js +0 -75
  267. package/pi-extension/tests/provider-support/astra.test.js +0 -306
  268. package/pi-extension/tests/provider-support/cli.test.js +0 -92
  269. package/pi-extension/tests/provider-support/native.test.js +0 -183
  270. package/pi-extension/tests/settings/settings-tui.test.js +0 -243
  271. package/pi-extension/tsconfig.json +0 -16
  272. package/runtime/prompts/context-virtualization.md +0 -3
  273. package/runtime/prompts/conversation-history.md +0 -3
  274. package/skills/design-for-depth/references/software-design-philosophy.md +0 -202
  275. /package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/budget.js +0 -0
  276. /package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/render.js +0 -0
@@ -1,12 +1,27 @@
1
1
  # Working Record Format
2
2
 
3
- This is the canonical Markdown shape for a Schema 4 Working Record. Read it before directly editing structured content or preparing Markdown for a lifecycle command. It defines format and mechanical invariants; it does not authorize work or settle task meaning.
3
+ This reference owns the exact Schema 4 shape: sections, fields, states, lifecycle transitions, and the command contract. Read it before editing structure or preparing input for a command. It defines format, not what is worth recording; [Track Work](../SKILL.md) owns that judgment.
4
4
 
5
- The record is a compact current-state projection with append-oriented Slice history. It is not a transcript, a second Spec, a Plan, or a source of truth for the live environment.
5
+ ## Task Directory
6
6
 
7
- ## Canonical Skeleton
7
+ Each task has one directory:
8
8
 
9
- Initialization creates every structural heading, including empty headings:
9
+ ```text
10
+ .freeflow/tasks/task-NNN-<short-name>/
11
+ record.md the Working Record
12
+ specs/ task-local Specs
13
+ plans/ task-local Plans
14
+ sources/ saved copies of material that exists only in conversation
15
+ scratch/ temporary work: throwaway scripts, saved output, downloads
16
+ ```
17
+
18
+ `NNN` is three or more digits. A new task takes the next number after the highest existing one; numbers are never reused. `specs/`, `plans/`, and `sources/` are created only when needed; `init` creates `scratch/`. Nothing in `scratch/` is part of the record unless the record points to it, and it may be deleted when the task ends. The directory must be ignored by Git and untracked.
19
+
20
+ A Spec or Plan may instead live in the repository's own documentation; the record points to it either way.
21
+
22
+ ## Skeleton
23
+
24
+ `init` creates every structural heading:
10
25
 
11
26
  ```markdown
12
27
  # Working Record: <task name>
@@ -37,6 +52,8 @@ Last updated: <UTC ISO-8601 timestamp>
37
52
 
38
53
  None
39
54
 
55
+ ### Recovery sources
56
+
40
57
  ### Next useful action
41
58
 
42
59
  ## Future Work
@@ -52,476 +69,298 @@ None
52
69
  ## Notes
53
70
  ```
54
71
 
55
- The header contains the task name, `Schema`, task `State`, and script-maintained `Last updated`. `init` creates the timestamp and every successful lifecycle mutation refreshes it. Views, validation, failed commands, no-ops, and direct Markdown edits do not refresh it. It is advisory recency metadata, not proof of validity, freshness, authority, or semantic truth.
72
+ The five top-level sections are fixed, in this order: Current Context, Current Work, Future Work, History, Notes. `### Recovery sources` is optional; records created before it existed remain valid without it.
56
73
 
57
- The five top-level sections and their order are fixed:
74
+ The header holds the task name, `Schema`, task `State`, and `Last updated`. `init` and every successful lifecycle command set `Last updated`; views, validation, failed commands, and direct edits do not. It records recency only, not validity or truth.
58
75
 
59
- ```text
60
- Current Context
61
- Current Work
62
- Future Work
63
- History
64
- Notes
65
- ```
66
-
67
- Do not create another top-level section or remove an empty structural heading. The `Notes` section is last and opaque to structured parsing; ordinary Markdown inside it is retained as inert content.
76
+ ## Field Syntax
68
77
 
69
- ## General Rules
70
-
71
- - Known structured blocks use only the field names defined here.
72
- - Omit optional fields when they carry no useful information; do not emit empty labels or `[empty]` markers.
73
- - `Current Slice` uses the literal `None` when no Slice is current.
74
- - Field values may be multiline. Use ordinary Markdown bullets for concise lists.
75
- - Lifecycle-created structured entities use compact field-list rows. A one-value field is `- Field: value`; multiple or block values use `- Field:` followed by two-space-indented lines. Keep fields contiguous so the preview remains a compact list.
76
- - Expanded Schema 4 fields (`Field:` followed by values) remain accepted for backward reads and direct maintenance. Do not mix expanded and compact field styles within one entity block.
77
- - Proposed Slices and proposed Checkpoints have no durable ID. Their titles must be unique across all Future Work items.
78
- - Current and historical Slices use script-assigned `S-NNN` IDs.
79
- - Accepted Checkpoints use script-assigned `C-NNN` IDs.
80
- - Decisions use script-assigned `D-NNN` IDs.
81
- - Durable IDs appear in headings and are never changed by direct edits.
82
- - A lifecycle command either publishes one complete valid transition or leaves the source unchanged. If publication is uncertain, stop and inspect `full` before retrying.
83
-
84
- ## Current Context
85
-
86
- Current Context is present understanding, not an event stream. Keep it concise and use bullets under exactly these seven headings:
78
+ Structured entities use compact field rows:
87
79
 
88
80
  ```markdown
89
- ## Current Context
90
-
91
- ### Goal
92
-
93
- - The durable outcome or central question.
94
-
95
- ### What defines this task
96
-
97
- - Accepted artifacts, user decisions, constraints, and source pointers that determine interpretation.
98
-
99
- ### Settled
100
-
101
- - Supported facts or accepted choices that still affect the task.
102
-
103
- ### Tentative
104
-
105
- - Provisional hypotheses or assumptions.
106
-
107
- ### Open
108
-
109
- - Unresolved questions capable of changing the next action.
110
-
111
- ### Current direction
112
-
113
- - The remaining strategy, not a completed-work narrative.
114
-
115
- ### Boundaries
116
-
117
- - Scope exclusions, evidence limits, stop conditions, and separately controlled actions.
81
+ - Field: one-line value
82
+ - Field:
83
+ - first item
84
+ - second item
118
85
  ```
119
86
 
120
- `Settled` should not copy Decision rationale. `What defines this task` may point to accepted artifacts and sources without copying their content. Remove completed Slice narration, test inventories, hashes, stale failures, and live-run detail once their active consequence has an owner elsewhere.
87
+ - Multi-line values are indented two spaces under their field.
88
+ - The older expanded style (`Field: value` without the leading dash) is still read. Do not mix the two styles within one entity; commands rewrite entities they change in compact style.
89
+ - Use only the fields defined for the entity. Omit an optional field that has no value; never write an empty label such as `- Type:`.
90
+ - Every line inside a structured entity belongs to a field or a permitted nested heading. Stray text is invalid.
91
+ - Durable IDs are assigned by commands: `S-NNN` Slices, `C-NNN` Checkpoints, `D-NNN` Decisions. They appear in headings and never change or get reused. They follow recording order, not the order work happened.
92
+ - Proposed Slices and proposed Checkpoints have no ID. Their titles must be unique across Future Work.
121
93
 
122
- Change Context only when its present meaning changes. A Slice or Checkpoint transition alone does not require a Context rewrite. Concise does not mean lossy: retain detail when removing it could change the next valid action.
94
+ ## Current Context
123
95
 
124
- Preserve the agreed outcome separately from the current approach. Use the existing Goal, defining-source pointers, Current direction, and Boundaries to retain the execution scope and user-facing return condition; do not add a contract or phase section. An accepted amendment or new finding may require reconciling affected Current Work and Future Work as well as Context. Record unresolved dependencies as unresolved rather than converting the current mechanism into a requirement.
96
+ Present understanding, as bullets under exactly these seven headings:
125
97
 
126
- ## Current Work
98
+ | Heading | Holds |
99
+ | --- | --- |
100
+ | Goal | The outcome or central question; not the current mechanism. |
101
+ | What defines this task | Pointers to the artifacts that define the task, such as its Spec, Plan, issue, or user-supplied brief. Every entry is read on each recovery. |
102
+ | Settled | Facts and accepted understanding that still affect the work. |
103
+ | Tentative | Hypotheses and provisional approaches. |
104
+ | Open | Unresolved questions that could change the work. |
105
+ | Current direction | The remaining approach and why; not a history of completed work. |
106
+ | Boundaries | Scope exclusions, constraints, evidence limits, user-facing return conditions, and separately controlled actions. |
127
107
 
128
- Current Work contains only one Current Slice and one next useful action:
108
+ Keep only pointers under `What defines this task`; accepted choices go in Decisions and constraints in Boundaries. Change Current Context only when present meaning changes; a lifecycle transition alone does not require it. Remove narration once its consequence is recorded elsewhere.
129
109
 
130
- ```markdown
131
110
  ## Current Work
132
111
 
112
+ Current Work holds one Current Slice or `None`, optional Recovery sources, and one Next useful action.
113
+
133
114
  ### Current Slice
134
115
 
135
- #### S-001 — <title>
116
+ ```markdown
117
+ #### S-004 — Draft the migration guide
136
118
  - State: in_progress
137
119
  - Type: delivery
138
- - Intended result: The accepted outcome.
139
- - Authority source: The request or approval covering this Slice.
140
- - Scope: The permitted work boundary.
141
- - Expected evidence: The evidence required before closure.
142
- - Stop condition: The condition requiring pause or return for direction.
143
- - Starting state: The relevant current code or artifact state.
144
- - Reopened from: S-004
120
+ - Intended result: A guide existing users can follow to move to v2.
121
+ - Authority source: User request in this conversation.
122
+ - Scope: docs/migration.md only.
123
+ - Expected evidence: Every v1 option maps to a v2 option or a stated removal.
124
+ - Stop condition: A v1 option with no v2 equivalent and no accepted removal.
125
+ - Starting state: docs/migration.md does not exist.
145
126
 
146
127
  ##### Material updates
147
128
 
148
- - Extension — authority: user request; added scope: legacy adapter; added evidence: integration check.
149
- - Evidence — claim: adapter preserves the response shape; observer/boundary: focused integration test; result: supported; proves: local compatibility; does not prove: production behavior; pointer: file:test/compatibility.test.mjs
150
- - Paused — reason: compatibility policy is unresolved; resume when: the user selects a policy.
151
- - Resumed — resolution source: user selected backward compatibility.
152
-
153
- ### Next useful action
154
-
155
- - Inspect the named adapter before changing it.
129
+ - Evidence — claim: all 14 options mapped; observer/boundary: diff against v1 option list; result: supported; proves: coverage of listed options; does not prove: undocumented options; pointer: docs/migration.md
156
130
  ```
157
131
 
158
- Required active Slice fields:
159
-
160
- - `State: in_progress | paused`;
161
- - `Intended result`;
162
- - `Authority source`;
163
- - `Scope`;
164
- - `Expected evidence`;
165
- - `Stop condition`;
166
- - `Starting state`.
132
+ | Field | Required | Values |
133
+ | --- | --- | --- |
134
+ | State | yes | `in_progress`, `paused` |
135
+ | Intended result | yes | |
136
+ | Authority source | yes | |
137
+ | Scope | yes | |
138
+ | Expected evidence | yes | |
139
+ | Stop condition | yes | |
140
+ | Starting state | yes | The state of what this Slice will change. |
141
+ | Type | no | `learning`, `delivery`, `deepening` |
142
+ | Dependencies | no | |
143
+ | Reopened from | no | `S-NNN` of a historical Slice |
167
144
 
168
- Optional active Slice fields:
145
+ `in_progress` means the Slice's result is being pursued. `paused` means it is still current but safe continuation is suspended; an ordinary turn, feedback, or context boundary is not a pause.
169
146
 
170
- - `Type: learning | delivery | deepening`;
171
- - `Dependencies`;
172
- - `Reopened from: S-NNN`.
173
-
174
- `Material updates` is optional and bullet-only. It is append-oriented, not a second entity schema. Add an entry only when losing it could affect safe continuation or truthful closure. Useful forms are:
147
+ `##### Material updates` is optional and holds bullets only. Use these prefixes when they fit; the rest of each line is prose:
175
148
 
176
149
  ```text
177
- - Extension — authority: ...; added scope: ...; added evidence: ...; stop-condition change: ...
150
+ - Extension — authority: ...; added scope: ...; added evidence: ...
178
151
  - Evidence — claim: ...; observer/boundary: ...; result: supported | contradicted | inconclusive | unavailable; proves: ...; does not prove: ...; pointer: ...
152
+ - Result — identity: ... (for example a commit SHA, document version, or sent message ID)
179
153
  - Paused — reason: ...; resume when: ...
180
154
  - Resumed — resolution source: ...
181
- - Blocker — why unsafe: ...; required resolution: ...; resume when: ...
182
- - Blocker resolved — resolution source: ...
155
+ - Blocker — why unsafe: ...; required resolution: ...
183
156
  - Contradiction — ...
184
- - Review — judgment and task effect: ...
157
+ - Review — judgment and effect: ...
185
158
  - Correction — ...
186
159
  ```
187
160
 
188
- These prefixes make important information recoverable without creating global Blocker or Evidence entities. They are compact conventions; the whole update remains ordinary Markdown prose. If an attempt fails, is rolled back, or leaves residual effects that change the next decision, preserve the attempt, reason, Evidence, and residual state here or in the historical Slice summary.
161
+ An Evidence entry identifies the state it observed well enough to tell it apart from later versions. When later edits leave a result's applicability unresolved, say so rather than carrying the earlier result forward. Append counterevidence as a new entry instead of rewriting the earlier one. A missing output is unavailable evidence, not proof the check never ran. Label a report you did not observe as a report.
189
162
 
190
- Before context loss, retain any unverified edits, unresolved process outcome, relevant rejected approach, and prerequisite for the next action that would otherwise be lost. Preserve the current assignment's source and consequences separately from superseded instructions. Evidence prose should distinguish an observed result for an identified state from its unresolved applicability after later edits; keep real output pointers when available, and label unsupported reports as reports. Do not turn requested corrections into completed facts.
163
+ When no Slice is current, the section contains the single line `None`.
191
164
 
192
- A learning result records its question, evidence limits, and consequence for later work; it does not silently establish production acceptance. These are semantic contents of existing fields, not new lifecycle states, contract entities, or event types.
165
+ ### Recovery sources
193
166
 
194
- When there is no active Slice:
167
+ What the next context must read to resume the current work, one bullet per source:
195
168
 
196
169
  ```markdown
197
- ### Current Slice
170
+ ### Recovery sources
198
171
 
199
- None
172
+ - docs/api-v2.pdf — the accepted response shape; sections 3–4 govern the current Slice.
173
+ - .freeflow/tasks/task-007-report/sources/layout.png — the user's layout; the header spacing is binding.
174
+ - conversation:turn-42 — the user's exception for legacy clients.
175
+ - docs/benchmarks.md — baseline timings; read when measuring performance.
200
176
  ```
201
177
 
202
- `Next useful action` is one concise action or an honest wait/stop condition. It is not a progress log. Slice lifecycle and task-state commands replace it atomically with agent-supplied text; Checkpoint commands may replace it when their transition changes the route.
203
-
204
- Before any consequential action, especially after recovery, confirm the task State, Current Slice, active Decisions, pending or deferred Checkpoints, Next useful action, applicable authority/scope/stop condition, unresolved Evidence, and contradictions. Reconcile the projection from the Working Record, selected exact History, accepted artifacts under `What defines this task`, the live environment, and current human intent and authority. Do not act from the Working Record alone.
205
-
206
- Do not begin Slice work until the start transition has successfully persisted and validated the Current Slice and Next useful action. Record an accepted extension before executing its expanded scope.
207
-
208
- A Current Slice may be `in_progress` or `paused` only. `paused` means the same outcome remains current but safe continuation is suspended; a turn boundary or ordinary feedback is not a pause. To remove an unresolved paused attempt from Current Work, close it historically as `blocked`. Close as historical `blocked` only from a paused Current Slice; close as `abandoned` only with explicit authority and a reason; close as `completed` only after required Evidence and applicable Checkpoints are settled.
209
-
210
- ### Direct Start
211
-
212
- When an immediately authorized outcome does not need Future Work ordering or recovery, `slice start-direct` may create a detailed Current Slice without consuming or changing any Future Work item:
178
+ Each entry is a pointer, then what it establishes. An entry may end with a trigger, `read when <situation>`: recovery reads it only once that situation applies. Use one only when the source matters to part of the work, not to save reading what the next action needs. A pointer is a path relative to the repository root, an absolute path, a URL, or a host history reference when the host can retrieve it. Material that exists only in the conversation is saved under the task's `sources/` directory first. Recovery sources apply to Current Work only and do not carry into History.
213
179
 
214
- ```markdown
215
- #### S-001 — Immediate outcome
216
- - State: in_progress
217
- - Intended result: The immediate accepted outcome.
218
- - Authority source: The request or approval covering this Slice.
219
- - Scope: The permitted work boundary.
220
- - Expected evidence: The evidence required before closure.
221
- - Stop condition: The condition requiring pause or return for direction.
222
- - Starting state: The relevant starting code or artifact state.
223
- ```
180
+ ### Next useful action
224
181
 
225
- Direct start requires the same authority and write-ahead contract as proposal start. Its title must not conflict with a Future Work item; if a proposal should be selected, use proposal start instead.
182
+ One concise action or an honest wait or stop condition, as a single bullet. Slice and task-state commands replace it with the `--next-action` text; Checkpoint commands replace it when `--next-action` is given.
226
183
 
227
184
  ## Future Work
228
185
 
229
- Future Work is one ordered mixed sequence of proposed Slices and non-terminal Checkpoints. Order recommends a sequence; it is not fixed execution order or authority.
230
-
231
- Preserve a useful provisional route when one emerges rather than waiting for every implementation detail. Keep the immediate outcome concrete and later outcomes directional. Use the existing Dependencies field for prerequisites or ordering constraints, including uncertainty when material. Reconcile affected proposals after learning or accepted changes; neither their order nor a preceding Slice's completion proves their prerequisites.
232
-
233
- All Future Work titles are unique across both kinds of item. A proposed item may be edited, reordered, or removed. A proposed item has no authority and cannot be selected merely because it exists.
186
+ One ordered sequence of proposed Slices and non-terminal Checkpoints. Order is a recommendation; it confers no authority and may be revised at any time.
234
187
 
235
188
  ### Proposed Slice
236
189
 
237
190
  ```markdown
238
- ### Slice — <unique title>
191
+ ### Slice — Add the CLI
239
192
  - State: proposed
240
- - Type: learning
241
- - Intended result: The candidate outcome.
242
- - Expected evidence: The evidence that would settle it.
243
- - Dependencies: A prerequisite or ordering constraint.
193
+ - Intended result: A CLI that exposes the parser.
194
+ - Expected evidence: CLI tests for each subcommand.
195
+ - Dependencies: Implement the parser.
244
196
  ```
245
197
 
246
- Required:
247
-
248
- - unique title in the heading;
249
- - `State: proposed`;
250
- - `Intended result`.
251
-
252
- Optional:
253
-
254
- - `Type: learning | delivery | deepening`;
255
- - `Expected evidence`;
256
- - `Dependencies`.
257
-
258
- Starting removes this block from Future Work and creates a detailed Current Slice with a new `S-NNN`. The start operation must resolve any Checkpoint `Applies to` reference that named this proposed Slice.
198
+ Required: `State: proposed` and `Intended result`. Optional: `Type`, `Expected evidence`, `Dependencies`.
259
199
 
260
200
  ### Checkpoint
261
201
 
262
- A Checkpoint belongs to one Slice. Its state is explicit even though its storage location remains Future Work until terminal:
263
-
264
- ```text
265
- proposed -> pending <-> deferred
266
- pending | deferred -> completed | cancelled | replaced
267
- ```
268
-
269
- A proposed Checkpoint has no ID:
270
-
271
202
  ```markdown
272
- ### Checkpoint — <unique title>
273
- - State: proposed
274
- - Type: independent_review
275
- - Condition: The boundary that must be crossed or assessed.
276
- - Applies to: <proposed Slice title>
203
+ ### Checkpoint C-002 — Commit the parser
204
+ - State: pending
205
+ - Type: preserve
206
+ - Condition: The parser Slice's checks pass.
207
+ - Applies to: S-004
277
208
  ```
278
209
 
279
- Required fields:
280
-
281
- - unique title;
282
- - `State: proposed | pending | deferred`;
283
- - `Type: independent_review | local_commit | user_decision | continuity`;
284
- - `Condition`;
285
- - `Applies to`.
210
+ A proposed Checkpoint has no ID in its heading (`### Checkpoint — <title>`). Required fields: `State` (`proposed`, `pending`, `deferred`), `Type`, `Condition`, `Applies to`. `Applies to` names a proposed Slice by exact title until that Slice starts, then its `S-NNN`. Every Checkpoint belongs to one Slice; there are no task-wide Checkpoints.
286
211
 
287
- `Applies to` uses the exact proposed Slice title until that Slice receives an ID, then becomes `S-NNN`. A task-wide Checkpoint is not part of this format; use a Slice that owns the continuity boundary.
212
+ | State | Meaning |
213
+ | --- | --- |
214
+ | `proposed` | Anticipated only. It has no ID and no authority, and may be removed directly. |
215
+ | `pending` | Authorized or selected and due. Work that depends on it must not cross it, and its Slice cannot close until it is closed. |
216
+ | `deferred` | Accepted but dormant until its condition. It is not cancelled, and it still blocks its Slice's closure. |
288
217
 
289
- When the Checkpoint becomes accepted, activation requires explicit selection or authority, assigns `C-NNN`, and changes its state to `pending`. A proposal or recommendation is not acceptance. `pending` means the obligation is due and dependent work must not cross it. `deferred` means it remains accepted but dormant until its condition. An accepted Checkpoint cannot be removed by direct editing and cannot leave Future Work except through a lifecycle command.
218
+ An accepted Checkpoint leaves Future Work only through `checkpoint close`; never drop one by editing.
290
219
 
291
- A proposed Checkpoint can be removed without History. A pending or deferred Checkpoint cannot be silently dropped. A Slice cannot close while an applicable Checkpoint is pending or deferred; resolve it first or keep the Slice current/paused.
220
+ | Type | Boundary | Earlier name, still read |
221
+ | --- | --- | --- |
222
+ | `preserve` | Save a recoverable point: commit, draft version, snapshot. | `local_commit` |
223
+ | `publish` | Make work available beyond the workspace: push, pull request, publication, sending. | |
224
+ | `review` | Independent judgment of the work. | `independent_review` |
225
+ | `decision` | A user-owned choice that later work depends on. | `user_decision` |
226
+ | `continuity` | A planned pause, handoff, or transfer. | |
292
227
 
293
228
  ## History
294
229
 
295
- History always has these subsections in this order:
296
-
297
- ```markdown
298
- ## History
299
-
300
- ### Decisions
301
-
302
- ### Checkpoints
303
-
304
- ### Slices
305
- ```
306
-
307
- History is append-oriented, not strictly immutable: lifecycle commands may change an active Decision to a terminal state or move a current Slice/Checkpoint into History. Terminal content is never silently deleted, reactivated, or replaced. A clerical correction appends a correction record without erasing the prior value.
230
+ Three subsections in this order: Decisions, Checkpoints, Slices. History is append-oriented: commands add entries and move terminal state into it; terminal entries are never deleted, reactivated, or rewritten.
308
231
 
309
232
  ### Decisions
310
233
 
311
- Decisions are accepted choices, not tentative hypotheses. Add one with a script-assigned `D-NNN`:
312
-
313
234
  ```markdown
314
235
  #### D-001 — Keep the Markdown record canonical
315
236
  - State: active
316
- - Decision: `record.md` remains the canonical task projection.
317
- - Established by: The user’s accepted direction.
318
- - Rationale: Agents need a readable selective recovery surface.
319
- - Source references: file:...#...
320
- - Consequences: Views can project one record without duplicating state.
237
+ - Decision: record.md remains the canonical task memory.
238
+ - Established by: The user's accepted direction on 2026-09-25.
239
+ - Rationale: Agents need one readable recovery surface.
240
+ - Consequences: Views project the same file.
321
241
  - Revisit when: The storage boundary changes.
322
242
  ```
323
243
 
324
- Fields:
325
-
326
- - `State: active | superseded | retired` — required;
327
- - `Decision` — required;
328
- - `Established by` — required;
329
- - `Rationale` — required;
330
- - `Consequences` — required;
331
- - `Revisit when` — required;
332
- - `Source references` — optional;
333
- - `Superseded by: D-NNN` — required when `superseded`;
334
- - `Retired because` — required when `retired`.
244
+ Required: `State` (`active`, `superseded`, `retired`), `Decision`, `Established by`, `Rationale`, `Consequences`, `Revisit when`. Optional: `Source references`. `Superseded by: D-NNN` is required when superseded; `Retired because` when retired.
335
245
 
336
- Lifecycle:
337
-
338
- ```text
339
- active -> superseded | retired
340
- ```
341
-
342
- A clerical clarification may edit an active Decision directly without changing its meaning. A material change creates a new Decision and supersedes the old one. The old Decision names the replacement. Terminal Decisions are never reactivated; adopting an old choice again creates a new active Decision.
246
+ - Record only what the user actually accepted. When the difference matters, keep a source reference that distinguishes the accepted choice from the proposal.
247
+ - A clerical clarification may edit an active Decision directly. A change in meaning is a new Decision that supersedes the old one.
248
+ - Retire a Decision that no longer governs, with the reason. Adopting a superseded or retired choice again is a new Decision.
343
249
 
344
250
  ### Checkpoints
345
251
 
346
- Only terminal Checkpoints appear in History:
252
+ A closed Checkpoint keeps its future fields and adds `Result` and `Task effect`. `State` is `completed`, `cancelled`, or `replaced`. `Evidence` is optional; `Reason` is required for cancelled and replaced; `Replaced by: C-NNN` for replaced, naming a Checkpoint that is still pending or deferred.
347
253
 
348
- ```markdown
349
- #### C-001 — Review the compatibility boundary
350
- - State: completed
351
- - Type: independent_review
352
- - Condition: Review the integrated result before dependent work proceeds.
353
- - Applies to: S-001
354
- - Result: Review completed; one non-blocking concern remains outside this Slice.
355
- - Evidence: review:compatibility-review
356
- - Task effect: The Slice may proceed.
357
- ```
254
+ `completed` means the boundary happened, not that its judgment was favorable.
358
255
 
359
- Required terminal fields:
360
-
361
- - `State: completed | cancelled | replaced`;
362
- - `Type`;
363
- - `Condition`;
364
- - `Applies to`;
365
- - `Result`;
366
- - `Task effect`.
367
-
368
- Conditional or optional fields:
256
+ ### Slices
369
257
 
370
- - `Evidence` — required when the result depends on an observation or review;
371
- - `Reason` — required when `cancelled` or `replaced`;
372
- - `Replaced by: C-NNN` — required when `replaced`.
258
+ A closed Slice keeps `Intended result` and, when present, `Type`, `Authority source`, and `Reopened from`. It adds `Result`, `Evidence and limits`, and `Task effect`. `State` is `completed`, `blocked`, or `abandoned`; `Resume when` is required for blocked and `Reason` for abandoned. `Residual effects` is optional.
373
259
 
374
- `completed` means the boundary occurred, not that its judgment was favorable. A failed or blocking review is a completed Checkpoint whose Result records the adverse judgment and effect.
260
+ Closing does not keep Scope, Stop condition, Starting state, Dependencies, Material updates, or Recovery sources. Anything among them that still matters belongs in `Evidence and limits` or `Task effect` before closing.
375
261
 
376
- ### Historical Slices
262
+ | State | Meaning |
263
+ | --- | --- |
264
+ | `completed` | The intended result and its required evidence are settled. |
265
+ | `blocked` | A paused attempt that could not continue left Current Work; `Resume when` says what would allow it. |
266
+ | `abandoned` | Explicit authority ended the pursuit; `Reason` says why. |
377
267
 
378
- Closure compacts the Current Slice and its Material updates into one historical entry:
268
+ A Slice that finished before it could be recorded, such as work done before the record existed, enters History through `slice record` with the same fields plus two more:
379
269
 
380
270
  ```markdown
381
- #### S-001 — Implement the compatibility layer
271
+ #### S-006 — Baseline on the easy tasks
382
272
  - State: completed
383
- - Type: delivery
384
- - Intended result: Existing clients remain compatible.
385
- - Authority source: User request in the current conversation.
386
- - Result: The adapter was updated and the accepted behavior was verified locally.
387
- - Evidence and limits: Focused integration checks passed; production behavior was not observed.
388
- - Task effect: The next consumer can be migrated.
273
+ - Occurred: 2026-09-26 to 2026-09-27
274
+ - Recorded: retroactively on 2026-09-28
275
+ - Intended result: ...
389
276
  ```
390
277
 
391
- Required historical fields:
392
-
393
- - `State: completed | blocked | abandoned`;
394
- - `Intended result`;
395
- - `Result`;
396
- - `Evidence and limits`;
397
- - `Task effect`.
398
-
399
- Optional or conditional fields:
400
-
401
- - `Type: learning | delivery | deepening`;
402
- - `Authority source`;
403
- - `Reopened from: S-NNN`;
404
- - `Resume when` — required when `blocked`;
405
- - `Reason` — required when `abandoned`;
406
- - `Residual effects` — useful when abandonment or rollback leaves consequences.
407
-
408
- A historical `blocked` Slice is the unresolved parked attempt that left Current Work. A historical `completed` Slice may be reopened only when later authorized work still belongs to the same original outcome. An abandoned outcome is normally followed by a new proposed Slice.
278
+ `Occurred` is when the work happened: `YYYY-MM-DD` or `YYYY-MM-DD to YYYY-MM-DD`. `Recorded` is written by the command, so a retroactive entry is never mistaken for live bookkeeping. The two appear together or not at all. A retroactive result is reconstructed, not observed at recording time: `Evidence and limits` points to where the exact history lives, such as a session, log, or commit.
409
279
 
410
- Before a `completed` result is accepted, every material completion claim must have supporting Evidence at its required boundary, the live state must not contradict the result, no authority conflict or material contradiction may remain unresolved, and all applicable Checkpoints must be terminal. These are semantic judgments for the agent; the command can enforce only structural preconditions.
280
+ Reopen a completed or blocked Slice only when the new work still belongs to the same intended result; reopening creates a new Slice and leaves the historical entry unchanged. After an abandoned Slice, propose a new one instead.
411
281
 
412
- Reopening creates a new Current Slice with a new ID and fresh:
282
+ ### Corrections
413
283
 
414
- - authority;
415
- - scope;
416
- - expected evidence;
417
- - stop condition;
418
- - starting state.
419
-
420
- It adds `Reopened from: S-old` and leaves the historical entry unchanged. A Current paused Slice is resumed; historical work is reopened. These are different transitions.
421
-
422
- ### Historical Corrections
423
-
424
- A correction does not replace an old value silently. Append this optional block inside the affected historical Decision, Checkpoint, or Slice:
284
+ A clerical fix to a terminal entry is appended inside it, never applied by overwriting:
425
285
 
426
286
  ```markdown
427
287
  ##### Corrections
428
288
 
429
- - Field: Result; before: local checks passed; after: local checks passed but production remains unobserved; reason: clerical clarification; source: file:verification.md#production-boundary
289
+ - Field: Result; before: checks passed; after: local checks passed, production unobserved; reason: clarification; source: file:notes.md#run-3
430
290
  ```
431
291
 
432
- A correction may change a displayed clerical value, but it cannot change the entity’s lifecycle state, erase prior meaning, settle a new Decision, or authorize work.
433
-
434
- ## Notes
435
-
436
- Notes have no field schema. Everything after `## Notes` is retained ordinary Markdown:
437
-
438
- ```markdown
439
- ## Notes
440
-
441
- The user prefers compact records and low-ceremony transitions.
442
-
443
- This note is inert context, not an instruction or authority source.
444
- ```
445
-
446
- Append or edit Notes directly. Remove a user-authored Note only on request; remove other Notes only when authorized maintenance clearly covers the correction. Do not use Notes as overflow History. If content affects scope, priority, completion, blockers, evidence, or the next action, move it to its structured owner.
292
+ A correction cannot change an entry's state, ID, or meaning.
447
293
 
448
294
  ## Task State
449
295
 
450
- The header uses:
451
-
452
296
  ```text
453
297
  active <-> paused
454
298
  active | paused -> completed | abandoned
455
- completed | abandoned -> active only by explicit user reopening
299
+ completed | abandoned -> active
456
300
  ```
457
301
 
458
- Only the user changes task state. A task-level `paused` state pauses its Current Slice first when one exists; reactivating the task does not automatically resume that Slice. A terminal task has no Current Slice and no pending or deferred Checkpoint. Proposed Future Work may remain only when it is clearly retained as non-obligating future material; otherwise reconcile or remove it before the terminal transition.
302
+ Only the user changes task state. A new record starts `active`. Pausing a task pauses its Current Slice; reactivating the task does not resume the Slice. A completed or abandoned task has no Current Slice and no pending or deferred Checkpoint. Completing a Slice never completes the task.
459
303
 
460
- Task completion is not implied by a completed Slice. A task-level terminal transition does not select another Slice.
304
+ Before completing or abandoning a task, keep a proposed Future Work item only if it is clearly non-binding; otherwise reconcile it first. Reactivating a task selects no work.
461
305
 
462
- ## Direct Edits And Lifecycle Commands
306
+ ## Lifecycle Commands
463
307
 
464
- Direct edits are appropriate for:
308
+ Run `working-record.mjs <group> <operation> --help` for each command's options and input fields. `--input -` reads the input fragment from stdin. An input fragment holds only the fields its help lists; commands set `State` and IDs themselves. Commands that change the Current Slice or task state require `--next-action`. `--record` resolves against `--root`, which defaults to the current directory; an absolute `--record` path finds its own root.
465
309
 
466
- - bullets in Current Context;
467
- - allowed prose and optional fields in Future Work, Current Work, and active History blocks;
468
- - proposed-item ordering or removal;
469
- - Next useful action;
470
- - appending Material updates;
471
- - Notes;
472
- - the defined correction block.
473
-
474
- Use lifecycle commands for:
475
-
476
- - initialization;
477
- - creating proposed Slices or Checkpoints;
478
- - assigning `S-NNN`, `C-NNN`, or `D-NNN`;
479
- - moving a Slice between Future Work, Current Work, and History;
480
- - changing Slice, Checkpoint, Decision, or task state;
481
- - converting a proposed-title reference to `S-NNN`;
482
- - creating a linked continuation Slice;
483
- - atomically superseding a Decision.
484
-
485
- A direct edit must not change a durable ID, lifecycle state, entity kind, or owning top-level section. It must not reactivate, silently delete, or replace terminal History. Unknown fields and invented headings are invalid inside structured blocks.
310
+ | Transition | Command |
311
+ | --- | --- |
312
+ | Create the record | `init --name <task name> --input <fragment>` (Goal and Next useful action required) |
313
+ | Propose a Slice | `slice propose` |
314
+ | Start a proposed Slice → `in_progress`, assigns `S-NNN` | `slice start --title <proposal title>` |
315
+ | Start a Slice that was never proposed | `slice start-direct` |
316
+ | `in_progress` → `paused` | `slice pause` |
317
+ | `paused` → `in_progress` | `slice resume` |
318
+ | Current → History `completed` / `blocked` (from paused) / `abandoned` | `slice close --state <state>` |
319
+ | Continue a completed or blocked historical Slice as a new Slice | `slice reopen --id <S-NNN>` |
320
+ | Record a Slice that already finished directly into History | `slice record --state <completed|blocked|abandoned>` |
321
+ | Propose a Checkpoint | `checkpoint propose` |
322
+ | `proposed` → `pending`, assigns `C-NNN` | `checkpoint activate` |
323
+ | `pending` ↔ `deferred` | `checkpoint defer`, `checkpoint resume` |
324
+ | `pending` / `deferred` → History | `checkpoint close --state <completed|cancelled|replaced>` |
325
+ | Add, supersede, or retire a Decision | `decision add`, `decision supersede`, `decision retire` |
326
+ | Change task state | `task set-state --state <state>` |
486
327
 
487
- Prose-only bullet edits need no extra validation. After changing headings, fields, references, or other structured blocks, run `validate` before consequential work. Every lifecycle command validates both its source and candidate.
328
+ Use `slice start` for a proposed Slice and `slice start-direct` only for work that was never proposed. Starting any Slice records it before its first effect; it does not authorize the work. `slice record` is only for work whose effects already happened; it leaves the Current Slice, Future Work, and Next useful action unchanged, so it can run while a Slice is live.
488
329
 
489
- The lifecycle executable is [working-record.mjs](../scripts/working-record.mjs). Read the format reference before preparing structured content, then run the complete operation help as `working-record.mjs <group> <operation> --help`; group help lists operations and operation help lists options and fragment fields. Use `--input -` for stdin when convenient. Command help is the transport contract for the operations described here and does not replace this format reference. It is not normally necessary to inspect the implementation source.
330
+ Every command validates the record before and after the change and publishes one complete valid result or nothing.
490
331
 
491
- ## View Contract
332
+ | Exit code | Meaning |
333
+ | --- | --- |
334
+ | 0 | The change was published, or there was nothing to change. |
335
+ | 1 | Nothing was written. The error says why. |
336
+ | 2 | The outcome is uncertain: the write may have happened. Read `view full` before retrying or editing. |
492
337
 
493
- The canonical file is Markdown. Both public views render its content as human-readable text rather than JSON. `full` preserves the complete Markdown content and order; a host may render it visually. Neither view follows external pointers or mutates the record.
338
+ ## Direct Edits
494
339
 
495
- ### `resume`
340
+ Edit directly:
496
341
 
497
- `resume` contains:
498
-
499
- 1. record name, Schema, and task State;
500
- 2. all seven Current Context headings and their bullets;
501
- 3. active Decisions derived from History/Decisions, without duplicating them in Current Context;
502
- 4. complete Current Work;
503
- 5. all Future Work in stored order, including proposed, pending, and deferred items;
504
- 6. all Notes.
342
+ - Current Context bullets;
343
+ - optional fields and wording in active entities;
344
+ - Material updates, Recovery sources, and the Next useful action;
345
+ - the order, wording, or removal of proposed items;
346
+ - Notes;
347
+ - Corrections blocks in History.
505
348
 
506
- It omits terminal History entries. Use it for active-state readback during intact-session continuation. A new conversational turn or ordinary pause does not require a reread by itself. Use a bounded entity or section read when that is sufficient. Do not substitute `resume` for the complete record after context loss.
349
+ Never edit directly: IDs, `State` fields, which section an entity is in, or any terminal History entry apart from Corrections. `validate` checks structure only; it cannot detect a hand-made state change or a deleted entry, so those edits are forbidden rather than checked.
507
350
 
508
- ### `full`
351
+ After editing headings, fields, or entity structure, run `validate --record <record.md>`. Prose-only edits need no validation.
509
352
 
510
- `full` contains the entire canonical record in order:
353
+ ## Views
511
354
 
512
- 1. header;
513
- 2. Current Context;
514
- 3. Current Work;
515
- 4. Future Work;
516
- 5. History with Decisions, Checkpoints, and Slices in that order;
517
- 6. Notes.
355
+ Both views are plain Markdown and change nothing.
518
356
 
519
- Read it completely after context loss, including compaction, context-replacing summarization, clear, session resume or navigation, transfer into another context, or uncertain continuity. It is also the view for audit, dispute, migration, malformed-record inspection, and uncertain mutation results.
357
+ - `view full` returns the file exactly as stored. It does not require the record to be valid, so use it to inspect malformed or unsupported records.
358
+ - `view resume` returns the header, Current Context, active Decisions, Current Work, Future Work, and Notes. It omits terminal History and is not sufficient after context loss.
520
359
 
521
- If output is truncated, continue bounded reads of the same canonical source until the whole record has been read. If full recovery cannot be completed within available context or access, report the limitation and stop affected work; do not silently replace it with `resume` or claim unseen History was recovered.
360
+ ## Notes
522
361
 
523
- A full read does not follow defining-source pointers or establish live correctness. Reconcile current direction, source evidence, task state, and authorization before acting. Once recovery is complete, use bounded in-session reads rather than repeatedly loading all History.
362
+ Everything under `## Notes` is ordinary Markdown with no structure. Notes do not authorize, prioritize, block, or prove anything. Anything that affects scope, evidence, or the next action belongs in its structured section instead. Remove a user-written Note only when the user asks.
524
363
 
525
364
  ## Legacy Records
526
365
 
527
- A record with another schema version is not a Schema 4 record. Do not reinterpret or directly mutate it as Schema 4. Inspect it read-only, preserve its original source, and use a separately authorized migration operation that can report any unmapped or ambiguous content.
366
+ A record with another `Schema` value is not a Schema 4 record. Read it through `view full` only; do not edit or transition it. Migration is a separate, authorized operation.