chore(kit): wire kei-db-contract into installer + drop final #[path] hack

A1 — install.sh wiring for kei-db-contract:
- install/lib-substrate.sh substrate_core_binaries(): add kei-db-contract
  to always-copy list. End users now get the binary in ~/.cargo/bin/
  immediately after install (no manual cargo install --path needed).

A2 — Wave B follow-up: drop #[path] hack from guard_test_corpus.rs
- tests/guard_test_corpus.rs: #[path = "../src/injection_*"] mod ...
  → use kei_memory::injection_guard::scan
- Now uses Wave B's [lib] target like tests/integration.rs already does.
- 4 tests still pass.

Verified via cargo test: 18 lib + 4 corpus + 3 ingest_guard + 1 injection_unit
+ 4 dedup + 8 integration + 4 ingest_real_trace = 42 tests, all green.

=== STATUS-TRUTH MARKER ===
shipped: functional
stubs: 0
cargo-check: PASS
cargo-test: PASS (42 tests, 0 failures)
behaviour-verified: yes
follow-up-required:
  - tests/ingest_guard_tests.rs already migrated (Wave A's earlier work)
  - kei-db-contract still requires kit user to have run install.sh; existing
    installs need re-run. Kit ledger-validate should add post-install probe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Parfii-bot 2026-05-01 17:55:52 +08:00
parent 6304d1b4a6
commit c35e1ae9ca
2 changed files with 3 additions and 8 deletions

View file

@ -10,17 +10,11 @@
//! 4. curl_with_secret (10)
//! 5. base64_blobs (10) ← restored as Block-tier
//!
//! Imports the guard via `#[path]` so the kei-memory binary crate stays
//! binary-only (same approach as `tests/integration.rs`).
//! Imports via the `kei_memory` lib (Wave B introduced `[lib]` target).
//!
//! Acceptance: at minimum 45 of 50 samples must reach `Block` severity.
#[path = "../src/injection_patterns.rs"]
mod injection_patterns;
#[path = "../src/injection_guard.rs"]
mod injection_guard;
use injection_guard::scan;
use kei_memory::injection_guard::scan;
fn pem(label: &str) -> String {
format!("{}BEGIN {}{}", "-".repeat(5), label, "-".repeat(5))

View file

@ -28,6 +28,7 @@ substrate_core_binaries() {
kei-brain-view kei-hibernate kei-ledger-sign kei-dna-index \
kei-entity-store kei-crossdomain kei-social-store \
kei-chat-store kei-provision kei-changelog kei-migrate \
kei-db-contract \
frustration-matrix \
ssh-check firewall-diff mock-render visual-diff tokens-sync
}