zettelkasten.synapse.matrix¶
zettelkasten.synapse.matrix ¶
Cross-store matrix lens: the link overlay projected as practice x canon.
A read-only VIEW over the bipartite connection overlay — it materializes nothing into either store. Rows are memory (practice) nodes, columns are ZK (canon) nodes, and a cell is the typed edge between them (relation + confidence). This is the natural matrix shape of a bipartite graph, so no spine/table machinery is needed.
On top of the grid, :func:synthesize_axes rolls each axis up to a summary:
- row synthesis — how one practice node relates across the canon it touches;
- column synthesis — how one canon node is exercised across practice;
- apex — a single synthesis over the row + column summaries.
Synthesis is injectable (default = a tool-free LLM pass) so the lens builds and tests without an LLM.
build_matrix_lens ¶
build_matrix_lens(zk_get_graph: GetGraph, projects: list[str] | None = None, graphs_dir: 'Path | None' = None, overlay: dict[str, Any] | None = None, min_confidence: float = 0.0, max_rows: int = _MAX_AXIS, max_columns: int = _MAX_AXIS) -> dict[str, Any]
Project the connection overlay into a practice x canon matrix (read-only).
Rows = memory nodes, columns = ZK nodes, cells = typed edges. Titles are resolved best-effort via the stores. Axes are capped (busiest nodes first) with a truncation flag.
Source code in zettelkasten/synapse/matrix.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
synthesize_axes ¶
Add row/column summaries and a rolled-up apex synthesis to a matrix lens.
synth(kind, header, items) returns summary text; defaults to a tool-free
LLM pass. Purely additive and read-only — the returned lens gains
row_synthesis / column_synthesis / apex fields.