pi-smart-compact 9.0.0 → 9.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 (56) hide show
  1. package/ARCHITECTURE.md +61 -36
  2. package/CHANGELOG.md +28 -0
  3. package/README.md +30 -5
  4. package/dist/app/native-continuity-bridge.d.ts.map +1 -1
  5. package/dist/app/pending-slot.d.ts.map +1 -1
  6. package/dist/app/preflight.d.ts +3 -3
  7. package/dist/app/preflight.d.ts.map +1 -1
  8. package/dist/app/run-smart-compact.d.ts.map +1 -1
  9. package/dist/app/session-run-lock.d.ts.map +1 -1
  10. package/dist/app/settled-auto-trigger.d.ts +20 -0
  11. package/dist/app/settled-auto-trigger.d.ts.map +1 -0
  12. package/dist/app/steps/extract.d.ts.map +1 -1
  13. package/dist/app/steps/metrics.d.ts +4 -4
  14. package/dist/app/steps/metrics.d.ts.map +1 -1
  15. package/dist/app/steps/persist.d.ts.map +1 -1
  16. package/dist/app/steps/synthesize.d.ts.map +1 -1
  17. package/dist/app/steps/window.d.ts +1 -1
  18. package/dist/app/steps/window.d.ts.map +1 -1
  19. package/dist/constants.d.ts +8 -1
  20. package/dist/constants.d.ts.map +1 -1
  21. package/dist/domain/scrub.d.ts.map +1 -1
  22. package/dist/domain/summary-parse.d.ts.map +1 -1
  23. package/dist/domain/tool-semantics.d.ts +6 -9
  24. package/dist/domain/tool-semantics.d.ts.map +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1216 -364
  27. package/dist/infra/ai-messages.d.ts +6 -0
  28. package/dist/infra/ai-messages.d.ts.map +1 -1
  29. package/dist/infra/context-graph.d.ts.map +1 -1
  30. package/dist/infra/fs.d.ts +2 -0
  31. package/dist/infra/fs.d.ts.map +1 -1
  32. package/dist/phases/explore.d.ts +2 -1
  33. package/dist/phases/explore.d.ts.map +1 -1
  34. package/dist/phases/synthesize.d.ts.map +1 -1
  35. package/dist/phases/verify.d.ts +3 -2
  36. package/dist/phases/verify.d.ts.map +1 -1
  37. package/dist/provider-eval.js +216 -33
  38. package/dist/provider-scenario-eval.js +279 -57
  39. package/dist/telemetry-report.js +216 -33
  40. package/dist/types.d.ts +12 -0
  41. package/dist/types.d.ts.map +1 -1
  42. package/dist/ui/dashboard-format.d.ts.map +1 -1
  43. package/dist/utils/cache.d.ts +2 -2
  44. package/dist/utils/cache.d.ts.map +1 -1
  45. package/dist/utils/extraction.d.ts +2 -1
  46. package/dist/utils/extraction.d.ts.map +1 -1
  47. package/dist/utils/helpers.d.ts +14 -2
  48. package/dist/utils/helpers.d.ts.map +1 -1
  49. package/dist/utils/session-log.d.ts +1 -1
  50. package/dist/utils/session-log.d.ts.map +1 -1
  51. package/dist/utils/state.d.ts.map +1 -1
  52. package/dist/utils/tokens.d.ts +2 -0
  53. package/dist/utils/tokens.d.ts.map +1 -1
  54. package/dist/utils/type-guards.d.ts +2 -0
  55. package/dist/utils/type-guards.d.ts.map +1 -1
  56. package/package.json +1 -1
package/ARCHITECTURE.md CHANGED
@@ -23,6 +23,7 @@ section is about lifecycle.
23
23
  | --- | --- |
24
24
  | `/smart-compact` | Manual command. Explainable target-first preflight or direct args. Bypasses the adaptive pressure gate, not yield/verification gates. |
25
25
  | `session_before_compact` | Auto hook. Returns/stages a pending summary or runs under pressure; durable commit waits for matching `session_compact`. |
26
+ | `agent_settled` | Opt-in pressure monitor. Requests `ctx.compact()` only; it never runs EESV or consumes/stages pending state. |
26
27
  | `smart_compact` tool | Agent-callable. Prepares a pending summary; never compacts mid-turn. |
27
28
  | `smart_recall` tool | Searches only the current project's bounded context graph; same session/branch ranks first. |
28
29
  | `smart_save_memory` tool | Persists one explicit user-confirmed project fact after secret/PII scrubbing. |
@@ -30,6 +31,14 @@ section is about lifecycle.
30
31
  A short-lived pending compaction is staged in the [`PendingSlot`](#pending-compaction-slot)
31
32
  and handed to Pi when compaction is applied.
32
33
 
34
+ With `autoTriggerStrategy: "settled"`, the idle hook applies finite
35
+ token/percentage, queue, in-flight, and per-session cooldown guards, then asks
36
+ Pi for a normal host compaction. Pi re-enters `session_before_compact`, which
37
+ reuses an already tool-staged summary or runs EESV exactly once under the
38
+ host's signal and timeout. The matching `session_compact` event remains the
39
+ only durable commit authority. This keeps proactive triggering out of the
40
+ pending/commit state machine and preserves branch-provenance checks.
41
+
33
42
  ### Host dependency boundary
34
43
 
35
44
  Pi core modules and `typebox` are wildcard peers supplied by the running host;
@@ -206,6 +215,11 @@ prose is never an input to the quality floor.
206
215
  Final verification runs again after continuity injection. The final scalar is
207
216
  reported as repaired **verification coverage**, alongside the pre-repair source
208
217
  score and fallback provenance; it is not labeled as raw synthesis quality.
218
+ Verification failures retain only exhaustive content-free gap kinds and the
219
+ rejecting gate (`post-synthesis` or `post-state`) in local telemetry. Summary
220
+ evidence is never copied into failure metrics. Both gates remain mandatory:
221
+ summary-derived continuity fields cannot become evidence for their own initial
222
+ verification.
209
223
  Polarity checks are symmetric: adding negation to a positive fact is rejected
210
224
  just as removing negation from a prohibition is. Unresolved-error source
211
225
  snippets and fallback-rendered evidence share `summaryEvidenceLine()`, so
@@ -213,11 +227,11 @@ Markdown prefixes and multiline wrapping cannot create false missing-error gaps.
213
227
 
214
228
  ## EESV hardening and control surfaces
215
229
 
216
- - **Canonical summary IR** accepts recognized H1/H2/H3 headings, preserves Progress subsections, and merges duplicate canonical kinds before state mutation.
217
- - **Typed verification gaps** drive mandatory deterministic repair; collision-aware path needles prevent basename cross-satisfaction. Provenance is persisted and shown before optional approval.
230
+ - **Canonical summary IR** accepts recognized H1/H2/H3 headings outside fenced code, preserves Progress subsections, and merges duplicate canonical kinds before state mutation.
231
+ - **Typed verification gaps** drive mandatory deterministic repair; collision-aware path needles prevent basename cross-satisfaction. Tool/file provenance and normalized semantic evidence are indexed once per verification pass, and truncated or delimiter-incomplete LLM patches are rejected. Provenance is persisted and shown before optional approval.
218
232
  - **Fine tool semantics** separate read/search/list/mutate/delete/execute operations. Pruning deduplicates only identical idempotent access signatures.
219
233
  - **Unified token planning** uses a run-bound estimator with bounded process-shared provider/model calibration, counts structured tool-call arguments, preserves an adaptive recent tail, targets mode-specific post-compaction headroom, reserves bounded deterministic post-summary state sections, clamps every provider request to the model's advertised output limit, and reserves/reconciles every request against aggregate prompt/output-token caps. Missing provider usage is estimated conservatively. Tool exchanges remain atomic; oversized result bodies are head/tail bounded only for synthesis after full deterministic extraction.
220
- - **Security boundaries** scrub high-confidence secrets before provider calls and durable cache/backup/state writes; PII scrubbing is opt-in. Backups remain in memory until confirmed apply.
234
+ - **Security boundaries** recursively scrub structured messages before host serialization or provider calls, redact secret-bearing primitive values, and scrub plus hard-cap exploration tool feedback. PII scrubbing is opt-in. Backups remain unmaterialized until confirmed apply.
221
235
  - **Policy controls** include focus weighting, exact call/latency budgets, default fail-closed manual approval, online damage monitoring, and persisted open-loop overrides. Interactive review time is outside the pipeline deadline.
222
236
  - **Release gates** (`bun run gate`, `bun run bench`) cover adversarial parser, verification, tool, cache, budget, scrub and damage fixtures plus bounded p95 regressions for extraction, pruning, chunking, summary parsing, and path matching.
223
237
 
@@ -249,36 +263,41 @@ leaving one content-free safe-fallback notice in the UI.
249
263
  | `CompactionState` | `utils/state.ts` | immutable project/session/branch-head snapshots; descendants resolve the newest matching ancestor and siblings never overwrite each other |
250
264
  | Continuity Ledger | `utils/state.ts` | prior facts carry forward until positive resolution evidence or an explicit override; goal shifts become non-destructive breadcrumbs |
251
265
  | Cross-compaction delta | `utils/state.ts` | "Changes Since Last Compaction" section |
252
- | Incremental extraction cache | `utils/cache.ts` + `utils/id-fingerprint.ts` | bounded SHA-256 prefix fingerprint + tail; safe only when the pruned prefix still matches |
266
+ | Incremental extraction cache | `utils/cache.ts` + `utils/id-fingerprint.ts` | bounded SHA-256 prefix fingerprint + tail; an exact pruned-payload match is reused directly, while incremental reuse is allowed only when the pruned prefix still matches |
253
267
  | Synthesis cache | `infra/synthesis-cache.ts` | behavior key includes normalized focus, route, mode, profile limits, run-level call/input/latency limits, and reasoning |
254
- | Session-log recovery | `utils/session-log.ts` | async bounded-memory JSONL scan with event-loop yields; bypasses pi-toolkit truncation by entry-id mapping without dropping late active-branch IDs at a fixed byte cap |
268
+ | Session-log recovery | `utils/session-log.ts` | async bounded-memory JSONL scan with event-loop yields and a bounded path cache; bypasses pi-toolkit truncation by entry-id mapping without dropping late active-branch IDs at a fixed byte cap |
255
269
  | Project fingerprint | `utils/fingerprint.ts` | locked read/merge/write; language/framework/key dirs stay bounded and `sessionCount` tracks distinct hashed session identities |
256
270
  | Damage detection | `utils/damage.ts` | best-effort post-compaction regression signals |
257
271
  | Context graph | `infra/context-graph.ts` | SQLite FTS5 facts + file edges; 2,000 non-structural nodes per project |
258
272
 
259
273
  Apply-confirmed verified state is queued and duplicate updates coalesce only
260
- for the exact project/session/branch head, then indexed on the next event-loop
261
- turn so SQLite work is not part of the native
262
- compaction hook's latency. `infra/context-graph.ts` adapts the same synchronous
263
- query/transaction contract to `bun:sqlite` in Bun tests and `node:sqlite`
264
- `DatabaseSync` in Pi's Node runtime; the packed release audit exercises both.
265
- The referenced queue timer survives extension
274
+ for the exact project/session/branch head. Replacing an existing key refreshes
275
+ that pending value even at capacity; a divergent 65th key is rejected rather
276
+ than evicting accepted work. The next event-loop turn drains the accepted
277
+ batch through one reused SQLite connection, so connection setup and graph work
278
+ are not part of the native compaction hook's latency.
279
+ `infra/context-graph.ts` adapts the same fail-closed transaction contract to
280
+ `bun:sqlite` in Bun tests and `node:sqlite` `DatabaseSync` in Pi's Node runtime;
281
+ the packed release audit exercises both. The queue timer survives extension
266
282
  shutdown/reload in the process; graph data is derived and a later cumulative
267
- state safely supersedes a missed update after a hard process kill. Fact occurrences are branch-head scoped; state, recall, and resolution use the
283
+ state safely supersedes a missed update after a hard process kill. Fact
284
+ occurrences are branch-head scoped; state, recall, and resolution use the
268
285
  complete host-visible branch ancestry before equivalent facts are deduplicated.
269
286
  Schema v1 preserves user-confirmed manual memory but resets older derived
270
287
  compaction nodes once so sibling branches cannot inherit a last-writer identity.
271
- Recall starts from FTS5 lexical matches, expands one hop
272
- through file-reference edges, then applies session, branch, fact-kind,
273
- confidence, recency, and explicit-memory weights. Exact equivalent facts are
274
- deduplicated before bounded output. Resolved/superseded state is removed from
275
- the active FTS index; another project's rows are never eligible.
288
+ Recall starts from FTS5 lexical matches whose rowids are the owning
289
+ `context_nodes` rowids, expands one hop through file-reference edges, then
290
+ applies session, branch, fact-kind, confidence, recency, and explicit-memory
291
+ weights. Exact equivalent facts are deduplicated before bounded output.
292
+ Resolved/superseded state is removed from the active FTS index; another
293
+ project's rows are never eligible.
276
294
 
277
295
  **Important retention limits:** pending in-memory compaction 5 min · exploration
278
296
  tool-support cache 1 h / 128 routes · token calibration 128 routes · extraction
279
- cache 1 h · compaction state 7 d · context graph 2,000 non-structural fact nodes
280
- and 500 active manual memories per project · remediation hints 7 d · metrics and damage
281
- JSONL logs 5 MiB each.
297
+ cache 1 h · compaction state 7 d / 64 snapshots · context graph 2,000
298
+ non-structural fact nodes, 64 pending branch-head updates, and 500 active manual
299
+ memories per project · remediation hints 7 d · metrics and damage JSONL logs
300
+ 5 MiB each · one exploration tool result 12,000 characters.
282
301
 
283
302
  ## Concurrency & safety model
284
303
 
@@ -296,30 +315,35 @@ loop). `consume()` returns a discriminated result:
296
315
  | `ok` | fresh payload for this session |
297
316
  | `empty` | nothing staged |
298
317
  | `expired` | older than the 5-minute TTL |
299
- | `mismatch` | staged by a **different** session (cross-session leak guard) |
318
+ | `mismatch` | staged by a different session, project, or non-ancestor branch head |
300
319
 
301
320
  Session identity comes from [`infra/session-identity.ts`](./src/infra/session-identity.ts):
302
321
  a real id when the host exposes one, otherwise a per-call unforgeable
303
- `unresolved:<uuid>` — two unresolved sessions can never collide.
322
+ `unresolved:<uuid>` — two unresolved sessions can never collide. Apply also
323
+ requires the staged branch head to be the current head or one of its visible
324
+ ancestors, so navigation to a sibling branch cannot consume stale payload.
304
325
 
305
326
  ### Cancellation deadlines
306
327
 
307
- Some providers ignore `AbortSignal`. The auto-trigger therefore uses a shared
308
- [`ExternalCancellation`](./src/app/run-smart-compact.ts) handle as a second line
309
- of defense: an outer `setTimeout` fires `abort()` and sets `timedOut`, and every
310
- side-effect gate in the orchestrator checks that flag before writing state or
311
- applying compaction. The caller waits for safe pipeline unwind; no unsafe
312
- `Promise.race` hard return can leave work running past the hook lifecycle.
328
+ Automatic compaction combines the host event's `AbortSignal` with its own
329
+ deadline through a shared [`ExternalCancellation`](./src/app/run-smart-compact.ts)
330
+ handle. Either source calls `abort()`, and every side-effect gate in the
331
+ orchestrator checks the shared state before writing or applying compaction.
332
+ The caller waits for safe pipeline unwind; no unsafe `Promise.race` hard return
333
+ can leave work running past the hook lifecycle.
313
334
 
314
335
  ### Filesystem & concurrency
315
336
 
316
337
  JSON/text cache writes use [`src/infra/fs.ts`](./src/infra/fs.ts): private
317
338
  artifact directories are 0700 and files are 0600; atomic temp-file + rename
318
339
  prevents half-truncated readers but intentionally does not claim fsync/power-loss
319
- durability. Append/trim operations use a `mkdir`-based cross-process lock and
320
- fail closed if ownership cannot be acquired, so sessions cannot interleave
321
- bytes. SQLite supplies its own WAL durability. Native continuity handoffs are
322
- one-shot, bounded, and keyed by project + session + branch head.
340
+ durability. Append/trim operations run asynchronously, yield before synchronous
341
+ filesystem work, and hold a `mkdir`-based cross-process lock for the complete
342
+ transaction. Lock ownership is reclaimed by atomic rename, never by deleting a
343
+ possibly renewed lease in place. Sessions therefore cannot interleave bytes or
344
+ steal a live successor's lock. SQLite supplies its own WAL durability. Native
345
+ continuity handoffs are one-shot, bounded, and keyed by project + session +
346
+ branch head.
323
347
 
324
348
  ## Provider awareness
325
349
 
@@ -332,7 +356,7 @@ drives pipeline behavior:
332
356
  | --- | --- |
333
357
  | `maxOutputTokens` | caps synthesis / patch budgets |
334
358
  | `supportsTools` (`true \| false \| "probe"`) | exploration tool-call probing |
335
- | `concurrencyLimit` | batch synthesis wave scheduling |
359
+ | `concurrencyLimit` | bounded batch-synthesis worker-pool width |
336
360
  | `cacheStrategy` | prompt-cache retention per call |
337
361
  | `timeoutMultiplier` | auto-trigger hard-timeout headroom |
338
362
  | `singlePassTokenMultiplier` | single-pass vs chunked threshold |
@@ -410,7 +434,7 @@ The code is organized into six layers, each with a single responsibility.
410
434
 
411
435
  | File | Responsibility |
412
436
  | --- | --- |
413
- | `src/index.ts` | extension registration, command parsing, auto-trigger hook |
437
+ | `src/index.ts` | extension registration, command parsing, and host lifecycle hooks |
414
438
  | `src/constants.ts` | version, thresholds, prompts, config keys |
415
439
  | `src/types.ts` | shared types and discriminated unions |
416
440
  | `domain/provider-evaluation.ts` | advisory provider scenario matrix and route telemetry aggregation |
@@ -424,6 +448,7 @@ The code is organized into six layers, each with a single responsibility.
424
448
  | `app/run-context.ts` | typed stage chain (`RcBase → … → StatedRc`) |
425
449
  | `app/mode-policy.ts` | Auto selector and finite Fast/Balanced/Thorough policies; legacy Aggressive maps to Fast |
426
450
  | `app/pending-slot.ts` | encapsulated pending-compaction state cell |
451
+ | `app/settled-auto-trigger.ts` | guarded proactive host compact requests; no EESV or pending-state ownership |
427
452
  | `app/steps/prepare.ts` | resolve config, provider caps, budgets, and cancellation; stage auth resolves lazily |
428
453
  | `app/steps/window.ts` | pick the prefix using provider-calibrated synthesis and deterministic post-processing bounds |
429
454
  | `app/steps/recover.ts` | recover full content for log-truncated messages |
@@ -460,14 +485,14 @@ All external-world interaction.
460
485
 
461
486
  | File | Responsibility |
462
487
  | --- | --- |
463
- | `infra/fs.ts` | atomic writes, advisory locks |
488
+ | `infra/fs.ts` | atomic writes, advisory locks, and yielding async append/trim |
464
489
  | `infra/paths.ts` | canonical cache/session/backup paths |
465
490
  | `infra/git.ts` | cached git-root discovery |
466
491
  | `infra/clock.ts` | injectable wall clock |
467
492
  | `infra/llm-client.ts` | LLM seam, custom-Codex wire cap, and ChatGPT Codex stream watchdog |
468
493
  | `infra/services.ts` | per-run services container |
469
494
  | `infra/session-identity.ts` | robust session-id resolution with opaque `unresolved:` fallback |
470
- | `infra/ai-messages.ts` | boundary adapters between `LlmMessage` and pi-ai `Message` |
495
+ | `infra/ai-messages.ts` | validated message upcasts and recursive pre-serialization redaction |
471
496
 
472
497
  ### Utility layer (`src/utils/`)
473
498
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [9.2.0] - 2026-08-11
4
+
5
+ ### Added
6
+
7
+ - `autoTriggerStrategy: "settled"` can proactively request Pi's normal compact flow after an idle high-pressure agent run. The opt-in handler is session-scoped, queue-aware, deduplicated, and cooled down; it never runs EESV or mutates pending/commit state outside the correlated host lifecycle.
8
+
9
+ ### Fixed
10
+
11
+ - Settled-triggered compaction reuses tool-staged summaries or runs the existing `session_before_compact` pipeline exactly once, preserving host cancellation, branch provenance, bounded auto budgets, native fallback, and apply-confirmed persistence.
12
+ - Verification failures now record the rejecting `post-synthesis` or `post-state` gate and every typed content-free gap kind, including missing read/deleted files. Invalid and prototype-inherited values are rejected; summary evidence remains absent from telemetry.
13
+
14
+ ## [9.1.0] - 2026-08-11
15
+
16
+ ### Fixed
17
+
18
+ - Provider-bound messages are recursively redacted before host serialization, secret-bearing object keys redact non-string primitive values, and exploration tool results are redacted and hard-capped before re-entering model context.
19
+ - Native apply now requires matching project/session branch ancestry, automatic hooks forward host cancellation into the shared abort path, stale run-lock leases are reclaimed atomically, and retained state snapshots are capped.
20
+ - Incremental extraction preserves bounded evidence and exact cache payloads; shell mutation tracking covers explicit literal targets without treating arbitrary command text as paths.
21
+ - Canonical summary parsing ignores headings inside fenced code, verifier patches reject truncation and unclosed fences, file-operation provenance is indexed once, and exact done-file checks no longer accept path collisions.
22
+ - Stable normalized goal identities prevent paraphrase-only goal shifts, and task-specific completion evidence can close completed follow-up loops without generic acknowledgements doing so.
23
+ - Zero/invalid context-window metadata follows one safe percentage policy, metrics tail reads honor the actual byte count, and nested `provider/model` identifiers are accepted by command and tool routing.
24
+
25
+ ### Performance
26
+
27
+ - Window planning and extraction reuse token, tool-call, and referenced-file indexes; exact pruned extraction cache hits bypass recomputation.
28
+ - Batch synthesis uses a bounded worker pool, session-log path discovery is cached, metrics appends yield off the event loop, state ancestry lookup is filename-indexed, and pending-slot newest lookup is constant-time.
29
+ - Context-graph FTS rowids match their content rows, queued same-branch updates refresh in place, SQLite transactions share fail-closed rollback semantics, and one connection is reused per drain.
30
+
3
31
  ## [9.0.0] - 2026-08-09
4
32
 
5
33
  ### Changed
package/README.md CHANGED
@@ -51,9 +51,11 @@ words such as `fast`, `balanced`, and paths such as `src/auth.ts` remain note
51
51
  content. Use `--note=...` or `--` when the boundary should be explicit. Invalid
52
52
  tool modes and budgets return an error instead of silently using defaults.
53
53
 
54
- At 60% context usage by default, the extension also participates in Pi's native
55
- compaction flow. Long-running agents can call `smart_compact`, `smart_recall`,
56
- and `smart_save_memory` directly.
54
+ By default, at 60% context usage the extension participates when Pi starts its
55
+ native compaction flow. Set `autoTriggerStrategy` to `settled` to additionally
56
+ request that same host flow after an idle agent run crosses the pressure gate.
57
+ Long-running agents can also call `smart_compact`, `smart_recall`, and
58
+ `smart_save_memory` directly.
57
59
 
58
60
  > [!IMPORTANT]
59
61
  > The tool path only stages a verified pending summary for Pi's next natural
@@ -377,6 +379,7 @@ Add `smartCompact` to `~/.pi/agent/settings.json`:
377
379
  "summaryThinkingLevel": "minimal",
378
380
  "segmentationThinkingLevel": "minimal",
379
381
  "autoTrigger": true,
382
+ "autoTriggerStrategy": "native-hook",
380
383
  "minContextPercent": 60,
381
384
  "backupEnabled": true,
382
385
  "scrubSecrets": true,
@@ -397,6 +400,27 @@ Add `smartCompact` to `~/.pi/agent/settings.json`:
397
400
  }
398
401
  ```
399
402
 
403
+ `native-hook` preserves the existing passive behavior. The opt-in proactive
404
+ strategy is:
405
+
406
+ ```json
407
+ {
408
+ "smartCompact": {
409
+ "autoTrigger": true,
410
+ "autoTriggerStrategy": "settled",
411
+ "minContextPercent": 80
412
+ }
413
+ }
414
+ ```
415
+
416
+ `settled` requires a Pi host that emits `agent_settled`; the release boundary is
417
+ verified against Pi 0.84.0 and 0.84.1.
418
+ The settled handler never runs EESV or mutates pending state itself: after
419
+ checking finite context pressure, idle/queue state, per-session in-flight
420
+ deduplication, and cooldown, it asks Pi to compact. The existing
421
+ `session_before_compact` and correlated `session_compact` handlers still own
422
+ summary generation, cancellation, apply, and durable commit.
423
+
400
424
  ### Per-phase reasoning
401
425
 
402
426
  Exploration can use a cheaper reasoning level while final synthesis and repair
@@ -447,8 +471,9 @@ the run fails closed before staging or apply.
447
471
  | `verificationModel` | `string \| null` | `null` | Optional explicit model for LLM verification repair |
448
472
  | `summaryThinkingLevel` | `minimal \| low \| medium \| high \| xhigh \| max \| null` | `minimal` | Reasoning level for synthesis and repair; provider default when null |
449
473
  | `segmentationThinkingLevel` | `minimal \| low \| medium \| high \| xhigh \| max \| null` | `minimal` | Reasoning level for exploration; provider default when null |
450
- | `autoTrigger` | `boolean` | `true` | Participate in Pi's native compact hook |
451
- | `autoTriggerTimeoutMs` | `number` | `120000` | Requested auto cancellation deadline; the synchronous hook clamps it to 60s and four LLM calls, shows live phase progress, then safely unwinds to native recovery |
474
+ | `autoTrigger` | `boolean` | `true` | Allow smart compaction in Pi's native hook and the selected trigger strategy |
475
+ | `autoTriggerStrategy` | `native-hook \| settled` | `native-hook` | `settled` additionally requests Pi's normal compact flow after an idle high-pressure agent run; verified with Pi 0.84.0+ |
476
+ | `autoTriggerTimeoutMs` | `number` | `120000` | Requested auto cancellation deadline; the host hook clamps it to 60s and four LLM calls, shows live phase progress, then safely unwinds to native recovery |
452
477
  | `minContextPercent` | `number` | `60` | Auto/tool context gate; manual `/smart-compact` warns and bypasses it |
453
478
  | `backupEnabled` | `boolean` | `true` | Prepare a scrubbed pre-compaction backup; write it only after confirmed apply |
454
479
  | `backupDir` | `string` | `~/.pi/agent/compact-backups` | Empty config value uses this path |
@@ -1 +1 @@
1
- {"version":3,"file":"native-continuity-bridge.d.ts","sourceRoot":"","sources":["../../src/app/native-continuity-bridge.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AASD,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACxD,IAAI,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,GAAG,IAAI,CAAC;IAClD,KAAK,CAAC,KAAK,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC3C,IAAI,IAAI,MAAM,CAAC;CAChB;AAMD,wBAAgB,4BAA4B,CAAC,IAAI,GAAE;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACT,GAAG,sBAAsB,CA2G9B"}
1
+ {"version":3,"file":"native-continuity-bridge.d.ts","sourceRoot":"","sources":["../../src/app/native-continuity-bridge.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AASD,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACxD,IAAI,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,GAAG,IAAI,CAAC;IAClD,KAAK,CAAC,KAAK,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC3C,IAAI,IAAI,MAAM,CAAC;CAChB;AAeD,wBAAgB,4BAA4B,CAAC,IAAI,GAAE;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;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kB,GAAG,WAAW,CAoEvE"}
1
+ {"version":3,"file":"pending-slot.d.ts","sourceRoot":"","sources":["../../src/app/pending-slot.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAoB,KAAK,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE7F,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACtC,OAAO,CAAC,GAAG,EAAE,sBAAsB,GAAG,aAAa,CAAC;IACpD,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACvC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IAC7D,IAAI,IAAI,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAOD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,WAAW,CAsFvE"}
@@ -1,13 +1,13 @@
1
1
  import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
2
  import type { Api, Model } from "@earendil-works/pi-ai";
3
- import type { CompactConfig, EffectiveCompactionMode, ProfileConfig, SessionMessageEntry } from "../types.ts";
4
- import { getProviderCaps, type TokenCalibrationStore, type TokenEstimator } from "../utils/tokens.ts";
3
+ import type { CompactConfig, EffectiveCompactionMode, ProfileConfig, ProviderCapabilities, SessionMessageEntry } from "../types.ts";
4
+ import { type TokenCalibrationStore, type TokenEstimator } from "../utils/tokens.ts";
5
5
  import type { CompactionWindowPlan } from "./run-context.ts";
6
6
  export declare function preflightDamageMedian(cwd: string, config: CompactConfig): number;
7
7
  export interface PreparedPreflightProfile {
8
8
  profileCfg: ProfileConfig;
9
9
  estimator: TokenEstimator;
10
- providerCaps: ReturnType<typeof getProviderCaps>;
10
+ providerCaps: ProviderCapabilities;
11
11
  adapted: boolean;
12
12
  damageMedian: number;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/app/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAc,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAI1H,OAAO,EAAE,eAAe,EAAsB,KAAK,qBAAqB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE1H,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,MAAM,CAMhF;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,aAAa,CAAC;IAC1B,SAAS,EAAE,cAAc,CAAC;IAC1B,YAAY,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IACjD,OAAO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AM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAA;CAAE,CAAC;AA4D/D,wBAAsB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC,CA6NxF"}
@@ -1 +1 @@
1
- {"version":3,"file":"session-run-lock.d.ts","sourceRoot":"","sources":["../../src/app/session-run-lock.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,OAAO,CAAC;IACnD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5C,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,WAAW,IAAI,MAAM,CAAC;IACtB,IAAI,IAAI,MAAM,CAAC;CAChB;AAsDD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,SAAI,EACjB,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3D,cAAc,CAoDhB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAK/F;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAG5F"}
1
+ {"version":3,"file":"session-run-lock.d.ts","sourceRoot":"","sources":["../../src/app/session-run-lock.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAIxC,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,OAAO,CAAC;IACnD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5C,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,WAAW,IAAI,MAAM,CAAC;IACtB,IAAI,IAAI,MAAM,CAAC;CAChB;AAiFD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,SAAI,EACjB,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3D,cAAc,CAoDhB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAK/F;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAG5F"}
@@ -0,0 +1,20 @@
1
+ /** Proactive auto-compaction request that delegates all EESV work to Pi's host lifecycle. */
2
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
3
+ import type { CompactConfig } from "../types.ts";
4
+ export interface SettledAutoTrigger {
5
+ request(ctx: ExtensionContext, config: CompactConfig): Promise<void>;
6
+ noteCompaction(sessionId: string): void;
7
+ clear(sessionId: string): void;
8
+ }
9
+ export interface SettledAutoTriggerOptions {
10
+ now?: () => number;
11
+ cooldownMs?: number;
12
+ }
13
+ /**
14
+ * Keep proactive triggering deliberately thin: it requests a normal host
15
+ * compaction and never runs EESV, consumes a pending summary, or stages a
16
+ * commit itself. The existing session_before_compact/session_compact pair
17
+ * therefore remains the only correlated apply path.
18
+ */
19
+ export declare function createSettledAutoTrigger(options?: SettledAutoTriggerOptions): SettledAutoTrigger;
20
+ //# sourceMappingURL=settled-auto-trigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settled-auto-trigger.d.ts","sourceRoot":"","sources":["../../src/app/settled-auto-trigger.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAE7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,yBAAyB;IACxC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,yBAA8B,GACtC,kBAAkB,CA8DpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../src/app/steps/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAmB/D,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,GAAG,WAAW,CAmM1D"}
1
+ {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../src/app/steps/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAoB/D,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,GAAG,WAAW,CA4N1D"}
@@ -15,9 +15,9 @@
15
15
  * the JSONL log and never throw past the cache.ts boundary.
16
16
  */
17
17
  import type { RcBase, StatedRc } from "../run-context.ts";
18
- import type { MetricsSnapshot } from "../../types.ts";
18
+ import type { CompactionMode, MetricsSnapshot } from "../../types.ts";
19
19
  export declare function buildSuccessMetrics(rc: StatedRc, status: "success" | "dry-run" | "cancelled"): MetricsSnapshot;
20
- export declare function recordSuccessMetrics(rc: StatedRc, status: "success" | "dry-run" | "cancelled"): void;
20
+ export declare function recordSuccessMetrics(rc: StatedRc, status: "success" | "dry-run" | "cancelled"): Promise<void>;
21
21
  /**
22
22
  * Partial summary that the orchestrator accumulates as steps complete. The
23
23
  * failure path uses whatever is present at the moment of the throw.
@@ -30,7 +30,7 @@ export interface FailureSummaryFields {
30
30
  totalTokens?: number;
31
31
  methodForMetrics?: string;
32
32
  profile: string;
33
- mode?: import("../../types.ts").CompactionMode;
33
+ mode?: CompactionMode;
34
34
  }
35
- export declare function recordFailureMetrics(rc: RcBase | StatedRc, err: unknown, fields: FailureSummaryFields): void;
35
+ export declare function recordFailureMetrics(rc: RcBase | StatedRc, err: unknown, fields: FailureSummaryFields): Promise<void>;
36
36
  //# sourceMappingURL=metrics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/app/steps/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,gBAAgB,CAAC;AA0BvE,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,QAAQ,EACZ,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAC1C,eAAe,CAuDjB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAA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BAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,MAAM,GAAG,QAAQ,EACrB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAmEf"}
@@ -1 +1 @@
1
- {"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../../src/app/steps/persist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAc,MAAM,gBAAgB,CAAC;AAUrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAQlD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAevF;AAED,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAe3F;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,CAkCvD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,UAAU,EAAE,eAAe,CAAC,EAAE,eAAe,GAAG,iBAAiB,CAmB3G;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAoBlD"}
1
+ {"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../../src/app/steps/persist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAc,MAAM,gBAAgB,CAAC;AAUrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AASlD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAevF;AAED,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAe3F;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,CAkCvD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,UAAU,EAAE,eAAe,CAAC,EAAE,eAAe,GAAG,iBAAiB,CAsB3G;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAoBlD"}
@@ -1 +1 @@
1
- {"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../../../src/app/steps/synthesize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAcH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKpE,wBAAsB,qBAAqB,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CA4WnF"}
1
+ {"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../../../src/app/steps/synthesize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAcH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKpE,wBAAsB,qBAAqB,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAiXnF"}
@@ -1,7 +1,7 @@
1
1
  /** Step 2: select and validate the active-context prefix to summarize. */
2
2
  import type { CompactionPlanReason, CompactionWindowPlan, PreparedRc, WindowedRc } from "../run-context.ts";
3
3
  import type { EffectiveCompactionMode, ProfileConfig, ProviderCapabilities, SessionMessageEntry } from "../../types.ts";
4
- import type { TokenEstimator } from "../../utils/tokens.ts";
4
+ import { type TokenEstimator } from "../../utils/tokens.ts";
5
5
  export type { CompactionWindowPlan } from "../run-context.ts";
6
6
  export interface CompactionWindowPlanInput {
7
7
  msgs: SessionMessageEntry[];
@@ -1 +1 @@
1
- {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../src/app/steps/window.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAE1E,OAAO,KAAK,EACV,oBAAoB,EAAE,oBAAoB,EAAE,UAAU,EAAuB,UAAU,EACxF,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,uBAAuB,EAAc,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAKpI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,IAAI,EAAE,uBAAuB,CAAC;IAC9B,UAAU,EAAE,aAAa,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,6EAA6E;IAC7E,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,+DAA+D;AAC/D,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAS7E;AAED,oFAAoF;AACpF,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,aAAa,EACzB,S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AC7C,MAAM,CAYR;AACD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,oBAAoB,CA2H3F;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAqEzE"}
@@ -8,7 +8,7 @@ import type { CompressionProfile, ProfileConfig } from "./types.ts";
8
8
  * `package.json#version`. Do not hand-edit this line for releases; bump
9
9
  * package.json and run `bun run sync-version`.
10
10
  */
11
- export declare const VERSION = "9.0.0";
11
+ export declare const VERSION = "9.2.0";
12
12
  export declare const CHARS_PER_TOKEN = 3.8;
13
13
  export declare const MIN_COMPACTION_SAVING_RATIO = 0.1;
14
14
  export declare const ESTIMATOR_ROUNDING_TOLERANCE_TOKENS = 1;
@@ -20,6 +20,8 @@ export declare const MAX_STATE_OPEN_LOOPS = 25;
20
20
  export declare const AUTO_TRIGGER_TIMEOUT_CAP_MS = 60000;
21
21
  /** Provider-call ceiling for the synchronous session_before_compact hook. */
22
22
  export declare const AUTO_TRIGGER_MAX_LLM_CALLS = 4;
23
+ /** Suppress proactive settled-trigger churn after any confirmed compaction. */
24
+ export declare const SETTLED_TRIGGER_COOLDOWN_MS: number;
23
25
  /** Positive per-run bounds shared by CLI and tool arguments; config separately allows 0 as a mode-derived sentinel. */
24
26
  export declare const BUDGET_LIMITS: {
25
27
  readonly CALLS: {
@@ -47,6 +49,7 @@ export declare const DEFAULT_CONFIG: {
47
49
  summaryThinkingLevel: "minimal";
48
50
  segmentationThinkingLevel: "minimal";
49
51
  autoTrigger: boolean;
52
+ autoTriggerStrategy: "native-hook";
50
53
  autoTriggerTimeoutMs: number;
51
54
  backupEnabled: boolean;
52
55
  backupDir: string;
@@ -105,8 +108,10 @@ export declare const EXTRACTION_LIMITS: {
105
108
  readonly ERRORS: 80;
106
109
  readonly DECISIONS: 80;
107
110
  readonly CONSTRAINTS: 80;
111
+ readonly TOPICS: 80;
108
112
  readonly TIMELINE: 120;
109
113
  readonly MEDIA_ATTACHMENTS: 40;
114
+ readonly REFERENCED_FILES: 200;
110
115
  };
111
116
  export declare const THIRTY_DAYS_MS: number;
112
117
  export declare const EXTRACTION_CACHE_PREFIX = "compact-extraction-";
@@ -159,6 +164,8 @@ export declare const TRUNC: {
159
164
  };
160
165
  export declare const DAMAGE_RECENT_MSG_WINDOW = 15;
161
166
  export declare const MAX_TOOL_OUTPUT_CHARS = 800;
167
+ /** Provider-visible output from one exploration tool invocation. */
168
+ export declare const MAX_EXPLORER_OUTPUT_CHARS = 12000;
162
169
  /** Shell-output patterns signalling a likely error even in a non-`isError` result. */
163
170
  export declare const LIKELY_ERROR_RE: RegExp;
164
171
  /** How far forward to look for a retry of the same tool after an error. */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,2BAA2B,MAAO,CAAC;AAChD,eAAO,MAAM,mCAAmC,IAAI,CAAC;AACrD,iHAAiH;AACjH,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAC/C,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,+FAA+F;AAC/F,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAClD,6EAA6E;AAC7E,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,uHAAuH;AACvH,eAAO,MAAM,aAAa;aACxB,KAAK;iBAAI,GAAG,EAAE,CAAC;iBAAE,GAAG,EAAE,GAAG;;aACzB,YAAY;iBAAI,GAAG,EAAE,KAAM;iBAAE,GAAG,EAAE,OAAS;;aAC3C,UAAU;iBAAI,GAAG,EAAE,IAAK;iBAAE,GAAG,EAAE,MAAO;;CAC9B,CAAC;AAEX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AK,CAAC;AAG/C,eAAO,MAAM,UAAU,iBAAiB,CAAC;AACzC,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,sBAAsB,QAU6T,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"scrub.d.ts","sourceRoot":"","sources":["../../src/domain/scrub.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,MAAM;IACrC,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AA8ED,iFAAiF;AACjF,qBAAa,cAAc;IAGb,OAAO,CAAC,QAAQ,CAAC,cAAc;IAAS,OAAO,CAAC,QAAQ,CAAC,UAAU;IAF/E,OAAO,CAAC,KAAK,CAAK;IAElB,YAA6B,cAAc,UAAO,EAAmB,UAAU,UAAQ,EAAI;IAE3F,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAgB3C;IAED,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAoCtC;IAED,KAAK,IAAI,MAAM,CAAuB;CACvC"}
1
+ {"version":3,"file":"scrub.d.ts","sourceRoot":"","sources":["../../src/domain/scrub.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,MAAM;IACrC,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAgFD,iFAAiF;AACjF,qBAAa,cAAc;IAGb,OAAO,CAAC,QAAQ,CAAC,cAAc;IAAS,OAAO,CAAC,QAAQ,CAAC,UAAU;IAF/E,O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MAAM,EACZ,SAAS,CAAC,EAAE,WAAW,GAAG,gBAAgB,GACzC,gBAAgB,CAoClB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,MAAM,EACZ,YAAY,SAAK,GAChB,gBAAgB,CAclB"}
@@ -1,17 +1,14 @@
1
- /**
2
- * Tool classification by argument shape, with normalized names used only to
3
- * safely break ties that arguments cannot resolve (read/search/list/delete and
4
- * ambiguous `text` payloads). The broad `classifyTool(args)` API remains
5
- * name-agnostic for compatibility.
6
- *
7
- * Bash-style tools that take a free-text `command` remain opaque to file-path
8
- * tracking by construction. Pure: no I/O, no async, no globals.
9
- */
10
1
  /**
11
2
  * Extract a non-empty file-path argument from a tool call, covering common key
12
3
  * names. Returns undefined when no usable path is present.
13
4
  */
14
5
  export declare function extractToolPath(args: unknown): string | undefined;
6
+ export interface ShellFileOperations {
7
+ modified: string[];
8
+ deleted: string[];
9
+ }
10
+ /** Extract only explicit literal file targets from common mutating shell forms. */
11
+ export declare function extractShellFileOperations(args: unknown): ShellFileOperations;
15
12
  export type ToolClass = "mutates" | "accesses" | "executes" | "other";
16
13
  export type ToolOperation = "read" | "search" | "list" | "mutate" | "delete" | "execute" | "unknown";
17
14
  /** Normalize provider wrappers and spelling differences without merging namespaces. */
@@ -1 +1 @@
1
- {"version":3,"file":"tool-semantics.d.ts","sourceRoot":"","sources":["../../src/domain/tool-semantics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkCH;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAQjE;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AACtE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,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