Repository navigation
feat(artifacts): inspect Android boot image components - #9487
Conversation
…mages A format parser and artifact reader now recognize ANDROID! headers in versions 0 through 4 and VNDRBOOT headers in versions 3 and 4 by magic, independent of filename. Non-empty stored pieces become children: kernel, ramdisk, second stage, recovery DTBO, DTB, a version 3 vendor ramdisk or version 4 named ramdisk-table entries, bootconfig, and a version 4 signature. gzip, lz4, and zstd are recorded from a leading magic and left compressed, and admission stops at 4096 vendor ramdisk entries, a 4096-byte entry, or a vendor header above 1 MiB before the table is read. Header facts cover page size, command line, OS version and security patch level when present, board name, and the header digest, with an AVB footer reported as version and sizes only; the format joins the existing container inventory and extraction path so CLI and MCP return the same evidence, including the untrusted command-line and name limitation and the unknown boot, init_boot, or recovery role.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The latest changes appear safe to merge, with no new blocking finding. SummaryAdds read-only Android boot and vendor_boot inspection and stored-component extraction through the existing artifact workflows.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Local image] --> B[Recognize Android magic]
B --> C[Parse header and bounded component ranges]
C --> D[Read vendor table and footer facts]
D --> E[Recheck source and cancellation]
E --> F[Publish entries, metadata and coverage]
F --> G[CLI or MCP inventory]
F --> H[Stream stored components for safe extraction]
Reviews (17) · Last reviewed commit: "fix(artifacts): publish validated facts ..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71de141317
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Header and vendor ramdisk table capacity failures now carry the named ceiling, and the reader reports them through artifactFixedLimitFailure so the recovery states this release has no runtime override and what does not raise the limit.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b01461cf47
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…actReader The reader now extends PositionalArtifactReader for the entry cache, stream ownership, cancellation, carrier freshness checks and close order, and keeps only Android header, vendor ramdisk table, AVB footer and entry construction.
ramdisk_addr describes the assembled vendor ramdisk section, and bootloader fragment selection decides where each fragment lands, so table fragments no longer inherit it as their load_address. The declared base stays on the root image metadata.
Inventory keys logical paths by their NFC spelling, so two canonically equivalent ramdisk names collided after normalization and could not be extracted together. Uniqueness is now checked with logicalPathNfc before suffixing; name_bytes_hex still records the stored bytes.
Resolve docs/specs/README.md by keeping both the Firmware section from this branch and the Native section from main.
|
Merged current main in b1d0c4f. The only conflict was docs/specs/README.md, resolved by keeping both this PR's Firmware section and main's new Native section; the Android boot reader suites, typecheck and lint pass on the merge. |
A UTF-8 character can straddle the 512-byte cmdline/extra_cmdline split in v0-v2 boot headers, which made both separate decodes fail and left command_line null. The joined line is now decoded from the concatenated NUL-trimmed field bytes; the separate fields and raw hex are unchanged.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab3f8014b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ecting the image A zero-length vendor ramdisk table entry made the whole vendor_boot image fail to parse, hiding the other fragments, DTB, and bootconfig. Keep the range check, then omit the empty entry and report it as a limitation, matching how other layouts skip zero-sized components.
|
Merged current main in f5acef6, which removes the duplicate |
Register android-boot-image in main's shared artifact recognizer table so inventory classification and binary target resolution reach the same verdict, instead of re-adding a magic check at each route. The extraction test's kernel member now carries a decodable ELF header, since main classifies ELF only when its header decodes (morluto#10650).
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
… parser beside its reader Main's architecture guards refuse new raw Buffer reads, per-format Error classes and local UTF-8 decoders. The domain module now owns only the ANDROID!/VNDRBOOT magic that the shared recognizer table needs; the header, vendor ramdisk and AVB footer parser moves to src/artifacts beside its reader and reads through BinaryReader, throws ParseFailureError (malformed, or decodeLimit for its fixed limits) and decodes with decodeStrictUtf8. Its Result interface is unchanged.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Compare the vendor ramdisk count refusal with artifactFixedLimitFailure instead of fragments of its wording, throw the returned parse error in the success helpers instead of a generic unreachable error, and let the MCP extraction test inherit the project deadline.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Build images whose tables really hold 4,096 and 4,097 entries: the first is inventoried completely, and the second is refused before its table is read.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Take the BINARY_TARGET_FORMAT_KINDS lookup main uses for archive formats and list android-boot-image there, and read ArtifactReader helpers from src/resources and BinaryReader from src/domain/binaryContainer.
|
Merged current main in f4ee42f to clear the conflict in |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Preserve Android boot image registration alongside the merged inspection workflows. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <[email protected]>
Keep shared parser failures through artifact inventory and error projection, including cleanup retry. Distinguish unsupported revisions, truncated declared structures and malformed layouts through the compiled CLI and MCP workflows. Preserve parser-owned fixed allowances and update the directly affected Deno confirmed-slot consumer, generated metadata and feature documentation. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Commit positional entries, coverage and Android metadata after carrier freshness and active checks, keeping failed preparations retryable. Project owned PE parser failures through one selected-input owner so unsupported targets retain the path and malformed or truncated headers retain their structured issues. Preserve primary causes, partial identity and cleanup ownership through retry. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
gensokyo-dev
left a comment
There was a problem hiding this comment.
Reviewed the Android format/reader integration and shared failure/publication corrections. Official AOSP producer/unpacker controls and bounded source/public checks support the read-only stored-component scope. Exact-head required CI and automated review must pass before merge; real-device/signature and platform-specific verification limits remain explicit.
Android boot (
ANDROID!, v0–v4) and vendor_boot (VNDRBOOT, v3–v4) images now expose header facts and stored components through the existing local artifact inventory/extraction workflows. Component ranges, caller paths, raw target strings and Evidence provenance remain intact. This is read-only format support with ordinary safe extraction; no new provider, target execution, flashing, payload decompression, or signature/AVB verification. No issue is linked because this is an additive format proposal.The parser uses the shared tagged failure algebra: unsupported revisions, truncated declarations and malformed structures stay distinct through CLI/MCP and cleanup retry. The directly affected Deno confirmed-slot consumer recognizes these reasons. Vendor table count/entry-size ceilings are checked before reading or allocating the table (at most 4,096 × 4,096 bytes); components stream admitted stored ranges. Positional metadata, entries and coverage publish together after final carrier validation. Shared PE input projection preserves selected paths and structured malformed/truncated diagnostics. Owning contracts, errors, documentation and format registration are updated. Existing files with recognized magic now inventory as Android boot images; other artifact formats retain their registrations.
Validation on Linux with pinned Node 24.22.1:
d2bb0af5ba6d3198a3e99529c97eda1be0b5a093covered boot v0–v4 and vendor_boot v3/v4. All component slices/hashes matched known inputs and the official unpacker; compiled CLI vendor-v4 extraction matched all four inputs. No images were booted or flashed.Coverage limits: no device-dumped images or signature/AVB verification; Windows/macOS-specific cases and C++/Rust schema engines were unavailable locally. Full typed lint and the complete suite were not run locally. On final head
abb99f3e405014aff5ae7a40f4e6a11c8ea2056d, GitHub Static checks, all source tests, all 12 built-test shards, Portable tests, CI required and Greptile passed. The Windows capability lane was skipped. One unrelated IDA startup-diagnostic EPIPE cleared on a failed-job rerun without code changes; no gate was bypassed. An existing Node SEA same-size-mutation test failed intermittently in a sibling run; its producer is unchanged, and one targeted pinned-main comparison passed, so a baseline failure has not been established. This observation is retained for CI assessment rather than attributed to main as a confirmed bug.Author readiness
Human owner: @mvanhorn