[PR #6705] [CLOSED] fix(flutter): accept GNU build IDs shorter than four bytes #7394

Closed
opened 2026-11-01 21:47:32 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6705
Author: @ezrabrilliant
Created: 10/23/2026
Status: ❌ Closed

Base: main ← Head: fix/flutter-short-build-id


📝 Commits (1)

  • 84f0b2b fix(flutter): accept GNU build IDs shorter than four bytes

📊 Changes

2 files changed (+56 additions, -2 deletions)

View changed files

➕ src/flutter/ElfBuildId.test.ts (+54 -0)
📝 src/flutter/ElfBuildId.ts (+2 -2)

📄 Description

Summary

Fixes #6697. identify_flutter_build returned a null build_id, no candidates,
and partial coverage for a valid GNU build ID shorter than four bytes, because
readElfBuildIds guarded the descriptor with descsz < 4 || descsz > 64 and
reported the too-small case with the inaccurate message "GNU build-id descriptor
exceeds the 4–64 byte projection".

Problem and expected behavior

Smallest trigger: an ELF NT_GNU_BUILD_ID note whose descriptor is the 3-byte ID
112233. Observed: rejected as out of range. Expected: the ID is read (the
4-byte control 11223344 already works). A GNU build-id descriptor has no
documented 4-byte minimum; it only needs to be non-empty.

Change and scope

Lower the minimum descriptor size from 4 to 1 byte in src/flutter/ElfBuildId.ts
(keeping the 64-byte projection cap) and correct the message to describe the
range rather than claim the value "exceeds" it. Empty descriptors (descsz == 0)
are still rejected. No contract or schema change.

Contract and boundary impact

  • Semantic owner and earliest changed stage: readElfBuildIds in
    src/flutter/ElfBuildId.ts, at GNU build-id note projection.

  • Contribution scope fit and linked maintainer decision: ordinary fix within an
    existing boundary; no maintainer scope decision required (not applicable).

  • CLI and MCP/tool-catalog contract: no schema change. identify_flutter_build
    now reports a 1–3 byte GNU build ID instead of null with partial coverage.

  • Provider, bridge, target-format, or platform compatibility: none.

  • Evidence, artifact, provenance, or reconstruction contract: none; recovers a
    valid Evidence value that was dropped.

  • Target selection, authority, upstream behavior, and cleanup details: not applicable.

  • Generated metadata, package, or installation impact: none.

  • Read existing files or captured data.

  • Launch or attach to a process.

  • Inject instrumentation or run scripts/code.

  • Change process memory, registers, files, or configuration.

  • Contact network services.

  • Recover protected code or work around protections.

  • Documentation or usability only; no target interaction.

  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: new src/flutter/ElfBuildId.test.ts drives
    readElfBuildIds with an in-memory FileHandle over engineFixtureImage +
    gnuBuildIdNote, covering a sub-4-byte ID (112233), a normal 20-byte ID, and
    an empty descriptor.

  • Base reproduction (executed): on the base revision the sub-4-byte case fails
    (candidates empty, build-id rejected); with the fix it returns ["112233"].

  • User-visible CLI/MCP output: identify_flutter_build reports the short
    build_id with complete coverage instead of null/partial. The service-to-CLI
    mapping is source-derived (FlutterBuildProvider); the public transport was not
    executed.

  • Remaining proof gaps: validated against synthetic ELF fixtures, not a real
    Flutter engine image.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:local -- src/flutter/ElfBuildId.test.ts — 3 passed (incl. the sub-4-byte regression).
  • npm run test:local -- src/flutter/DartElf.test.ts src/flutter/FlutterPayloadScan.test.ts src/native/elf/ElfNoteParser.test.ts src/domain/native/elfNotes.test.ts — 69 passed, 1 skipped.
  • npm run check:fast — typecheck + lint: 2 tasks successful.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Previously rejected short build IDs
    now decode; no previously accepted input changes.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none; parsing-bound fix, no
    target execution.

Author readiness

Human owner: @ezrabrilliant

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VkKgC2HYpt7rG38FnoufT1


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6705 **Author:** [@ezrabrilliant](https://github.com/ezrabrilliant) **Created:** 10/23/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/flutter-short-build-id` --- ### 📝 Commits (1) - [`84f0b2b`](https://github.com/morluto/rea/commit/84f0b2b2d01634f140870fe50321006032766348) fix(flutter): accept GNU build IDs shorter than four bytes ### 📊 Changes **2 files changed** (+56 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `src/flutter/ElfBuildId.test.ts` (+54 -0) 📝 `src/flutter/ElfBuildId.ts` (+2 -2) </details> ### 📄 Description ## Summary Fixes #6697. `identify_flutter_build` returned a null `build_id`, no candidates, and partial coverage for a valid GNU build ID shorter than four bytes, because `readElfBuildIds` guarded the descriptor with `descsz < 4 || descsz > 64` and reported the too-small case with the inaccurate message "GNU build-id descriptor exceeds the 4–64 byte projection". ## Problem and expected behavior Smallest trigger: an ELF `NT_GNU_BUILD_ID` note whose descriptor is the 3-byte ID `112233`. Observed: rejected as out of range. Expected: the ID is read (the 4-byte control `11223344` already works). A GNU build-id descriptor has no documented 4-byte minimum; it only needs to be non-empty. ## Change and scope Lower the minimum descriptor size from 4 to 1 byte in `src/flutter/ElfBuildId.ts` (keeping the 64-byte projection cap) and correct the message to describe the range rather than claim the value "exceeds" it. Empty descriptors (`descsz == 0`) are still rejected. No contract or schema change. ## Contract and boundary impact - Semantic owner and earliest changed stage: `readElfBuildIds` in `src/flutter/ElfBuildId.ts`, at GNU build-id note projection. - Contribution scope fit and linked maintainer decision: ordinary fix within an existing boundary; no maintainer scope decision required (not applicable). - CLI and MCP/tool-catalog contract: no schema change. `identify_flutter_build` now reports a 1–3 byte GNU build ID instead of null with partial coverage. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: none; recovers a valid Evidence value that was dropped. - Target selection, authority, upstream behavior, and cleanup details: not applicable. - Generated metadata, package, or installation impact: none. - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: new `src/flutter/ElfBuildId.test.ts` drives `readElfBuildIds` with an in-memory FileHandle over `engineFixtureImage` + `gnuBuildIdNote`, covering a sub-4-byte ID (`112233`), a normal 20-byte ID, and an empty descriptor. - Base reproduction (executed): on the base revision the sub-4-byte case fails (`candidates` empty, build-id rejected); with the fix it returns `["112233"]`. - User-visible CLI/MCP output: `identify_flutter_build` reports the short `build_id` with complete coverage instead of null/partial. The service-to-CLI mapping is source-derived (`FlutterBuildProvider`); the public transport was not executed. - Remaining proof gaps: validated against synthetic ELF fixtures, not a real Flutter engine image. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run test:local -- src/flutter/ElfBuildId.test.ts` — 3 passed (incl. the sub-4-byte regression). - `npm run test:local -- src/flutter/DartElf.test.ts src/flutter/FlutterPayloadScan.test.ts src/native/elf/ElfNoteParser.test.ts src/domain/native/elfNotes.test.ts` — 69 passed, 1 skipped. - `npm run check:fast` — typecheck + lint: 2 tasks successful. ## Compatibility, safety, and release - Breaking changes or migration steps: none. Previously rejected short build IDs now decode; no previously accepted input changes. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none; parsing-bound fix, no target execution. ## Author readiness Human owner: @ezrabrilliant - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VkKgC2HYpt7rG38FnoufT1 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:47:32 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7394
No description provided.