practice fix follow-up — the picker lists EVERY birth-session group (owner ruling)

Owner escalation on deviation 1: practice availability must not
inherit a visual-rendering threshold. graphClusters() now runs
birthSessionPartition(snap.nodes) directly (same size-desc/id-asc
ordering) instead of reading the snapshot's MIN_CLUSTER_SIZE-filtered
clusters array — MIN_CLUSTER_SIZE stays a hull-drawing rule only.
Label join mirrors the snapshot's (chat title / notes path, null when
the naming record is gone). Contract doc + architecture.md sentence
corrected to match; empty-picker copy reworded ('once a session births
its first proposition' — no 3+ mechanics). Render pins: new empty line
+ a 1- and 2-proposition group listing pin. 1130/1130, tsc 0, lint 0,
build 0.
This commit is contained in:
amosblomqvist
2026-09-29 19:28:51 +03:00
parent f39e1b4294
commit a53127a764
5 changed files with 41 additions and 19 deletions
+18
View File
@@ -46,6 +46,15 @@ function clusters(): GraphClusterGroup[] {
];
}
/** Small groups are listable (owner ruling: practice availability never
* inherits the hull-drawing threshold). */
function smallClusters(): GraphClusterGroup[] {
return [
{ key: "chat_2", kind: "chat", label: "One-off question", nodeIds: ["n20"], nodeCount: 1 },
{ key: "chat_3", kind: "chat", label: "Quick exchange", nodeIds: ["n30", "n31"], nodeCount: 2 },
];
}
function stubProblem(id: string, chains: string[]): Problem {
return { id, chains, statement: "", solution: "", rubric: "", status: "generating" };
}
@@ -129,6 +138,15 @@ describe("PracticeDialogBody — creation (cluster picker)", () => {
it("an empty graph is an honest empty list", () => {
const html = renderToStaticMarkup(<PracticeDialogBody {...base} clusters={[]} />);
assert.ok(html.includes("No clusters yet"));
assert.ok(html.includes("once a session births its first proposition"), "no 3+ mechanics in copy");
});
it("1- and 2-proposition groups appear — no hull threshold in the picker", () => {
const html = renderToStaticMarkup(<PracticeDialogBody {...base} clusters={smallClusters()} />);
assert.ok(html.includes('data-testid="practice-cluster-chat_2"'), "singleton group listed");
assert.ok(html.includes("1 propositions"));
assert.ok(html.includes('data-testid="practice-cluster-chat_3"'), "pair group listed");
assert.ok(html.includes("2 propositions"));
});
it("empty selection (vanished nodes) renders the honest inline line", () => {