Skip to content

[Request]: Reusable request/response blocks across routes (YAML anchors are rejected) #257

Closed

Description

@jimhoyd

Tried: share one request.body block, sandboxReason and response.headers across three routes.
Expected: reuse.
Got: YAML anchors are rejected (documented, and run 2 tripped on it anyway); the blocks are copied verbatim on each route (65 YAML lines in run 1, largely repetition).
Suggestion: a profiles-style reuse mechanism for request, response.headers and route defaults, consistent with existing policy reuse.
Evidence: an A/B benchmark on URLCode 0.4.1 with Sonnet 5 agents building the same Todo app from the repo docs. Run 1 (benchmark Agent B, no authoring skill, no browser check) and run 2 (session "Todo application with URLCode", authoring skill loaded, tightened prompt) hit this independently. n=1 each; single small app, so treat frequency as anecdotal. The Agent A control (no URLCode) needed 2 shell calls and 0 dependencies for the same app.

Activity

  1. added
    enhancement
    on Sep 20, 2026
  2. added
    needs-decision
    ai-first
    on Sep 20, 2026
  3. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Decision: build reusable blocks.

    Shape (from the existing policies.profile pattern): an optional top-level map of named request and response.headers blocks that a route selects by name (use: <name>). YAML anchors, aliases and merge keys stay rejected.

    To settle in the design before building:

    1. Merge rule: a route's own key wins as a whole block, with no deep merge.
    2. Resolution happens at load time, so the route hash, audit and routes output show the resolved result and a reviewer can see what actually applies.
    3. Behavior for an unknown name (fail validation) and for a block that touches reserved headers.
    4. Whether sandboxReason and other route defaults are included, or only request and response.headers first.

    Update the specification, schema (npm run docs:reference) and an executable example in the same PR. Note for the record: the evidence is n=1 per run on one small Todo app, and the project's evidence test would normally wait for more repetition; this is an explicit maintainer decision to proceed.

  4. added
    in-progress
    and removed
    needs-decision
    on Sep 20, 2026
  5. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Progress: implementation started by an agent against the maintainer decision on this issue; a PR will be linked here when it opens.

  6. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Progress: PR #301 opened: top-level shared blocks selected with use: <name> for request and response.headers.

  7. removed
    in-progress
    on Sep 20, 2026
  8. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Implemented in #301: top-level shared blocks (request and response.headers) selected with use: , resolved at load time; anchors stay rejected. sandboxReason and other route defaults are deliberately left out of the first version.

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-firstenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions