Repository navigation
refactor(core,net,remote,proto): one definition each for fork descendants, recovery lineage, refusals, listings, capabilities and login refs - #366
Merged
Conversation
…overy lineage, and proofs that keep their verification - fork descendants come from one pass over each node's causal past instead of rescanning every node per fork, stored by frame so `is_fork_void` is a lookup - the class-0 recovery lineage is derived once and read by every pass, instead of the handoff rule living in two functions - a `FraudProof` keeps what verifying it established, so a resolve and the remote planner stop re-checking both signatures of a proof already verified - one "above the frontier" predicate and one frame selection for a checkpoint's two commitments - `counted_through` is one expression No consensus rule changes: a forked author's data is still judged against its own fork only, which a new test pins.
`finish_listing` was compiled only with the HTTP backends, so the in-memory store and the faulty store each had their own copy of the listing contract.
`Error::Rejected` carried the close reason as a string, and pairing decided whether to retry by comparing it to "busy" and "not pairing". It now carries a `Refusal`, which is also what writes the close, so the code and reason bytes have one definition. The bytes on the wire are unchanged, and a test pins them. Sync and pairing also shared two copies of "wait for the peer to read the refusal, then close with the right code"; there is one now.
…gin ref one grammar - the bindings carry `CAPABILITIES` and a `Capability` union, and `hello` and the backend are typed with it, so a misspelt capability no longer compiles - `LoginRef` writes and parses its own `<vault>:<item>` text; the host, the engine's fill history and the browser bindings all go through it Nothing on the wire changes.
…proven fork frames in a list A `FraudProof` can't exist unverified, so `verify()` only repeated what `verified()` already holds. Its last callers read `verified()` now. The frames a proof names were collected into a map of sets that is empty for every vault without a fork; a list of `(frame, author)` pairs says the same with no allocation in that case.
…call The gate asked "is there a refusal?" and then looked the slot up again, with a fallback for a case the first answer had ruled out. `pairing()` returns the open slot or the close to send, so admitting and routing a pairing connection are one line each.
…f everywhere `format_ref` and `filled_key` were one-line wrappers around `to_string()`, and the macOS AutoFill paths and the Swift bridge still built and read the `<vault>:<item>` text by hand. They all go through `LoginRef` now, and the fill history takes the ref itself rather than its text. The Swift bridge still reads a record identifier in either case, by lowercasing it first.
…on doesn't know `hello` drops them, and non-strings with them. The tests that set a fake host's capabilities no longer cast around the `Capability` type.
kitlangton
force-pushed
the
core-net-proto-ssot
branch
from
December 2, 2026 21:18
3fdf058 to
6c414f2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four places where the same rule was written twice now have one definition each, with no change to anything sent between devices, to a remote, or to the browser extension.
Protocol versions stay at 38 (daemon) and 3 (browser). No new dependencies.
❌ Before
"busy"and"not pairing". Sync and pairing each had their own copy of "wait for the peer to read the refusal, then close".<vault>:<item>text was built by hand in six files and parsed in two, including the macOS AutoFill paths and the Swift bridge.✅ After
Capabilitytype, so a typo failstsc. A login ref writes and parses itself, and every one of those sites goes through it.🟰 Behavior change: none on the wire or in any consensus rule. Two edge cases read differently, both only for input no shipped build sends: a pairing refusal with an unrecognised reason is now treated as "not pairing" instead of passing the text through, and the extension drops capability names it doesn't know from
helloinstead of keeping strings it never used (now covered by a test).📊 Proof
9 "too many connections",3 "not pairing",3 "busy",3 "expired")tscerror (checked by hand with a scratch file)hellonaming a capability the extension doesn't know, or a non-stringSpeed was not measured: the fork pass and the skipped signature checks are less work by construction, but there is no benchmark here. New tests: 5 (two core, two net, one proto); 1,561 Rust tests and 1,035 extension tests pass.
Two things this PR deliberately did not do:
VaultCreated/RecoveryRotatedwere not collapsed ontoCreatedVault: they are built and destructured in files other open PRs own.👀 Read:
crates/core/src/v2/membership.rs,recovery_lineageand theRotateRecoveryarm ofauthorize. The arm used to re-derive the handoff rule and now asks "is this the frame that retired this root"; that is only equal because a recovery root is never the target of a removal and is admitted exactly once, so removals can't change the lineage. The existing reference-model property tests cover it. The rest is routine.🔍 Found in a code audit · no user reports · speed not measured
Checks run
On the rebased branch (onto
devwith #370), after the review fixes:bun run gen:proto, then thethe_extension_bindings_are_currenttest: pass, no diffcargo fmt --all -- --check: cleancargo clippy --workspace --all-targets -- -D warnings: cleancargo clippy -p deadbolt-core -p deadbolt-net --features sim --all-targets -- -D warnings: cleanbun run check:wasm: cleancargo test --workspace --no-fail-fastlocally: 1,558 passed, 3 failed, 5 ignored. The three (codes_do_not_hold_off_the_idle_lock,browser_lookups_do_not_hold_off_the_idle_lock,init_vaults_and_locking) are not from this PR: since feat(enclave,daemon): add With this Mac quick unlock, passphrase cadence, and native macOS watcher #355 a test daemon reads the real Mac's keyboard and mouse idle time, and input in the last 5 seconds resets its idle lock, so they fail on a Mac someone is typing on. They fail the same way with this PR's review fixes stashed, and pass on CI's headless runners.cd extension && bun run typecheck: cleancd extension && bun test: 1,035 pass, 0 failbash scripts/file-size.sh: 0 errors, 28 warnings, none newcrates/ostest that reads a child process's arguments (a crate this PR doesn't touch) and a browser e2e passkeys step that lost its page mid-click. Neither cause is diagnosed.