feat(spine): report integrity, governance, and ground truth, and verify a record file#172
Merged
Merged
Conversation
…fy a record file `flynn spine verify` now reports a record tier by tier in one pass: integrity (the events rebuild the signed Merkle root), governance (no action ran without a preceding admission), and ground truth (a claimed success is backed by a passing check, or is not asserted). A record that fails any tier is reported in full and the command exits non-zero, so it can gate a script. Add `flynn spine verify --file <path>` to verify a record read from a file rather than the durable store, so an exported record can be checked anywhere. A record whose signer is self-certifying needs nothing further; one signed by another key (a published conformance vector) takes that key in hex via `--key`. Tested: a clean record reports verified, governed, and not-asserted; a tampered record is caught; a run grounded by a passing check reports grounded while one whose check failed reports not grounded; a record signed by a non-self-certifying key needs `--key` and then verifies.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
flynn spine verifynow reports a record tier by tier in one pass: integrity (the events rebuild the signed Merkle root), governance (no action ran without a preceding admission), and ground truth (a claimed success is backed by a passing check, or is not asserted). A record that fails any tier is reported in full and the command exits non-zero. Addsflynn spine verify --file <path>to verify a record read from a file rather than the durable store, with--key <hex>for a record signed by a key that is not self-certifying.Why
Verification previously printed a single line for one tier and only worked against a run stored locally. A record carries more than integrity: it carries whether the run was governed and whether its success was grounded in a check. Reporting all three in one command makes what a record does and does not prove legible at a glance, and exiting non-zero on any failure lets the command gate a script. Verifying a file (not just a stored run) lets a record be checked after it has been exported or handed to a third party, which is the point of a portable, self-verifying record.
How to verify
go build ./...,go test ./cmd/flynn/,go vet ./cmd/flynn/, andgolangci-lint run ./cmd/flynn/pass.TestVerifyRecordReportsTiersasserts the three-tier report on a clean record;TestVerifyRecordCatchesTamperasserts a flipped byte is caught;TestVerifyRecordGroundTruthasserts a passing check reports grounded and a failing one reports not grounded;TestVerifyRecordExternalKeyasserts a non-self-certifying record needs--keyand then verifies.