Repository navigation
feat(evidence): link each trail event to the line before it - #190
Merged
Merged
Conversation
Signed-off-by: Konrad Karauda <konrad@karauda.com>
Signed-off-by: Konrad Karauda <konrad@karauda.com>
The collector refuses a line whose bytes are not the codec's spelling of its event, pinned by golden lines. A request id admitted again starts a chain of its own; the expiry close and Seal's other-trail guard are tested, Seal failures are counted apart from the sink's, and one test helper builds lines. Signed-off-by: Konrad Karauda <konrad@karauda.com>
Signed-off-by: Konrad Karauda <konrad@karauda.com> # Conflicts: # docs/index.md # site/docs/index.html # site/llms.txt # site/sitemap.xml
…ournal 1.1 (WIP) Signed-off-by: Konrad Karauda <konrad@karauda.com>
Signed-off-by: Konrad Karauda <konrad@karauda.com>
…budget (WIP) Signed-off-by: Konrad Karauda <konrad@karauda.com>
…unts by phase (WIP) Signed-off-by: Konrad Karauda <konrad@karauda.com>
…sed (WIP) Signed-off-by: Konrad Karauda <konrad@karauda.com>
… refused (WIP) Signed-off-by: Konrad Karauda <konrad@karauda.com>
…y (WIP) Signed-off-by: Konrad Karauda <konrad@karauda.com>
Signed-off-by: Konrad Karauda <konrad@karauda.com> # Conflicts: # CHANGELOG.md # docs/adr/README.md # docs/index.md # site/docs/changelog.html # site/docs/index.html # site/llms.txt # site/sitemap.xml
… nothing alone (WIP) Signed-off-by: Konrad Karauda <konrad@karauda.com>
|
Cloudflare builds and deploys previews for this pull request. Learn more about Cloudflare previews.
Updated: |
Signed-off-by: Konrad Karauda <konrad@karauda.com>
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.
What changed, and why
Event.prev_event_digest(field 31, declared in1.0, previously empty). The link issha256:plus 64 lower-case hex digits. It uses SHA-256 over the previous evidence line’s exact bytes in the same chain, excluding the newline. Chains start atACTION_PROPOSEDwith an empty link. Readmitting a request id after its trail closes starts a new chain.prev_event_idkeeps its meaning.collectruns a collector that refuses argument previews, result previews, and redaction profiles with400. The response quotes no content. Clearing those fields would change the linked bytes. The collector also refuses carriage returns, JSONnull, raw runes the encoder escapes, and lines that differ from the plane’s encoding of the decoded event.testdata/evidence/lines.jsonlpins the encoding. The plane retries refused records, then quarantines and counts them. The next event links to the missing line.1.1stores the last line’s digest so held requests resume their chains after restart. The first event after resuming a1.0entry has an empty link. A0.20plane refuses1.1entries. Requests held across rollback stay atAPPROVAL_REQUESTEDand never run. Before rollback, close every held request or let it expire.INDETERMINATEandINVALID_FIELD_VALUEbefore any write, preventing interleaving. When a held trail’s closing record fails to land, including at startup, its id stays open until shutdown and its journal entry remains.held_trails_left_opencounts those trails. A trail removes only the entry it filed.Pipeline.SealFailures,SealFailuresAfterEffect, andSealFailuresAbandonedcount them separately from sink failures. Health keys areseal_failures,seal_failures_after_effect, andseal_failures_abandoned, each with aguardana_control_pipeline_..._totalmetric. Post-effect seal failures that lose closing records count as lost closings forrun’s exit status.Invariant or record
Proposed
ADR-0096records decisions 1 to 3, implemented here, and 4 to 10, deferred. Invariant 5 requires seal failures to fail closed, as refused appends do. Invariant 10 preserves correlation ids. Only field 31’s comment changed in the v1 wire schema. The local wire compatibility check passed againstmain.How it was tested
Independent reviews followed each round. Each headline finding was reproduced before its fix. Each fix started with a failing test.
Seal’s other-trail guard, and the pinned escaped rune set.The collector rejected 26 alternative spellings. Each is now a fixed test case. Race-enabled tests passed for
internal/gateway.The final tree passed these tests on macOS.
internal/gateway1443,internal/evidence521 (2 skipped),internal/gateway/e2e132adapters/otel135,adapters/mcp571,adapters/enforce463internal/holdjournal192 (1 skipped),cmd/guardana-gateway1050 (3 skipped)internal/spool162,internal/trailfile164,internal/metrics32,internal/docscheck472Linux container tests passed for evidence, e2e, collector, and journal. Gateway and command packages failed only tests requiring the missing toolchain binary or source tree. Command failures matched
mainthere.Lint reported 0 issues on Darwin and Linux. Vet, two-accounts vet, formatting, size, brand, import (0 violations), and documentation checks passed. Only a review probe covers closing-append panics. No fuzzing ran.
Documentation
ADR-0096and its index row.1.1, generated metrics, changelog Added and Changed.