Skip to content

feat(reader): report the 64 KiB Formats/Latest scan cap; docs(viewer): gen-fixture prerequisite - #262

Merged
DrunkOnJava merged 4 commits into
mainfrom
worktree-agent-afb87698602c01fdd
Sep 19, 2026
Merged

DrunkOnJava merged 4 commits into
mainfrom
worktree-agent-afb87698602c01fdd

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two small, independent fixes. rvt::formats::parse_schema now records that it
stopped at the 64 KiB Formats/Latest scan cap instead of truncating silently,
and the viewer's demo staging documents (and can now satisfy) the gen-fixture
prerequisite for the synthetic-mvp demo.

Motivation

Changes

  • src/formats.rs: promote the cap to a public SCHEMA_SCAN_LIMIT; SchemaTable
    gains scan_truncated / scanned_bytes / total_bytes (all #[serde(default)],
    struct now derives Default), set by parse_schema. Parsing results unchanged.
    Two new unit tests.
  • src/compression.rs: FormatsLatestIntegrity gains schema_scan_truncated /
    schema_scanned_bytes, derived from the inflated length (no second parse), and
    summary_line() appends the fact. One new unit test plus assertions in the
    existing three.
  • src/bin/rvt_schema.rs: text summary prints a scan-truncated line; the filtered
    JSON view carries the new fields.
  • src/walker.rs: test-only SchemaTable literals updated with ..Default::default().
  • docs/export-diagnostics.md, docs/schemas/export-diagnostics.schema.json: the
    two new optional formats_latest_integrity fields.
  • viewer/README.md: documents cargo build --release --bin gen-fixture next to
    the npm run stage:demos mention and what happens when it is missing. Also
    fixes the Local dev wasm-pack line in the same file - with current wasm-pack
    the cargo flags must follow a -- separator, so the documented form failed
    with unexpected argument '--out-dir'; it now matches the invocation
    .github/workflows/deploy-viewer.yml and publish.yml already use.
  • viewer/scripts/stage-demos.mjs: when gen-fixture is not on PATH or in
    target/{release,debug}/, run the repo's own
    cargo build --release --bin gen-fixture before giving up; keep the existing
    warning when cargo is unavailable or the build fails. Still downloads nothing.

rvt-inspect surfaces this through the Formats integrity row it already
prints. The checked-in tier1 fixtures are all well under 64 KiB, so the row is
unchanged for them:

  Formats integrity: Formats/Latest - 122 stored - inflate ok - single-page

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 --all passes locally (via tools/check-local.sh --viewer:
    cargo test --workspace --all-targets --all-features)
  • cargo clippy --all-targets --all-features -- -D warnings passes
  • cargo fmt --check passes
  • New / changed code has unit tests
    (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)
  • N/A: does not touch the IFC exporter's entity output
  • N/A: adds no element decoder
  • N/A: not a performance change

Also ran, for #187 acceptance: npm run stage:demos in viewer/ on a tree with
no gen-fixture built - the fallback ran the cargo build and staged
synthetic-mvp: ok (generated via target/release/gen-fixture). npm run typecheck
and npm run build both pass (they run as part of tools/check-local.sh --viewer).
rvt-inspect and rvt-schema were run against corpus/tier1/architectural-2024
to confirm the unchanged output for a sub-64 KiB stream.

Audit-honesty checklist

  • README / docs reflect the current state after this PR
  • If a limitation was resolved, the relevant docs are updated - the new field is
    documented in docs/export-diagnostics.md and the JSON schema
  • No new limitation introduced. The flag is explicitly a "we stopped here"
    signal and claims nothing about the unscanned tail; multi-page
    Formats/Latest stays 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 the
    in-code doc comments
  • Commit messages describe WHAT changed and WHY
  • No emojis in code, docs, or commit messages
  • No private paths, personal email addresses, or internal jargon in committed files
  • N/A: not a reverse-engineering finding - no new probe or reconnaissance addendum

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0 (see CONTRIBUTING.md)
  • This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content
  • Any new test fixtures use synthetic values - the new tests build synthetic
    in-memory byte buffers only

Breaking changes

None. Both new field groups are additive; the SchemaTable fields are
#[serde(default)] so older JSON still deserializes, and the
formats_latest_integrity fields are additive in the JSON schema.

Screenshots or output samples

No UI or IFC output change. The rvt-inspect row above is the only changed
user-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/Latest schema parsing now surfaces when the existing 64 KiB scan cap applies instead of truncating silently. parse_schema sets SchemaTable::scan_truncated, scanned_bytes, and total_bytes; the cap is exported as SCHEMA_SCAN_LIMIT. FormatsLatestIntegrity / diagnose_formats_latest_integrity add matching schema_scan_truncated and schema_scanned_bytes (from inflated size, no second parse), and CLI paths (rvt-schema, rvt-inspect via summary_line) expose the fact. Export diagnostics docs and JSON schema document the additive fields.

Viewer demo staging documents that synthetic-mvp comes from gen-fixture, fixes the local wasm-pack invocation (cargo flags after --), and lets stage-demos.mjs run cargo build --release --bin gen-fixture when the binary is missing.

Reviewed by Cursor Bugbot for commit 91ff0dd. Configure here.

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
@cursor

cursor Bot commented Sep 19, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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
DrunkOnJava enabled auto-merge (squash) September 19, 2026 18:05
@DrunkOnJava
DrunkOnJava merged commit e86c4c4 into main Sep 19, 2026
21 checks passed
@DrunkOnJava
DrunkOnJava deleted the worktree-agent-afb87698602c01fdd branch September 19, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant