Repository navigation
Conversation
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.
hardenProjectserialisesbla-harden-summary.jsonand writes it whole, whilereadHardenRunSummaryrefuses to read a summary aboveMAX_HARDEN_SUMMARY_BYTES(8 MiB). The two halves of the same feature disagreed about what a valid summary is: a large enough tree produced a file that BLA's ownbla_run_lookupand the run-evidence path would reject, so the run that wrote it looked like it had no summary at all.What changed
src/engine/run-evidence.tsgainsserializeHardenSummary, which serialises the payload and returnsjson: nullonce the UTF-8 byte length crossesMAX_HARDEN_SUMMARY_BYTES, reporting the measured size and the ceiling either way. This is the same constant the reader already enforces, so writer and reader now share one source of truth.hardenProjectroutes its summary through the helper. When the ceiling would be crossed it records the existingsummaryWriteFailurewith the size and the ceiling instead of writing a summary the reader would then refuse (src/engine/harden.ts).tests/harden-summary-write-cap.test.tspins both directions: a small summary serialises as indented JSON with a real byte count, and an oversized one comes back asjson: null.Why this matters
The summary is documented as BLA-authored metadata that a later pass reads back. Writing one the reader will reject is a silent dead end; failing the write honestly, with the size in the message, tells the caller exactly what happened and keeps the report truthful.
Tests
npx vitest run tests/harden-summary-write-cap.test.ts tests/run-evidence.test.ts tests/run-evidence-bounded.test.ts tests/harden-seed-location.test.ts tests/harden-progress-cancel.test.tspasses, 16 tests.npx vitest run tests/hardening-engine.test.tspasses, 15 tests.Compatibility
A summary that fits is byte-identical to before, because the serialisation is the same
JSON.stringify(payload, null, 2). Only a summary that would exceed 8 MiB changes behaviour, and it now fails closed with a named reason rather than writing a file the reader would never accept.