practice: the chain table — every reasoning chain in one selectable overlay (owner-approved plan, 2026-09-29)
- core formatChainLine: names + arrow one-liner, singleton marker, pure
- graph-view Chains button (chrome row, empty-graph hidden) opens the
overlay: fuzzy search (names/aliases/statements), collapsible chain →
member → statement rows, birth-session + created columns, no
understanding-levels column
- pinned Selected section derives the agents' actual input live
(chainsForSelection over the selection; premise without its
conclusion shows as the singleton it becomes)
- Generate opens the creation dialog in CUSTOM mode: selection summary
+ dated default title, posts {nodeIds, params, note}; cluster mode
untouched on /practice
- live-verified on the owner's dev server: 219 chains, derived preview,
search-never-filters-Selected, dialog handoff (selection pass-through
bug caught + fixed en route), Esc/backdrop dismiss, zero writes
- practice UI files re-normalized to tabs (my earlier prettier runs had
drifted them to the 2-space default; whitespace-only)
17 render/unit pins added; gates: tsc 0, 1174/1174, lint 0, build 0
This commit is contained in:
@@ -91,6 +91,24 @@ export function chainsToGraph(
|
||||
return { nodeIds: [...nodeIds].sort(), edges };
|
||||
}
|
||||
|
||||
/** A chain as one world-facing line — the propositions' NAMES joined
|
||||
* by the derivation arrow: "Premise one, Premise two → Conclusion"; a
|
||||
* singleton shows its "(no premises)" marker. Pure + browser-safe:
|
||||
* the shell (chain table, derived previews) cannot import the agent
|
||||
* module — the level tables set this precedent. Unknown ids fall back
|
||||
* to the raw id (honest, never guessed). Premises sort by id — the
|
||||
* same determinism law as chainsForSelection. */
|
||||
export function formatChainLine(
|
||||
chain: Pick<ReasoningChain, "premises" | "conclusion">,
|
||||
propositions: Readonly<Record<string, { name: string }>>,
|
||||
): string {
|
||||
const nameOf = (id: string) => propositions[id]?.name ?? id;
|
||||
const premises = [...chain.premises].sort().map(nameOf).join(", ");
|
||||
return premises !== ""
|
||||
? `${premises} → ${nameOf(chain.conclusion)}`
|
||||
: `${nameOf(chain.conclusion)} (no premises)`;
|
||||
}
|
||||
|
||||
/** chainCoverage()'s report. `missing` fails the partition; `duplicated`
|
||||
* is informational — a chain MAY legitimately be exercised by several
|
||||
* problems (the operations make that sound). */
|
||||
|
||||
Reference in New Issue
Block a user