Repository navigation
docs(spec): IEmailService Errors lists name TEMPLATE_INVALID - #26911
Conversation
sendTemplate and renderTemplate already refuse a stored template whose hole the authoring rules refuse; the contract now lists that code. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziYqBAqnKprHc4h25c
📓 Docs Drift CheckThis PR changes 1 package(s): 3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 147 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7b7b9f509a12674ad3fc6417e1f83efbc92105dd && git checkout 7b7b9f509a12674ad3fc6417e1f83efbc92105dd
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 94e29cd11f5d959a4847369837ce719879497b15 6978e58122bd4ecc32b7d5aeab155c5a8f3bcbc0 && git checkout -B drift-repro 94e29cd11f5d959a4847369837ce719879497b15 && git merge --no-ff 6978e58122bd4ecc32b7d5aeab155c5a8f3bcbc0
node scripts/docs-audit/affected-docs.mjs --json 94e29cd11f5d959a4847369837ce719879497b15
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziYqBAqnKprHc4h25c
Contract reviewServed-tier: Read on this head: the PR body (patched by the seat), its 2 commits, its file list, the one PR comment (docs-drift 6453226337), the net diff against main; card #26803 body and all four comments (6448509653, 6452785442, 6453226732, 6453251122); PR #26799 body and file list; the cited code on ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
维护者速读 (席位终稿)
席位意见:接受。契约复核 PASS(6454314274),每一句新增文字都对照了 main 上的代码。 席位核对 · ACCEPT ·
|
Requested by Yibo Wang · project thread
Fixes #26803
维护者速读
IEmailService契约里sendTemplate和renderTemplate的错误清单补上TEMPLATE_INVALID,只改注释,不改类型或 schema。TEMPLATE_INVALID,但契约没写,渠道或应用作者读契约时不知道这是一个永久失败。packages/spec/src/contracts/email-service.ts(两段新增的 Errors 条目)。git grep -c TEMPLATE_INVALID -- packages/spec/src/contracts/email-service.ts,预期 4(每个清单两处)。Clause-②: no
Metadata-protocol: none
Skills-docs: no skill lists these codes;
content/docs/kernel/runtime-services/email-service.mdx(Typed Error Codes) updated in this PR;content/docs/automation/email-templates.mdxalready names it.What changes
packages/spec/src/contracts/email-service.ts: thesendTemplateandrenderTemplateErrors lists nameTEMPLATE_INVALID, worded from what@objectstack/plugin-emaildoes: a stored template with a hole the authoring rules refuse (ruleemail-template-hole-grammar: a second formatter, or acurrencyargument that is not a literal ISO 4217 code) is refused at render withTEMPLATE_INVALID: email template NAME (locale=LOCALE): HOLE_AND_RULE, and is permanent until the template is re-published.content/docs/kernel/runtime-services/email-service.mdx: Typed Error Codes listsTEMPLATE_INVALID..changeset/26803-email-service-template-invalid.md: patch on@objectstack/spec.Why
The runtime throws this code from both methods since #26799, and
service-messaginggrades it permanent, but the contract a channel or app author reads did not list it.Measured
TEMPLATE_INVALIDonorigin/main6090bb7: thrown bytemplate-engine.tsrender (TEMPLATE_INVALID:+ the grammar's refusal) and re-thrown byEmailService.resolveAndRenderTemplatewith the template name and locale in front; bothsendTemplateandrenderTemplatego through that resolver.TEMPLATE_UNSUPPORTED:EmailServicenever throws it. Only theservice-messagingemail and inbox channels raise it, when the registered email service lackssendTemplate/renderTemplate. So it is not added toIEmailService's lists.error-code-ledger.zod.tsregisters routeerror.codevalues;TEMPLATE_NOT_FOUND,TEMPLATE_INACTIVEandMISSING_VARIABLESare absent from it (0 hits) because they areErrormessage prefixes, not envelope codes. Mirroring that,TEMPLATE_INVALIDis not added, and the ledger and its test are untouched.Acceptance notes
content/docs/kernel/runtime-services/email-service.mdxTyped Error Codes now listsTEMPLATE_INVALIDbeside the three older codes (claim surface amended by the seat, 2026-10-27T20:51Z).Verification
All on head 6978e58 (spec tests on 0ca6a37; the later commit is .mdx only).
Spec tests and typecheck (under os-verify-lock)
pnpm --filter @objectstack/spec test && pnpm --filter @objectstack/spec typecheck: VERDICT command-exit 0. Test Files 736 passed (736); Tests 22050 passed, 1 todo.Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: On 6978e58: 97 derived, 94 exit 0, 3 NOT MEASURED with exit 3 (full-build prerequisite: speccheck:skill-examples,check:dual-build-cjs-loads,check:lean-entry-closure);--ran: 94 run, 3 NOT-MEASURED, 0 UNRUN. Earlier, on 0ca6a37: 73 commands. 71 exit 0.check:doc-formula-expressionsfirst exited 3 (formula not built), then exit 0 after building formula and lint.check:dual-build-cjs-loadsandcheck:lean-entry-closureexit 3 (PREREQUISITE NOT MET, need a full build): NOT MEASURED locally, CI runs them.--ranreconciliation: 73 derived, 71 run, 2 NOT-MEASURED, 0 UNRUN.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufziYqBAqnKprHc4h25c