You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: refine "when to escalate to subtype" with two real-world triggers
While doing the wizardsofodd toolcall refactor, found two cases that justify
subtype escalation beyond just "different runtime node class":
1. **Existing subtype's required attrs don't apply** — template.output's
@payloadRef AND @textRef are both required (renderable-template
invariants). LLM tool-call envelopes need @toolname but have no text
body; @textRef doesn't apply. Extending template.output with @toolname
would force every toolcall to declare a stub @textRef. New subtype
(template.toolcall, no @textRef required) is the honest fit.
2. **Load-time error detection when provider is missing** — the loader
treats undeclared @-attrs as OPEN POLICY (silently accepted, no error
or warning per attr-schema-validate.ts:15). Only subtype names are
validated. So if a custom generator only does something useful when
metadata is present, subtype registration is the only mechanism that
catches "consumer forgot to wire the provider" at load time via
ERR_UNKNOWN_SUBTYPE. With pure attr-extension, missing providers
silently no-op.
Also rewrote the "extend an existing subtype" default example to use
@AuditTrail (a real cross-cutting concern) instead of @toolname (which
turned out NOT to fit the extend pattern). Notes the extend → escalate
transition explicitly.
These were surfaced during real refactor work. No API change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments