Skip to content

docs(agents): refresh the stale declared≠enforced example in Prime Directive #10#3105

Merged
os-zhuang merged 2 commits into
mainfrom
claude/heuristic-germain-67e905
Jul 17, 2026
Merged

docs(agents): refresh the stale declared≠enforced example in Prime Directive #10#3105
os-zhuang merged 2 commits into
mainfrom
claude/heuristic-germain-67e905

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What

Prime Directive #10 in AGENTS.md illustrates "never advertise a capability the runtime doesn't deliver" with a validation-rule example that has gone stale:

the spec declares 9 validation-rule types but the write-path validator enforces only 3 (state_machine/script/cross_field); the other 6 are tracked in #1475 rather than demoed in the showcase

#1475 is closed and that 9-vs-3 split no longer exists. Verified against the tree today:

then (as the example claims) now (verified)
ValidationRuleSchema declares 9 types 6script/state_machine/format/cross_field/json_schema/conditional
rule-validator.ts switch handles 3 types all 6, with real handlers (no stub cases)

Diffing #1475's list of 6 unenforced types (unique/format/json_schema/async/custom/conditional) against the 6 that survive shows how it was resolved: unique/async/custom were trimmed (they'd need I/O or a handler model — uniqueness went to a DB index), and format/json_schema/conditional got real enforcement.

The example is still true — one layer down

Adversarial verification of my own first draft caught it saying "the runtime validator enforces all 6." That sentence is itself the failure mode this directive prohibits.

evaluateValidationRules() has exactly two call sites: engine.ts:2265 (insert) and engine.ts:2440 (single-id update). The options.multidriver.updateMany branch (engine.ts:2442-2487) never calls it. On a bulk update all 6 rule types are silent no-ops — along with field-level requiredWhen and per-option visibleWhen authorization, which live inside the same evaluator. The guard warning at engine.ts:2449 is gated on needsPriorRecord(), which returns false for format/json_schema — so those two fail with no signal at all.

Filed as #3106 (bug+security) rather than fixed here, per this very directive. The wording now says what's true and carries the transferable lesson: a case label is not enforcement — check the call site.

Why past tense rather than a fresh example

A stale example is itself the thing the directive warns about — docs advertising a state the code no longer has. Swapping in a different live gap just restarts the same clock. The closed-loop account can't drift, and it happens to demonstrate all three verbs the directive prescribes — "fix it, trim it, or file an issue" — in one case: filed (#1475) → trimmed (3 types) → implemented (3 types). The live #3106 pointer then keeps the directive honest about the limit of that fix.

Notes

🤖 Generated with Claude Code

…rective #10

The example cited "the spec declares 9 validation-rule types but the
write-path validator enforces only 3" as a live gap. That stopped being
true: #1475 was closed by trimming the never-enforced types
(unique/async/custom) and fixing enforcement for the rest. Today
ValidationRuleSchema declares 6 types (script/state_machine/format/
cross_field/json_schema/conditional) and rule-validator.ts's switch
handles all 6 — declared == enforced.

Rewritten in the past tense so it reads as a closed loop rather than an
open gap. This keeps it serving the principle it illustrates ("never
advertise a capability the runtime doesn't deliver") and in fact
demonstrates all three of its prescribed verbs: filed (#1475), trimmed
(3 types removed), fixed (3 types enforced).

A stale example is itself the failure mode the directive warns about —
documentation advertising a state the code no longer has.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@os-zhuang os-zhuang added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Jul 17, 2026
@vercel

vercel Bot commented Jul 17, 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 Jul 17, 2026 9:33am

Request Review

…rule

Adversarial verification of my own rewrite turned up the irony: "the
runtime validator enforces all 6" is itself advertising a capability the
runtime doesn't fully deliver — exactly what this directive prohibits.

evaluateValidationRules() has two call sites (engine.ts:2265 insert,
engine.ts:2440 single-id update). The options.multi/updateMany branch
never calls it, so on a bulk update all 6 rule types — plus field-level
requiredWhen and per-option visibleWhen authorization, which live inside
the same evaluator — are silent no-ops. The guard warning there is gated
on needsPriorRecord(), which returns false for format/json_schema, so
those two fail with no signal at all.

#1475's 9-vs-3 gap is genuinely closed; the switch does handle all 6.
But "declared == enforced" was true of the switch, not of the system.
Reworded to say what's true, and filed #3106 for the call-site hole
rather than expanding this docs PR into an engine fix (PD #10).

The example now carries the transferable lesson: a case label is not
enforcement — check the call site.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@os-zhuang
os-zhuang merged commit 06d4eed into main Jul 17, 2026
15 checks passed
@os-zhuang
os-zhuang deleted the claude/heuristic-germain-67e905 branch July 17, 2026 09:34
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 skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant