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:
+22
-1
@@ -9,7 +9,7 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "node:test";
|
||||
import type { EdgeType } from "../src/core/contracts.ts";
|
||||
import { chainCoverage, chainsForSelection, chainsToGraph } from "../src/core/practice.ts";
|
||||
import { chainCoverage, chainsForSelection, chainsToGraph, formatChainLine } from "../src/core/practice.ts";
|
||||
|
||||
// ─── fixtures ────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -138,3 +138,24 @@ describe("chainCoverage", () => {
|
||||
assert.deepEqual(chainCoverage(set), { missing: [], duplicated: [] });
|
||||
});
|
||||
});
|
||||
|
||||
describe("formatChainLine (the chain table's one-line shape, 2026-09-29)", () => {
|
||||
const props = {
|
||||
p1: { name: "Premise one" },
|
||||
p2: { name: "Premise two" },
|
||||
c1: { name: "Conclusion" },
|
||||
solo: { name: "Standalone" },
|
||||
};
|
||||
|
||||
it("joins sorted premise NAMES by the derivation arrow", () => {
|
||||
assert.equal(formatChainLine({ premises: ["p2", "p1"], conclusion: "c1" }, props), "Premise one, Premise two → Conclusion");
|
||||
});
|
||||
|
||||
it("a singleton shows its (no premises) marker", () => {
|
||||
assert.equal(formatChainLine({ premises: [], conclusion: "solo" }, props), "Standalone (no premises)");
|
||||
});
|
||||
|
||||
it("unknown ids fall back to the raw id (honest, never guessed)", () => {
|
||||
assert.equal(formatChainLine({ premises: ["ghost"], conclusion: "c1" }, props), "ghost → Conclusion");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user