Skip to content

Phase 1: engine core - #4

Merged
thearpankumar merged 341 commits into
masterfrom
phase/1-engine-core
Dec 4, 2026
Merged

thearpankumar merged 341 commits into
masterfrom
phase/1-engine-core

Conversation

@thearpankumar

Copy link
Copy Markdown
Owner

Phase 1 of the backlog: the engine core and the first command line. Every Phase 1 item is ticked in docs/backlog.md, which says for each what landed, what was measured and what is left. Nothing here is released or audited.

Items

  • Encrypt pipeline and signed manifests (E4, E5): data and meta blobs, size-class packs and shards, device-signed manifests, the path index and the signed vault root, read-after-write checks, chunk reuse, and an independent check of folder changes.
  • Key hierarchy (E6): keyring, epoch KEKs and DEKs, the passphrase share slot and the SLIP-39 recovery text, wrapped key types bound to their labels, KeyProvider, the config, certificates and device set.
  • Local storage backend: files on disk behind the Backend trait, fsync order and compare-and-swap of the root, the single-writer lock, device state, two-phase garbage collection.
  • Automatic KEK rotation (E7): a new epoch in one commit, with a final check against the old trees.
  • Embedded event queue (M1): authenticated jobs with per-sender replay marks.
  • CLI v0: init, put, get, verify, rotate and status, in the order lock, commit, root, then device state.
  • Findings pass: a batched read-back for large commits, parallel read-ahead for get, a pack table read through its tree, and a pool of node-sized protected buffers.
  • Dependencies: curve25519-dalek 5.1.0, past RUSTSEC-2026-0620. That bug is in the AVX-512 backend, which our builds do not enable.

Format and threat model

  • Format spec: now draft v0.44. Rotation is decided as a copy into a new vault (OQ-20).
  • Threat model: the Phase 1 gate review is in section 15.3.
  • Known misses, accepted by the maintainer: a cold key lookup at 1,000,000 objects takes 66 µs (target 50), and a small commit takes 12 to 13.5 ms besides its fsyncs (target 12).

Checks run locally

fmt (both workspaces), clippy, the full workspace test run (1,850 passed, 0 failed), doc, the tests/ workspace, vectors --check, check-layers, check-features, check-docs, check-vendored, check-zstd-link, check-commits, typos and actionlint.

cargo-nextest, cargo-deny, cargo-shear, cargo-fuzz, zizmor and Miri are not installed here, so this PR's CI is their first run.

🤖 Generated with Claude Code

…d or kind, no location entries for abandoned nodes, saved seeds
… showed was not covered, and docs of part 7d3
…k-table error, one hand-over function for the final check, and a crash test of a fall back
…ach case once, the first failure in order reported
…ry and a bounded reader of the candidate tree
… entry and tree, the exact reuse rule), threat model review row and the backlog text
…reuse rule on its own, and the bound and list tests
…t the commit did not write, report the lowest panicking crash point
…s and sizes that catch each safeguard of ends_naturally
…mmit, and the final check has one lookup of each new location entry and pack record
…es and lies at every step of a commit that reads them
…idate entry, tree and an edited tree, a tree cut by size and the candidate reader as fuzz fixtures
…eal writer, a swap that never is a no-op, and the spec text of the part
… check, and the backlog text of the part with its measurements
…nd last, and the location key text names kind 0x08 everywhere
…y a blob this commit stored is safe without one
…ommits, and the redundant pack-table branch removed
…ep MUST of FS-91, and the boundary of the commit's check as a test
…ed in counted bytes, used by reads and a commit's lookups and never by its final check or a scrub
…up to 50,000 files, with the caches off and on
…s widths, which a scan of the pack table did for every record by writing it
…uffers and what the commit and the cold lookup now cost, in the backlog, the format spec and the threat model
…ays, and the pool serves a cache copy and an open
… and the unused lookup by ID without a read is removed
…nly thing the test can refuse, since every record has an ID of its own
…tation refuses a repeated pack ID and tells a failed read of the old table from damage, and inline digests are kept in an ordered map
…efore the program starts and a failed prompt test kills its child
…ly are ignored under Miri, and its job gets 50 minutes
…indows lint clean, and rustix is a Linux dependency of the bus
…est CI drops the fuzz smoke and mutation jobs
@thearpankumar
thearpankumar merged commit 23bf68d into master Dec 4, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant