Skip to content

docs(agents): contract-first — fix the metadata, not the runtime (Prime Directive #12)#2424

Merged
os-zhuang merged 1 commit into
mainfrom
docs/agents-contract-first
Jun 28, 2026
Merged

docs(agents): contract-first — fix the metadata, not the runtime (Prime Directive #12)#2424
os-zhuang merged 1 commit into
mainfrom
docs/agents-contract-first

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Codifies the principle behind the AI-flow create_record fix as Prime Directive #12.

The rule: this is a metadata-driven framework — packages/spec is the one contract between metadata producers and the runtime/renderers that consume it. When metadata "doesn't work," ask first whether it's spec-compliant and whether the fix is the long-term-correct direction. If the metadata is wrong, fix the producer and reject it at authoring/publish — do not add a lenient alias / ?? fallback in a consumer (node executor, REST layer, renderer) to tolerate off-spec input. A tolerant fallback fossilizes the wrong convention into a second de-facto contract, dilutes the spec, and hides the producer's bug. We own both ends, so Postel's law does not apply. Change the spec only when it's genuinely wrong — deliberately, with migration. The existing cfg.filter ?? cfg.filters / cfg.objectName ?? cfg.object fallbacks are debt, not a pattern to copy.

Worked example (the origin of this rule): an AI-authored create_record used fieldValues/today()/{{trigger.record.id}} while the executor reads fields/{TODAY()}/{record.id}. Fix = correct the authoring skill + a publish-gate lint that rejects the wrong shape (cloud#688), not a cfg.fields ?? cfg.fieldValues runtime alias (framework#2419, rejected).

One of three sibling PRs adding the same principle to the framework / cloud / objectui AGENTS.md.

🤖 Generated with Claude Code

… not the runtime)

Codify the rule that governed the AI-flow create_record fix: when metadata
doesn't work, first ask if it's spec-compliant and whether the fix is the
long-term-correct direction. Fix the producer + reject off-spec input at
authoring/publish; never add a lenient `??` alias in a consumer (executor /
renderer) to tolerate non-compliant metadata. `packages/spec` stays the single
strict contract; change the spec only when it is genuinely wrong. The existing
`cfg.filter ?? cfg.filters` style fallbacks are debt, not a pattern to extend.

Same principle added to the cloud and objectui AGENTS.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 28, 2026 10:58am

Request Review

@github-actions github-actions Bot added size/xs documentation Improvements or additions to documentation labels Jun 28, 2026
@os-zhuang
os-zhuang merged commit 19c25d4 into main Jun 28, 2026
15 checks passed
@os-zhuang
os-zhuang deleted the docs/agents-contract-first branch June 28, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant