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

@@ -19,7 +19,8 @@ export type GraphNodeType =
| "halacha"
| "topic"
| "practice_area"
| "gap";
| "gap"
| "digest";
export type GraphEdgeType =
| "cites"
@@ -27,7 +28,8 @@ export type GraphEdgeType =
| "tagged"
| "in_area"
| "corroborates"
| "equivalent";
| "equivalent"
| "covers";
export type GraphNode = {
id: string;
@@ -45,6 +47,8 @@ export type GraphNode = {
community: number | null; // dense cluster id, 0 = largest
gap_status: string | null; // gap nodes only — open|uploaded|closed|irrelevant
missing_precedent_id: string | null; // gap nodes only
note: string | null; // digest nodes only — the holding line
digest_id: string | null; // digest nodes only
};
export type GraphFacets = {