Skip to content

feat(core): authoring fixture/diff tools, automatic host revision pin, clearer host and cache errors (#722, #723, #724, #725) - #735

Merged
jimhoyd merged 4 commits into
mainfrom
claude/sleepy-shannon-xvazgl
Sep 25, 2026
Merged

jimhoyd merged 4 commits into
mainfrom
claude/sleepy-shannon-xvazgl

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Problem and change

Verification

Run on Node v26.10.0:

Compatibility and security

🤖 Generated with Claude Code

https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP


Generated by Claude Code

…uthoring tools (#722)

suggestFixtures(yaml) proposes tests/requests.json cases only where the YAML
alone determines the answer (redirect, respond, page/download, disabled 404,
405 with allow, missing/invalid simple inputs, required-body 400, unmatched
404); function, middleware, proxy, signals, extension, extension-policy,
include, pattern/format and env/secret-binding routes go to gaps, and
conditional, expiring, static, agents/throttle and unsampleable routes to
review. summarizeYamlChange(before, after) reports route, capability,
trusted/sandboxed code-seam and requested/released operator-grant changes
by name only. Both are exported from @jimhoyd/urlcode/agent-context, exposed
as `urlcode fixtures suggest` / `urlcode diff` and read-only MCP tools
suggest_fixtures / summarize_yaml_change, deterministic and bounded.

Core package budget raised (packed 660->675 KiB, unpacked 2700->2750 KiB)
with justification in scripts/package-audit.ts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
… be cached (#725)

One assertion covers match/conditional routes, extension mounts and routes
naming a cache-sensitive extension policy, but it always said
"<pattern>: conditional routing requires cache disabled or no-store" (and
"Conditional responses require no-store" for a cacheable response header).
The message now follows the condition that fired:

- match/conditional: "<pattern>: conditional routing requires cache disabled
  or no-store" / "<pattern>: conditional responses require no-store"
- policies.extensions: "<pattern>: routes protected by extension "auth"
  cannot be cached; use cache: {strategy: no-store} or remove cache"
- extension mount: "<pattern>: routes served by extension "<name>" cannot be
  cached; ..."
- header variants: "... cannot send a cacheable response header; set it to
  no-store or remove it"

Only the sensitive extension names are listed. The refusal itself is
unchanged. Tests assert the exact text; EXTENSIONS.md documents it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…, test and dev (#724)

#714 named extension activation errors, but two earlier failure points still
printed "Operation failed; check project files, module dependencies and
command options":

- host.mjs itself throwing while imported (a top-level error or an import
  that cannot be resolved) now prints "Host file failed to load: <message>"
  with code host-load.
- an extension's host() hook throwing inside composeHost now prints
  "Extension "<name>" host() failed: <message>" with code extension-host and
  the extension field (extensionError gains a 'host' phase).

Both use boundedMessage: one line, 500 characters, no stack, operator
console only; request-time answers are unchanged. Core's own refusals inside
composeHost keep their message. A host file that imports a second copy of
core is still recognized: ConfigError carries a Symbol.for brand and
asConfigError rebuilds such an error with its known detail fields only.

Module-resolution messages are shown as Node reports them, including the
missing specifier and the importing file's absolute path, following #714's
choice to print the operator's own error verbatim on the operator's own
console; LOCAL-DEVELOPMENT.md says so, and AI-AUTHORING.md lists the codes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…tomatically (#723)

Owner decision on #723: when a CLI command (serve, dev, validate, test,
routes, audit, benchmark) receives both --policy and --host-file, core loads
and validates the policy first and passes its projectSha256 to composeHost()
as the host revision pin. No new flag; project YAML never supplies it.

- loadOperatorHost(file, project, {revision}) sets a
  Symbol.for('urlcode.host.operatorRevision') slot only while it imports the
  host file (restored afterwards), so a host.mjs importing another copy of
  core still sees it. Only the revision crosses; the grants stay with core.
- composeHost() takes its pin from hostRevisionPin(): that revision when
  present, otherwise PROJECT_SHA256. Each host() hook still receives it as
  context.projectSha256, so generated host.mjs files, starters and existing
  host files need no change.
- PROJECT_SHA256 set alongside --policy must be equal, or the command
  refuses (code revision-pin-mismatch). A policy for another project
  revision refuses once the host registers an extension, with the usual
  revision-pin hint. Neither source still refuses, now naming both.
- The registration equality check stays; the policy is read once and
  reused for bindings.

The AWS and Vercel handlers load no host file and are unchanged: operator
code that builds their extensions with composeHost still sets
PROJECT_SHA256, and URLCODE_POLICY keeps its own pin check. The GitHub
Action passes no --policy and keeps computing PROJECT_SHA256.

CLI hints, OPERATIONS/EXTENSIONS (new "The revision pin" section),
COMPOSING-A-SITE, STORE, FRAMEWORK, CI, RUNTIME-IMPLEMENTATION, the auth and
mcp READMEs, the store-crud recipe and the create-extension scaffold now
describe both sources; llms-full.txt regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
@jimhoyd
jimhoyd merged commit c97c65a into main Sep 25, 2026
23 checks passed
@jimhoyd
jimhoyd deleted the claude/sleepy-shannon-xvazgl branch September 25, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment