Repository navigation
refactor(cli): project JSON-text options and pwntools inspectors from contracts - #10589
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
Contributor
[Medium impact] The PR appears safe to merge; no actionable regression was found. SummaryAdds JSON-text options to
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
Contract["Contract field schema"] --> Projection["describeContractCommand"]
Argv["JSON-text option"] --> Decode["safeParseJson"]
Projection --> Check["Contract field checks"]
Decode --> Check
Check --> Map["toContractInput"]
Map --> Inspect["inspectAndClose"]
Inspect --> Evidence["Evidence with caller path"]
Reviews (2) · Last reviewed commit: "refactor(cli): project JSON-text options..." · Reviewed by Greptile |
19 tasks
morluto
force-pushed
the
refactor/cli-contract-artifact-inspectors
branch
from
November 14, 2026 20:33
377a0ba to
8c0e8ab
Compare
morluto
force-pushed
the
refactor/cli-contract-json-options
branch
from
November 14, 2026 20:33
07d25a2 to
793dfbb
Compare
morluto
force-pushed
the
refactor/cli-contract-artifact-inspectors
branch
from
November 14, 2026 20:33
8c0e8ab to
377a0ba
Compare
morluto
requested review from
N0zoM1z0,
gensokyo-dev and
kaoru0822-kitauji
as code owners
November 14, 2026 20:33
morluto
force-pushed
the
refactor/cli-contract-artifact-inspectors
branch
from
November 14, 2026 20:33
377a0ba to
8c0e8ab
Compare
morluto
changed the base branch from
refactor/cli-contract-artifact-inspectors
to
main
November 15, 2026 01:15
… contracts Add a jsonText declaration to the contract command description: a structured contract field is taken as one JSON text argument, decoded at argv parsing, and admitted by the contract field's own schema, so --schema advertises the contract's structure. This generalizes the per-command producerLimitsOption wiring. Migrate inspect-binary-layout and inspect-recorded-crash (producer_limits as JSON text; recorded-crash keeps --debugger-context for include_debugger_context) and delete their hand-written options and input spreads. The parity guard probes JSON-text fields with valid, malformed and contract-refused JSON.
morluto
force-pushed
the
refactor/cli-contract-json-options
branch
from
November 15, 2026 01:15
793dfbb to
1a19726
Compare
19 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
Third slice of plan W1, stacked on #10576 (base
refactor/cli-contract-artifact-inspectors; retarget after #10571 and #10576 merge). Refs #10583 (the projection stays framework-neutral).It adds a JSON-text option projection to the contract command description and migrates
inspect-binary-layoutandinspect-recorded-crash, deleting their hand-written options and input spreads.Problem and expected behavior
Structured contract fields such as
producer_limitsreach the CLI as one JSON text argument. Each command wired that by hand throughproducerLimitsOption(<schema copy>)and then mapped the decoded value back by hand. The derived projection must keep:--producer-limits, and--debugger-contextforinclude_debugger_context;producer-limits must be a JSON object.Change and scope
contractCliDescription.ts: new projection listjsonText: [field]. The parameter admits text, decodes it withsafeParseJson, and pipes the value into the contract field's own schema, so--schemaadvertises the contract's structure. Parameters gain ajsonTextfact for renderers.inspect-binary-layout:detailis omitted with a reason, as before.inspect-recorded-crash:--debugger-contextis a rename ofinclude_debugger_context.inspectAndClose+withEvidenceCallerInputPathhandler.{"input_bytes":0}, unknown keys,[],null).inspect-rust-binary,inspect-python-pyc,inspect-erlang-beamandinspect-model-artifact. Their--viewis a delivery selection decoded at run time with command-specific messages, and it is validated with per-operation delivery schemas and view kinds (rust also derives thedetaildefault fromview). That needs a view-delivery projection, not just JSON text.Contract and boundary impact
describeContractCommand).--schema: semantically identical for both commands.--producer-limitsmoved after the timeout option (contract order).inspectAndClose).Expected effects:
(No effect changes: the migrated commands keep their existing behavior.)
Evidence and regression coverage
--schema --format jsonand--helpbefore and after.--schemais semantically equal for both commands; help differs only in option order.Validation performed
npm run typecheck: passed.npm run check:fast: exit 0.npm run knip: no findings.npm run test:focused --7 files: 7 passed; 228 tests passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.