--- id: fork-substrate-scaffold name: Fork scaffold — substrate subtree, provenance register, licenses status: completed depends_on: [scaffold-workspace] scope: narrow risk: low impact: component level: implementation tags: [wave-2, substrate] --- ## Description Create the fork's home and its provenance apparatus before any code moves (ADR-011, ADR-012 §1 as amended by ADR-013, ADR-018): - `alkstore-sqlite/src/substrate/` module subtree, wired into the engine crate's module tree (`mod substrate;` — internal, never re-exported through the engine's public API; ADR-012 §2's contract-blind boundary starts structurally). - `PROVENANCE.md` at the subtree root per ADR-018: upstream identity (honker-core, checkout `/workspace/honker` @ `f4e53c6`, package `node-v0.5.1-10-gf4e53c6`), license (MIT OR Apache-2.0), the fork decision citation (ADR-011), and the empty delta register structure (per-delta, category-tagged entries — the categories ADR-018 pins; the port deltas of `fork-port-deltas` are the first entries). - The dual-license notice carried in-tree (MIT OR Apache-2.0 text, per ADR-012 §1's scaffold-time list). - The substrate's `Cargo.toml`-independent posture: the subtree compiles as engine-crate modules; its dependencies (rusqlite) come from the engine crate's manifest. This task moves no machinery — it establishes where the fork lives, who it is, and how its lineage is tracked, so the port tasks land into a finished frame. ## Acceptance Criteria - [x] `src/substrate/` exists, wired as an internal module, empty or stub content only - [x] `PROVENANCE.md` complete per ADR-018 (identity, revision, license, decision citation, delta-register structure) - [x] Dual-license notice in-tree - [x] Engine crate still compiles; clippy/fmt clean ## References - docs/architecture/decisions/011-sqlite-substrate-fork.md - docs/architecture/decisions/012-forked-substrate-design.md §1 - docs/architecture/decisions/013-fold-substrate-into-sqlite.md - docs/architecture/decisions/018-provenance-register-and-cherry-picks.md ## Notes - **`PROVENANCE.md` initial entries are pre-declared checklist rows, not verified records.** ADR-018 §2 fixes the scaffold's initial entries as the retained records' deltas (ADR-011 scope register + ADR-012 §4–§5), but the machinery they describe does not exist yet — the port tasks make it. Writing "planned but verified-later" rows would misrecord the tree state, so the register carries the delta list as the port tasks' checklist (16 entries, D-01..D-16, each with category/what/where/why/lineage), and `fork-provenance-and-floor` completes/verifies them against the actually-ported tree at gate time. The register's header states this explicitly. Cherry-picks section: empty, append-only. - **Entry granularity decision**: the standing classes of ADR-018 §2 are written in entries as `port delta` / `re-derivation` / `drop` / `hygiene` / `cherry-pick`. ADR-018's prose names them ("kept-half port delta", etc.); nothing pins a token format. Wave 2's later entries should match these tokens. - **W-3/W-4 recorded as rows, not prose.** ADR-012 §4 records W-3 (not-actionable) and W-4 (keep-RW) as decisions-of-record; the register carries them as `port delta` rows whose What states the deliberateness (row D-08/D-09), so the "no unregistered divergence" audit has a row to tie them to. - **Module wiring is `mod substrate;` with no re-export** — ADR-012 §2/§6's contract-blind boundary starts structurally (the module's contents are currently only doc text; the port adds machinery). The module docs in `mod.rs` carry the fork-point statement and boundary statement (the alksocks module-docs shape). - **Bundled `LICENSE` composition**: fork-point + attribution header (alksocks `src/rfc1928/LICENSE` shape, adapted: dual-license upstream, copyright Russell Romney, fork decision cites ADR-011/013) followed by the verbatim upstream `LICENSE-APACHE` and `LICENSE-MIT` texts from `/workspace/honker/honker-core` @ `f4e53c6`. - **Full upstream commit hash pinned** in both PROVENANCE.md and the LICENSE header: `f4e53c6b83ad2d6979c04098d576db024ce7e98d` (2026-10-02) — verified against the reference checkout's git log; `git describe` confirms the package name `node-v0.5.1-10-gf4e53c6` cited in the ADRs. ## Summary Fork scaffold landed: `alkstore-sqlite/src/substrate/` created with `mod.rs` (fork-point statement, contract-blind boundary statement, fidelity + sync runtime postures, scaffold-state note — internal module, `mod substrate;`, nothing re-exported through the engine's public API), `PROVENANCE.md` per ADR-018 (upstream identity: honker/honker-core @ `f4e53c6` = `f4e53c6b83ad2d6979c04098d576db024c e7e98d`, package `node-v0.5.1-10-gf4e53c6`, published lineage 0.5.0 2026-08-23, license MIT OR Apache-2.0, fork-point git-history statement, inherited fix-train lineage facts, reference-checkout posture; delta register: 16 pre-declared checklist entries D-01..D-16 pinning the port deltas, drops, re-derivation, and hygiene deltas the port tasks will make, cherry-picks section empty) — and the bundled dual-license `LICENSE` (attribution header + verbatim Apache-2.0 and MIT texts). Verified: `cargo build`, `cargo test -p alkstore-sqlite`, `cargo clippy --all-targets -- -D warnings`, `cargo fmt --check` all clean.