Skip to content

Audit rust/swift/scala/scheme golden-master history for #1532's cross-language line-shift impact #1597

Closed

Description

@squid-protocol

Background

#1532 was filed as a Haskell-specific bug ("start_line looks shifted by roughly one prior function"). Root-causing it for PR #1596 found the real bug wasn't Haskell-specific at all: prism.py's _strip_nested_comments — shared by every recursive_block/recursive_block_haskell/recursive_block_lisp language, i.e. rust, swift, scala, haskell, scheme (see the five "lexical_family": "recursive_block..." entries in gitgalaxy/standards/language_standards.py) — deleted a block comment's matched span outright instead of replacing it with an equal number of newlines. Any multi-line block comment anywhere earlier in a file shifted every later function's recorded start_line backward by exactly the number of newlines the comment spanned, cumulative for each such comment.

PR #1596 fixes the root cause (_strip_nested_comments now preserves newline count, matching the idiom the generic REGEX_MATRIX stripper's strip_callback already uses) and re-blesses both golden masters. The scala kafka corpus in language-crucible already showed the exact same shape in that PR's diff (Kafka.scala's main/getPropsFromArgs/buildServer all shifted, e.g. main moved from line 57 to the correct line 72 — a +15 correction), confirming the cross-language impact is real, not theoretical.

What this issue is asking for

An explicit audit pass across the rust, swift, scheme corpora in language-crucible (scala's kafka corpus is already confirmed via #1596's diff; haskell's pandoc corpus is already confirmed via #1532 itself) to check whether any of their files contain multi-line block comments that would have been silently under-counting line numbers pre-fix. Since #1596 already re-blessed the golden masters repo-wide, this is now purely a retrospective question — "how much real-world drift did this cause historically" — not a live bug, but worth a quick pass to close the loop given start_line correctness is exactly the kind of data-integrity property this project measures its own accuracy against.

Suggested approach

Grep each corpus for multi-line /* ... */ (rust/swift/scala) and nested #| ... |# (scheme) block comments near the top of files (the worst case, since it shifts the most subsequent content), and spot-check a few start_line values against ground truth the same way #1532's investigation did for App.hs.

Related

Activity

  1. added
    bug
    data-integrity
    core-engine
    on Aug 14, 2026
  2. squid-protocol commented on Aug 14, 2026

    @squid-protocol
    OwnerAuthor

    Audit complete — no historical impact found for rust/swift/scheme

    Methodology: diffed tests/golden_master_audit.json/tests/golden_master_zero_dep_audit.json before vs. after PR #1596's merge commit (b5ad82f3) using tests/golden_diff.py's own deep_compare, filtered to rust/swift/scheme paths. Cross-checked with a standalone replica of _strip_nested_comments's old (buggy) newline-deletion logic run directly against every rust/swift/scheme file actually present in the golden master corpus, to measure how many newlines each file's real block comments would have lost pre-fix. Sanity-checked the replica against the two known-affected files first — it correctly reproduced App.hs's -10 and Kafka.scala's -15, so the methodology is trustworthy.

    Result:

    • rust (48 files across bevy/holylang/serde/syn/tokio/wasmtime): 0 files contain a qualifying multi-line /* */ block comment. Idiomatic Rust overwhelmingly uses //////! line-doc-comments, which were never affected by this bug (the single-line branch of _strip_nested_comments never deleted a real newline).
    • swift (6 files, alamofire): 0 files contain a qualifying multi-line block comment.
    • scheme (7 files, racket): exactly 1 file, scheme/racket/io.ss, contains a real multi-line #| |# block comment that would have lost 21 newlines under the old bug — but that file has zero functions detected by GitGalaxy's scheme rules, so the bug had no function/start_line to misattribute, and produced no visible diff in either golden master.

    Confirms what PR #1596's own diff already suggested: in the current language-crucible corpus, this bug's real-world impact was isolated to haskell (idiomatic Haddock {- | -} header comments) and scala (Kafka.scala's header comment) — not rust/swift/scheme, even though the underlying prism.py code path is shared by all five languages. The fix stands regardless (any future rust/swift/scheme file with a real multi-line block comment before a function would have hit this), but there's no retroactive golden-master drift to chase down for these three languages.

    Closing — audit done, no further action needed.

  3. added this to the v2.4.8 milestone on Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginedata-integrity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions