Skip to content

[Gap]: generated project AGENTS.md never states the --expect-routes counting rule from #290 #481

Closed

Description

@jimhoyd

What you were trying to do

Build the Redirector benchmark task using URLCode; verify with the checks an authoring agent is actually told to run.

Where it broke down

#290 fixed urlcode audit's diagnostics (added declared/generated to counts) and documented the --expect-routes counting rule in docs/READINESS.md ("N is the total configured count: declared routes plus generated site.* routes"). That rule never reached any of the three places an authoring agent is actually pointed at first — all three hand over a pre-computed, already-correct N with no explanation of why it's not just the number of routes: entries:

  1. Generated project AGENTS.md (urlcode init / renderAgentsGuide() in packages/core/src/agents-guide.ts, ## Checks that count as evidence, ~lines 90-98): renders urlcode audit --expect-routes ${routes} with the correct number, then only says "Run all three after every change, updating the route count deliberately." starters/default/AGENTS.md ships the identical static gap (stale --expect-routes 2, same vague prose).
  2. Packaged skill (skills/urlcode/SKILL.md, ## 4. Prove it, lines 112-124): same command, same gap — "Update N deliberately when routes are added or removed" never mentions generated site.* routes count toward N.
  3. MCP get_context (packages/core/src/context.ts:126,236): commands.audit is built from compiled.count / context.project.routes (already includes generated routes), but the returned ProjectContext carries no note explaining that project.routes != routes: entry count.

An agent that reasons from its own declared-route count (rather than blindly copy-pasting the given N) hits route-count-mismatch and has to read the audit failure's counts breakdown to learn the rule — the exact trial-and-error #290 was meant to eliminate, and it happens regardless of which of the three paths the agent used to get started.

Evidence

A/B benchmark run test4 (task: redirector, contract redirector-v8, @jimhoyd/[email protected], Sonnet 5 medium, run 2026-09-22 — after #290/PR #298 shipped). Agent B's filed feedback:

urlcode audit --expect-routes N counts N against the total generated route count (declared routes plus one auto-generated route per site.* convention, e.g. the 404 page), not against the number of entries under routes: in urlcode.yaml. With 5 declared redirect routes plus site.notFound, --expect-routes 5 fails with a route-count-mismatch and --expect-routes 6 is required.

The project's own generated AGENTS.md (work/b-1/AGENTS.md:59) listed urlcode audit --expect-routes 6 verbatim (the correct number), but without the rule stated the agent still tried 5 first based on its own route count.

Suggested improvement

Add one short clause stating the counting rule everywhere N is handed to an agent, e.g.: "N is declared routes plus one per active site.* convention; the audit failure reports declared/generated if you get it wrong."

  • renderAgentsGuide()'s ## Checks that count as evidence section (and starters/default/AGENTS.md).
  • skills/urlcode/SKILL.md ## 4. Prove it section.
  • ProjectContext from get_context: either a one-line note field near project.routes/commands.audit, or fold it into constraints.

Keep each addition to a clause, not a paragraph — AGENTS.md is "under 80 lines by design" and the skill/context payload are similarly budget-conscious.

What was not verified

Single session (n=1), not repeated evidence.

Activity

  1. added
    documentation
    ai-first
    on Sep 22, 2026
  2. added
    important
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-firstdocumentationimportant

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions