@llblab/pi-kit 0.5.2 → 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 (141) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +5 -5
  3. package/node_modules/@llblab/pi-actors/AGENTS.md +1 -1
  4. package/node_modules/@llblab/pi-actors/CHANGELOG.md +6 -0
  5. package/node_modules/@llblab/pi-actors/README.md +1 -1
  6. package/node_modules/@llblab/pi-actors/dist/lib/async-runs.d.ts +3 -0
  7. package/node_modules/@llblab/pi-actors/dist/lib/async-runs.js +14 -1
  8. package/node_modules/@llblab/pi-actors/dist/lib/command-templates.js +45 -3
  9. package/node_modules/@llblab/pi-actors/dist/lib/extension-runtime.js +1 -1
  10. package/node_modules/@llblab/pi-actors/dist/lib/observability.d.ts +16 -3
  11. package/node_modules/@llblab/pi-actors/dist/lib/observability.js +92 -7
  12. package/node_modules/@llblab/pi-actors/dist/lib/pi.d.ts +0 -1
  13. package/node_modules/@llblab/pi-actors/dist/lib/pi.js +15 -24
  14. package/node_modules/@llblab/pi-actors/dist/lib/run-delivery-lineage.d.ts +17 -0
  15. package/node_modules/@llblab/pi-actors/dist/lib/run-delivery-lineage.js +44 -0
  16. package/node_modules/@llblab/pi-actors/dist/lib/run-delivery.d.ts +4 -0
  17. package/node_modules/@llblab/pi-actors/dist/lib/run-delivery.js +102 -4
  18. package/node_modules/@llblab/pi-actors/dist/lib/run-ui-runtime.js +58 -39
  19. package/node_modules/@llblab/pi-actors/dist/lib/runtime.js +14 -6
  20. package/node_modules/@llblab/pi-actors/dist/skills/actors/SKILL.md +1 -1
  21. package/node_modules/@llblab/pi-actors/docs/async-runs.md +1 -1
  22. package/node_modules/@llblab/pi-actors/docs/coordinator-delivery.md +18 -23
  23. package/node_modules/@llblab/pi-actors/lib/async-runs.ts +18 -1
  24. package/node_modules/@llblab/pi-actors/lib/command-templates.ts +41 -3
  25. package/node_modules/@llblab/pi-actors/lib/extension-runtime.ts +1 -1
  26. package/node_modules/@llblab/pi-actors/lib/observability.ts +119 -5
  27. package/node_modules/@llblab/pi-actors/lib/pi.ts +15 -28
  28. package/node_modules/@llblab/pi-actors/lib/run-delivery-lineage.ts +68 -0
  29. package/node_modules/@llblab/pi-actors/lib/run-delivery.ts +120 -4
  30. package/node_modules/@llblab/pi-actors/lib/run-ui-runtime.ts +69 -44
  31. package/node_modules/@llblab/pi-actors/lib/runtime.ts +17 -6
  32. package/node_modules/@llblab/pi-actors/package.json +1 -1
  33. package/node_modules/@llblab/pi-actors/skills/actors/SKILL.md +1 -1
  34. package/node_modules/@llblab/pi-grow-loop/AGENTS.md +2 -2
  35. package/node_modules/@llblab/pi-grow-loop/CHANGELOG.md +4 -0
  36. package/node_modules/@llblab/pi-grow-loop/README.md +6 -6
  37. package/node_modules/@llblab/pi-grow-loop/index.ts +6 -3
  38. package/node_modules/@llblab/pi-grow-loop/package.json +1 -1
  39. package/node_modules/@llblab/pi-state-flow/AGENTS.md +33 -12
  40. package/node_modules/@llblab/pi-state-flow/BACKLOG.md +125 -2
  41. package/node_modules/@llblab/pi-state-flow/CHANGELOG.md +87 -45
  42. package/node_modules/@llblab/pi-state-flow/README.md +203 -107
  43. package/node_modules/@llblab/pi-state-flow/docs/README.md +4 -0
  44. package/node_modules/@llblab/pi-state-flow/docs/architecture.md +188 -0
  45. package/node_modules/@llblab/pi-state-flow/docs/temporal-acceptance.md +42 -0
  46. package/node_modules/@llblab/pi-state-flow/index.ts +164 -2
  47. package/node_modules/@llblab/pi-state-flow/lib/acquisition.ts +138 -0
  48. package/node_modules/@llblab/pi-state-flow/lib/artifact.ts +273 -0
  49. package/node_modules/@llblab/pi-state-flow/lib/config.ts +48 -0
  50. package/node_modules/@llblab/pi-state-flow/lib/context.ts +18 -5
  51. package/node_modules/@llblab/pi-state-flow/lib/continuation.ts +268 -0
  52. package/node_modules/@llblab/pi-state-flow/lib/discovery.ts +117 -0
  53. package/node_modules/@llblab/pi-state-flow/lib/durable.ts +562 -0
  54. package/node_modules/@llblab/pi-state-flow/lib/episode.ts +24 -12
  55. package/node_modules/@llblab/pi-state-flow/lib/extension.ts +606 -70
  56. package/node_modules/@llblab/pi-state-flow/lib/git.ts +666 -0
  57. package/node_modules/@llblab/pi-state-flow/lib/history.ts +95 -0
  58. package/node_modules/@llblab/pi-state-flow/lib/json.ts +24 -0
  59. package/node_modules/@llblab/pi-state-flow/lib/maintenance.ts +141 -0
  60. package/node_modules/@llblab/pi-state-flow/lib/memory.ts +52 -0
  61. package/node_modules/@llblab/pi-state-flow/lib/migration.ts +88 -0
  62. package/node_modules/@llblab/pi-state-flow/lib/publication.ts +296 -0
  63. package/node_modules/@llblab/pi-state-flow/lib/recovery.ts +23 -7
  64. package/node_modules/@llblab/pi-state-flow/lib/rehydration.ts +79 -0
  65. package/node_modules/@llblab/pi-state-flow/lib/runtime.ts +264 -0
  66. package/node_modules/@llblab/pi-state-flow/lib/session.ts +6 -0
  67. package/node_modules/@llblab/pi-state-flow/lib/skills.ts +99 -7
  68. package/node_modules/@llblab/pi-state-flow/lib/snapshot.ts +305 -48
  69. package/node_modules/@llblab/pi-state-flow/lib/state.ts +74 -7
  70. package/node_modules/@llblab/pi-state-flow/lib/status.ts +125 -6
  71. package/node_modules/@llblab/pi-state-flow/lib/storage.ts +196 -0
  72. package/node_modules/@llblab/pi-state-flow/lib/temporal.ts +233 -0
  73. package/node_modules/@llblab/pi-state-flow/lib/terminal.ts +70 -24
  74. package/node_modules/@llblab/pi-state-flow/lib/transition.ts +254 -29
  75. package/node_modules/@llblab/pi-state-flow/package.json +8 -2
  76. package/node_modules/@llblab/pi-state-flow/skills/state-flow-memory/SKILL.md +128 -0
  77. package/node_modules/@llblab/pi-telegram/AGENTS.md +14 -9
  78. package/node_modules/@llblab/pi-telegram/BACKLOG.md +20 -4
  79. package/node_modules/@llblab/pi-telegram/CHANGELOG.md +22 -5
  80. package/node_modules/@llblab/pi-telegram/README.md +13 -9
  81. package/node_modules/@llblab/pi-telegram/docs/README.md +1 -0
  82. package/node_modules/@llblab/pi-telegram/docs/architecture.md +220 -18
  83. package/node_modules/@llblab/pi-telegram/docs/generative-apps.md +1 -1
  84. package/node_modules/@llblab/pi-telegram/docs/multi-instance-bus.md +70 -19
  85. package/node_modules/@llblab/pi-telegram/docs/outbound.md +13 -7
  86. package/node_modules/@llblab/pi-telegram/docs/public-api.md +13 -5
  87. package/node_modules/@llblab/pi-telegram/docs/ui-style.md +3 -1
  88. package/node_modules/@llblab/pi-telegram/index.ts +4 -1415
  89. package/node_modules/@llblab/pi-telegram/lib/activity.ts +19 -5
  90. package/node_modules/@llblab/pi-telegram/lib/agent-messages.ts +6 -3
  91. package/node_modules/@llblab/pi-telegram/lib/bindings.ts +37 -2
  92. package/node_modules/@llblab/pi-telegram/lib/bus-follower.ts +600 -135
  93. package/node_modules/@llblab/pi-telegram/lib/bus-leader.ts +962 -55
  94. package/node_modules/@llblab/pi-telegram/lib/bus.ts +350 -26
  95. package/node_modules/@llblab/pi-telegram/lib/channel-posts.ts +544 -0
  96. package/node_modules/@llblab/pi-telegram/lib/commands.ts +234 -11
  97. package/node_modules/@llblab/pi-telegram/lib/config.ts +178 -25
  98. package/node_modules/@llblab/pi-telegram/lib/delivery.ts +18 -18
  99. package/node_modules/@llblab/pi-telegram/lib/extension.ts +1792 -0
  100. package/node_modules/@llblab/pi-telegram/lib/generative-apps.ts +20 -2
  101. package/node_modules/@llblab/pi-telegram/lib/journal.ts +2184 -126
  102. package/node_modules/@llblab/pi-telegram/lib/lifecycle.ts +7 -1
  103. package/node_modules/@llblab/pi-telegram/lib/locks.ts +38 -1
  104. package/node_modules/@llblab/pi-telegram/lib/menu-settings.ts +154 -15
  105. package/node_modules/@llblab/pi-telegram/lib/outbound-attachments.ts +74 -40
  106. package/node_modules/@llblab/pi-telegram/lib/outbound-voice.ts +28 -42
  107. package/node_modules/@llblab/pi-telegram/lib/outbound.ts +18 -14
  108. package/node_modules/@llblab/pi-telegram/lib/paths.ts +29 -0
  109. package/node_modules/@llblab/pi-telegram/lib/polling.ts +85 -17
  110. package/node_modules/@llblab/pi-telegram/lib/preview.ts +115 -70
  111. package/node_modules/@llblab/pi-telegram/lib/prompts.ts +5 -2
  112. package/node_modules/@llblab/pi-telegram/lib/queue.ts +66 -22
  113. package/node_modules/@llblab/pi-telegram/lib/replies.ts +47 -39
  114. package/node_modules/@llblab/pi-telegram/lib/routing.ts +305 -112
  115. package/node_modules/@llblab/pi-telegram/lib/status.ts +10 -0
  116. package/node_modules/@llblab/pi-telegram/lib/sync.ts +308 -39
  117. package/node_modules/@llblab/pi-telegram/lib/telegram-api.ts +315 -7
  118. package/node_modules/@llblab/pi-telegram/lib/thread-cleanup-manager.ts +664 -0
  119. package/node_modules/@llblab/pi-telegram/lib/thread-display.ts +226 -0
  120. package/node_modules/@llblab/pi-telegram/lib/thread-naming.ts +118 -0
  121. package/node_modules/@llblab/pi-telegram/lib/threads.ts +1686 -129
  122. package/node_modules/@llblab/pi-telegram/lib/updates.ts +1319 -97
  123. package/node_modules/@llblab/pi-telegram/lib/workspace-admission.ts +1643 -0
  124. package/node_modules/@llblab/pi-telegram/lib/workspace-retirement.ts +968 -0
  125. package/node_modules/@llblab/pi-telegram/lib/workspace-slots.ts +84 -0
  126. package/node_modules/@llblab/pi-telegram/package.json +1 -1
  127. package/node_modules/@llblab/pi-telegram/screenshot.png +0 -0
  128. package/node_modules/@llblab/pi-telegram/scripts/measure-bus.mjs +83 -0
  129. package/node_modules/@llblab/pi-telegram/scripts/measure-workspace.mjs +101 -0
  130. package/node_modules/@llblab/{skills → pi-telegram/skills}/show-me/SKILL.md +28 -6
  131. package/node_modules/@llblab/pi-telegram/skills/show-me/references/telegram-surfaces.md +43 -0
  132. package/node_modules/@llblab/pi-telegram/skills/telegram-bridge/references/delivery-and-threads.md +1 -1
  133. package/node_modules/@llblab/skills/abcd-context/AGENTS.md +1 -0
  134. package/node_modules/@llblab/skills/abcd-context/CHANGELOG.md +6 -2
  135. package/node_modules/@llblab/skills/abcd-context/SKILL.md +1 -1
  136. package/node_modules/@llblab/skills/abcd-context/docs/validation-design.md +11 -5
  137. package/node_modules/@llblab/skills/abcd-context/scripts/_self-test.mjs +61 -0
  138. package/node_modules/@llblab/skills/abcd-context/scripts/validate-context.mjs +67 -0
  139. package/node_modules/@llblab/skills/package.json +2 -3
  140. package/node_modules/@llblab/skills/release-flow/SKILL.md +2 -4
  141. package/package.json +7 -6
@@ -1,3 +1,126 @@
1
- # Backlog
1
+ # BACKLOG
2
2
 
3
- No planned work.
3
+ Canonical proposed work for **pi-state-flow 0.6.0 — Continuity without fixation**.
4
+
5
+ Baseline: **0.5.0**, commit `feed43c33db7f4a7f9c10a7eda619a2ffc2c91b5`, inspected on 2026-09-09. This document specifies work; it does not report implementation or validation results. Reconcile with newer repository work before editing.
6
+
7
+ ## Release contract
8
+
9
+ A fresh State Flow run should inherit the consequences of previous work: active commitments, established observations, bounded negative results, meaningful corrections, unresolved decision-relevant uncertainty, and the exact point of continuation. It should not inherit an unapproved method as a requirement or an earlier inference as established truth.
10
+
11
+ Implement this through the existing runtime protocol, the explicit curation Skill, and focused regression coverage. Do not build a new memory engine. More novelty, smaller state, and zero repeated work are not independent success criteria.
12
+
13
+ **Done:** the runtime and Skill express consistent memory rules; the documented curation sequence is executable with current tools and compilation obligations; compatibility regressions pass. Semantic quality remains a model-judgment boundary rather than a deterministic transport claim.
14
+
15
+ ## Fixed boundaries
16
+
17
+ - Keep the semantic shape exactly `artifacts`, `contract`, `working`, `response`, with existing flexible object contents and `global → cwd → session` overlay.
18
+ - Preserve `checkpoint.json` / `patches.jsonl`, shared causal boundaries, hot offsets 0–7, Git/file-only guarantees, branch restoration, and local acceptance versus remote publication.
19
+ - Preserve the native tool loop, complete current-run trajectory, inspectable Pi trace, bootstrap behavior, and removal of completed trajectories only at user-run boundaries. No extra resets or forced exploratory reruns.
20
+ - Keep `patch_state` single-scope and the sole semantic mutation tool. Keep terminal multi-scope reconciliation, runtime-owned response, and strict inference barriers.
21
+ - No required per-item confidence/provenance/status schema, additional memory store, semantic truth validator, automatic curation, state-size gate, or mandatory historical/source reread.
22
+ - No automatic permission expansion, external publication, or historical erasure. Scope is applicability, not instruction authority.
23
+ - No blockchain/IPFS/JAM integration, model marketplace, speculative alternate-agent execution, or native auto-resume work in this release.
24
+
25
+ ## Ordered work
26
+
27
+ ### [x] SF-060-01 — Make ordinary runtime handoffs preserve continuity without fixing the method
28
+
29
+ **Primary files:** `lib/terminal.ts`, `lib/extension.ts`, `tests/terminal.test.ts`. Align normative wording in `AGENTS.md`.
30
+
31
+ Replace or consolidate existing memory guidance rather than appending another large protocol block. Keep the protocol independent of user-controlled text and stable during the current run and its retry chain.
32
+
33
+ Required semantics:
34
+
35
+ - Remove the blanket prohibition on retaining speculation. Exclude speculative clutter and unsupported assertions, but retain explicitly uncertain hypotheses when they can affect an open decision.
36
+ - Distinguish user requirements, confirmed decisions, observations, assistant conclusions, and provisional methods. Silence or repeated assistant assertion is not user acceptance. Do not demote confirmed decisions merely to encourage search.
37
+ - Preserve interaction consequences when relevant: proposals awaiting acceptance, corrections, unresolved questions, settled explanations, and referents needed for the next follow-up. Do not synthesize shared history or a personality dossier.
38
+ - Retain a consequential result at its demonstrated boundary: tested mechanism, conditions, outcome, and an existing useful evidence locator. A failed implementation does not disprove every implementation; one success does not establish unrestricted validity.
39
+ - Preserve exact rejection reasons and known reconsideration conditions. Reconsideration may follow a different mechanism, changed conditions, a discriminating test, or a specific verification need; do not manufacture alternatives or rerun unchanged failures without a reason.
40
+ - Preserve completed prerequisites and verified outcomes that remain relevant; remove obsolete progress narration, not the fact that work was completed.
41
+ - Reconcile information affected by the current run and relevant existing commitments. Do not require a repository-wide or all-scope maintenance audit on every ordinary turn. Keep terminal reconciliation; keep explicit curation separate.
42
+ - Keep `working` as last observations, not live external state. Preserve targeted revalidation needs without promising rollback or exactly-once effects.
43
+ - Clarify that matching source hash/compiler metadata establishes source-version consistency, not semantic fidelity or higher instruction authority. Remove ambiguous use of "authoritative" for a fallible Skill compilation; current instructions remain controlling.
44
+
45
+ Update `patch_state` description/guidance to permit a necessary write-and-verify step in explicitly requested curation, in addition to meaningful loss/recovery-risk barriers. A known uncertainty may be worth preserving without asserting its underlying hypothesis as true. Do not create a new curation mode, flag, or automatic call requirement.
46
+
47
+ **Acceptance:** no conflicting blanket ban remains in the emitted protocol; no compulsory item schema or extra model call appears; ordinary no-memory-change answers remain valid; current-run tool/retry context and user authority are unchanged. Record before/after protocol size as a diagnostic, not an arbitrary pass/fail cap.
48
+
49
+ ### [x] SF-060-02 — Ship the revised bounded curation Skill
50
+
51
+ **Primary files:** `skills/state-flow-memory/SKILL.md`, `tests/skills.test.ts`.
52
+
53
+ Use the revised Skill supplied with this task as the editorial baseline. Keep it self-contained and explicit-only; do not inject its full inventory/migration procedure into every runtime prompt.
54
+
55
+ Required outcomes:
56
+
57
+ - Add `reframe` alongside keep/update/narrow/promotion/remove. These are audit choices, not mandatory stored labels.
58
+ - Preserve useful uncertainty, commitments, interaction consequences, bounded learning, source recoverability, and the distinction between a requirement and a provisional method.
59
+ - Include one bounded fresh-run review: what must still hold; what changed; what remains open; what omission would cause repetition or lost commitments; what retained claim would impose an unjustified method.
60
+ - Use the narrowest valid scope. Resolve destination conflicts before movement; write and verify the destination before deleting the source; inspect the effective overlay afterward. Separate tool calls are not atomic migration.
61
+ - Preserve an accepted source copy on unverified external promotion. Verify destination identity, content and revision through the actual interface; a stored assertion of acceptance is not a receipt. Preserve routing necessary for later retrieval.
62
+ - Report partial migration, unavailable evidence, and historical secret-retention limits truthfully. Do not expose secrets in the report or equate active-state deletion with historical erasure.
63
+ - Stop after the requested cohort, including an unchanged or blocked result. Do not start a project investigation or an automatic audit merely to improve memory.
64
+
65
+ **Acceptance:** Pi discovers the Skill without diagnostics; its activation remains explicit; the revised policy does not contradict SF-060-01; tests assert the relevant contract rather than preserving obsolete wording. A justified reread of the changed Skill refreshes its existing path-keyed artifact through normal compilation. Do not invalidate unrelated artifacts or invent a new compiler revision solely for this prose change.
66
+
67
+ ### [x] SF-060-03 — Prove the Skill can complete curation through existing barriers
68
+
69
+ **Primary files:** `lib/extension.ts`, `lib/transition.ts` (verification targets); `tests/skills.test.ts`, `tests/transition.test.ts`, `tests/integration.test.ts`; relevant protocol/Skill instructions.
70
+
71
+ The baseline already clears successful acquisition trackers after an accepted `commitStage`. Do not add a new tracker lifecycle on the assumption that accepted reads remain pending. The actual scheduling constraint is that pending Skill reads require CWD compilation and pending invalidated ordinary Markdown reads require global compilation at the next accepting transition.
72
+
73
+ Document and regression-test this executable sequence:
74
+
75
+ 1. Read the curation Skill when needed; accept its required CWD compilation before accumulating a global compilation obligation.
76
+ 2. Read the smallest required state projections. Read a stale ordinary Markdown source only for a justified gap; accept its global compilation before proceeding with unrelated single-scope writes.
77
+ 3. Write the migration destination using `patch_state`, verify it with a separate `read_state`, then delete/narrow the source and verify the resulting scope/effective state.
78
+ 4. Complete one terminal reconciliation without repeating already accepted compilations or inventing memory changes.
79
+
80
+ Do not depend on read-after-write inspection following a terminal answer; readback must occur after tool barriers, before final reporting. Do not weaken compiler validation or introduce multi-scope `patch_state` to solve a scheduling problem.
81
+
82
+ Cover these boundaries:
83
+
84
+ - A Skill read followed by an unrelated session/global patch without required compilation is rejected without accepting state; the documented compilation-first route succeeds.
85
+ - Simultaneously pending CWD/global acquisition remains subject to the existing complete-compilation rule. Test rejection of insufficient single-scope patches and acceptance through existing multi-scope terminal reconciliation. Do not silently discard obligations or claim an unperformed curation was verified.
86
+ - Accepted compilation clears only completed acquisition work; a failed acceptance does not authorize dropping it. Existing trusted hash/compiler and source-refresh checks remain effective.
87
+ - Destination failure preserves the source; source-deletion failure leaves a recoverable duplicate and is reported as incomplete. Inherited values exposed by deletion are visible to verification.
88
+ - No-op memory curation introduces no fabricated memory changes. A changed final response may still create a semantic transition under the existing contract.
89
+ - Reader siblings remain blocked by `patch_state`; read-only verification creates no transition. A successful local acceptance is not repeated because remote replication failed.
90
+
91
+ **Acceptance:** tests exercise actual tool/event ordering, not only hand-authored terminal patches. Use the real Pi SDK fixture where lifecycle behavior matters, clearly labeling its scripted provider. Existing validators and public tool schemas remain intact. Change production logic only for an observed regression within this sequence, with a reproducer; no speculative refactor.
92
+
93
+ ### [x] SF-060-05 — Align documentation, preserve compatibility, and prepare release
94
+
95
+ **Primary files:** `AGENTS.md`, `README.md`, `docs/architecture.md`, `CHANGELOG.md`, `package.json`, `package-lock.json`, and this backlog.
96
+
97
+ - Describe ordinary handoff versus explicit curation consistently, including useful uncertainty, confirmed decisions, bounded negative results and interaction consequences.
98
+ - Remove conditional language suggesting global memory is a feature switch. Clarify that a valid state/receipt does not prove semantic truth, useful curation, or historical deletion.
99
+ - Document compilation-first curation scheduling and the existing mixed-acquisition limitation. Do not advertise a new atomic multi-scope tool operation.
100
+ - Keep existing 0.5.0 Git-backed and file-only states readable without schema migration, bulk rewrite or invented semantic transitions. Protocol changes do not retroactively certify old memory or rewrite historical revisions. Refresh changed Skill content through justified acquisition, not a global startup rebuild.
101
+ - Keep current-run/native trace behavior, temporal offsets, scope isolation, response finalization and publication behavior covered by the existing test suite. Add only focused compatibility cases that are missing.
102
+ - Prepare version 0.6.0 in package and lockfile, concise release notes, and a requirement-to-test/evidence map for SF-060-01 through SF-060-03. Record what was actually run and any remaining limitations.
103
+
104
+ **Acceptance:** `npm run validate` passes; packed content includes the revised Skill and documentation; no new storage/config/tool contract or production dependency is introduced. Packaging and release follow existing repository gates. Preparing the release does not authorize commits, tags, pushes, npm publication or GitHub release creation.
105
+
106
+ ## Dependencies and stopping rule
107
+
108
+ `SF-060-01 → SF-060-02 → SF-060-03`; `SF-060-05` closes the release.
109
+
110
+ Each item closes with its diff, targeted proof and unresolved limitations. Split a large proof into smaller cases under the same item; do not enlarge product scope. Newly discovered adjacent issues go into a deferred section unless they prevent this release contract from holding.
111
+
112
+ Stop when the four items and release checks are satisfied. Do not prolong 0.6.0 to seek universal semantic guarantees or a redesigned memory system.
113
+
114
+ ## Deferred host integration — preserved from 0.5.0
115
+
116
+ - [ ] **Native default session continuation:** Integrate existing read-only recommendation, exact selection and knowledge-bootstrap contracts before Pi creates `SessionManager`, preserving explicit new/resume precedence, truthful notices and cross-process session ownership. The recorded 0.5.0 blocker is the lack of a suitable Pi pre-session resolver hook; reverify upstream support when taking this item. It is not a 0.6.0 release dependency.
117
+
118
+ ## Baseline evidence
119
+
120
+ The findings above come from inspection of this pinned revision, not an execution of its tests:
121
+
122
+ - [Runtime protocol and terminal handling](https://github.com/llblab/pi-state-flow/blob/feed43c33db7f4a7f9c10a7eda619a2ffc2c91b5/lib/terminal.ts): blanket speculation prohibition coexists with preserving decision-relevant hypotheses; terminal reconciliation already exists.
123
+ - [Extension wiring](https://github.com/llblab/pi-state-flow/blob/feed43c33db7f4a7f9c10a7eda619a2ffc2c91b5/lib/extension.ts): compilation trackers clear after accepted commit; context projection and barrier lifecycle are already implemented.
124
+ - [Transition validation](https://github.com/llblab/pi-state-flow/blob/feed43c33db7f4a7f9c10a7eda619a2ffc2c91b5/lib/transition.ts): required compiler outputs are scoped, and the single-scope tool and multi-scope terminal share staging.
125
+ - [Existing curation tests](https://github.com/llblab/pi-state-flow/blob/feed43c33db7f4a7f9c10a7eda619a2ffc2c91b5/tests/skills.test.ts): the existing narrowing example uses a terminal multi-scope patch rather than the complete read/compile/write/readback sequence.
126
+ - [Contributor invariants](https://github.com/llblab/pi-state-flow/blob/feed43c33db7f4a7f9c10a7eda619a2ffc2c91b5/AGENTS.md) and [existing backlog](https://github.com/llblab/pi-state-flow/blob/feed43c33db7f4a7f9c10a7eda619a2ffc2c91b5/BACKLOG.md): unchanged engine boundaries and deferred host work.
@@ -1,79 +1,121 @@
1
1
  # Changelog
2
2
 
3
+ > Each release keeps at most 8 outcome records of at most 512 characters.
4
+
5
+ ## 0.6.0: Continuity without fixation
6
+
7
+ - `Memory`: Revised ordinary handoffs to preserve confirmed decisions, useful uncertainty, interaction consequences, completed prerequisites, bounded positive and negative results, and exact continuation without promoting provisional methods or unsupported assertions.
8
+ - `Skill`: Expanded the explicit `state-flow-memory` Skill with reframing, one bounded fresh-run review, compilation-first scheduling, write/readback/delete scope migration, recoverable partial results, and evidence-gated external promotion.
9
+ - `Curation`: Added regression coverage for the executable curation barrier sequence while preserving single-scope `patch_state`, terminal multi-scope reconciliation, trusted compiler metadata, native tool context, and local acceptance independently from remote replication.
10
+ - `Compatibility`: Preserved the 0.5.0 semantic shape and Git/file storage without migration, bulk rewrite, new dependency, or new runtime/config/tool contract.
11
+
12
+ ## 0.5.0: Durable memory, compiled routing, and local-first publication
13
+
14
+ - `Publication`: Decoupled immediate local Git acceptance from optional remote replication with persisted `off`/`turn-end`/legacy `transition` policy, a symlink-safe CAS queue, descendant-only coalescing, asynchronous non-interactive workers, restart recovery, concurrency-safe confirmation, and truthful status diagnostics.
15
+ - `Memory`: Made State Flow the unconditional durable-memory owner while enabled, with global semantic memory always available at the narrowest correct scope; external promotion pointers remain optional semantic handoff records rather than runtime ownership configuration.
16
+ - `Artifacts`: Added extensible compiled artifact metadata, validated tags, deterministic candidate routing, and bounded visible source rehydration without persisting source bodies or treating routing as read authorization.
17
+ - `Continuation`: Added read-only native-session discovery, exact State Flow provenance checks, deterministic continuation ranking, and bootstrap planning while keeping automatic default resume deferred until Pi exposes a pre-session resolver hook.
18
+ - `Identity`: Unified Pi's session UUID and native storage key as one runtime address, centralized extension runtime construction, and skipped obsolete hashed-path probing once canonical CWD materialization is proven.
19
+ - `Validation`: Replaced transient semantic-equality SHA-256 calculations with validated structural JSON comparison while retaining cryptographic hashes for durable identity, freshness, integrity, CAS, and fingerprints.
20
+ - `Transcript`: Restored the empty-line boundary between the `patch_state` tool call and its materialization result in Pi and Telegram transcript rendering.
21
+ - `Skill`: Bundled the optional `state-flow-memory` Skill for explicit bounded audits, scope narrowing, contradiction cleanup, and evidence-gated external handoff without background maintenance.
22
+
23
+ ## 0.4.0: Temporal state and independent durable storage
24
+
25
+ ### Temporal state
26
+
27
+ - `Temporal`: Rebuilt materialized state on one parent-linked causal lineage. `state[0..7]` and each global/CWD/session projection now resolve the same accepted boundary, sparse multi-scope changes share one identity, response-only changes advance history, and semantic no-ops do not.
28
+ - `Temporal`: Added enabled-only `read_state` for lazy effective or scoped reads at offsets zero through seven. Reads use the cached checkpoint/tail runtime without publishing, while `patch_state` remains the sole mutator and an immediate inference barrier.
29
+ - `Lifecycle`: Preserved Pi's native tool loop and full inspectable session trace while reconciling each finalized answer into session response exactly once. New sessions inherit shared scopes without rewriting them; resume, tree navigation, stop, and pre-runtime branch starts preserve branch-local provenance.
30
+
31
+ ### Storage and recovery
32
+
33
+ - `Storage`: Moved runtime state out of Knowledge into the independently configurable `agentDir/state-flow` store. Canonical scope files are anchored `checkpoint.json` plus bounded replayable `patches.jsonl`, with separate session `config.json` and `meta.json`; strict revision-only Pi checkpoints replace copied semantic snapshots.
34
+ - `Storage`: Made Git optional. File-only mode preserves the exact current cohort and hot history when the executable is absent; Git mode commits every accepted cohort immediately, keeps local-only repositories valid, retries the exact commit after remote failure, and adopts populated file stores without inventing earlier history.
35
+ - `Identity`: Aligned CWD and session directories with Pi's native readable layout, including JSONL filename stems and header-derived in-memory session names. Canonical owner metadata retains collision/foreign-identity checks; current Git-backed SHA-suffixed development stores migrate transactionally, while old Git revisions remain readable.
36
+ - `Recovery`: Added conservative current-state migration and branch restoration without checkout/reset. Historical reads select Git objects directly; unavailable pointers never authorize substituting live files, and changing the configured store does not silently relocate Knowledge-backed history.
37
+ - `Publication`: Hardened publication with shared exclusion, isolated indexes, exact prepared-byte receipts, compare-and-swap checks, symlink/path rejection, unrelated staging preservation, and conflict-aware byte-exact rollback.
38
+
39
+ ### Configuration, context, and diagnostics
40
+
41
+ - `Configuration`: Added strict agent-level `state-flow.json`: `directory` selects storage and `autoStart` defaults to `false` for genuinely new sessions only. Absolute, config-relative, and home-relative paths are supported; SDK storage and Knowledge roots remain independent overrides.
42
+ - `Context`: Retained the canonical `artifacts`, `contract`, `working`, and `response` semantic shape, with recursive global → CWD → session overlay. Knowledge Markdown and Skill acquisition now use source-addressed, runtime-hashed artifact compilations and materialized-first read policy rather than raw-body injection.
43
+ - `Diagnostics`: Expanded status and acceptance documentation for selected revisions, active temporal boundaries, hot-history depth, retained scope tails, artifact freshness, pending publication, unavailable materialization, and all twenty temporal properties.
44
+
3
45
  ## 0.3.0: Optional memory patches and evidence-aware handoffs
4
46
 
5
- - Require targeted revalidation of volatile observations and inspection of external effects after interruption or branch navigation; missing memory proves neither success nor absence of effects. Document the absence of rollback/freshness guarantees and preserve the restriction on routine Skill rereads. Add instruction-presence tests, not semantic or integration guarantees.
6
- - Strengthen the handoff protocol with evidence-aware continuation, requirement/observation/hypothesis distinctions, conditional rejections, and contradiction reconciliation; preserve decision-relevant uncertainty during optimization. Add instruction-presence regressions, not semantic guarantees. Increase the protocol-only character budget to 3,700 (3,900 with bootstrap) for these obligations; state remains uncapped.
7
- - Accept ordinary non-empty terminal answers as empty memory patches: preserve memory and update the response without unnecessary regeneration, including answers split across text blocks.
8
- - Keep malformed explicit envelopes and missing Skill compilations on the existing bounded validation path.
9
- - Clear the backlog; documented integration and continuation-quality limitations remain, not release commitments.
47
+ - `Reality`: Require targeted revalidation of volatile observations and inspection of external effects after interruption or branch navigation; missing memory proves neither success nor absence of effects. Document the absence of rollback/freshness guarantees and preserve the restriction on routine Skill rereads. Add instruction-presence tests, not semantic or integration guarantees.
48
+ - `Memory`: Strengthen the handoff protocol with evidence-aware continuation, requirement/observation/hypothesis distinctions, conditional rejections, and contradiction reconciliation; preserve decision-relevant uncertainty during optimization. Add instruction-presence regressions, not semantic guarantees. Increase the protocol-only character budget to 3,700 (3,900 with bootstrap) for these obligations; state remains uncapped.
49
+ - `Terminal`: Accept ordinary non-empty terminal answers as empty memory patches: preserve memory and update the response without unnecessary regeneration, including answers split across text blocks.
50
+ - `Validation`: Keep malformed explicit envelopes and missing Skill compilations on the existing bounded validation path.
51
+ - `Planning`: Clear the backlog; documented integration and continuation-quality limitations remain, not release commitments.
10
52
 
11
53
  ## 0.2.3: Document protocol and validation limitations
12
54
 
13
- - Document that duplicate-comment detection also rejects literal State Flow envelope examples inside fenced or inline code in terminal answers, and provide a plain-JSON workaround.
14
- - Clarify that mock lifecycle tests are not real Pi scheduler integration checks and that structural validation cannot guarantee semantic memory retention.
15
- - No runtime behavior changes.
55
+ - `Terminal`: Document that duplicate-comment detection also rejects literal State Flow envelope examples inside fenced or inline code in terminal answers, and provide a plain-JSON workaround.
56
+ - `Validation`: Clarify that mock lifecycle tests are not real Pi scheduler integration checks and that structural validation cannot guarantee semantic memory retention.
57
+ - `Runtime`: No runtime behavior changes.
16
58
 
17
59
  ## 0.2.2: README structure hotfix
18
60
 
19
- - Separate installation from usage, remove the redundant quick-start section, and move architecture details after the user-facing documentation.
61
+ - `Documentation`: Separate installation from usage, remove the redundant quick-start section, and move architecture details after the user-facing documentation.
20
62
 
21
63
  ## 0.2.1: README banner hotfix
22
64
 
23
- - Add the project banner to the README.
65
+ - `Documentation`: Add the project banner to the README.
24
66
 
25
67
  ## 0.2.0: Modular runtime hardening
26
68
 
27
- - Add a task-first README quick start with explicit compatibility, opt-in behavior, one-off trial instructions, and Pi package security guidance.
28
- - Tighten the normative runtime protocol and enforce a regression-tested character budget; omit absent validation feedback from synthetic runtime context instead of serializing a redundant `null`.
29
- - Redistribute lifecycle coverage from the former monolithic extension suite into the corresponding mirrored domain suites, leaving `extension.test.ts` focused on composition and using one shared test harness.
30
- - Split the runtime into independent `json`, `state`, `episode`, `snapshot`, `session`, `recovery`, `status`, `context`, `skills`, `terminal`, `validation`, `transition`, and `extension` modules under `lib/`; isolate explicit episode transitions, active-branch selection and recovery, status rendering, bounded retry decisions, atomic state staging, and compare-and-swap commits; mirror each domain under `tests/`, enforce an acyclic dependency graph with cross-domain invariant tests, and reduce `index.ts` to composition and public exports.
31
- - Register lifecycle commands in the canonical start, status, stop order.
32
- - Centralize synthetic runtime-context construction and private validation-message filtering in the independently tested context domain, keeping user-controlled specifications out of system-prompt composition.
33
- - Keep State Flow enabled and preserve the last committed state when terminal-validation retries are exhausted; only the transient retry chain is abandoned so the next user request can continue reliably.
34
- - Track Skill reads through an independently tested lifecycle correlator in Pi's actual `tool_execution_start` → `tool_call` event order while retaining the mutable intercepted input reference, so later argument rewrites are attributed to the executed path.
35
- - Discard mismatched lifecycle records defensively so a stale or reused tool-call id cannot produce false Skill acquisition.
36
- - Bound restored iteration and validation-attempt counters before incrementing them, reject exhausted live iteration counters explicitly, and cover both safe-integer boundaries so malformed branch metadata cannot corrupt retry accounting or status output.
37
- - Reject restored non-JSON state values such as non-finite numbers before they can break hashing or silently materialize as `null`.
38
- - Fall back past malformed newer checkpoints to the newest valid active-branch snapshot, while still failing closed on cyclic or hostile snapshot objects when no valid checkpoint remains.
39
- - Reject malformed three-field state shapes rather than reinterpreting them as legacy working memory, and contain failures while enumerating hostile branch entries.
40
- - Make canonical serialization and exported patch validation reject lossy or cyclic non-JSON inputs explicitly instead of returning invalid results or silently rewriting values.
69
+ - `Documentation`: Add a task-first README quick start with explicit compatibility, opt-in behavior, one-off trial instructions, and Pi package security guidance.
70
+ - `Protocol`: Tighten the normative runtime protocol and enforce a regression-tested character budget; omit absent validation feedback from synthetic runtime context instead of serializing a redundant `null`.
71
+ - `Testing`: Redistribute lifecycle coverage from the former monolithic extension suite into the corresponding mirrored domain suites, leaving `extension.test.ts` focused on composition and using one shared test harness.
72
+ - `Architecture`: Split the runtime into independent `json`, `state`, `episode`, `snapshot`, `session`, `recovery`, `status`, `context`, `skills`, `terminal`, `validation`, `transition`, and `extension` modules under `lib/`; isolate explicit episode transitions, active-branch selection and recovery, status rendering, bounded retry decisions, atomic state staging, and compare-and-swap commits; mirror each domain under `tests/`, enforce an acyclic dependency graph with cross-domain invariant tests, and reduce `index.ts` to composition and public exports.
73
+ - `Lifecycle`: Register lifecycle commands in the canonical start, status, stop order.
74
+ - `Context`: Centralize synthetic runtime-context construction and private validation-message filtering in the independently tested context domain, keeping user-controlled specifications out of system-prompt composition.
75
+ - `Recovery`: Keep State Flow enabled and preserve the last committed state when terminal-validation retries are exhausted; only the transient retry chain is abandoned so the next user request can continue reliably.
76
+ - `Skill`: Track Skill reads through an independently tested lifecycle correlator in Pi's actual `tool_execution_start` → `tool_call` event order while retaining the mutable intercepted input reference, so later argument rewrites are attributed to the executed path.
77
+ - `Lifecycle`: Discard mismatched lifecycle records defensively so a stale or reused tool-call id cannot produce false Skill acquisition.
78
+ - `Validation`: Bound restored iteration and validation-attempt counters before incrementing them, reject exhausted live iteration counters explicitly, and cover both safe-integer boundaries so malformed branch metadata cannot corrupt retry accounting or status output.
79
+ - `Validation`: Reject restored non-JSON state values such as non-finite numbers before they can break hashing or silently materialize as `null`.
80
+ - `Recovery`: Fall back past malformed newer checkpoints to the newest valid active-branch snapshot, while still failing closed on cyclic or hostile snapshot objects when no valid checkpoint remains.
81
+ - `Recovery`: Reject malformed three-field state shapes rather than reinterpreting them as legacy working memory, and contain failures while enumerating hostile branch entries.
82
+ - `Validation`: Make canonical serialization and exported patch validation reject lossy or cyclic non-JSON inputs explicitly instead of returning invalid results or silently rewriting values.
41
83
 
42
84
  ## 0.1.5: Skill attribution and state model clarification
43
85
 
44
- - Attribute successful Skill acquisition to finalized `tool_execution_start` arguments, with a tested compatibility fallback to the intercepted `tool_call` input.
45
- - Clarify that the three-field materialized handoff coexists with mutable exogenous project and runtime state that can also shape model behavior.
46
- - Remove the obsolete `/reload` step from the usage instructions.
86
+ - `Skill`: Attribute successful Skill acquisition to finalized `tool_execution_start` arguments, with a tested compatibility fallback to the intercepted `tool_call` input.
87
+ - `State`: Clarify that the three-field materialized handoff coexists with mutable exogenous project and runtime state that can also shape model behavior.
88
+ - `Documentation`: Remove the obsolete `/reload` step from the usage instructions.
47
89
 
48
90
  ## 0.1.4: Release verification hotfix
49
91
 
50
- - Kept npm pack lifecycle output out of release inventory JSON so Trusted Publisher releases can complete public verification and GitHub Release creation.
92
+ - `Release`: Kept npm pack lifecycle output out of release inventory JSON so Trusted Publisher releases can complete public verification and GitHub Release creation.
51
93
 
52
94
  ## 0.1.3: Trusted Publisher release automation
53
95
 
54
- - Added immutable-tag GitHub Actions automation that validates the package, publishes and verifies npm through Trusted Publisher with provenance, and creates the matching GitHub Release.
96
+ - `Release`: Added immutable-tag GitHub Actions automation that validates the package, publishes and verifies npm through Trusted Publisher with provenance, and creates the matching GitHub Release.
55
97
 
56
98
  ## 0.1.2: Repository identity hotfix
57
99
 
58
- - Aligned GitHub repository, package metadata, installation documentation, and release links under the canonical `llblab/pi-state-flow` identity.
100
+ - `Identity`: Aligned GitHub repository, package metadata, installation documentation, and release links under the canonical `llblab/pi-state-flow` identity.
59
101
 
60
102
  ## 0.1.1: Public npm distribution
61
103
 
62
- - Enabled public npm distribution for `@llblab/pi-state-flow`, including registry access and verified GitHub package metadata.
63
- - Clarified that compiled Skill knowledge is stored persistently under `contract.compiled_skills`, never as another top-level state field.
104
+ - `Release`: Enabled public npm distribution for `@llblab/pi-state-flow`, including registry access and verified GitHub package metadata.
105
+ - `Skill`: Clarified that compiled Skill knowledge is stored persistently under `contract.compiled_skills`, never as another top-level state field.
64
106
 
65
107
  ## 0.1.0
66
108
 
67
- - Added an opt-in State Flow runtime inspired by SKILL.state, with argument-free lifecycle commands, per-user-run specifications, active-branch persistence, and one materialized explicit state.
68
- - Added native Pi tool-loop preservation: tool-bearing responses require no patch, current-run tool trajectory remains model-visible, and one terminal handoff commits state after the complete agent run.
69
- - Added required flexible `contract` and `working` objects plus the required latest user-facing `response` string, recursive materialization, nested object-key `null` deletion, materialized-null rejection, and deterministic state compare-and-swap.
70
- - Kept arbitrary response content outside the transcript-private `<!-- state_flow … -->` memory-patch frame; the runtime strictly anchors the frame at the start of one terminal text block, requires exactly one blank separator, reconciles materialized `response` with Pi's finalized post-handler text at `turn_end`, and routes post-handler finalization failures through the same bounded hidden regeneration chain. Documented that the frame remains observable to streaming consumers before finalization.
71
- - Kept user-controlled turn specifications at user authority by moving their repeated representation out of the system prompt and into synthetic user runtime context, including support for empty text in image-only prompts.
72
- - Added active-branch restoration after `/tree` navigation, clean abandonment of interrupted terminal-validation retries before the next user run, and cumulative retry accounting across intervening tool-bearing turns.
73
- - Preserved persistent and current-run custom context from other Pi extensions, attributed Skill acquisition from finalized executed arguments after mutable tool interception, and limited accidental intermediate-envelope stripping to a structurally valid leading frame.
74
- - Hardened recursive patch materialization so JSON keys such as `__proto__` remain ordinary own data without changing object prototypes.
75
- - Added an explicit release file allowlist, Pi package discovery keywords, package-safe README targets, Pi/Node compatibility bounds, and a prepack validation gate so generated packages contain only runtime and human-facing release files.
76
- - Added bootstrap migration for enabling State Flow inside an existing session, per-run specification rotation, schema-free episode-level Skill compilation in `contract.compiled_skills` keyed by exact source path, and model-owned memory optimization that reorganizes inefficient structure and deletes stale, redundant, speculative, or low-value state.
77
- - Removed per-tool state commits, action authorization, Delta Window, observation envelopes, action ledgers, project schemas, state and patch byte caps, dynamic growth pressure, and all coupling to other extensions.
78
- - Compressed the static runtime protocol while retaining terminal, handoff, Skill-compilation, authority, and memory-optimization invariants.
79
- - Added stop-as-complete-episode-reset semantics, a compact accent `state-flow` plus dim `#<iteration>` status, and complete pretty-formatted state JSON output from `/state-flow-status`.
109
+ - `Runtime`: Added an opt-in State Flow runtime inspired by SKILL.state, with argument-free lifecycle commands, per-user-run specifications, active-branch persistence, and one materialized explicit state.
110
+ - `Lifecycle`: Added native Pi tool-loop preservation: tool-bearing responses require no patch, current-run tool trajectory remains model-visible, and one terminal handoff commits state after the complete agent run.
111
+ - `State`: Added required flexible `contract` and `working` objects plus the required latest user-facing `response` string, recursive materialization, nested object-key `null` deletion, materialized-null rejection, and deterministic state compare-and-swap.
112
+ - `Terminal`: Kept arbitrary response content outside the transcript-private `<!-- state_flow … -->` memory-patch frame; the runtime strictly anchors the frame at the start of one terminal text block, requires exactly one blank separator, reconciles materialized `response` with Pi's finalized post-handler text at `turn_end`, and routes post-handler finalization failures through the same bounded hidden regeneration chain. Documented that the frame remains observable to streaming consumers before finalization.
113
+ - `Authority`: Kept user-controlled turn specifications at user authority by moving their repeated representation out of the system prompt and into synthetic user runtime context, including support for empty text in image-only prompts.
114
+ - `Recovery`: Added active-branch restoration after `/tree` navigation, clean abandonment of interrupted terminal-validation retries before the next user run, and cumulative retry accounting across intervening tool-bearing turns.
115
+ - `Context`: Preserved persistent and current-run custom context from other Pi extensions, attributed Skill acquisition from finalized executed arguments after mutable tool interception, and limited accidental intermediate-envelope stripping to a structurally valid leading frame.
116
+ - `State`: Hardened recursive patch materialization so JSON keys such as `__proto__` remain ordinary own data without changing object prototypes.
117
+ - `Packaging`: Added an explicit release file allowlist, Pi package discovery keywords, package-safe README targets, Pi/Node compatibility bounds, and a prepack validation gate so generated packages contain only runtime and human-facing release files.
118
+ - `Bootstrap`: Added bootstrap migration for enabling State Flow inside an existing session, per-run specification rotation, schema-free episode-level Skill compilation in `contract.compiled_skills` keyed by exact source path, and model-owned memory optimization that reorganizes inefficient structure and deletes stale, redundant, speculative, or low-value state.
119
+ - `Architecture`: Removed per-tool state commits, action authorization, Delta Window, observation envelopes, action ledgers, project schemas, state and patch byte caps, dynamic growth pressure, and all coupling to other extensions.
120
+ - `Protocol`: Compressed the static runtime protocol while retaining terminal, handoff, Skill-compilation, authority, and memory-optimization invariants.
121
+ - `Lifecycle`: Added stop-as-complete-episode-reset semantics, a compact accent `state-flow` plus dim `#<iteration>` status, and complete pretty-formatted state JSON output from `/state-flow-status`.