Skip to content

Leading UTF-8 BOM never stripped -> defeats ^-anchored line-1 extraction (58 corpus files; 38 livecode classes missed) #2411

Closed

Description

@squid-protocol

Summary

A leading UTF-8 BOM (EF BB BF / U+FEFF) at the very start of a file is never
stripped anywhere in the pipeline (aperture.py / prism.py — confirmed: no
ufeff / utf-8-sig / BOM handling exists in gitgalaxy/). Any ^-anchored
signal rule that targets line 1 then fails, because ^[ \t]* does not consume
.

Impact (measured)

Most visible on livecode: .livecodescript files are exported with a BOM and
their object declaration script "Name" is line 1. After the class_start
quoted-name fix (this same sweep), the corpus should detect 62 .livecodescript
classes; it detects 24. The other 38 are missed purely because of the BOM:

$ head -1 accountsignupcardbehavior.livecodescript | cat -A
M-oM-;M-?script "EnvironmentAccountSignupCardBehavior"$

Strip the 3 BOM bytes and the identical line matches class_start fine.

BOM files across the whole language-crucible/data/ corpus:

language dir BOM files
livecode 39
csharp 6
powershell 6
xml 5
cpp 1
abap 1
total 58

So the fix has ripple beyond livecode (a csharp namespace/using on line 1, a
powershell param(/function on line 1, etc. would newly be detected), which is why
this is filed rather than fixed inside the livecode manual-verification sweep.

Proposed fix

Strip a single leading  once, at file read / ingestion time (equivalent to
decoding as utf-8-sig), before any stage sees the text. One well-scoped change;
needs a full Differential Scan + golden-master re-bless because of the 19
non-livecode corpus files above.

Found by

tri-comparison-ledger-sweep skill, livecode manual-verification pass (2026-08-28).
The corpus even ships a deliberately-named bom.livecodescript test file, so BOM
handling is clearly intended to work.

Activity

  1. added
    bug
    core-engine
    on Aug 29, 2026
  2. added 2 commits that reference this issue on Aug 29, 2026
  3. added this to the v2.4.9 milestone on Aug 31, 2026
  4. added a commit that references this issue on Sep 26, 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-enginepriority: medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions