- Rust workspace with stemedb-core crate - Full .claude/ configuration (agents, skills, commands, guides) - ai-lookup/ for token-efficient fact storage - Quality gates: clippy, fmt, jscpd duplication detection - Pre-commit hook with 5-phase quality checks - CLAUDE.md router and CODING_GUIDELINES.md standards Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
Branching ("Fork Reality")
Last Updated: 2025-01-31 Confidence: Medium (planned feature)
Summary
Branching allows agents to create hypothetical scenarios without polluting the main knowledge graph. Think "What if inflation hits 5%?" - simulate effects without committing to reality.
Key Facts:
- Implemented via Overlay Graphs
- Branch = lightweight index (Map<Hash, Assertion>)
- Writes go to branch, reads check branch first then global
- Merge commits branch assertions to global WAL
- Copy-on-write semantics
File Pointer: crates/stemedb-core/src/branch.rs (planned, Phase 3)
How It Works
Global DAG: Branch "recession-2025":
[A1] -> [A2] -> [A3] [A4-hypothetical]
|
"inflation = 5%"
Write to Branch
// Assertions stored in branch's ephemeral index, not Global DAG
branch.put(hypothetical_assertion)?;
Read from Branch
// Check branch index first, fall back to global
let value = branch.get(hash)
.or_else(|| global.get(hash))?;
Merge Branch
// Commit hypotheticals to global if they become real
global.merge(branch)?; // Appends branch assertions to WAL
Use Cases
- Scenario Analysis: "What if competitor launches?"
- Planning: "What if we expand to Europe?"
- Backtesting: "What if we knew X earlier?"