Repository navigation
fix: narrow Finding 1 strip gate — exclude Formats/Latest - #162
Conversation
PR #160 stripped Formats/Latest and regressed Core Interior class_names 9579→8575. Keep strip on Partitions/* and Global/* DB streams only; add is_revit_paged_loader_candidate for research. Credit @STE1200. Co-authored-by: DrunkOnJava <[email protected]>
Keep Wave 2 Worker A incremental work (checksum_page_framing suite, writer bare-inflate verify, contract docs) on top of the #162 Formats exclusion already on main. Co-authored-by: DrunkOnJava <[email protected]>
Wave 2 Worker A: complete narrowed Finding 1 contract on top of #162. - Synthetic checksum_page_framing suite (bare fails / gated strip passes) - Writer verify uses bare inflate (no false strip on strip-clean encoder) - Contract/probe docs from Wave 1 #159 + Wave 2 evidence - Formats/Latest remains ungated; Partitions/Global stay gated Credit @STE1200. Refs #151 / Discussion #112.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 72895ad. Configure here.
| /// [`inflate_stream_auto`] / [`inflate_all_chunks_for_stream`] consult this gate. | ||
| pub fn is_checksum_paged_stream(path: &str) -> bool { | ||
| let clean = clean_stream_path(path); | ||
| // Formats/Latest intentionally omitted — see module docs above. |
There was a problem hiding this comment.
Formats excluded from production strip
High Severity
Excluding Formats/Latest from is_checksum_paged_stream leaves production inflate unstripped on that path. Finding 1 requires trailer strip on checksum-paged streams including Formats; magnetar Formats already fails gzip ISIZE without strip and passes with it, while SchemaTable stays flat. The class_names 9579→8575 change is heuristic noise, not a schema-count loss.
Additional Locations (2)
Triggered by learned rule: #160/#151: production inflate strips page trailers
Reviewed by Cursor Bugbot for commit 72895ad. Configure here.
Adds `ADocumentInstance::elem_table_pointer() -> Option<[u32; 2]>`. The ADocument record carries a pointer to the document-wide element index table — the map from ElementId to per-element record location in Global/Latest. That pointer was already being decoded into `InstanceField::Pointer` by the walker but wasn't directly addressable from the typed view. Behaviour: - Field-name matching: accepts `m_elem_table`, `m_elemTable`, `elem_table`, `elemtable`, `elementtable`, `m_element_table` — Revit uses different spellings across releases, the method handles all observed variants case-insensitively. - NULL-sentinel handling: returns `None` for both `[0, 0]` and `[u32::MAX, u32::MAX]` — Revit uses either to mean "no element table pointer yet set." Callers see a unified `None`. - Bytes-fallback safety: if the walker's type classifier fell back to raw bytes for this field (schema drift, cross-version wire change), we return `None` instead of trying to reinterpret the bytes as a pointer. This is the entry point for the element-index walker subsystem. Next step (separate task): a `walk_elem_table` that follows the pointer into Global/Latest and parses the pointed-to bytes into `(ElementId → byte_offset)` pairs. That's gated on corpus byte inspection and is tracked under GEO-27..35 (wall / floor / column / beam geometry extraction) which all depend on being able to resolve element IDs back to their serialized bodies. 6 new unit tests covering: - canonical field extraction - snake_case alias acceptance - both NULL sentinels return None - missing field returns None - Bytes-fallback returns None (schema-drift safety) 387 lib tests pass (was 381, +6). Closes L5B-01 (#162) at the pointer-extraction scope; follow-on index-table parsing remains pending corpus inspection.
Exclude Formats/Latest from production checksum-page strip (class_names 9579→8575 on Core Interior). Keep strip on Partitions/* and Global/*. Credit @STE1200.
Wave 2 Worker A: complete narrowed Finding 1 contract on top of #162. - Synthetic checksum_page_framing suite (bare fails / gated strip passes) - Writer verify uses bare inflate (no false strip on strip-clean encoder) - Contract/probe docs from Wave 1 #159 + Wave 2 evidence - Formats/Latest remains ungated; Partitions/Global stay gated Credit @STE1200. Refs #151 / Discussion #112.


Summary
Compliance check of merged PR #160 (
8c8b083) against the independent judge narrow verdict for Finding 1 / #151.Verdict: too wide — production stripped
Formats/Latestand regressed magnetar Core Interiorclass_names9579→8575.Credit: @STE1200
Hotfix
Formats/Latestfromis_checksum_paged_stream(production strip gate)Partitions/*and listedGlobal/*is_revit_paged_loader_candidatefor research/probes (still includes Formats)Partitions/46; Formats named-inflate ≡ bareread_streamunchanged (stored-byte accurate)Evidence (re-run)
Artifacts:
/opt/cursor/artifacts/wave2_strip_compliance/Test plan
cargo test --release --lib compression::tests(21 ok)cargo clippy --release --lib -- -D warningsNote
Medium Risk
Changes which CFB streams get page-trailer stripping before inflate—affects schema/class inventory on
Formats/Latestand multi-chunk partition recovery; behavior is evidence-driven but stream-path-specific.Overview
Narrows the production checksum-page trailer strip so it no longer applies to
Formats/Latest, after PR #160 showed naive strip on that stream droppedclass_names(9579→8575 on Core Interior) whilePartitions/*still gains extra gzip members with strip.is_checksum_paged_streamnow gates onlyPartitions/*and the listedGlobal/*database streams.Formats/Latestis omitted from that gate;inflate_stream_at/prepare_stream_for_inflatetherefore leave Formats bytes unchanged (same as bareinflate_at). Strip behavior on partitions and globals is unchanged. A newis_revit_paged_loader_candidatekeepsFormats/Latestin the broader reviter-aligned set for probes only.Tests and docs were updated: path assertions, multipage synthetic test uses
Partitions/46and checks Formats named-inflate matches bare inflate; the DISC-112 report records the post-merge re-measurement.read_streamis still stored-byte accurate.Reviewed by Cursor Bugbot for commit 72895ad. Configure here.