Skip to content

Add urlcode explain and urlcode manifest from the compiled IR - #99

Merged
jimhoyd merged 2 commits into
mainfrom
claude/issue-82-explain-manifest
Sep 18, 2026
Merged

jimhoyd merged 2 commits into
mainfrom
claude/issue-82-explain-manifest

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements docs/NEXT-STEPS.md §3.3 and §3.4.

  • urlcode explain [/route] [--project DIR] [--target T] [--host-file F] [--json] — from the compiled IR (config → router → policies), prints effective methods, handler (destination / module and export / file / extension / link collection), the middleware chain, validated inputs (parameters and body policy), policies in effect with each compiled policy's inventory, extension requirements (with provider registration, revision-pin match and policy-schema validity when a host file is given), the cache outcome including the no-store the runtime forces on extension, proxy and conditional routes, binding names (never values), egress origins, capabilities and per-target support. Without a path it prints a one-line-per-route table. An unknown route exits 1 and names the nearest patterns.
  • SDK: explainRoute is extended in place (same entry point, now returns the full description or {matched:false, nearest}), plus explainProject. New src/explain.ts holds the IR reader, src/explain-cli.ts the rendering.
  • urlcode manifest [--project DIR] [--json] — deterministic semantic manifest: schemaVersion, urlcode version, entry file and includes, revision (equal to inspectExtensionRevision), config version, routes, capabilities used, extension declarations, recipe provenance (optional recipe.yaml beside the entry), external requirements (env/secret names, proxy and signal origins, extensions, link stores, dynamic links), function and middleware modules with their routes, per-target compatibility. build writes it as manifest.json beside its output (BuildReport.manifest), the SDK exports buildManifest/renderManifest, MCP offers get_manifest (read-only; tool count 8 → 9).
  • Docs: docs/TOOLING.md (SDK entries and a new "Explain and manifest" section), a paragraph in docs/READINESS.md, one line in docs/AI-AUTHORING.md, regenerated llms-full.txt.

Validation

  • npm run verify (lint, typecheck, check incl. llms-full, build, tests): 463 tests, 37 skipped, all new tests green. One unrelated provider-verification case (redirect-query-drop, "transport, deadline or response-limit failure") flaked under the full-suite load and passes in isolation; the same single flake appears on main before this change.
  • New tests (test/explain.test.ts, test/manifest.test.ts): cookbook snapshot for /hello/{name} and the extensions fixture's /account and /private; explain agrees with the runtime inventory on methods, policies, state, handler and middleware for every route of the cookbook, conditions and extensions examples; manifest revision equals inspectExtensionRevision, byte-identical on two builds, agrees with inspectProject; build emits manifest.json identical to urlcode manifest --json; CLI exit codes; MCP get_manifest.

Closes #82

🤖 Generated with Claude Code

https://claude.ai/code/session_01AQ3ZGqNtWviSYfUMsxU54E


Generated by Claude Code

`urlcode explain [/route]` describes what the compiled configuration will do
for a path: effective methods, handler, middleware chain, validated inputs,
policies in effect with extension requirements (and provider facts when a
host file is given), the cache outcome including the forced no-store,
binding names, egress origins, capabilities and per-target support. Without
a path it prints one line per route; an unknown route exits 1 and names the
nearest patterns. The SDK's explainRoute now returns this description and
explainProject covers every route.

`urlcode manifest` emits a deterministic semantic manifest (schema version,
urlcode version, entry and includes, the revision digest equal to
inspectExtensionRevision, routes, capabilities, extensions, recipe
provenance, external requirements, functions, middleware and target
compatibility). `build` writes it as manifest.json beside its output,
buildManifest returns it from the SDK and MCP offers it as get_manifest.

Tests cover cookbook snapshots for a function route and an
extension-protected route, agreement of explain with the runtime inventory
on methods, policies, state, handler and middleware for every cookbook,
conditions and extensions route, manifest determinism and revision, the
build output, the CLI and the MCP tool. Docs: TOOLING.md, READINESS.md,
AI-AUTHORING.md and the regenerated llms-full.txt.

Closes #82

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AQ3ZGqNtWviSYfUMsxU54E
@jimhoyd
jimhoyd merged commit 096f342 into main Sep 18, 2026
12 checks passed
@jimhoyd
jimhoyd deleted the claude/issue-82-explain-manifest branch September 18, 2026 08:00
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.

urlcode explain and urlcode manifest from compiled semantics

2 participants