@pi-unipi/unipi 2.4.1 → 2.5.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 (108) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/package.json +28 -23
  3. package/packages/ask-user/package.json +2 -2
  4. package/packages/autocomplete/package.json +4 -2
  5. package/packages/btw/package.json +2 -2
  6. package/packages/cocoindex/package.json +2 -2
  7. package/packages/cocoindex/tools.ts +0 -8
  8. package/packages/compactor/README.md +18 -22
  9. package/packages/compactor/package.json +3 -3
  10. package/packages/compactor/src/compaction/build-sections.ts +2 -2
  11. package/packages/compactor/src/compaction/format.ts +1 -1
  12. package/packages/compactor/src/config/presets.ts +19 -30
  13. package/packages/compactor/src/index.ts +39 -56
  14. package/packages/compactor/src/session/resume-inject.ts +27 -0
  15. package/packages/compactor/src/tools/ctx-batch-execute.ts +4 -2
  16. package/packages/compactor/src/tools/ctx-execute-file.ts +4 -2
  17. package/packages/compactor/src/tools/ctx-execute.ts +4 -2
  18. package/packages/compactor/src/tools/register.ts +22 -4
  19. package/packages/compactor/src/tui/settings-overlay.ts +9 -22
  20. package/packages/compactor/src/types.ts +24 -2
  21. package/packages/core/events.ts +13 -13
  22. package/packages/core/package.json +3 -2
  23. package/packages/core/sandbox.ts +7 -6
  24. package/packages/footer/README.md +2 -2
  25. package/packages/footer/package.json +3 -3
  26. package/packages/footer/src/events.ts +0 -10
  27. package/packages/footer/src/segments/core.ts +0 -9
  28. package/packages/image/package.json +2 -2
  29. package/packages/info-screen/core-groups.ts +0 -14
  30. package/packages/info-screen/package.json +2 -2
  31. package/packages/input-shortcuts/package.json +2 -2
  32. package/packages/kanboard/commands.ts +0 -1
  33. package/packages/kanboard/package.json +2 -2
  34. package/packages/mcp/README.md +9 -0
  35. package/packages/mcp/package.json +5 -2
  36. package/packages/mcp/src/bridge/registry.ts +244 -137
  37. package/packages/mcp/src/bridge/translator.ts +77 -9
  38. package/packages/mcp/src/index.ts +43 -67
  39. package/packages/mcp/src/tui/settings-overlay.ts +3 -9
  40. package/packages/memory/README.md +15 -11
  41. package/packages/memory/bridge/mempalace_bridge.py +636 -0
  42. package/packages/memory/mempalace.ts +169 -18
  43. package/packages/memory/package.json +3 -3
  44. package/packages/memory/storage.ts +27 -28
  45. package/packages/memory/tools.ts +0 -1
  46. package/packages/milestone/README.md +11 -3
  47. package/packages/milestone/hooks.ts +112 -44
  48. package/packages/milestone/index.ts +1 -1
  49. package/packages/milestone/package.json +5 -2
  50. package/packages/notify/README.md +2 -0
  51. package/packages/notify/events.ts +23 -13
  52. package/packages/notify/package.json +2 -2
  53. package/packages/notify/tools.ts +17 -8
  54. package/packages/notify/types.ts +5 -1
  55. package/packages/ralph/package.json +3 -3
  56. package/packages/ralph/ralph-loop.ts +10 -0
  57. package/packages/subagents/README.md +3 -1
  58. package/packages/subagents/package.json +10 -6
  59. package/packages/subagents/src/agent-manager.ts +46 -11
  60. package/packages/subagents/src/core-compat.ts +38 -0
  61. package/packages/subagents/src/global.d.ts +7 -0
  62. package/packages/subagents/src/index.ts +6 -3
  63. package/packages/subagents/src/widget.ts +0 -7
  64. package/packages/unipi/bundled.js +1052 -837
  65. package/packages/updater/package.json +4 -3
  66. package/packages/utility/README.md +1 -1
  67. package/packages/utility/package.json +7 -4
  68. package/packages/utility/src/commands.ts +2 -10
  69. package/packages/utility/src/diff/theme.ts +0 -3
  70. package/packages/utility/src/tui/name-badge.ts +0 -9
  71. package/packages/web-api/package.json +2 -2
  72. package/packages/web-api/src/engine/extract.ts +0 -26
  73. package/packages/web-api/src/tools.ts +0 -13
  74. package/packages/workflow/README.md +8 -0
  75. package/packages/workflow/commands.ts +25 -23
  76. package/packages/workflow/index.ts +172 -81
  77. package/packages/workflow/lifecycle.ts +43 -0
  78. package/packages/workflow/package.json +6 -2
  79. package/packages/autocomplete/index.ts +0 -7
  80. package/packages/autocomplete/src/__tests__/command-registry.audit.test.ts +0 -120
  81. package/packages/autocomplete/src/__tests__/provider.sorting.test.ts +0 -423
  82. package/packages/compactor/src/compaction/recall-scope.ts +0 -32
  83. package/packages/compactor/src/compaction/sections.ts +0 -15
  84. package/packages/compactor/src/display/bash-display.ts +0 -28
  85. package/packages/compactor/src/display/diff-presentation.ts +0 -25
  86. package/packages/compactor/src/display/pending-diff-preview.ts +0 -51
  87. package/packages/compactor/src/display/user-message-box.ts +0 -16
  88. package/packages/compactor/src/session/analytics.ts +0 -205
  89. package/packages/image/index.ts +0 -1
  90. package/packages/input-shortcuts/index.ts +0 -5
  91. package/packages/input-shortcuts/src/status.ts +0 -35
  92. package/packages/kanboard/tui/kanboard-overlay.ts +0 -300
  93. package/packages/mcp/index.ts +0 -1
  94. package/packages/memory/search.ts +0 -134
  95. package/packages/milestone/coexist.ts +0 -114
  96. package/packages/notify/src/__tests__/ask-user-prompt-message.test.ts +0 -159
  97. package/packages/notify/src/__tests__/event-bus.test.ts +0 -119
  98. package/packages/notify/src/__tests__/permission-prompt-message.test.ts +0 -172
  99. package/packages/subagents/src/__tests__/badge-generation.test.ts +0 -315
  100. package/packages/subagents/src/__tests__/config.test.ts +0 -240
  101. package/packages/subagents/src/__tests__/esc-propagation.test.ts +0 -162
  102. package/packages/subagents/src/__tests__/file-lock.test.ts +0 -244
  103. package/packages/subagents/src/__tests__/shutdown-stale-ctx.test.ts +0 -185
  104. package/packages/subagents/src/__tests__/workflow-integration.test.ts +0 -334
  105. package/packages/subagents/src/prompts.ts +0 -39
  106. package/packages/utility/index.ts +0 -1
  107. package/packages/web-api/src/tui/progress.ts +0 -168
  108. package/packages/web-api/src/tui/result.ts +0 -173
package/CHANGELOG.md CHANGED
@@ -6,6 +6,68 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.5.0] — 2026-08-14
10
+
11
+ This release makes persistent memory migration reliable across standalone and all-in-one installs, while stabilizing workflow tool schemas and MCP registration.
12
+
13
+ ### Added
14
+
15
+ - **Verified MemPalace catch-up:** migration state now records a source fingerprint and explicit discovered/imported/skipped/failed/verified counts. New or changed legacy memories trigger an idempotent catch-up, and partial runs retry instead of being marked complete.
16
+ - **MemPalace packaging contracts:** the umbrella tarball now ships the Python bridge and resolves it across standalone, bundled, nested npm, and explicit override layouts.
17
+ - **Deterministic MCP registration:** server discovery runs in parallel behind an atomic registration barrier with canonical tool ordering, duplicate-name rejection, rollback, and orderly disconnect.
18
+ - **Workflow lifecycle tests:** added coverage for call-time tool enforcement, nested workflow restoration, MCP schema stability, concurrent completion, and Milestone completion fallback.
19
+
20
+ ### Changed
21
+
22
+ - **Workflow tools are enforced at execution time.** UniPi no longer mutates Pi's active tool list between workflow phases, preserving provider prefix-cache stability and avoiding stale tool schemas.
23
+ - **MCP schemas are canonicalized.** Equivalent JSON schemas now produce stable key/required ordering and Pi-compatible complete object schemas.
24
+ - **Milestone completion is per workflow run.** Overlapping runs are tracked independently and agent shutdown only reconciles runs that missed their normal completion event.
25
+ - **Memory markdown records preserve authoritative IDs** in frontmatter while retaining the legacy filename/title fallback for existing files.
26
+
27
+ ### Fixed
28
+
29
+ - **All-in-one UniPi installs no longer silently fall back to SQLite** because `mempalace_bridge.py` was absent from the umbrella artifact or resolved relative to the wrong module.
30
+ - **MemPalace migration no longer false-completes** after bridge errors, timeouts, partial writes, or stale timestamp markers; exact persisted documents are re-read and verified before completion is recorded.
31
+ - **MCP no longer registers tools in network-completion order,** leak partial registrations after failure, or retain clients during shutdown.
32
+ - **Workflow completion and sandbox rules no longer bleed across nested or concurrent runs.**
33
+
34
+ ## [2.4.2] — 2026-08-13
35
+
36
+ This release closes the unreachable-code and misleading-contract audit across runtime behavior, package artifacts, and integration events.
37
+
38
+ ### Added
39
+
40
+ - **Release contracts:** added package-entry, production-graph, all-tarball manifest, standalone Subagents import, and isolated Utility dependency checks.
41
+ - **Workflow lifecycle events:** workflow commands now emit one start/end pair around their agent run; Milestone synchronizes on completion while retaining shutdown fallback.
42
+ - **Compactor event delivery:** successful compactions now emit the documented completion event, and Ralph emits iteration completion only after a real advance.
43
+
44
+ ### Changed
45
+
46
+ - **Compactor configuration is now truthful.** Session continuity and sandbox off modes are enforced; language allowlists and output limits are active. Unsupported FTS5, display, and pipeline controls are hidden/deprecated rather than presented as working features.
47
+ - **Subagents honors type enablement.** JSON and custom-agent frontmatter disables are enforced before records or queue entries are created.
48
+ - **Notification priority is effective.** Explicit low/normal/high requests map to Gotify 2/5/8 and ntfy 2/3/5; omission preserves configured platform priorities.
49
+ - **Standalone Subagents ships built ESM.** The package now prebuilds verified `dist` JavaScript/declarations, publishes no tests or raw source, and exposes a standalone Pi extension entry.
50
+ - **Utility declares its real dependencies.** Direct Shiki usage is backed by `shiki`, and Pi TUI is declared as a host-shared peer.
51
+ - **Package roots and manifests were tightened.** Meaningful Footer/Updater barrels are canonical, redundant wrappers are gone, and root/workspace tarballs exclude tests while retaining every declared main.
52
+
53
+ ### Fixed
54
+
55
+ - **Compactor resume context reaches the model once.** The hidden one-shot snapshot no longer gets consumed and discarded, and the system prompt remains prefix-cache stable.
56
+ - **Compactor sandbox policy is enforced.** Disabled tools are not registered, disallowed languages are rejected, and configured output limits reach shared executors.
57
+ - **`/unipi:status` responds immediately and truthfully.** Removed the dead request broadcast and guaranteed 500 ms wait; the command now points to live info and diagnostics surfaces.
58
+ - **Footer event wiring no longer waits on stale stats events.** Live Compactor segments continue reading session state directly.
59
+ - **Standalone package resolution works in strict installs.** Subagents imports by package name, and Utility resolves Shiki and Pi TUI from its installed package root.
60
+
61
+ ### Removed
62
+
63
+ - Nine compiler-proven private declarations with no reads or callers.
64
+ - Fourteen source modules absent from the production graph, after preserving active `SectionData` and `RuntimeStats` type contracts.
65
+ - Permanently-zero Compactor indexed-byte accounting and unused package-root pass-through wrappers.
66
+
67
+ ### Known issue
68
+
69
+ - The rank-2 LLM summarization provider still returns placeholder text. Its resolution is intentionally deferred pending the broader Wigolo/web-fetch architecture decision.
70
+
9
71
  ## [2.4.1] — 2026-08-13
10
72
 
11
73
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/unipi",
3
- "version": "2.4.1",
3
+ "version": "2.5.0",
4
4
  "description": "All-in-one extension suite for Pi coding agent",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "prepare": "node scripts/build-bundle.mjs --if-missing",
28
28
  "prepublishOnly": "npm run build",
29
29
  "publish:all": "npm publish --workspaces --access public",
30
- "test": "npx tsx --test tests/*.test.js && npm test --workspaces --if-present",
30
+ "test": "npx tsx --test tests/*.test.js packages/memory/tests/*.test.ts && npm test --workspaces --if-present",
31
31
  "typecheck": "npx tsc --noEmit --skipLibCheck"
32
32
  },
33
33
  "files": [
@@ -36,12 +36,17 @@
36
36
  "packages/*/*.ts",
37
37
  "packages/*/src/**/*.ts",
38
38
  "packages/*/extensions/**/*.ts",
39
+ "packages/*/bridge/**/*.py",
39
40
  "packages/*/platforms/*",
40
41
  "packages/*/tui/*",
41
42
  "packages/*/SKILL.md",
42
43
  "packages/*/skills/**/*",
43
44
  "packages/*/README.md",
44
- "packages/unipi/bundled.js"
45
+ "packages/unipi/bundled.js",
46
+ "!packages/**/__tests__/**",
47
+ "!packages/**/tests/**",
48
+ "!packages/**/*.test.ts",
49
+ "!packages/**/*.spec.ts"
45
50
  ],
46
51
  "pi": {
47
52
  "extensions": [
@@ -71,26 +76,26 @@
71
76
  "typebox": "^1.1.38"
72
77
  },
73
78
  "dependencies": {
74
- "@pi-unipi/ask-user": "2.4.0",
75
- "@pi-unipi/btw": "2.4.0",
76
- "@pi-unipi/compactor": "2.4.0",
77
- "@pi-unipi/notify": "2.4.0",
78
- "@pi-unipi/command-enchantment": "2.4.0",
79
- "@pi-unipi/core": "2.4.0",
80
- "@pi-unipi/info-screen": "2.4.0",
81
- "@pi-unipi/mcp": "2.4.0",
82
- "@pi-unipi/memory": "2.4.0",
83
- "@pi-unipi/ralph": "2.4.1",
84
- "@pi-unipi/subagents": "2.4.0",
85
- "@pi-unipi/utility": "2.4.0",
86
- "@pi-unipi/milestone": "2.4.0",
87
- "@pi-unipi/kanboard": "2.4.0",
88
- "@pi-unipi/web-api": "2.4.0",
89
- "@pi-unipi/workflow": "2.4.0",
90
- "@pi-unipi/footer": "2.4.0",
91
- "@pi-unipi/updater": "2.4.0",
92
- "@pi-unipi/input-shortcuts": "2.4.0",
93
- "@pi-unipi/cocoindex": "2.4.0"
79
+ "@pi-unipi/ask-user": "2.5.0",
80
+ "@pi-unipi/btw": "2.5.0",
81
+ "@pi-unipi/compactor": "2.5.0",
82
+ "@pi-unipi/notify": "2.5.0",
83
+ "@pi-unipi/command-enchantment": "2.5.0",
84
+ "@pi-unipi/core": "2.5.0",
85
+ "@pi-unipi/info-screen": "2.5.0",
86
+ "@pi-unipi/mcp": "2.5.0",
87
+ "@pi-unipi/memory": "2.5.0",
88
+ "@pi-unipi/ralph": "2.5.0",
89
+ "@pi-unipi/subagents": "2.5.0",
90
+ "@pi-unipi/utility": "2.5.0",
91
+ "@pi-unipi/milestone": "2.5.0",
92
+ "@pi-unipi/kanboard": "2.5.0",
93
+ "@pi-unipi/web-api": "2.5.0",
94
+ "@pi-unipi/workflow": "2.5.0",
95
+ "@pi-unipi/footer": "2.5.0",
96
+ "@pi-unipi/updater": "2.5.0",
97
+ "@pi-unipi/input-shortcuts": "2.5.0",
98
+ "@pi-unipi/cocoindex": "2.5.0"
94
99
  },
95
100
  "devDependencies": {
96
101
  "@earendil-works/pi-agent-core": "^0.80.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/ask-user",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Structured user input tool for Pi coding agent — single-select, multi-select, freeform",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -40,7 +40,7 @@
40
40
  "access": "public"
41
41
  },
42
42
  "dependencies": {
43
- "@pi-unipi/core": "2.4.0"
43
+ "@pi-unipi/core": "2.5.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@earendil-works/pi-coding-agent": "^0.80.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/command-enchantment",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Enhanced TUI autocomplete for /unipi:* commands — colored, sorted, and grouped by package",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -24,7 +24,9 @@
24
24
  ],
25
25
  "files": [
26
26
  "src/**/*.ts",
27
- "README.md"
27
+ "README.md",
28
+ "!src/__tests__/**",
29
+ "!src/**/*.test.ts"
28
30
  ],
29
31
  "peerDependencies": {
30
32
  "@earendil-works/pi-coding-agent": "^0.80.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/btw",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "A pi extension for parallel side conversations with /unipi:btw — part of the Unipi suite",
5
5
  "type": "module",
6
6
  "main": "extensions/btw.ts",
@@ -37,7 +37,7 @@
37
37
  "@earendil-works/pi-tui": "^0.80.0"
38
38
  },
39
39
  "dependencies": {
40
- "@pi-unipi/core": "2.4.0"
40
+ "@pi-unipi/core": "2.5.0"
41
41
  },
42
42
  "pi": {
43
43
  "extensions": [],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/cocoindex",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "CocoIndex integration for Pi — AST-aware content indexing, semantic vector search, and incremental pipeline management",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -25,7 +25,7 @@
25
25
  "typebox": "^1.1.38"
26
26
  },
27
27
  "dependencies": {
28
- "@pi-unipi/core": "2.4.0"
28
+ "@pi-unipi/core": "2.5.0"
29
29
  },
30
30
  "optionalDependencies": {
31
31
  "@lancedb/lancedb": "^0.21.0"
@@ -35,14 +35,6 @@ function textResult(text: string, details?: Record<string, unknown>): any {
35
35
  };
36
36
  }
37
37
 
38
- function jsonResult(data: unknown, label?: string): any {
39
- const text = label ? `${label}:\n${JSON.stringify(data, null, 2)}` : JSON.stringify(data, null, 2);
40
- return {
41
- content: [{ type: "text", text }],
42
- details: data as Record<string, unknown>,
43
- };
44
- }
45
-
46
38
  // ─────────────────────────────────────────────────────────
47
39
  // Registration
48
40
  // ─────────────────────────────────────────────────────────
@@ -72,14 +72,14 @@ Keyboard:
72
72
 
73
73
  ### Presets tab
74
74
 
75
- Presets are profiles that set strategies, pipeline switches, sandbox mode, and display mode.
75
+ Presets are profiles that set strategies, the implemented Auto Injection pipeline behavior, and sandbox mode.
76
76
 
77
77
  | Preset | Intended use | Important effects |
78
78
  |---|---|---|
79
- | `precise` | Code-heavy work, minimal waste | Full compaction sections, safe-only sandbox, opencode display, Pipeline: `ttlCache` + `mmapPragma` on. |
80
- | `balanced` | Daily/default profile | Compact transcript, balanced display, FTS mode auto, sandbox all, Pipeline: all six switches on. |
81
- | `thorough` | Debug/audit sessions | Full transcript, verbose display, sandbox all, Pipeline: all six switches on. |
82
- | `lean` | Quick fixes or short sessions | Brief/minimal compaction sections, no sandbox, no session continuity, Pipeline: all off. |
79
+ | `precise` | Code-heavy work, minimal waste | Full compaction sections, sandbox enabled, Auto Injection off. |
80
+ | `balanced` | Daily/default profile | Compact transcript, sandbox enabled, Auto Injection on. |
81
+ | `thorough` | Debug/audit sessions | Full transcript, sandbox enabled, Auto Injection on. |
82
+ | `lean` | Quick fixes or short sessions | Brief/minimal compaction sections, no sandbox, no session continuity, Auto Injection off. |
83
83
 
84
84
  The **Project Override** row controls where settings are saved:
85
85
 
@@ -99,11 +99,10 @@ These settings control what is extracted into compaction summaries or how relate
99
99
  | `Outstanding Context` | `full`, `critical-only`, `off` | Keeps blockers, TODOs, pending decisions, and follow-ups. |
100
100
  | `User Preferences` | `all`, `recent-only`, `off` | Preserves user preferences learned during the session. |
101
101
  | `Brief Transcript` | `full`, `compact`, `minimal`, `off` | Keeps a rolling recent transcript after the structured sections. |
102
- | `Session Continuity` | `full`, `essential-only`, `off` | Controls XML-style resume snapshots that help the next turn continue after compaction. |
103
- | `Sandbox Execution` | `all`, `safe-only`, `off` | Controls agent-facing sandbox availability/intent. Safe-only is intended for less risky execution. |
104
- | `Tool Display` | `opencode`, `balanced`, `verbose`, `custom` | Controls built-in tool output rendering style and diff display behavior. |
102
+ | `Session Continuity` | `full`, `off` | Controls XML-style resume snapshots. Off prevents snapshot creation and injection; Pi’s normal compaction summary still remains. |
103
+ | `Sandbox Execution` | `all`, `off` | Controls sandbox tool registration. Changes require a session reload. Allowed languages and output limit are enforced from config. |
105
104
 
106
- Config-only legacy field: `fts5Index` remains in the schema for compatibility, but project indexing has moved to `@pi-unipi/cocoindex`.
105
+ Config-only legacy field: `fts5Index` remains in the schema for compatibility, but project indexing has moved to `@pi-unipi/cocoindex`. It is hidden from Compactor settings and presets. Legacy `sessionContinuity.mode: "essential-only"`, `eventCategories`, and `sandboxExecution.mode: "safe-only"` values remain loadable; essential-only behaves as full and safe-only behaves as enabled/all until explicit filtering/security policies are designed. Legacy `toolDisplay` and `showTruncationHints` fields also remain loadable but are deprecated and ignored; their profile names were never mapped to runtime renderer modes. Narrow-terminal diff clamping remains active as independent safety behavior.
107
106
 
108
107
  ### Auto tab
109
108
 
@@ -133,20 +132,15 @@ Example config:
133
132
 
134
133
  ### Pipeline tab
135
134
 
136
- Pipeline switches are low-level feature flags used by presets and advanced users.
135
+ The Pipeline tab exposes only behavior implemented by the current runtime.
137
136
 
138
137
  | Setting | Preset behavior | Current effect |
139
138
  |---|---|---|
140
- | `TTL Cache` | On in `precise`, `balanced`, `thorough`; off in `lean` | Reserved/compatibility switch for cache behavior. Search has an internal cache, but this toggle is not currently required for it. |
141
- | `Auto Injection` | On in `balanced`, `thorough`; off in `precise`, `lean` | Active. Adds behavioral/session state to the resume snapshot after compaction. |
142
- | `MMap Pragma` | On in `precise`, `balanced`, `thorough`; off in `lean` | Reserved/compatibility switch for SQLite mmap tuning. |
143
- | `Proximity Reranking` | On in `balanced`, `thorough`; off in `precise`, `lean` | Reserved/compatibility switch for future recall/search ranking. |
144
- | `Timeline Sort` | On in `balanced`, `thorough`; off in `precise`, `lean` | Reserved/compatibility switch for future chronological recall sorting. |
145
- | `Progressive Throttling` | On in `balanced`, `thorough`; off in `precise`, `lean` | Reserved/compatibility switch for future large-project throttling. |
139
+ | `Auto Injection` | On in `balanced`, `thorough`; off in `precise`, `lean` | Adds behavioral/session state to the one-shot resume context after compaction. |
146
140
 
147
- If all Pipeline values stay `off` after choosing a preset, that means the running version is not applying preset pipeline values correctly. Choose a preset, press **Enter** to save, and verify you are on a version containing the preset pipeline fix.
141
+ Deprecated config-only compatibility fields are still accepted so existing files load without migration failures, but they are ignored and no longer controlled or advertised by presets: `ttlCache`, `mmapPragma`, `proximityReranking`, `timelineSort`, and `progressiveThrottling`.
148
142
 
149
- Config-only pipeline field:
143
+ Other config-only pipeline field:
150
144
 
151
145
  | Field | Meaning |
152
146
  |---|---|
@@ -289,10 +283,12 @@ Practical interpretation:
289
283
 
290
284
  That means preset application is not updating `config.pipeline`. The intended behavior is:
291
285
 
292
- - `precise`: `ttlCache` + `mmapPragma` on.
293
- - `balanced`: all six pipeline switches on.
294
- - `thorough`: all six pipeline switches on.
295
- - `lean`: all pipeline switches off.
286
+ - `precise`: Auto Injection off.
287
+ - `balanced`: Auto Injection on.
288
+ - `thorough`: Auto Injection on.
289
+ - `lean`: Auto Injection off.
290
+
291
+ The five deprecated compatibility fields remain off in every preset.
296
292
 
297
293
  Make sure you are running a version with the preset pipeline fix, select the preset, and press **Enter** to save.
298
294
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/compactor",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Context engine for Pi — zero-LLM compaction, session continuity, sandbox execution, and tool display optimization",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -34,8 +34,8 @@
34
34
  "access": "public"
35
35
  },
36
36
  "dependencies": {
37
- "@pi-unipi/core": "2.4.0",
38
- "@pi-unipi/info-screen": "2.4.0",
37
+ "@pi-unipi/core": "2.5.0",
38
+ "@pi-unipi/info-screen": "2.5.0",
39
39
  "@earendil-works/pi-agent-core": "^0.80.0"
40
40
  },
41
41
  "peerDependencies": {
@@ -9,8 +9,8 @@ import { extractFiles } from "./extract/files.js";
9
9
  import { extractPreferences, dedupPreferencesAgainstGoals } from "./extract/preferences.js";
10
10
  import { extractCommits, formatCommits } from "./extract/commits.js";
11
11
  import { buildBriefSections, sectionsToTranscript, stringifyBrief } from "./brief.js";
12
- import type { SectionData } from "./sections.js";
13
- export type { SectionData } from "./sections.js";
12
+ import type { SectionData } from "../types.js";
13
+ export type { SectionData } from "../types.js";
14
14
 
15
15
  const BLOCKER_RE =
16
16
  /\b(fail(ed|s|ure|ing)?|broken|cannot|can't|won't work|does not work|doesn't work|still (broken|failing|wrong)|blocked|blocker|not (fixed|resolved|working)|crash(es|ed|ing)?)\b/i;
@@ -2,7 +2,7 @@
2
2
  * Stage 5: Format — Render sections with separators
3
3
  */
4
4
 
5
- import type { SectionData } from "./sections.js";
5
+ import type { SectionData } from "../types.js";
6
6
 
7
7
  const section = (title: string, items: string[]): string => {
8
8
  if (items.length === 0) return "";
@@ -12,13 +12,11 @@ const pipeline = (overrides: Partial<CompactorConfig["pipeline"]> = {}): Compact
12
12
  customNoisePatterns: [...(overrides.customNoisePatterns ?? DEFAULT_COMPACTOR_CONFIG.pipeline.customNoisePatterns)],
13
13
  });
14
14
 
15
- const pipelineAllOn = (): CompactorConfig["pipeline"] => pipeline({
16
- ttlCache: true,
15
+ // Auto Injection is the only preset-controlled pipeline feature with a runtime
16
+ // implementation. The other persisted fields are retained as ignored legacy
17
+ // compatibility data, but presets must not advertise or enable them.
18
+ const pipelineWithAutoInjection = (): CompactorConfig["pipeline"] => pipeline({
17
19
  autoInjection: true,
18
- proximityReranking: true,
19
- timelineSort: true,
20
- progressiveThrottling: true,
21
- mmapPragma: true,
22
20
  });
23
21
 
24
22
  const preset = (
@@ -33,30 +31,29 @@ const preset = (
33
31
  userPreferences: { ...DEFAULT_COMPACTOR_CONFIG.userPreferences, ...(overrides.userPreferences ?? {}) },
34
32
  briefTranscript: { ...DEFAULT_COMPACTOR_CONFIG.briefTranscript, ...(overrides.briefTranscript ?? {}) },
35
33
  sessionContinuity: { ...DEFAULT_COMPACTOR_CONFIG.sessionContinuity, ...(overrides.sessionContinuity ?? {}) },
36
- fts5Index: { ...DEFAULT_COMPACTOR_CONFIG.fts5Index, ...(overrides.fts5Index ?? {}) },
34
+ // Legacy compatibility data only; presets never advertise or alter it.
35
+ fts5Index: { ...DEFAULT_COMPACTOR_CONFIG.fts5Index },
37
36
  sandboxExecution: { ...DEFAULT_COMPACTOR_CONFIG.sandboxExecution, ...(overrides.sandboxExecution ?? {}) },
38
- toolDisplay: { ...DEFAULT_COMPACTOR_CONFIG.toolDisplay, ...(overrides.toolDisplay ?? {}) },
37
+ // Legacy compatibility data only; presets never advertise or alter it.
38
+ toolDisplay: { ...DEFAULT_COMPACTOR_CONFIG.toolDisplay },
39
39
  pipeline: pipeline(overrides.pipeline),
40
40
  autoCompaction: { ...DEFAULT_COMPACTOR_CONFIG.autoCompaction, ...(overrides.autoCompaction ?? {}) },
41
41
  });
42
42
 
43
- // Pipeline feature defaults per preset:
44
- // precise: ttlCache+mmap on, rest off
45
- // balanced: all on
46
- // thorough: all on
47
- // lean: all off
43
+ // Active pipeline behavior per preset:
44
+ // precise/lean: auto-injection off
45
+ // balanced/thorough: auto-injection on
46
+ // Reserved compatibility fields remain at their inert defaults in all presets.
48
47
 
49
48
  export const PRESET_CONFIGS: Record<CompactorPreset, CompactorConfig> = {
50
49
  // New preset names
51
50
  precise: preset({
52
- pipeline: pipeline({ ttlCache: true, mmapPragma: true }),
53
- sandboxExecution: { ...DEFAULT_COMPACTOR_CONFIG.sandboxExecution, mode: "safe-only" },
54
- toolDisplay: { ...DEFAULT_COMPACTOR_CONFIG.toolDisplay, mode: "opencode" },
51
+ pipeline: pipeline(),
52
+ sandboxExecution: { ...DEFAULT_COMPACTOR_CONFIG.sandboxExecution, mode: "all" },
55
53
  }),
56
54
  thorough: preset({
57
- pipeline: pipelineAllOn(),
55
+ pipeline: pipelineWithAutoInjection(),
58
56
  briefTranscript: { ...DEFAULT_COMPACTOR_CONFIG.briefTranscript, mode: "full" },
59
- toolDisplay: { ...DEFAULT_COMPACTOR_CONFIG.toolDisplay, mode: "verbose" },
60
57
  }),
61
58
  lean: preset({
62
59
  pipeline: pipeline(),
@@ -67,27 +64,21 @@ export const PRESET_CONFIGS: Record<CompactorPreset, CompactorConfig> = {
67
64
  userPreferences: { ...DEFAULT_COMPACTOR_CONFIG.userPreferences, enabled: false, mode: "off" },
68
65
  briefTranscript: { ...DEFAULT_COMPACTOR_CONFIG.briefTranscript, enabled: true, mode: "minimal" },
69
66
  sessionContinuity: { ...DEFAULT_COMPACTOR_CONFIG.sessionContinuity, enabled: false, mode: "off" },
70
- fts5Index: { ...DEFAULT_COMPACTOR_CONFIG.fts5Index, enabled: false, mode: "off" },
71
67
  sandboxExecution: { ...DEFAULT_COMPACTOR_CONFIG.sandboxExecution, enabled: false, mode: "off" },
72
- toolDisplay: { ...DEFAULT_COMPACTOR_CONFIG.toolDisplay, enabled: true, mode: "opencode" },
73
68
  }),
74
69
  balanced: preset({
75
- pipeline: pipelineAllOn(),
70
+ pipeline: pipelineWithAutoInjection(),
76
71
  briefTranscript: { ...DEFAULT_COMPACTOR_CONFIG.briefTranscript, mode: "compact" },
77
- toolDisplay: { ...DEFAULT_COMPACTOR_CONFIG.toolDisplay, mode: "balanced" },
78
- fts5Index: { ...DEFAULT_COMPACTOR_CONFIG.fts5Index, mode: "auto" },
79
72
  }),
80
73
 
81
74
  // Backward-compat aliases — map old names to new
82
75
  opencode: preset({
83
- pipeline: pipeline({ ttlCache: true, mmapPragma: true }),
84
- sandboxExecution: { ...DEFAULT_COMPACTOR_CONFIG.sandboxExecution, mode: "safe-only" },
85
- toolDisplay: { ...DEFAULT_COMPACTOR_CONFIG.toolDisplay, mode: "opencode" },
76
+ pipeline: pipeline(),
77
+ sandboxExecution: { ...DEFAULT_COMPACTOR_CONFIG.sandboxExecution, mode: "all" },
86
78
  }),
87
79
  verbose: preset({
88
- pipeline: pipelineAllOn(),
80
+ pipeline: pipelineWithAutoInjection(),
89
81
  briefTranscript: { ...DEFAULT_COMPACTOR_CONFIG.briefTranscript, mode: "full" },
90
- toolDisplay: { ...DEFAULT_COMPACTOR_CONFIG.toolDisplay, mode: "verbose" },
91
82
  }),
92
83
  minimal: preset({
93
84
  pipeline: pipeline(),
@@ -98,9 +89,7 @@ export const PRESET_CONFIGS: Record<CompactorPreset, CompactorConfig> = {
98
89
  userPreferences: { ...DEFAULT_COMPACTOR_CONFIG.userPreferences, enabled: false, mode: "off" },
99
90
  briefTranscript: { ...DEFAULT_COMPACTOR_CONFIG.briefTranscript, enabled: true, mode: "minimal" },
100
91
  sessionContinuity: { ...DEFAULT_COMPACTOR_CONFIG.sessionContinuity, enabled: false, mode: "off" },
101
- fts5Index: { ...DEFAULT_COMPACTOR_CONFIG.fts5Index, enabled: false, mode: "off" },
102
92
  sandboxExecution: { ...DEFAULT_COMPACTOR_CONFIG.sandboxExecution, enabled: false, mode: "off" },
103
- toolDisplay: { ...DEFAULT_COMPACTOR_CONFIG.toolDisplay, enabled: true, mode: "opencode" },
104
93
  }),
105
94
  custom: structuredClone(DEFAULT_COMPACTOR_CONFIG),
106
95
  };