From 34d5bbc810f2860b1627f18185346e87830eef73 Mon Sep 17 00:00:00 2001 From: Ajay Ghanwat Date: Wed, 5 Aug 2026 13:54:23 +0530 Subject: [PATCH] docs: add the missing cast to .input() in the Task 3 plan snippet The builder's .input() did not typecheck as written (TS2345). The phantom __input/__output markers make ProcedureDef invariant, which is exactly why .output() already carried a cast - .input() needed the analogous one and did not have it. Caught by the Task 3 implementer, who also verified via @ts-expect-error that InferProcedureInput/InferProcedureOutput genuinely reject wrong shapes, so the phantom markers are carrying real type information rather than silently widening. Co-Authored-By: Claude Opus 5 --- docs/plans/2026-08-05-inter-app-comms-implementation.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/plans/2026-08-05-inter-app-comms-implementation.md b/docs/plans/2026-08-05-inter-app-comms-implementation.md index 6f12901c..921deeb0 100644 --- a/docs/plans/2026-08-05-inter-app-comms-implementation.md +++ b/docs/plans/2026-08-05-inter-app-comms-implementation.md @@ -561,7 +561,14 @@ export class ProcedureBuilder { } input>(schema: S): ProcedureBuilder, Output> { - return new ProcedureBuilder, Output>({ ...this.def, input: schema }); + // The cast is required for the same reason .output() needs one: the + // phantom __input/__output markers make ProcedureDef invariant, so + // spreading a ProcedureDef into a ProcedureDef, + // Output> is not assignable without it. No runtime effect. + return new ProcedureBuilder, Output>({ + ...this.def, + input: schema, + } as ProcedureDef, Output>); } output(): ProcedureBuilder {