acp-kernel 0.0.95 → 0.0.96

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.
@@ -0,0 +1,30 @@
1
+ import type { CompressionState, CoreMessage } from "./types.js";
2
+ /**
3
+ * Re-mint live messages whose id collides with an already-FOLDED copy of the same
4
+ * content (billion-context #1476). Runs as the FIRST pipeline node, before
5
+ * assign-refs and prune, so the re-minted id is what gets ref'd and what prune sees.
6
+ *
7
+ * Root cause: deriveMessageId's cluster counter restarts every conversion pass, so
8
+ * text re-sent after its earlier copy was folded re-derives the SAME bare `h_…` id.
9
+ * From that single collision: assignRefs is first-wins (`if (map.byRaw[id]) continue`)
10
+ * and the folded original already owns `byRaw[h_…]`, so the fresh instance gets NO
11
+ * ref; and prune drops any covered id that isn't the pinned first user message, so
12
+ * the fresh user turn silently vanishes upstream.
13
+ *
14
+ * Why "covered base" is the discriminator: a base is covered iff an active block
15
+ * lists it in effectiveMessageIds, i.e. its original is off the wire (replaced by a
16
+ * summary). So any LIVE message carrying a covered id is a new instance, not the
17
+ * original — and must get a distinct instance id. A NON-covered base keeps the
18
+ * converter's numbering untouched: that is the shape where the old copy is still on
19
+ * the wire and un-folded, where the in-pass occurrence count already keeps the pair
20
+ * distinct, and touching the ids would only churn the prefix cache. Do not broaden
21
+ * this to all bases.
22
+ *
23
+ * For each conflicting root, live instances are renumbered in arrival order to
24
+ * root_1, root_2, … skipping any number a folded copy already claims. Deterministic
25
+ * for a fixed (state, body): a live message whose root stays covered keeps the same
26
+ * _k every turn (prefix-cache stable) and shifts only when a newer identical
27
+ * instance joins the pass.
28
+ */
29
+ export declare function remintCoveredLiveIds(messages: CoreMessage[], state: CompressionState): CoreMessage[];
30
+ //# sourceMappingURL=instance-reid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance-reid.d.ts","sourceRoot":"","sources":["../src/instance-reid.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAahE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,EAAE,gBAAgB,GACtB,WAAW,EAAE,CAiCf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acp-kernel",
3
- "version": "0.0.95",
3
+ "version": "0.0.96",
4
4
  "description": "Framework-agnostic context-compression engine (model-driven, 3-tier LSM). Pure core: no host dependency.",
5
5
  "license": "MIT",
6
6
  "author": "ranxianglei",