Repository navigation
feat(native): carry the value of each fixed structural decoding allowance - #11651
Merged
Merged
Conversation
…ance BinaryResourceFailure and relocation-index refusals pass their maximum as limit and unit; the PE certificate decoder allowances drop the value from their names and pass it with a per-payload unit; the ELF note parser names its text ceiling with the enforced value. Kernel-module and unwind providers no longer claim a fixed text or structural allowance for a memory limit that names no ceiling (no parser produces one).
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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
[Medium impact] The PR appears safe to merge; both previous findings are fixed and no new blocking issue was found. SummaryThis PR adds producer-owned ceiling values and units to native decoding refusals.
Reviews (3) · Last reviewed commit: "fix(native): report a binary resource ce..." · Reviewed by Greptile |
…r counts BinaryResourceFailure carries an optional unit; the ELF hardening entry budget says entries and the structural byte budgets say bytes. binaryResourceCeiling reports the unit only when the producer named it, so an entry count is no longer labelled as bytes. The ELF note test takes its expected ceiling from the fixture length instead of the message.
Plastic-time
added a commit
to Plastic-time/rea
that referenced
this pull request
Nov 16, 2026
- Move PeRichHeaderPort to src/ports/binaryDiagnostics (morluto#11208). The provider now implements it, like the other PE providers. - Import the artifact toolkit from src/resources, BinaryContainer from src/domain/binaryContainer and readPeHeaders from src/domain/pe. - List PeRichHeaderProvider among native's entry files. - Map failures with projectPeBinaryFailure, as PeImportsProvider and PeLoadConfigProvider do. The new guards forbid a hand-built resource-constraint refusal and an inline error message; the shared PE projection already owns both, so the provider adds neither. The structural allowance's recovery now carries its ceiling (morluto#11651). - Tests: the Evidence subject names its target identity (morluto#11416), and readPeHeaders now throws a malformed ParseFailureError (morluto#11550). - Re-record the advertised schema summary: the output hash now matches inspect_pe_imports after Evidence format revision 2.
20 of 29 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs #10508 (item 4, native structural slice). The twelve native structural fixed-allowance calls (ELF notes, unwind, kernel modules, native exports, binary hardening, initializers, PE certificates, imports and load config) named no value, so
details.refusalhad nolimitorunit. Each now carries the value its producer enforced, or stops claiming a ceiling no producer names. After this and #11641, the only calls without a value are the three W4 sites (src/adb×2,src/process/ArtifactAnalysisResources.ts).Problem and expected behavior
Before:
inspect_pe_certificatesrefusing a PKCS#7 payload with more than 16,384 ASN.1 values returned an allowance named "The PE certificate ASN.1 allowance of 16384 values per PKCS#7 payload (this release has no runtime override)" and nodetails.refusal.limit.After:
details.refusal = { kind: "fixed_ceiling", allowance: "The PE certificate ASN.1 value allowance", allowance_kind: "parser", limit: 16384, unit: "values per PKCS#7 payload" }, and the remediation states the value.Change and scope
BinaryResourceFailurestructural refusals (ELF structural decoding in kernel modules and unwind, binary hardening, native initializers, native exports, PE imports and load config, and the Go provider):binaryResourceCeiling(failure)giveslimitand the unit the producer counts.BinaryResourceFailuregains an optionalunit; the hardening entry budget saysentries, and the ELF dynamic directory, binary-container table and section-directory budgets saybytes. A producer that names no unit gives no unit.PeBinaryFailure'slimitRecoveryreceives that ceiling. The unwind allowance no longer embeds "16 MiB" in its name.limit.maximumand its ownunit(entries or bytes).limitand a per-payload/per-OIDunit.fixedAllowancewith the enforcedbudget.limit); the provider keeps that reader-named ceiling instead of a provider string.memory-boundary branches claimed a fixed text or structural allowance, but neither parser produces a memory-boundary reader limit (their limits arefile-sizefromreadStableArtifactandcapacityfrom the parsers). Those branches now keep only a reader-named ceiling, and the unusedTEXT_BUDGETstring is removed.Not included: the three W4 sites; the Flutter sites are in #11641.
Contribution scope: within existing boundaries.
Contract and boundary impact
BinaryResourceFailure,ElfPointerRelocationFailure, the ELF note parser, the PE certificate decoder table); providers project it unchanged.details.refusal.limit/unitfor these refusals; the PE certificate, unwind and ELF note allowance names change; the remediation states the value.code,retryableandreported_limitsare unchanged.docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/native/elf/ElfNotesProvider.test.ts: the note-text refusal assertsdetails.refusalwith the enforced value and compares the remediation withanalysisRefusalRemediationinstead of matching sentences.src/native/pe/PeCertificatesProvider.test.ts: the depth, values, text, OID bytes and OID arc cases assertlimitandunitinstead of the value inside the name.ElfNoteParser.ts,ElfNotesProvider.tsandPeCertificatesProvider.ts, those 6 cases fail.BinaryResourceFailurestructural refusals of hardening, initializers, exports, PE imports and load config, kernel modules and unwind (each needs a >16 MiB structure); their values come from the failure's ownmaximum_bytes. The kernel-module and unwind memory branches are unreachable today, so their change is source-derived.For evidence-bearing changes:
Validation performed
npm run test:focused --20 native files (ELF notes parser and provider, unwind tables, kernel modules, hardening, initializers, PE certificates, imports and load config, the matchingtests/boundary/filesystemfiles,binaryDiagnosticsMcp,peCertificatesCli): 569 passed, 1 skipped (8.9 s, 1.2 GB peak).npm run check:fast: passed.npx oxfmton the changed files.BinaryResourceFailurecarries its producer's unit (hardening entries, structural bytes) throughbinaryResourceCeiling; new parser and provider cases (65,537 dynamic entries) fail with the previousElfHardening.ts; 21 native and Go files 748 passed, 1 skipped;npm run check:fastpassed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.