Repository navigation
refactor(cli): project observe-native-calls onto a session target and its contract document - #10700
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. |
[Medium impact] The reviewed changes appear safe to merge. SummaryMoves more CLI commands onto their named contracts and shared command builders.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["observe-native-calls path inputJson"] --> B["Decode JSON with the command signal"]
B --> C{"Contract accepts the document?"}
C -->|No|D["Return an input error"]
C -->|Yes|E["Run the provider on the caller's path"]
E --> F["Await provider cleanup"]
F --> G["Return the result"]
Reviews (4) · Last reviewed commit: "refactor(cli): project inspect-artifact ..." · Reviewed by Greptile |
769ba82 to
44c8628
Compare
44c8628 to
b81ed2a
Compare
afb76d7 to
63990e9
Compare
b81ed2a to
e8b0a9e
Compare
63990e9 to
fb146a1
Compare
e6f1711 to
0e105c7
Compare
fb146a1 to
cdb44f0
Compare
0e105c7 to
bd32c3d
Compare
cdb44f0 to
dfd85dd
Compare
00fc8a2 to
eefe85d
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
eefe85d to
58a3b8b
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
… its contract document
…ents with delivery options (#10711) * refactor(cli): carry document command delivery as options and project endpoint and browser scenario commands A JSON-document projection can now take the contract's detail and view fields as --detail, --evidence_output and --view beside the document. The document refuses those fields with the option to use, and the delivery is admitted by the contract's own view schema before the document is read. compare-static-and-observed-endpoints, capture-browser-scenario and validate-browser-scenario now register from their contracts; validation projects the capture contract without detail. * fix(cli): admit the endpoint comparison document before reading its Evidence bundle The document command context carries the document's transport frame, so a handler that reads an Evidence bundle first can refuse a malformed document beforehand, as the hand-written command did. * refactor(cli): pass only object documents to the document field refusal
…n_binary target options (#10722) * refactor(cli): project inspect-artifact and extract-artifact with open_binary target options A declared session target can now take fields of the contract an MCP client opens the target with as options. They are admitted by that contract, with the target as its path, before the target is opened, and the projection can narrow an enum to the values the command supports. inspect-artifact and extract-artifact are derived from their contracts with open_binary's format and ESP flash fields. MCP open_binary and the CLI share one mapping from those fields to the target selection. extract-artifact now runs under the command's cancellation signal. * fix(cli): read open_binary from its session contract so startup stays lazy * build(lint): refuse value imports of the complete tool catalog in CLI startup modules
6047cc5 to
d270416
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Next slice of plan W1, stacked on #10697 (base
refactor/cli-contract-reconstruction-documents; retarget as the lower PRs merge). Refs #10583.The contract-document projection gains a session target: the
pathpositional before the JSON document.observe-native-callsis derived from its contract with it.Problem and expected behavior
observe-native-calls <path> <input-json>was hand-written:z.record(...).parse.runProviderAnalysiswithout the command's signal.The JSON-document projection (#10668) could not express a target the CLI opens, so this command stayed outside it.
The expected behavior is unchanged: the same positionals, the same refusals before the target is opened, and the same provider call.
Change and scope
contractCliDescription.ts:CliDocumentProjection.sessionTargetadds thepathpositional ahead of the document key. A CLI-only option cannot take either key.contractCommand.ts:ContractDocumentContext.sessionTargetcarries the target as the caller spelled it, as the flag projection does.nativeCallCommands.ts: registered throughregisterContractDocumentCommandwithNATIVE_TOOL_CONTRACTS'observe_native_calls. The handler admits the document with the contract's input schema before opening the target. It then runs the operation on the spelled target with the command's cancellation signal.compare-static-and-observed-endpoints,capture-browser-scenario,validate-browser-scenario). They take contract fields as CLI flags beside the document.Contract and boundary impact
path,inputJson).--schemaadvertises the contract input, which is the same schema object as before.observe-native-callsnow runs underwithCommandCancellation, and the provider receives the command's signal. This matches the other session-target commands.Expected effects (unchanged from the existing command):
Evidence and regression coverage
jsonInputStatus.test.ts:observe-native-callsrefuses an invalid document (breakpoints: "main") withoperation: observe_native_calls, before opening a missing target.cliContractCommandParity.test.ts: document commands may declare a session target positional before the document;observe-native-callsis listed.localPathAdmissionCli.test.ts(unchanged) still covers the emptypathrefusal.Validation performed
npm run typecheck: passed.npm run test:focused -- tests/boundary/cli/cliContractCommandParity.test.ts tests/boundary/cli/jsonInputSchema.test.ts tests/acceptance/localPathAdmissionCli.test.ts tests/boundary/cli/jsonInputStatus.test.ts: 324 passed, before the new status case.npm run test:focused -- tests/boundary/cli/jsonInputStatus.test.ts: 36 passed, with the new case.--no-verify. Typecheck was run manually; lint-staged ran oxlint and oxfmt on commit.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.