pi-smart-compact 8.0.5 → 8.0.7

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 (51) hide show
  1. package/ARCHITECTURE.md +513 -0
  2. package/CHANGELOG.md +29 -0
  3. package/README.md +99 -68
  4. package/SECURITY.md +8 -3
  5. package/dist/app/mode-policy.d.ts +0 -1
  6. package/dist/app/mode-policy.d.ts.map +1 -1
  7. package/dist/app/preflight.d.ts +16 -2
  8. package/dist/app/preflight.d.ts.map +1 -1
  9. package/dist/app/run-smart-compact.d.ts.map +1 -1
  10. package/dist/app/steps/extract.d.ts.map +1 -1
  11. package/dist/app/steps/state.d.ts.map +1 -1
  12. package/dist/app/steps/synthesize.d.ts.map +1 -1
  13. package/dist/app/steps/verify.d.ts.map +1 -1
  14. package/dist/app/steps/window.d.ts +3 -1
  15. package/dist/app/steps/window.d.ts.map +1 -1
  16. package/dist/constants.d.ts +18 -1
  17. package/dist/constants.d.ts.map +1 -1
  18. package/dist/domain/telemetry.d.ts +3 -0
  19. package/dist/domain/telemetry.d.ts.map +1 -1
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +969 -652
  22. package/dist/infra/context-graph.d.ts.map +1 -1
  23. package/dist/infra/fs.d.ts +1 -1
  24. package/dist/infra/fs.d.ts.map +1 -1
  25. package/dist/infra/git.d.ts.map +1 -1
  26. package/dist/infra/session-identity.d.ts +4 -0
  27. package/dist/infra/session-identity.d.ts.map +1 -1
  28. package/dist/phases/verify.d.ts.map +1 -1
  29. package/dist/provider-eval.js +113 -22
  30. package/dist/provider-scenario-eval.js +151 -108
  31. package/dist/telemetry-report.js +138 -41
  32. package/dist/types.d.ts +3 -2
  33. package/dist/types.d.ts.map +1 -1
  34. package/dist/ui/dashboard-insights.d.ts.map +1 -1
  35. package/dist/ui/overlays.d.ts +1 -1
  36. package/dist/ui/overlays.d.ts.map +1 -1
  37. package/dist/utils/cache.d.ts.map +1 -1
  38. package/dist/utils/extraction.d.ts +5 -0
  39. package/dist/utils/extraction.d.ts.map +1 -1
  40. package/dist/utils/fingerprint.d.ts +1 -1
  41. package/dist/utils/fingerprint.d.ts.map +1 -1
  42. package/dist/utils/helpers.d.ts.map +1 -1
  43. package/dist/utils/pruning.d.ts.map +1 -1
  44. package/dist/utils/state.d.ts +4 -3
  45. package/dist/utils/state.d.ts.map +1 -1
  46. package/dist/utils/tokens.d.ts.map +1 -1
  47. package/docs/MIGRATING_TO_V8.md +32 -14
  48. package/docs/RELEASE.md +13 -10
  49. package/package.json +2 -1
  50. package/dist/app/explore-wrap.d.ts +0 -8
  51. package/dist/app/explore-wrap.d.ts.map +0 -1
@@ -1,6 +1,6 @@
1
1
  # Migrating from v7 to v8
2
2
 
3
- This guide applies to the stable `8.0.5` release.
3
+ This guide applies to the stable `8.0.7` release.
4
4
 
5
5
  ## Compatibility
6
6
 
@@ -33,10 +33,19 @@ source-search output persisted as unresolved work; the next confirmed save persi
33
33
  the sanitized state. v8.0.3 keeps the same graph file and transparently opens it
34
34
  with `node:sqlite` under Pi or `bun:sqlite` in Bun tooling. v8.0.4 changes only
35
35
  compaction planning, UX, and privacy-safe operational metrics; v8.0.5 bounds
36
- user-facing failure diagnostics. Neither requires a state or database migration.
37
-
38
- Facts remain conservative: absence from a new window is not deletion. A fact is
39
- removed only by an explicit resolved/superseded override.
36
+ user-facing failure diagnostics; v8.0.6 streamlines the three-mode decision card
37
+ and live progress brief. v8.0.7 reserves post-summary planning headroom,
38
+ sanitizes known transient diagnostics, bounds active continuity before resolved
39
+ history, and introduces branch-occurrence context-graph schema v1. On first graph
40
+ open, user-confirmed manual memories remain; older derived compaction nodes are
41
+ reset and repopulate from later apply-confirmed compactions.
42
+
43
+ Facts remain conservative across follow-ups and free-form goal changes: bounded
44
+ absence or new wording is never resolution. Goal shifts are retained as
45
+ `Previous goal` context; errors and loops retire only through positive resolution
46
+ evidence or an explicit override. Newer successful file access/mutation/delete
47
+ evidence still resolves contradictory file status. State and graph resolution use
48
+ the complete host-visible branch ancestry, not a truncated lineage or siblings.
40
49
 
41
50
  ### Persistent context graph
42
51
 
@@ -46,11 +55,14 @@ Applied, verified compactions are indexed into:
46
55
  ~/.pi/agent/.cache/smart-compact/context-graph.sqlite
47
56
  ```
48
57
 
49
- The database is local, project-partitioned, mode `0600` where supported, and
50
- bounded to 2,000 non-structural fact nodes per project. Apply-confirmed state is
51
- queued for the next event-loop turn so SQLite indexing is not part of the
52
- native compaction hook's latency. It enables
53
- `smart_recall` and confirmation-gated `smart_save_memory`. Set
58
+ The database is local, project-partitioned, mode `0600`, and bounded to 2,000
59
+ non-structural fact nodes per project. Private artifact directories are 0700 and
60
+ files are 0600. Apply-confirmed state is queued for the next event-loop turn so
61
+ SQLite indexing is not part of the native compaction hook's latency. It enables
62
+ `smart_recall` and confirmation-gated `smart_save_memory`. Memory writes fail
63
+ closed when the working directory is exactly `HOME` or the filesystem root; the
64
+ interactive prompt shows the complete scrubbed memory and paths. A project may
65
+ hold at most 500 active manual memories. Set
54
66
  `contextGraphEnabled` to `false` before first use to disable indexing and both
55
67
  tools. Disabling does not delete an existing database.
56
68
 
@@ -65,7 +77,9 @@ Consequently Data Confidence may start below 85 and rise as complete v8 runs
65
77
  replace legacy evidence.
66
78
 
67
79
  `telemetryChannel` defaults to `stable`. Use `canary` only on an externally
68
- selected canary installation; the extension reports Hold/Rollback/Promote but
80
+ selected canary installation. Reports show total/applied runs, and only non-dry,
81
+ host-confirmed applied outcomes count toward promotion; deterministic green
82
+ checks do not imply `PROMOTE`. The extension reports Hold/Rollback/Promote but
69
83
  never deploys, edits configuration, or rolls itself back.
70
84
 
71
85
  ## New optional settings
@@ -75,7 +89,7 @@ All defaults preserve the selected model and require no migration edits.
75
89
  | Key | Default | Purpose |
76
90
  |---|---|---|
77
91
  | `mode` | `auto` | Pressure/risk-aware execution policy |
78
- | `zeroCallEnabled` | `true` | Deterministic Fast/Aggressive synthesis when confidence is high |
92
+ | `zeroCallEnabled` | `true` | Deterministic Fast synthesis when confidence is high |
79
93
  | `contextGraphEnabled` | `true` | Local scoped graph and memory tools |
80
94
  | `telemetryChannel` | `stable` | Stable/canary metric tag |
81
95
  | `segmentationModel` | `null` | Explicit Explore route; selected model when null |
@@ -84,10 +98,14 @@ All defaults preserve the selected model and require no migration edits.
84
98
 
85
99
  See the README configuration table for budgets and monitoring options.
86
100
 
87
- ## Recommended rollout
101
+ ## Backups and rollout
102
+
103
+ v8.0.7 backs up the complete selected pre-prune conversation after configured
104
+ scrubbing, using 0600 files in a 0700 directory. Retention only prunes
105
+ marker-owned backups.
88
106
 
89
107
  1. Back up `~/.pi/agent/settings.json` and the Smart Compact cache directory.
90
- 2. Install the exact stable version: `pi install npm:pi-smart-compact@8.0.5`.
108
+ 2. Install the exact stable version: `pi install npm:pi-smart-compact@8.0.7`.
91
109
  3. Leave all model routes null initially.
92
110
  4. Keep `telemetryChannel: "stable"` unless intentionally running a separate
93
111
  canary cohort.
package/docs/RELEASE.md CHANGED
@@ -26,10 +26,11 @@ bun install --frozen-lockfile
26
26
  bun run release:check
27
27
  ```
28
28
 
29
- `release:check` performs source + script typechecking, all tests, the adversarial
30
- EESV gate, the multi-entry build, package allowlist/denylist checks, a packed
31
- manifest/version/peer audit, an isolated install, a second frozen-lockfile
32
- install, extension/tool registration smoke, and packaged CLI smoke tests.
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.
33
34
 
34
35
  Then validate the host boundary in an isolated workspace:
35
36
 
@@ -52,8 +53,8 @@ bun run telemetry-report --min-canary-runs=20
52
53
 
53
54
  Check that:
54
55
 
55
- - [ ] packed files are limited to `dist`, `docs`, README/license/support files,
56
- and package metadata;
56
+ - [ ] packed files are limited to `dist`, `docs`, README, LICENSE, CHANGELOG,
57
+ SECURITY, SUPPORT, ARCHITECTURE, and package metadata;
57
58
  - [ ] `dist/index.js`, declarations, and all three bundled CLIs are present;
58
59
  - [ ] the extension registers `smart_compact`, `smart_recall`, and
59
60
  `smart_save_memory` from the packed install;
@@ -74,10 +75,12 @@ After explicit approval to publish an RC, use the npm `next` tag rather than
74
75
  ```
75
76
 
76
77
  Keep all stage model routes null unless a separate routing decision is approved.
77
- Collect at least 20 schema-v2 canary runs, ≥70% verifier-quality coverage, and
78
- ≥70% run-correlated damage-observation coverage in both stable and canary
79
- cohorts. Missing observations are missing evidence, never clean runs.
80
- Promotion requires:
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:
81
84
 
82
85
  - [ ] `telemetry-report` says `PROMOTE`;
83
86
  - [ ] dashboard Data Confidence is ≥85;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-smart-compact",
3
- "version": "8.0.5",
3
+ "version": "8.0.7",
4
4
  "description": "Verification-oriented smart compaction extension for Pi Coding Agent — deterministic extraction, exploration, synthesis, verification, metrics, and safety checks.",
5
5
  "packageManager": "bun@1.3.14",
6
6
  "engines": {
@@ -40,6 +40,7 @@
40
40
  "dist",
41
41
  "docs",
42
42
  "README.md",
43
+ "ARCHITECTURE.md",
43
44
  "LICENSE",
44
45
  "CHANGELOG.md",
45
46
  "SECURITY.md",
@@ -1,8 +0,0 @@
1
- /**
2
- * Thin re-export shim that lets `app/steps/synthesize.ts` reach the
3
- * exploration phase without importing through a deep path. Keeping the
4
- * indirection here means callers don't need to know whether the
5
- * implementation lives under `phases/` or some future `app/explore`.
6
- */
7
- export { exploreConversation, shouldExplore } from "../phases/explore.ts";
8
- //# sourceMappingURL=explore-wrap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"explore-wrap.d.ts","sourceRoot":"","sources":["../../src/app/explore-wrap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}