Repository navigation
red: B53 CLI real-file tests with injected faults (scratch, do not merge) - #648
Closed
DrunkOnJava wants to merge 4 commits into
Closed
DrunkOnJava wants to merge 4 commits into
DrunkOnJava wants to merge 4 commits into
Conversation
Red run pending: the scratch branch injects a fault into each binary, since the behaviour exists already.
…ch, never merged)
…; never exits 0 with a stream that does not decode (B53)
Owner
Author
|
Red outputs recorded in #653's test commit. |
DrunkOnJava
added a commit
that referenced
this pull request
Oct 4, 2026
…uses a patch spanning a checksummed page (B53, B69) (#653) B53: tests/cli_real_files.rs gives rvt-elem-table, rvt-history, rvt-analyze, rvt-diff, rvt-ifc-compare and rvt-write their first real-file checks (family corpus and RE1 Architecture with Revit's export). Red with one injected fault per binary on draft #648 (run 37213954071); the outputs are in the test commit. B69: without faults (draft #650, run 37213958029) the rvt-write test failed on main: an identity patch of a family's Formats/Latest exited 0 and the stream read back as 'unexpected end of file'. Revit stores these streams in 65,249-byte pages, each ending in a 353-byte checksum rvt-rs cannot compute, and the reader strips one at every full page. The writer now refuses (Error::WriteRefused) a patch whose stored bytes reach a full page, instead of writing a stream no reader can decode. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes core write-path behavior for common streams and adds broad CLI corpus tests that gate CI when corpora are present. > > **Overview** > **rvt-write (B69)** now **refuses** patches whose framed stored bytes would reach a full **65,249-byte checksummed page** on paged streams such as `Formats/Latest` and `Global/Latest`, returning **`Error::WriteRefused`** (`write refused: ...`) **before** any output file is touched. Patches are framed up front via **`framed_patch_bytes`**, so a refusal cannot leave a “success” file whose stream no longer decodes. > > **Testing (B53)** adds **`tests/cli_real_files.rs`**, running **`rvt-elem-table`**, **`rvt-history`**, **`rvt-analyze`**, **`rvt-diff`**, **`rvt-ifc-compare`**, and **`rvt-write`** end-to-end on the family/project corpora (with skips when fixtures are missing). The **`rvt-write`** case identity-patches those two streams and asserts either a clean read-back with unchanged other streams, or a page-related refusal with no output file. > > The user guide documents the page limit; **`tools/ci/test-targets.txt`** registers **`cli_real_files`** under the **cli** CI class. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7ed09d3. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
Scratch branch: B53's tests cover behaviour that exists, so this branch injects one fault into each of the six binaries to show each test fail for its reason. Deleted after the red run is recorded.
Note
High Risk
Intentionally corrupts CLI output, diff semantics, IFC compare exit codes, and stream patching—unsafe to ship; only appropriate as a temporary red-test branch.
Overview
Adds B53 end-to-end integration coverage in
tests/cli_real_files.rsfor six CLIs (rvt-elem-table,rvt-history,rvt-analyze,rvt-diff,rvt-ifc-compare,rvt-write) against the family corpus and optional project corpora, and registerscli_real_filesintools/ci/test-targets.txt.This branch is not meant to merge: it deliberately breaks each of those binaries in one place so the new tests fail for the right reason during a “red” validation run—
rvit_version + 1in analyze JSON, bogus “IDENTICAL” logic inrvt-diff,parsed_records - 1in elem-table JSON, reversed history entries inrvt-history --json, inverted--fail-on-diffgating inrvt-ifc-compare, and XOR of the first patched byte for inlinenew_decompressedinrvt-write.Reviewed by Cursor Bugbot for commit c327ef6. Configure here.