You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Narrow Node client result types for closed daemon projections from #1153.
Adds public contracts for wait, prepare, push, and trigger-app-event, wires them into CommandResultMap and MCP output schemas, and tightens JSON payload typing for push/app-event payloads.
Reviewed the narrowing. The typed spine, MCP schemas, and the JsonObject migration all line up cleanly with the projections — push, trigger-app-event, and the toDaemonWaitData path match field-for-field. Two spots where the new contract under-declares what the daemon actually puts on the wire, plus one minor behavior change:
1. PrepareCommandResult omits fields the projection always emits.prepareIosRunnerResponseData spreads ...result (src/daemon/handlers/session.ts:131), and result: PrepareIosRunnerResult carries runner (required — emitted on every success) plus optional cache / artifact / xctestrunPath / recoveryReason / failureReason. None appear in src/contracts/prepare.ts, so the "compact projection" the docstring describes isn't actually compact — runner leaks untyped on every prepare call. Either narrow the projection to explicitly pick the contract fields (so runtime matches the type), or add the ones that are genuinely public to the contract.
2. WaitCommandResult omits selectorChain. The iOS selector fast-path returns data: payload unstripped (src/daemon/selector-runtime.ts:373-376), so a public wait <selector> on iOS emits selectorChain: [...], which isn't in src/contracts/wait.ts. Note the sibling is fast-path strips it via stripSelectorChain (selector-runtime.ts:349) — the wait path looks like it should too. Stripping it there makes runtime match the new contract and fixes a small internal-field leak in one move.
3. (minor) trigger-app-event payload loses read-time validation. Swapping looseObjectField() → jsonSchemaField<JsonObject>(looseObjectSchema()) in src/commands/management/push.ts keeps the same JSON schema but drops the optionalRecord reader, so a non-object payload is no longer rejected at field-read with Expected payload to be an object. — it's now caught later in assertJsonObject with a different message. Functionally still rejected, just a different stage/wording; flagging in case byte-identical errors matter.
Reviewed current head b0c06b1 against #1153 and ADR 0008. The PR moves closed result contracts for wait, prepare, push, and trigger-app-event into public contract modules, wires them into CommandResultMap/client methods and MCP output schemas, and keeps the narrowing limited to daemon projections with focused client/schema/runtime tests. CI is green across 21/21 checks. No actionable blockers found.
New head b940304 arrived after my ready review of b0c06b1, and checks are currently running again. I removed the stale ready-for-human label for now; I will re-review/relabel once the current head is clean.
Preview removed because the pull request was closed.
2026-07-08 16:35 UTC
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
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
Narrow Node client result types for closed daemon projections from #1153.
Adds public contracts for wait, prepare, push, and trigger-app-event, wires them into CommandResultMap and MCP output schemas, and tightens JSON payload typing for push/app-event payloads.
Closes #1153
Validation