Repository navigation
fix(limits)!: let apktool and assetutil take producer_limits.output_bytes and type Android and process capture refusals - #14624
Conversation
…ytes and type Android and process capture refusals decode_android_resources and inspect_asset_catalog refused larger apktool or assetutil output with a fixed capture ceiling. Both now accept producer_limits.output_bytes (defaults 4 MiB and 64 MiB) and report details.limit for it. assetutil's budget covers each stream and the JSON retained across catalogs, capped at 128 MiB for the in-process decode. capture_process's retained-frame refusal reports details.limit for limits.output_bytes, and a JADX JVM heap failure is marked as measured exhaustion. The lipo field-retention allowance is reclassified as derived from the native command output capture, and the JADX external DEX representation allowance as protocol (a fraction of the bridge's local MCP frame). BREAKING CHANGE: apktool and assetutil output refusals report details.limit for producer_limits.output_bytes instead of a fixed_ceiling refusal.
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. |
[Medium impact] The reviewed changes appear safe to merge; no blocking issues were identified. SummaryAdds per-call output budgets for Apktool and assetutil, reports typed recovery for capture failures, and carries measured input sizes into retry guidance.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[CLI JSON or MCP input] --> B[Shared input schema]
B --> C[Selected output budget]
C --> D[Owned process capture]
D -->|Budget exceeded| E[Typed limit and generated recovery]
D -->|Complete output| F[Decode or inspect result]
Reviews (9) · Last reviewed commit: "merge: keep the session output control f..." · Reviewed by Greptile |
… check deadlines leave the output budget unchanged
Per-call output refusals for Apktool, assetutil and process normalization drop their authored recovery for the generated adjustable_budget text. The shared selected-input refusal reports required_value from the size the stable read observed, and producer command output refusals drop duplicated prose.
…producers Co-authored-by: morluto <[email protected]>
The generated recovery sentence is not the contract. The refusal names capture_process_scenario and limits.output_bytes.
|
@greptileai please review the current head |
commandContext now receives the output limit from its caller, which is how producer.output_bytes reaches packet and signal captures. Apktool and assetutil keep their own defaults and maxima, so that setting does not supply their omitted producer_limits.output_bytes. Co-authored-by: morluto <[email protected]>
|
@greptileai please review the current head |
Summary
Part of #14237 and #14234.
decode_android_resources(Apktool) andinspect_asset_catalog(assetutil) refused larger producer output with a fixed capture ceiling and no override. Both now takeproducer_limits.output_bytesand reportdetails.limitfor it. Three more refusals in the same producer family now carry typed recovery, and two fixed ceilings are reclassified with their reasons.Change and scope
src/domain/apktool/apktoolResourceAnalysis.ts,src/apktool/ApktoolProvider.ts,src/cli/apktoolCommands.ts):producer_limits: { output_bytes }sets the retainedapktool dstdout and stderr. The default is 4 MiB, as before.buffer.constants.MAX_STRING_LENGTH, because the retained output is decoded into one JavaScript string.limitwithparameter: "producer_limits.output_bytes", and the CLI takes--producer-limitsas JSON text.src/domain/apple/appleAssetCatalog.ts,src/artifacts/apple/AppleAssetCatalogAnalysis.ts,src/cli/artifactCommands.ts):producer_limits.output_bytesdefaults to 64 MiB, as before, with a maximum of 128 MiB. The JSON is decoded in REA's own process and every catalog's records are retained; raising the maximum would need a streaming decoder.MAX_TOTAL_METADATA_BYTEScheck is removed.src/process/capture/ProcessNormalization.ts) reportsdetails.limitforlimits.output_bytes.DEFAULT_PROCESS_OUTPUT_BYTESnow owns the 1,000,000-byte default the schema already used.load_apkis markedmeasuredExhaustion. It is exhaustion of the heap the JVM had, not a request above a configured budget, and it keeps itsREA_JADX_HEAP_MIBremediation.Registry:
ApktoolProvider.tsapktool output captureproducer_limits.output_bytesAppleAssetCatalogAnalysis.tsassetutil captureproducer_limits.output_bytesnative/parsers/lipo.tslipo field retentionderivedNativeCommandAnalysisError.ts) remains pending.android/JadxSession.tsexternal DEX representationprotocolThe prose-only baseline shrinks by 2 (
JadxSession.ts,ProcessNormalization.ts).Contract and boundary impact
producer_limitsondecode_android_resourcesandinspect_asset_catalog. The advertised schema summaries are updated.docs/reference/limits-and-recovery.md.Evidence and regression coverage
tests/boundary/providers/apktoolDecodeOutputLimit.test.ts(new): a launcher writes more thanoutput_bytes: 64. The publicdecode_android_resourcesprovider call refuses withdetails.limitforproducer_limits.output_bytesand with nodetails.refusal.src/artifacts/apple/AppleAssetCatalogAnalysis.test.ts:details.limit.limitin place offixedAllowance.src/process/capture/ProcessNormalization.test.ts: a retained frame that no longer fits reportsdetails.limitforlimits.output_bytes.src/apktool/ApktoolDecodeTimeout.test.ts: the deadline remediation now namesproducer_limits.output_bytesas the separate control.Adoption of #14625 (merged from main)
AnalysisParameterLimitwith no authoredremediationAction. The generatedadjustable_budgetrecovery spells the CLI flag or MCP field. The authored text is removed from the Apktool and assetutil capture refusals, the shared producer command output refusal and thecapture_processnormalization refusal.required_value: the shared selected-input refusal (ArtifactAnalysisResources.selectedFileSize, used by packet capture and signal recording) reports the file size the stable read observed.Number.MAX_SAFE_INTEGERare omitted.required_value.ArtifactReaderFailuregains an optionalobservedBytes, set only byreadStableArtifact's file-size refusal. This is how the observed size reaches the refusal.Validation performed
npm run test:focused --on the apktool, asset catalog, process normalization, JADX protocol and apktool CLI/MCP tests (35 files): passednpm run typecheck: cleannode scripts/verify/fixed-ceilings.mjs: 97 registered, 76 pending, 101 authored-only (this branch alone, from main)node scripts/verify/architecture-guards.mjs,npm run docs:check,npm run verify:advertised-schemas -- --update-summary: passednpx oxfmt --check .: cleanCompatibility, safety, and release
details.limit(producer_limits.output_bytes) and no longer carry afixed_ceilingrefusal. The combined assetutil metadata refusal is now the same typed capture refusal. Behaviour is unchanged whenproducer_limitsis omitted.AndroidMappingFile.tsand the JNI report allowance inJadxAnalysis.tsstill carry prose-only recovery. Both are fixed resource policies that need their own per-call controls.