KeiSeiKit-1.0/_primitives/_rust
Parfii-bot 3cc4279a54 fix(ledger): DNA UNIQUE constraint + v5 migration (HIGH audit)
1 HIGH audit fix: agents.dna had no UNIQUE constraint → duplicate
DNAs accepted silently → kei-replay ambiguous.

- schema.rs: v5 migration adds CREATE UNIQUE INDEX idx_agents_dna_unique
  with pre-check. If existing DB has dna duplicates, migration surfaces
  typed LedgerError::DnaMigrationBlocked { duplicates: Vec<(String, usize)> }
  instead of silently dropping rows.

- error.rs: +DnaCollision { dna } (runtime insert violation at fork).
  Caller regenerates nonce and retries.
  +DnaMigrationBlocked (migration-time precheck failure) with
  resolution hint in doc-comment.

- ledger.rs: classify_insert_error distinguishes DNA-violation vs
  duplicate-id vs generic SQL error.

- NULL handling: multiple NULL dnas allowed (SQLite default UNIQUE
  semantics), preserves v2 "dna optional" contract.

+5 tests, 23/23 kei-ledger green.

Constructor Pattern: source files <=192 LOC, all functions <=25 LOC.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 15:45:43 +08:00
..
firewall-diff feat(primitives): 2 Rust verification cubes 2026-04-21 21:00:01 +08:00
kei-agent-runtime fix(compose): render resolved scope block — agent sees concrete paths, not generic text 2026-04-23 05:44:15 +08:00
kei-artifact Merge feat/v0.16.1-polish — dynamic schema + mode matrix Phase 3.6 2026-04-22 15:13:05 +08:00
kei-atom-discovery feat(tx1): taxonomy + lineage facets schema extension 2026-04-23 06:10:58 +08:00
kei-auth fix(kei-auth): remove --key CLI flag (F12 HIGH — /proc/cmdline leak) 2026-04-22 13:36:17 +08:00
kei-cache feat(r2): new kei-cache crate — deterministic result cache 2026-04-23 05:55:13 +08:00
kei-capability feat(e2): kei-capability fork subcommand + lineage stamping 2026-04-23 10:21:45 +08:00
kei-changelog feat(primitives): kei-docs-scaffold shell + kei-changelog Rust 2026-04-21 21:01:28 +08:00
kei-chat-store feat(a): Store::open multi-schema — kei-chat-store sessions fully engine-owned 2026-04-23 14:27:15 +08:00
kei-conflict-scan feat(primitives): 4 Rust crates for deep-sleep — conflict-scan, refactor-engine, graph-check, store 2026-04-22 08:28:22 +08:00
kei-content-store feat(w12a): sister re-migration — content-store campaigns promoted to engine 2026-04-23 14:44:31 +08:00
kei-crossdomain feat(a): Store::open multi-schema — kei-chat-store sessions fully engine-owned 2026-04-23 14:27:15 +08:00
kei-curator chore(rust): misc schema/main refactor in 8 crates (assorted CP splits) 2026-04-22 13:36:17 +08:00
kei-entity-store fix(entity-store): FTS delete-tx + archive FTS desync (HIGH audit) 2026-04-23 15:45:23 +08:00
kei-forge feat(stream-f): kei-forge pure-Rust templating — eliminate shell-out 2026-04-23 01:21:00 +08:00
kei-graph-check feat(primitives): 4 Rust crates for deep-sleep — conflict-scan, refactor-engine, graph-check, store 2026-04-22 08:28:22 +08:00
kei-ledger fix(ledger): DNA UNIQUE constraint + v5 migration (HIGH audit) 2026-04-23 15:45:43 +08:00
kei-memory feat(primitives): kei-memory Rust crate — offline session analyzer (Genesis-clean) 2026-04-22 00:50:04 +08:00
kei-migrate feat(primitives): kei-migrate Rust universal migration runner 2026-04-21 20:35:29 +08:00
kei-pipe feat(p-pipe-cache): wire kei-cache into kei-pipe DAG executor 2026-04-23 14:26:11 +08:00
kei-provision fix(provision/b4): exec.rs redacts args + truncates stderr 2026-04-23 05:30:33 +08:00
kei-refactor-engine fix(kei-refactor-engine): retract 'git apply-ready' claim (F1 RELEASE BLOCKER) 2026-04-22 13:36:17 +08:00
kei-replay feat(w9e): NEW kei-replay crate — reconstruct spawn from DNA 2026-04-23 13:34:16 +08:00
kei-router chore(rust): misc schema/main refactor in 8 crates (assorted CP splits) 2026-04-22 13:36:17 +08:00
kei-runtime fix(p1-integration): validate.rs allows _schemas/fragments $ref + drop additionalProperties on fragment-composed atom schemas 2026-04-23 04:53:26 +08:00
kei-sage feat(a): Store::open multi-schema — kei-chat-store sessions fully engine-owned 2026-04-23 14:27:15 +08:00
kei-search-core chore(rust): misc schema/main refactor in 8 crates (assorted CP splits) 2026-04-22 13:36:17 +08:00
kei-social-store feat(w12a): sister re-migration — content-store campaigns promoted to engine 2026-04-23 14:44:31 +08:00
kei-spawn feat(w9d): kei-spawn drive subcommand + AnthropicDriver trait stub 2026-04-23 13:34:16 +08:00
kei-store refactor(v0.22): kei-store AsyncBackend trait + shared tokio runtime (Track B) 2026-04-22 21:06:50 +08:00
kei-task feat(a): Store::open multi-schema — kei-chat-store sessions fully engine-owned 2026-04-23 14:27:15 +08:00
keisei fix(tests): repair 2 missing closing braces from v0.22 Track-A↔Track-C merge 2026-04-22 21:16:22 +08:00
mock-render refactor(mock-render): split main.rs 227 LOC into 4 cubes (F5a Constructor Pattern) 2026-04-22 13:36:17 +08:00
ssh-check feat(primitives): 2 Rust verification cubes 2026-04-21 21:00:01 +08:00
tokens-sync feat(primitives): 3 Rust cubes — mock-render, visual-diff, tokens-sync 2026-04-21 21:07:45 +08:00
visual-diff feat(primitives): 3 Rust cubes — mock-render, visual-diff, tokens-sync 2026-04-21 21:07:45 +08:00
.gitignore feat(primitives): 2 Rust verification cubes 2026-04-21 21:00:01 +08:00
Cargo.lock feat(p-pipe-cache): wire kei-cache into kei-pipe DAG executor 2026-04-23 14:26:11 +08:00
Cargo.toml feat(w9e): NEW kei-replay crate — reconstruct spawn from DNA 2026-04-23 13:34:16 +08:00