Skip to content

Add shared request and response.headers blocks (refs #257) - #301

Merged
jimhoyd merged 1 commit into
mainfrom
feat/257-shared-blocks
Sep 20, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
feat/257-shared-blocks

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Refs #257 (does not close it).

Implements the maintainer decision on #257: an optional top-level shared map of named request and response.headers blocks that a route selects with use: <name>, modeled on policies.profile. Anchors, aliases and merge keys stay rejected.

Design points settled (documented in docs/SPECIFICATION.md, Shared blocks):

  1. Merge: a route's own request or response key wins as a whole block; no deep merge.
  2. Resolution at load time (validateDocument, and includes resolve against the entry file's map). use is removed, so the route hash and every downstream consumer see the resolved route. Note: routes inventory output does not print headers or request policy, so the hash and compiled route are where the resolved result shows.
  3. Unknown name fails validation; a shared response.headers naming a runtime-owned header fails (the reserved set is now exported from http-policy.ts and reused). Includes may use but not declare shared.
  4. Only request and response.headers for now; sandboxReason, sandbox, policies and other defaults left out.

Also: schema (request/response extracted to shared $defs), YAML reference and llms-full.txt regenerated, new examples/shared-blocks with fixtures, test/shared-blocks.test.ts, #257 row removed from docs/OPEN-DECISIONS.md. npm run verify and npm run check:docs pass.

Evidence note per the issue: n=1 on one small Todo app; explicit maintainer decision to proceed.

🤖 Generated with Claude Code

@jimhoyd
jimhoyd force-pushed the feat/257-shared-blocks branch from b8f7a95 to 06ca1a2 Compare September 20, 2026 15:20
@jimhoyd
jimhoyd enabled auto-merge (squash) September 20, 2026 15:21
@jimhoyd
jimhoyd merged commit 108a8c4 into main Sep 20, 2026
20 checks passed
@jimhoyd
jimhoyd deleted the feat/257-shared-blocks branch September 20, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant