feat(graph): daily-digest (יומון) discovery layer (corpus graph PR E)

Chaim's idea: surface the downloaded "כל יום" digests in the graph. Each digest
COVERS the ruling it analyses — a corpus precedent when we have it (16), or a
synthesized gap node from its underlying_citation when we don't (269). So the
digest layer doubles as a discovery signal: it makes visible that the daily
feed overwhelmingly covers rulings NOT yet in the corpus.

Backend (web/graph_api.py — read-only, G2):
- "digest" added to VALID_NODE_TYPES (off by default).
- _digest_nodes_and_edges(): dig:<id> nodes from completed digests, `covers`
  edge → cl:precedent (linked_case_law_id in view) or → gap:<underlying_citation>
  (synthesized, deduped against the gap layer — real in-degree wins). Carries
  concept_tag (label), headline_holding (note), underlying_court/date.
- _add_digests() appends the layer with gap dedup. Wired into both build
  functions. GraphNode += note, digest_id. Gated via node_types (no app.py
  change). Validated: 16 covers→precedent, 269 covers→gap.

Frontend:
- graph.ts: GraphNodeType += "digest"; GraphEdgeType += "covers"; node fields.
- graph-filter-panel: toggle "יומונים (כל יום)" (off by default).
- graph-canvas: digest = teal node (r=4); `covers` edges teal.
- graph-node-panel: digest branch — concept + holding + court/date + link to
  /digests.

web-ui build + lint pass. Invariants: G2 (SELECT-only), UI2. api:types post-deploy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 21:31:04 +00:00
parent 8dc0a268fb
commit fc5d69902f
6 changed files with 147 additions and 6 deletions

View File

@@ -51,6 +51,7 @@ const NODE_COLORS: Record<string, string> = {
topic: "#a97d3a", // gold — hubs stand out
practice_area: "#475569", // slate
gap: "#94a3b8", // faint slate — research gap (not in corpus)
digest: "#2f6f7a", // teal — daily-digest (יומון) discovery layer
};
const TREATMENT_COLORS: Record<string, string> = {
@@ -114,6 +115,7 @@ export function colorForNode(n: GraphNode, colorBy: ColorBy): string {
export function radiusForNode(n: GraphNode, sizeBy: SizeBy): number {
if (n.type === "topic" || n.type === "practice_area") return 5;
if (n.type === "digest") return 4;
if (sizeBy === "pagerank" && n.pagerank != null) {
return 3 + Math.sqrt(n.pagerank) * 18;
}
@@ -301,6 +303,9 @@ export function GraphCanvas({
if (link.type === "tagged" || link.type === "in_area") {
return "rgba(169,125,58,0.16)";
}
if (link.type === "covers") {
return "rgba(47,111,122,0.45)"; // teal — digest → ruling
}
return "rgba(80,90,110,0.22)";
},
[activeId],