Repository navigation
Persist state through the shared atomic writer - #6
Merged
Merged
Conversation
StateEngine::save carried its own copy of the tempfile-persist-fsync sequence that util::atomic_write already implements, line for line. One implementation, one place to audit.
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.
StateEngine::savecarried its own copy of the tempfile / write / fsync / persist / fsync-parent sequence.util::atomic_writeimplements the same sequence line for line and already serves the registry, keystore and fabric policy writers.Both copies created the parent directory, used
tempfile::NamedTempFilein that directory, calledsync_all()on the temp file and the parent, and mappedpersisterrors toTaprootError::Io. No behaviour change: same atomicity, same durability, same error type.Diff stat:
src/engine.rs, 2 insertions, 20 deletions.Checks
cargo fmt --all -- --checkclean locally.cargo clippy --locked -- -D warnings(the CI clippy line) clean locally, exit 0.cargo check --lockedclean locally.cargo clippy --locked --all-targets -- -D warningsreports the one pre-existingbool_assert_comparisonwarning atsrc/fabric.rs:234. That is the known expected warning in the lib test target; the CI gate does not pass--all-targets, so it is not a new finding.Not shipped
Policy.allowed_branchesis written bytaproot fabric policy-setand byPOST /v1/policy/:repo, and read back bypolicy-get, but never enforced on either push path. Reproduced: withallowed_branches: ["main"]set fororg/app,taproot registry pushof a state whosebase.branchisevil-branchprintedpushedand exited 0. Same gap insrc/server.rs:71-81. Enforcement is a behaviour change to a security-adjacent guard, so it needs a red-first test I cannot run on this box.Policy.blocked_env_keysandPolicy.require_check_strictare stored and never read by any enforcement path.src/cli.rs:1884usesresolve_fabric_path(None), so it reads.taproot/fabricunder the current directory.RegistryPushArgshas no--fabricflag, so a policy stored anywhere else is silently skipped.