diff --git a/kernel/package-lock.json b/kernel/package-lock.json index 8a2c4491d7..7ecaea2d8c 100644 --- a/kernel/package-lock.json +++ b/kernel/package-lock.json @@ -1,12 +1,12 @@ { "name": "acp-kernel", - "version": "0.0.201", + "version": "0.0.202", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "acp-kernel", - "version": "0.0.201", + "version": "0.0.202", "license": "MIT", "devDependencies": { "@types/node": "^22.0.0", diff --git a/kernel/package.json b/kernel/package.json index 5ac694d897..80a65d212a 100644 --- a/kernel/package.json +++ b/kernel/package.json @@ -1,6 +1,6 @@ { "name": "acp-kernel", - "version": "0.0.201", + "version": "0.0.202", "description": "Framework-agnostic context-compression engine (model-driven, 3-tier LSM). Pure core: no host dependency.", "license": "MIT", "author": "ranxianglei", diff --git a/kernel/src/block-map.ts b/kernel/src/block-map.ts index b121179bb9..e5ad39b67d 100644 --- a/kernel/src/block-map.ts +++ b/kernel/src/block-map.ts @@ -53,6 +53,35 @@ export function activeBlockSpans(state: CompressionState): BlockSpan[] { return spans; } +/** #5667 defect B: which ACTIVE blocks' ref-spans sit strictly INSIDE a + * displayed range's numeric span — i.e. the range's literal label bridges + * across an already-folded interior. On surface-replace hosts the covered + * messages leave the array without leaving a segmentation gap, so the segmenter + * joins the two surviving flanks into one range whose label reads as a solid + * mNNNNN–mMMMMM span (billion-context #5508 family). Display-only signal: the + * renderers append it; foldability judgment (KDD#12 single projection) is + * untouched. Returns block ids, oldest-first by span start; empty when nothing + * is spanned. A covered message is never a range member, so a block can only + * intersect a range's span as a strict interior hole — partial overlap is + * impossible and need not be tested. */ +export function blocksSpannedByRange( + startRef: string, + endRef: string, + spans: BlockSpan[], +): string[] { + const [loRef, hiRef] = orderedRefPair(startRef, endRef); + const lo = refNum(loRef); + const hi = refNum(hiRef); + if (hi - lo < 1) return []; + const out: string[] = []; + for (const s of spans) { + const bLo = Math.min(refNum(s.startRef), refNum(s.endRef)); + const bHi = Math.max(refNum(s.startRef), refNum(s.endRef)); + if (bLo > lo && bHi < hi) out.push(s.blockId); + } + return out.sort((a, b) => refNum(a) - refNum(b)); +} + /** Format newly created blocks for tool-result display, e.g. * `blocks: b3=m00044–m00097, b4=m00103–m00123`. Adapters append this to their * compress result line so the model's block ledger comes from the kernel diff --git a/kernel/src/compress.ts b/kernel/src/compress.ts index 43a0238c6e..e5022b0c1e 100644 --- a/kernel/src/compress.ts +++ b/kernel/src/compress.ts @@ -1970,7 +1970,13 @@ function applySingleRange(input: SingleRangeInput): SingleRangeOutcome { for (const consumedId of consumedBlockIds) { const consumed = blockById(input.state, consumedId); - if (consumed) consumed.active = false; + if (consumed) { + // #5667 A: lineage written ONLY here (consumption). Non-consumptive + // deactivation (orphan GC / host expand in sync.ts) must leave it unset — + // that absence is what keeps the death cause discriminable. + consumed.active = false; + consumed.supersedesBlockId = blockId; + } } return { tokens: compressedTokens, warnings }; diff --git a/kernel/src/nudge-text.ts b/kernel/src/nudge-text.ts index 0c8463c154..7f2bda4208 100644 --- a/kernel/src/nudge-text.ts +++ b/kernel/src/nudge-text.ts @@ -121,6 +121,7 @@ export function formatRanges( textPct: number; dangerous: boolean; noMergeBefore: boolean; + crossesCoveredBy: string[]; } const refNum = (ref: string): number => { const m = ref.match(/\d+/); @@ -147,6 +148,7 @@ export function formatRanges( protectedTools: [], dangerous: r.dangerous ?? false, noMergeBefore: r.noMergeBefore ?? false, + crossesCoveredBy: r.crossesCoveredBy ?? [], }); } for (const r of protectedRanges) { @@ -169,6 +171,7 @@ export function formatRanges( protectedTools: [...r.tools], dangerous: false, noMergeBefore: r.noMergeBefore ?? false, + crossesCoveredBy: [], }); } // Order/merge by POSITION, never ref number: refs can be non-monotonic vs array @@ -196,6 +199,9 @@ export function formatRanges( for (const t of e.protectedTools) { if (!last.protectedTools.includes(t)) last.protectedTools.push(t); } + for (const b of e.crossesCoveredBy) { + if (!last.crossesCoveredBy.includes(b)) last.crossesCoveredBy.push(b); + } } else { merged.push({ ...e }); } @@ -211,13 +217,19 @@ export function formatRanges( e.dangerous && e.compressibleTokens > 0 ? " ⚠️ NOT recommended unless you are certain." : ""; + // #5667 B: the label bridges an already-folded interior — say so so the + // model does not re-submit the covered span as new content (#5508 family). + const spanNote = + e.crossesCoveredBy.length > 0 + ? ` · spans folded ${e.crossesCoveredBy.join(", ")}` + : ""; if (e.protectedTokens > 0 && e.compressibleTokens === 0) { - return ` ${lo}–${hi} ${e.count} msgs ${formatK(e.tokens)} [PROTECTED: ${e.protectedTools.join(", ")} — not compressible]${suffix}`; + return ` ${lo}–${hi} ${e.count} msgs ${formatK(e.tokens)} [PROTECTED: ${e.protectedTools.join(", ")} — not compressible]${spanNote}${suffix}`; } if (e.protectedTokens > 0 && e.compressibleTokens > 0) { - return ` ${lo}–${hi} ${e.count} msgs ${formatK(e.tokens)} [${formatK(e.compressibleTokens)} compressible | ${formatK(e.protectedTokens)} protected: ${e.protectedTools.join(", ")}]${userNote(e.userMsgs)}${suffix}`; + return ` ${lo}–${hi} ${e.count} msgs ${formatK(e.tokens)} [${formatK(e.compressibleTokens)} compressible | ${formatK(e.protectedTokens)} protected: ${e.protectedTools.join(", ")}]${userNote(e.userMsgs)}${spanNote}${suffix}`; } - return ` ${lo}–${hi} ${e.count} msgs ${formatK(e.tokens)} [tool ${e.toolPct}% | text ${e.textPct}%]${userNote(e.userMsgs)}${suffix}`; + return ` ${lo}–${hi} ${e.count} msgs ${formatK(e.tokens)} [tool ${e.toolPct}% | text ${e.textPct}%]${userNote(e.userMsgs)}${spanNote}${suffix}`; }); return `Compressible ranges (${merged.length}, oldest first):\n${lines.join("\n")}`; } diff --git a/kernel/src/recommend.ts b/kernel/src/recommend.ts index 23a2ca2631..ea24f43e24 100644 --- a/kernel/src/recommend.ts +++ b/kernel/src/recommend.ts @@ -37,6 +37,7 @@ import { countMessageTokens } from "./tokenize.js"; import { computeIntegrityWithdrawals } from "./turn-integrity.js"; import { evaluateRefold } from "./refold.js"; import { segmentGroups } from "./segment.js"; +import { activeBlockSpans, blocksSpannedByRange } from "./block-map.js"; import { projectUnit, collectCoverage, @@ -461,6 +462,9 @@ export function buildCompressibleRanges( // split at real array gaps and at user messages once a group has >= 3 messages. // Splitting at user boundaries keeps each range aligned to roughly one turn. const compressible: CompressibleRange[] = []; + // #5667 B: active-block spans resolved once so each range can record the + // folded interior its label bridges (display-only, never feeds foldability). + const activeSpansForSpan = activeBlockSpans(state); for (const group of segmentGroups(compressibleMsgs)) { const first = group[0]!; const range: CompressibleRange = { @@ -494,6 +498,12 @@ export function buildCompressibleRanges( } range.textPct = 100 - range.toolPct; } + const spanned = blocksSpannedByRange( + range.startRef, + range.endRef, + activeSpansForSpan, + ); + if (spanned.length > 0) range.crossesCoveredBy = spanned; compressible.push(range); } @@ -566,6 +576,8 @@ function mergeBatch(batch: CompressibleRange[]): CompressibleRange { // position-based merging (formatRanges) still sees it after this batch is // re-emitted as a single range. if (first.noMergeBefore === true) merged.noMergeBefore = true; + const spanned = batch.flatMap((r) => r.crossesCoveredBy ?? []); + if (spanned.length > 0) merged.crossesCoveredBy = [...new Set(spanned)]; return merged; } diff --git a/kernel/src/report.ts b/kernel/src/report.ts index 9e50101b24..9c6449b0ef 100644 --- a/kernel/src/report.ts +++ b/kernel/src/report.ts @@ -1,8 +1,9 @@ -import { clampPrefix } from "./truncate.js"; +import { clampPrefix, scrubLoneSurrogates } from "./truncate.js"; import { isToolMessage } from "./message-kind.js"; import { BLOCKED_REF, orderedRefPair, refForRaw } from "./refs.js"; import { countMessageTokens } from "./tokenize.js"; import { segmentGroups } from "./segment.js"; +import { activeBlockSpans, blocksSpannedByRange } from "./block-map.js"; import { isLiveCheckpointCarrier } from "./state.js"; import { computeProtectedRefs } from "./recommend.js"; import { @@ -194,6 +195,12 @@ export interface StatusReportOptions { originalMessages?: CoreMessage[]; } +export function projectionErrorDetail(err: unknown): string { + const raw = err instanceof Error ? err.message : String(err); + const detail = scrubLoneSurrogates(raw).trim(); + return detail.slice(0, 120) || "no error detail"; +} + export function buildStatusReport( state: CompressionState, messages: CoreMessage[], @@ -504,8 +511,8 @@ function renderUncompressedRanges( protectedMessageIds: protectedRefs, shared, }); - } catch { - return "\u26a0 not foldable: refs unresolvable"; + } catch (err) { + return `\u26a0 not foldable: ${projectionErrorDetail(err)}`; } if (proj.fatal?.kind === "zone") return "\u26a0 not foldable: protected zone only"; @@ -518,6 +525,7 @@ function renderUncompressedRanges( } lines.push(`Sorted by ${sort === "time" ? "time" : "size"}`); lines.push(""); + const activeSpansForSpan = activeBlockSpans(state); for (const r of merged.slice(0, limit)) { // Ascending endpoint labels: non-monotonic refs (#1001) can make a // positional span's labels numerically descending (#2168). @@ -525,9 +533,15 @@ function renderUncompressedRanges( r.count === 1 ? r.startRef : orderedRefPair(r.startRef, r.endRef).join("–"); + const spanned = + r.count > 1 + ? blocksSpannedByRange(r.startRef, r.endRef, activeSpansForSpan) + : []; + const spanNote = + spanned.length > 0 ? ` · spans folded ${spanned.join(", ")}` : ""; const flag = flagFor ? flagFor(r) : null; lines.push( - ` ${range} (${r.count} msgs, ${formatTokens(r.tokens)}${r.count > 1 ? ` (${Math.round(r.tokens / r.count)}/msg)` : ""}) ${dominantTool(r.toolTokens)}${flag ? ` ${flag}` : ""}`, + ` ${range}${spanNote} (${r.count} msgs, ${formatTokens(r.tokens)}${r.count > 1 ? ` (${Math.round(r.tokens / r.count)}/msg)` : ""}) ${dominantTool(r.toolTokens)}${flag ? ` ${flag}` : ""}`, ); } if (merged.length > limit) { diff --git a/kernel/src/types.ts b/kernel/src/types.ts index 928504c10a..237cf52912 100644 --- a/kernel/src/types.ts +++ b/kernel/src/types.ts @@ -122,6 +122,12 @@ export interface CompressionBlock { * Undefined = unstamped traffic or provably-loose coverage; never guessed. */ startSeq?: number; endSeq?: number; + /** #5667 defect A: the id of the block that CONSUMED this one (nested fold). + * Written only at the single consumption point (compress.ts); non-consumptive + * deactivation (orphan GC / host expand) leaves it unset, which is exactly + * what makes an inactive block's death cause readable. Optional: states + * persisted before this field exist read as "no lineage recorded". */ + supersedesBlockId?: string; } /** A compression block's current ref span, pre-resolved for display. */ @@ -708,6 +714,15 @@ export interface CompressibleRange { * has no index gap and the index check alone would let mergeRangesToThreshold * bridge back into one doomed span bracketing the dead ref. */ noMergeBefore?: boolean; + /** #5667 defect B (display-only): ids of ACTIVE blocks whose ref-spans sit + * strictly inside this range's numeric span — the range's literal label + * bridges an already-folded interior (surface-replace hosts leave no gap, so + * the segmenter joins the flanks; billion-context #5508 family). Renderers + * append " · spans folded bN" so the model does not re-submit the covered + * interior as new content. Set by buildCompressibleRanges / mergeBatch; + * NEVER consulted by foldability judgment (KDD#12 single projection). Absent + * when nothing is spanned or on hand-built ranges. */ + crossesCoveredBy?: string[]; } export interface ProtectedRange { diff --git a/kernel/tests/issue5667-nested-fold-ledger.test.ts b/kernel/tests/issue5667-nested-fold-ledger.test.ts new file mode 100644 index 0000000000..c2f95820fd --- /dev/null +++ b/kernel/tests/issue5667-nested-fold-ledger.test.ts @@ -0,0 +1,288 @@ +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { createCore } from "../src/compress.js"; +import { createInitialState } from "../src/state.js"; +import { assignRefs } from "../src/refs.js"; +import { defaultCountTokens } from "../src/tokenize.js"; +import { syncBlocks } from "../src/sync.js"; +import { blocksSpannedByRange } from "../src/block-map.js"; +import { + buildCompressibleRanges, + mergeRangesToThreshold, +} from "../src/recommend.js"; +import { formatRanges } from "../src/nudge-text.js"; +import { buildStatusReport, projectionErrorDetail } from "../src/report.js"; +import type { + CompressionBlock, + Config, + CompressibleRange, + CoreMessage, +} from "../src/types.js"; + +// #5667: three state-ledger distortions exposed by nested folding (a new block +// consuming an active one). Regression pins for the A/B/C fixes. See PR body. + +function config(overrides: Partial = {}): Config { + return { + tiers: { enabled: true, tier2Trigger: 5, tier3Trigger: 10 }, + nudge: { + maxContextLimitPct: 0.55, + minContextLimitPct: 0.45, + frequency: 5, + iterationThreshold: 15, + force: "soft", + growthRatio: 0.05, + }, + promotionThreshold: 5, + truncate: { threshold: 1 }, + merge: { maxSummaryLength: 3000, minOldGenBlocks: 3 }, + compress: { minCompressRange: 0, maxSummaryLength: 0, minSummaryLength: 0 }, + protectedTools: [], + preserveRecentMessages: 0, + preserveRecentTokens: 0, + modelContextLimit: 100000, + ...overrides, + }; +} + +function msg( + id: string, + text: string, + role: CoreMessage["role"] = "user", +): CoreMessage { + return { id, role, contentType: "text", text }; +} + +function makeBlock(overrides: Partial = {}): CompressionBlock { + return { + blockId: "b1", + runId: "r1", + tier: 1, + summary: "s", + directMessageIds: [], + effectiveMessageIds: [], + directBlockIds: [], + compressedTokens: 100, + createdAt: Date.now(), + survivedCount: 0, + generation: "young", + active: true, + ...overrides, + }; +} + +// ─── Defect A: supersedes_block_id written only at consumption ──────────────── + +test("A: nested fold stamps consumed children with the consumer's id", () => { + const core = createCore(); + const state = createInitialState(); + const messages = Array.from({ length: 20 }, (_, i) => + msg(`id${i + 1}`, `message ${i + 1}`), + ); + state.messageRefs = assignRefs(messages, { + existing: state.messageRefs, + nextIndex: 1, + }).map; + const r1 = core.applyCompression({ + ranges: [ + { startRef: "m00001", endRef: "m00010", summary: "first ten" }, + { startRef: "m00011", endRef: "m00020", summary: "next ten" }, + ], + messages, + state, + config: config(), + }); + const childA = r1.state.blocks.find((b) => b.startRef === "m00001")!; + const childB = r1.state.blocks.find((b) => b.startRef === "m00011")!; + const r2 = core.applyCompression({ + ranges: [{ startRef: childA.blockId, endRef: childB.blockId, summary: "distilled" }], + messages, + state: r1.state, + config: config(), + }); + const consumer = r2.state.blocks[r2.state.blocks.length - 1]!; + assert.equal(consumer.tier, 2); + const gotA = r2.state.blocks.find((b) => b.blockId === childA.blockId)!; + const gotB = r2.state.blocks.find((b) => b.blockId === childB.blockId)!; + assert.equal(gotA.active, false, "consumed child must be inactive"); + assert.equal(gotB.active, false, "consumed child must be inactive"); + assert.equal(gotA.supersedesBlockId, consumer.blockId); + assert.equal(gotB.supersedesBlockId, consumer.blockId); + assert.equal(consumer.supersedesBlockId, undefined, "consumer has no parent"); +}); + +test("A: non-consumptive deactivation leaves supersedesBlockId unset", () => { + const state = createInitialState(); + // Orphan GC: the block's messages are absent from the resent view. + const orphan = makeBlock({ + blockId: "b-orphan", + effectiveMessageIds: ["ghost-1"], + }); + // Host expand: the block is present but explicitly expanded by the host. + const expanded = makeBlock({ + blockId: "b-expanded", + expanded: true, + effectiveMessageIds: ["live-1"], + }); + // Reconcile re-mark of an already-recorded lineage edge: the consumer lists + // the child in directBlockIds, sync re-marks it inactive without restamping. + const parent = makeBlock({ + blockId: "b-parent", + directBlockIds: ["b-child"], + effectiveMessageIds: ["live-2"], + }); + const child = makeBlock({ blockId: "b-child" }); + state.blocks = [orphan, expanded, parent, child]; + const result = syncBlocks([msg("live-1", "a"), msg("live-2", "b")], state); + const gotOrphan = result.state.blocks.find((b) => b.blockId === "b-orphan")!; + const gotExpanded = result.state.blocks.find((b) => b.blockId === "b-expanded")!; + const gotParent = result.state.blocks.find((b) => b.blockId === "b-parent")!; + const gotChild = result.state.blocks.find((b) => b.blockId === "b-child")!; + assert.equal(gotOrphan.active, false, "orphan GC must deactivate"); + assert.ok( + result.deactivated.includes("b-orphan"), + "orphan GC must record the deactivation", + ); + assert.equal(gotExpanded.active, false, "host-expanded stays inactive"); + assert.equal(gotParent.active, true, "present consumer stays active"); + assert.equal(gotChild.active, false, "reconcile keeps consumed child inactive"); + assert.equal( + gotOrphan.supersedesBlockId, + undefined, + "orphan-GC death stamps no lineage", + ); + assert.equal( + gotExpanded.supersedesBlockId, + undefined, + "host-expand death stamps no lineage", + ); + assert.equal( + gotChild.supersedesBlockId, + undefined, + "reconcile re-mark does not backfill lineage", + ); +}); + +// ─── Defect B: display-only annotation for a range spanning a folded block ──── + +test("B: blocksSpannedByRange flags strictly-interior blocks only", () => { + const spans = [ + { blockId: "b1", tier: 1, startRef: "m00002", endRef: "m00004" }, + { blockId: "b2", tier: 1, startRef: "m00007", endRef: "m00009" }, + { blockId: "b3", tier: 1, startRef: "m00001", endRef: "m00005" }, + { blockId: "b4", tier: 1, startRef: "m00009", endRef: "m00015" }, + ]; + assert.deepEqual(blocksSpannedByRange("m00001", "m00015", spans), [ + "b1", + "b2", + ]); + assert.deepEqual(blocksSpannedByRange("m00005", "m00005", spans), []); + assert.deepEqual(blocksSpannedByRange("m00015", "m00001", spans), [ + "b1", + "b2", + ]); +}); + +test("B: bridged surface-replace range records the folded interior it spans", () => { + const a = msg("a", "x".repeat(2000)); + const e = msg("e", "v".repeat(2000)); + const state = createInitialState(); + state.messageRefs = assignRefs( + [a, msg("b", "y"), msg("c", "z"), msg("d", "w"), e], + { existing: state.messageRefs, nextIndex: 1 }, + ).map; + state.blocks.push( + makeBlock({ + blockId: "bFolded", + startRef: "m00002", + endRef: "m00004", + effectiveMessageIds: ["b", "c", "d"], + }), + ); + const ranges = buildCompressibleRanges([a, e], state, config()).compressible; + assert.equal(ranges.length, 1); + assert.equal(ranges[0]!.startRef, "m00001"); + assert.equal(ranges[0]!.endRef, "m00005"); + assert.deepEqual(ranges[0]!.crossesCoveredBy, ["bFolded"]); +}); + +test("B: a range that does not span a block carries no crossesCoveredBy", () => { + const a = msg("a", "x".repeat(2000)); + const e = msg("e", "v".repeat(2000)); + const state = createInitialState(); + state.messageRefs = assignRefs( + [a, msg("b", "y"), msg("c", "z"), msg("d", "w"), e], + { existing: state.messageRefs, nextIndex: 1 }, + ).map; + const ranges = buildCompressibleRanges([a, e], state, config()).compressible; + assert.equal(ranges.length, 1); + assert.equal(ranges[0]!.crossesCoveredBy, undefined); +}); + +test("B: formatRanges appends 'spans folded' only when the field is set", () => { + const crossed: CompressibleRange = { + startRef: "m00001", + endRef: "m00005", + count: 2, + tokens: 1000, + chars: 4000, + toolPct: 0, + textPct: 100, + crossesCoveredBy: ["bFolded"], + }; + assert.match(formatRanges([crossed], []), / · spans folded bFolded/); + const plain: CompressibleRange = { + startRef: "m00001", + endRef: "m00005", + count: 2, + tokens: 1000, + chars: 4000, + toolPct: 0, + textPct: 100, + }; + assert.doesNotMatch(formatRanges([plain], []), /spans folded/); +}); + +test("B: mergeRangesToThreshold carries crossesCoveredBy across a batch", () => { + const base = { count: 2, chars: 400, toolPct: 50, textPct: 50, tokens: 500 }; + const ranges: CompressibleRange[] = [ + { startRef: "m00001", endRef: "m00002", crossesCoveredBy: ["bX"], ...base }, + { startRef: "m00003", endRef: "m00004", ...base }, + ]; + const merged = mergeRangesToThreshold(ranges, 600); + assert.equal(merged.length, 1); + assert.deepEqual(merged[0]!.crossesCoveredBy, ["bX"]); +}); + +// ─── Defect C: projection exceptions surface their detail ───────────────────── + +test("C: an unresolvable endpoint surfaces the real reason, not a flat verdict", () => { + const u1 = msg("u1", "please do the thing"); + const t1 = msg("t1", "call skill", "assistant"); + const state = createInitialState(); + // t1's stored ref is BLOCKED (protected tool) — a valid-looking range whose + // tail endpoint cannot be resolved, so projectUnit throws on it. + state.messageRefs = { + byRaw: { u1: "m00001", t1: "BLOCKED" }, + byRef: { m00001: "u1" }, + }; + const out = buildStatusReport(state, [u1, t1], defaultCountTokens, { + scope: "uncompressed", + config: config({ protectedTools: ["skill"] }), + originalMessages: [u1, t1], + }); + assert.match(out, /not foldable:/); + assert.doesNotMatch(out, /refs unresolvable/); + assert.match(out, /Invalid boundary ref/); +}); + +test("C: projectionErrorDetail falls back when the error carries no message", () => { + assert.equal(projectionErrorDetail(new Error("")), "no error detail"); + assert.equal(projectionErrorDetail(new Error(" \t\n ")), "no error detail"); + assert.equal(projectionErrorDetail("plain reason"), "plain reason"); + assert.equal( + projectionErrorDetail(new Error("x".repeat(500))).length, + 120, + "long details stay truncated", + ); +}); diff --git a/package-lock.json b/package-lock.json index 72519f7f77..8f31611801 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,7 @@ }, "kernel": { "name": "acp-kernel", - "version": "0.0.201", + "version": "0.0.202", "dev": true, "license": "MIT", "devDependencies": { diff --git a/src/storage/ingest.ts b/src/storage/ingest.ts index d1ba085308..67cff33f4a 100644 --- a/src/storage/ingest.ts +++ b/src/storage/ingest.ts @@ -472,7 +472,7 @@ function finishPlan( // recomputes nothing — same bytes, same utf8, same sha256). summaryHash: sha256Hex(summaryJson), oneHash: oneJson === null ? null : sha256Hex(oneJson), - supersedesBlockId: null, + supersedesBlockId: b.supersedesBlockId ?? null, active: b.active, createdAt: b.createdAt, coveredHash: sha256Hex(JSON.stringify(covered)),