pi-smart-compact 8.0.2 → 8.0.5
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/CHANGELOG.md +42 -0
- package/README.md +49 -16
- package/dist/app/preflight.d.ts +38 -0
- package/dist/app/preflight.d.ts.map +1 -0
- package/dist/app/run-context.d.ts +24 -0
- package/dist/app/run-context.d.ts.map +1 -1
- package/dist/app/run-smart-compact.d.ts +4 -0
- package/dist/app/run-smart-compact.d.ts.map +1 -1
- package/dist/app/steps/metrics.d.ts.map +1 -1
- package/dist/app/steps/persist.d.ts.map +1 -1
- package/dist/app/steps/prepare.d.ts.map +1 -1
- package/dist/app/steps/state.d.ts.map +1 -1
- package/dist/app/steps/tier.d.ts.map +1 -1
- package/dist/app/steps/verify.d.ts +2 -2
- package/dist/app/steps/verify.d.ts.map +1 -1
- package/dist/app/steps/window.d.ts +17 -16
- package/dist/app/steps/window.d.ts.map +1 -1
- package/dist/constants.d.ts +3 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/domain/summary-parse.d.ts +2 -0
- package/dist/domain/summary-parse.d.ts.map +1 -1
- package/dist/domain/telemetry.d.ts.map +1 -1
- package/dist/domain/yield-gate.d.ts +35 -0
- package/dist/domain/yield-gate.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3268 -2927
- package/dist/infra/context-graph.d.ts.map +1 -1
- package/dist/phases/synthesize.d.ts.map +1 -1
- package/dist/phases/verify.d.ts +14 -0
- package/dist/phases/verify.d.ts.map +1 -1
- package/dist/provider-eval.js +1 -1
- package/dist/provider-scenario-eval.js +8 -4
- package/dist/telemetry-report.js +3 -1
- package/dist/types.d.ts +28 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/dashboard-format.d.ts.map +1 -1
- package/dist/ui/error-format.d.ts +3 -0
- package/dist/ui/error-format.d.ts.map +1 -0
- package/dist/ui/overlays.d.ts +16 -8
- package/dist/ui/overlays.d.ts.map +1 -1
- package/dist/utils/extraction.d.ts.map +1 -1
- package/dist/utils/helpers.d.ts +11 -9
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/state.d.ts.map +1 -1
- package/dist/utils/type-guards.d.ts.map +1 -1
- package/docs/MIGRATING_TO_V8.md +6 -3
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,48 @@
|
|
|
4
4
|
|
|
5
5
|
No changes yet.
|
|
6
6
|
|
|
7
|
+
## [8.0.5] - 2026-08-07
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Verify/continuity rejection no longer emits evidence-bearing findings and then repeats the exception with a full JavaScript stack in the manual UI. Verification and yield failures now render one bounded, content-free line with score/count/kinds or target estimates; full stacks are emitted only when `DEBUG=smart-compact` is explicitly enabled.
|
|
12
|
+
- Unknown provider/native-apply errors collapse multiline text and cap the visible message, preventing the `EESV Verify: Checking` phase from being followed by pages of diagnostic output. Conversation-unchanged guidance remains explicit.
|
|
13
|
+
|
|
14
|
+
## [8.0.4] - 2026-08-07
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Manual `/smart-compact` now opens one keyboard-first preflight screen driven by the same calibrated planner used for execution. It shows estimated before/after window pressure, projected net savings, live-tail and summary budgets, soft boundaries that will be summarized, hard safeguards, and an explainable mode recommendation. `D` progressively reveals estimator and boundary details; `M` changes the summary route and recalculates the plan.
|
|
19
|
+
- Semantic progress feedback reports Extract, optional Explore, Synthesize, Verify, and Apply without per-batch toast noise. Final feedback compares the plan with the applied estimate and appears only after Pi confirms the matching `session_compact` run ID.
|
|
20
|
+
- Privacy-safe metrics/details now distinguish projected and applied estimates, yield, retention target, summary budget, relaxed soft-boundary kinds, and hard-boundary adjustment. Post-summary yield rejection has its own content-free failure kind.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Context reduction is now the binding success contract. Recent user turns, pi-toolkit checkpoints, and topical grouping are soft fidelity preferences retained only when they fit the mode budget; complete tool-call/result pairs and zero-gap verification remain hard.
|
|
25
|
+
- Every plan must project at least 10% net savings before any LLM call. After synthesis and continuity repair, the measured summary must still meet the planned target and 10% floor or the run fails closed before staging/apply.
|
|
26
|
+
- `requireApproval: false` no longer shows a redundant second result modal after the user approves the preflight. `requireApproval: true` retains the final verified-summary Apply/Cancel review.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- A long pair of user turns can no longer override an explicit manual tail target and turn a high-yield plan into a misleading low-yield success. The captured 174,797-token production replay now plans 144,588 tokens for compaction and about 30,209 for the live tail instead of retaining 167,352 tokens and saving only 5,764.
|
|
31
|
+
- The configured summary route, not the active context model, is the default hidden-behind-Advanced model in manual preflight. Preview and execution share the same config snapshot, adaptive profile, calibration, and active branch.
|
|
32
|
+
- Mode descriptions, narrow-terminal wrapping, active-versus-summary labels, and success timing now match actual behavior; `Applied` is never reported from an unconfirmed native callback.
|
|
33
|
+
|
|
34
|
+
## [8.0.3] - 2026-08-07
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- Explicit manual `/smart-compact` now uses the absolute adaptive safety tail instead of a context-window percentage target. A 219K-token session on a 1M-token model therefore compacts in `thorough`, `balanced`, or `fast` mode instead of silently doing nothing unless `aggressive` happens to cross the estimator-dependent boundary.
|
|
39
|
+
- Overflow recovery no longer delegates an already-oversized context to native's one-shot summarizer. When reported usage exceeds the active model window (for example 372K tokens after switching to a 272K model), EESV maps measured usage across active messages, summarizes through soft recent-turn/checkpoint protections, and still preserves complete tool-call/result pairs.
|
|
40
|
+
- Low-yield, below-threshold, repeated, too-small, unsafe-boundary, and concurrent manual attempts now warn rather than disappearing silently; protected recent user turns, tool-call/result integrity, and fail-closed verification remain mandatory.
|
|
41
|
+
- Phase 4 deterministic repair now converges through bounded passes and passes only patchable findings. Any zero-gap deterministic fallback replaces unverifiable model output; rejection occurs only when that fallback also cannot verify.
|
|
42
|
+
- Fallback, repair, continuity-ledger, open-loop, delta, and failed-chunk rendering flatten extracted multiline evidence before inserting it into Markdown, preventing diagnostic text from creating forged sections.
|
|
43
|
+
- Semantic contradiction detection now requires concept overlap and ignores shared numeric identifiers, preventing unrelated constraints with anchors such as `release`, `build`, or `2026` from contradicting each other.
|
|
44
|
+
- Long explicit decisions retain their full bounded semantic evidence during repair, and successful shell output that merely contains source-code error words is no longer cataloged as an unresolved command failure.
|
|
45
|
+
- `thorough` mode may use its configured LLM repair for any remaining finding, including a high-score single gap; the repair prompt can remove fabrications and correct polarity instead of only appending text.
|
|
46
|
+
- Verification failures now emit a dedicated privacy-safe telemetry kind with score/count/gap kinds, rather than being collapsed into `internal` without diagnostics.
|
|
47
|
+
- Context graph storage now uses `bun:sqlite` only under Bun and a `node:sqlite` `DatabaseSync` adapter under Pi's Node runtime. The packed-artifact audit executes a real save/recall transaction under Node so this runtime mismatch cannot recur.
|
|
48
|
+
|
|
7
49
|
## [8.0.2] - 2026-08-07
|
|
8
50
|
|
|
9
51
|
### Fixed
|
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ pi install git:github.com/alpertarhan/pi-smart-compact
|
|
|
31
31
|
## Quick start
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
/smart-compact #
|
|
34
|
+
/smart-compact # explainable single-screen preflight
|
|
35
35
|
/smart-compact auto # adaptive default
|
|
36
36
|
/smart-compact anthropic/claude-sonnet-4 fast # direct model + mode
|
|
37
37
|
/smart-compact balanced --focus=auth # preserve extra auth detail
|
|
@@ -63,7 +63,7 @@ The design principle is simple:
|
|
|
63
63
|
|
|
64
64
|
> **Facts first. Synthesis second. Verification before apply.**
|
|
65
65
|
|
|
66
|
-
Any unresolved verification gap rejects the custom summary before staging or apply. Automatic
|
|
66
|
+
Any unresolved verification gap rejects the custom summary before staging or apply. A zero-gap deterministic fallback is preferred over unverifiable model output; only failure of that fallback rejects the run. 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.
|
|
67
67
|
|
|
68
68
|
## EESV pipeline
|
|
69
69
|
|
|
@@ -86,7 +86,7 @@ Pi conversation
|
|
|
86
86
|
| **Extract** | Deterministically catalogs files, errors, decisions, constraints, topics, media metadata, and open loops. This is the verification ground truth. |
|
|
87
87
|
| **Explore** | Runs only in `thorough` mode (or when `auto` selects it); cheaper modes use deterministic boundaries. |
|
|
88
88
|
| **Synthesize** | Uses adaptive single-pass or bounded hierarchical synthesis with per-mode call, prompt-token, chunk, and output budgets. |
|
|
89
|
-
| **Verify** |
|
|
89
|
+
| **Verify** | Applies deterministic repairs to a bounded fixed point, then uses a verified deterministic quality floor. Only `thorough` may spend one additional LLM repair call before that fallback. |
|
|
90
90
|
|
|
91
91
|
### What survives compaction
|
|
92
92
|
|
|
@@ -121,11 +121,35 @@ Set `contextGraphEnabled` to `false` to disable indexing and both tools.
|
|
|
121
121
|
|
|
122
122
|
| Surface | Behavior |
|
|
123
123
|
| --- | --- |
|
|
124
|
-
| `/smart-compact` | Explicit manual run.
|
|
124
|
+
| `/smart-compact` | Explicit manual run. Opens a target-first preflight or accepts direct args, dry-run, focus, and budgets. |
|
|
125
125
|
| `session_before_compact` | Auto path. Returns/stages a verification-scored summary under pressure; durable state waits for matching `session_compact`. |
|
|
126
126
|
| `smart_compact` tool | Agent path. Produces a pending summary for Pi's next natural compact; does not compact mid-turn. |
|
|
127
127
|
| `/smart-compact loops` | Project-level open-loop manager: resolve/reopen, priority, pin/unpin. |
|
|
128
128
|
|
|
129
|
+
### Manual preflight
|
|
130
|
+
|
|
131
|
+
The interactive command uses the configured summary route and the exact
|
|
132
|
+
execution planner before spending LLM tokens. The primary screen shows the
|
|
133
|
+
recommended fidelity preset, why it fits the current pressure/session shape,
|
|
134
|
+
estimated context before and after, projected savings, live-tail and summary
|
|
135
|
+
budgets, soft boundaries that will be summarized, and the hard tool-pair plus
|
|
136
|
+
zero-gap-verification guarantees.
|
|
137
|
+
|
|
138
|
+
- `↑` / `↓` changes `Thorough`, `Balanced`, or `Fast` and recalculates the plan.
|
|
139
|
+
- `Enter` runs only a viable plan; `Esc` cancels without mutation.
|
|
140
|
+
- `D` toggles calibrated estimator, target, boundary, and route details.
|
|
141
|
+
- `M` opens Advanced model selection and replans with that route's calibration.
|
|
142
|
+
|
|
143
|
+
Values remain estimates until the next provider turn reports usage. Smart
|
|
144
|
+
Compact therefore uses `~`/`≤` language, measures the completed summary again
|
|
145
|
+
before staging, and reports final success only after Pi confirms the matching
|
|
146
|
+
`session_compact` run ID. A single long user turn may be split at a safe message
|
|
147
|
+
boundary: its older prefix is verified into the summary while the budgeted
|
|
148
|
+
working tail stays raw. Tool exchanges are summarized or retained as complete
|
|
149
|
+
call/result pairs, never split. If Verify, yield, provider, or native apply
|
|
150
|
+
fails, the UI shows one bounded actionable line without evidence text or a
|
|
151
|
+
JavaScript stack. Stack diagnostics are opt-in with `DEBUG=smart-compact`.
|
|
152
|
+
|
|
129
153
|
### Focus and budgets
|
|
130
154
|
|
|
131
155
|
```bash
|
|
@@ -155,7 +179,7 @@ The tool exposes equivalent `focus`, `max_calls`, `max_input_tokens`, and
|
|
|
155
179
|
| `fast` | 3 | 100K | 20K | Favors larger single-pass windows and minimum waiting |
|
|
156
180
|
| `thorough` (`slow` alias) | 8 | 300K | 80K | Maximum fidelity; enables Explore and one optional LLM repair |
|
|
157
181
|
|
|
158
|
-
Fast and aggressive modes use a zero-call deterministic summary when extraction confidence is high; otherwise they keep the bounded LLM path. Auto planning also raises fidelity when scoped continuity or prior damage indicates risk.
|
|
182
|
+
Fast and aggressive modes use a zero-call deterministic summary when extraction confidence is high; otherwise they keep the bounded LLM path. Auto planning also raises fidelity when scoped continuity or prior damage indicates risk. The mode token target is binding: recent user turns, pi-toolkit checkpoints, and topical grouping remain raw only when they fit the planned tail; otherwise the verified summary carries them forward.
|
|
159
183
|
|
|
160
184
|
Output caps stop subsequent calls after observed usage reaches the threshold.
|
|
161
185
|
The ChatGPT Codex subscription endpoint rejects `max_output_tokens`,
|
|
@@ -202,7 +226,8 @@ Raw local JSONL remains available to the interactive dashboard, while
|
|
|
202
226
|
`bun run telemetry-report` emits aggregate-only telemetry: no session/project
|
|
203
227
|
IDs, prompts, summaries, paths, or error text. Failures use a stable taxonomy
|
|
204
228
|
(cancelled, timeout, rate limit, authentication, budget, output limit,
|
|
205
|
-
provider, persistence, validation, internal).
|
|
229
|
+
provider, persistence, validation, verification, internal). Verification failures
|
|
230
|
+
retain only content-free score/count/gap-kind diagnostics.
|
|
206
231
|
|
|
207
232
|
Set `telemetryChannel` to `canary` only on the externally selected canary
|
|
208
233
|
cohort. The report compares schema-v2 canary runs with the stable baseline and
|
|
@@ -231,7 +256,7 @@ guidance for reaching the target.
|
|
|
231
256
|
- Exact access-call pruning—different reads, searches, offsets, and patterns do not collapse
|
|
232
257
|
- Tool-call/tool-result pair integrity at the compaction boundary
|
|
233
258
|
- Collision-safe modified-file verification for monorepos
|
|
234
|
-
-
|
|
259
|
+
- Bounded fixed-point repair for patchable verification gaps, followed by a zero-gap deterministic quality floor
|
|
235
260
|
- Cross-session guard and five-minute TTL for pending summaries
|
|
236
261
|
- Session-log recovery for older, truncated tool results
|
|
237
262
|
- Marker-owned retention-pruned backups before compaction; foreign files in a
|
|
@@ -256,10 +281,12 @@ handling or a dedicated DLP system**. See the
|
|
|
256
281
|
|
|
257
282
|
### Approval and feedback
|
|
258
283
|
|
|
259
|
-
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
284
|
+
- The manual preflight is the default decision point. `requireApproval: true`
|
|
285
|
+
additionally shows a fail-closed verified-summary **Apply / Cancel** review;
|
|
286
|
+
`false` avoids a redundant second modal. Fingerprint, continuity state,
|
|
287
|
+
context graph, and success telemetry commit only after the host confirms the
|
|
288
|
+
matching native `session_compact` event, and only then does the UI report
|
|
289
|
+
`Applied`.
|
|
263
290
|
- Online damage monitoring observes the first post-compaction messages and
|
|
264
291
|
records re-read files or repeated context. Observations join the originating
|
|
265
292
|
compaction by a local run id; missing evidence lowers coverage rather than
|
|
@@ -345,10 +372,16 @@ Automatic and tool-triggered runs operate on Pi's current active context, not
|
|
|
345
372
|
the append-only session history. A same-session staged summary is reused, the
|
|
346
373
|
exploration loop is limited to three rounds, provider and outer retries are
|
|
347
374
|
disabled, and every mode has finite call plus aggregate prompt-token budgets.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
375
|
+
Complete tool-call/result pairs are the hard window boundary. Recent user
|
|
376
|
+
turns, pi-toolkit checkpoints, and topical grouping are soft and may expand the
|
|
377
|
+
raw tail only while remaining inside the selected budget. Automatic/tool runs
|
|
378
|
+
normally return to Pi's native compactor without an LLM call when a hard
|
|
379
|
+
boundary cannot meet the target. Overflow is the safety exception: EESV keeps
|
|
380
|
+
chunked recovery rather than resending an oversized one-shot prompt to native
|
|
381
|
+
compaction. Manual `/smart-compact` uses an absolute adaptive tail rather than
|
|
382
|
+
a percentage of a large model window. A plan below 10% projected savings never
|
|
383
|
+
starts; if the measured final summary misses the same yield/target contract,
|
|
384
|
+
the run fails closed before staging or apply.
|
|
352
385
|
|
|
353
386
|
<details>
|
|
354
387
|
<summary><strong>All configuration keys</strong></summary>
|
|
@@ -364,7 +397,7 @@ Manual `/smart-compact` remains an explicit force path.
|
|
|
364
397
|
| `segmentationThinkingLevel` | `minimal \| low \| medium \| high \| xhigh \| max \| null` | `minimal` | Reasoning level for exploration; provider default when null |
|
|
365
398
|
| `autoTrigger` | `boolean` | `true` | Participate in Pi's native compact hook |
|
|
366
399
|
| `autoTriggerTimeoutMs` | `number` | `120000` | Hard timeout for automatic runs |
|
|
367
|
-
| `minContextPercent` | `number` | `60` |
|
|
400
|
+
| `minContextPercent` | `number` | `60` | Auto/tool context gate; manual `/smart-compact` warns and bypasses it |
|
|
368
401
|
| `backupEnabled` | `boolean` | `true` | Write a pre-compaction backup |
|
|
369
402
|
| `backupDir` | `string` | `~/.pi/agent/compact-backups` | Empty config value uses this path |
|
|
370
403
|
| `profiles` | object | built-ins | Per-profile numeric overrides |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { Api, Model } from "@earendil-works/pi-ai";
|
|
3
|
+
import type { CompactConfig, EffectiveCompactionMode, ProfileConfig } from "../types.ts";
|
|
4
|
+
import { type TokenCalibrationStore, type TokenEstimator } from "../utils/tokens.ts";
|
|
5
|
+
import type { CompactionWindowPlan } from "./run-context.ts";
|
|
6
|
+
export declare function preflightDamageMedian(cwd: string, config: CompactConfig): number;
|
|
7
|
+
export interface PreparedPreflightProfile {
|
|
8
|
+
profileCfg: ProfileConfig;
|
|
9
|
+
estimator: TokenEstimator;
|
|
10
|
+
adapted: boolean;
|
|
11
|
+
damageMedian: number;
|
|
12
|
+
}
|
|
13
|
+
/** Shared deterministic preparation used by both the preview and the real run. */
|
|
14
|
+
export declare function preparePreflightProfile(input: {
|
|
15
|
+
cwd: string;
|
|
16
|
+
summaryModel: Model<Api>;
|
|
17
|
+
mode: EffectiveCompactionMode;
|
|
18
|
+
tokenCalibration: TokenCalibrationStore;
|
|
19
|
+
config: CompactConfig;
|
|
20
|
+
damageMedian?: number;
|
|
21
|
+
}): PreparedPreflightProfile;
|
|
22
|
+
export interface ManualPreflight {
|
|
23
|
+
mode: EffectiveCompactionMode;
|
|
24
|
+
plan: CompactionWindowPlan | null;
|
|
25
|
+
reason: CompactionWindowPlan["reason"] | "not-enough-messages";
|
|
26
|
+
profileCfg: ProfileConfig;
|
|
27
|
+
totalTokens: number;
|
|
28
|
+
rawEstimatedMessageTokens: number;
|
|
29
|
+
estimatorScale: number;
|
|
30
|
+
adapted: boolean;
|
|
31
|
+
damageMedian: number;
|
|
32
|
+
contextWindowTokens: number;
|
|
33
|
+
contextPercent: number;
|
|
34
|
+
toolPercent: number;
|
|
35
|
+
overflowedContext: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function planManualPreflight(ctx: ExtensionContext, summaryModel: Model<Api>, mode: EffectiveCompactionMode, tokenCalibration: TokenCalibrationStore, config: CompactConfig, damageMedian?: number): ManualPreflight;
|
|
38
|
+
//# sourceMappingURL=preflight.d.ts.map
|
|
@@ -0,0 +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,EAAuB,MAAM,aAAa,CAAC;AAI1H,OAAO,EAAsB,KAAK,qBAAqB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,MAAM,CAIhF;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,aAAa,CAAC;IAC1B,SAAS,EAAE,cAAc,CAAC;IAC1B,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,CAkB3B;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,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,GACpB,eAAe,CA4CjB"}
|
|
@@ -63,6 +63,8 @@ export interface RunFlags {
|
|
|
63
63
|
autoTriggered: boolean;
|
|
64
64
|
skipCompact: boolean;
|
|
65
65
|
force: boolean;
|
|
66
|
+
/** Pi is retrying a provider turn that exceeded the active model window. */
|
|
67
|
+
overflowRecovery?: boolean;
|
|
66
68
|
}
|
|
67
69
|
export interface ResolvedAuth {
|
|
68
70
|
apiKey: string;
|
|
@@ -72,6 +74,8 @@ export interface RcBase {
|
|
|
72
74
|
/** Unique id for correlating staged and applied compaction lifecycle events. */
|
|
73
75
|
runId: string;
|
|
74
76
|
ctx: ExtensionContext;
|
|
77
|
+
/** Optional caller snapshot; prepareRun loads config only when absent. */
|
|
78
|
+
config?: CompactConfig;
|
|
75
79
|
notify: Notifier;
|
|
76
80
|
vlog: (msg: string) => void;
|
|
77
81
|
services: SmartCompactServices;
|
|
@@ -111,6 +115,24 @@ export interface PreparedExt {
|
|
|
111
115
|
verifyAuth?: ResolvedAuth;
|
|
112
116
|
}
|
|
113
117
|
export type PreparedRc = RcBase & PreparedExt;
|
|
118
|
+
export type RelaxedSoftBoundary = "recent-user-turn" | "anchor" | "topical";
|
|
119
|
+
export type CompactionPlanReason = "viable" | "no-eligible-prefix" | "unsafe-tool-boundary" | "retention-target-exceeded" | "mode-target-not-met" | "insufficient-projected-saving";
|
|
120
|
+
export interface CompactionWindowPlan {
|
|
121
|
+
keepFrom: number;
|
|
122
|
+
compactTokens: number;
|
|
123
|
+
retainedTokens: number;
|
|
124
|
+
projectedAfterTokens: number;
|
|
125
|
+
projectedSavedTokens: number;
|
|
126
|
+
projectedYield: number;
|
|
127
|
+
fixedContextTokens: number;
|
|
128
|
+
retentionTargetTokens: number;
|
|
129
|
+
summaryBudgetTokens: number;
|
|
130
|
+
targetAfterTokens: number;
|
|
131
|
+
hardBoundaryAdjusted: boolean;
|
|
132
|
+
viable: boolean;
|
|
133
|
+
reason: CompactionPlanReason;
|
|
134
|
+
relaxedSoftBoundaries: RelaxedSoftBoundary[];
|
|
135
|
+
}
|
|
114
136
|
export interface WindowedExt extends PreparedExt {
|
|
115
137
|
readonly _windowed: true;
|
|
116
138
|
sessionId: string;
|
|
@@ -126,6 +148,8 @@ export interface WindowedExt extends PreparedExt {
|
|
|
126
148
|
compactTokens: number;
|
|
127
149
|
/** Estimated retained-tail tokens, normalized to Pi's measured context. */
|
|
128
150
|
accTokens: number;
|
|
151
|
+
/** Content-free plan used to gate execution and, later, preview it in the UI. */
|
|
152
|
+
compactionPlan: CompactionWindowPlan;
|
|
129
153
|
}
|
|
130
154
|
export type WindowedRc = RcBase & WindowedExt;
|
|
131
155
|
export interface RecoveredExt extends WindowedExt {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-context.d.ts","sourceRoot":"","sources":["../../src/app/run-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE,CAAC;IAC3B,sBAAsB,EAAE,OAAO,aAAa,EAAE,sBAAsB,CAAC;IACrE,QAAQ,EAAE,OAAO,CAAC;CACnB;AACD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;AAQ9C,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB;AACD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;AAElC,uEAAuE;AACvE,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,EACnC,OAAO,EAAE,MAAM,EACf,KAAK,SAAa,GACjB,IAAI,CAGN;AAED,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,IAAI,CAE/E;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,GAAG,SAAS,MAAM,EAAE,IAAI,SAAS,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,IAAI,GAAG,IAAI,CAE/F"}
|
|
@@ -49,6 +49,8 @@ export interface SmartCompactOptions {
|
|
|
49
49
|
* need?" explicit at the type level.
|
|
50
50
|
*/
|
|
51
51
|
ctx: ExtensionContext;
|
|
52
|
+
/** Reuse a caller-loaded snapshot when preview and execution must agree. */
|
|
53
|
+
config?: import("../types.ts").CompactConfig;
|
|
52
54
|
summaryModel: Model<Api>;
|
|
53
55
|
segModel: Model<Api>;
|
|
54
56
|
/** Optional explicit verification/repair route; defaults to the summary model. */
|
|
@@ -68,6 +70,8 @@ export interface SmartCompactOptions {
|
|
|
68
70
|
skipCompact?: boolean;
|
|
69
71
|
/** Explicit user command may bypass adaptive context-pressure tier gate. */
|
|
70
72
|
force?: boolean;
|
|
73
|
+
/** Native hook reason is overflow; EESV must not resend the rejected window to native summarization. */
|
|
74
|
+
overflowRecovery?: boolean;
|
|
71
75
|
/** Optional hard budget for native auto-trigger only. Manual/tool runs do not time out by default. */
|
|
72
76
|
timeoutMs?: number;
|
|
73
77
|
/** Host cancellation for tool/manual callers. Linked to the pipeline controller. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-smart-compact.d.ts","sourceRoot":"","sources":["../../src/app/run-smart-compact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKtE,OAAO,KAAK,EACQ,UAAU,EAC7B,MAAM,kBAAkB,CAAC;AAc1B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,0EAA0E;AAC1E,MAAM,WAAW,mBAAmB;IAClC;;;;;;;OAOG;IACH,GAAG,EAAE,gBAAgB,CAAC;IACtB,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACrB,kFAAkF;IAClF,WAAW,CAAC,EAAE,KAAK,CAAC,GAAG,CA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1B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IACpD,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC;CAC/D;AAuDD,wBAAsB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgM9E"}
|
|
@@ -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,
|
|
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,CAmDjB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI,CAkBpG;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,gBAAgB,EAAE,cAAc,CAAC;CAChD;AAED,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,MAAM,GAAG,QAAQ,EACrB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,oBAAoB,GAC3B,IAAI,CAmEN"}
|
|
@@ -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;AASrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
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;AASrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAQlD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CASpE;AAED,gFAAgF;AAChF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAWxE;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,CAkB3G;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAoBlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../src/app/steps/prepare.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAgB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../src/app/steps/prepare.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAgB,MAAM,mBAAmB,CAAC;AAW1E,wBAAsB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CA2DvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/app/steps/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/app/steps/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAiB9D,wBAAgB,UAAU,CAAC,EAAE,EAAE,UAAU,GAAG,QAAQ,CA6InD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tier.d.ts","sourceRoot":"","sources":["../../../src/app/steps/tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAc,MAAM,mBAAmB,CAAC;AAK3E,wBAAgB,UAAU,CAAC,EAAE,EAAE,WAAW,GAAG,QAAQ,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"tier.d.ts","sourceRoot":"","sources":["../../../src/app/steps/tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAc,MAAM,mBAAmB,CAAC;AAK3E,wBAAgB,UAAU,CAAC,EAAE,EAAE,WAAW,GAAG,QAAQ,GAAG,IAAI,CAmB3D"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Step 7: verify and repair the synthesized summary.
|
|
3
3
|
*
|
|
4
4
|
* Every safe deterministic repair is applied regardless of scalar score. The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* mode policy controls whether unresolved findings get an additional LLM call;
|
|
6
|
+
* score remains diagnostic and never suppresses known, zero-cost repairs.
|
|
7
7
|
*/
|
|
8
8
|
import type { SynthesizedRc, VerifiedRc } from "../run-context.ts";
|
|
9
9
|
export declare function verifyAndPatch(rc: SynthesizedRc): Promise<VerifiedRc>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/app/steps/verify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/app/steps/verify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAYnE,wBAAsB,cAAc,CAAC,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CA0F3E"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
/** Step 2: select and validate the active-context prefix to summarize. */
|
|
2
|
+
import type { CompactionWindowPlan, PreparedRc, WindowedRc } from "../run-context.ts";
|
|
3
|
+
import type { EffectiveCompactionMode, ProfileConfig, SessionMessageEntry } from "../../types.ts";
|
|
4
|
+
export type { CompactionWindowPlan } from "../run-context.ts";
|
|
5
|
+
export interface CompactionWindowPlanInput {
|
|
6
|
+
msgs: SessionMessageEntry[];
|
|
7
|
+
branch: unknown[];
|
|
8
|
+
messageTokens: number[];
|
|
9
|
+
totalTokens: number;
|
|
10
|
+
modelContextWindow?: number;
|
|
11
|
+
mode: EffectiveCompactionMode;
|
|
12
|
+
profileCfg: ProfileConfig;
|
|
13
|
+
force: boolean;
|
|
14
|
+
overflowedContext: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Pure, content-free result suitable for both execution and a later UI preview. */
|
|
17
|
+
export declare function planCompactionWindow(input: CompactionWindowPlanInput): CompactionWindowPlan;
|
|
17
18
|
export declare function resolveCompactionWindow(rc: PreparedRc): WindowedRc | null;
|
|
18
19
|
//# sourceMappingURL=window.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../src/app/steps/window.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../src/app/steps/window.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAE1E,OAAO,KAAK,EACY,oBAAoB,EAAE,UAAU,EAAuB,UAAU,EACxF,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,uBAAuB,EAAc,aAAa,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAM9G,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;CAC5B;AAED,oFAAoF;AACpF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,oBAAoB,CAmG3F;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CA2EzE"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -8,8 +8,10 @@ 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 = "8.0.
|
|
11
|
+
export declare const VERSION = "8.0.5";
|
|
12
12
|
export declare const CHARS_PER_TOKEN = 3.8;
|
|
13
|
+
export declare const MIN_COMPACTION_SAVING_RATIO = 0.1;
|
|
14
|
+
export declare const ESTIMATOR_ROUNDING_TOLERANCE_TOKENS = 1;
|
|
13
15
|
export declare const COMPACT_SYSTEM_PREFIX: string;
|
|
14
16
|
export declare const PROFILES: Record<CompressionProfile, ProfileConfig>;
|
|
15
17
|
export declare const DEFAULT_CONFIG: {
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -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,MA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AC7E,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAOvC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAGtC,eAAO,MAAM,qBAAqB,QAAkB,CAAC;AAGrD,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAGvC,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAG/C,eAAO,MAAM,UAAU,iBAAiB,CAAC;AACzC,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,sBAAsB,QAU6T,CAAC"}
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
* duplicate body lines removed. Unknown sections remain independent.
|
|
19
19
|
*/
|
|
20
20
|
import { CanonicalSummary, Section, SectionKind } from "./summary-schema.ts";
|
|
21
|
+
/** Collapse untrusted extracted evidence to one Markdown-safe line. */
|
|
22
|
+
export declare function summaryEvidenceLine(value: string, maxLength: number): string;
|
|
21
23
|
export declare function parseSummary(markdown: string): CanonicalSummary;
|
|
22
24
|
/** Find the first section matching the requested kind. */
|
|
23
25
|
export declare function findSection(summary: CanonicalSummary | string, kind: SectionKind): Section | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary-parse.d.ts","sourceRoot":"","sources":["../../src/domain/summary-parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,EAAqC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"summary-parse.d.ts","sourceRoot":"","sources":["../../src/domain/summary-parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,EAAqC,MAAM,qBAAqB,CAAC;AAKhH,uEAAuE;AACvE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAQ5E;AAYD,wBAAgB,YAAY,CA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gB,YAAY,CAC1B,OAAO,EAAE,SAAS,mBAAmB,EAAE,EACvC,aAAa,EAAE,SAAS,oBAAoB,EAAE,EAC9C,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1E,gBAAgB,CAiFlB;AAYD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,SAAS,mBAAmB,EAAE,EACvC,aAAa,EAAE,SAAS,oBAAoB,EAAE,EAC9C,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GACnD,oBAAoB,CAoDtB;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAiC/E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CompactionWindowPlan } from "../app/run-context.ts";
|
|
2
|
+
export interface CompactionYieldEstimate {
|
|
3
|
+
plannedAfterTokens: number;
|
|
4
|
+
plannedSavedTokens: number;
|
|
5
|
+
plannedYield: number;
|
|
6
|
+
estimatedAfterTokens: number;
|
|
7
|
+
estimatedSavedTokens: number;
|
|
8
|
+
estimatedYield: number;
|
|
9
|
+
retainedTailTokens: number;
|
|
10
|
+
summaryTokens: number;
|
|
11
|
+
summaryBudgetTokens: number;
|
|
12
|
+
targetAfterTokens: number;
|
|
13
|
+
relaxedSoftBoundaries: CompactionWindowPlan["relaxedSoftBoundaries"];
|
|
14
|
+
hardBoundaryAdjusted: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Content-free failure raised before any compaction side effect. */
|
|
17
|
+
export declare class YieldGateError extends Error implements CompactionYieldEstimate {
|
|
18
|
+
readonly reason: "target-miss" | "insufficient-saving";
|
|
19
|
+
readonly name = "YieldGateError";
|
|
20
|
+
constructor(reason: "target-miss" | "insufficient-saving", estimate: CompactionYieldEstimate);
|
|
21
|
+
plannedAfterTokens: number;
|
|
22
|
+
plannedSavedTokens: number;
|
|
23
|
+
plannedYield: number;
|
|
24
|
+
estimatedAfterTokens: number;
|
|
25
|
+
estimatedSavedTokens: number;
|
|
26
|
+
estimatedYield: number;
|
|
27
|
+
retainedTailTokens: number;
|
|
28
|
+
summaryTokens: number;
|
|
29
|
+
summaryBudgetTokens: number;
|
|
30
|
+
targetAfterTokens: number;
|
|
31
|
+
relaxedSoftBoundaries: CompactionWindowPlan["relaxedSoftBoundaries"];
|
|
32
|
+
hardBoundaryAdjusted: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function verifyCompactionYield(totalTokens: number, summaryTokens: number, plan: CompactionWindowPlan): CompactionYieldEstimate;
|
|
35
|
+
//# sourceMappingURL=yield-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yield-gate.d.ts","sourceRoot":"","sources":["../../src/domain/yield-gate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,MAAM,WAAW,uBAAuB;IACtC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IACrE,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,qEAAqE;AACrE,qBAAa,cAAe,SAAQ,KAAM,YAAW,uBAAuB;aAG9C,MAAM,EAAE,aAAa,GAAG,qBAAqB;IAFzE,QAAQ,CAAC,IAAI,oBAAoB;IAEjC,YAA4B,MAAM,EAAE,aAAa,GAAG,qBAAqB,EAAE,QAAQ,EAAE,uBAAuB,EAK3G;IAED,kBAAkB,EAAG,MAAM,CAAC;IAC5B,kBAAkB,EAAG,MAAM,CAAC;IAC5B,YAAY,EAAG,MAAM,CAAC;IACtB,oBAAoB,EAAG,MAAM,CAAC;IAC9B,oBAAoB,EAAG,MAAM,CAAC;IAC9B,cAAc,EAAG,MAAM,CAAC;IACxB,kBAAkB,EAAG,MAAM,CAAC;IAC5B,aAAa,EAAG,MAAM,CAAC;IACvB,mBAAmB,EAAG,MAAM,CAAC;IAC7B,iBAAiB,EAAG,MAAM,CAAC;IAC3B,qBAAqB,EAAG,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IACtE,oBAAoB,EAAG,OAAO,CAAC;CAChC;AAED,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,oBAAoB,GACzB,uBAAuB,CAyBzB"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACzG,OAAO,EAAc,KAAK,KAAK,EAAE,KAAK,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAKzE,OAAO,EAAE,UAAU,EAAwE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACzG,OAAO,EAAc,KAAK,KAAK,EAAE,KAAK,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAKzE,OAAO,EAAE,UAAU,EAAwE,MAAM,oBAAoB,CAAC;AAyDtH,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAG5F;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,EAC/B,MAAM,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,EACrC,QAAQ,UAAQ,GACf;IAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAAA;CAAE,CAwB7G;AAeD,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,EAAE,YAAY,QA4jB7D"}
|