Repository navigation
fix(native)!: report details.limit for native reader per-call budgets - #14622
Merged
Merged
Conversation
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; no new actionable issue was found. SummaryShares budget definitions between input schemas and
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
B["Shared budget definition"] --> S["Input schema"]
S --> P["Reader enforces selected value"]
B --> L["Parameter limit facts"]
P -->|Budget exceeded| L
L --> R["Generated CLI or MCP recovery"]
Reviews (6) · Last reviewed commit: "refactor(native): let the generated adju..." · Reviewed by Greptile |
This was referenced Nov 26, 2026
Devicetree, Windows shortcut, kernel build config, firmware staging and byte-entropy refusals of caller-selected budgets named their control only in remediation prose. Each now sets details.limit from a domain-owned budget object that also builds the schema (src/domain/parameterBudget.ts), so the reported range is the one the next call accepts. inspect_devicetree's fixed 32 MiB decoded representation allowance becomes the per-call max_decoded_bytes (default 32 MiB, 1 KiB to 256 MiB); its refusal reports boundary max_decoded_bytes instead of decoded_bytes. The pwntools allocation failure declares measuredExhaustion, the firmware inherited RLIMIT_FSIZE refusal declares measuredExhaustion, and the LLDB combined-result ceiling is a registered representation bound. Part of #14234 and #14235. BREAKING CHANGE: inspect_devicetree's decoded-representation refusal reports reported_limits.boundary "max_decoded_bytes" with details.limit, instead of "decoded_bytes".
…ropy length range exact The FIT reader compared the renamed devicetree limit against decoded_bytes, so a decoded-budget refusal became capacity; it now checks max_decoded_bytes, with a test. The LLDB representation ceiling keeps a short name and carries its recovery as narrowing. The byte-entropy length maximum is the window the selected block_size admits.
…he native reader controls With #14625 the refusal owns per-call recovery, so the devicetree, Windows shortcut, kernel build config, firmware staging and byte-entropy refusals drop their authored sentences. inspect_byte_entropy reports the smallest admitting block_size as required_value.
morluto
force-pushed
the
fix/native-reader-parameter-limits
branch
from
November 26, 2026 03:44
792ba91 to
d7f636f
Compare
morluto
enabled auto-merge (squash)
November 26, 2026 04:09
Open
3 tasks done
This was referenced Nov 26, 2026
trism-prism
added a commit
to trism-prism/rea
that referenced
this pull request
Nov 28, 2026
Rebased onto main; the devicetree and NuGet parts were dropped here (landed via morluto#14622 and morluto#14629). This commit now carries only the pyc part. Refusals of the per-call budgets on inspect_devicetree, inspect_nuget_nupkg and inspect_python_pyc carried recovery only in remediation prose. Each owner now keeps one bounds object that feeds both its input schema and a structured details.limit (parameter, effective value, unit, range, default). A pyc limit that depends on max_objects and max_depth together reports related_parameters instead of a single range. The fixed decoded devicetree allowance is reported as a fixed ceiling and registered as pending. Refs morluto#14234
vincentkoc
pushed a commit
that referenced
this pull request
Nov 30, 2026
* fix(limits): report details.limit for pyc budget refusals Rebased onto main; the devicetree and NuGet parts were dropped here (landed via #14622 and #14629). This commit now carries only the pyc part. Refusals of the per-call budgets on inspect_devicetree, inspect_nuget_nupkg and inspect_python_pyc carried recovery only in remediation prose. Each owner now keeps one bounds object that feeds both its input schema and a structured details.limit (parameter, effective value, unit, range, default). A pyc limit that depends on max_objects and max_depth together reports related_parameters instead of a single range. The fixed decoded devicetree allowance is reported as a fixed ceiling and registered as pending. Refs #14234 * test(python): expect field-only pyc recovery text and the CLI limit flag
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
Part of #14234 and #14235. Several native-reader refusals of budgets a caller can already change per call named that control only in
remediationActionprose. They now reportdetails.limit(control_kind: "parameter", the field, effective value, range, default,applies_at: "next_call"). One fixed allowance, the devicetree decoded-representation estimate, becomes a per-call control.Behavior change
src/domain/parameterBudget.ts: oneParameterBudgetobject (minimum, maximum, default, unit) builds both the zod schema (parameterBudgetSchema) and the refusal'sAnalysisParameterLimit(parameterBudgetLimit). The reported range is therefore the range the next call accepts.inspect_devicetree:DEVICETREE_READ_BUDGETSownsmax_file_bytes,max_nodes,max_properties,max_depthand the newmax_decoded_bytes. The fixed 32 MiB decoded-representation allowance (an estimate charged before each allocation; repeated node paths grow it faster than the input) is nowmax_decoded_bytes(default 32 MiB, range 1 KiB to 256 MiB). The FIT reader, which calls the same parser with fixed budgets, passes the default and mapsmax_decoded_bytesto itsmemoryboundary (a small change insrc/artifacts/fit/FitStructure.ts, tested inFitStructure.test.ts).inspect_windows_shortcut:WINDOWS_SHORTCUT_BUDGETSowns the four per-call budgets; the provider's duplicated maxima table is removed.inspect_kernel_build_config:KERNEL_BUILD_CONFIG_BUDGETSowns the four budgets. The compressed IKCFG candidate allowance is derived frommax_config_bytes, so that refusal reports themax_config_byteslimit. The read-budget and file-size refusals reportmax_file_bytes.extract_firmware:FIRMWARE_STAGING_BUDGETSownsmax_output_bytesandmax_output_files; the staging refusal reports its limit. The inherited RLIMIT_FSIZE refusal is an observed host limit, not an REA control, and now declaresmeasuredExhaustion.inspect_byte_entropy: the 32,768-block refusal reportsblock_size(256 to 65536, default 4096) while a larger block admits the window, and otherwiselength(at most 32,768 blocks of the selectedblock_size; its default is the rest of the file).inspect_binary_layout/ pwntools: a structured allocation failure declaresmeasuredExhaustion, matching the documented rule that an allocation failure does not proveproducer_limits.address_space_byteswas exhausted.observe_native_calls: the combined LLDB result ceiling (min(buffer.constants.MAX_LENGTH, MAX_STRING_LENGTH)) is a fixed allowance ("The combined LLDB result representation ceiling", with the smaller-capture guidance innarrowing), registered asrepresentation.Controls added or reclassified
max_decoded_bytesdetails.limiton existing controlsrepresentationmeasuredExhaustionGuard counts: authored-only refusals 103 to 93 (seven files removed from the baseline). Pending ceilings unchanged at 80 (the devicetree allowance was never declared). Registered: 99 to 100 (one representation).
After #14625 these refusals carry no authored recovery; the generated adjustable-budget recovery names the control.
inspect_byte_entropyreports the smallest admittingblock_sizeasrequired_value. The other sites report none: count budgets stop at the first excess, and a file-size stop does not measure the complete need.Validation
npx vitest run src/domain/firmware src/firmware src/application/binaryDiagnostics/ByteEntropyService.test.ts src/domain/native/byteEntropy.test.ts tests/boundary/filesystem/kernelBuildConfig.test.ts tests/boundary/filesystem/windowsShortcut.test.ts tests/boundary/mcp/devicetreeMcp.test.ts tests/boundary/firmware src/artifacts/fit src/native/pwntools tests/evaluation/fixedCeilingGuard.test.ts: 593 passed, 54 skipped (platform)details.limit: devicetree over MCP (max_nodes,max_file_bytes,max_decoded_bytes, then a raisedmax_nodessucceeds); shortcut (max_file_bytes,max_id_list_items,max_extra_data_blocks,max_string_bytes); kernel config (max_file_bytes,max_entries,max_config_bytes,max_payload_bytes); byte entropy (block_size, andlengthwhen no block admits the window); devicetree parser admits a blob above the default with a raisedmax_decoded_bytes.node scripts/verify/fixed-ceilings.mjs: 100 registered, 80 pending, 93 authored-onlynode scripts/verify/architecture-guards.mjs: passednpm run verify:advertised-schemas -- --update-summary:inspect_devicetreesummary updatednpm run docs:check,npx oxfmt --check .,npx oxlinton changed files: cleantsc --noEmiton the changed files: cleanCompatibility
Breaking: the devicetree decoded-representation refusal reports
reported_limits.boundary: "max_decoded_bytes"anddetails.limitinstead ofdecoded_bytes. Other changes adddetails.limit,measuredExhaustionor afixed_ceilingrefusal to existing refusals. Defaults are unchanged.