Repository navigation
feat(reader): report the 64 KiB Formats/Latest scan cap; docs(viewer): gen-fixture prerequisite - #262
Merged
Merged
Conversation
parse_schema caps its scan of the decompressed Formats/Latest stream at 64 KiB because the tail is binary object data that trips the class-name heuristic. Nothing recorded that the cap applied, so rvt-schema, rvt-inspect and the formats_latest_integrity diagnostic could not tell "the schema fit" from "we stopped looking" (Discussion #112). Promote the cap to a public formats::SCHEMA_SCAN_LIMIT and have parse_schema report scan_truncated / scanned_bytes / total_bytes on SchemaTable. Parsing results are unchanged. Surface it in two places: FormatsLatestIntegrity gains schema_scan_truncated / schema_scanned_bytes (derived from the inflated length, no second parse) and appends the fact to its summary_line, which rvt-inspect already prints as the Formats integrity row; rvt-schema prints a scan-truncated line in its text summary and carries the fields in its JSON output. This is a "we stopped here" signal only. It makes no claim that the unscanned tail holds parseable schema - multi-page Formats/Latest stays tracked under #151 / #154. Closes #188
On a fresh clone the synthetic-mvp demo was skipped with a warning that was the first mention of the gen-fixture build anywhere, and viewer staging then marked the demo unavailable in the gallery. Document the prerequisite next to the stage:demos mention in viewer/README.md with the exact command, and add a fallback in stage-demos.mjs: when gen-fixture is not on PATH or in target/, run the repo's own cargo build --release --bin gen-fixture before giving up. The existing warning is kept for the case where cargo is unavailable or the build fails. The script still downloads nothing. Also fix the Local dev wasm-pack line in the same README: with the current wasm-pack, cargo flags must follow a `--` separator, so the documented form failed with "unexpected argument '--out-dir'". Use the same invocation the deploy and publish workflows already use. Closes #187
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_1fa665ad-5846-4e57-ace0-72cec8d58765) |
DrunkOnJava
enabled auto-merge (squash)
September 19, 2026 18:05
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.
Summary
Two small, independent fixes.
rvt::formats::parse_schemanow records that itstopped at the 64 KiB
Formats/Latestscan cap instead of truncating silently,and the viewer's demo staging documents (and can now satisfy) the
gen-fixtureprerequisite for the
synthetic-mvpdemo.Motivation
Formats/Latestis binaryobject data that trips the class-name heuristic - but nothing recorded that it
applied. On real project files the stream is far larger than 64 KiB, so
rvt-schema,rvt-inspectand theformats_latest_integritydiagnostic couldnot tell "the schema fit" from "we stopped looking" (Discussion Set of findings #112).
viewer/README.mddescribed tier1 demo staging but never mentioned thatsynthetic-mvpis generated bygen-fixture, so on a fresh clone the stagingwarning was the first time a newcomer heard about it.
Changes
src/formats.rs: promote the cap to a publicSCHEMA_SCAN_LIMIT;SchemaTablegains
scan_truncated/scanned_bytes/total_bytes(all#[serde(default)],struct now derives
Default), set byparse_schema. Parsing results unchanged.Two new unit tests.
src/compression.rs:FormatsLatestIntegritygainsschema_scan_truncated/schema_scanned_bytes, derived from the inflated length (no second parse), andsummary_line()appends the fact. One new unit test plus assertions in theexisting three.
src/bin/rvt_schema.rs: text summary prints a scan-truncated line; the filteredJSON view carries the new fields.
src/walker.rs: test-onlySchemaTableliterals updated with..Default::default().docs/export-diagnostics.md,docs/schemas/export-diagnostics.schema.json: thetwo new optional
formats_latest_integrityfields.viewer/README.md: documentscargo build --release --bin gen-fixturenext tothe
npm run stage:demosmention and what happens when it is missing. Alsofixes the
Local devwasm-pack line in the same file - with current wasm-packthe cargo flags must follow a
--separator, so the documented form failedwith
unexpected argument '--out-dir'; it now matches the invocation.github/workflows/deploy-viewer.ymlandpublish.ymlalready use.viewer/scripts/stage-demos.mjs: whengen-fixtureis not onPATHor intarget/{release,debug}/, run the repo's owncargo build --release --bin gen-fixturebefore giving up; keep the existingwarning when cargo is unavailable or the build fails. Still downloads nothing.
rvt-inspectsurfaces this through theFormats integrityrow it alreadyprints. The checked-in tier1 fixtures are all well under 64 KiB, so the row is
unchanged for them:
When the inflated stream is larger than the cap the row gains a
- schema scan truncated (<scanned> of <inflated> inflated bytes scanned)suffix. No checked-in fixture reaches that size, so it is covered by the
synthetic unit tests rather than by a corpus file here.
Testing
cargo test --allpasses locally (viatools/check-local.sh --viewer:cargo test --workspace --all-targets --all-features)cargo clippy --all-targets --all-features -- -D warningspassescargo fmt --checkpasses(
formats::tests::scan_truncation_flag_unset_for_small_buffer,formats::tests::scan_truncation_flag_set_past_limit_without_changing_parse,compression::tests::formats_integrity_reports_schema_scan_truncation_past_limit)Also ran, for #187 acceptance:
npm run stage:demosinviewer/on a tree withno
gen-fixturebuilt - the fallback ran the cargo build and stagedsynthetic-mvp: ok (generated via target/release/gen-fixture).npm run typecheckand
npm run buildboth pass (they run as part oftools/check-local.sh --viewer).rvt-inspectandrvt-schemawere run againstcorpus/tier1/architectural-2024to confirm the unchanged output for a sub-64 KiB stream.
Audit-honesty checklist
documented in
docs/export-diagnostics.mdand the JSON schemasignal and claims nothing about the unscanned tail; multi-page
Formats/Lateststays tracked under RE: Reproduce checksum-paged stream decompression and silent corruption #151 / RE: Reproduce complete Formats/Latest parsing and serialization-tag assignment #154, in both the issue and thein-code doc comments
Legal and contribution hygiene
CONTRIBUTING.md)in-memory byte buffers only
Breaking changes
None. Both new field groups are additive; the
SchemaTablefields are#[serde(default)]so older JSON still deserializes, and theformats_latest_integrityfields are additive in the JSON schema.Screenshots or output samples
No UI or IFC output change. The
rvt-inspectrow above is the only changeduser-visible string.
Related issues
Closes #188
Closes #187
Note
Low Risk
Additive diagnostics and documentation/staging helpers; schema parse behavior is unchanged aside from new metadata fields.
Overview
Formats/Latestschema parsing now surfaces when the existing 64 KiB scan cap applies instead of truncating silently.parse_schemasetsSchemaTable::scan_truncated,scanned_bytes, andtotal_bytes; the cap is exported asSCHEMA_SCAN_LIMIT.FormatsLatestIntegrity/diagnose_formats_latest_integrityadd matchingschema_scan_truncatedandschema_scanned_bytes(from inflated size, no second parse), and CLI paths (rvt-schema,rvt-inspectviasummary_line) expose the fact. Export diagnostics docs and JSON schema document the additive fields.Viewer demo staging documents that
synthetic-mvpcomes fromgen-fixture, fixes the localwasm-packinvocation (cargo flags after--), and letsstage-demos.mjsruncargo build --release --bin gen-fixturewhen the binary is missing.Reviewed by Cursor Bugbot for commit 91ff0dd. Configure here.