pi-smart-compact 9.7.0 → 10.0.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 (211) hide show
  1. package/ARCHITECTURE.md +979 -372
  2. package/CHANGELOG.md +720 -0
  3. package/LICENSE +8 -0
  4. package/README.md +130 -640
  5. package/SECURITY.md +34 -12
  6. package/SUPPORT.md +26 -9
  7. package/assets/DejaVu-LICENSE.txt +187 -0
  8. package/assets/DejaVuSansMono.ttf +0 -0
  9. package/assets/README.md +26 -0
  10. package/assets/skills/context-management/SKILL.md +34 -0
  11. package/dist/app/anchor-cache.d.ts +36 -0
  12. package/dist/app/anchor-cache.d.ts.map +1 -0
  13. package/dist/app/artifact-storage.d.ts +47 -0
  14. package/dist/app/artifact-storage.d.ts.map +1 -0
  15. package/dist/app/background-preparation.d.ts +39 -0
  16. package/dist/app/background-preparation.d.ts.map +1 -0
  17. package/dist/app/compaction-commit-store.d.ts +5 -1
  18. package/dist/app/compaction-commit-store.d.ts.map +1 -1
  19. package/dist/app/context-evidence.d.ts +57 -0
  20. package/dist/app/context-evidence.d.ts.map +1 -0
  21. package/dist/app/context-guide.d.ts +3 -0
  22. package/dist/app/context-guide.d.ts.map +1 -0
  23. package/dist/app/context-operations.d.ts +106 -0
  24. package/dist/app/context-operations.d.ts.map +1 -0
  25. package/dist/app/effective-state.d.ts +23 -0
  26. package/dist/app/effective-state.d.ts.map +1 -0
  27. package/dist/app/extension-conflicts.d.ts +15 -0
  28. package/dist/app/extension-conflicts.d.ts.map +1 -0
  29. package/dist/app/global-settings-runtime.d.ts +3 -3
  30. package/dist/app/global-settings-runtime.d.ts.map +1 -1
  31. package/dist/app/hindsight-memory.d.ts +100 -0
  32. package/dist/app/hindsight-memory.d.ts.map +1 -0
  33. package/dist/app/host-cache-ledger.d.ts +68 -0
  34. package/dist/app/host-cache-ledger.d.ts.map +1 -0
  35. package/dist/app/lazy-tools.d.ts +36 -0
  36. package/dist/app/lazy-tools.d.ts.map +1 -0
  37. package/dist/app/memory-backend.d.ts +58 -0
  38. package/dist/app/memory-backend.d.ts.map +1 -0
  39. package/dist/app/mnemopi-memory.d.ts +13 -0
  40. package/dist/app/mnemopi-memory.d.ts.map +1 -0
  41. package/dist/app/mnemopi-protocol.d.ts +78 -0
  42. package/dist/app/mnemopi-protocol.d.ts.map +1 -0
  43. package/dist/app/mnemopi-worker.d.ts +2 -0
  44. package/dist/app/mnemopi-worker.d.ts.map +1 -0
  45. package/dist/app/model-feasibility.d.ts +20 -0
  46. package/dist/app/model-feasibility.d.ts.map +1 -0
  47. package/dist/app/native-compaction.d.ts +88 -0
  48. package/dist/app/native-compaction.d.ts.map +1 -0
  49. package/dist/app/native-continuity-bridge.d.ts.map +1 -1
  50. package/dist/app/navigation-data.d.ts +28 -0
  51. package/dist/app/navigation-data.d.ts.map +1 -0
  52. package/dist/app/navigation-types.d.ts +60 -0
  53. package/dist/app/navigation-types.d.ts.map +1 -0
  54. package/dist/app/pending-slot.d.ts +11 -1
  55. package/dist/app/pending-slot.d.ts.map +1 -1
  56. package/dist/app/preflight.d.ts.map +1 -1
  57. package/dist/app/register-context-tools.d.ts +16 -3
  58. package/dist/app/register-context-tools.d.ts.map +1 -1
  59. package/dist/app/register-navigation.d.ts +20 -0
  60. package/dist/app/register-navigation.d.ts.map +1 -0
  61. package/dist/app/register-smart-compact-command.d.ts +17 -2
  62. package/dist/app/register-smart-compact-command.d.ts.map +1 -1
  63. package/dist/app/register-smart-compact-tool.d.ts.map +1 -1
  64. package/dist/app/register-smart-context-tool.d.ts +55 -0
  65. package/dist/app/register-smart-context-tool.d.ts.map +1 -0
  66. package/dist/app/run-context.d.ts +4 -1
  67. package/dist/app/run-context.d.ts.map +1 -1
  68. package/dist/app/run-smart-compact.d.ts +3 -3
  69. package/dist/app/run-smart-compact.d.ts.map +1 -1
  70. package/dist/app/session-handoff.d.ts +64 -0
  71. package/dist/app/session-handoff.d.ts.map +1 -0
  72. package/dist/app/session-lineage.d.ts +17 -0
  73. package/dist/app/session-lineage.d.ts.map +1 -0
  74. package/dist/app/session-run-lock.d.ts +0 -2
  75. package/dist/app/session-run-lock.d.ts.map +1 -1
  76. package/dist/app/settled-auto-trigger.d.ts +2 -0
  77. package/dist/app/settled-auto-trigger.d.ts.map +1 -1
  78. package/dist/app/smart-compact-input.d.ts +1 -1
  79. package/dist/app/smart-compact-input.d.ts.map +1 -1
  80. package/dist/app/smart-compact-policy.d.ts +1 -1
  81. package/dist/app/smart-compact-policy.d.ts.map +1 -1
  82. package/dist/app/steps/extract.d.ts +45 -1
  83. package/dist/app/steps/extract.d.ts.map +1 -1
  84. package/dist/app/steps/metrics.d.ts +1 -0
  85. package/dist/app/steps/metrics.d.ts.map +1 -1
  86. package/dist/app/steps/persist.d.ts.map +1 -1
  87. package/dist/app/steps/prepare.d.ts.map +1 -1
  88. package/dist/app/steps/recover.d.ts +9 -0
  89. package/dist/app/steps/recover.d.ts.map +1 -1
  90. package/dist/app/steps/state.d.ts.map +1 -1
  91. package/dist/app/steps/synthesize.d.ts.map +1 -1
  92. package/dist/app/steps/tier.d.ts.map +1 -1
  93. package/dist/app/steps/verify.d.ts.map +1 -1
  94. package/dist/app/steps/visual.d.ts +4 -0
  95. package/dist/app/steps/visual.d.ts.map +1 -0
  96. package/dist/app/steps/window.d.ts.map +1 -1
  97. package/dist/app/tool-artifacts.d.ts +27 -0
  98. package/dist/app/tool-artifacts.d.ts.map +1 -0
  99. package/dist/app/visual-archive.d.ts +29 -0
  100. package/dist/app/visual-archive.d.ts.map +1 -0
  101. package/dist/constants.d.ts +96 -1
  102. package/dist/constants.d.ts.map +1 -1
  103. package/dist/domain/compaction-usage.d.ts +16 -0
  104. package/dist/domain/compaction-usage.d.ts.map +1 -0
  105. package/dist/domain/model-capacity.d.ts +12 -0
  106. package/dist/domain/model-capacity.d.ts.map +1 -0
  107. package/dist/domain/provider-evaluation.d.ts +7 -0
  108. package/dist/domain/provider-evaluation.d.ts.map +1 -1
  109. package/dist/domain/telemetry.d.ts +43 -2
  110. package/dist/domain/telemetry.d.ts.map +1 -1
  111. package/dist/domain/tool-semantics.d.ts +23 -0
  112. package/dist/domain/tool-semantics.d.ts.map +1 -1
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/index.js +17298 -8331
  115. package/dist/infra/ai-messages.d.ts +1 -1
  116. package/dist/infra/ai-messages.d.ts.map +1 -1
  117. package/dist/infra/context-graph.d.ts +38 -7
  118. package/dist/infra/context-graph.d.ts.map +1 -1
  119. package/dist/infra/fs.d.ts.map +1 -1
  120. package/dist/infra/hindsight-client.d.ts +73 -0
  121. package/dist/infra/hindsight-client.d.ts.map +1 -0
  122. package/dist/infra/hindsight-receipts.d.ts +68 -0
  123. package/dist/infra/hindsight-receipts.d.ts.map +1 -0
  124. package/dist/infra/llm-client.d.ts +26 -23
  125. package/dist/infra/llm-client.d.ts.map +1 -1
  126. package/dist/infra/memory-ref.d.ts +27 -0
  127. package/dist/infra/memory-ref.d.ts.map +1 -0
  128. package/dist/infra/native-protocol.d.ts +54 -0
  129. package/dist/infra/native-protocol.d.ts.map +1 -0
  130. package/dist/infra/optional-components.d.ts +15 -0
  131. package/dist/infra/optional-components.d.ts.map +1 -0
  132. package/dist/infra/paths.d.ts +2 -0
  133. package/dist/infra/paths.d.ts.map +1 -1
  134. package/dist/infra/services.d.ts +15 -5
  135. package/dist/infra/services.d.ts.map +1 -1
  136. package/dist/infra/visual-renderer.d.ts +16 -0
  137. package/dist/infra/visual-renderer.d.ts.map +1 -0
  138. package/dist/mnemopi-worker.js +213 -0
  139. package/dist/phases/explore.d.ts +12 -9
  140. package/dist/phases/explore.d.ts.map +1 -1
  141. package/dist/phases/synthesize.d.ts +18 -3
  142. package/dist/phases/synthesize.d.ts.map +1 -1
  143. package/dist/phases/verify.d.ts +20 -2
  144. package/dist/phases/verify.d.ts.map +1 -1
  145. package/dist/rtk.d.ts +7 -0
  146. package/dist/rtk.d.ts.map +1 -0
  147. package/dist/rtk.js +767 -0
  148. package/dist/types.d.ts +128 -4
  149. package/dist/types.d.ts.map +1 -1
  150. package/dist/ui/dashboard-format.d.ts +2 -1
  151. package/dist/ui/dashboard-format.d.ts.map +1 -1
  152. package/dist/ui/dashboard-insights.d.ts +9 -1
  153. package/dist/ui/dashboard-insights.d.ts.map +1 -1
  154. package/dist/ui/error-format.d.ts +7 -2
  155. package/dist/ui/error-format.d.ts.map +1 -1
  156. package/dist/ui/handoff-overlay.d.ts +26 -0
  157. package/dist/ui/handoff-overlay.d.ts.map +1 -0
  158. package/dist/ui/home-overlay.d.ts +54 -0
  159. package/dist/ui/home-overlay.d.ts.map +1 -0
  160. package/dist/ui/metrics-dashboard-overlay.d.ts.map +1 -1
  161. package/dist/ui/metrics-report.d.ts.map +1 -1
  162. package/dist/ui/navigation-overlay.d.ts +92 -0
  163. package/dist/ui/navigation-overlay.d.ts.map +1 -0
  164. package/dist/ui/overlays.d.ts +12 -2
  165. package/dist/ui/overlays.d.ts.map +1 -1
  166. package/dist/ui/profiles.d.ts +51 -0
  167. package/dist/ui/profiles.d.ts.map +1 -0
  168. package/dist/ui/settings-complex.d.ts +49 -3
  169. package/dist/ui/settings-complex.d.ts.map +1 -1
  170. package/dist/ui/settings-list.d.ts +28 -0
  171. package/dist/ui/settings-list.d.ts.map +1 -0
  172. package/dist/ui/settings-overlay.d.ts +13 -6
  173. package/dist/ui/settings-overlay.d.ts.map +1 -1
  174. package/dist/ui/storage-report.d.ts +4 -0
  175. package/dist/ui/storage-report.d.ts.map +1 -0
  176. package/dist/utils/backups.d.ts.map +1 -1
  177. package/dist/utils/cache.d.ts +6 -2
  178. package/dist/utils/cache.d.ts.map +1 -1
  179. package/dist/utils/config.d.ts +12 -0
  180. package/dist/utils/config.d.ts.map +1 -1
  181. package/dist/utils/extraction.d.ts +7 -0
  182. package/dist/utils/extraction.d.ts.map +1 -1
  183. package/dist/utils/helpers.d.ts.map +1 -1
  184. package/dist/utils/id-fingerprint.d.ts +3 -1
  185. package/dist/utils/id-fingerprint.d.ts.map +1 -1
  186. package/dist/utils/issues.d.ts +61 -0
  187. package/dist/utils/issues.d.ts.map +1 -0
  188. package/dist/utils/pruning.d.ts.map +1 -1
  189. package/dist/utils/session-log.d.ts +0 -2
  190. package/dist/utils/session-log.d.ts.map +1 -1
  191. package/dist/utils/state.d.ts +21 -2
  192. package/dist/utils/state.d.ts.map +1 -1
  193. package/dist/utils/tokens.d.ts +10 -2
  194. package/dist/utils/tokens.d.ts.map +1 -1
  195. package/docs/MIGRATING_TO_V8.md +7 -1
  196. package/docs/README.md +69 -0
  197. package/docs/RELEASE.md +174 -56
  198. package/docs/assets/banner.png +0 -0
  199. package/docs/assets/banner.svg +1158 -70
  200. package/docs/assets/pi-smart-compact.png +0 -0
  201. package/docs/assets/pi-smart-compact.svg +24 -0
  202. package/docs/configuration.md +637 -0
  203. package/docs/evaluation.md +409 -0
  204. package/docs/guide.md +879 -0
  205. package/docs/hindsight-memory.md +314 -0
  206. package/docs/identity.md +124 -0
  207. package/package.json +44 -11
  208. package/dist/provider-eval.js +0 -2107
  209. package/dist/provider-scenario-eval.js +0 -2884
  210. package/dist/telemetry-report.js +0 -1958
  211. package/docs/provider-evaluation-2026-08-06.md +0 -63
@@ -5,6 +5,16 @@ import type { LlmMessage, ProviderCapabilities } from "../types.ts";
5
5
  export declare function getProviderCaps(provider: string): ProviderCapabilities;
6
6
  /** Finite context usage percentage; invalid/unknown window metadata is 0%. */
7
7
  export declare function safeContextPercent(totalTokens: number | null | undefined, contextWindow: number | null | undefined): number;
8
+ /**
9
+ * Window for automatic trigger/preparation percentages: maxContextTokens when
10
+ * set (>0) and below a valid model window, else the model window unchanged.
11
+ * Hard headroom checks must keep using model.contextWindow.
12
+ */
13
+ export declare function effectiveContextWindow(model: {
14
+ contextWindow: number;
15
+ } | undefined, config: {
16
+ maxContextTokens?: number;
17
+ }): number | undefined;
8
18
  /**
9
19
  * Bounded per-(provider,model) calibration factors smoothed by EMA.
10
20
  * Provider/model tokenization is process-wide knowledge rather than session
@@ -20,8 +30,6 @@ export declare class TokenCalibrationStore {
20
30
  calibrate(estimated: number, actual: number, provider?: string, model?: string): void;
21
31
  size(): number;
22
32
  }
23
- /** @internal Test-only reset; do not call from production code. */
24
- export declare function __resetTokenCalibrationForTests(): void;
25
33
  export declare function estimateTokens(text: string, provider?: string, model?: string, calibration?: TokenCalibrationStore): number;
26
34
  export declare function calibrateFromResponse(estimated: number, actual: number, provider?: string, model?: string, calibration?: TokenCalibrationStore): void;
27
35
  export interface TokenEstimator {
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/utils/tokens.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAkGpE,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,CAQtE;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAI3H;AAED;;;;;GAKG;AACH,qBAAa,qBAAqB;IAGpB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAFvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IAErD,YAA6B,UAAU,SAAM,EAAI;IAEjD,KAAK,IAAI,IAAI,CAA0B;IAEvC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ7C;IAED,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAUpF;IAED,IAAI,IAAI,MAAM,CAA8B;CAC7C;AAQD,mEAAmE;AACnE,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;A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AAM,GAAG,SAAS,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC;CACzH;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,CAAC,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,EACd,WAAW,GAAE,qBAA4C,GACxD,cAAc,CAehB"}
@@ -1,5 +1,10 @@
1
1
  # Migrating from v7 to v8
2
2
 
3
+ > **Scope:** Historical migration note for upgrading from v7 to v8 (8.0.8). Versions, host baselines and settings reflect that release, not the current package; current behavior is in the guide and configuration reference.
4
+ > Current documentation for Pi Continuity (the `pi-smart-compact` package):
5
+ > [guide](./guide.md) · [configuration](./configuration.md) ·
6
+ > [evaluation](./evaluation.md) · [documentation index](./README.md).
7
+
3
8
  This guide applies to the stable `8.0.8` release.
4
9
 
5
10
  ## Compatibility
@@ -96,7 +101,8 @@ All defaults preserve the selected model and require no migration edits.
96
101
  | `summaryModel` | `null` | Explicit Synthesis route; selected model when null |
97
102
  | `verificationModel` | `null` | Explicit repair route; summary/selected model when null |
98
103
 
99
- See the README configuration table for budgets and monitoring options.
104
+ For current budgets and monitoring options, see the [configuration
105
+ reference](./configuration.md); the defaults above describe v8.
100
106
 
101
107
  ## Backups and rollout
102
108
 
package/docs/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # Pi Continuity documentation
2
+
3
+ [Project overview](../README.md) · [User guide](./guide.md) · [Configuration](./configuration.md)
4
+
5
+ Pi Continuity is the product name; `pi-smart-compact` remains the package,
6
+ command family and repository. [Identity and naming](./identity.md).
7
+
8
+ These guides follow the **current source checkout**, including unreleased work.
9
+ Compare your installed version with the [changelog](../CHANGELOG.md). Dated
10
+ reports describe their own revisions, not necessarily today's behavior.
11
+
12
+ ## Start with your task
13
+
14
+ | I want to… | Read |
15
+ | --- | --- |
16
+ | Install and choose how the extension runs | [Get started](../README.md#get-started) |
17
+ | Clean up output, compact or recover evidence | [User guide](./guide.md) |
18
+ | Use anchors or move work to a fresh session | [Session navigation and handoff](./guide.md#session-navigation) |
19
+ | Understand a setting, trigger, model route or budget | [Configuration reference](./configuration.md) |
20
+ | Choose where project memory lives | [Memory stores](./guide.md#memory-store-memorybackend) |
21
+ | Connect an existing Hindsight server | [Hindsight setup and privacy](./hindsight-memory.md) |
22
+ | Diagnose unexpected behavior | [Troubleshooting](./guide.md#troubleshooting) · [Support](../SUPPORT.md) |
23
+ | Report sensitive information privately | [Security policy](../SECURITY.md) |
24
+
25
+ ## Understand or contribute
26
+
27
+ | Document | Scope |
28
+ | --- | --- |
29
+ | [Architecture](../ARCHITECTURE.md) | Ownership, preservation rules, apply boundaries and module responsibilities. |
30
+ | [Evaluation](./evaluation.md) | Available checks and experiments; what quality, cost and timing evidence can establish. |
31
+ | [Contributing](https://github.com/alpertarhan/pi-smart-compact/blob/main/CONTRIBUTING.md) | Development setup, repository map and pull-request expectations. |
32
+ | [Release checklist](./RELEASE.md) | Package validation, compatibility and publication gates. |
33
+ | [Identity and assets](./identity.md) | Product naming, logo sources, palette and reproducible image exports. |
34
+ | [Changelog](../CHANGELOG.md) | Versioned changes and unpublished work. |
35
+
36
+ ## Keep these concepts separate
37
+
38
+ | Concept | Purpose | Not a substitute for… |
39
+ | --- | --- | --- |
40
+ | **Context hygiene** | Reduce active tool-output noise while keeping eligible evidence retrievable. Local cleanup needs no summary-model call. | A new conversation summary. |
41
+ | **Session continuity** | Carry constraints, decisions, failures and next steps through research, compaction and reload. | Filesystem rollback or a complete copy of the original history. |
42
+ | **Project memory** | Recall scoped facts through one selected backend; explicit saves require confirmation. The local graph can also index derived compaction state. | Backups, output archives or automatic transcript upload. |
43
+
44
+ The [storage guide](./guide.md#storage-and-privacy) explains where each kind of
45
+ state lives and how long it is retained.
46
+
47
+ ## Historical evidence
48
+
49
+ Reports are preserved as dated evidence. Their measurements, revision limits and
50
+ warnings remain part of the record; they are not current setup instructions.
51
+
52
+ - [Pilot and research reports on GitHub](https://github.com/alpertarhan/pi-smart-compact/tree/main/docs/reports):
53
+ context hygiene, AgentSession lifecycle, visual evidence, Hindsight/native
54
+ compaction research and the earlier provider baseline. The
55
+ [evaluation guide](./evaluation.md#pilots-and-dated-reports) explains each scope.
56
+ - [Review findings on GitHub](https://github.com/alpertarhan/pi-smart-compact/blob/main/docs/findings/README.md):
57
+ the index of external-model and agent-harness audits, organized by reviewer
58
+ and date. Findings are advisory, not a release gate or product guarantee.
59
+ - [v7 → v8 migration](./MIGRATING_TO_V8.md): instructions for that historical
60
+ transition, **not** the current installation baseline.
61
+
62
+ `docs/reports/` and `docs/findings/` are repository-only and excluded from npm.
63
+ Links to those archives deliberately open GitHub, so this index also works from
64
+ an installed package. User guides and brand assets ship with the package;
65
+ developer source, tests and evaluation scripts do not.
66
+
67
+ A green scripted pilot does not establish live-model fidelity, billed savings
68
+ or production readiness. Use the [evaluation limits](./evaluation.md) and
69
+ [release checklist](./RELEASE.md) before making those claims.
package/docs/RELEASE.md CHANGED
@@ -1,21 +1,48 @@
1
1
  # Release checklist
2
2
 
3
- Use this checklist before publishing `pi-smart-compact`.
4
-
5
- > **Stop condition:** validation, packing, and isolated installation are safe.
6
- > `npm publish`, Git tags, GitHub releases, and deployment require separate
7
- > explicit approval. The automated checks never perform them.
3
+ Use this checklist before publishing Pi Continuity as the npm package
4
+ `pi-smart-compact`. The package name, command, tool names and configuration
5
+ key do not change with the documentation brand.
6
+
7
+ > **Approval boundary:** validation, packing and isolated installation do not
8
+ > publish anything. Creating a published GitHub release is the explicit
9
+ > approval that starts npm publication through Trusted Publishing. Use a draft
10
+ > release for preparation; ordinary commits, tags and pull-request CI do not
11
+ > publish packages.
12
+
13
+ Evidence classes and their limits are defined in
14
+ [evaluation](./evaluation.md#offline-and-live-evidence). Keep the unpublished
15
+ checkout version and the version currently on npm distinct in every note.
16
+ Toolchain prerequisites (Bun pin, Node with npm, ripgrep) are listed at the top
17
+ of [evaluation](./evaluation.md); `release:audit` also needs network access for
18
+ package installation.
8
19
 
9
20
  ## 1. Prepare the candidate
10
21
 
11
- - [ ] Choose a SemVer version. Use a prerelease such as `8.0.0-rc.4` until the
12
- stable/canary gates pass.
13
- - [ ] Update `package.json`; run `bun run sync-version` for `src/constants.ts`.
22
+ - [ ] Use a distinct prerelease until the stable/canary gates pass, unless the
23
+ release owner explicitly approves a version-specific stable exception.
24
+ Record any exception and missing evidence in the release notes; it is
25
+ not a `PROMOTE` result. Stamp `package.json` and run
26
+ `bun run sync-version` before packing.
14
27
  - [ ] Move shipped notes from `[Unreleased]` into the dated version in
15
- `CHANGELOG.md`.
16
- - [ ] Update README, architecture, and migration notes for behavior/config
17
- changes.
18
- - [ ] Confirm Pi and TypeBox remain wildcard peer dependencies (`"*"`).
28
+ `CHANGELOG.md`; never word a candidate entry as if the final release
29
+ check or canary promotion already passed.
30
+ - [ ] Update the guide, configuration, evaluation, architecture and migration
31
+ notes for behavior/config changes. Dated reports (`docs/reports/`) stay
32
+ historical and are not packed; add a new report or addendum instead of
33
+ rewriting them.
34
+ - [ ] On a major version change, update the supported-versions row in
35
+ `SECURITY.md`; `release:audit` requires it to read ``Latest `<major>.x` ``.
36
+ - [ ] For Claude subscription routes, pair the fresh candidate with the exact
37
+ `pi-claude-oauth-adapter` build used in the proofs (published `0.2.2`
38
+ plus the final-payload patch, [upstream PR #10](https://github.com/minzique/pi-claude-oauth-adapter/pull/10),
39
+ until it is released) and record
40
+ the paired archive paths and hashes at final packaging — do not
41
+ reconstruct them from memory. pi-toolkit's auto-context must not be
42
+ loaded with the candidate.
43
+ - [ ] Confirm Pi remains a host peer (`">=0.87.1"`) and TypeBox a wildcard peer (`"*"`); neither is bundled.
44
+ - [ ] Confirm the visual renderer remains optional/external and the font plus its license ship in `assets/`, together with the on-demand context guide `assets/skills/context-management/SKILL.md`. Verify default Node loading without the optional addon and a real PNG render where supported.
45
+ - [ ] Confirm Mnemopi stays an optional external engine with TypeBox external in its worker, and that `bun`, `@oh-my-pi/pi-mnemopi` and `@resvg/resvg-js` remain optional peers pinned to `OPTIONAL_COMPONENTS` (never `optionalDependencies`). Verify a plain install pulls none of them in, the failure names the install command for the install root, the installed Node-host worker runs on the user-installed `bun` component under a Pi-style npm root with no Bun on `PATH`, and the fail-closed missing-engine and missing-Bun failures submit no memory request and create no store.
19
46
  - [ ] Confirm no secrets, local JSONL, SQLite data, backups, or generated
20
47
  credentials are tracked or packed.
21
48
 
@@ -26,22 +53,40 @@ bun install --frozen-lockfile
26
53
  bun run release:check
27
54
  ```
28
55
 
29
- `release:check` runs the expanded CI chain: source and scripts typechecking,
30
- all tests, the adversarial gate, build, and release audit. The audit verifies the
31
- packed manifest/version/peers, supported SECURITY major, package contents,
32
- isolated and frozen installs, extension/tool registration, Node SQLite, and
33
- packaged CLIs.
56
+ `release:check` runs the full local chain: source, scripts, test and bench
57
+ typechecking; all tests; the adversarial `gate`; the hot-path `bench`; build;
58
+ `release:audit`; and `compat:pi latest`. The audit verifies the packed
59
+ manifest/version/peers, supported SECURITY major, package contents
60
+ (runtime-only `dist`: exactly `index.js`, `rtk.js`, and `mnemopi-worker.js` plus
61
+ declarations), isolated and frozen installs, extension/tool registration, Node
62
+ SQLite, and the optional Mnemopi worker through real Node-host tools. It also
63
+ runs the installed worker under a Bun-free `PATH` on the user-installed
64
+ pinned `bun` component (installed with the command Readiness shows into a
65
+ Pi-style npm root, then kept across a Pi update) and checks the
66
+ install-command, missing-engine and missing-Bun negatives (no store, no
67
+ model/network request). Evaluation and report CLIs are source-checkout tools,
68
+ not packed: the audit runs `scripts/provider-eval.ts`,
69
+ `scripts/telemetry-report.ts`, and all four offline continuation/memory arms of
70
+ `scripts/task-eval.ts` under its isolated HOME; scripted transport is not
71
+ live quality evidence. The test suite covers storage durability with real
72
+ `SessionManager` artifacts aged past 20 days by timestamps — deterministic
73
+ aging, not a wall-clock soak — through actual reload and fork.
74
+
75
+ Run the full chain on the exact candidate. A green result from before any
76
+ later change, including UI or documentation edits, does not count. Pull-request
77
+ CI includes the adversarial gate, but latest-Pi compatibility runs only on a
78
+ schedule or manual dispatch, so a green CI badge does not replace this step.
34
79
 
35
80
  Then validate the host boundary in an isolated workspace:
36
81
 
37
82
  ```bash
38
- bun run compat:pi 0.84.0
83
+ bun run compat:pi 0.87.1
39
84
  bun run compat:pi latest
40
85
  bun audit
41
86
  ```
42
87
 
43
- The compatibility runner temporarily pins only its copied workspace; the source
44
- manifest must remain wildcard-only.
88
+ The compatibility runner temporarily pins only its copied workspace; source
89
+ peer ranges and minimum-version development pins must remain unchanged.
45
90
 
46
91
  ## 3. Inspect artifacts
47
92
 
@@ -49,18 +94,32 @@ manifest must remain wildcard-only.
49
94
  npm pack --dry-run
50
95
  bun run provider-eval --min-samples=5
51
96
  bun run telemetry-report --min-canary-runs=20
97
+ bun run task-eval --out=/tmp/psc-task-eval-new
52
98
  ```
53
99
 
54
100
  Check that:
55
101
 
56
- - [ ] packed files are limited to `dist`, `docs`, README, LICENSE, CHANGELOG,
57
- SECURITY, SUPPORT, ARCHITECTURE, and package metadata;
58
- - [ ] `dist/index.js`, declarations, and all three bundled CLIs are present;
59
- - [ ] the extension registers `smart_compact`, `smart_recall`, and
60
- `smart_save_memory` from the packed install;
102
+ - [ ] packed files are limited to `dist`, `docs` (without `docs/reports/` and
103
+ `docs/findings/`), `assets`, README, LICENSE, CHANGELOG, SECURITY,
104
+ SUPPORT, ARCHITECTURE, and package metadata; `release:audit` requires
105
+ `ARCHITECTURE.md`, `docs/RELEASE.md` and `docs/MIGRATING_TO_V8.md` and
106
+ rejects reports and findings;
107
+ - [ ] `dist` holds only `index.js`, `rtk.js`, `mnemopi-worker.js`, and
108
+ declarations — no evaluation/report CLI bundles;
109
+ - [ ] the extension registers `smart_compact`, `smart_context`,
110
+ `smart_recall`, and `smart_save_memory` from the packed install;
61
111
  - [ ] no provider route was selected automatically;
62
112
  - [ ] Data Confidence is honest (legacy evidence may keep it below 85).
63
113
 
114
+ The task evaluator defaults to real stock Pi sessions with offline scripted
115
+ transport and temporary memory stores. Live mode needs a fresh explicit
116
+ request/input/output budget and selected-provider credentials; it is not part
117
+ of `release:check`. Input estimates and output reservations are not invoices.
118
+ The SDK fetch guard is not a subprocess network/filesystem sandbox. Codex is
119
+ rejected unless explicitly selected as unbounded output; that exception never
120
+ satisfies a hard output-token budget. No provider-quality or savings claim
121
+ follows from a passing offline report.
122
+
64
123
  ## 4. Canary the RC
65
124
 
66
125
  After explicit approval to publish an RC, use the npm `next` tag rather than
@@ -75,51 +134,110 @@ After explicit approval to publish an RC, use the npm `next` tag rather than
75
134
  ```
76
135
 
77
136
  Keep all stage model routes null unless a separate routing decision is approved.
78
- Collect at least 20 non-dry, host-confirmed **applied** schema-v2 canary runs,
79
- ≥70% verifier-quality coverage, and ≥70% run-correlated damage-observation
80
- coverage in both stable and canary cohorts. Inspect the report's total/applied
81
- counts: dry runs and staged-but-unapplied runs are not promotion evidence.
82
- Missing observations are missing evidence, never clean runs. A deterministic
83
- green release check never implies `PROMOTE`. Promotion requires:
137
+ Collect at least 20 non-dry, host-confirmed **applied** schema-v2 canary runs
138
+ of the candidate version, a stable baseline of at least 20 applied runs,
139
+ ≥70% verifier-quality coverage and ≥70% run-correlated damage-observation
140
+ coverage **in both stable and canary cohorts**, and canary data confidence ≥85.
141
+ Inspect the report's total/attempted/applied counts: dry runs, staged-but-
142
+ unapplied runs, voluntary user cancellations, and discarded speculative
143
+ preparations are not promotion evidence (cancellations are neutral — real
144
+ timeouts and provider failures still count). Every metrics entry must carry an
145
+ explicit `releaseChannel`; entries without one are excluded from both cohorts
146
+ and surfaced in the report, never silently pooled as stable. Missing
147
+ observations are missing evidence, never clean runs. A deterministic green
148
+ release check never implies `PROMOTE`. Promotion requires:
84
149
 
85
150
  - [ ] `telemetry-report` says `PROMOTE`;
151
+ - [ ] canary data confidence is ≥85 (report `HOLD` at 82 is a hold, not a pass);
86
152
  - [ ] dashboard Data Confidence is ≥85;
87
153
  - [ ] canary success is ≥95% and absolute verifier quality is ≥85;
88
- - [ ] failure rate did not rise by ≥5pp to at least 10%;
89
- - [ ] verifier quality did not fall by 5 points;
90
- - [ ] p95 duration and average tokens did not rise by 50%;
91
- - [ ] fallback and damage rates did not rise by 10pp;
154
+ - [ ] both cohorts have ≥70% quality and damage-observation coverage;
155
+ - [ ] canary failure rate is at most 5% and not 5pp or more above stable;
156
+ - [ ] verifier quality did not fall by 5 points or more;
157
+ - [ ] p95 duration and average tokens did not rise by 50% or more;
158
+ - [ ] fallback and damage rates did not rise by 10pp or more;
92
159
  - [ ] no unresolved security, data-loss, cross-session, or cancellation issue.
93
160
 
94
- A `ROLLBACK` result blocks promotion. `HOLD` means collect evidence or fix data
95
- coverage; it is not a pass.
96
-
97
- ## 5. Publish — explicit approval required
161
+ The report evaluates rollback triggers once the canary has at least three
162
+ attempted runs; exact rules are in
163
+ [evaluation](./evaluation.md#decision-rules).
98
164
 
99
- Only after the user/release owner explicitly approves:
165
+ The preparation-policy block (prepared/used/discarded, discard reasons,
166
+ time-to-ready, reuse rate, discarded spend) is measurement only: thresholds,
167
+ TTLs, and cooldowns stay manual policy decisions. Route reports keep the
168
+ input/cache-read/cache-write/output split, mark estimated usage, and label
169
+ subscription (OAuth) routes — never price subscription usage at API rates or
170
+ strip cached tokens from quota.
100
171
 
101
- ```bash
102
- # RC
103
- npm publish --tag next
172
+ A `ROLLBACK` result blocks promotion. `HOLD` means collect evidence or fix data
173
+ coverage; it is not a pass. Promotion authority remains manual. A release-owner
174
+ exception must name its version and evidence limits; it does not turn missing
175
+ evidence into a passing gate.
104
176
 
105
- # Stable, after canary approval and a stable SemVer bump
106
- npm publish
107
- ```
177
+ ## 5. Publish — explicit approval required
108
178
 
109
- `prepublishOnly` reruns `release:check`; it does not bypass any gate.
179
+ ### One-time npm Trusted Publisher setup
180
+
181
+ In the npm package settings for `pi-smart-compact`, add a **GitHub Actions**
182
+ trusted publisher with these exact values:
183
+
184
+ | Field | Value |
185
+ | --- | --- |
186
+ | Organization or user | `alpertarhan` |
187
+ | Repository | `pi-smart-compact` |
188
+ | Workflow filename | `publish.yml` (not `.github/workflows/publish.yml`) |
189
+ | Environment | Leave empty; the workflow does not use an environment |
190
+ | Publish permission | Allow direct `npm publish`, not only `npm stage publish` |
191
+
192
+ The current npm default can permit staging only. Direct publication must be
193
+ enabled to avoid a manual approval for every package. npm does not verify these
194
+ fields when saving; the first successful workflow publication proves the link.
195
+ See [npm Trusted Publishing](https://docs.npmjs.com/trusted-publishers/).
196
+
197
+ No `NPM_TOKEN` or `NODE_AUTH_TOKEN` secret is needed.
198
+ [`publish.yml`](https://github.com/alpertarhan/pi-smart-compact/blob/main/.github/workflows/publish.yml)
199
+ uses a GitHub-hosted runner, `id-token: write`, Node 26.10.0, npm 11.19.1 and
200
+ the Bun version pinned in `package.json`. npm obtains short-lived OIDC
201
+ credentials and automatically attaches provenance for this public repository.
202
+ Keep these versions and the workflow filename aligned when changing tooling.
203
+
204
+ ### Release an approved version
205
+
206
+ 1. Merge the version, generated `VERSION`, changelog and release documentation
207
+ through a PR into `main`, with required CI passing. Complete the checks above.
208
+ 2. Create a GitHub release at that exact `main` commit with tag `v<version>`,
209
+ matching `package.json`. Include upgrade notes and the actual validation
210
+ evidence; document any explicitly approved canary exception.
211
+ 3. For a SemVer prerelease, mark the GitHub release **pre-release**. For a stable
212
+ version, leave that flag off. Publish the release, not just its tag.
213
+ 4. Follow **Actions → Publish to npm**. The workflow rejects tags that do not
214
+ match the package version, mismatched prerelease flags and commits outside
215
+ `main`. Prereleases publish to npm `next`; stable versions publish to `latest`.
216
+
217
+ The workflow checks minimum-Pi compatibility and dependency advisories, then
218
+ calls `npm publish`. Its existing `prepublishOnly` hook runs the full
219
+ `release:check`, including the packed install audit and latest-Pi compatibility,
220
+ before uploading. It never uses `--ignore-scripts` to bypass these gates.
221
+
222
+ If the first run fails authentication, check the exact owner/repository/workflow
223
+ fields, the empty environment and direct-publish permission on npm. After fixing
224
+ the configuration, rerun the failed Actions job; do not publish manually to
225
+ mask a broken OIDC setup. Once a version is published, it is immutable: a new
226
+ package change needs a new version, not a republish or a moved release tag.
110
227
 
111
228
  ## 6. After publishing
112
229
 
113
- 1. Verify npm package contents and integrity.
114
- 2. Create the matching Git tag and GitHub release with migration/compatibility
115
- notes.
116
- 3. Install through Pi in a clean profile:
230
+ 1. Confirm **Publish to npm** completed successfully. A published GitHub release
231
+ alone does not prove the package reached npm.
232
+ 2. Check the registry version, dist-tag, integrity and provenance:
117
233
 
118
234
  ```bash
119
- pi install npm:pi-smart-compact@next # RC
120
- # or npm:pi-smart-compact for stable
235
+ VERSION=$(node -p 'require("./package.json").version')
236
+ npm view "pi-smart-compact@$VERSION" version dist.integrity dist.attestations --json
237
+ npm view pi-smart-compact dist-tags --json
121
238
  ```
122
239
 
123
- 4. Re-run tool registration, one manual compaction, Smart Recall, and the local
124
- dashboard.
125
- 5. Keep canary monitoring active through the agreed observation window.
240
+ 3. Install the exact version through Pi in a clean profile, then re-run tool
241
+ registration, one manual compaction, Smart Recall and the local dashboard.
242
+ 4. Keep canary monitoring active through the agreed observation window;
243
+ successful publication is not production-quality evidence.
Binary file