Repository navigation
Ecosystem conformance: zod used directly, and URLCode hosted inside Hono (#841) - #887
Merged
Merged
Conversation
… host (#841) proofs/ecosystem adds two bounded conformance checks, run by `npm run test:ecosystem` against a packed consumer: - A trusted function route imports zod 4.6.5 through its own API, with no adapter, descriptor or catalog entry. The same import on a `sandbox: true` route is refused before serving (sandbox-import). explain labels the route trusted (in-process). - URLCode is embedded in Hono (createRuntime plus an operator bridge) and compared request by request with `urlcode serve`. The reverse direction is also covered: a Hono app behind function routes and behind an extension mount. The README records every gap found: - no exported Request/Response adapter; - trusted proxies, the loopback Host check, probes, the request log, admission and stream limits are startServer-only; - repeated-header counts are lost on pure-fetch hosts; - no base path; - no function wildcard; - a review false positive on app.fetch. The suite is wired into verify:workspaces, CI and ci-plan. The docs add "Using npm libraries directly" (FRAMEWORK) and "Hosting URLCode inside another framework" (OPERATIONS). They also correct the stale OPERATIONS claim that functions support only relative imports. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 29, 2026 01:52
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
…quest/response rules (#889) (#891) * feat(core)!: embedded fetch handler for hosting URLCode inside another framework (#889) createEmbeddedHandler(runtime, options) turns a self-hosted runtime into a (Request, {peer, rawHeaders}) => Promise<Response> handler that answers exactly as startServer: both hosts now share one request pipeline (host-request.ts: header lines and counts, body limits, trusted-proxy client resolution, error format and policy headers) and the same prepareResponse/prepareStream/errorResponse answer. Cloudflare's fetch response builder is the same shared fetchResponse. - Trusted proxies: trustedProxies resolves the client from the vouched peer and exactly one X-Forwarded-For, as --trusted-proxies. - Repeated headers: the host passes raw header lines, or declares headerLines: 'unavailable'; joined values containing a comma then count as repeated. runtime.handle() without headerCounts applies the same rule instead of reading a missing count as zero. - basePath: a prefix-stripping mount keeps its prefix in a function's request.url and in every path-absolute Location. - loopbackHost: optional loopback Host admission (421), as the Node server. Docs: OPERATIONS "Hosting URLCode inside another framework" (what is provided and what stays server-only), RIM-EMBED-001, SECURITY, FRAMEWORK, llms. Package budget raised with measured sizes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(proofs): host URLCode in Hono through createEmbeddedHandler (#889) The ecosystem fixture's Hono host drops its copied response bridge (hono/urlcode-fetch.mjs) and uses createEmbeddedHandler with trustedProxies, loopbackHost and, for the prefix-stripping mount, basePath. The integration test now asserts X-Forwarded-For resolution from a trusted proxy, 421 for a foreign Host and the kept /mounted prefix in both hosts; the README's gaps narrow to the server-owned operations, conservative counts on pure-fetch hosts, basePath scope, byte-level header joining, the function-route catch-all and review's app.fetch false positive. fetchResponse sends an empty body as no body, so a host does not give zero bytes a default content type. OPERATIONS keeps the fixture pointer and the reverse direction from #887. Core package budget re-measured on current main. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Adds #841 acceptance evidence for direct library use and a second, materially different host integration. The fixtures are in
proofs/ecosystem/, with a README listing supported directions and every gap.npm run test:ecosystempacks core, installs into a copied site, and runsurlcode serveand the Hono host side by side (12/12). It is included inverify:workspacesand the CI workspace-integration job.Direct npm library use
validate --localandurlcode testpass.sandbox: trueroute is refused before serving (sandbox-import) byvalidate,serveand an embeddedcreateRuntime.execution: trusted (in-process).Hosting URLCode inside Hono (hono 4.13.10, @hono/node-server 2.1.1)
createRuntimeplus a 112-line bridge;/*).urlcode serve:X-Request-Id,nosniff,no-store, and separateSet-Cookielines;Gaps and core coupling (filed separately)
prepareResponse,prepareStream,errorResponseand the error-code table are unexported, so the bridge copies core's rules and can drift. This is the main embedding blocker.startServer.headerCountsis optional, which weakens duplicate-header refusals on fetch-only hosts.urlcode reviewflagsapp.fetch(request)as an outbound call.The docs gain "Using npm libraries directly" (FRAMEWORK.md) and "Hosting URLCode inside another framework" (OPERATIONS.md). A stale sentence that said functions support only relative imports is corrected.
Evidence
npm run verifypasses: 1150/1150,test:addons,test:proof,test:ecosystem12/12.npm run test:packagepasses.🤖 Generated with Claude Code