pi-smart-compact 8.0.8 → 9.1.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.
- package/ARCHITECTURE.md +90 -70
- package/CHANGELOG.md +45 -2
- package/README.md +52 -30
- package/SECURITY.md +1 -1
- package/dist/app/native-continuity-bridge.d.ts.map +1 -1
- package/dist/app/pending-slot.d.ts.map +1 -1
- package/dist/app/preflight.d.ts +2 -1
- package/dist/app/preflight.d.ts.map +1 -1
- package/dist/app/run-context.d.ts +10 -10
- package/dist/app/run-context.d.ts.map +1 -1
- package/dist/app/run-smart-compact.d.ts +18 -2
- package/dist/app/run-smart-compact.d.ts.map +1 -1
- package/dist/app/session-run-lock.d.ts.map +1 -1
- package/dist/app/smart-compact-input.d.ts +23 -0
- package/dist/app/smart-compact-input.d.ts.map +1 -0
- package/dist/app/steps/extract.d.ts.map +1 -1
- package/dist/app/steps/metrics.d.ts +4 -4
- package/dist/app/steps/metrics.d.ts.map +1 -1
- package/dist/app/steps/persist.d.ts +2 -3
- package/dist/app/steps/persist.d.ts.map +1 -1
- package/dist/app/steps/prepare.d.ts +4 -6
- package/dist/app/steps/prepare.d.ts.map +1 -1
- package/dist/app/steps/recover.d.ts +1 -1
- package/dist/app/steps/recover.d.ts.map +1 -1
- package/dist/app/steps/state.d.ts.map +1 -1
- package/dist/app/steps/synthesize.d.ts.map +1 -1
- package/dist/app/steps/verify.d.ts.map +1 -1
- package/dist/app/steps/window.d.ts +5 -1
- package/dist/app/steps/window.d.ts.map +1 -1
- package/dist/constants.d.ts +25 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/domain/scrub.d.ts.map +1 -1
- package/dist/domain/summary-parse.d.ts +1 -1
- package/dist/domain/summary-parse.d.ts.map +1 -1
- package/dist/domain/summary-schema.d.ts +1 -1
- package/dist/domain/summary-schema.d.ts.map +1 -1
- package/dist/domain/tool-semantics.d.ts +15 -9
- package/dist/domain/tool-semantics.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3105 -1389
- package/dist/infra/ai-messages.d.ts +6 -0
- package/dist/infra/ai-messages.d.ts.map +1 -1
- package/dist/infra/context-graph.d.ts.map +1 -1
- package/dist/infra/fs.d.ts +13 -15
- package/dist/infra/fs.d.ts.map +1 -1
- package/dist/infra/git.d.ts +5 -11
- package/dist/infra/git.d.ts.map +1 -1
- package/dist/infra/llm-client.d.ts +2 -0
- package/dist/infra/llm-client.d.ts.map +1 -1
- package/dist/infra/paths.d.ts +4 -2
- package/dist/infra/paths.d.ts.map +1 -1
- package/dist/infra/session-identity.d.ts +11 -0
- package/dist/infra/session-identity.d.ts.map +1 -1
- package/dist/infra/synthesis-cache.d.ts.map +1 -1
- package/dist/phases/explore.d.ts +2 -1
- package/dist/phases/explore.d.ts.map +1 -1
- package/dist/phases/synthesize.d.ts +4 -1
- package/dist/phases/synthesize.d.ts.map +1 -1
- package/dist/phases/verify.d.ts +10 -3
- package/dist/phases/verify.d.ts.map +1 -1
- package/dist/provider-eval.js +278 -27
- package/dist/provider-scenario-eval.js +422 -49
- package/dist/telemetry-report.js +278 -27
- package/dist/types.d.ts +51 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/overlays.d.ts +2 -1
- package/dist/ui/overlays.d.ts.map +1 -1
- package/dist/utils/backups.d.ts +31 -0
- package/dist/utils/backups.d.ts.map +1 -0
- package/dist/utils/cache.d.ts +3 -2
- package/dist/utils/cache.d.ts.map +1 -1
- package/dist/utils/damage.d.ts.map +1 -1
- package/dist/utils/extraction.d.ts +8 -1
- package/dist/utils/extraction.d.ts.map +1 -1
- package/dist/utils/fingerprint.d.ts +5 -1
- package/dist/utils/fingerprint.d.ts.map +1 -1
- package/dist/utils/helpers.d.ts +15 -37
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/pruning.d.ts.map +1 -1
- package/dist/utils/session-log.d.ts +10 -18
- package/dist/utils/session-log.d.ts.map +1 -1
- package/dist/utils/state.d.ts +2 -2
- package/dist/utils/state.d.ts.map +1 -1
- package/dist/utils/tokens.d.ts +2 -0
- package/dist/utils/tokens.d.ts.map +1 -1
- package/dist/utils/type-guards.d.ts +2 -0
- package/dist/utils/type-guards.d.ts.map +1 -1
- package/package.json +2 -2
package/ARCHITECTURE.md
CHANGED
|
@@ -60,14 +60,14 @@ threads a typed context through ten stages:
|
|
|
60
60
|
|
|
61
61
|
| # | Stage | Module | Transition |
|
|
62
62
|
| ---: | --- | --- | --- |
|
|
63
|
-
| 1 | prepare | `app/steps/prepare.ts` | config +
|
|
64
|
-
| 2 | window | `app/steps/window.ts` | pick the prefix
|
|
63
|
+
| 1 | prepare | `app/steps/prepare.ts` | config + provider caps + budgets; auth remains lazy |
|
|
64
|
+
| 2 | window | `app/steps/window.ts` | pick the prefix using a calibrated final-summary allowance |
|
|
65
65
|
| 3 | recover | `app/steps/recover.ts` | restore log-truncated messages |
|
|
66
66
|
| 4 | tier | `app/steps/tier.ts` | choose none / light / full |
|
|
67
67
|
| 5 | extract | `app/steps/extract.ts` | prune + deterministic extraction + cache |
|
|
68
68
|
| 6 | synthesize | `app/steps/synthesize.ts` | single-pass or EESV |
|
|
69
|
-
| 7 | verify | `app/steps/verify.ts` | structural verify + repair |
|
|
70
|
-
| 8 | state | `app/steps/state.ts` + `domain/yield-gate.ts` | state/open loops/delta + final yield proof |
|
|
69
|
+
| 7 | verify | `app/steps/verify.ts` | structural verify + repair; high-risk outcomes require successful tool evidence |
|
|
70
|
+
| 8 | state | `app/steps/state.ts` + `domain/yield-gate.ts` | state/open loops/resolved history/delta + final yield proof |
|
|
71
71
|
| 9 | persist | `app/steps/persist.ts` | stage pending, apply compaction |
|
|
72
72
|
| 10 | metrics | `app/steps/metrics.ts` | success / failure record |
|
|
73
73
|
|
|
@@ -120,8 +120,9 @@ pressure and deterministic extraction risk.
|
|
|
120
120
|
Model routes are stage-specific but never inferred from mode. With no explicit
|
|
121
121
|
configuration, Explore, Synthesize, and Verify all use the selected Pi model.
|
|
122
122
|
`segmentationModel`, `summaryModel`, and `verificationModel` can independently
|
|
123
|
-
override those routes.
|
|
124
|
-
|
|
123
|
+
override those routes. Credentials resolve lazily immediately before each
|
|
124
|
+
stage's first network call and are reused for equivalent routes; call metrics
|
|
125
|
+
preserve the actual route.
|
|
125
126
|
|
|
126
127
|
### Keep window and preprocessing
|
|
127
128
|
|
|
@@ -145,10 +146,11 @@ keeps chunked recovery instead of sending an oversized one-shot prompt to
|
|
|
145
146
|
native summarization. Manual runs use the profile's absolute adaptive tail, so
|
|
146
147
|
model-window size cannot turn an explicit command into a full-context no-op.
|
|
147
148
|
|
|
148
|
-
Before summarization the pipeline serializes the full selected
|
|
149
|
-
|
|
149
|
+
Before summarization the pipeline serializes and scrubs the full selected
|
|
150
|
+
conversation into an in-memory prepared backup, then prunes redundant messages,
|
|
150
151
|
loads the previous verified summary plus bounded continuity state, checks the
|
|
151
|
-
incremental extraction cache, and loads the project fingerprint.
|
|
152
|
+
incremental extraction cache, and loads the project fingerprint. The backup is
|
|
153
|
+
written atomically only after the matching native compaction is confirmed.
|
|
152
154
|
|
|
153
155
|
### Extract
|
|
154
156
|
|
|
@@ -187,16 +189,20 @@ deterministic fallback assembly when any budget or LLM call fails.
|
|
|
187
189
|
### Verify
|
|
188
190
|
|
|
189
191
|
Primary: [`src/phases/verify.ts`](./src/phases/verify.ts). Scores the summary
|
|
190
|
-
against
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
done/unresolved inconsistencies,
|
|
194
|
-
open-
|
|
192
|
+
against deterministic extraction, continuity, explicit focus/note steering,
|
|
193
|
+
and source messages. It checks missing modified/read/deleted files, unresolved
|
|
194
|
+
errors, high-confidence constraints, weak goal coverage, missing structure,
|
|
195
|
+
suspicious fabricated paths, done/unresolved inconsistencies, explicit
|
|
196
|
+
decisions, open loops, and unsupported high-risk outcome claims. Claims such as
|
|
197
|
+
“tests passed” require matching source prose or a successful related tool
|
|
198
|
+
result.
|
|
195
199
|
|
|
196
200
|
**Repair order is intentional:** (1) deterministic patch first (free,
|
|
197
201
|
idempotent) → (2) one LLM patch only in `thorough` mode if still insufficient
|
|
198
|
-
→ (3) replace lower-scoring output with
|
|
199
|
-
|
|
202
|
+
→ (3) replace lower-scoring output with a deterministic quality floor built
|
|
203
|
+
only from extraction, continuity, and steering → (4) reject unless final
|
|
204
|
+
verification has no gaps and meets the verified threshold. Untrusted chunk
|
|
205
|
+
prose is never an input to the quality floor.
|
|
200
206
|
Final verification runs again after continuity injection. The final scalar is
|
|
201
207
|
reported as repaired **verification coverage**, alongside the pre-repair source
|
|
202
208
|
score and fallback provenance; it is not labeled as raw synthesis quality.
|
|
@@ -207,13 +213,13 @@ Markdown prefixes and multiline wrapping cannot create false missing-error gaps.
|
|
|
207
213
|
|
|
208
214
|
## EESV hardening and control surfaces
|
|
209
215
|
|
|
210
|
-
- **Canonical summary IR** accepts recognized H1/H2/H3 headings, preserves Progress subsections, and merges duplicate canonical kinds before state mutation.
|
|
211
|
-
- **Typed verification gaps** drive mandatory deterministic repair; collision-aware path needles prevent basename cross-satisfaction. Provenance is persisted and shown before optional approval.
|
|
216
|
+
- **Canonical summary IR** accepts recognized H1/H2/H3 headings outside fenced code, 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. 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.
|
|
212
218
|
- **Fine tool semantics** separate read/search/list/mutate/delete/execute operations. Pruning deduplicates only identical idempotent access signatures.
|
|
213
|
-
- **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
|
|
214
|
-
- **Security boundaries** scrub
|
|
215
|
-
- **Policy controls** include focus weighting, exact call/latency budgets, fail-closed manual approval, online damage monitoring, and persisted open-loop overrides.
|
|
216
|
-
- **Release
|
|
219
|
+
- **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** 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
|
+
- **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
|
+
- **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.
|
|
217
223
|
|
|
218
224
|
## State, caching & persistence
|
|
219
225
|
|
|
@@ -221,10 +227,12 @@ Post-verification, `app/steps/state.ts` + `src/utils/state.ts` enrich the
|
|
|
221
227
|
summary, then `domain/yield-gate.ts` measures the final replacement. Planning
|
|
222
228
|
has already reserved the bounded post-synthesis enrichment band by reducing the
|
|
223
229
|
retained tail; missing the original target or 10% net-saving floor still throws
|
|
224
|
-
before a `StatedRc` can reach staging/apply. `session_before_compact` only stages
|
|
225
|
-
the host emits the matching `session_compact`,
|
|
226
|
-
reusable state
|
|
227
|
-
|
|
230
|
+
before a `StatedRc` can reach staging/apply. `session_before_compact` only stages
|
|
231
|
+
a passing candidate; after the host emits the matching `session_compact`,
|
|
232
|
+
`app/steps/persist.ts` commits reusable state, the prepared conversation backup,
|
|
233
|
+
and success telemetry. Aborted/unconfirmed candidates write none of them. The
|
|
234
|
+
UI reports `Applied` only after that correlated commit and emits a separate
|
|
235
|
+
warning if any durable side effect was partial.
|
|
228
236
|
`ui/error-format.ts` converts verification/yield failures to one bounded,
|
|
229
237
|
content-free diagnostic and collapses unknown multiline errors; full stacks are
|
|
230
238
|
suppressed by default and emitted only under explicit `DEBUG=smart-compact`.
|
|
@@ -238,39 +246,44 @@ leaving one content-free safe-fallback notice in the UI.
|
|
|
238
246
|
| Concern | Where | Notes |
|
|
239
247
|
| --- | --- | --- |
|
|
240
248
|
| Open-loop injection | `utils/state.ts` | inserted before Next Steps via the canonical parser |
|
|
241
|
-
| `CompactionState` | `utils/state.ts` |
|
|
249
|
+
| `CompactionState` | `utils/state.ts` | immutable project/session/branch-head snapshots; descendants resolve the newest matching ancestor and siblings never overwrite each other |
|
|
242
250
|
| Continuity Ledger | `utils/state.ts` | prior facts carry forward until positive resolution evidence or an explicit override; goal shifts become non-destructive breadcrumbs |
|
|
243
251
|
| Cross-compaction delta | `utils/state.ts` | "Changes Since Last Compaction" section |
|
|
244
|
-
| Incremental extraction cache | `utils/cache.ts` + `utils/id-fingerprint.ts` | bounded SHA-256 prefix fingerprint + tail;
|
|
245
|
-
| Synthesis cache | `infra/synthesis-cache.ts` | behavior key includes normalized focus, route, mode,
|
|
246
|
-
| Session-log recovery | `utils/session-log.ts` |
|
|
247
|
-
| Project fingerprint | `utils/fingerprint.ts` | locked read/merge/write; language/framework/key dirs stay bounded
|
|
252
|
+
| 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
|
+
| 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 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
|
+
| Project fingerprint | `utils/fingerprint.ts` | locked read/merge/write; language/framework/key dirs stay bounded and `sessionCount` tracks distinct hashed session identities |
|
|
248
256
|
| Damage detection | `utils/damage.ts` | best-effort post-compaction regression signals |
|
|
249
257
|
| Context graph | `infra/context-graph.ts` | SQLite FTS5 facts + file edges; 2,000 non-structural nodes per project |
|
|
250
258
|
|
|
251
259
|
Apply-confirmed verified state is queued and duplicate updates coalesce only
|
|
252
|
-
for the exact project/session/branch head
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
260
|
+
for the exact project/session/branch head. Replacing an existing key refreshes
|
|
261
|
+
that pending value even at capacity; a divergent 65th key is rejected rather
|
|
262
|
+
than evicting accepted work. The next event-loop turn drains the accepted
|
|
263
|
+
batch through one reused SQLite connection, so connection setup and graph work
|
|
264
|
+
are not part of the native compaction hook's latency.
|
|
265
|
+
`infra/context-graph.ts` adapts the same fail-closed transaction contract to
|
|
266
|
+
`bun:sqlite` in Bun tests and `node:sqlite` `DatabaseSync` in Pi's Node runtime;
|
|
267
|
+
the packed release audit exercises both. The queue timer survives extension
|
|
258
268
|
shutdown/reload in the process; graph data is derived and a later cumulative
|
|
259
|
-
state safely supersedes a missed update after a hard process kill. Fact
|
|
269
|
+
state safely supersedes a missed update after a hard process kill. Fact
|
|
270
|
+
occurrences are branch-head scoped; state, recall, and resolution use the
|
|
260
271
|
complete host-visible branch ancestry before equivalent facts are deduplicated.
|
|
261
272
|
Schema v1 preserves user-confirmed manual memory but resets older derived
|
|
262
273
|
compaction nodes once so sibling branches cannot inherit a last-writer identity.
|
|
263
|
-
Recall starts from FTS5 lexical matches
|
|
264
|
-
through file-reference edges, then
|
|
265
|
-
confidence, recency, and explicit-memory
|
|
266
|
-
deduplicated before bounded output.
|
|
267
|
-
the active FTS index; another
|
|
274
|
+
Recall starts from FTS5 lexical matches whose rowids are the owning
|
|
275
|
+
`context_nodes` rowids, expands one hop through file-reference edges, then
|
|
276
|
+
applies session, branch, fact-kind, confidence, recency, and explicit-memory
|
|
277
|
+
weights. Exact equivalent facts are deduplicated before bounded output.
|
|
278
|
+
Resolved/superseded state is removed from the active FTS index; another
|
|
279
|
+
project's rows are never eligible.
|
|
268
280
|
|
|
269
281
|
**Important retention limits:** pending in-memory compaction 5 min · exploration
|
|
270
282
|
tool-support cache 1 h / 128 routes · token calibration 128 routes · extraction
|
|
271
|
-
cache 1 h · compaction state 7 d · context graph 2,000
|
|
272
|
-
|
|
273
|
-
|
|
283
|
+
cache 1 h · compaction state 7 d / 64 snapshots · context graph 2,000
|
|
284
|
+
non-structural fact nodes, 64 pending branch-head updates, and 500 active manual
|
|
285
|
+
memories per project · remediation hints 7 d · metrics and damage JSONL logs
|
|
286
|
+
5 MiB each · one exploration tool result 12,000 characters.
|
|
274
287
|
|
|
275
288
|
## Concurrency & safety model
|
|
276
289
|
|
|
@@ -288,30 +301,35 @@ loop). `consume()` returns a discriminated result:
|
|
|
288
301
|
| `ok` | fresh payload for this session |
|
|
289
302
|
| `empty` | nothing staged |
|
|
290
303
|
| `expired` | older than the 5-minute TTL |
|
|
291
|
-
| `mismatch` | staged by a
|
|
304
|
+
| `mismatch` | staged by a different session, project, or non-ancestor branch head |
|
|
292
305
|
|
|
293
306
|
Session identity comes from [`infra/session-identity.ts`](./src/infra/session-identity.ts):
|
|
294
307
|
a real id when the host exposes one, otherwise a per-call unforgeable
|
|
295
|
-
`unresolved:<uuid>` — two unresolved sessions can never collide.
|
|
308
|
+
`unresolved:<uuid>` — two unresolved sessions can never collide. Apply also
|
|
309
|
+
requires the staged branch head to be the current head or one of its visible
|
|
310
|
+
ancestors, so navigation to a sibling branch cannot consume stale payload.
|
|
296
311
|
|
|
297
312
|
### Cancellation deadlines
|
|
298
313
|
|
|
299
|
-
|
|
300
|
-
[`ExternalCancellation`](./src/app/run-smart-compact.ts)
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
314
|
+
Automatic compaction combines the host event's `AbortSignal` with its own
|
|
315
|
+
deadline through a shared [`ExternalCancellation`](./src/app/run-smart-compact.ts)
|
|
316
|
+
handle. Either source calls `abort()`, and every side-effect gate in the
|
|
317
|
+
orchestrator checks the shared state before writing or applying compaction.
|
|
318
|
+
The caller waits for safe pipeline unwind; no unsafe `Promise.race` hard return
|
|
319
|
+
can leave work running past the hook lifecycle.
|
|
305
320
|
|
|
306
321
|
### Filesystem & concurrency
|
|
307
322
|
|
|
308
323
|
JSON/text cache writes use [`src/infra/fs.ts`](./src/infra/fs.ts): private
|
|
309
324
|
artifact directories are 0700 and files are 0600; atomic temp-file + rename
|
|
310
325
|
prevents half-truncated readers but intentionally does not claim fsync/power-loss
|
|
311
|
-
durability. Append/trim operations
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
326
|
+
durability. Append/trim operations run asynchronously, yield before synchronous
|
|
327
|
+
filesystem work, and hold a `mkdir`-based cross-process lock for the complete
|
|
328
|
+
transaction. Lock ownership is reclaimed by atomic rename, never by deleting a
|
|
329
|
+
possibly renewed lease in place. Sessions therefore cannot interleave bytes or
|
|
330
|
+
steal a live successor's lock. SQLite supplies its own WAL durability. Native
|
|
331
|
+
continuity handoffs are one-shot, bounded, and keyed by project + session +
|
|
332
|
+
branch head.
|
|
315
333
|
|
|
316
334
|
## Provider awareness
|
|
317
335
|
|
|
@@ -324,17 +342,19 @@ drives pipeline behavior:
|
|
|
324
342
|
| --- | --- |
|
|
325
343
|
| `maxOutputTokens` | caps synthesis / patch budgets |
|
|
326
344
|
| `supportsTools` (`true \| false \| "probe"`) | exploration tool-call probing |
|
|
327
|
-
| `concurrencyLimit` | batch
|
|
345
|
+
| `concurrencyLimit` | bounded batch-synthesis worker-pool width |
|
|
328
346
|
| `cacheStrategy` | prompt-cache retention per call |
|
|
329
347
|
| `timeoutMultiplier` | auto-trigger hard-timeout headroom |
|
|
330
348
|
| `singlePassTokenMultiplier` | single-pass vs chunked threshold |
|
|
331
349
|
| `tokenRatioEstimate` | token estimation; refined by per-(provider,model) **EMA calibration** |
|
|
332
350
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
351
|
+
Every provider call is raced against one aborting hard deadline so a transport
|
|
352
|
+
that ignores cancellation cannot keep the run lock indefinitely. Custom Codex
|
|
353
|
+
endpoints also receive `max_output_tokens` through Pi AI's payload hook. The
|
|
354
|
+
ChatGPT subscription endpoint rejects every wire output-cap field, so its
|
|
355
|
+
deadline is derived from the requested output allowance (15–90s) and paired
|
|
356
|
+
with a visible-output ceiling. Deadline failures route to the phase's
|
|
357
|
+
deterministic fallback.
|
|
338
358
|
|
|
339
359
|
### Provider evaluation and routing evidence
|
|
340
360
|
|
|
@@ -414,14 +434,14 @@ The code is organized into six layers, each with a single responsibility.
|
|
|
414
434
|
| `app/run-context.ts` | typed stage chain (`RcBase → … → StatedRc`) |
|
|
415
435
|
| `app/mode-policy.ts` | Auto selector and finite Fast/Balanced/Thorough policies; legacy Aggressive maps to Fast |
|
|
416
436
|
| `app/pending-slot.ts` | encapsulated pending-compaction state cell |
|
|
417
|
-
| `app/steps/prepare.ts` | resolve config,
|
|
418
|
-
| `app/steps/window.ts` | pick the prefix
|
|
437
|
+
| `app/steps/prepare.ts` | resolve config, provider caps, budgets, and cancellation; stage auth resolves lazily |
|
|
438
|
+
| `app/steps/window.ts` | pick the prefix using provider-calibrated synthesis and deterministic post-processing bounds |
|
|
419
439
|
| `app/steps/recover.ts` | recover full content for log-truncated messages |
|
|
420
440
|
| `app/steps/tier.ts` | choose compaction tier (none / light / full) |
|
|
421
441
|
| `app/steps/extract.ts` | pruning + deterministic extraction with incremental cache |
|
|
422
442
|
| `app/steps/synthesize.ts` | single-pass / EESV synthesis |
|
|
423
|
-
| `app/steps/verify.ts` | structural verification + repair |
|
|
424
|
-
| `app/steps/state.ts` | enrich summary with state
|
|
443
|
+
| `app/steps/verify.ts` | structural verification + repair with tool-result trust boundaries |
|
|
444
|
+
| `app/steps/state.ts` | enrich summary with state, open loops, and recent resolved-error history |
|
|
425
445
|
| `app/steps/persist.ts` | apply compaction, save fingerprint, persist state |
|
|
426
446
|
| `app/steps/metrics.ts` | record success / failure metrics |
|
|
427
447
|
|
|
@@ -450,14 +470,14 @@ All external-world interaction.
|
|
|
450
470
|
|
|
451
471
|
| File | Responsibility |
|
|
452
472
|
| --- | --- |
|
|
453
|
-
| `infra/fs.ts` | atomic writes, advisory locks |
|
|
473
|
+
| `infra/fs.ts` | atomic writes, advisory locks, and yielding async append/trim |
|
|
454
474
|
| `infra/paths.ts` | canonical cache/session/backup paths |
|
|
455
475
|
| `infra/git.ts` | cached git-root discovery |
|
|
456
476
|
| `infra/clock.ts` | injectable wall clock |
|
|
457
477
|
| `infra/llm-client.ts` | LLM seam, custom-Codex wire cap, and ChatGPT Codex stream watchdog |
|
|
458
478
|
| `infra/services.ts` | per-run services container |
|
|
459
479
|
| `infra/session-identity.ts` | robust session-id resolution with opaque `unresolved:` fallback |
|
|
460
|
-
| `infra/ai-messages.ts` |
|
|
480
|
+
| `infra/ai-messages.ts` | validated message upcasts and recursive pre-serialization redaction |
|
|
461
481
|
|
|
462
482
|
### Utility layer (`src/utils/`)
|
|
463
483
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,51 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [
|
|
3
|
+
## [9.1.0] - 2026-08-11
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
- 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.
|
|
9
|
+
- Incremental extraction preserves bounded evidence and exact cache payloads; shell mutation tracking covers explicit literal targets without treating arbitrary command text as paths.
|
|
10
|
+
- 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.
|
|
11
|
+
- 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.
|
|
12
|
+
- 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.
|
|
13
|
+
|
|
14
|
+
### Performance
|
|
15
|
+
|
|
16
|
+
- Window planning and extraction reuse token, tool-call, and referenced-file indexes; exact pruned extraction cache hits bypass recomputation.
|
|
17
|
+
- 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.
|
|
18
|
+
- 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.
|
|
19
|
+
|
|
20
|
+
## [9.0.0] - 2026-08-09
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Major hardening release: verified host-correlated apply, strict command/tool inputs, bounded automatic compaction, model-aware output ceilings, branch-scoped continuity, and fail-closed yield and evidence contracts are now enforced end to end.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Command and tool inputs now share one strict parser. Control tokens are consumed only from the left edge, `--note`/`--` preserve literal notes, file paths are not mistaken for model IDs, and invalid modes or budgets fail explicitly.
|
|
29
|
+
- Verified state is stored as immutable project/session/branch-head snapshots; sibling branches no longer overwrite continuity, loop overrides re-index the updated graph, and synthesis cache keys include every output-affecting run budget.
|
|
30
|
+
- Deleted-file evidence now survives chunk synthesis, fallback assembly, verification, and repair. Modified/deleted paths count only in their canonical sections; unrelated parallel tool calls and substantive assistant constraints are no longer pruned.
|
|
31
|
+
- Every provider transport has an aborting hard deadline, stale filesystem locks are reclaimed asynchronously, backup listing reads bounded headers, and session-log recovery scans large active logs incrementally without a 50 MiB correctness cutoff.
|
|
32
|
+
- Result and approval UI expose generation fallbacks, source-versus-repaired coverage, remaining-gap counts, and the actual summary preview. Project fingerprints count distinct sessions instead of compaction runs.
|
|
33
|
+
- Verification now grounds high-risk completion claims only against successful tool results or deterministic resolved-error/file evidence, removes unsupported assistant-only claims, and builds the quality floor only from deterministic extraction, continuity, and explicit steering.
|
|
34
|
+
- Session-log recovery preserves exact entry/message identity; synthesis cache keys include recovered content and every provider route; full cache values are cloned without sharing nested mutable state.
|
|
35
|
+
- Boundary indexes are integer-canonicalized, exploration arguments reject empty broad matches, extraction evidence is bounded with visible overflow counts, and delayed tool results remain paired under the chunk ceiling.
|
|
36
|
+
- Missing provider usage is conservatively estimated for budgets and telemetry. Budget-driven synthesis fallbacks are recorded explicitly rather than appearing as provider-free success.
|
|
37
|
+
- Scrubbed backups are prepared without I/O and written only after correlated native apply. Partial persistence is reported separately, stale state/temp artifacts are removed, and stage transitions now enforce runtime order and required fields.
|
|
38
|
+
- Manual verified-summary review is enabled by default and excluded from the pipeline deadline; the preview wraps long evidence lines and dashboards hide unavailable quality scores.
|
|
39
|
+
- Cross-process JSONL retention now holds the append/trim lock for the complete transaction, overflow planning accounts for host-only fixed context, and long command failures preserve a bounded error window from the middle of pruned tool output.
|
|
40
|
+
- Single-batch synthesis fallbacks are visible and never cached as clean output; verification refreshes the run-wide LLM-call total; transient tool-probe failures no longer poison capability caches; profile overrides enforce integer and cross-field bounds.
|
|
41
|
+
- Verified-summary review is one scrollable Apply/Cancel screen, unavailable preflight choices explain why Enter is blocked, exact backup payloads materialize only after native apply, and restore forks from the recorded branch leaf or opens an isolated session for legacy backups.
|
|
42
|
+
- Unresolved host sessions stop before pipeline work, branch ancestry snapshots are bounded while retaining compaction state heads, Git-root caching is bounded and expiring, and context-graph directories are normalized to owner-only permissions.
|
|
43
|
+
- Window planning now translates provider output caps through the calibrated local estimator and budgets bounded deterministic repair/state additions, preventing late target rejection after a high-saving run.
|
|
44
|
+
- Secret scrubbing recognizes provider-specific Google/Stripe/GitLab/npm credentials, AWS secret assignments, credential-bearing object keys, and passwords in connection URIs.
|
|
45
|
+
- Incremental extraction caches retain failed-operation signatures, so only the same later operation can resolve a cached error; recent resolved errors remain visible in the continuation summary.
|
|
46
|
+
- Automatic compaction shows live phase progress and is bounded to 60 seconds and four LLM calls before native recovery. Context-graph queue saturation now rejects and reports the newest update instead of silently evicting accepted state.
|
|
47
|
+
- CI actions are pinned to immutable commits, the redundant adversarial rerun was removed from CI, and restore tests delete their temporary HOME directories.
|
|
48
|
+
- Every tracked provider request is clamped to the model's advertised output limit before budget reservation and dispatch. The release check now includes p95 hot-path regression limits and a host-correlated end-to-end auto-compaction/apply lifecycle test.
|
|
6
49
|
|
|
7
50
|
## [8.0.8] - 2026-08-09
|
|
8
51
|
|
package/README.md
CHANGED
|
@@ -38,12 +38,19 @@ Then run `/smart-compact` for an explainable preflight before anything changes.
|
|
|
38
38
|
/smart-compact auto # adaptive mode selection
|
|
39
39
|
/smart-compact anthropic/claude-sonnet-4 fast # explicit model + mode
|
|
40
40
|
/smart-compact balanced --focus=auth # preserve extra auth detail
|
|
41
|
+
/smart-compact --note="keep balanced and fast terminology"
|
|
42
|
+
/smart-compact -- preserve this note verbatim after the option boundary
|
|
41
43
|
/smart-compact metrics # text metrics report
|
|
42
44
|
/smart-compact dashboard # interactive dashboard
|
|
43
45
|
/smart-compact restore # browse and restore backups
|
|
44
46
|
/smart-compact loops # manage persisted open loops
|
|
45
47
|
```
|
|
46
48
|
|
|
49
|
+
Command controls are consumed only from the left edge. Once note text starts,
|
|
50
|
+
words such as `fast`, `balanced`, and paths such as `src/auth.ts` remain note
|
|
51
|
+
content. Use `--note=...` or `--` when the boundary should be explicit. Invalid
|
|
52
|
+
tool modes and budgets return an error instead of silently using defaults.
|
|
53
|
+
|
|
47
54
|
At 60% context usage by default, the extension also participates in Pi's native
|
|
48
55
|
compaction flow. Long-running agents can call `smart_compact`, `smart_recall`,
|
|
49
56
|
and `smart_save_memory` directly.
|
|
@@ -68,7 +75,7 @@ The design principle is simple:
|
|
|
68
75
|
|
|
69
76
|
> **Facts first. Synthesis second. Verification before apply.**
|
|
70
77
|
|
|
71
|
-
Any unresolved verification gap rejects the custom summary before staging or apply. A zero-gap
|
|
78
|
+
Any unresolved verification gap rejects the custom summary before staging or apply. High-risk outcome claims such as “tests passed” or “deployed” must match source messages or a successful related tool result; unsupported claims are removed deterministically. A zero-gap fallback built only from extraction, continuity, and explicit focus/note steering is preferred over unverifiable model output; untrusted chunk prose cannot become the quality floor. A successful compaction must also meet its mode target and at least 10% estimated net savings both before synthesis and after the final summary is measured. Automatic failures leave Pi free to use its native compactor, while manual failures leave the conversation unchanged.
|
|
72
79
|
|
|
73
80
|
## EESV pipeline
|
|
74
81
|
|
|
@@ -150,14 +157,18 @@ target, route, and boundary data stays under `D` instead of crowding the decisio
|
|
|
150
157
|
- `D` toggles calibrated estimator, target, boundary, and route details.
|
|
151
158
|
- `M` opens Advanced model selection and replans with that route's calibration.
|
|
152
159
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
Provider-reported token usage is used when available; missing or partial usage
|
|
161
|
+
is conservatively estimated for both metrics and aggregate budgets. Every
|
|
162
|
+
provider request is clamped to the selected model's advertised output limit
|
|
163
|
+
before reservation and dispatch. Smart Compact uses `~`/`≤` language for
|
|
164
|
+
post-compaction estimates, measures the completed summary again before staging,
|
|
165
|
+
and reports final success only after Pi confirms the matching
|
|
166
|
+
`session_compact` run ID. A single long user turn may be
|
|
167
|
+
split at a safe message boundary: its older prefix is verified into the summary
|
|
168
|
+
while the budgeted working tail stays raw. Tool exchanges remain complete
|
|
169
|
+
call/result pairs; oversized result evidence is head/tail bounded only in the
|
|
170
|
+
synthesis prompt after deterministic extraction has consumed the full input.
|
|
171
|
+
If Verify, yield, provider, or native apply fails, the UI shows one bounded actionable line without evidence text or a
|
|
161
172
|
JavaScript stack. A successful `100/100` is labeled **verification coverage**;
|
|
162
173
|
the source score and deterministic/LLM/fallback provenance remain visible so
|
|
163
174
|
repaired coverage is never presented as raw synthesis quality. Stack diagnostics
|
|
@@ -182,8 +193,8 @@ brief. `verbose` restores routine phase notices; full stack diagnostics require
|
|
|
182
193
|
does **not** attempt unsupported non-contiguous compaction.
|
|
183
194
|
- `--max-calls` accepts `1–100`.
|
|
184
195
|
- `--max-input-tokens` accepts `10000–1000000` aggregate prompt tokens.
|
|
185
|
-
- `--max-latency` accepts `5000–600000` milliseconds as a cancellation deadline;
|
|
186
|
-
- Budget exhaustion degrades to deterministic summaries instead of dropping context.
|
|
196
|
+
- `--max-latency` accepts `5000–600000` milliseconds as a provider/pipeline cancellation deadline; interactive summary review time is excluded.
|
|
197
|
+
- Budget exhaustion is recorded as an explicit fallback outcome and degrades to deterministic summaries instead of dropping context.
|
|
187
198
|
|
|
188
199
|
The tool exposes equivalent `focus`, `max_calls`, `max_input_tokens`, and
|
|
189
200
|
`max_latency_ms` parameters.
|
|
@@ -206,7 +217,7 @@ the verified summary carries them forward. Automatic risk refinement may deepen
|
|
|
206
217
|
analysis/repair strategy after extraction, but it does not mutate the profile
|
|
207
218
|
allowance or retention window that was already used to prove the target.
|
|
208
219
|
|
|
209
|
-
Output caps stop subsequent calls after
|
|
220
|
+
Output caps stop subsequent calls after reported or conservatively estimated usage reaches the threshold.
|
|
210
221
|
The ChatGPT Codex subscription endpoint rejects `max_output_tokens`,
|
|
211
222
|
`max_tokens`, and `max_completion_tokens`; Smart Compact therefore enforces a
|
|
212
223
|
15–90 second per-call watchdog plus a streamed visible-output ceiling and falls
|
|
@@ -286,11 +297,20 @@ guidance for reaching the target.
|
|
|
286
297
|
- Tool-call/tool-result pair integrity at the compaction boundary
|
|
287
298
|
- Collision-safe modified-file verification for monorepos
|
|
288
299
|
- Bounded fixed-point repair for patchable verification gaps, followed by a zero-gap deterministic quality floor
|
|
300
|
+
- High-risk success claims are grounded only in successful host/tool results or
|
|
301
|
+
deterministic resolved-error/file evidence; assistant prose is never proof
|
|
302
|
+
of its own claim.
|
|
303
|
+
- The window planner converts provider output caps through the calibrated local
|
|
304
|
+
estimator and reserves bounded deterministic repair/state additions before
|
|
305
|
+
choosing the retained tail.
|
|
306
|
+
- Recent resolved errors remain explicit in the Continuity Ledger instead of
|
|
307
|
+
disappearing when they leave the unresolved set.
|
|
289
308
|
- Cross-session guard and five-minute TTL for pending summaries
|
|
290
309
|
- Session-log recovery for older, truncated tool results
|
|
291
|
-
-
|
|
292
|
-
|
|
293
|
-
-
|
|
310
|
+
- The full selected pre-prune conversation is scrubbed and prepared in memory;
|
|
311
|
+
its 0600 backup is written only after the matching native compaction succeeds.
|
|
312
|
+
Marker-owned retention leaves foreign files in custom directories untouched.
|
|
313
|
+
- Private artifact directories are enforced as 0700 and files as 0600; stale state snapshots and orphaned atomic-write temp files are removed during bounded retention sweeps.
|
|
294
314
|
|
|
295
315
|
### Secrets and PII
|
|
296
316
|
|
|
@@ -301,9 +321,10 @@ boundary:
|
|
|
301
321
|
provider request · extraction cache · backup · state · context graph · pending summary
|
|
302
322
|
```
|
|
303
323
|
|
|
304
|
-
It covers common API keys,
|
|
305
|
-
|
|
306
|
-
|
|
324
|
+
It covers common API keys (including Google and Stripe), AWS/GitHub/GitLab/npm/
|
|
325
|
+
Slack tokens, JWTs, bearer tokens, private keys, secret-bearing object fields,
|
|
326
|
+
generic credential assignments, and passwords embedded in connection URIs.
|
|
327
|
+
Optional email/phone/payment-card scrubbing is available through `scrubPii`.
|
|
307
328
|
|
|
308
329
|
Secret scrubbing is defense in depth, **not a replacement for proper secret
|
|
309
330
|
handling or a dedicated DLP system**. See the
|
|
@@ -311,12 +332,13 @@ handling or a dedicated DLP system**. See the
|
|
|
311
332
|
|
|
312
333
|
### Approval and feedback
|
|
313
334
|
|
|
314
|
-
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
`Applied
|
|
335
|
+
- Manual runs show a fail-closed verified-summary **Apply / Cancel** review by
|
|
336
|
+
default (`requireApproval: true`); set it to `false` only to opt out of the
|
|
337
|
+
second modal after preflight. Review time is not charged to the pipeline
|
|
338
|
+
deadline. Fingerprint, continuity state, context graph, prepared backup, and
|
|
339
|
+
success telemetry commit only after the host confirms the matching native
|
|
340
|
+
`session_compact` event. The UI reports `Applied` at that point and separately
|
|
341
|
+
warns if any durable persistence side effect was partial.
|
|
320
342
|
- Online damage monitoring observes the first post-compaction messages and
|
|
321
343
|
records re-read files or repeated context. Observations join the originating
|
|
322
344
|
compaction by a local run id; missing evidence lowers coverage rather than
|
|
@@ -359,7 +381,7 @@ Add `smartCompact` to `~/.pi/agent/settings.json`:
|
|
|
359
381
|
"backupEnabled": true,
|
|
360
382
|
"scrubSecrets": true,
|
|
361
383
|
"scrubPii": false,
|
|
362
|
-
"requireApproval":
|
|
384
|
+
"requireApproval": true,
|
|
363
385
|
"maxLlmCalls": 8,
|
|
364
386
|
"maxLlmInputTokens": 0,
|
|
365
387
|
"codexMaxCallMs": 0,
|
|
@@ -426,13 +448,13 @@ the run fails closed before staging or apply.
|
|
|
426
448
|
| `summaryThinkingLevel` | `minimal \| low \| medium \| high \| xhigh \| max \| null` | `minimal` | Reasoning level for synthesis and repair; provider default when null |
|
|
427
449
|
| `segmentationThinkingLevel` | `minimal \| low \| medium \| high \| xhigh \| max \| null` | `minimal` | Reasoning level for exploration; provider default when null |
|
|
428
450
|
| `autoTrigger` | `boolean` | `true` | Participate in Pi's native compact hook |
|
|
429
|
-
| `autoTriggerTimeoutMs` | `number` | `120000` |
|
|
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 |
|
|
430
452
|
| `minContextPercent` | `number` | `60` | Auto/tool context gate; manual `/smart-compact` warns and bypasses it |
|
|
431
|
-
| `backupEnabled` | `boolean` | `true` |
|
|
453
|
+
| `backupEnabled` | `boolean` | `true` | Prepare a scrubbed pre-compaction backup; write it only after confirmed apply |
|
|
432
454
|
| `backupDir` | `string` | `~/.pi/agent/compact-backups` | Empty config value uses this path |
|
|
433
455
|
| `profiles` | object | built-ins | Per-profile numeric overrides |
|
|
434
456
|
| `pinPaths` | `string[]` | `[]` | Always preserve matching paths |
|
|
435
|
-
| `requireApproval` | `boolean` | `
|
|
457
|
+
| `requireApproval` | `boolean` | `true` | Manual verified-summary review; cancel/error fails closed |
|
|
436
458
|
| `scrubSecrets` | `boolean` | `true` | High-confidence credential redaction |
|
|
437
459
|
| `scrubPii` | `boolean` | `false` | Email/phone/card-shaped redaction |
|
|
438
460
|
| `maxLlmCalls` | integer `0–100` | `8` | Global ceiling combined with the selected mode |
|
|
@@ -546,8 +568,8 @@ coordinate hook order or prefer a single automatic compaction owner.
|
|
|
546
568
|
|
|
547
569
|
```bash
|
|
548
570
|
bun install --frozen-lockfile
|
|
549
|
-
bun run release:check # typecheck + tests + adversarial
|
|
550
|
-
bun run bench
|
|
571
|
+
bun run release:check # typecheck + tests + adversarial/performance gates + build + package audit
|
|
572
|
+
bun run bench # standalone hot-path p95 regression gate
|
|
551
573
|
bun run compat:pi # isolated latest-Pi compatibility check
|
|
552
574
|
```
|
|
553
575
|
|
package/SECURITY.md
CHANGED
|
@@ -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;
|
|
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;IACpB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACT,GAAG,sBAAsB,CA4G9B"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
package/dist/app/preflight.d.ts
CHANGED
|
@@ -1,12 +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";
|
|
3
|
+
import type { CompactConfig, EffectiveCompactionMode, ProfileConfig, ProviderCapabilities, SessionMessageEntry } from "../types.ts";
|
|
4
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: ProviderCapabilities;
|
|
10
11
|
adapted: boolean;
|
|
11
12
|
damageMedian: number;
|
|
12
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;
|
|
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,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIhJ,OAAO,EAA2D,KAAK,qBAAqB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE9I,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,oBAAoB,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,kFAAkF;AAClF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,IAAI,EAAE,uBAAuB,CAAC;IAC9B,gBAAgB,EAAE,qBAAqB,CAAC;IACxC,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,wBAAwB,CAmB3B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,uBAAuB,CAAC;IAC9B,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAClC,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,qBAAqB,CAAC;IAC/D,UAAU,EAAE,aAAa,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,EAAE,MAAM,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,EAAE,MAAM,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,uEAAuE;AACvE,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,gBAAgB,EACrB,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,EACxB,gBAAgB,EAAE,qBAAqB,GACtC,sBAAsB,CAsBxB;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,gBAAgB,EACrB,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,EACxB,IAAI,EAAE,uBAAuB,EAC7B,gBAAgB,EAAE,qBAAqB,EACvC,MAAM,EAAE,aAAa,EACrB,YAAY,CAAC,EAAE,MAAM,EACrB,MAAM,GAAE,sBAA2F,GAClG,eAAe,CAqCjB"}
|