docs(agents): contract-first — fix the metadata, not the runtime (Prime Directive #12)#2424
Merged
Merged
Conversation
… 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codifies the principle behind the AI-flow
create_recordfix as Prime Directive #12.The rule: this is a metadata-driven framework —
packages/specis 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 existingcfg.filter ?? cfg.filters/cfg.objectName ?? cfg.objectfallbacks are debt, not a pattern to copy.Worked example (the origin of this rule): an AI-authored
create_recordusedfieldValues/today()/{{trigger.record.id}}while the executor readsfields/{TODAY()}/{record.id}. Fix = correct the authoring skill + a publish-gate lint that rejects the wrong shape (cloud#688), not acfg.fields ?? cfg.fieldValuesruntime alias (framework#2419, rejected).One of three sibling PRs adding the same principle to the framework / cloud / objectui AGENTS.md.
🤖 Generated with Claude Code