Cost channel cull: the cluster-naming fold dies — two stages, two channels

Off UI's d651f93 flag (displayCostTotals already isolates the display to
extraction + audit; the naming stage row and naming runs were filtered
out client-side). This culls the server side of the same ruling.

THE STANDING RULING, REVERSED BY ITS OWN PREMISE: NamingRunUsage /
readNamingRuns / appendNamingUsage were kept at the wave-7 namer kill
ONLY because cost-summary's HISTORICAL naming stage read them. With the
fold culled, that premise dies — so the whole ledger read path goes too,
following the wave-7 embeddings precedent chain: consumer-less ledger
seams are deleted, and the on-disk naming-runs.jsonl stays INERT (real
trees keep their historical spend bytes; they are simply not displayed
anywhere — the same treatment as historical stages.embedding spend).

- core/cost-summary.ts: two channels in (chat + notes front doors), two
  stages out; RecentRun.kind collapses to "extraction" (labels field
  gone); CostSummaryInput.naming gone; totalDollars = extraction + audit.
- ports/store/contracts/config: appendNamingUsage + readNamingRuns ports,
  store impls + guards, the NamingRunUsage interface, and
  LEDGER_FILES.namingRuns die. graphRevision no longer counts the file
  (a smaller revision value is harmless — reads never compare).
- components/graph-view.tsx (mechanical, flagged): the defensive
  .filter(run.kind !== "naming") guards a kind that no longer exists.
- Tests: cost-summary's both-channels fold pins; the naming fixtures and
  the appendNamingUsage store pin die with the seams.
This commit is contained in:
amosblomqvist
2026-09-24 19:33:35 +03:00
parent 2cba283009
commit 73027f49bf
12 changed files with 33 additions and 153 deletions
+5 -6
View File
@@ -42,14 +42,14 @@ export function graphCosts(): GraphCostSummary {
.readSources()
.filter((s) => s.extractions?.length)
.map((s) => ({ filePath: s.filePath, extractions: s.extractions! }));
return graphCostSummary({ chats, sources, naming: stores.graphStore.readNamingRuns() });
return graphCostSummary({ chats, sources });
}
/** The graph's version stamp (session-deletion wave 6): the max mtime
* across every graph data file — ledgers, positions, embeddings. Moves
* on ANY graph write (merge append, settle, embed, or a deletion's
* atomic rewrite), never moves on reads, and needs no bookkeeping of
* its own: the fs IS the counter. Consumers poll it (the activity feed
* across every graph data file — ledgers, positions. Moves on ANY
* graph write (merge append, settle, or a deletion's atomic rewrite),
* never moves on reads, and needs no bookkeeping of its own: the fs
* IS the counter. Consumers poll it (the activity feed
* carries it; the DELETE response returns it) to know clusters/layout
* must refetch — the "graph changed underneath me" signal. */
export function graphRevision(): number {
@@ -61,7 +61,6 @@ export function graphRevision(): number {
LEDGER_FILES.mappings,
LEDGER_FILES.sessions,
LEDGER_FILES.coverage,
LEDGER_FILES.namingRuns,
POSITIONS_FILE,
]) {
try {