Commit 3ccd9bf
feat(storage): persist kanren CrossLangInteraction as hexads (issue #33 follow-up)
Adds a per-cross-language-interaction hexad facet so the `(crosslang :from :to)`
query evaluator can graduate from a same-repo co-occurrence proxy to true
FFI/cross-language reachability over persisted kanren-derived facts.
- `HexadSemantic.crosslang: Option<CrosslangSemantic>` (additive,
`skip_serializing_if`, opt-in via env var).
- `CrosslangSemantic { interaction_id, source_lang, target_lang, mechanism,
source_file, source_line, target_file, target_line, repo_name }`.
- `build_crosslang_hexads(report) -> Vec<PanicAttackHexad>` — drives the
kanren pipeline per repo (ingest → extract → load_rules → analyze →
query_interactions) and emits one hexad per `CrossLangInteraction`.
- New env var `PANIC_ATTACK_STORE_CROSSLANG_HEXADS` (separate from the
finding-hexad gate so callers can opt into one without the other);
default off, mirrors the `PANIC_ATTACK_STORE_FINDING_HEXADS` shape.
- Wired into `persist_assemblyline_report` — file-side only for now to
keep API surface stable; HTTP push deferred.
- `load_crosslang_hexads(base_dir)` helper (allow(dead_code) until the
paired query-evaluator PR is filed).
Tests (+4 in `storage::tests`, 252 lib tests pass): build-from-empty
returns empty Vec; build-from-real-UnsafeFFI-weak-point yields ≥1 hexad
with non-empty mechanism + repo-scoped interaction_id; write/read
roundtrip including missing-dir-returns-empty; env-var default-off
+ on-with-`1`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent acd329f commit 3ccd9bf
2 files changed
Lines changed: 372 additions & 0 deletions
0 commit comments