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:
@@ -260,10 +260,11 @@ export interface Cluster {
|
||||
|
||||
/** One birth-session cluster as the practice picker consumes it (owner
|
||||
* ruling 2026-09-29: problem sets take NODES — the UI resolves a picked
|
||||
* cluster to its member ids). Same grouping the graph view renders
|
||||
* (birthSessionPartition semantics, MIN_CLUSTER_SIZE presentation
|
||||
* filter included); `label` is null when the naming record is gone —
|
||||
* honest, never guessed (the graph view renders those unlabeled). */
|
||||
* cluster to its member ids). EVERY birth-session group regardless of
|
||||
* size (owner ruling, same evening: MIN_CLUSTER_SIZE is a hull-drawing
|
||||
* rule — practice availability must not inherit a visual threshold);
|
||||
* `label` is null when the naming record is gone — honest, never
|
||||
* guessed (the graph view renders those unlabeled). */
|
||||
export interface GraphClusterGroup {
|
||||
/** The birth session's id — a chatId or a notes source id. */
|
||||
key: string;
|
||||
|
||||
+16
-13
@@ -4,6 +4,7 @@ import type { GraphClusterGroup, GraphSnapshot } from "../core/contracts.ts";
|
||||
import type { GraphCostSummary } from "../core/cost-summary.ts";
|
||||
import { graphCostSummary } from "../core/cost-summary.ts";
|
||||
import { graphSnapshot } from "../core/graph.ts";
|
||||
import { birthSessionPartition } from "../core/session-clusters.ts";
|
||||
import {
|
||||
deleteNodeTraces,
|
||||
nodeDeletionImpact,
|
||||
@@ -23,21 +24,23 @@ export function graphView(): GraphSnapshot {
|
||||
return graphSnapshot(stores);
|
||||
}
|
||||
|
||||
/** GET /api/graph/clusters — the birth-session groups the graph view
|
||||
* renders, resolved to node ids for the practice picker (owner ruling
|
||||
* 2026-09-29: cluster→nodeIds resolves in the UI; the API stays
|
||||
* graph-domain). Reuses the snapshot's clustering verbatim — same
|
||||
* ordering (size desc, ties by id) and the same MIN_CLUSTER_SIZE
|
||||
* presentation filter the canvas honors. A corrupt/empty graph is an
|
||||
* empty list. */
|
||||
/** GET /api/graph/clusters — the birth-session groups, resolved to node
|
||||
* ids for the practice picker (owner ruling 2026-09-29: cluster→nodeIds
|
||||
* resolves in the UI; the API stays graph-domain). EVERY group is
|
||||
* listed regardless of size (owner ruling, same evening:
|
||||
* MIN_CLUSTER_SIZE is a hull-DRAWING rule — practice availability must
|
||||
* not inherit a visual threshold), with the partition's own ordering
|
||||
* (size desc, ties by id asc). The label join mirrors the snapshot's:
|
||||
* chat title / notes file path, null when the naming record is gone —
|
||||
* honest, never guessed. A corrupt/empty graph is an empty list. */
|
||||
export function graphClusters(): GraphClusterGroup[] {
|
||||
const snap = graphSnapshot(stores);
|
||||
return snap.clusters.map((cluster) => ({
|
||||
key: cluster.id,
|
||||
kind: cluster.id in snap.sessions ? "chat" : "notes",
|
||||
label: cluster.label,
|
||||
nodeIds: cluster.members,
|
||||
nodeCount: cluster.members.length,
|
||||
return birthSessionPartition(snap.nodes).map((group) => ({
|
||||
key: group.id,
|
||||
kind: group.id in snap.sessions ? "chat" : "notes",
|
||||
label: snap.sessions[group.id] ?? snap.fileSources[group.id] ?? null,
|
||||
nodeIds: group.members,
|
||||
nodeCount: group.members.length,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user