pi-tuck 1.1.2 → 1.2.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 (77) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +7 -3
  3. package/dist/index.d.ts +2 -6
  4. package/dist/index.js +16 -111
  5. package/dist/src/build-id.d.ts +1 -1
  6. package/dist/src/build-id.js +1 -1
  7. package/dist/src/compaction.d.ts +2 -103
  8. package/dist/src/compaction.js +29 -146
  9. package/dist/src/diagnostic-replay.js +2 -2
  10. package/dist/src/diagnostics.d.ts +3 -2
  11. package/dist/src/diagnostics.js +30 -9
  12. package/dist/src/history-tools.js +3 -3
  13. package/dist/src/kept-reads.d.ts +2 -2
  14. package/dist/src/kept-reads.js +144 -8
  15. package/dist/src/ledger.d.ts +1 -1
  16. package/dist/src/ledger.js +5 -3
  17. package/dist/src/legacy-cleanup.d.ts +3 -0
  18. package/dist/src/legacy-cleanup.js +190 -0
  19. package/dist/src/notify.d.ts +3 -0
  20. package/dist/src/notify.js +13 -0
  21. package/dist/src/omissions.d.ts +1 -1
  22. package/dist/src/omissions.js +3 -3
  23. package/dist/src/path-key.d.ts +3 -0
  24. package/dist/src/path-key.js +8 -0
  25. package/dist/src/request-capacity.js +1 -1
  26. package/dist/src/run.d.ts +1 -3
  27. package/dist/src/run.js +3 -5
  28. package/dist/src/source-export.d.ts +1 -1
  29. package/dist/src/source-export.js +1 -1
  30. package/dist/src/status.d.ts +0 -6
  31. package/dist/src/status.js +1 -6
  32. package/dist/src/tuck/core/content.js +6 -9
  33. package/dist/src/tuck/core/keyword-query.d.ts +2 -2
  34. package/dist/src/tuck/core/keyword-query.js +1 -1
  35. package/dist/src/tuck/core/search-entries.js +5 -5
  36. package/dist/src/tuck/core/transcript.js +2 -1
  37. package/dist/src/tuck.js +390 -394
  38. package/dist/src/windows-private-storage.d.ts +9 -0
  39. package/dist/src/windows-private-storage.js +90 -0
  40. package/index.ts +18 -82
  41. package/package.json +5 -8
  42. package/src/build-id.ts +1 -1
  43. package/src/compaction.ts +28 -113
  44. package/src/diagnostic-replay.ts +2 -2
  45. package/src/diagnostics.ts +24 -9
  46. package/src/history-tools.ts +3 -3
  47. package/src/kept-reads.ts +78 -10
  48. package/src/ledger.ts +5 -3
  49. package/src/legacy-cleanup.ts +134 -0
  50. package/src/notify.ts +10 -0
  51. package/src/omissions.ts +3 -3
  52. package/src/path-key.ts +9 -0
  53. package/src/request-capacity.ts +1 -1
  54. package/src/run.ts +4 -6
  55. package/src/source-export.ts +1 -1
  56. package/src/status.ts +1 -10
  57. package/src/tuck/core/content.ts +5 -10
  58. package/src/tuck/core/keyword-query.ts +2 -2
  59. package/src/tuck/core/search-entries.ts +5 -5
  60. package/src/tuck/core/transcript.ts +2 -1
  61. package/src/tuck.ts +329 -335
  62. package/src/windows-private-storage.ts +94 -0
  63. package/dist/src/assets.d.ts +0 -58
  64. package/dist/src/assets.js +0 -80
  65. package/dist/src/eligibility-cache.d.ts +0 -19
  66. package/dist/src/eligibility-cache.js +0 -33
  67. package/dist/src/semantic-recall.d.ts +0 -422
  68. package/dist/src/semantic-recall.js +0 -1386
  69. package/dist/src/setup.d.ts +0 -3
  70. package/dist/src/setup.js +0 -191
  71. package/scripts/eg2-runtime.py +0 -307
  72. package/scripts/provision-eg2.py +0 -139
  73. package/scripts/semantic-worker.py +0 -234
  74. package/src/assets.ts +0 -92
  75. package/src/eligibility-cache.ts +0 -43
  76. package/src/semantic-recall.ts +0 -592
  77. package/src/setup.ts +0 -163
package/CHANGELOG.md CHANGED
@@ -3,6 +3,71 @@
3
3
  All notable changes to pi-tuck. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow
4
4
  [Semantic Versioning](https://semver.org/).
5
5
 
6
+ ## [1.2.0] - 2026-11-15
7
+
8
+ ### Added
9
+
10
+ - **Windows.** pi-tuck now installs and runs on Windows. Paths are compared the same way however Windows spells them (drive letter case,
11
+ backslashes, relative paths), and Windows shell commands that change files (`Set-Content`, `Remove-Item`, `del`, `move` and others)
12
+ count as changes. `/tuck-incident` creates its folder and files with private Windows permissions and refuses folders other users can read.
13
+ Tested on Windows 10 with Node 24 and Pi 1.5.2.
14
+
15
+ ### Fixed
16
+
17
+ - **Kept reads no longer quote a stale or partial file as if it were whole and current.** A cut's summary now keeps only whole reads;
18
+ a read is dropped from it when a later shell command that is not read-only names the file, or when a git command such as `checkout`,
19
+ `stash`, `restore` or `reset` ran, and paths are compared after normalising their spelling.
20
+
21
+ ### Removed
22
+
23
+ - **Semantic search and `tuck_search`.** Semantic-unique hits were 18 of 1,935 events (0.9%), against a 15% bar. The local model,
24
+ setup and downloads, worker, indexes and background indexing are gone. `tuck_recall` still provides exact reads and keyword search.
25
+
26
+ ### Changed
27
+
28
+ - **Old sessions still load, cut and recall.** Historical `tuck_search` and `vcc_search` calls remain readable; old private entries are
29
+ ignored. A leftover `semanticRecall` setting is ignored silently, and `/tuck` no longer reports semantic state.
30
+ - **Old search files are cleaned up once per machine.** Under `~/.pi/agent/pi-tuck/` (from the home directory, independent of Pi's agent-folder
31
+ setting), cleanup removes the real directories `python`, `index`,
32
+ `downloads`, `staging-<digits>` (exactly `staging-` followed by one or more digits), and `.pi-semantic-<six alphanumeric characters>`.
33
+ It removes `runtime` only when a child has a `pins.json` with pi-tuck's old pin fields, then removes the root only if empty.
34
+ Symlinks at the root or candidate paths and foreign files in the root are left in place; links inside removed directories are unlinked without
35
+ following their targets. On macOS and Linux, a directory is left alone if a live process has it open or the bounded `lsof` check fails;
36
+ Windows leaves all candidates alone. A notice names only removed directories, with the path and best-effort space freed, using stderr
37
+ without a UI. An empty `~/.pi/agent/pi-tuck-semantic-removed` marker records a completed attempt, including partial cleanup or nothing
38
+ to clean; an attempt that cannot start is retried. Once marked, a folder recreated later by another program is left alone.
39
+ `/tuck-semantic`, its stub text and the old notice are gone.
40
+
41
+ ### Release gates
42
+
43
+ - **Live gate on NIM Nemotron (10 paired tasks at room 16,384, against 1.1.2):** solved wins minus losses +1 (bar at least -1), turn-cap
44
+ stops 3 against 4, doubt moments 6 against 9, 0 lost tasks. Kept-read records quoting a partial or stale read: 0 against 141. The gate
45
+ found one false refusal after a steering message; it was fixed (1.1.3) and pinned by tests built from that run.
46
+ - **Replay against 1.1.3 (byte-identical to 1.1.2):** 29 recordings, cuts 1,975 → 1,869 and clips 16 → 8 with the smaller tool list and
47
+ the stricter kept reads; 0 lost or dead tasks, 0 faults.
48
+ - **Strict stress:** 322 cells, the resumed-session and stand-down suites and an 85 MB recall test, 0 findings. Lifecycle with 40 seeds.
49
+ Tests and CI on macOS and Ubuntu; the full suite also passed on Windows. The packed tarball loaded in the real installed Pi on macOS and
50
+ Windows.
51
+
52
+ ## [1.1.3] - 2026-11-15
53
+
54
+ ### Fixed
55
+
56
+ - **A steering message after a very large tool round could end the run with a false refusal.** When the user or a harness sent a message
57
+ while the agent was working, right after a round of tool results too large for the window, pi-tuck planned that cut as if a new run
58
+ were starting. The summary could then leave out the prompt that started the run, and pi-tuck's own prompt check refused with "the
59
+ request is missing the whole text of the prompt that started this run". The cut now keeps the running task's prompt and the fresh tool
60
+ round, as a cut at a tool boundary does. Cuts without a steering message are unchanged.
61
+
62
+ ### Release gates
63
+
64
+ - **Shipped without a live gate: replay matches 1.1.2 byte for byte.** 29 recordings, 13,946 of 13,946 requests identical, 0 lost or
65
+ dead tasks; none of them contains a mid-run steer.
66
+ - **The defect is pinned by two tests that fail on 1.1.2 and pass here:** a scripted large parallel round followed by a steer, and a
67
+ replay of the recorded session where it was found (a public benchmark task, paths scrubbed).
68
+ - **Strict stress:** 322 cells, including 4 new steer cells, and the resumed-session and stand-down suites; 0 findings. Lifecycle with 40
69
+ seeds. Tests and CI. The packed tarball loaded in the real installed Pi.
70
+
6
71
  ## [1.1.2] - 2026-11-14
7
72
 
8
73
  ### Changed
package/README.md CHANGED
@@ -64,8 +64,8 @@ Then start a new Pi session. That is all. pi-tuck takes over Pi's compaction, bo
64
64
 
65
65
  - Needs Pi 1.2.0 or later (tested on 1.2.0 and 1.4.0), on macOS or Linux. On an older Pi, pi-tuck stays off, Pi's own compaction runs, and pi-tuck says so once. Full features on macOS with Apple silicon; elsewhere, compaction and word recall.
66
66
  - On macOS with Apple silicon, the first session also downloads a local search model in the background (about 390 MB, once), and says once when it is set up. Until it is ready, search works by keyword. See [Semantic search](#semantic-search).
67
- - Prefer GitHub? `pi install git:github.com/galyavin/pi-tuck@v1.1.0`.
68
- - To pin a version, add it: `pi install npm:pi-tuck@1.1.0`.
67
+ - Prefer GitHub? `pi install git:github.com/galyavin/pi-tuck@v1.1.2`.
68
+ - To pin a version, add it: `pi install npm:pi-tuck@1.1.2`.
69
69
 
70
70
  ## Uninstall
71
71
 
@@ -103,10 +103,12 @@ pi-tuck's tools appear only after its first cut. Before that there is nothing ou
103
103
 
104
104
  | Command | Does |
105
105
  |---|---|
106
- | `/tuck` | Says in words what pi-tuck is doing in this session: the version this session loaded (an open session keeps it until Pi restarts), how many cuts and retries pi-tuck made and the last cut's size before and after, whether the cut point adapts or is fixed by `cutAt`, and how search works here. It is for you; the model sees nothing new. |
106
+ | `/tuck` | Says in words what pi-tuck is doing in this session: the version this session loaded (an open session keeps it until Pi restarts), how many cuts and retries pi-tuck made and the last cut's size before and after, whether the cut point adapts or is fixed by `cutAt`, how search works here, and, since 1.1.1, `standing down:` with the reason when pi-tuck is not acting. It is for you; the model sees nothing new. |
107
107
  | `/tuck-semantic on\|off\|status` | Turns semantic search on or off for this session, or shows its state. |
108
108
  | `/tuck-incident on\|next\|off\|status` | Records this session's compaction decisions to a file you can attach to a bug report. |
109
109
 
110
+ Since 1.1.1, pi-tuck stands down to native Pi when it cannot do its job safely: with an unknown context window (0, missing or not a number), with a Pi virtual model, or with Pi's auto-compaction turned off. It then does exactly what native Pi does, and `/tuck` says `standing down:` with the reason. Refusal, overflow and manual-cut notices also reach stderr when there is no UI (`pi -p`, JSON runs), as the output-limit notice already did.
111
+
110
112
  `/compact` works as usual. Text after it does not steer the summary, because pi-tuck builds the summary from the session itself: since 1.0.19 it cuts as plain `/compact` does and says the text was not used. Pi's own setting `"compaction": { "enabled": false }` turns compaction off.
111
113
 
112
114
  ## What is proven, and what is not
@@ -136,6 +138,8 @@ Known limits today:
136
138
  - A request above the room could be admitted and then refused, leaving the session stuck where native Pi would have sent (1.0.22 to 1.0.24; fixed in 1.0.25). pi-tuck checked its line in its own corrected token count, while Pi's reply cap uses Pi's own estimate, which is higher when the provider counts fewer tokens than pi-tuck's raw measure ([`CHANGELOG.md`](CHANGELOG.md) 1.0.25).
137
139
  - Near the 1.0.22 refusal line, replies were cut to a few hundred tokens (1.0.22; fixed in 1.0.23). 1.0.22 left only its reply floor and did not count Pi's 4,096-token margin on the reply cap ([`CHANGELOG.md`](CHANGELOG.md) 1.0.23).
138
140
  - Cost of the 1.0.22 change: between the room and the window, the reply reserve no longer cushions a wrong count. At a cold start an undercount can reach the provider. A provider that errors is caught and learned from; a server that truncates silently truncates, as it does for native Pi. With a setup above the room, cuts are forced and frequent, each freeing little, which beats a stranded session ([`CHANGELOG.md`](CHANGELOG.md) 1.0.22).
141
+ - Fixed in 1.1.1: a resumed session forgot what pi-tuck had learned about the provider's token counts. pi-tuck saved its calibration only inside a cut, so after quitting and resuming Pi before the next cut it counted at 1x again and could send a request the provider truncated or refused, where native Pi succeeded. pi-tuck now saves a small private entry in the session when what a resume would learn changes, not every turn, and reads it back on resume. The entry never reaches the model ([`CHANGELOG.md`](CHANGELOG.md) 1.1.1).
142
+ - Fixed in 1.1.1: pi-tuck refused prompts that native Pi would have sent when the context window was unknown, the model was a Pi virtual model, or Pi's auto-compaction was turned off. It now stands down to native in those cases. Also fixed in 1.1.1: refusal, overflow and manual-cut notices were silent without a UI, so a run in `pi -p` or JSON mode could end with no word; the semantic search status could claim "ready" when it was turned off or had failed; and a retry after a reply hit the output limit skipped a check that a pending cut had really been saved in the session ([`CHANGELOG.md`](CHANGELOG.md) 1.1.1).
139
143
  - Fixed in 1.0.33: a file read's recall number pointed at the read call, not at what the read returned. The summary lists each file the session read with a `tuck_recall` number, and that number brought back the call's arguments instead of the file's contents, so recalling a read cost a turn and showed nothing useful. It now brings back the read's output ([`CHANGELOG.md`](CHANGELOG.md) 1.0.33).
140
144
  - Fixed in 1.0.32: background indexing never started at the cuts pi-tuck makes itself. Pi announces only its own compactions, so cuts pi-tuck saved after a tool round, at the end of a run, or before retrying a reply that hit the output limit started no indexing ([`CHANGELOG.md`](CHANGELOG.md) 1.0.32).
141
145
  - Fixed in 1.0.31: input that arrived after a tool round had been checked, such as another extension's context or a newly enabled tool, could push the next request past the hard line, and the final check refused a request that pi-tuck could still cut. It now cuts at that check, carries the cut in that request, saves it at the next boundary, and refuses only when no cut can fit ([`CHANGELOG.md`](CHANGELOG.md) 1.0.31).
package/dist/index.d.ts CHANGED
@@ -2,12 +2,8 @@ import { type ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
2
  export type { CompactionOptions } from "./src/compaction.js";
3
3
  export { installCompaction } from "./src/compaction.js";
4
4
  export { inspectIncident, readableIncident } from "./src/diagnostic-replay.js";
5
- export { createSemanticRecall, SemanticRecallController } from "./src/semantic-recall.js";
6
- export type { SemanticRecallConfig, PriorResult, SemanticState, SemanticSetup } from "./src/semantic-recall.js";
7
- export { ensureSemanticRuntime } from "./src/setup.js";
8
- /** pi-tuck as a Pi extension: compaction and history recall always; semantic recall too, unless `pi-tuck.json` in Pi's agent folder
9
- * says `{"semanticRecall": false}`. Its runtime is set up in the background the first time a session starts. The same file's `"cutAt"`
10
- * (a number above 0 and at most 1) is the fraction of the input room a cut is triggered at, 0.6 by default. */
5
+ /** pi-tuck as a Pi extension: compaction and history recall. `"cutAt"` in `pi-tuck.json` in Pi's agent folder (a number above 0 and at most
6
+ * 1) fixes the cut point as a fraction of the input room; without it, the cut point adapts. */
11
7
  /** The oldest Pi with every hook and API pi-tuck uses, and the oldest its tests pass on (Pi 1.2 added the custom message that starts a
12
8
  * run to before_agent_start, which the prompt's cut counts). */
13
9
  export declare const PI_FLOOR = "1.2.0";
package/dist/index.js CHANGED
@@ -1,18 +1,14 @@
1
1
  import { VERSION, getAgentDir } from "@earendil-works/pi-coding-agent";
2
- import { existsSync, readFileSync, realpathSync } from "node:fs";
3
- import { join, sep } from "node:path";
2
+ import { readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
4
  import { installCompaction } from "./src/compaction.js";
5
5
  import { validCutAt } from "./src/budget.js";
6
- import { createSemanticRecall } from "./src/semantic-recall.js";
7
- import { defaultRoot, runtimeConfigPath } from "./src/assets.js";
8
- import { ensureSemanticRuntime } from "./src/setup.js";
6
+ import { notify } from "./src/notify.js";
7
+ import { cleanupLegacyFiles } from "./src/legacy-cleanup.js";
9
8
  export { installCompaction } from "./src/compaction.js";
10
9
  export { inspectIncident, readableIncident } from "./src/diagnostic-replay.js";
11
- export { createSemanticRecall, SemanticRecallController } from "./src/semantic-recall.js";
12
- export { ensureSemanticRuntime } from "./src/setup.js";
13
- /** pi-tuck as a Pi extension: compaction and history recall always; semantic recall too, unless `pi-tuck.json` in Pi's agent folder
14
- * says `{"semanticRecall": false}`. Its runtime is set up in the background the first time a session starts. The same file's `"cutAt"`
15
- * (a number above 0 and at most 1) is the fraction of the input room a cut is triggered at, 0.6 by default. */
10
+ /** pi-tuck as a Pi extension: compaction and history recall. `"cutAt"` in `pi-tuck.json` in Pi's agent folder (a number above 0 and at most
11
+ * 1) fixes the cut point as a fraction of the input room; without it, the cut point adapts. */
16
12
  /** The oldest Pi with every hook and API pi-tuck uses, and the oldest its tests pass on (Pi 1.2 added the custom message that starts a
17
13
  * run to before_agent_start, which the prompt's cut counts). */
18
14
  export const PI_FLOOR = "1.2.0";
@@ -41,99 +37,16 @@ export default async function (pi) {
41
37
  });
42
38
  return;
43
39
  }
44
- const semanticRecall = createSemanticRecall();
45
- // `/tuck-semantic off` holds for the rest of the session, including over a setup that finishes later.
46
40
  const settings = readSettings(join(getAgentDir(), "pi-tuck.json"));
47
- // Semantic recall runs on Metal, so only on Apple silicon; elsewhere the model is not offered tuck_search at all.
48
- const appleSilicon = process.platform === "darwin" && process.arch === "arm64";
49
- const handle = await installCompaction(pi, { semanticRecall, search: appleSilicon, cutAt: settings.cutAt, onSemanticSetting: async (enabled) => {
50
- if (!enabled)
51
- semanticRecall.setSetup("off-user");
52
- else if (semanticRecall.status().setup === "off-user")
53
- semanticRecall.setSetup("starting", { installed: existsSync(runtimeConfigPath(defaultRoot())) });
54
- } });
55
- if (settings.semanticRecall === false) {
56
- semanticRecall.setSetup("off-settings");
57
- pi.on("session_start", () => { semanticRecall.setSetup("off-settings"); });
58
- return;
59
- }
60
- let session = 0, said = "", announced = false, setup;
61
- // A context outlives its session (a setup can finish after /new); a notice to an ended session is dropped.
62
- // With no UI (pi -p), Pi shows no notices, so a settings error or an off or failing semantic recall would go unsaid: write each to stderr
63
- // instead, once per session. stderr is the operator's; it never enters the model's context.
64
- const stderrSaid = new Set();
65
- const say = (ctx, message, level) => {
66
- if (!ctx.hasUI) {
67
- if (!stderrSaid.has(message)) {
68
- stderrSaid.add(message);
69
- try {
70
- process.stderr.write(message + "\n");
71
- }
72
- catch { /* closed */ }
73
- }
74
- return;
75
- }
76
- try {
77
- ctx.ui.notify(message, level);
78
- }
79
- catch { /* ended */ }
80
- };
81
- const once = (ctx, message, level) => { if (said !== message) {
82
- said = message;
83
- say(ctx, message, level);
84
- } };
85
- const announce = (ctx, state, detail) => {
86
- semanticRecall.setSetup(state, detail);
87
- const notice = semanticRecall.setupNotice();
88
- if (notice)
89
- (state === "off-platform" || state === "off-project" ? once : say)(ctx, notice.message, notice.level);
90
- };
91
- pi.on("session_shutdown", () => { session++; });
92
- pi.on("session_start", (_event, ctx) => {
93
- const current = ++session;
94
- stderrSaid.clear();
41
+ const handle = await installCompaction(pi, { cutAt: settings.cutAt });
42
+ let said = false;
43
+ pi.on("session_start", async (_event, ctx) => {
44
+ await cleanupLegacyFiles(ctx);
95
45
  if (handle.state?.(ctx).kind === "standingDown")
96
46
  return;
97
- if (settings.error)
98
- once(ctx, `pi-tuck: ${settings.error}; using the defaults.`, "warning");
99
- if (!appleSilicon)
100
- return announce(ctx, "off-platform");
101
- // Semantic recall keeps its runtime and indexes outside the project it serves, so not when Pi runs in a folder that holds its
102
- // agent folder, such as the home folder.
103
- if (within(real(getAgentDir()), real(ctx.cwd)))
104
- return announce(ctx, "off-project");
105
- // A run with no UI (pi -p, RPC, JSON) uses a runtime that is already installed: that needs no download. It does not start a first-time
106
- // setup, which would outlast a one-shot run, and it says why, so tuck_search and /tuck name the real state.
107
- const installed = existsSync(runtimeConfigPath(defaultRoot()));
108
- if (!ctx.hasUI && !installed)
109
- return announce(ctx, "not-installed");
110
- // The download's announcement outlives the session that made it: a session that starts while the shared setup is still running
111
- // owes the "set up" notice once, as before the refactor.
112
- semanticRecall.setSetup("starting", { installed, announced });
113
- setup ??= ensureSemanticRuntime(defaultRoot(), message => {
114
- announced = true;
115
- if (current === session && semanticRecall.status().setup !== "off-user")
116
- announce(ctx, "starting", { installed, notice: message, announced: true });
117
- });
118
- setup.then(async () => {
119
- if (current !== session || semanticRecall.status().setup === "off-user")
120
- return;
121
- try {
122
- await handle.setSemanticEnabled(true, ctx);
123
- if (current === session && semanticRecall.status().setup !== "off-user") {
124
- announce(ctx, "ready", { announced });
125
- announced = false;
126
- }
127
- }
128
- catch (error) {
129
- if (current === session && semanticRecall.status().setup !== "off-user")
130
- announce(ctx, "failed", { stage: "start", reason: reason(error) });
131
- }
132
- }, error => {
133
- setup = undefined; // the next session start tries again
134
- if (current === session && semanticRecall.status().setup !== "off-user")
135
- announce(ctx, "failed", { stage: "setup", reason: reason(error) });
136
- });
47
+ if (settings.error && !said) {
48
+ said = notify(ctx, `pi-tuck: ${settings.error}; using the defaults.`, "warning");
49
+ }
137
50
  });
138
51
  }
139
52
  function readSettings(path) {
@@ -146,18 +59,10 @@ function readSettings(path) {
146
59
  }
147
60
  try {
148
61
  const value = JSON.parse(text);
149
- if (value && typeof value === "object" && (value.semanticRecall === undefined || typeof value.semanticRecall === "boolean") &&
62
+ if (value && typeof value === "object" &&
150
63
  (value.cutAt === undefined || validCutAt(value.cutAt)))
151
- return value;
64
+ return { cutAt: value.cutAt };
152
65
  }
153
66
  catch { /* reported below */ }
154
- return { error: `${path} should be a JSON object like {"semanticRecall": false, "cutAt": 0.8}, with cutAt a number above 0 and at most 1` };
155
- }
156
- const reason = (error) => error instanceof Error ? error.message : String(error);
157
- const within = (path, folder) => path === folder || path.startsWith(folder.endsWith(sep) ? folder : folder + sep);
158
- const real = (path) => { try {
159
- return realpathSync(path);
67
+ return { error: `${path} should be a JSON object like {"cutAt": 0.8}, with cutAt a number above 0 and at most 1` };
160
68
  }
161
- catch {
162
- return path;
163
- } };
@@ -1 +1 @@
1
- export declare const BUILD_ID = "e36f2c823c0d56405dab4cda3f16894a034bdb082d322c30587474d15b332b70";
1
+ export declare const BUILD_ID = "f653b17921c5383797b70c8962152e6b4537a7769e05118290fc34d492a06ec1";
@@ -1 +1 @@
1
- export const BUILD_ID = "e36f2c823c0d56405dab4cda3f16894a034bdb082d322c30587474d15b332b70";
1
+ export const BUILD_ID = "f653b17921c5383797b70c8962152e6b4537a7769e05118290fc34d492a06ec1";
@@ -1,5 +1,4 @@
1
- import { type Run } from "./run.js";
2
- import { type SemanticRecallController } from "./semantic-recall.js";
1
+ import { Run } from "./run.js";
3
2
  import { type RecorderOptions } from "./diagnostics.js";
4
3
  import { type AgentMessage } from "./budget.js";
5
4
  import { SettingsManager, type ExtensionAPI, type ExtensionContext, type SessionEntry } from "@earendil-works/pi-coding-agent";
@@ -38,12 +37,6 @@ export declare function compactionState(model: {
38
37
  contextWindow?: number;
39
38
  } | undefined, enabled: boolean): CompactionState;
40
39
  export interface CompactionOptions {
41
- semanticRecall?: SemanticRecallController;
42
- /** Whether `tuck_search` exists: false where semantic recall cannot run (off Apple silicon), so the model is offered word recall only. */
43
- search?: boolean;
44
- /** Optional host-owned transient operator preference; handle operations never call back. */
45
- onSemanticSetting?: (enabled: boolean) => Promise<unknown>;
46
- semanticStatus?: () => unknown;
47
40
  diagnostics?: RecorderOptions;
48
41
  /** Optional read-only observation of actual corrected budget checks; no request content. */
49
42
  observeBudget?: (measurement: {
@@ -86,104 +79,10 @@ export interface CompactionOptions {
86
79
  }
87
80
  export declare function installCompaction(pi: ExtensionAPI, options?: CompactionOptions): Promise<{
88
81
  close: () => Promise<void>;
89
- semanticRecall: SemanticRecallController;
90
- setSemanticEnabled: (enabled: boolean, ctx: ExtensionContext) => Promise<{
91
- setup: import("./semantic-recall.js").SemanticSetup;
92
- setupMessage: string | null;
93
- enabled: boolean;
94
- configured: boolean;
95
- cleanupError: string | null;
96
- state: import("./semantic-recall.js").SemanticState;
97
- snapshotId: string | null;
98
- throughEntryId: string | null;
99
- eligibleSources: number;
100
- totalUnits: number;
101
- coveredUnits: number;
102
- indexingComplete: boolean;
103
- lastError: string | null;
104
- window: {
105
- indexedCharacters: number;
106
- windowCharacters: number;
107
- outOfViewCharacters: number;
108
- eligibleCharacters: number;
109
- oldestCoveredEntryId: string | null;
110
- oldestCoveredTime: string | null;
111
- conversation: {
112
- indexedCharacters: number;
113
- outOfViewCharacters: number;
114
- };
115
- toolResults: {
116
- indexedCharacters: number;
117
- outOfViewCharacters: number;
118
- oldestCoveredTime: string | null;
119
- };
120
- } | null;
121
- recovery: {
122
- attempts: number;
123
- integrity: boolean;
124
- retryAt: string | null;
125
- } | null;
126
- operations: {
127
- preparationEmbeddings: number;
128
- queryEmbeddings: number;
129
- };
130
- limits: {
131
- keyword: number;
132
- broad: number;
133
- };
134
- }>;
135
- semanticStatus: () => {
136
- host?: unknown;
137
- local: {
138
- setup: import("./semantic-recall.js").SemanticSetup;
139
- setupMessage: string | null;
140
- enabled: boolean;
141
- configured: boolean;
142
- cleanupError: string | null;
143
- state: import("./semantic-recall.js").SemanticState;
144
- snapshotId: string | null;
145
- throughEntryId: string | null;
146
- eligibleSources: number;
147
- totalUnits: number;
148
- coveredUnits: number;
149
- indexingComplete: boolean;
150
- lastError: string | null;
151
- window: {
152
- indexedCharacters: number;
153
- windowCharacters: number;
154
- outOfViewCharacters: number;
155
- eligibleCharacters: number;
156
- oldestCoveredEntryId: string | null;
157
- oldestCoveredTime: string | null;
158
- conversation: {
159
- indexedCharacters: number;
160
- outOfViewCharacters: number;
161
- };
162
- toolResults: {
163
- indexedCharacters: number;
164
- outOfViewCharacters: number;
165
- oldestCoveredTime: string | null;
166
- };
167
- } | null;
168
- recovery: {
169
- attempts: number;
170
- integrity: boolean;
171
- retryAt: string | null;
172
- } | null;
173
- operations: {
174
- preparationEmbeddings: number;
175
- queryEmbeddings: number;
176
- };
177
- limits: {
178
- keyword: number;
179
- broad: number;
180
- };
181
- };
182
- };
183
82
  state: (ctx: ExtensionContext) => CompactionState;
184
83
  inspectState: (ctx: ExtensionContext) => {
185
84
  run: Readonly<Run> | undefined;
186
- phase: "starting" | "failed" | "decided" | "claimed" | "expired" | "admitted" | "commit-failed" | undefined;
85
+ phase: "decided" | "claimed" | "expired" | "starting" | "admitted" | "failed" | "commit-failed" | undefined;
187
86
  calibrationIdentity: string;
188
87
  pendingCut: boolean;
189
88
  };