Commit 018c56f
feat(contract)!: drop zod meta-validation, ESM-only build, input-less signals/queries/updates
Wave 1 of the v8 review remediation (spec items 1-6):
- Activity-collision check now allows the same activity definition object to
be referenced from several scopes (reference equality — the flat namespace
stays unambiguous); real collisions (different objects, same name) recommend
hoisting the shared activity to the contract's global "activities" block.
- defineContract rejects a global activity whose name equals a workflow name
(they share the root of the worker implementations map).
- Replaced the zod-based contract meta-validation with a hand-rolled
structural validator over unknown; zod moved from dependencies to
devDependencies (tests still use it as a Standard Schema). The contract
root is now strict: unknown top-level keys are rejected, matching the
strict defaultOptions behavior.
- defineSignal/defineQuery/defineUpdate accept an omitted input: they
materialize an UndefinedInputSchema (Standard Schema whose validated value
is always undefined), so handler inputs infer as undefined without
z.void() ceremony. Definition types keep a required input slot so the
worker and client compile unchanged (their optional-payload surfaces land
in Wave 3).
- Deleted the trivial InferContractWorkflows alias; fixed the stale
"unthrown 4" comment in errors.ts to describe unthrown 5 semantics.
- Dropped the CJS build: ESM-only exports with types conditions (aligned
with packages/testing), removed main/module/types top-level fields.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 710bfca commit 018c56f
10 files changed
Lines changed: 725 additions & 260 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | 26 | | |
30 | 27 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 28 | + | |
| 29 | + | |
39 | 30 | | |
40 | 31 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 32 | + | |
| 33 | + | |
49 | 34 | | |
50 | 35 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 36 | + | |
| 37 | + | |
59 | 38 | | |
60 | 39 | | |
61 | 40 | | |
62 | 41 | | |
63 | | - | |
| 42 | + | |
64 | 43 | | |
65 | | - | |
| 44 | + | |
66 | 45 | | |
67 | 46 | | |
68 | 47 | | |
69 | 48 | | |
70 | 49 | | |
71 | | - | |
72 | | - | |
| 50 | + | |
73 | 51 | | |
74 | 52 | | |
75 | 53 | | |
| |||
84 | 62 | | |
85 | 63 | | |
86 | 64 | | |
87 | | - | |
| 65 | + | |
| 66 | + | |
88 | 67 | | |
89 | 68 | | |
90 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
5 | 12 | | |
6 | 13 | | |
7 | 14 | | |
| |||
404 | 411 | | |
405 | 412 | | |
406 | 413 | | |
407 | | - | |
| 414 | + | |
408 | 415 | | |
409 | 416 | | |
410 | 417 | | |
| |||
436 | 443 | | |
437 | 444 | | |
438 | 445 | | |
439 | | - | |
| 446 | + | |
440 | 447 | | |
441 | 448 | | |
442 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
443 | 569 | | |
444 | 570 | | |
445 | 571 | | |
| |||
470 | 596 | | |
471 | 597 | | |
472 | 598 | | |
473 | | - | |
| 599 | + | |
474 | 600 | | |
475 | 601 | | |
476 | 602 | | |
| |||
597 | 723 | | |
598 | 724 | | |
599 | 725 | | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
600 | 763 | | |
601 | 764 | | |
602 | 765 | | |
| |||
0 commit comments