Repository navigation
fix(json): classify JSON input heap headroom and string-ceiling refusals - #14949
vincentkoc merged 4 commits into
Conversation
Mark live V8 heap-headroom refusals in JsonInputFile as measuredExhaustion, bind single-string runtime and serialization ceilings in JsonInputFile and JsonAuthenticationHeadroom to registered representation allowances, and remove all 4 entries from untyped-budget-refusal-baseline.json (Refs morluto#14234).
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 PR appears safe to merge; no actionable defects were found. SummaryThis PR classifies JSON resource refusals and adds focused regression tests.
No actionable issues were found. Review covered the full PR because the previous and current commits have different merge bases with the target commit. No previous review threads were supplied. Checks were source-based; tests were not run. Supersession could not be checked because GitHub access required authentication. Reviews (4) · Last reviewed commit: "chore: merge main for JSON refusal valid..." · Reviewed by Greptile |
* commit 'e18ed55bac14191010efe91ba61489cab1d2ba55': (137 commits) fix(artifacts): report macOS package bundle release versions (morluto#14860) test(asar): verify cleanup on the original file handle (morluto#15155) fix(ubi): bound smaller-grid probe memoization (morluto#15168) fix(artifacts): distinguish content from containment changes (morluto#15165) fix(bflt): retain complete text when data is truncated (morluto#15160) refactor(domain): reuse graph projection and validation helpers (morluto#15173) fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801) test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172) test(beam): reuse the CLI Evidence reader (morluto#15171) test(oci): share descriptor budget refusal assertions (morluto#15159) refactor(audit): share byte framing for offline audit logs (morluto#15162) refactor(evidence): reuse observed file reports for binary metadata (morluto#15161) fix(doctor): omit package-runner cache shims from installations (morluto#15059) refactor(packages): share package inspection budget contracts (morluto#15158) refactor(desktop): share completed command answer recovery (morluto#15156) refactor(views): share page byte reservations (morluto#15152) refactor(artifacts): share GPU and media asset layout rules (morluto#15150) fix(setup): name the detected host when Hopper setup does not apply (morluto#14449) fix(iso9660): read a directory record whose identifier padding byte is not zero (morluto#15020) fix(windows): report the ACE count a private DACL check observed (morluto#14450) ...
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Thanks! I merged the pinned main revision and checked the refusal contracts with a clean P2 review. CI is validating the combined head. This addresses four JSON refusal sites; the broader #14234 remains open. |
|
thanks for the fix! merged after a clean canonical review and green CI, including 285 tests. the JSON refusals now distinguish measured heap exhaustion from fixed string limits. the broader #14234 work remains open. |
* commit '6c7dffc59b970fcfae023af3171d92ee0ac50f94': (137 commits) fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949) fix(macos-pkg): retain cpio hard-link contents (morluto#15157) fix(artifacts): report macOS package bundle release versions (morluto#14860) test(asar): verify cleanup on the original file handle (morluto#15155) fix(ubi): bound smaller-grid probe memoization (morluto#15168) fix(artifacts): distinguish content from containment changes (morluto#15165) fix(bflt): retain complete text when data is truncated (morluto#15160) refactor(domain): reuse graph projection and validation helpers (morluto#15173) fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801) test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172) test(beam): reuse the CLI Evidence reader (morluto#15171) test(oci): share descriptor budget refusal assertions (morluto#15159) refactor(audit): share byte framing for offline audit logs (morluto#15162) refactor(evidence): reuse observed file reports for binary metadata (morluto#15161) fix(doctor): omit package-runner cache shims from installations (morluto#15059) refactor(packages): share package inspection budget contracts (morluto#15158) refactor(desktop): share completed command answer recovery (morluto#15156) refactor(views): share page byte reservations (morluto#15152) refactor(artifacts): share GPU and media asset layout rules (morluto#15150) fix(setup): name the detected host when Hopper setup does not apply (morluto#14449) ...
* commit '6c7dffc59b970fcfae023af3171d92ee0ac50f94': fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949) fix(macos-pkg): retain cpio hard-link contents (morluto#15157) fix(artifacts): report macOS package bundle release versions (morluto#14860) test(asar): verify cleanup on the original file handle (morluto#15155) fix(ubi): bound smaller-grid probe memoization (morluto#15168)
* commit 'eb5cd34258f35b7f12602c9fc95c4c9509c7be10': fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136) fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949) fix(macos-pkg): retain cpio hard-link contents (morluto#15157) fix(artifacts): report macOS package bundle release versions (morluto#14860)
* commit 'c86e86d697cc00dd00367ee2a4e726d4552e637e': fix(artifacts): retain stored files in Godot PCK patches (morluto#15180) fix(setup): do not persist versioned launcher paths (morluto#15123) fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136) fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949) fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
* commit '91380cff6a6ce8b82b042ceb4e5013f3cc87a9d0': fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169) fix(artifacts): retain stored files in Godot PCK patches (morluto#15180) fix(setup): do not persist versioned launcher paths (morluto#15123) fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136) fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949) fix(macos-pkg): retain cpio hard-link contents (morluto#15157) fix(artifacts): report macOS package bundle release versions (morluto#14860) test(asar): verify cleanup on the original file handle (morluto#15155) fix(ubi): bound smaller-grid probe memoization (morluto#15168) fix(artifacts): distinguish content from containment changes (morluto#15165) fix(bflt): retain complete text when data is truncated (morluto#15160) refactor(domain): reuse graph projection and validation helpers (morluto#15173) fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801) test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172)
* commit '91380cff6a6ce8b82b042ceb4e5013f3cc87a9d0': fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169) fix(artifacts): retain stored files in Godot PCK patches (morluto#15180) fix(setup): do not persist versioned launcher paths (morluto#15123) fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136) fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949) fix(macos-pkg): retain cpio hard-link contents (morluto#15157) fix(artifacts): report macOS package bundle release versions (morluto#14860) test(asar): verify cleanup on the original file handle (morluto#15155)
* commit '6053481d47c518af7de8e6a88a3579f1f95e7851': fix(nds): bind file names to disjoint FNT subtables (morluto#15178) fix(glb): preserve JSON chunk read failures (morluto#15181) fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169) fix(artifacts): retain stored files in Godot PCK patches (morluto#15180) fix(setup): do not persist versioned launcher paths (morluto#15123) fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136) fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949) fix(macos-pkg): retain cpio hard-link contents (morluto#15157) fix(artifacts): report macOS package bundle release versions (morluto#14860)
* commit '5c3c1edd72453746266691deca2c7355a8df9b0d': (623 commits) fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182) perf(n64): stream ROM byte-order normalization (morluto#15179) fix(oci)!: keep unobserved directory identity unknown (morluto#15164) fix(nds): bind file names to disjoint FNT subtables (morluto#15178) fix(glb): preserve JSON chunk read failures (morluto#15181) fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169) fix(artifacts): retain stored files in Godot PCK patches (morluto#15180) fix(setup): do not persist versioned launcher paths (morluto#15123) fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136) fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949) fix(macos-pkg): retain cpio hard-link contents (morluto#15157) fix(artifacts): report macOS package bundle release versions (morluto#14860) test(asar): verify cleanup on the original file handle (morluto#15155) fix(ubi): bound smaller-grid probe memoization (morluto#15168) fix(artifacts): distinguish content from containment changes (morluto#15165) fix(bflt): retain complete text when data is truncated (morluto#15160) refactor(domain): reuse graph projection and validation helpers (morluto#15173) fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801) test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172) test(beam): reuse the CLI Evidence reader (morluto#15171) ... # Conflicts: # src/cli/cliCommandRegistrations.ts
* commit '31cec30f51fb59b28a1849a67d09ab79b1c40094': (803 commits) fix(android): declare Android mapping and JNI fixed allowances (morluto#15183) fix(artifacts): retain deep comparison source chains (morluto#15191) perf(evidence): bound link inspection frontier by records (morluto#15189) perf(evidence): retain snapshots across duplicate imports (morluto#15186) fix(nro): exclude ASET header bytes from asset ranges (morluto#15185) fix(bflt): reject relocation tables overlapping image segments (morluto#15188) docs(artifacts): document Kubernetes audit log inventory (morluto#15187) fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182) perf(n64): stream ROM byte-order normalization (morluto#15179) fix(oci)!: keep unobserved directory identity unknown (morluto#15164) fix(nds): bind file names to disjoint FNT subtables (morluto#15178) fix(glb): preserve JSON chunk read failures (morluto#15181) fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169) fix(artifacts): retain stored files in Godot PCK patches (morluto#15180) fix(setup): do not persist versioned launcher paths (morluto#15123) fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136) fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949) fix(macos-pkg): retain cpio hard-link contents (morluto#15157) fix(artifacts): report macOS package bundle release versions (morluto#14860) test(asar): verify cleanup on the original file handle (morluto#15155) ...
* commit '31cec30f51fb59b28a1849a67d09ab79b1c40094': (803 commits) fix(android): declare Android mapping and JNI fixed allowances (morluto#15183) fix(artifacts): retain deep comparison source chains (morluto#15191) perf(evidence): bound link inspection frontier by records (morluto#15189) perf(evidence): retain snapshots across duplicate imports (morluto#15186) fix(nro): exclude ASET header bytes from asset ranges (morluto#15185) fix(bflt): reject relocation tables overlapping image segments (morluto#15188) docs(artifacts): document Kubernetes audit log inventory (morluto#15187) fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182) perf(n64): stream ROM byte-order normalization (morluto#15179) fix(oci)!: keep unobserved directory identity unknown (morluto#15164) fix(nds): bind file names to disjoint FNT subtables (morluto#15178) fix(glb): preserve JSON chunk read failures (morluto#15181) fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169) fix(artifacts): retain stored files in Godot PCK patches (morluto#15180) fix(setup): do not persist versioned launcher paths (morluto#15123) fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136) fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949) fix(macos-pkg): retain cpio hard-link contents (morluto#15157) fix(artifacts): report macOS package bundle release versions (morluto#14860) test(asar): verify cleanup on the original file handle (morluto#15155) ...
Summary
Refs #14234.
Classify the four remaining untyped resource-constraint refusals in
src/application/JsonInputFile.tsandsrc/application/JsonAuthenticationHeadroom.ts:JsonInputFile.ts(admitJsonAssemblyandrequireStringAssemblyHeadroom) withmeasuredExhaustion: truewhile keepingJSON_INPUT_RESOURCE_REMEDIATION.JsonInputFile.ts's streamed single-scalarconstants.MAX_STRING_LENGTHrefusal andJsonAuthenticationHeadroom.ts'sserializedCodeUnitLimitsingle-string serialization refusal to registeredfixedAllowanceOptions(...)ceilings (representationclass inscripts/verify/fixed-ceiling-registry.json).scripts/verify/untyped-budget-refusal-baseline.jsonby 4 sites, removing bothsrc/application/JsonInputFile.tsandsrc/application/JsonAuthenticationHeadroom.tswithout adding anypendingresource-policy entries.Problem and expected behavior
scripts/verify/untyped-budget-refusal-baseline.jsonlisted 3 untyped authored-only refusals insrc/application/JsonInputFile.tsand 1 insrc/application/JsonAuthenticationHeadroom.ts:admitJsonAssemblyandrequireStringAssemblyHeadroominJsonInputFile.tsrefuse against livegetHeapStatistics().total_available_sizewithoutmeasuredExhaustion: true.jsonReadFailureinJsonInputFile.tscatches hostInvalid string length/ERR_STRING_TOO_LONG(constants.MAX_STRING_LENGTH) and carried only prose recovery withoutdetails.refusal.requireAuthenticationHeadroominJsonAuthenticationHeadroom.tschecksserializedCodeUnits > options.serializedCodeUnitLimit(used by callers to guardbufferConstants.MAX_STRING_LENGTHbeforeJSON.stringify) and carried only prose recovery withoutdetails.refusal.Expected behavior (#14234): observed runtime heap exhaustion sets
measuredExhaustion: true, and JavaScript runtime single-string representation limits setfixedAllowanceOptions(...)so callers receive structureddetails.refusal(kind: "fixed_ceiling",allowance,allowance_kind,limit,unit,narrowing).Change and scope
measuredExhaustion: truetoadmitJsonAssemblyandrequireStringAssemblyHeadroominsrc/application/JsonInputFile.ts.jsonReadFailureinsrc/application/JsonInputFile.tstofixedAllowanceOptions("The JavaScript runtime single-string length limit", "parser", { limit: constants.MAX_STRING_LENGTH, unit: "code_units", narrowing: ... }).serializedCodeUnitLimitbranch insrc/application/JsonAuthenticationHeadroom.tstofixedAllowanceOptions("The single-string JSON serialization limit", "report", { limit: options.serializedCodeUnitLimit, unit: "code_units", narrowing: "Reduce the selected facts before serialization." })."class": "representation"inscripts/verify/fixed-ceiling-registry.jsonand updatescripts/verify/untyped-budget-refusal-baseline.jsonwithnode scripts/verify/fixed-ceilings.mjs --shrink-baselines.Contract and boundary impact
src/application/JsonInputFile.tsandsrc/application/JsonAuthenticationHeadroom.ts; projected throughanalysisErrorRefusal/projectAnalysisError.details.refusal(kind: "fixed_ceiling") andretryable: false, while heap-headroom refusals preserveJSON_INPUT_RESOURCE_REMEDIATIONwithout projecting a false fixed ceiling.JsonInputFile.tsare untouched.docs/public/product-catalog.json), package, or installation impact: none.Expected effects:
Evidence and regression coverage
src/application/JsonAuthenticationHeadroom.test.ts— assertsfixedAllowancefacts (name,kind: "report",limit,unit: "code_units",narrowing) onserializedCodeUnitLimitrefusal.src/application/JsonInputFileRefusal.test.ts— verifiesmeasuredExhaustion: true(and absence ofdetails.refusal) on container-assembly and long-scalar heap-headroom refusals, and verifiesdetails.refusal(kind: "fixed_ceiling",allowance: "The JavaScript runtime single-string length limit",limit: constants.MAX_STRING_LENGTH,unit: "code_units") when streamed decoding hitsInvalid string length.node scripts/verify/fixed-ceilings.mjs --shrink-baselinesdropssrc/application/JsonAuthenticationHeadroom.ts(1) andsrc/application/JsonInputFile.ts(3) fromscripts/verify/untyped-budget-refusal-baseline.json(57 -> 53 authored-only refusals, 32 pending unchanged).details.refusalon single-string JSON ceiling errors now includes{ kind: "fixed_ceiling", operation, allowance, allowance_kind, limit, unit, narrowing }.For evidence-bearing changes:
Validation performed
node scripts/verify/fixed-ceilings.mjs --shrink-baselines— passed (Fixed ceilings: 75 declarations registered; 32 pending a control. Authored-only refusals: 53.)npx oxfmt --check .— passed (All matched files use the correct format.)npx tsc --noEmit— passed (0 errors)node scripts/verify/architecture-guards.mjs— passed (Architecture guards passed across 3309 source files.)npm run verify:module-boundaries— passed (Checked resolved module boundaries in 5123 source files.)npx vitest run src/application/JsonInputFileRefusal.test.ts src/application/JsonAuthenticationHeadroom.test.ts tests/evaluation/fixedCeilingGuard.test.ts tests/evaluation/typedResourceRefusalRule.test.ts tests/process-global/managedBundleReadGuards.test.ts— passed (5 files, 39 tests)Compatibility, safety, and release
reported_limitsfields and heap-headroom remediation prose are unchanged).Author readiness
Human owner: @liziye627-design
Author checklist (completed by the PR author before requesting review)
type(scope): outcome.REA_runtime setting with a default, floor, and maximum, unless a fixed ceiling has a stated reason. See Adding a runtime setting.