@hassangameryt/freeflow 0.6.0 → 0.7.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 (122) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/.codex-plugin/plugin.json +4 -5
  4. package/README.md +39 -55
  5. package/capabilities/cognitive-routing/SKILL.md +288 -130
  6. package/command-surface.json +0 -24
  7. package/hooks/freeflow-runtime-context.mjs +42 -477
  8. package/hooks/hooks.json +1 -26
  9. package/hooks/tests/check-runtime-context-hook.sh +108 -319
  10. package/package.json +4 -2
  11. package/pi-extension/dist/cognitive-routing/commands.js +3 -3
  12. package/pi-extension/dist/cognitive-routing/config.js +16 -20
  13. package/pi-extension/dist/cognitive-routing/controller.js +478 -48
  14. package/pi-extension/dist/cognitive-routing/history.js +12 -0
  15. package/pi-extension/dist/cognitive-routing/host.js +74 -12
  16. package/pi-extension/dist/cognitive-routing/pi-routing-session.js +414 -0
  17. package/pi-extension/dist/cognitive-routing/pi-session-control.js +320 -0
  18. package/pi-extension/dist/cognitive-routing/tool.js +1 -0
  19. package/pi-extension/dist/cognitive-routing/types.js +1 -1
  20. package/pi-extension/dist/index.js +236 -219
  21. package/pi-extension/dist/runtime/runtime-context.js +126 -286
  22. package/pi-extension/dist/settings/settings-ui.js +52 -336
  23. package/pi-extension/src/cognitive-routing/commands.ts +15 -5
  24. package/pi-extension/src/cognitive-routing/config.ts +16 -20
  25. package/pi-extension/src/cognitive-routing/controller.ts +561 -51
  26. package/pi-extension/src/cognitive-routing/history.ts +12 -0
  27. package/pi-extension/src/cognitive-routing/host.ts +110 -16
  28. package/pi-extension/src/cognitive-routing/pi-routing-session.ts +538 -0
  29. package/pi-extension/src/cognitive-routing/pi-session-control.ts +444 -0
  30. package/pi-extension/src/cognitive-routing/tool.ts +1 -0
  31. package/pi-extension/src/cognitive-routing/types.ts +1 -1
  32. package/pi-extension/src/index.ts +249 -239
  33. package/pi-extension/src/runtime/runtime-context.ts +129 -305
  34. package/pi-extension/src/settings/settings-ui.ts +53 -371
  35. package/pi-extension/tests/cognitive-routing/commands.test.js +1 -1
  36. package/pi-extension/tests/cognitive-routing/controller.test.js +69 -40
  37. package/pi-extension/tests/cognitive-routing/extension-lifecycle.test.js +128 -57
  38. package/pi-extension/tests/cognitive-routing/pi-normal-lifecycle.test.js +434 -0
  39. package/pi-extension/tests/cognitive-routing/pi-session-control.test.js +174 -0
  40. package/pi-extension/tests/cognitive-routing/pi-session-history.test.js +91 -0
  41. package/pi-extension/tests/cognitive-routing/profile-resolution.test.js +47 -4
  42. package/pi-extension/tests/integration/mode-free-core.test.js +218 -0
  43. package/pi-extension/tests/integration/pi-extension.test.js +430 -2478
  44. package/pi-extension/tests/integration/prompt-architecture.test.js +124 -79
  45. package/pi-extension/tests/integration/unaffected-regressions.test.js +411 -0
  46. package/runtime/prompts/cognitive-routing.md +5 -4
  47. package/runtime/prompts/conversation-history.md +1 -1
  48. package/runtime/prompts/core.md +77 -6
  49. package/runtime/prompts/interaction-contract.md +6 -2
  50. package/skills/action-selection/SKILL.md +93 -44
  51. package/skills/action-selection/references/trajectory-stalls.md +71 -0
  52. package/skills/bypass/SKILL.md +109 -39
  53. package/skills/commit-work/SKILL.md +94 -55
  54. package/skills/commit-work/references/git-state-edges.md +94 -0
  55. package/skills/commit-work/references/simple-push.md +92 -0
  56. package/skills/commit-work/references/staging-decisions.md +79 -46
  57. package/skills/decision-gate/SKILL.md +80 -22
  58. package/skills/design-for-depth/SKILL.md +208 -43
  59. package/skills/design-for-depth/references/design-pressure-signals.md +108 -240
  60. package/skills/design-for-depth/references/interface-design-loop.md +77 -97
  61. package/skills/design-for-depth/references/module-and-dependency-design.md +147 -0
  62. package/skills/design-for-depth/references/software-design-philosophy.md +127 -173
  63. package/skills/design-for-depth/references/state-and-failure-boundaries.md +136 -0
  64. package/skills/diagnose-failure/SKILL.md +198 -52
  65. package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +19 -5
  66. package/skills/diagnose-failure/references/flaky-and-performance-diagnosis.md +13 -5
  67. package/skills/discuss/SKILL.md +118 -76
  68. package/skills/discuss/references/discussion-continuity.md +84 -32
  69. package/skills/evaluate-skill/SKILL.md +166 -52
  70. package/skills/evaluate-skill/references/evaluation-definition-schema.md +2 -2
  71. package/skills/evaluate-skill/references/evaluation-design.md +56 -30
  72. package/skills/evaluate-skill/references/execution-and-evidence.md +1 -1
  73. package/skills/evaluate-skill/references/review-and-revision.md +62 -21
  74. package/skills/execute-work/SKILL.md +98 -59
  75. package/skills/execute-work/references/code-practices.md +4 -4
  76. package/skills/execute-work/references/execute-work-edges.md +42 -22
  77. package/skills/review-artifact/SKILL.md +132 -71
  78. package/skills/review-artifact/references/adjudicate-artifact-review.md +101 -0
  79. package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +52 -41
  80. package/skills/review-work/SKILL.md +115 -72
  81. package/skills/review-work/references/adjudicate-work-review.md +97 -0
  82. package/skills/review-work/references/independent-work-reviewer-contract.md +40 -35
  83. package/skills/review-work/references/security-risk-lens.md +17 -15
  84. package/skills/setup-freeflow/SKILL.md +14 -17
  85. package/skills/setup-freeflow/references/activation-contract.md +24 -30
  86. package/skills/setup-freeflow/references/host-setup.md +6 -7
  87. package/skills/simplify-code/SKILL.md +97 -39
  88. package/skills/simplify-code/references/simplification-patterns.md +1 -1
  89. package/skills/tdd/SKILL.md +108 -41
  90. package/skills/tdd/references/test-design.md +1 -1
  91. package/skills/track-work/SKILL.md +133 -300
  92. package/skills/track-work/references/working-record-format.md +515 -0
  93. package/skills/track-work/scripts/lib/document.mjs +713 -0
  94. package/skills/track-work/scripts/lib/format.mjs +166 -0
  95. package/skills/track-work/scripts/lib/store.mjs +233 -0
  96. package/skills/track-work/scripts/lib/transitions.mjs +790 -0
  97. package/skills/track-work/scripts/lib/views.mjs +27 -430
  98. package/skills/track-work/scripts/working-record.mjs +292 -98
  99. package/skills/verify-work/SKILL.md +46 -20
  100. package/skills/verify-work/references/browser-runtime-evidence.md +1 -1
  101. package/skills/verify-work/references/integration-evidence.md +1 -7
  102. package/skills/verify-work/references/performance-evidence.md +1 -1
  103. package/skills/workflow/SKILL.md +110 -80
  104. package/skills/workflow/references/domain-skill-composition.md +24 -18
  105. package/skills/write-skill/SKILL.md +218 -62
  106. package/skills/write-skill/references/activation-boundaries.md +63 -21
  107. package/skills/write-skill/references/agent-first-instructions.md +61 -27
  108. package/skills/write-skill/references/progressive-disclosure.md +91 -41
  109. package/skills/write-skill/references/skill-dependency-graphs.md +190 -0
  110. package/runtime/prompts/skills.md +0 -65
  111. package/skills/mode-contract/SKILL.md +0 -104
  112. package/skills/track-work/scripts/lib/codec.mjs +0 -570
  113. package/skills/track-work/scripts/lib/commands.mjs +0 -568
  114. package/skills/track-work/scripts/lib/contract.mjs +0 -303
  115. package/skills/track-work/scripts/lib/model.mjs +0 -506
  116. package/skills/track-work/scripts/lib/operations.mjs +0 -965
  117. package/skills/track-work/scripts/lib/record-store.mjs +0 -264
  118. package/skills/track-work/scripts/lib/result.mjs +0 -37
  119. package/skills/track-work/scripts/lib/rewrites.mjs +0 -740
  120. package/skills/track-work/scripts/lib/schema.mjs +0 -277
  121. package/skills/track-work/scripts/lib/source-inventory.mjs +0 -162
  122. package/skills/track-work/scripts/lib/workspace.mjs +0 -134
@@ -13,7 +13,7 @@ Start from the highest stable interface used by callers, then choose the smalles
13
13
  - **End-to-end or user-path check:** the requirement is a critical flow whose value depends on the assembled system.
14
14
  - **Characterization test:** existing behavior must be observed and protected before a behavior-preserving refactor.
15
15
 
16
- A characterization test records current behavior; it does not make that behavior desired or authoritative. Stop when intended behavior conflicts with source truth or remains user-owned.
16
+ A characterization test records current behavior; it does not make that behavior desired or authoritative. When characterization supports Simplify Code, protect only behavior that accepted source truth requires or that must remain unchanged for the selected simplification. Stop when intended behavior conflicts with source truth or remains user-owned.
17
17
 
18
18
  A smaller environment is not better when it mocks away the behavior being claimed. A larger environment is not better when its extra machinery adds noise without proving more.
19
19
 
@@ -1,388 +1,221 @@
1
1
  ---
2
2
  name: track-work
3
- description: Use when ongoing work needs durable task memory, or existing task memory must be created, recovered, reconciled, updated, or closed, so current understanding, active work, future outcomes, decisions, evidence, and the next action survive execution, feedback, pauses, or context loss.
3
+ description: Use when ongoing work needs durable task memory, or when creating, recovering, maintaining, transitioning, or closing a Working Record.
4
4
  ---
5
5
 
6
6
  # Track Work
7
7
 
8
- Maintain living task memory without turning it into a transcript, fixed Plan, or authority over live evidence and user decisions.
8
+ Maintain one compact Working Record as the current projection of a task. It is memory, not authority, source truth, a Spec, a Plan, or a transcript. Current user direction, accepted artifacts, live evidence, and repository instructions override stale record content.
9
9
 
10
- A **Working Record** is ignored local Markdown that preserves current task state across execution, feedback, pauses, and context loss. A **Current Slice** is the durable representation of the active Slice when task memory is needed. A **Proposed Slice** is an unselected future Slice with no ID, execution state, or authority. `block`, `resume`, and `reopen` preserve one Slice's identity across different continuation conditions.
10
+ ## Track Only When Continuity Matters
11
11
 
12
- Track Work owns the Working Record and its lifecycle. It does not decide whether durable memory is needed, authorize implementation, settle product intent, judge review findings, complete the task, commit, publish, or promote local artifacts.
12
+ Use a record when losing current understanding, accepted decisions, future obligations, one active outcome, evidence, or the next useful action could misalign later work. Do not create one for a short disposable result merely because work occurred.
13
13
 
14
- A Working Record is memory, not authority. Current user direction, live evidence, repository instructions, and accepted source truth override stale record content.
15
-
16
- ## Enter With A Record Need
17
-
18
- Enter when [Workflow](../workflow/SKILL.md) routes a durable-memory need established by current context or [Discuss](../discuss/SKILL.md), the user explicitly requests a record operation, or an existing record needs recovery, reconciliation, or a lifecycle transition.
19
-
20
- If record need, task ownership, or mutation authority is unresolved, return to Workflow or Discuss. Reading this skill never authorizes record creation or mutation.
21
-
22
- Use one ignored local directory per task:
14
+ Use one ignored record per task:
23
15
 
24
16
  ```text
25
17
  .freeflow/tasks/task-NNN-<short-name>/record.md
26
18
  ```
27
19
 
28
- Everything under `.freeflow/tasks/**` is local task memory. Track Work never stages, commits, publishes, promotes, or synchronizes it. [Write Spec](../write-spec/SKILL.md) and [Write Plan](../write-plan/SKILL.md) separately own tracked artifacts.
29
-
30
- ## Follow The Lifecycle
31
-
32
- ```text
33
- Record need established
34
- -> create or recover the record
35
- -> reconcile memory with conversation and live evidence
36
- -> preserve material state changes in their canonical owners
37
- -> select one authorized outcome or wait
38
- -> maintain one coherent Current Slice through feedback and checkpoints
39
- -> settle the outcome and reconcile affected current state
40
- -> return to Workflow or the owning route
41
- ```
42
-
43
- Do not reduce this lifecycle to `start -> close`. Decisions, proposals, checkpoints, evidence, blockers, Notes, Current Context, and the next action remain part of record maintenance whenever their underlying state materially changes.
44
-
45
- ## Preserve One Living Record
46
-
47
- Schema-v2 `record.md` is readable Markdown and the only canonical task state. Its semantic owners are:
48
-
49
- 1. **Current Context:** what remains necessary to understand the task now.
50
- 2. **Current Work:** route, one Current Slice or `None`, blockers, selected upcoming boundaries, and one next useful action.
51
- 3. **Proposed Slices:** ordered, revisable outcomes that have not started.
52
- 4. **History:** decision records, resolved checkpoint outcomes, and completed, parked, or abandoned Slices.
53
- 5. **Notes:** inert retained context with no active task effect.
54
-
55
- Omit optional content when it carries no useful state. Preserve detail when forgetting it could cause a later reader to choose the wrong route. Compactness removes repetition, transcripts, and raw output—not continuity.
56
-
57
- Give each detailed fact one owner. Other sections use a compact pointer or derived view rather than copying it.
58
-
59
- Only the user changes task state: `Active`, `Paused`, `Completed`, or `Abandoned`. Paused tasks reject `start` and `resume`. Completed and Abandoned tasks require `Current Slice: None`.
60
-
61
- ## Create Or Recover
62
-
63
- ### Start Honestly
64
-
65
- A minimal record contains:
66
-
67
- - user-owned task state;
68
- - goal or central question;
69
- - supported current understanding;
70
- - important route-changing open questions;
71
- - `Current Slice: None` when no work is selected;
72
- - one next useful action.
73
-
74
- A record may begin without decisions, proposals, checkpoints, Notes, or a Current Slice. Do not invent content to fill sections.
75
-
76
- If discussion already produced decisions, proposals, checkpoint selections, or explicitly retained Notes, create the minimal record and preserve those related facts in the first authorized atomic update before returning to Discuss or execution. Do not let `init` erase state that justified creating the record.
77
-
78
- If context is too thin, return to Discuss. If the user still requests a record, create an honest minimal one and wait.
79
-
80
- ### Recover From Current Evidence
81
-
82
- After compaction, summarization, clear, resume, session navigation, or ownership transfer:
83
-
84
- 1. run `view --view resume`;
85
- 2. confirm task identity, task state, Current Slice, route, next action, and record SHA;
86
- 3. compare memory with the current conversation and live repository or environment;
87
- 4. retrieve an exact entity only when its rationale, lineage, authority, chronology, or evidence affects the next decision;
88
- 5. reconcile only state contradicted or changed by supported current evidence;
89
- 6. return to the route that owns the next activity.
90
-
91
- A record from another conversation branch is memory, not authority. Do not import branch-local approval merely because it is recorded.
92
-
93
- Before an expected compaction, pause, clear, or transfer, reconcile the record only when material task state changed. The boundary itself is not an event, checkpoint result, or reason to append a status update.
94
-
95
- ## Maintain Current Context
96
-
97
- Current Context is present state, not chronology:
98
-
99
- - **Goal:** the durable outcome or central question.
100
- - **What defines this task:** accepted source pointers or governing artifacts.
101
- - **Settled:** supported understanding that still affects interpretation or action.
102
- - **Tentative:** live hypotheses that remain provisional.
103
- - **Open:** unresolved questions capable of changing the route.
104
- - **Current direction:** remaining strategy, not completed phases.
105
- - **Boundaries:** accepted scope, exclusions, evidence limits, and stop conditions that remain relevant.
106
-
107
- Replace a summary when its meaning changes. Do not append update paragraphs, discussion turns, completed-Slice narration, test inventories, hashes, review findings, or live-run detail.
108
-
109
- Decision rationale and lineage belong in History. Active decision summaries in views are derived from History; do not store a second decision summary in Current Context.
110
-
111
- When a Slice settles, rewrite Current Context from what remains true. Remove event detail now owned by History while preserving consequences that still affect later work.
112
-
113
- ## Preserve Discussion Without Taking It Over
114
-
115
- Discuss owns exploration, alternatives, assumptions, and direction:
116
-
117
- ```text
118
- Discuss -> material accepted state -> Track Work update -> Discuss
119
- ```
20
+ [Workflow](../workflow/SKILL.md) establishes record need, authority, ownership, and the route that receives the result. Use [Discuss](../discuss/SKILL.md) when intent, assumptions, alternatives, or task ownership are materially open. Track Work preserves accepted state and returns to that owning activity; it does not take over discussion.
120
21
 
121
- Persist only supported changes that could affect later interpretation or action. One atomic update may reconcile related context, decisions, proposals, checkpoint selections, Notes, blockers, or next action.
22
+ Only the user changes task state. Creating or updating a record never authorizes implementation, evidence generation, commit, publication, deployment, or another controlled action.
122
23
 
123
- A record update does not end discussion, authorize implementation, select a proposal, choose a checkpoint, settle a user-owned decision, or claim evidence or readiness. Return to Discuss after preservation unless Workflow established another route.
24
+ ## Keep Five Canonical Sections
124
25
 
125
- ## Propose, Select, Or Wait
26
+ Keep the record in this order:
126
27
 
127
- ### Preserve Future Outcomes
28
+ 1. **Current Context** — concise present understanding.
29
+ 2. **Current Work** — one Current Slice or none, plus one next useful action.
30
+ 3. **Future Work** — one ordered sequence of Slices and Checkpoints not yet in History.
31
+ 4. **History** — Decisions, Checkpoints, and settled Slices, in that order.
32
+ 5. **Notes** — inert retained context.
128
33
 
129
- Create a Proposed Slice when an unselected future outcome, evidence boundary, dependency, or ordering must survive context loss.
34
+ Current Context and Notes remain ordinary Markdown prose and bullets. Structured entities in Current Work, Future Work, and History use compact field-list rows: one value stays inline as `- Field: value`, while multiple values use nested two-space-indented bullets. This changes presentation only; the Schema 4 sections, fields, IDs, states, and lifecycle semantics remain unchanged.
130
35
 
131
- A proposal:
36
+ Read [Working Record Format](references/working-record-format.md) before directly editing structured record content or preparing Markdown for a lifecycle command. It owns the exact headings, fields, state tables, omission rules, and compact entity layout. Do not invent fields, headings, IDs, or lifecycle states.
132
37
 
133
- - remains unnumbered and has no execution state;
134
- - carries no authority;
135
- - names one Learning, Delivery, or Deepening result;
136
- - states intended result and expected evidence;
137
- - records real dependencies and selected checkpoints when they exist;
138
- - remains revisable until selected.
38
+ ## Create Or Recover Honestly
139
39
 
140
- Use exact proposal titles rather than ordinal references such as “proposal 2.” Preserve an external Plan phase or identifier only when one exists.
40
+ Initialization creates every canonical heading. Start with at least:
141
41
 
142
- Do not create a proposal merely to start it immediately when one already-authorized direct result is clear and no future queue needs preservation. When several outcomes, dependencies, or ordering constraints matter, preserve them first and select one by exact title.
42
+ - the task state;
43
+ - a supported Goal;
44
+ - any defining source or material Open question already known;
45
+ - `Current Slice: None`;
46
+ - one next useful action or an honest wait condition.
143
47
 
144
- ### Select With Write-Ahead Authority
48
+ If the task is too unclear to state a Goal and next action without invention, discuss it before initialization.
145
49
 
146
- Select a Slice only when its concrete work is requested or approved. If only record creation is approved, keep `Current Slice: None`, preserve proposals when needed, set the next useful action, and wait.
50
+ The header’s `Last updated` is created by `init` and refreshed by successful lifecycle commands. Direct Markdown edits may leave it stale; it is advisory recency metadata, not proof of validity, freshness, authority, or semantic truth.
147
51
 
148
- Before [Execute Work](../execute-work/SKILL.md) begins, record:
52
+ Use `resume` after context loss, compaction, session navigation, handoff, an intentional pause, or uncertain continuity. Do not reload it merely because another conversational turn began. Compare the recovered projection with current user direction and the live environment, then reconcile only affected state.
149
53
 
150
- - assigned Slice ID and type;
151
- - intended result;
152
- - authority source;
153
- - reason and scope;
154
- - expected evidence;
155
- - stop condition;
156
- - relevant starting state;
157
- - dependencies;
158
- - selected checkpoints and pending boundaries.
54
+ ## Reconstruct State Before Action
159
55
 
160
- Save this write-ahead state before execution. It preserves intent; it does not claim execution occurred.
56
+ Before any consequential action, especially after recovery, confirm:
161
57
 
162
- Approval cadence and reporting cadence are separate. A decision approval, tentative proposal, nearby instruction, or permission to discuss does not authorize implementation.
58
+ - task State;
59
+ - Current Slice and its state;
60
+ - active Decisions;
61
+ - pending or deferred Checkpoints;
62
+ - the Next useful action;
63
+ - applicable authority, scope, and stop condition;
64
+ - unresolved Evidence or contradictions.
163
65
 
164
- ## Maintain One Current Slice
66
+ 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. Retrieve only the exact historical block needed for rationale, chronology, supersession, lineage, or Evidence. Do not act from the Working Record alone.
165
67
 
166
- ### Keep The Outcome Coherent
68
+ A record from another conversation branch remains memory. It does not transfer branch-local authority. If the record does not use the supported schema, inspect it through `full` and stop before direct edits or lifecycle transitions; migration is a separate explicit operation.
167
69
 
168
- Current Slice states are:
70
+ Before an expected compaction, clear, session pause, or handoff, reconcile the record only when material task state changed. The context boundary itself is not a History event, Evidence item, or Checkpoint.
169
71
 
170
- - `In progress`: active work, including in-scope discussion, implementation, feedback, verification, self-review, selected review, correction, and checkpoints.
171
- - `Blocked`: safe continuation is unavailable because a required decision, dependency, capability, evidence source, stop condition, or other condition is missing.
72
+ ## Keep Current Context Small And Current
172
73
 
173
- Waiting for ordinary feedback, discussing, reviewing, correcting, or gathering in-scope evidence does not make a Slice Blocked.
74
+ Use concise bullets under exactly seven headings:
174
75
 
175
- Keep the same Slice while intended result, authority boundary, evidence boundary, and useful outcome remain coherent. Do not create activity-shaped Slices for implementation, tests, review, corrections, documentation, or commits that belong to the same result.
76
+ - Goal
77
+ - What defines this task
78
+ - Settled
79
+ - Tentative
80
+ - Open
81
+ - Current direction
82
+ - Boundaries
176
83
 
177
- ### Reconcile Steering And Extensions
84
+ `Settled` contains supported present understanding, not duplicate Decision history. `What defines this task` points to accepted artifacts, user decisions, constraints, and source truth that determine interpretation.
178
85
 
179
- Do not log every edit, command, implementation choice, correction, or conversation.
86
+ Change Context only when its present meaning changes. Do not rewrite it after every Slice, Checkpoint, test, review, or ordinary transition. Add, edit, move, or remove only the affected bullet. Completed-event detail belongs with its Slice; accepted choice and rationale belong to a Decision.
180
87
 
181
- When feedback remains inside the accepted result and authority, apply it and preserve its meaningful final effect. When feedback changes intended result, scope, authority, evidence boundary, or stop condition, classify and record the change before acting.
88
+ ## Edit Content Directly; Script Lifecycles
182
89
 
183
- Keep an extension in the Current Slice when the intended result remains coherent, current or new explicit authority covers it, the combined result can still be verified as one unit, and no stop condition or owner decision requires another route.
90
+ Use ordinary Markdown reads and edits for content that requires judgment:
184
91
 
185
- Record an accepted extension before execution with its authority source, reason and added scope, added evidence boundary, changed stop condition when applicable, and extension starting state. Preserve the original boundary; do not rewrite it to imply the extension was always planned.
92
+ - Current Context bullets;
93
+ - allowed wording and optional fields inside Future Work or the Current Slice;
94
+ - proposed-item order or removal;
95
+ - the next useful action;
96
+ - Material updates;
97
+ - Notes;
98
+ - clerical correction of active prose;
99
+ - the defined clerical correction block in terminal History.
186
100
 
187
- Use a new Slice when work needs a distinct result, authority source, evidence boundary, independently useful outcome, or explicit abandonment of the original result. First settle or park the Current Slice; do not silently replace it.
101
+ A direct edit may change allowed content inside a block. It must not change the block’s durable ID, lifecycle state, entity kind, or owning top-level section. Do not delete or reactivate terminal History or erase its prior value; append a defined correction instead.
188
102
 
189
- Questions, criticism, review findings, and useful suggestions do not authorize changes.
103
+ Prose-only bullet edits need no extra validation. After editing headings, fields, references, or other structured blocks, run `validate` before consequential work; every lifecycle command validates its source and candidate.
190
104
 
191
- ### Block, Resume, Or Reopen
105
+ Use a deterministic lifecycle command when an operation creates structured identity or changes lifecycle state:
192
106
 
193
- When safe continuation becomes unavailable:
107
+ - initialize the record;
108
+ - propose a Slice or Checkpoint;
109
+ - start, pause, resume, close, or reopen a Slice;
110
+ - activate, defer, resume, or close a Checkpoint;
111
+ - add, supersede, or retire a Decision;
112
+ - change task state.
194
113
 
195
- 1. keep the Current Slice current;
196
- 2. record what blocks continuation, why it is unsafe, and what resolution is required;
197
- 3. set the resume condition;
198
- 4. stop.
114
+ Commands own placement, ID allocation, legal state transitions, complete multi-block movement, and the script-maintained `Last updated` field. The agent owns meaning and supplies the content. Slice and task-state transitions also require agent-supplied Next useful action text; Checkpoint transitions may update it when supplied. Use [working-record.mjs](scripts/working-record.mjs) directly for the lifecycle boundary. Read the format reference first, then run the complete operation help—`working-record.mjs <group> <operation> --help`—before preparing a fragment; use `--input -` when supplying agent-authored Markdown through stdin. `validate --record` checks the stored Schema 4 record after structured direct edits. Do not inspect the implementation source under `scripts/lib/` unless diagnosing a concrete defect.
199
115
 
200
- Use `resume` when that current blocker resolves and the same outcome remains coherent. Preserve the blocker incident and resolution source. A resolution that expands scope follows the extension rule before execution.
116
+ A lifecycle command must validate the source and candidate before publication and apply one complete transition or none. If its result is uncertain, stop and re-read `full` before retrying or editing related state.
201
117
 
202
- Park the Slice as historical `Blocked` only when the attempt is deliberately removed from Current Work while its blocker remains unresolved.
118
+ ## Keep One Coherent Slice
203
119
 
204
- Use `reopen` when later authorized work still belongs to a historical Slice's original outcome. Reopening keeps the same ID, preserves prior outcomes through compact reopen history, and requires fresh authority, reason and scope, expected evidence, and stop condition.
120
+ A Slice is one coherent learning, delivery, or deepening outcome. Keep implementation, verification, review, accepted correction, and associated Checkpoints inside the same Slice while its intended result, authority boundary, evidence boundary, and independently useful outcome remain coherent.
205
121
 
206
- Failure belongs in evidence or outcome; it is not itself a Slice state.
122
+ Use a new Slice when any of those boundaries materially changes. Do not split ordinary implementation stages, tests, reviews, or corrections into separate Slices.
207
123
 
208
- ### Keep Review And Correction Inside The Result
124
+ A proposed Slice has no durable ID or authority. Its title must be unique across Future Work. It may be edited, reordered, or removed until selected.
209
125
 
210
- Implementation, verification, self-review, or an independent review report does not settle the Slice by itself. Review may support continuation, correction, more evidence, deferment, a route change, or stopping; it need not Pass.
126
+ When an immediately authorized outcome does not need Future Work ordering or recovery, use `slice start-direct`. It creates a new Current Slice without consuming or changing any Future Work item. Never silently treat a direct start as proposal selection.
211
127
 
212
- Keep accepted in-scope correction and its verification inside the Current Slice. Do not invent review or correction Slices.
128
+ Starting requires current authority and creates one detailed Current Slice with a new `S-NNN` ID before execution. Do not begin Slice work until that start transition has successfully persisted and validated the Current Slice and Next useful action. After a successful start or reopen, return the bounded result to [Execute Work](../execute-work/SKILL.md); the transition itself is not implementation authority.
213
129
 
214
- ## Preserve Record-Worthy Entities
215
-
216
- ### Decisions
217
-
218
- Record a task-local Decision when an accepted choice affects later interpretation, implementation, acceptance, or recovery and losing its rationale could cause misalignment.
219
-
220
- Preserve what was decided, who decided or what established it, rationale and sources, consequences, and a revisit condition when useful.
221
-
222
- Decision states are:
223
-
224
- - `Active`: currently affects later work;
225
- - `Superseded`: replaced or narrowed by another decision, with reciprocal links;
226
- - `Retired`: historically valid but no longer active.
227
-
228
- Retire or supersede decisions through their lifecycle. Do not delete durable decision history. A changed understanding is not automatically a decision; a tentative direction remains Tentative until accepted.
229
-
230
- ### Checkpoints
231
-
232
- A checkpoint is an additional boundary selected by Workflow from an approved Plan or explicit discussion before dependent work. Types are Independent review, Local commit, User decision, and Continuity.
233
-
234
- Ordinary feedback, self-review, a nearby question, a status pause, or temporal proximity is not a checkpoint.
235
-
236
- When a checkpoint is selected before or during a Slice:
237
-
238
- 1. use one stable single-line title;
239
- 2. add that exact title to the affected proposal or Current Slice's selected checkpoints;
240
- 3. add a compact upcoming entry under Current Work that preserves the title, selection source, and condition;
241
- 4. keep the Current Slice `In progress` while the checkpoint belongs to its result.
242
-
243
- When the checkpoint reaches `Completed`, `Deferred`, `Cancelled`, or `Replaced`:
244
-
245
- 1. add one History checkpoint with the exact selected title;
246
- 2. preserve type, selected-by source, condition, terminal result, judgment or decision, evidence pointer, and task effect when applicable;
247
- 3. remove its upcoming Current Work entry in the same atomic update;
248
- 4. return its outcome to Workflow.
249
-
250
- A Completed Slice cannot close until each selected checkpoint title has a terminal History checkpoint with the exact same title and all other pending boundaries are reconciled.
251
-
252
- When a task-, phase-, or continuity-level checkpoint follows a settled Slice, leave `Current Slice: None`, keep the checkpoint as upcoming, and make it the next useful action. A Local commit checkpoint never authorizes push or integration.
253
-
254
- ### Evidence And History
255
-
256
- Keep detailed evidence with the Slice or checkpoint that produced or used it. When two History entities refer to the same event, one owns the detailed findings and the other stores a concise result and pointer.
257
-
258
- Preserve what was checked, what the result supports and does not support, which state or artifact was observed, selected independent-review judgment and adjudication, completed checkpoint results, and where exact evidence can be found.
259
-
260
- Use only real pointers such as `file:<path>#<section>`, `commit:<sha>`, `output:<id>`, `review:<reference>`, or `session:<id>/turn:<id>`. Do not copy large raw output or create History for routine self-review.
261
-
262
- ### Notes
263
-
264
- A Note preserves task-adjacent context with no active task effect. Add one when the user explicitly asks to note, remember, retain, or defer something that has no structured owner.
265
-
266
- During authorized maintenance, add an agent-originated Note only when the information is concrete, worth preserving across context loss, not already represented, and has no effect on current scope, priority, completion, blockers, or next action. Ask when authorship or retention intent matters.
267
-
268
- Notes do not authorize, prioritize, schedule, block, unblock, prove, or require follow-up. Do not periodically triage them or create decisions, Slices, Specs, Plans, issues, or artifacts from them by default.
269
-
270
- If later user direction independently makes Note content active, create the appropriate structured state from that new direction. Preserve the original user-authored Note unless the user requests its change.
271
-
272
- ## Close And Reconcile
273
-
274
- Historical Slice states are:
275
-
276
- - `Completed`: the intended result and required in-scope methods, evidence, corrections, and checkpoints are settled;
277
- - `Blocked`: the unresolved attempt was deliberately parked;
278
- - `Abandoned`: the intended result is no longer pursued under explicit authority.
279
-
280
- Before closing, obtain the Workflow-established outcome, gather strongest evidence and proof limits, resolve or deliberately route every selected checkpoint and pending boundary, confirm accepted corrections are verified, and confirm required in-scope work is settled.
281
-
282
- When closing:
130
+ ```text
131
+ Future proposed
132
+ -> Current in_progress
133
+ <-> Current paused
134
+ -> History completed | blocked | abandoned
135
+ ```
283
136
 
284
- 1. settle the Current Slice with its intended result, outcome, authority, accepted extensions, strongest evidence, review conclusion and task effect when applicable, and state-specific blocker or abandonment reason;
285
- 2. rewrite Current Context from what remains true;
286
- 3. reconcile decisions, tentative hypotheses, open questions, proposals, blockers, route, and next useful action only where the outcome changed them;
287
- 4. clear Current Work blockers that belonged to the settled Slice;
288
- 5. set `Current Slice: None`;
289
- 6. do not select or start another Slice automatically.
137
+ - `in_progress` means the selected outcome is actively being pursued.
138
+ - `paused` means the outcome remains current but safe continuation is suspended. Ordinary feedback or a turn boundary is not a pause.
139
+ - Historical `blocked` means the unresolved paused attempt deliberately left Current Work.
140
+ - Historical `completed` means the intended result and required evidence boundary were settled.
141
+ - Historical `abandoned` means the outcome is no longer pursued under explicit authority.
142
+ - 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.
290
143
 
291
- A Learning Slice may complete by disproving its hypothesis. A green test or finished implementation alone does not establish closure.
144
+ Append a Material update only when safe continuation or truthful closure would otherwise lose a material change. Use concise labeled bullets for Evidence, pauses and resumptions, accepted extensions, contradictions, review outcomes, or corrections. Routine commands, edits, tests, and conversation turns are not record events.
292
145
 
293
- Before applying a user-directed task-state change, reconcile Current Context, Current Work, important History, and the next action; then apply exactly the chosen state.
146
+ Record an accepted extension before expanded work begins. Preserve its authority, added scope, added evidence boundary, and changed stop condition when applicable. Questions, criticism, findings, and useful suggestions do not authorize an extension.
294
147
 
295
- ## Read Through Purpose-Owned Views
148
+ A Slice cannot close while a `pending` or `deferred` Checkpoint applies to it. Resolve the Checkpoint first. Closure compacts the active declaration and Material updates into one historical Slice; it does not copy the active block wholesale.
296
149
 
297
- After context loss, begin with `view --view resume`, compare the confirmed projection with conversation and live evidence, and retrieve an exact entity only when rationale, authority, chronology, supersession, or evidence is material.
150
+ Before closing as `completed`, establish that every material completion claim has supporting Evidence at its required boundary, the live state does not contradict the result, no authority conflict remains, and no material contradiction is unresolved. A Learning Slice may complete by disproving its hypothesis when its question and Evidence boundary are settled. The command can enforce structure, not semantic truth.
298
151
 
299
- - `resume`: complete active state needed to continue safely;
300
- - `discuss`: Current Context, proposals, and a Current Slice summary;
301
- - `execute`: the full Current Slice and only context needed for that outcome;
302
- - `recent`: bounded recent settled Slices;
303
- - `entity`: one exact proposal, Slice, Decision, checkpoint, or Note;
304
- - `full`: complete record audit.
152
+ Closing never selects or starts another Future Work item. After closure, Current Slice is `None` until another outcome is explicitly selected.
305
153
 
306
- Views emit direct Markdown with task identity and SHA metadata. There are no public `current` or `work` storage-section views. Do not normally read complete History.
154
+ To continue a historical `completed` or `blocked` Slice, create a new Current Slice with a new ID and `Reopened from: S-old`. Supply fresh authority, scope, expected evidence, stop condition, and starting state. Leave the historical entry unchanged. Resuming returns a Current paused Slice to `in_progress`; reopening creates a linked Slice from History.
307
155
 
308
- ## Use The Deterministic Boundary
156
+ ## Keep Checkpoints Prospective Until Terminal
309
157
 
310
- The executable entrypoint is:
158
+ Every Checkpoint belongs to one Slice. Its title must be unique across Future Work.
311
159
 
312
160
  ```text
313
- skills/track-work/scripts/working-record.mjs
161
+ proposed -> pending <-> deferred
162
+ pending | deferred -> completed | cancelled | replaced
314
163
  ```
315
164
 
316
- This skill decides whether a Decision, proposal, checkpoint, Note, extension, or closure is semantically warranted. The command schema never makes that judgment; it only defines how to express the selected operation.
165
+ - `proposed` is a candidate with no authority or durable ID.
166
+ - `pending` is an accepted unresolved boundary that dependent work must not cross.
167
+ - `deferred` remains accepted but dormant until its recorded condition.
168
+ - `completed` means the boundary occurred; its result may still be adverse or blocking.
169
+ - `cancelled` means it is no longer required.
170
+ - `replaced` names the pending Checkpoint that takes its place.
317
171
 
318
- Once the semantic operation is selected, and before the first use of its mutation command in the active context, after context loss, or after any failed operation, run:
172
+ A proposed Checkpoint may be removed without History. Activate it only when the boundary is explicitly selected or authorized; a proposal or recommendation is not acceptance. Activation assigns `C-NNN`. When its proposed Slice starts, the same transition replaces the exact proposed-title reference with the new `S-NNN`. An accepted Checkpoint leaves Future Work only through a lifecycle command and remains there until terminal.
319
173
 
320
- ```text
321
- node skills/track-work/scripts/working-record.mjs schema --command <name>
322
- ```
174
+ ## Preserve Decisions Without Rewriting Their Meaning
323
175
 
324
- Use only the returned fields, selectors, operations, and conditional requirements. Do not inspect internal modules or reconstruct inputs from memory.
176
+ Decisions live under History and receive `D-NNN` when added:
325
177
 
326
- Supply semantic JSON with `--input <json-file>` or `--input -`. Existing-record mutations require the exact SHA-256 from a confirmed view or prior confirmed result.
178
+ ```text
179
+ active -> superseded | retired
180
+ ```
327
181
 
328
- Use `update` for precise state and entity edits. Choose one accepted input mode; do not mix `edits` with direct semantic fields. Within `edits`, use exactly one operation per field, entity, or collection edit and batch related edits for one atomic write. Use dedicated commands for Slice transitions and the direct Decision lifecycle form for Decision state transitions.
182
+ 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. A superseded Decision names its replacement; a retired Decision records why it no longer governs. Terminal Decisions are not reactivated. Adopting an old choice again creates a new active Decision.
329
183
 
330
- Wrong types, unknown fields, mixed forms, multiple operations, malformed titles, multiline list members, ambiguous selectors, and missing or non-unique text matches fail closed. `replaceText` compares normalized line endings and still requires one exact semantic match.
184
+ ## Keep Evidence And Blockers With Their Slice
331
185
 
332
- The command families are:
186
+ Do not create global Evidence or Blocker sections. A material Evidence update states the claim, observing boundary, result, what it proves and does not prove, and a real pointer when available. Later contradictory Evidence is appended rather than silently rewriting the earlier observation.
333
187
 
334
- - `init`, `view`, `validate`, and `inspect` for creation and observation;
335
- - `update` for precise context, work, proposal, Decision, checkpoint, Note, and task-state maintenance;
336
- - `start`, `block`, `resume`, `reopen`, and `close` for Slice lifecycle;
337
- - `unlock` for explicitly authorized stale-lock recovery;
338
- - `migrate` and `compress` for explicit representation rewrites.
188
+ A pause update states why continuation stopped and what permits resumption. A resume update states the resolution source. At closure, distill the strongest relevant Evidence, proof limits, unresolved blocker, and task effect into the historical Slice.
339
189
 
340
- Dry runs validate the same candidate structure and round trip as applied operations but do not persist, create snapshots, consume IDs, or change timestamps. Structural validity never proves semantic truth, readiness, migration effectiveness, or task completion.
190
+ Evidence supports claims only at its observing boundary. A green check, completed implementation, or review opinion alone does not establish a supported exit. If an attempt fails, is rolled back, or leaves residual effects that change the next decision, preserve that attempt, reason, Evidence, and residual state in Material updates or the historical Slice.
341
191
 
342
- ## Recover Without Guessing
192
+ ## Change Task State Explicitly
343
193
 
344
- A failed, dry-run, read-only, or no-op operation does not change record bytes, SHA, or `Last updated` and does not consume IDs.
194
+ Task states are:
345
195
 
346
- After `committed-unconfirmed`, discard held SHAs, fresh-read the actual record, run `validate` and `inspect` when available, establish a confirmed projection, and only then discuss or mutate again.
196
+ ```text
197
+ active <-> paused
198
+ active | paused -> completed | abandoned
199
+ completed | abandoned -> active only by explicit user reopening
200
+ ```
347
201
 
348
- Never delete a lock manually. Use `unlock` only after the script reports a stale lock, the user authorizes recovery, and the exact observed lock selectors are available. Live, malformed, changed, replaced, or concurrently removed locks fail closed. Recovery never confirms record content; fresh-read afterward.
202
+ Pausing a task pauses its Current Slice first when one exists. Reactivating the task does not automatically resume that Slice. A completed or abandoned task requires Current Slice `None` 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. Reopening a task does not automatically select work.
349
203
 
350
- Legacy and unsupported records remain read-only until explicit migration. Migration begins from exact `inspect.sourceUnits` and may not summarize, consolidate, drop, retitle, reorder, or move semantic entities to incompatible owners. Compression is a separate authorized operation with explicit scope and preservation declarations. Use each command's current schema; do not infer rewrite coverage.
204
+ ## Keep Notes Inert
351
205
 
352
- For malformed, stale, locked, or conflicting state, preserve the exact evidence. Do not force-write, guess repair, bypass the script, silently change scope, or continue with a stale SHA.
206
+ Notes have no field schema. Add or edit them directly as ordinary Markdown. Remove a user-authored Note only when the user requests it; remove other Notes only when current maintenance authority clearly covers that correction.
353
207
 
354
- ## Check Consistency
208
+ Notes do not authorize, prioritize, schedule, block, unblock, prove, or require follow-up.
355
209
 
356
- Before relying on or finishing a record mutation, confirm:
210
+ ## Read Through Two Views
357
211
 
358
- - Current Context describes present state rather than accumulated events.
359
- - Detailed facts have one canonical owner.
360
- - Current Work names no more than one Slice with a clear authority source.
361
- - Every current or historical Slice keeps one stable ID.
362
- - Proposed Slices remain unnumbered, unselected, and ordered by real dependencies.
363
- - Accepted extensions preserve the original boundary and were recorded before execution.
364
- - Discussion, review, correction, and checkpoints did not replace a coherent Current Slice.
365
- - `Blocked` means safe continuation is unavailable, not that feedback is pending.
366
- - active Decisions remain recoverable through History and lifecycle links are consistent.
367
- - upcoming checkpoints retain their selection source and condition.
368
- - resolved checkpoint titles exactly match their selected references.
369
- - Notes remain inert and user-authored Notes preserve their meaning.
370
- - settled evidence and event detail are not duplicated in Current Context.
371
- - one next useful action exists and belongs only to Current Work.
372
- - live evidence and current user direction override contradictory memory.
212
+ - `resume` shows the record header, complete Current Context, active Decisions derived from History, complete Current Work, complete Future Work, and Notes. It omits terminal History.
213
+ - `full` returns the complete canonical Markdown exactly as stored.
373
214
 
374
- Correct a clear clerical inconsistency inside current authority or return a material conflict to Workflow or Discuss. Do not force the next lifecycle transition.
215
+ Both views are direct Markdown text, not JSON. A host may render that Markdown visually. Neither view follows external pointers or mutates the record. When one historical entity is needed, search and read its bounded `S-NNN`, `C-NNN`, or `D-NNN` block instead of loading all History.
375
216
 
376
- ## Return To The Owner
217
+ ## Return To The Requesting Activity
377
218
 
378
- - unchanged discussion state: return to Discuss or wait;
379
- - material accepted memory: update, then return to its owner;
380
- - authorized execution: start, then Execute Work;
381
- - unavailable continuation: block and stop;
382
- - resolved current blocker: resume, then Execute Work;
383
- - authorized continuation of a settled outcome: reopen;
384
- - settled outcome: close, reconcile affected state, then return to Workflow;
385
- - malformed, stale, locked, or conflicting state: preserve evidence and return to Workflow or Discuss;
386
- - point-in-time transfer: [Handoff](../handoff/SKILL.md).
219
+ After maintenance, return to the activity that requested the record operation. Discussion returns to [Discuss](../discuss/SKILL.md) after accepted state is preserved; authorized Slice work returns to [Execute Work](../execute-work/SKILL.md). Point-in-time transfer uses [Handoff](../handoff/SKILL.md). Task-local durable content remains owned by [Write Spec](../write-spec/SKILL.md) and [Write Plan](../write-plan/SKILL.md). Do not continue execution, select Future Work, or treat a recorded proposal, Decision, Checkpoint, or next action as fresh authority merely because it is present.
387
220
 
388
- Track Work ends when the record accurately preserves supported state and one next useful action. It does not claim implementation, review, migration effectiveness, commit, release, or publication is complete.
221
+ Stop instead of guessing when authority, intended result, scope, evidence, record structure, migration, or a transition is unclear. Track Work ends when the record accurately preserves supported current state and one next useful action. It does not claim implementation, verification, review, commit, release, publication, or task completion on its own.