Repository navigation
Add urlcode explain and urlcode manifest from the compiled IR - #99
Merged
Merged
Conversation
`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
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01AQ3ZGqNtWviSYfUMsxU54E
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theno-storethe 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.explainRouteis extended in place (same entry point, now returns the full description or{matched:false, nearest}), plusexplainProject. Newsrc/explain.tsholds the IR reader,src/explain-cli.tsthe rendering.urlcode manifest [--project DIR] [--json]— deterministic semantic manifest:schemaVersion, urlcode version, entry file and includes,revision(equal toinspectExtensionRevision), config version, routes, capabilities used, extension declarations, recipe provenance (optionalrecipe.yamlbeside 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.buildwrites it asmanifest.jsonbeside its output (BuildReport.manifest), the SDK exportsbuildManifest/renderManifest, MCP offersget_manifest(read-only; tool count 8 → 9).docs/TOOLING.md(SDK entries and a new "Explain and manifest" section), a paragraph indocs/READINESS.md, one line indocs/AI-AUTHORING.md, regeneratedllms-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 onmainbefore this change.test/explain.test.ts,test/manifest.test.ts): cookbook snapshot for/hello/{name}and the extensions fixture's/accountand/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 equalsinspectExtensionRevision, byte-identical on two builds, agrees withinspectProject;buildemitsmanifest.jsonidentical tourlcode manifest --json; CLI exit codes; MCPget_manifest.Closes #82
🤖 Generated with Claude Code
https://claude.ai/code/session_01AQ3ZGqNtWviSYfUMsxU54E
Generated by Claude Code