search.rs → query/engine.rs (algorithms, pipeline, seed matching)
query.rs → query/parser.rs (PEG query language, field resolution)
query/mod.rs re-exports for backwards compatibility.
crate::search still works (aliased to query::engine).
crate::query::run_query resolves to the parser's entry point.
No logic changes — pure file reorganization.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
The Provenance enum couldn't represent agents defined outside the
source code. Replace it with a Text field in the capnp schema so any
agent can write its own provenance label (e.g. "extractor:write",
"rename:tombstone") without a code change.
Schema: rename old enum fields to provenanceOld, add new Text
provenance fields. Old enum kept for reading legacy records.
Migration: from_capnp_migrate() falls back to old enum when the
new text field is empty.
Also adds `poc-memory tail` command for viewing recent store writes.
Co-Authored-By: ProofOfConcept <poc@bcachefs.org>
Default search now uses exact key match only. Component matching
(--fuzzy) and content search (--content) are explicit flags. This
makes missing graph structure visible instead of silently falling
back to broad matching.
match_seeds() previously only found nodes whose keys exactly matched
search terms. This meant searches like "formal verification" or
"bcachefs plan" returned nothing — no nodes are keyed with those
exact strings.
Three-tier matching strategy:
1. Exact key match (full weight) — unchanged
2. Key component match (0.5× weight) — split keys on -/_/./#,
match individual words. "plan" now finds "the-plan", "verification"
finds "c-to-rust-verification-workflow", etc.
3. Content match (0.2× weight, capped at 50 hits) — search node
content for terms that didn't match any key. Catches nodes whose
keys are opaque but whose content is relevant.
Also adds prompt-based seeding to the hook pipeline: extract_query_terms
from the user's prompt and merge into the term set. Previously the hook
only seeded from transcript scanning (finding node keys as substrings
in conversation history), which meant fresh sessions or queries about
new topics produced no search results at all.
Node weight no longer gates signal propagation — only edge_decay
and edge_strength affect traversal. Node weight is applied at the
end for ranking. This lets low-weight nodes serve as bridges
without killing the signal passing through them.
Co-Authored-By: ProofOfConcept <poc@bcachefs.org>
All seeds emit at once. At each hop, activations from all sources
sum at each node, and the combined map propagates on the next hop.
Nodes where multiple wavefronts overlap get reinforced and radiate
stronger — natural interference patterns.
Lower default min_activation threshold (×0.1) since individual
contributions are smaller in additive mode.
Co-Authored-By: ProofOfConcept <poc@bcachefs.org>
Initialize direction from the two most spectrally separated seeds
instead of relying on input order (which was alphabetical from
BTreeMap). Run 3 rounds of power iteration with normalization
instead of 1 for better convergence.
Co-Authored-By: ProofOfConcept <poc@bcachefs.org>
Three new composable search stages:
confluence — multi-source spreading activation. Unlike spread (which
takes max from any source), confluence rewards nodes reachable from
multiple seeds additively. Naturally separates unrelated seed groups
since their neighborhoods don't overlap. Params: max_hops, edge_decay,
min_sources.
geodesic — straightest path between seed pairs in spectral space.
At each graph hop, picks the neighbor whose spectral direction most
aligns with the target (cosine similarity of direction vectors).
Nodes on many geodesic paths score highest. Params: max_path, k.
manifold — extrapolation along the direction seeds define. Computes
weighted centroid + principal axis of seeds in spectral space, then
scores candidates by projection onto that axis (penalized by
perpendicular distance). Finds what's "further along" rather than
"nearby." Params: k.
Co-Authored-By: ProofOfConcept <poc@bcachefs.org>
Add util::truncate() and util::first_n_chars() to replace 16 call
sites doing the same floor_char_boundary or chars().take().collect()
patterns. Deduplicate the batching loop in consolidate.rs (4 copies
→ 1 loop over an array). Fix all clippy warnings: redundant closures,
needless borrows, collapsible if, unnecessary cast, manual strip_prefix.
Net: -44 lines across 16 files.
poc-daemon (notification routing, idle timer, IRC, Telegram) was already
fully self-contained with no imports from the poc-memory library. Now it's
a proper separate crate with its own Cargo.toml and capnp schema.
poc-memory retains the store, graph, search, neuro, knowledge, and the
jobkit-based memory maintenance daemon (daemon.rs).
Co-Authored-By: ProofOfConcept <poc@bcachefs.org>