Repository navigation
Commit fccbd9d
feat(spec, plugin-email): IEmailService.isConfigured() answers whether mail is delivered (#25125)
Closes #25065
Clause-②: yes (widening: an optional member on `IEmailService`)
Metadata-protocol: none
## What
- **Contract** (`packages/spec/src/contracts/email-service.ts`):
`IEmailService` gains one OPTIONAL member, `isConfigured?(): boolean`,
with the same name and shape as `ISmsService.isConfigured()`. Its TSDoc
says: `true` means the active transport hands mail to a real delivery
provider; `false` means no mail leaves the process (sends still resolve
and audit); a `log` transport is never delivering, in any environment;
the answer is read at call time and follows runtime transport swaps;
consumers treat an ABSENT member as unknown and must never read it as
delivering.
- **Implementation**
(`packages/plugins/plugin-email/src/email-service.ts`):
`EmailService.isConfigured()` returns `false` while the active transport
is the `LogTransport` and `true` for any other transport. It reads the
live transport on every call, so it follows `setTransport` swaps,
including the ones the plugin makes from the `mail` settings namespace.
- **Changeset**: `@objectstack/spec` + `@objectstack/plugin-email` at
`patch`. Under ruling A (#25105, landed in #25114) the level follows the
metadata protocol only. `IEmailService` is a service contract, not an
authorable key, value or metadata type, so the kind is `none` and the
level is `patch`. The `Clause-②` widening line stays as the claim states
it.
- **Out of this PR**: no consumer reads the member yet. The sign-up path
in #25060 and the `plugin-auth` readers (`hasEmailTransport()` /
`isEmailServiceAvailable()`) are out of this claim. #25060 remains open.
## Tests (final head `1fe7845d18`)
- `pnpm --filter @objectstack/plugin-email test`: 36 files / 649 tests
passed. `typecheck` (tsc + test typecheck) exit 0.
- New plugin-email cases: log transport gives false; live transport
gives true; runtime swap log to live to log; registered plugin service
on the default boot gives false; saving SMTP settings turns it true;
swapping SMTP to Resend stays true.
- Spec: `src/contracts/email-service.test.ts` passes 6/6. The type test
pins that the member is optional (an implementation without it stays
assignable), and uses `@ts-expect-error` on a non-boolean answer.
`typecheck`, including `check:test-typecheck`, exits 0, so that
directive is compiled. `test:repo`: 72 files / 1237 tests passed.
- `pnpm --filter @objectstack/spec check:generated`: all 14 generated
artifacts up to date against a freshly built dist. No baseline moved, so
the api-surface snapshot does not record interface members.
- Ablation: `scripts/ablation-replace.mjs` on the `isConfigured` body.
The subject is imported from `src` through relative paths, so there is
no dist leg. Leg 1 (`return true`) and leg 2 (`return false`) each ran
with the marker on disk (1 hit, anchor 0 hits). Each turned 4 of the new
tests red (2 files failed, 4 failed / 50 passed). Both restores were
verified: blob equals the HEAD blob `279f67336b27` and `git diff HEAD`
is empty.
- `node scripts/pm/dispatch-gates.mjs --commands` (90 commands, plus the
5 roster families under touched directories) all exited 0. The changeset
gates were re-run after the regrade commit.
## Acceptance notes
- The CI-only families that `dispatch-gates` names (shard attestations,
type-check workspace lanes, Build Core) were not measured locally. CI
runs them.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5e9b100 commit fccbd9d
6 files changed
Lines changed: 145 additions & 1 deletion
File tree
- .changeset
- packages
- plugins/plugin-email/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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
68 | 91 | | |
69 | 92 | | |
70 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
657 | 668 | | |
658 | 669 | | |
659 | 670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
339 | 366 | | |
0 commit comments