Commit d5c75e2
authored
#4087 retired a `/storage` bridge that called `upload(key, data, options?)` as
`upload(file, { request })`. Sweeping the other dispatcher domains against
`packages/spec/src/contracts/*` found the mirror-image gap in three places: the
call site and the implementation agreed, and the CONTRACT was the thing nobody
had written. Each was worked around with `typeof x.foo === 'function'` — a
duck-type is what "the contract does not cover this" looks like when nobody
fixes the contract. Fixed at the contract (Prime Directive #12).
Contracts:
- `INotificationService` += `listInbox?` / `markRead?` / `markAllRead?` and
`InboxQuery` / `InboxNotification` / `InboxListResult` / `MarkReadResult`.
Three SDK-expressed routes rested on them, implemented by service-messaging,
while the contract described only `send`. The dev stub implements exactly
`send`/`sendBatch` BECAUSE it followed the contract — so the one
implementation written to spec was the one the domain had to duck-type past.
Optional, because a send-only provider (SMTP, Twilio, a Slack webhook) fills
the slot legitimately without an inbox — a fact `handlerReady` cannot express,
since the slot is serveable and only this capability is absent.
- `II18nService` += `getFieldLabels?`. Both serving surfaces probed for it and
both documented it as "optional on II18nService", which was untrue until now.
- `IAutomationService` += `getFlowRuntimeStates?` and `FlowRuntimeState`. The
dispatcher's inline cast declared `{ name, enabled, bound }` — a third copy of
the shape, narrower than the engine returns, dropping the `status` /
`triggerType` / `object` fields that say WHY a flow is unbound.
Two runtime defects fell out of the same sweep, both on the legacy trigger
route — the one `client.automation.trigger()` calls:
- It passed the raw HTTP body to `execute(name, body)`, so the
`{recordId, objectName, params}` translation never ran AND no caller identity
was forwarded. A flow's default `runAs` is `'user'`, and a `runAs:'user'` run
whose trigger resolved no user has its data operations REFUSED (#3760,
fail-closed) — so that SDK method could not run a data-touching flow at all,
while `POST /:name/trigger` could. service-automation's own comment claims
"most trigger surfaces (REST action / trigger endpoint) already resolve the
full envelope"; for this endpoint it was not. Both routes share one context
builder now.
- The `automationService.trigger(...)` probe it tried first is deleted. Nothing
in the repo has ever implemented `trigger` on the automation slot and the
contract never declared it, so the branch was unreachable everywhere and its
`execute` "fallback" was the route. Declaring `trigger?` would have blessed a
second name for `execute`.
Call sites read the contract now instead of `as any` / inline re-declarations,
so the next deviation is a compile error. service-i18n's probe loses two casts
with it — one through `Record<string, unknown>`, one restating the signature;
its build failed the moment the method became declared, which is the point.
The test that pinned the dead `trigger` branch asserted `trigger` was called
with three arguments no implementation takes — the same shape that kept #4087
green for months. It now pins the contract method and the translated context.
Not included: `getConnectorDescriptors`, the fourth gap in #4127. It needs the
`ConnectorDescriptor` / `ConnectorActionDescriptor` / `ConnectorOrigin` /
`ConnectorState` cluster promoted from service-automation into `packages/spec`,
which is its own change.
Refs #4127
1 parent 8c711fb commit d5c75e2
12 files changed
Lines changed: 566 additions & 76 deletions
File tree
- .changeset
- packages
- runtime/src
- domains
- services/service-i18n/src
- spec
- src/contracts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 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 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
529 | 622 | | |
530 | 623 | | |
531 | 624 | | |
| |||
0 commit comments