Repository navigation
Reconcile #164 and #165: retire dynamic-link/short, and fix the trust claims they each caught - #166
Conversation
Takes the trusted-by-default corrections urlcode-docs carried and this repository did not, and rescues the two pages that existed only there. Co-Authored-By: Claude Opus 5 <[email protected]>
Both packages were unpublished from npm and their repositories deleted. Core never depended on either, but live guidance still described stored short links as "moving to a future urlcode-dynamic-link extension package, not yet published", and README, docs/README.md and the spike banners still linked to repositories that now 404. Every such link is gone, and the guidance says what is true: core has no native `link` handler, no supported extension provides stored links, and a project needing them owns that storage itself. Dated records keep their bodies and get retirement notes; SPIKE-MONOREPO's note is reconciled with the urlcode-docs reversal already on main rather than reverting it, and now records that urlcode-docs is retiring too. Two trust-by-default corrections that were missing here: - docs/FUNCTION-SECURITY.md gains "Migrating to the trusted default", which warns that on upgrade every existing function/middleware route silently changes execution mode from sandboxed to trusted unless it declares `sandbox: true`, and says to opt routes back in before upgrading. The two-worker concurrency cap that motivated the change is the real default in src/functions.ts. It also gains "Trusted code, not trusted requests": trusted describes authorship, never the request data. - examples/prerender claimed its function "runs in the QuickJS/WASM sandbox with no filesystem, network or host code" while no route declared `sandbox: true`, so under the trusted default it ran in-process with full Node access. The three routes now declare `sandbox: true` deliberately and the prose says why. check-trust-model-prose.ts scans Markdown only, which is why a .mjs comment and YAML went unflagged. README also had two `## Documentation` and two `## Built with URLCode` sections; they are merged. docs/README.md linked to local SPIKE-AUTH/ADMIN/UI pages that do not exist here — they are owned by urlcode-auth, urlcode-admin and urlcode-ui, and the same table already said so two rows down. The links now point at the owning repositories rather than vendoring 1528 lines of copies, which is the duplication this cleanup exists to end. Verified: npm run verify — lint, typecheck, check, build and 512 tests (510 pass, 2 skipped, 0 fail). The prerender recipe was run end to end after the sandbox change: 7 fixtures pass, 3 pages render, audit passes 12 checks. Co-Authored-By: Claude Opus 5 <[email protected]>
…d through check-trust-model-prose.ts scanned Markdown only. That is why examples/prerender asserted, in a .mjs comment, that it "runs in the QuickJS/WASM sandbox with no filesystem, network or host code" while its urlcode.yaml declared no `sandbox: true` — under the trusted default it ran in-process with full Node access, and neither half of the contradiction was in a file the check read. Two additions: - Comments of runnable project material under examples/ and starters/ (`.mjs`/`.cjs`/`.js`/`.ts` and `urlcode.yaml`) are scanned. Only comment text is extracted, with line numbers preserved, so a rule never matches a string literal or a route path that happens to contain the word. - A new `unbacked-isolation-claim` rule cross-checks each project against its own YAML: prose claiming sandbox or QuickJS/WASM isolation must be backed by at least one route declaring `sandbox: true`. This is the rule that catches the original defect rather than its symptom — deleting the three `sandbox: true` lines from examples/prerender now fails the check with all three claims named. `llms.txt` and `llms-full.txt` are .txt, so they take the prose path, not the comment path; verified by planting a violation in llms.txt and seeing it reported. Scans 140 files → 185. Also drops the three `docs/README.md` rows linking SPIKE-AUTH/ADMIN/UI as local pages. They are owned by urlcode-auth, urlcode-admin and urlcode-ui, and the "Auth, admin and UI spikes" row below already points there. Verified: npm run verify — 512 tests, 510 pass, 2 skipped, 0 fail. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Two follow-ups from review, both now pushed: The three spike rows are deleted, not relinked. The Markdown-only gap in The rule that matters is the new
|
#166 resolved this example's false isolation claim the wrong way round. The comment in functions/page.mjs said the code "runs in the QuickJS/WASM sandbox with no filesystem, network or host code" while no route declared `sandbox: true`; #166 made the claim true by adding `sandbox: true` to all three routes. The code was right and the comment was wrong, not the reverse. docs/AI-AUTHORING.md is explicit: "Do not add `sandbox: true` reflexively to every route 'for safety' — it costs the route the worker-pool capacity ceiling and the ability to use `fetch`, Node builtins, the filesystem or npm packages, for isolation most routes do not need." It then lists the three cases that do warrant it: unreviewed code, a secret whose blast radius matters, or logic complex enough that limiting a bug's reach is the margin wanted. This example meets none of them. `page` is seven lines of reviewed first-party code whose whole body is `new Response(args.body)`, with literal arguments from urlcode.yaml — the trusted default's own case. Shipping the flagship recipe with a reflexive opt-in taught readers to cargo-cult `sandbox: true` and made the example contradict the guidance page. So the three declarations come out and the prose describes what actually runs. "Guest execution"/"guest code" also becomes "project code" where it meant the route's own handlers: under the trusted default those are in-process project code, not a guest. docs/PRERENDER.md already described prerendering as mode-agnostic, and the example now matches it: the README says a route declaring `sandbox: true` prerenders the same way. The `unbacked-isolation-claim` check added in #166 still does its job, and does it in the right direction — it requires prose and YAML to agree, not that a project be sandboxed. Verified both ways: the tree passes, and re-adding a QuickJS claim to page.mjs fails the check naming that line. Verified: npm run verify — 512 tests, 510 pass, 2 skipped, 0 fail. The recipe runs end to end: 7 fixtures, 3 pages rendered, audit 12/12. Co-authored-by: Claude Opus 5 <[email protected]>
Supersedes #164 and #165, which overlapped on ten files and disagreed on two things. This is the reconciled result, checked against the code rather than against either PR's description.
Why they could not just both be merged
#164 branched before #163 landed. #163 had already reversed the documentation-home policy that #164's middle commit existed to reverse, so merging #164 would have reverted #163's version-register corrections and its
SPIKE-MONOREPO.mdupdate. #164 wasCONFLICTINGfor that reason.They also disagreed about
urlcode-docs: #164 kept it as the rendering site, #165 recorded it as retiring with the other two. #165 is the later position and is the one kept.POLICIES,policies/compression,BEST-PRACTICES,ASSETS,PRERENDER)MANAGEMENT-SECURITY.md,EXTENSION-IMPLEMENTATION.mdrescuedMANAGEMENT-SECURITYretirement banner kept — theurlcode linksCLI it documents has nocaseinsrc/cli.tsFUNCTION-SECURITY.mdupgrade migration guideexamples/prerenderfalse isolation claimSPIKE-ADMIN/AUTH/UI.md(1528 lines)AGENTS/CONTRIBUTING/OPEN-DECISIONS/VERSION-ALIGNMENTrewritesThe two trust-model corrections, verified against the code
Both were only in #164, and both hold:
docs/FUNCTION-SECURITY.mdhad no upgrade migration guide.src/types.ts:75documentssandbox?: booleanas "Default false: trusted, in-process, unsandboxed", andsrc/runtime.ts:119-124splits routes onsandbox === true. So on upgrade, every existingfunction/middlewareroute silently changes execution mode unless it declaressandbox: true. Nothing here said so. The concurrency motivation checks out too:src/functions.ts:69defaults the pool toworkers = 2.examples/prerendermade a false isolation claim.functions/page.mjssaid it "runs in the QuickJS/WASM sandbox with no filesystem, network or host code" while no route inexamples/prerender/urlcode.yamldeclaredsandbox: true— so under the trusted default it ran in-process with full Node access. The three routes now declare it deliberately.check-trust-model-prose.tsscans Markdown only, which is why a.mjscomment and YAML went unflagged; that gap is worth its own issue.Where I did not follow either PR
SPIKE-ADMIN/AUTH/UI.md; Bring urlcode-docs' content across before it is retired #165 declined them as owned byurlcode-auth/urlcode-admin/urlcode-ui. The links indocs/README.md:64-66were genuinely dangling, but the same table already said two rows down that these live in their own repositories, andAGENTS.mdsays those extensions are owned there. Vendoring three copies re-creates exactly the drift this cleanup exists to end, so the links point at the owning repositories instead. Flagging this as the one judgment call worth overruling if you disagree.README.mdanddocs/README.mdstill linked togithub.com/jimhoyd-com/urlcode-shortand.../urlcode-dynamic-linkin six places, including a build retrospective that is no longer reachable;grepfor either URL now returns nothing.README.mdhad two## Documentationsections and two## Built with URLCodesections — pre-existing on main, not introduced by either PR. Merged.0.1.0-alpha.1declares the exact peer@jimhoyd/urlcode: 0.4.0-alpha.1and can never be installed beside0.4.0-alpha.2.llms.txtlistedurlcode-dynamic-linkas "planned, not yet published" and omittedurlcode-middlewareentirely. Both fixed..github/ISSUE_TEMPLATE/config.ymlstill sent readers tourlcode-docs. Retire urlcode-dynamic-link and urlcode-short, and make docs/ the documentation home #164 pointed docs-site problems back aturlcode-docs/issues, which contradicts its retirement; that contact link is removed instead.VERSION-ALIGNMENT.mdsaid the two packages "are being retired"; they are retired, so it is past tense now.Verification
npm run verify— lint, typecheck, check, build, 512 tests: 510 pass, 2 skipped, 0 failnpm run check— trust-model prose clean across 140 files; guidance claims clean against 130 schema fields; YAML reference,llms-full.txt, cookbook index and plugin distribution all currentsandbox: true:testpasses 7 fixtures,prerender.mjsemits 3 pages,audit --expect-routes 3passes 12 checksCompatibility and security
No runtime, schema or API change. The only non-documentation edits are
examples/prerender(a correctness fix to an example's declared trust) and a comment inscripts/check-guidance-claims.ts.🤖 Generated with Claude Code