omp-fabric 1.16.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/chunks/{chunk-3U5ZVAIX.js → chunk-7OAFYAJC.js} +2 -2
  3. package/dist/chunks/{chunk-N2MMGFMD.js → chunk-C5JMLDIM.js} +2 -2
  4. package/dist/chunks/{chunk-BSUEBCAM.js → chunk-QZJB7QTM.js} +2 -2
  5. package/dist/chunks/{chunk-BSUEBCAM.js.map → chunk-QZJB7QTM.js.map} +2 -2
  6. package/dist/chunks/{chunk-3NWBU3K7.js → chunk-VYB7ROEH.js} +2 -2
  7. package/dist/chunks/{chunk-D2ET33NE.js → chunk-WMB6QCWX.js} +2 -5
  8. package/dist/chunks/{chunk-D2ET33NE.js.map → chunk-WMB6QCWX.js.map} +2 -2
  9. package/dist/chunks/{chunk-XJMS4223.js → chunk-YD4MAZMT.js} +2 -4
  10. package/dist/chunks/{chunk-XJMS4223.js.map → chunk-YD4MAZMT.js.map} +2 -2
  11. package/dist/chunks/{chunk-ARRZTY7E.js → chunk-Z7N4PVTM.js} +2 -2
  12. package/dist/compaction/hook.d.ts +0 -2
  13. package/dist/compaction/hook.d.ts.map +1 -1
  14. package/dist/compaction/hook.js +1 -1
  15. package/dist/compaction/lcm-maintenance.d.ts +7 -7
  16. package/dist/compaction/lcm-maintenance.d.ts.map +1 -1
  17. package/dist/compaction/lcm-runtime.d.ts +2 -6
  18. package/dist/compaction/lcm-runtime.d.ts.map +1 -1
  19. package/dist/compaction/lcm-runtime.js +48 -47
  20. package/dist/compaction/lcm-runtime.js.map +2 -2
  21. package/dist/fabric-runtime-state.d.ts +0 -1
  22. package/dist/fabric-runtime-state.d.ts.map +1 -1
  23. package/dist/fabric-runtime-state.js +5 -5
  24. package/dist/fabric-runtime-state.js.map +2 -2
  25. package/dist/index.js +3 -3
  26. package/dist/memory/lcm-adapter.d.ts +0 -3
  27. package/dist/memory/lcm-adapter.d.ts.map +1 -1
  28. package/dist/providers/memory-provider.js +1 -1
  29. package/dist/residency/host.js +4 -4
  30. package/dist/residency/omp-entry.js +4 -4
  31. package/dist/ui/lcm-dashboard.js +1 -1
  32. package/dist/ui/lcm-panel.js +1 -1
  33. package/docs/compaction.md +8 -0
  34. package/package.json +1 -1
  35. /package/dist/chunks/{chunk-3U5ZVAIX.js.map → chunk-7OAFYAJC.js.map} +0 -0
  36. /package/dist/chunks/{chunk-N2MMGFMD.js.map → chunk-C5JMLDIM.js.map} +0 -0
  37. /package/dist/chunks/{chunk-3NWBU3K7.js.map → chunk-VYB7ROEH.js.map} +0 -0
  38. /package/dist/chunks/{chunk-ARRZTY7E.js.map → chunk-Z7N4PVTM.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.17.0
4
+
5
+ ### Fixed
6
+
7
+ - Summaries stopped leaving the frontier one message after they were built. LCM stamped each stored entry with the host's leaf id, which is the id of the newest entry, and then filtered the frontier on it, so a node matched only until the next message arrived. The label is gone from the model: `LcmNode` no longer carries it, leaf and condensed identity no longer hash it, and the four selectors no longer filter on it. A production ledger of 5,400 entries held 106 of 133 nodes behind 36 dead leaf values and served 2 of 400 sources; the same branch now serves 160 of 400. Existing ledgers keep the labels in a column nothing reads, so nothing migrates.
8
+ - Branch isolation now rests where it was already exact: a summary is served only when every source it covers is on the live branch. `selectLeaf` applies that same predicate when it decides which entries are already summarised, so an entry covered only by a node the live branch cannot serve is summarised again instead of being skipped forever.
9
+ - `getFrontier` drops a node whose sources another selected node fully contains, so a rewind that remints a covered prefix can no longer put the same range into a compacted prompt twice.
10
+
11
+ ### Changed
12
+
13
+ - `branch` was removed from `LcmCompactionInput`, `LcmCompactionOutput`, `LcmSummaryNode`, `LcmDashboardNode` and the memory branch binding. `createLeaf` and `createCondensed` now require their arguments rather than defaulting to an unscoped selection.
14
+
3
15
  ## 1.16.0
4
16
 
5
17
  ### Added
@@ -10,7 +10,7 @@ import {
10
10
  lifecycleSourceIdentity,
11
11
  loadModelUsage,
12
12
  useBudgetLedger
13
- } from "./chunk-3NWBU3K7.js";
13
+ } from "./chunk-VYB7ROEH.js";
14
14
  import {
15
15
  normalizeModelAliases,
16
16
  resolveAvailableOmpModel
@@ -685,4 +685,4 @@ if (isMain) {
685
685
  export {
686
686
  runResidentHostFromConfigPath
687
687
  };
688
- //# sourceMappingURL=chunk-3U5ZVAIX.js.map
688
+ //# sourceMappingURL=chunk-7OAFYAJC.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-NX2G7BRO.js";
7
7
  import {
8
8
  rawContextTokens
9
- } from "./chunk-D2ET33NE.js";
9
+ } from "./chunk-WMB6QCWX.js";
10
10
  import {
11
11
  compactionRequestBoundsError,
12
12
  encodeCompactionRequest
@@ -463,4 +463,4 @@ export {
463
463
  buildPeerCards,
464
464
  awaitPeerSettle
465
465
  };
466
- //# sourceMappingURL=chunk-N2MMGFMD.js.map
466
+ //# sourceMappingURL=chunk-C5JMLDIM.js.map
@@ -180,7 +180,7 @@ var renderLcmDetailLines = (theme, detail, sourceIndex, entry, width, height) =>
180
180
  ),
181
181
  theme.fg(
182
182
  "dim",
183
- truncateToWidth(safeText(`model hash ${node.modelHash} \xB7 branch ${node.branch ?? "none"}`), width, "")
183
+ truncateToWidth(safeText(`model hash ${node.modelHash}`), width, "")
184
184
  ),
185
185
  theme.fg(
186
186
  "dim",
@@ -245,4 +245,4 @@ export {
245
245
  renderLcmPreviewLines,
246
246
  renderLcmDetailLines
247
247
  };
248
- //# sourceMappingURL=chunk-BSUEBCAM.js.map
248
+ //# sourceMappingURL=chunk-QZJB7QTM.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ui/lcm-panel.ts"],
4
- "sourcesContent": ["import type { Theme } from \"@oh-my-pi/pi-coding-agent\";\nimport { truncateToWidth, visibleWidth } from \"@oh-my-pi/pi-tui\";\nimport type { LcmDashboardNode, LcmStatusSource } from \"../fabric-runtime-state.js\";\nimport { lcmStatusLabel } from \"../compaction/lcm-status.js\";\nimport { formatClock, formatCost, padToWidth, safeText, wrapPlainText } from \"./format.js\";\n\nexport const LCM_NODE_PAGE = 200;\n\nconst COVERAGE_COMPLETE_RATIO = 0.95;\nconst EMERGENCY_MODEL_HASH = \"emergency\";\n\nexport interface LcmViewSnapshot {\n report: ReturnType<LcmStatusSource[\"report\"]>;\n coverage: ReturnType<LcmStatusSource[\"coverage\"]>;\n preview: ReturnType<LcmStatusSource[\"preview\"]>;\n coverageMap: ReturnType<LcmStatusSource[\"coverageMap\"]>;\n nodes: LcmDashboardNode[];\n offset: number;\n hasMore: boolean;\n}\n\nexport interface LcmNodeDetail {\n node: LcmDashboardNode;\n revisions: Array<{ revision: number; text: string; modelHash: string; createdAt: number }>;\n ancestors: string[];\n}\n\nexport interface LcmSourceEntry {\n payloadJson: string;\n content: string;\n role: string;\n createdAt: number;\n}\n\n/** Reads every ledger projection the LCM view needs in one pass so rendering never walks the ledger. */\nexport const readLcmSnapshot = (source: LcmStatusSource, offset: number): LcmViewSnapshot => {\n const nodes = source.nodes(LCM_NODE_PAGE, offset);\n return {\n report: source.report(),\n coverage: source.coverage(),\n preview: source.preview(),\n coverageMap: source.coverageMap(),\n nodes,\n offset,\n hasMore: nodes.length === LCM_NODE_PAGE,\n };\n};\n\nexport const lcmNodeDetail = (\n source: LcmStatusSource,\n nodeId: string,\n): LcmNodeDetail | undefined => {\n const detail = source.node(nodeId);\n if (!detail) return undefined;\n return {\n node: detail.node,\n revisions: [...detail.revisions].sort((left, right) => left.revision - right.revision),\n ancestors: detail.ancestors,\n };\n};\n\nconst formatBytes = (bytes: number): string => {\n if (!Number.isFinite(bytes) || bytes <= 0) return \"0 B\";\n if (bytes < 1_024) return `${Math.round(bytes)} B`;\n if (bytes < 1_048_576) return `${(bytes / 1_024).toFixed(1)} kB`;\n return `${(bytes / 1_048_576).toFixed(1)} MB`;\n};\n\nconst formatPercent = (value: number): string =>\n value > 0 && value < 1 ? `${value.toFixed(value < 0.1 ? 2 : 1)}%` : `${Math.round(value)}%`;\n\nconst isEmergency = (modelHash: string): boolean => modelHash === EMERGENCY_MODEL_HASH;\n\nconst originLabel = (modelHash: string): string => (isEmergency(modelHash) ? \"excerpt\" : \"model\");\n\nconst shortId = (value: string): string => (value.length > 10 ? `${value.slice(0, 10)}\u2026` : value);\n\nconst textBytes = (text: string | undefined): number =>\n text ? Buffer.byteLength(text, \"utf8\") : 0;\n\nexport const lcmUnavailableLine = (): string =>\n \"LCM ledger unavailable \u00B7 set compaction.engine to lcm and start a session to populate it\";\n\nconst bandRun = (theme: Theme, char: string, length: number): string => {\n const color = char === \"\u2588\" ? \"success\" : char === \"\u2593\" ? \"warning\" : \"dim\";\n return theme.fg(color, char.repeat(length));\n};\n\nconst coverageBand = (\n theme: Theme,\n map: LcmViewSnapshot[\"coverageMap\"],\n cells: number,\n): string => {\n if (cells <= 0) return \"\";\n if (map.length === 0) return theme.fg(\"dim\", \"\u00B7\".repeat(cells));\n let band = \"\";\n let runChar = \"\";\n let runLength = 0;\n for (let cell = 0; cell < cells; cell++) {\n const start = Math.min(map.length - 1, Math.floor((cell * map.length) / cells));\n const end = Math.min(map.length, Math.max(start + 1, Math.floor(((cell + 1) * map.length) / cells)));\n let covered = 0;\n for (let index = start; index < end; index++) {\n if (map[index]!.covered) covered++;\n }\n const char = covered === 0 ? \"\u2591\" : covered === end - start ? \"\u2588\" : \"\u2593\";\n if (char === runChar) {\n runLength++;\n continue;\n }\n if (runLength > 0) band += bandRun(theme, runChar, runLength);\n runChar = char;\n runLength = 1;\n }\n if (runLength > 0) band += bandRun(theme, runChar, runLength);\n return band;\n};\n\nexport const renderLcmCoverageLine = (\n theme: Theme,\n snapshot: LcmViewSnapshot,\n width: number,\n): string => {\n const { active, covered } = snapshot.coverage;\n const label = `${covered}/${active} covered ${formatPercent(active > 0 ? (covered / active) * 100 : 0)}`;\n const cells = Math.max(0, width - visibleWidth(label) - 1);\n const band = coverageBand(theme, snapshot.coverageMap, cells);\n return truncateToWidth(`${band} ${theme.fg(\"muted\", label)}`, width, \"\");\n};\n\nconst nodeRow = (node: LcmDashboardNode): string => {\n const indent = \" \".repeat(Math.min(node.depth, 8));\n const glyph = node.kind === \"condensed\" ? \"\u25C6\" : \"\u25C7\";\n return safeText(\n `${indent}${glyph} ${node.kind} ${originLabel(node.modelHash)} \u00B7 ${node.sources.length} src \u00B7 ${node.children.length} ch \u00B7 ${formatBytes(textBytes(node.text))} \u00B7 ${shortId(node.nodeId)}`,\n );\n};\n\nexport const renderLcmNodeLines = (\n theme: Theme,\n snapshot: LcmViewSnapshot,\n width: number,\n height: number,\n selectedIndex: number,\n): string[] => {\n const available = Math.max(1, height);\n const total = snapshot.nodes.length;\n const heading = `nodes ${total === 0 ? 0 : snapshot.offset + 1}-${snapshot.offset + total}${snapshot.hasMore ? \"+\" : \"\"}`;\n const lines = [theme.fg(\"accent\", truncateToWidth(heading, width, \"\"))];\n if (total === 0) {\n lines.push(theme.fg(\"dim\", \" (no summary nodes on the active branch yet)\"));\n while (lines.length < available) lines.push(\"\");\n return lines.slice(0, available);\n }\n const rows = Math.max(1, available - 1);\n const start = Math.max(\n 0,\n Math.min(selectedIndex - Math.floor(rows / 2), Math.max(0, total - rows)),\n );\n for (let index = start; index < Math.min(total, start + rows); index++) {\n const node = snapshot.nodes[index]!;\n const emergency = isEmergency(node.modelHash);\n let line = theme.fg(emergency ? \"warning\" : \"muted\", nodeRow(node));\n if (index === selectedIndex) line = theme.bg(\"selectedBg\", padToWidth(line, width));\n lines.push(truncateToWidth(line, width, \"\"));\n }\n while (lines.length < available) lines.push(\"\");\n return lines.slice(0, available);\n};\n\nexport const renderLcmPreviewLines = (\n theme: Theme,\n snapshot: LcmViewSnapshot,\n width: number,\n height: number,\n): string[] => {\n const available = Math.max(1, height);\n const preview = snapshot.preview;\n const complete =\n preview.activeSources > 0 &&\n preview.coveredSources / preview.activeSources >= COVERAGE_COMPLETE_RATIO;\n const ratio =\n complete && preview.sourceBytes > 0\n ? ` \u00B7 assembled text is ${formatPercent((preview.summaryBytes / preview.sourceBytes) * 100)} of the session payload it replaces`\n : \"\";\n const headline = `preview \u00B7 frontier holds ${preview.coveredSources}/${preview.activeSources} sources \u00B7 ${preview.nodes} nodes assemble to ${formatBytes(preview.summaryBytes)} \u00B7 session stored payload ${formatBytes(preview.sourceBytes)}${ratio}`;\n const lines = wrapPlainText(headline, width, 2).map((line) => theme.fg(\"accent\", line));\n const body = wrapPlainText(preview.text, width, Math.max(1, available - lines.length));\n for (const line of body) lines.push(theme.fg(\"dim\", line));\n if (body.length === 0) lines.push(theme.fg(\"dim\", \"(the frontier assembles no text yet)\"));\n while (lines.length < available) lines.push(\"\");\n return lines.slice(0, available);\n};\n\nconst revisionColumns = (\n theme: Theme,\n detail: LcmNodeDetail,\n width: number,\n rows: number,\n): string[] => {\n const current = detail.revisions[detail.revisions.length - 1];\n const previous = detail.revisions[detail.revisions.length - 2];\n if (!current) return [];\n if (!previous) {\n const lines = [theme.fg(\"accent\", `text \u00B7 current revision ${current.revision} \u00B7 ${originLabel(current.modelHash)}`)];\n for (const line of wrapPlainText(current.text, width, Math.max(1, rows - 1))) {\n lines.push(theme.fg(\"dim\", line));\n }\n return lines;\n }\n const label = (revision: { revision: number; modelHash: string }, name: string): string =>\n `${name} revision ${revision.revision} \u00B7 ${originLabel(revision.modelHash)}`;\n if (width < 60) {\n const lines = [theme.fg(\"accent\", label(current, \"current\"))];\n for (const line of wrapPlainText(current.text, width, Math.max(1, Math.floor((rows - 2) / 2)))) {\n lines.push(theme.fg(\"dim\", line));\n }\n lines.push(theme.fg(\"accent\", label(previous, \"previous\")));\n for (const line of wrapPlainText(previous.text, width, Math.max(1, Math.floor((rows - 2) / 2)))) {\n lines.push(theme.fg(\"muted\", line));\n }\n return lines;\n }\n const columnWidth = Math.floor((width - 1) / 2);\n const body = Math.max(1, rows - 1);\n const previousBody = wrapPlainText(previous.text, columnWidth, body);\n const currentBody = wrapPlainText(current.text, columnWidth, body);\n const lines = [\n `${padToWidth(theme.fg(\"accent\", label(previous, \"previous\")), columnWidth)}${theme.fg(\"borderMuted\", \"\u2502\")}${theme.fg(\"accent\", label(current, \"current\"))}`,\n ];\n for (let index = 0; index < body; index++) {\n const left = previousBody[index];\n const right = currentBody[index];\n if (left === undefined && right === undefined) break;\n lines.push(\n `${padToWidth(theme.fg(\"muted\", left ?? \"\"), columnWidth)}${theme.fg(\"borderMuted\", \"\u2502\")}${theme.fg(\"dim\", right ?? \"\")}`,\n );\n }\n return lines;\n};\n\nexport const renderLcmDetailLines = (\n theme: Theme,\n detail: LcmNodeDetail,\n sourceIndex: number,\n entry: LcmSourceEntry | undefined,\n width: number,\n height: number,\n): string[] => {\n const available = Math.max(1, height);\n const node = detail.node;\n const lines: string[] = [\n theme.fg(\n isEmergency(node.modelHash) ? \"warning\" : \"accent\",\n truncateToWidth(\n safeText(\n `${node.kind} \u00B7 ${originLabel(node.modelHash)} \u00B7 depth ${node.depth} \u00B7 ${node.state} \u00B7 ${formatClock(node.createdAt)} \u00B7 ${node.nodeId}`,\n ),\n width,\n \"\",\n ),\n ),\n theme.fg(\n \"dim\",\n truncateToWidth(safeText(`model hash ${node.modelHash} \u00B7 branch ${node.branch ?? \"none\"}`), width, \"\"),\n ),\n theme.fg(\n \"dim\",\n truncateToWidth(\n safeText(`ancestors ${detail.ancestors.length > 0 ? detail.ancestors.join(\" \u203A \") : \"none\"}`),\n width,\n \"\",\n ),\n ),\n theme.fg(\n \"dim\",\n truncateToWidth(\n safeText(\n `children (${node.children.length}) ${node.children.length > 0 ? node.children.map(shortId).join(\" \") : \"none\"}`,\n ),\n width,\n \"\",\n ),\n ),\n theme.fg(\"accent\", truncateToWidth(`sources (${node.sources.length})`, width, \"\")),\n ];\n const sourceRows = Math.min(node.sources.length, Math.max(1, Math.floor(available / 4)));\n const sourceStart = Math.max(\n 0,\n Math.min(sourceIndex - Math.floor(sourceRows / 2), Math.max(0, node.sources.length - sourceRows)),\n );\n for (let index = sourceStart; index < Math.min(node.sources.length, sourceStart + sourceRows); index++) {\n const source = node.sources[index]!;\n const text = ` ${source.sessionId}/${source.entryId}@${source.revision}`;\n const line =\n index === sourceIndex\n ? theme.bg(\"selectedBg\", padToWidth(theme.fg(\"muted\", text), width))\n : theme.fg(\"muted\", text);\n lines.push(truncateToWidth(line, width, \"\"));\n }\n if (node.sources.length === 0) lines.push(theme.fg(\"dim\", \" (no sources)\"));\n if (entry) {\n lines.push(\n theme.fg(\n \"accent\",\n truncateToWidth(\n safeText(`raw entry \u00B7 ${entry.role} \u00B7 ${formatClock(entry.createdAt)} \u00B7 ${formatBytes(Buffer.byteLength(entry.payloadJson, \"utf8\"))} stored`),\n width,\n \"\",\n ),\n ),\n );\n for (const line of wrapPlainText(entry.content, width, Math.max(1, Math.floor(available / 4)))) {\n lines.push(theme.fg(\"dim\", line));\n }\n }\n const remaining = Math.max(1, available - lines.length);\n for (const line of revisionColumns(theme, detail, width, remaining)) lines.push(line);\n while (lines.length < available) lines.push(\"\");\n return lines.slice(0, available);\n};\n"],
5
- "mappings": ";;;;;;;;AACA,SAAS,iBAAiB,oBAAoB;AAKvC,IAAM,gBAAgB;AAE7B,IAAM,0BAA0B;AAChC,IAAM,uBAAuB;AA0BtB,IAAM,kBAAkB,CAAC,QAAyB,WAAoC;AAC3F,QAAM,QAAQ,OAAO,MAAM,eAAe,MAAM;AAChD,SAAO;AAAA,IACL,QAAQ,OAAO,OAAO;AAAA,IACtB,UAAU,OAAO,SAAS;AAAA,IAC1B,SAAS,OAAO,QAAQ;AAAA,IACxB,aAAa,OAAO,YAAY;AAAA,IAChC;AAAA,IACA;AAAA,IACA,SAAS,MAAM,WAAW;AAAA,EAC5B;AACF;AAEO,IAAM,gBAAgB,CAC3B,QACA,WAC8B;AAC9B,QAAM,SAAS,OAAO,KAAK,MAAM;AACjC,MAAI,CAAC,OAAQ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AAS,OAAO,KAAK,IAAI,GAAG,KAAK,MAAM,YAAY,CAAC,CAAC,CAAC,GAAG;AAC9F,YAAM,KAAK,MAAM,GAAG,OAAO,IAAI,CAAC;AAAA,IAClC;AAAA,EACF;AACA,QAAM,YAAY,KAAK,IAAI,GAAG,YAAY,MAAM,MAAM;AACtD,aAAW,QAAQ,gBAAgB,OAAO,QAAQ,OAAO,SAAS,EAAG,OAAM,KAAK,IAAI;AACpF,SAAO,MAAM,SAAS,UAAW,OAAM,KAAK,EAAE;AAC9C,SAAO,MAAM,MAAM,GAAG,SAAS;AACjC;",
4
+ "sourcesContent": ["import type { Theme } from \"@oh-my-pi/pi-coding-agent\";\nimport { truncateToWidth, visibleWidth } from \"@oh-my-pi/pi-tui\";\nimport type { LcmDashboardNode, LcmStatusSource } from \"../fabric-runtime-state.js\";\nimport { lcmStatusLabel } from \"../compaction/lcm-status.js\";\nimport { formatClock, formatCost, padToWidth, safeText, wrapPlainText } from \"./format.js\";\n\nexport const LCM_NODE_PAGE = 200;\n\nconst COVERAGE_COMPLETE_RATIO = 0.95;\nconst EMERGENCY_MODEL_HASH = \"emergency\";\n\nexport interface LcmViewSnapshot {\n report: ReturnType<LcmStatusSource[\"report\"]>;\n coverage: ReturnType<LcmStatusSource[\"coverage\"]>;\n preview: ReturnType<LcmStatusSource[\"preview\"]>;\n coverageMap: ReturnType<LcmStatusSource[\"coverageMap\"]>;\n nodes: LcmDashboardNode[];\n offset: number;\n hasMore: boolean;\n}\n\nexport interface LcmNodeDetail {\n node: LcmDashboardNode;\n revisions: Array<{ revision: number; text: string; modelHash: string; createdAt: number }>;\n ancestors: string[];\n}\n\nexport interface LcmSourceEntry {\n payloadJson: string;\n content: string;\n role: string;\n createdAt: number;\n}\n\n/** Reads every ledger projection the LCM view needs in one pass so rendering never walks the ledger. */\nexport const readLcmSnapshot = (source: LcmStatusSource, offset: number): LcmViewSnapshot => {\n const nodes = source.nodes(LCM_NODE_PAGE, offset);\n return {\n report: source.report(),\n coverage: source.coverage(),\n preview: source.preview(),\n coverageMap: source.coverageMap(),\n nodes,\n offset,\n hasMore: nodes.length === LCM_NODE_PAGE,\n };\n};\n\nexport const lcmNodeDetail = (\n source: LcmStatusSource,\n nodeId: string,\n): LcmNodeDetail | undefined => {\n const detail = source.node(nodeId);\n if (!detail) return undefined;\n return {\n node: detail.node,\n revisions: [...detail.revisions].sort((left, right) => left.revision - right.revision),\n ancestors: detail.ancestors,\n };\n};\n\nconst formatBytes = (bytes: number): string => {\n if (!Number.isFinite(bytes) || bytes <= 0) return \"0 B\";\n if (bytes < 1_024) return `${Math.round(bytes)} B`;\n if (bytes < 1_048_576) return `${(bytes / 1_024).toFixed(1)} kB`;\n return `${(bytes / 1_048_576).toFixed(1)} MB`;\n};\n\nconst formatPercent = (value: number): string =>\n value > 0 && value < 1 ? `${value.toFixed(value < 0.1 ? 2 : 1)}%` : `${Math.round(value)}%`;\n\nconst isEmergency = (modelHash: string): boolean => modelHash === EMERGENCY_MODEL_HASH;\n\nconst originLabel = (modelHash: string): string => (isEmergency(modelHash) ? \"excerpt\" : \"model\");\n\nconst shortId = (value: string): string => (value.length > 10 ? `${value.slice(0, 10)}\u2026` : value);\n\nconst textBytes = (text: string | undefined): number =>\n text ? Buffer.byteLength(text, \"utf8\") : 0;\n\nexport const lcmUnavailableLine = (): string =>\n \"LCM ledger unavailable \u00B7 set compaction.engine to lcm and start a session to populate it\";\n\nconst bandRun = (theme: Theme, char: string, length: number): string => {\n const color = char === \"\u2588\" ? \"success\" : char === \"\u2593\" ? \"warning\" : \"dim\";\n return theme.fg(color, char.repeat(length));\n};\n\nconst coverageBand = (\n theme: Theme,\n map: LcmViewSnapshot[\"coverageMap\"],\n cells: number,\n): string => {\n if (cells <= 0) return \"\";\n if (map.length === 0) return theme.fg(\"dim\", \"\u00B7\".repeat(cells));\n let band = \"\";\n let runChar = \"\";\n let runLength = 0;\n for (let cell = 0; cell < cells; cell++) {\n const start = Math.min(map.length - 1, Math.floor((cell * map.length) / cells));\n const end = Math.min(map.length, Math.max(start + 1, Math.floor(((cell + 1) * map.length) / cells)));\n let covered = 0;\n for (let index = start; index < end; index++) {\n if (map[index]!.covered) covered++;\n }\n const char = covered === 0 ? \"\u2591\" : covered === end - start ? \"\u2588\" : \"\u2593\";\n if (char === runChar) {\n runLength++;\n continue;\n }\n if (runLength > 0) band += bandRun(theme, runChar, runLength);\n runChar = char;\n runLength = 1;\n }\n if (runLength > 0) band += bandRun(theme, runChar, runLength);\n return band;\n};\n\nexport const renderLcmCoverageLine = (\n theme: Theme,\n snapshot: LcmViewSnapshot,\n width: number,\n): string => {\n const { active, covered } = snapshot.coverage;\n const label = `${covered}/${active} covered ${formatPercent(active > 0 ? (covered / active) * 100 : 0)}`;\n const cells = Math.max(0, width - visibleWidth(label) - 1);\n const band = coverageBand(theme, snapshot.coverageMap, cells);\n return truncateToWidth(`${band} ${theme.fg(\"muted\", label)}`, width, \"\");\n};\n\nconst nodeRow = (node: LcmDashboardNode): string => {\n const indent = \" \".repeat(Math.min(node.depth, 8));\n const glyph = node.kind === \"condensed\" ? \"\u25C6\" : \"\u25C7\";\n return safeText(\n `${indent}${glyph} ${node.kind} ${originLabel(node.modelHash)} \u00B7 ${node.sources.length} src \u00B7 ${node.children.length} ch \u00B7 ${formatBytes(textBytes(node.text))} \u00B7 ${shortId(node.nodeId)}`,\n );\n};\n\nexport const renderLcmNodeLines = (\n theme: Theme,\n snapshot: LcmViewSnapshot,\n width: number,\n height: number,\n selectedIndex: number,\n): string[] => {\n const available = Math.max(1, height);\n const total = snapshot.nodes.length;\n const heading = `nodes ${total === 0 ? 0 : snapshot.offset + 1}-${snapshot.offset + total}${snapshot.hasMore ? \"+\" : \"\"}`;\n const lines = [theme.fg(\"accent\", truncateToWidth(heading, width, \"\"))];\n if (total === 0) {\n lines.push(theme.fg(\"dim\", \" (no summary nodes on the active branch yet)\"));\n while (lines.length < available) lines.push(\"\");\n return lines.slice(0, available);\n }\n const rows = Math.max(1, available - 1);\n const start = Math.max(\n 0,\n Math.min(selectedIndex - Math.floor(rows / 2), Math.max(0, total - rows)),\n );\n for (let index = start; index < Math.min(total, start + rows); index++) {\n const node = snapshot.nodes[index]!;\n const emergency = isEmergency(node.modelHash);\n let line = theme.fg(emergency ? \"warning\" : \"muted\", nodeRow(node));\n if (index === selectedIndex) line = theme.bg(\"selectedBg\", padToWidth(line, width));\n lines.push(truncateToWidth(line, width, \"\"));\n }\n while (lines.length < available) lines.push(\"\");\n return lines.slice(0, available);\n};\n\nexport const renderLcmPreviewLines = (\n theme: Theme,\n snapshot: LcmViewSnapshot,\n width: number,\n height: number,\n): string[] => {\n const available = Math.max(1, height);\n const preview = snapshot.preview;\n const complete =\n preview.activeSources > 0 &&\n preview.coveredSources / preview.activeSources >= COVERAGE_COMPLETE_RATIO;\n const ratio =\n complete && preview.sourceBytes > 0\n ? ` \u00B7 assembled text is ${formatPercent((preview.summaryBytes / preview.sourceBytes) * 100)} of the session payload it replaces`\n : \"\";\n const headline = `preview \u00B7 frontier holds ${preview.coveredSources}/${preview.activeSources} sources \u00B7 ${preview.nodes} nodes assemble to ${formatBytes(preview.summaryBytes)} \u00B7 session stored payload ${formatBytes(preview.sourceBytes)}${ratio}`;\n const lines = wrapPlainText(headline, width, 2).map((line) => theme.fg(\"accent\", line));\n const body = wrapPlainText(preview.text, width, Math.max(1, available - lines.length));\n for (const line of body) lines.push(theme.fg(\"dim\", line));\n if (body.length === 0) lines.push(theme.fg(\"dim\", \"(the frontier assembles no text yet)\"));\n while (lines.length < available) lines.push(\"\");\n return lines.slice(0, available);\n};\n\nconst revisionColumns = (\n theme: Theme,\n detail: LcmNodeDetail,\n width: number,\n rows: number,\n): string[] => {\n const current = detail.revisions[detail.revisions.length - 1];\n const previous = detail.revisions[detail.revisions.length - 2];\n if (!current) return [];\n if (!previous) {\n const lines = [theme.fg(\"accent\", `text \u00B7 current revision ${current.revision} \u00B7 ${originLabel(current.modelHash)}`)];\n for (const line of wrapPlainText(current.text, width, Math.max(1, rows - 1))) {\n lines.push(theme.fg(\"dim\", line));\n }\n return lines;\n }\n const label = (revision: { revision: number; modelHash: string }, name: string): string =>\n `${name} revision ${revision.revision} \u00B7 ${originLabel(revision.modelHash)}`;\n if (width < 60) {\n const lines = [theme.fg(\"accent\", label(current, \"current\"))];\n for (const line of wrapPlainText(current.text, width, Math.max(1, Math.floor((rows - 2) / 2)))) {\n lines.push(theme.fg(\"dim\", line));\n }\n lines.push(theme.fg(\"accent\", label(previous, \"previous\")));\n for (const line of wrapPlainText(previous.text, width, Math.max(1, Math.floor((rows - 2) / 2)))) {\n lines.push(theme.fg(\"muted\", line));\n }\n return lines;\n }\n const columnWidth = Math.floor((width - 1) / 2);\n const body = Math.max(1, rows - 1);\n const previousBody = wrapPlainText(previous.text, columnWidth, body);\n const currentBody = wrapPlainText(current.text, columnWidth, body);\n const lines = [\n `${padToWidth(theme.fg(\"accent\", label(previous, \"previous\")), columnWidth)}${theme.fg(\"borderMuted\", \"\u2502\")}${theme.fg(\"accent\", label(current, \"current\"))}`,\n ];\n for (let index = 0; index < body; index++) {\n const left = previousBody[index];\n const right = currentBody[index];\n if (left === undefined && right === undefined) break;\n lines.push(\n `${padToWidth(theme.fg(\"muted\", left ?? \"\"), columnWidth)}${theme.fg(\"borderMuted\", \"\u2502\")}${theme.fg(\"dim\", right ?? \"\")}`,\n );\n }\n return lines;\n};\n\nexport const renderLcmDetailLines = (\n theme: Theme,\n detail: LcmNodeDetail,\n sourceIndex: number,\n entry: LcmSourceEntry | undefined,\n width: number,\n height: number,\n): string[] => {\n const available = Math.max(1, height);\n const node = detail.node;\n const lines: string[] = [\n theme.fg(\n isEmergency(node.modelHash) ? \"warning\" : \"accent\",\n truncateToWidth(\n safeText(\n `${node.kind} \u00B7 ${originLabel(node.modelHash)} \u00B7 depth ${node.depth} \u00B7 ${node.state} \u00B7 ${formatClock(node.createdAt)} \u00B7 ${node.nodeId}`,\n ),\n width,\n \"\",\n ),\n ),\n theme.fg(\n \"dim\",\n truncateToWidth(safeText(`model hash ${node.modelHash}`), width, \"\"),\n ),\n theme.fg(\n \"dim\",\n truncateToWidth(\n safeText(`ancestors ${detail.ancestors.length > 0 ? detail.ancestors.join(\" \u203A \") : \"none\"}`),\n width,\n \"\",\n ),\n ),\n theme.fg(\n \"dim\",\n truncateToWidth(\n safeText(\n `children (${node.children.length}) ${node.children.length > 0 ? node.children.map(shortId).join(\" \") : \"none\"}`,\n ),\n width,\n \"\",\n ),\n ),\n theme.fg(\"accent\", truncateToWidth(`sources (${node.sources.length})`, width, \"\")),\n ];\n const sourceRows = Math.min(node.sources.length, Math.max(1, Math.floor(available / 4)));\n const sourceStart = Math.max(\n 0,\n Math.min(sourceIndex - Math.floor(sourceRows / 2), Math.max(0, node.sources.length - sourceRows)),\n );\n for (let index = sourceStart; index < Math.min(node.sources.length, sourceStart + sourceRows); index++) {\n const source = node.sources[index]!;\n const text = ` ${source.sessionId}/${source.entryId}@${source.revision}`;\n const line =\n index === sourceIndex\n ? theme.bg(\"selectedBg\", padToWidth(theme.fg(\"muted\", text), width))\n : theme.fg(\"muted\", text);\n lines.push(truncateToWidth(line, width, \"\"));\n }\n if (node.sources.length === 0) lines.push(theme.fg(\"dim\", \" (no sources)\"));\n if (entry) {\n lines.push(\n theme.fg(\n \"accent\",\n truncateToWidth(\n safeText(`raw entry \u00B7 ${entry.role} \u00B7 ${formatClock(entry.createdAt)} \u00B7 ${formatBytes(Buffer.byteLength(entry.payloadJson, \"utf8\"))} stored`),\n width,\n \"\",\n ),\n ),\n );\n for (const line of wrapPlainText(entry.content, width, Math.max(1, Math.floor(available / 4)))) {\n lines.push(theme.fg(\"dim\", line));\n }\n }\n const remaining = Math.max(1, available - lines.length);\n for (const line of revisionColumns(theme, detail, width, remaining)) lines.push(line);\n while (lines.length < available) lines.push(\"\");\n return lines.slice(0, available);\n};\n"],
5
+ "mappings": ";;;;;;;;AACA,SAAS,iBAAiB,oBAAoB;AAKvC,IAAM,gBAAgB;AAE7B,IAAM,0B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AO,EAAE,CAAC;AAAA,EAC7C;AACA,MAAI,KAAK,QAAQ,WAAW,EAAG,OAAM,KAAK,MAAM,GAAG,OAAO,gBAAgB,CAAC;AAC3E,MAAI,OAAO;AACT,UAAM;AAAA,MACJ,MAAM;AAAA,QACJ;AAAA,QACA;AAAA,UACE,SAAS,kBAAe,MAAM,IAAI,SAAM,YAAY,MAAM,SAAS,CAAC,SAAM,YAAY,OAAO,WAAW,MAAM,aAAa,MAAM,CAAC,CAAC,SAAS;AAAA,UAC5I;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,IACF;AACA,eAAW,QAAQ,cAAc,MAAM,SAAS,OAAO,KAAK,IAAI,GAAG,KAAK,MAAM,YAAY,CAAC,CAAC,CAAC,GAAG;AAC9F,YAAM,KAAK,MAAM,GAAG,OAAO,IAAI,CAAC;AAAA,IAClC;AAAA,EACF;AACA,QAAM,YAAY,KAAK,IAAI,GAAG,YAAY,MAAM,MAAM;AACtD,aAAW,QAAQ,gBAAgB,OAAO,QAAQ,OAAO,SAAS,EAAG,OAAM,KAAK,IAAI;AACpF,SAAO,MAAM,SAAS,UAAW,OAAM,KAAK,EAAE;AAC9C,SAAO,MAAM,MAAM,GAAG,SAAS;AACjC;",
6
6
  "names": ["lines"]
7
7
  }
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  peerLabelPrefix,
23
23
  writeHandoffSession
24
- } from "./chunk-N2MMGFMD.js";
24
+ } from "./chunk-C5JMLDIM.js";
25
25
  import {
26
26
  DEFAULT_FABRIC_CONFIG,
27
27
  MAX_AGENT_TIMEOUT_MS,
@@ -6635,4 +6635,4 @@ export {
6635
6635
  agentParticipantRecords,
6636
6636
  actorParticipantRecord
6637
6637
  };
6638
- //# sourceMappingURL=chunk-3NWBU3K7.js.map
6638
+ //# sourceMappingURL=chunk-VYB7ROEH.js.map
@@ -1666,13 +1666,11 @@ var registerCompactionHook = (omp, options) => {
1666
1666
  const branchEntries = event.branchEntries ?? [];
1667
1667
  const sessionManager = context?.sessionManager;
1668
1668
  const sessionId = sessionManager?.getSessionId?.() ?? "";
1669
- const branch = sessionManager?.getLeafId?.() ?? null;
1670
1669
  let output;
1671
1670
  try {
1672
1671
  output = options.lcm.compact({
1673
1672
  branchEntries,
1674
1673
  sessionId,
1675
- branch,
1676
1674
  firstKeptEntryId: event.preparation.firstKeptEntryId,
1677
1675
  tokensBefore: event.preparation.tokensBefore,
1678
1676
  ...event.customInstructions === void 0 ? {} : { customInstructions: event.customInstructions }
@@ -1683,7 +1681,7 @@ var registerCompactionHook = (omp, options) => {
1683
1681
  if (context?.hasUI) context.ui.notify(`LCM compaction failed: ${message}`, "error");
1684
1682
  return { cancel: true };
1685
1683
  }
1686
- if (!output || typeof output.summary !== "string" || output.summary.length === 0 || output.source !== "ready-frontier" && output.source !== "emergency" || output.tokensBefore !== event.preparation.tokensBefore || output.branch !== branch || typeof output.firstKeptEntryId !== "string" || branchEntries.length === 0 || output.firstKeptEntryId.length > 0 && !branchEntries.some((entry) => entry.id === output.firstKeptEntryId)) {
1684
+ if (!output || typeof output.summary !== "string" || output.summary.length === 0 || output.source !== "ready-frontier" && output.source !== "emergency" || output.tokensBefore !== event.preparation.tokensBefore || typeof output.firstKeptEntryId !== "string" || branchEntries.length === 0 || output.firstKeptEntryId.length > 0 && !branchEntries.some((entry) => entry.id === output.firstKeptEntryId)) {
1687
1685
  return { cancel: true };
1688
1686
  }
1689
1687
  return {
@@ -1694,7 +1692,6 @@ var registerCompactionHook = (omp, options) => {
1694
1692
  details: {
1695
1693
  compactor: "lcm",
1696
1694
  source: output.source,
1697
- branch,
1698
1695
  ...output.details && typeof output.details === "object" ? output.details : {}
1699
1696
  }
1700
1697
  }
@@ -1724,4 +1721,4 @@ export {
1724
1721
  compileFabricSummary,
1725
1722
  registerCompactionHook
1726
1723
  };
1727
- //# sourceMappingURL=chunk-D2ET33NE.js.map
1724
+ //# sourceMappingURL=chunk-WMB6QCWX.js.map