Skip to content

red: B53 CLI real-file tests with injected faults (scratch, do not merge) - #648

Closed
DrunkOnJava wants to merge 4 commits into
mainfrom
red/b53-cli-real-files
Closed

DrunkOnJava wants to merge 4 commits into
mainfrom
red/b53-cli-real-files

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

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.rs for 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 registers cli_real_files in tools/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 + 1 in analyze JSON, bogus “IDENTICAL” logic in rvt-diff, parsed_records - 1 in elem-table JSON, reversed history entries in rvt-history --json, inverted --fail-on-diff gating in rvt-ifc-compare, and XOR of the first patched byte for inline new_decompressed in rvt-write.

Reviewed by Cursor Bugbot for commit c327ef6. Configure here.

Red run pending: the scratch branch injects a fault into each binary, since the behaviour exists already.
…; never exits 0 with a stream that does not decode (B53)
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Red outputs recorded in #653's test commit.

@DrunkOnJava DrunkOnJava closed this Oct 4, 2026
@DrunkOnJava
DrunkOnJava deleted the red/b53-cli-real-files branch October 4, 2026 16:25
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant