Skip to main content

Module programs

Module programs 

Source
Expand description

Bitmap-program analytics over the infon index — the deterministic template library the agent composes beyond bare retrieve. Ported from the mother’s hypergraph/programs.ts + query-engine.ts (fd46262): partitions (breakdown/crosstab), salience (rank), the structural s-graph (cooccurs/s_path/s_clusters), and stepwise answerability (narrow).

Everything reduces to roaring set-algebra: partitions are anchor ∩ token popcounts; the s-graph is token→token overlap (shared situations) with a threshold s. Non-discriminative high-DF tokens and contextual facets (geo/time/qty/…) are held out of the structural graph so the analytics reason over signal, not stopword-like noise — the registration() fix (71e1714).

Structs§

Graph
Edge and component counts for one reading at one threshold.
Level
One level of an s-filtration: both readings of the incidence matrix at overlap threshold s.

Functions§

breakdown
Partition an anchor set by the values of a facet: for each facet/value, the anchor ∩ token count. A breakdown of an explicitly requested facet shows ALL its values — the high-DF registration filter (which belongs on the structural graph) must not hide the most frequent values here.
cooccurs
Tokens that co-occur most with token (shared-situation overlap), over the structural node space.
crosstab
Co-occurrence matrix of two facets over an anchor set (top-k values of each by anchor overlap). Like breakdown, the requested facets’ values are shown in full (no high-DF registration filter).
dual_node_names
The names behind the dual node indices of s_filtration, in the same order.
narrow
Add scope/filter tokens one at a time and report how the matched set shrinks — where it hits zero tells you which constraint the corpus cannot satisfy.
rank
Rank a facet’s values by salience: a min-max-normalised blend of frequency (posting size) and cross-concept breadth (how many distinct structural nodes it co-occurs with). Recency is omitted — the Rust corpus has no reliable per-situation date column — so weights split freq/breadth 0.5/0.5.
s_clusters
Connected components of the structural graph at overlap threshold s — the token clusters.
s_filtration
Sweep the overlap threshold from 1 to max_s, reporting both topologies at each level.
s_path
Shortest ≥s-overlap path (fewest hops) between two tokens over the structural graph; null if disconnected at s.