Skip to content

Reconcile #164 and #165: retire dynamic-link/short, and fix the trust claims they each caught - #166

Merged
jimhoyd merged 3 commits into
mainfrom
claude/pr-165-164-cleanup-merge-3286b9
Sep 19, 2026
Merged

jimhoyd merged 3 commits into
mainfrom
claude/pr-165-164-cleanup-merge-3286b9

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

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.md update. #164 was CONFLICTING for 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.

Taken from Note
Trusted-by-default prose fixes (POLICIES, policies/compression, BEST-PRACTICES, ASSETS, PRERENDER) #165 Unchanged
MANAGEMENT-SECURITY.md, EXTENSION-IMPLEMENTATION.md rescued both #164's MANAGEMENT-SECURITY retirement banner kept — the urlcode links CLI it documents has no case in src/cli.ts
Retirement notes across 20 pages #164 Applied on top of #163's main, not instead of it
FUNCTION-SECURITY.md upgrade migration guide #164 See below
examples/prerender false isolation claim #164 See below
SPIKE-ADMIN/AUTH/UI.md (1528 lines) neither See below
AGENTS/CONTRIBUTING/OPEN-DECISIONS/VERSION-ALIGNMENT rewrites #163 + #165 #164's older versions dropped

The two trust-model corrections, verified against the code

Both were only in #164, and both hold:

  • docs/FUNCTION-SECURITY.md had no upgrade migration guide. src/types.ts:75 documents sandbox?: boolean as "Default false: trusted, in-process, unsandboxed", and src/runtime.ts:119-124 splits routes on sandbox === true. So on upgrade, every existing function/middleware route silently changes execution mode unless it declares sandbox: true. Nothing here said so. The concurrency motivation checks out too: src/functions.ts:69 defaults the pool to workers = 2.
  • examples/prerender made a false isolation claim. functions/page.mjs said it "runs in the QuickJS/WASM sandbox with no filesystem, network or host code" while no route in examples/prerender/urlcode.yaml declared sandbox: 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.ts scans Markdown only, which is why a .mjs comment and YAML went unflagged; that gap is worth its own issue.

Where I did not follow either PR

  • The three restored spike pages are not restored. Retire urlcode-dynamic-link and urlcode-short, and make docs/ the documentation home #164 vendored 1528 lines of SPIKE-ADMIN/AUTH/UI.md; Bring urlcode-docs' content across before it is retired #165 declined them as owned by urlcode-auth/urlcode-admin/urlcode-ui. The links in docs/README.md:64-66 were genuinely dangling, but the same table already said two rows down that these live in their own repositories, and AGENTS.md says 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.
  • Every link to a deleted repository is gone, not just relabelled. README.md and docs/README.md still linked to github.com/jimhoyd-com/urlcode-short and .../urlcode-dynamic-link in six places, including a build retrospective that is no longer reachable; grep for either URL now returns nothing.
  • README.md had two ## Documentation sections and two ## Built with URLCode sections — pre-existing on main, not introduced by either PR. Merged.
  • The package table drops the two retired rows rather than carrying them with a bold "being retired", and the sharp edge stays: dynamic-link's 0.1.0-alpha.1 declares the exact peer @jimhoyd/urlcode: 0.4.0-alpha.1 and can never be installed beside 0.4.0-alpha.2.
  • llms.txt listed urlcode-dynamic-link as "planned, not yet published" and omitted urlcode-middleware entirely. Both fixed.
  • .github/ISSUE_TEMPLATE/config.yml still sent readers to urlcode-docs. Retire urlcode-dynamic-link and urlcode-short, and make docs/ the documentation home #164 pointed docs-site problems back at urlcode-docs/issues, which contradicts its retirement; that contact link is removed instead.
  • VERSION-ALIGNMENT.md said 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 fail
  • npm 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 current
  • The prerender recipe run end to end after adding sandbox: true: test passes 7 fixtures, prerender.mjs emits 3 pages, audit --expect-routes 3 passes 12 checks
  • No remaining link to either deleted repository, and no remaining "moving to a future" / "not yet published" claim about them

Compatibility 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 in scripts/check-guidance-claims.ts.

  • Changes match the documented portable contract; docs/examples are updated where needed.
  • Relevant tests and package checks pass, or limitations are explained above.
  • No credentials, customer data or private project material are included.
  • Runtime/starter changes remain aligned where applicable.

🤖 Generated with Claude Code

jimhoyd and others added 3 commits September 19, 2026 13:30
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]>
@jimhoyd

jimhoyd commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator Author

Two follow-ups from review, both now pushed:

The three spike rows are deleted, not relinked. docs/README.md no longer lists SPIKE-AUTH/SPIKE-ADMIN/SPIKE-UI as how-to rows at all; the "Auth, admin and UI spikes" row further down the same page already names the owning repositories, so the earlier rows were redundant as well as dangling.

The Markdown-only gap in check-trust-model-prose.ts is fixed here rather than filed. It now scans the comments of runnable project material under examples/ and starters/ (.mjs/.cjs/.js/.ts and urlcode.yaml), extracting comment text only with line numbers preserved so a rule never matches a string literal or a route path.

The rule that matters is the new unbacked-isolation-claim: it cross-checks each project against its own YAML, so prose claiming sandbox or QuickJS/WASM isolation must be backed by a route declaring sandbox: true. That catches the original defect, not just its symptom. Deleting the three sandbox: true lines from examples/prerender now fails:

examples/prerender/README.md:20 [unbacked-isolation-claim]
  runs to serve them: the source project executes a QuickJS/WASM guest per request
  -> no route in this project declares `sandbox: true`, so its code runs trusted and in-process

examples/prerender/functions/page.mjs:2 [unbacked-isolation-claim]
  This route declares `sandbox: true`, so it runs in the QuickJS/WASM sandbox

llms.txt and llms-full.txt are .txt and must keep taking the prose path, not the comment path — confirmed by planting a violation in llms.txt and seeing it reported at the right line. Coverage goes from 140 files to 185.

npm run verify green: 512 tests, 510 pass, 2 skipped, 0 fail.

@jimhoyd
jimhoyd merged commit 10c2439 into main Sep 19, 2026
10 checks passed
@jimhoyd
jimhoyd deleted the claude/pr-165-164-cleanup-merge-3286b9 branch September 19, 2026 18:52
jimhoyd added a commit that referenced this pull request Sep 19, 2026
#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]>
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.

1 participant