Skip to content

fix: harden assembly extraction rules - #936

Merged
squid-protocol merged 3 commits into
mainfrom
extraction-hardening-assembly
Aug 1, 2026
Merged

fix: harden assembly extraction rules#936
squid-protocol merged 3 commits into
mainfrom
extraction-hardening-assembly

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #856.
Updates assembly extraction rules to pass adversarial hardening.

  • Created tests/extraction/languages/test_assembly.py with 128 comprehensive cases (valid, invalid, pathological) covering func_start, args, class_start, and _dependency_capture.
  • func_start: Expanded to support MASM style labels with ?, @, and . prefixes which also unblocked the negative lookahead exclusion.
  • args: Added ARM32 args (r0-r7) support.
  • class_start: Refactored grammar to properly capture MASM struct definitions (<name> STRUCT) alongside NASM's (struc <name>), and allowed MASM identifiers.
  • _dependency_capture: Included INCLUDE and INCLUDELIB for MASM directives and moved the rule from being case-sensitive.
  • Updated Epic tracking document how_to_harden_extraction.md with a new recurring bug class (Class 44: Neutralized negative lookaheads).
  • Updated crucible golden master files via crucible_check.py --update --yes reflecting an increased density of parsed tokens due to fixed/expanded captures.

@squid-protocol squid-protocol added testing Unit, integration, and E2E pipeline verification core-engine Modifications to the central physics and parsing engine labels Aug 1, 2026
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit dd2e8f0 into main Aug 1, 2026
28 checks passed
@squid-protocol
squid-protocol deleted the extraction-hardening-assembly branch August 1, 2026 04:08
squid-protocol added a commit that referenced this pull request Aug 1, 2026
…ix forms (#940)

Independent review of merged PR #936 found `args`'s `[er][89]` matched the
fictional registers "e8"/"e9" while failing to match the real r8d/r9d/r8w/
r9w/r8b/r9b sub-register forms (the trailing \b never fires between two
word characters). Fixed to `r[89][dwb]?`. Also closed a real coverage gap:
assembly's own _meta declares it "Backwards Compatible", yet args had zero
support for the legacy 8/16-bit x86 register set (al/ah/ax, etc.) that real
16-bit real-mode code (the bootos corpus file) uses for argument coupling.

Verified against the real assembly corpus through the actual Prism
comment-stripping pipeline (not raw file text, which over-counts matches
inside prose comments): 84->305 matches (+263%), concentrated in the
16-bit bootloader code the old pattern missed entirely. crucible_check.py
diff confirmed confined to assembly; golden master fixtures re-blessed.

class_start and _dependency_capture independently audited and found clean
against the real corpus (no bugs found).

Co-authored-by: Joe Esquibel <squid-protocol@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-engine Modifications to the central physics and parsing engine testing Unit, integration, and E2E pipeline verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extraction hardening: assembly

1 participant