Skip to content

fix: narrow Finding 1 strip gate — exclude Formats/Latest - #162

Merged
DrunkOnJava merged 1 commit into
mainfrom
cursor/wave2-strip-narrow-hotfix-67f9
Aug 29, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
cursor/wave2-strip-narrow-hotfix-67f9

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Aug 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Compliance check of merged PR #160 (8c8b083) against the independent judge narrow verdict for Finding 1 / #151.

Verdict: too wide — production stripped Formats/Latest and regressed magnetar Core Interior class_names 9579→8575.

Credit: @STE1200

Hotfix

  • Exclude Formats/Latest from is_checksum_paged_stream (production strip gate)
  • Keep strip on Partitions/* and listed Global/*
  • Add is_revit_paged_loader_candidate for research/probes (still includes Formats)
  • Synthetic multipage test uses Partitions/46; Formats named-inflate ≡ bare
  • read_stream unchanged (stored-byte accurate)
  • No Formats ~48% schema-recovery claim

Evidence (re-run)

Stream Control Strip / production
Formats/Latest class_names 9579 strip → 8575 (main); hotfix → 9579
Partitions/46 925 chunks 935 chunks (+10) kept

Artifacts: /opt/cursor/artifacts/wave2_strip_compliance/

Test plan

  • cargo test --release --lib compression::tests (21 ok)
  • cargo clippy --release --lib -- -D warnings
  • Production probe: Formats class_names=9579; Partitions/46 +10 chunks

Note

Medium Risk
Changes which CFB streams get page-trailer stripping before inflate—affects schema/class inventory on Formats/Latest and 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 dropped class_names (9579→8575 on Core Interior) while Partitions/* still gains extra gzip members with strip.

is_checksum_paged_stream now gates only Partitions/* and the listed Global/* database streams. Formats/Latest is omitted from that gate; inflate_stream_at / prepare_stream_for_inflate therefore leave Formats bytes unchanged (same as bare inflate_at). Strip behavior on partitions and globals is unchanged. A new is_revit_paged_loader_candidate keeps Formats/Latest in the broader reviter-aligned set for probes only.

Tests and docs were updated: path assertions, multipage synthetic test uses Partitions/46 and checks Formats named-inflate matches bare inflate; the DISC-112 report records the post-merge re-measurement. read_stream is still stored-byte accurate.

Reviewed by Cursor Bugbot for commit 72895ad. Configure here.

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]>
@DrunkOnJava
DrunkOnJava merged commit 9f94c68 into main Aug 29, 2026
19 of 23 checks passed
@DrunkOnJava
DrunkOnJava deleted the cursor/wave2-strip-narrow-hotfix-67f9 branch August 29, 2026 19:55
cursor Bot pushed a commit that referenced this pull request Aug 29, 2026
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]>
DrunkOnJava added a commit that referenced this pull request Aug 29, 2026
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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

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.

Comment thread src/compression.rs
/// [`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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Triggered by learned rule: #160/#151: production inflate strips page trailers

Reviewed by Cursor Bugbot for commit 72895ad. Configure here.

DrunkOnJava added a commit that referenced this pull request Aug 31, 2026
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.
DrunkOnJava added a commit that referenced this pull request Aug 31, 2026
Exclude Formats/Latest from production checksum-page strip (class_names 9579→8575 on Core Interior). Keep strip on Partitions/* and Global/*. Credit @STE1200.
DrunkOnJava added a commit that referenced this pull request Aug 31, 2026
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.
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.

2 participants