Skip to content

fix(native)!: report details.limit for remaining native reader budgets and make BEAM table rows adjustable - #14631

Merged
morluto merged 5 commits into
mainfrom
fix/native-format-allowances
Nov 26, 2026
Merged

morluto merged 5 commits into
mainfrom
fix/native-format-allowances

Conversation

@morluto

@morluto morluto commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Part of #14234 and #14235. This finishes the per-call budget refusals in the native readers that still named their control only in remediationAction prose. The fixed BEAM table-row ceiling becomes a per-call control, the plist nesting allowance is reclassified, and fixed GPU and APK refusals that described their allowance only in prose now declare it.

Behavior change

  • Each change uses a domain-owned ParameterBudget object (from fix(native)!: report details.limit for native reader per-call budgets #14622) that builds both the schema and details.limit:
    • inspect_elf_dependencies: max_file_bytes, max_needed, max_versions, max_imports.
    • inspect_elf_unwind_ranges: max_file_bytes and max_ranges. The per-page symbol-name text allowance stays fixed, but its refusal now reports details.limit for the page size limit, which is the control that admits the page.
    • inspect_apple_ips: max_file_bytes, max_join_bytes, max_threads, max_frames, max_images, max_registers, max_integer_text_bytes.
    • inspect_dwarf_units, inspect_native_initializers: max_file_bytes.
    • inspect_pe_resources: max_entries.
  • inspect_erlang_beam: the fixed 65,536-row ceiling on export, import and lambda rows becomes max_table_rows, with the same default and a maximum of 1,048,576. The parser decodes and retains one row per entry, so this is a resource limit. max_chunks, max_atoms and max_file_bytes also report details.limit.
  • inspect_plist nesting is reclassified from pending to representation. MAX_NATIVE_PLIST_NESTING_DEPTH is MAX_JSON_DEPTH - 3: the decoded value is nested inside Evidence JSON, whose depth is bounded before recursive result cloning.
  • inspect_gpu_code_objects and inspect_apk_signature: three fixed allowances that were named only in prose now use fixedAllowanceOptions or fixedProducerInputAllowance and are registered as pending [Feature] Give native readers' fixed structural, text and inventory allowances a control or a stated fixed reason #14235: "The GPU parser allowance", "The GPU object allowance" and "The APK signature input allowance". This makes existing debt visible; it does not add new limits.

Counts

Compared with the state after #14622:

  • Authored-only refusals: 93 to 82. Seven files left the baseline.
  • Pending: 80 to 81. Removed: BEAM rows; plist nesting moved to representation. Added: the three declarations above.

After #14625 these refusals carry no authored recovery. BEAM reports the complete table-row and atom counts as required_value. The ELF unwind per-page symbol-name text allowance is a registered fixed allowance (pending #14235) whose narrowing asks for a smaller limit, because the generated "pass a larger" recovery would be wrong for it.

Validation

  • npx vitest run over: src/erlang, tests/boundary/mcp/erlangBeamMcp.test.ts, tests/boundary/filesystem (incl. pythonBeamCleanup, elfUnwindRanges, productCatalog), tests/boundary/mcp/elfDependenciesMcp.test.ts, tests/acceptance/elfDependenciesCli.test.ts, src/native, src/gpu, src/apkSignature, src/domain/native, src/domain/erlang, tests/conformance, tests/evaluation/fixedCeilingGuard.test.ts. All pass.
  • New or updated refusal tests that assert details.limit:
    • BEAM over MCP: max_atoms, max_chunks, and single and combined table rows, with no details.refusal. A raised max_table_rows admits the image.
    • ELF dependencies over MCP: max_needed and max_file_bytes.
    • ELF unwind: page limit and max_ranges.
  • node scripts/verify/fixed-ceilings.mjs: 102 registered, 81 pending, 82 authored-only
  • node scripts/verify/architecture-guards.mjs, npm run docs:check, npx oxfmt --check .: clean
  • npm run verify:advertised-schemas -- --update-summary: clean
  • Scoped tsc --noEmit: clean

Compatibility

Breaking: a BEAM table-row refusal reports details.limit for max_table_rows instead of a fixed_ceiling refusal. Every other change adds details.limit or a registered fixedAllowance to existing refusals. Defaults are unchanged.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T02:58:16.333171Z
We couldn’t complete this review. Comment @codex review to try again.
863b39d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The reviewed changes appear safe to merge; both numbered findings are fixed.RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge; both numbered findings are fixed.

Summary

The PR adds structured budget refusals and makes BEAM table rows adjustable. The latest commit fixes both numbered review findings.

  • BEAM inspections let callers raise the table-row budget.
  • Device-tree inspections let callers set a decoded-byte budget.
  • Native reader refusals identify the per-call budget that stopped them.
  • Firmware and byte-entropy refusals name their caller-set limit.
  • Fixed parser allowances now appear as named limits in refusals.

Reviews (5) · Last reviewed commit: "refactor(native): keep one owner of the ..." · Reviewed by Greptile

@morluto
morluto force-pushed the fix/native-format-allowances branch from 770566f to a9d2f51 Compare November 26, 2026 03:47
Comment thread docs/reference/limits-and-recovery.md Resolved
Comment thread src/native/apple/AppleIpsProvider.ts Resolved
@morluto
morluto enabled auto-merge (squash) November 26, 2026 04:08
…s and make BEAM table rows adjustable

inspect_elf_dependencies, inspect_elf_unwind_ranges, inspect_apple_ips,
inspect_dwarf_units, inspect_native_initializers and inspect_pe_resources
named their per-call budgets only in remediation prose. Each now reports
details.limit from a domain-owned budget object that also builds the
schema. The unwind per-page symbol-name text refusal names the page size
`limit`, the control that admits it.

The fixed 65,536-row BEAM table ceiling becomes the per-call
max_table_rows (default 65,536, at most 1,048,576).

The plist nesting allowance is reclassified as a representation bound
(MAX_JSON_DEPTH less the report envelope). GPU and APK input refusals that
named their fixed allowances only in prose now declare them, registered
as pending #14235.

Part of #14234 and #14235.

BREAKING CHANGE: a BEAM table-row refusal reports details.limit for
max_table_rows instead of a fixed_ceiling refusal.
…he remaining native controls

With #14625 the refusal owns per-call recovery, so the ELF dependency, ELF unwind, Apple IPS, DWARF, initializer, PE resource and BEAM refusals drop their authored sentences. BEAM reports the complete row and atom counts as required_value. The unwind per-page text allowance is a registered fixed allowance whose narrowing names a smaller limit, because a larger page would not admit it.
@morluto
morluto force-pushed the fix/native-format-allowances branch from 9f3be0d to c6d4c0c Compare November 26, 2026 04:13
@morluto
morluto merged commit 1badb6a into main Nov 26, 2026
45 checks passed
@morluto
morluto deleted the fix/native-format-allowances branch November 26, 2026 04:31
vincentkoc added a commit that referenced this pull request Nov 26, 2026
…-beta3-20261126

* commit 'd63982890e70c55b09704249cde0327537e610f0':
  refactor(views): share default page request fields (#14633)
  test(dotnet): stop expecting required_value for the lower-bound path-depth refusal
  feat(limits)!: raise disk-backed admission defaults for large ordinary targets (#14653)
  feat(artifacts): back archive member counts with the artifact.member_count setting (#14650)
  build(deps): update Knip to 6.46.1 (#14641)
  fix(native)!: report details.limit for remaining native reader budgets and make BEAM table rows adjustable (#14631)
  perf(ci): omit unused PR associations from timing queries (#14636)
  perf(ci): resolve small pinned test batches directly (#14638)

# Conflicts:
#	tests/acceptance/dotnetBundleJourney.test.ts
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working labels Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant