Skip to content

Align the documented trust model, plan status and version facts, and check guidance against the schema - #160

Merged
jimhoyd merged 3 commits into
mainfrom
claude/tender-edison-4gammr
Sep 19, 2026
Merged

jimhoyd merged 3 commits into
mainfrom
claude/tender-edison-4gammr

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Problem and change

A review of all nine repositories found documented positions that had drifted from the source and from each other. Four classes of problem, all fixed here.

The trust model was not carried through the documentation. 0.4.0-alpha.2 made function/middleware routes trusted and unsandboxed by default with sandbox: true as the per-route opt-in, but docs/OPERATIONS.md, docs/FRAMEWORK.md, docs/SPECIFICATION.md, docs/RESILIENCE.md, the three provider guides, README.md and llms.txt still described the old always-sandboxed model as current. Every live claim is corrected and scoped to the two execution modes. Historical text is annotated rather than rewritten: the ROADMAP.md 0.1.0-alpha.2 security-correction entry, the next-phase plan's preserved-architecture sentence and the dated usability review keep what they said and gain a note that 0.4.0-alpha.2 superseded it. docs/SPIKE-DEFAULT-TRUST-MODEL.md still read "not yet implemented" and called urlcode-dynamic-link and urlcode-middleware unbuilt; it now records implementation in 0.4.0-alpha.2, evidenced by sandbox/sandboxReason in the schema, and that the version is not yet published.

docs/NEXT-STEPS.md described shipped work as future. Every numbered item was verified against the source; 17 are marked done or partly done using the file's existing convention, citing files and symbols rather than line numbers. A dated note records that Phases 1, 3 and 4 largely landed before Phase 0 produced a model-backed benchmark run — benchmarks/agent/runs/ holds only baseline.json with model: stub, so the application-specific code ratio is still unmeasured.

No page stated which core version downstream packages support. docs/VERSION-ALIGNMENT.md defines the supported floor, the three declaration forms, the rule against publishing a peer range no published core satisfies, and the publish-core then raise-floors then regenerate ordering. It uses the current @jimhoyd/urlcode-middleware breakage as the worked example: that package is published requiring core >=0.4.0-alpha.2, which is not on npm, so a registry install cannot resolve its peer.

#158's auth guidance inverted its own principle. That change recorded declarative-first and, in the same commit, told agents to "never invent an auth field". Route-level auth is implemented — defined in schemas/urlcode.schema.json, expanded by normalizeRouteAuth in src/config.ts, typed in src/types.ts, asserted in test/recipes.test.ts — so the guidance steered agents away from a supported short form toward the long policy form it expands to. The generator, starter and skill now teach auth and the sibling cache short form, conditioned on an auth extension being declared. docs/PROJECT-DIRECTION.md's showcase example used roles: [admin]; the schema's routeAuth defines singular role, so the flagship example of what a route should read like would not have validated.

Two new enforcing checks, both wired into npm run check:

  • scripts/check-trust-model-prose.ts — fails on prose describing the pre-0.4.0-alpha.2 model as current. Scans 138 files sentence by sentence; a documented marker exempts genuinely historical text.
  • scripts/check-guidance-claims.ts — fails when agent-facing guidance contradicts the schema. Rules derive from the schema, not a hand-maintained list: a schema-defined field may not be called invented or unsupported; a handler-enumeration line may name only handlers the schema still defines; a field the reader is told to declare must resolve.

docs/OPEN-DECISIONS.md is new: nine decisions documentation cannot make, each with what is true today, the options and the cost of leaving it open.

Verification

  • npm run verify passes: lint, typecheck, generated-resource checks, build, 503 tests (501 pass, 0 fail, 2 skipped).
  • npm run check passes, including both new checks: trust-model prose scans 138 files clean; guidance-claims scans 10 agent-facing files against 130 schema fields clean.
  • The guidance check was verified against the regressions it exists for, not only against a clean tree. Reintroducing the "never invent an auth field" sentence fails it with no-denied-field; returning the removed link handler to the inventory line fails it with handler-inventory. Its first draft produced 36 paragraph-level false positives, including the legitimate rule "report unsupported requirements instead of inventing fields"; scoping the denial rule to the sentence and requiring the field within 60 characters of the denial removed them.
  • starters/default/AGENTS.md is regenerated from renderAgentsGuide and stays within its 80-line bound; test/cli.test.ts asserts the committed copy equals what init generates.
  • llms-full.txt regenerated with npm run docs:llms.

Compatibility and security

Documentation, generated agent guidance and two new check scripts only. No runtime API, schema, YAML, dependency, permission or deployment change. The auth and cache short forms described here already shipped; nothing in this branch adds or alters a field. No package is published and no pin is changed — publishing 0.4.0-alpha.2 remains a separate maintainer action, and it is what unblocks the middleware peer and the downstream repins.

  • 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

https://claude.ai/code/session_01RGEwCLf6egztgdcFPbLGaE


Generated by Claude Code

The 0.4.0-alpha.2 trust-model change (function/middleware trusted and
unsandboxed by default, sandbox: true as the per-route opt-in) had not been
carried through the documentation, docs/NEXT-STEPS.md described shipped work as
future, and no page stated which core version downstream packages support.

Trust model:
- Correct every live claim that functions/middleware are untrusted, sandboxed
  or isolated by default across docs/, README.md and llms.txt, scoping
  QuickJS/WASM statements to routes that declare sandbox: true.
- Annotate rather than rewrite historical text: the ROADMAP 0.1.0-alpha.2
  security-correction entry, the next-phase plan's preserved-architecture
  sentence and the dated usability review keep what they said and carry a note
  that 0.4.0-alpha.2 superseded it.
- Record in docs/SPIKE-DEFAULT-TRUST-MODEL.md that the decision is implemented
  in 0.4.0-alpha.2, evidenced by sandbox/sandboxReason in the schema, and that
  0.4.0-alpha.2 is not yet published.
- Add scripts/check-trust-model-prose.ts, wired into npm run check, which fails
  on a stale claim. It scans 138 files sentence by sentence, allows explicitly
  marked historical text, and does not fire on correctly scoped sentences.

Plan and version facts:
- Mark the 17 docs/NEXT-STEPS.md items that have shipped, citing files and
  symbols rather than line numbers, and record that Phases 1, 3 and 4 largely
  landed before Phase 0 produced a model-backed benchmark run.
- Record dated npm dist-tag facts in docs/RELEASE-READINESS.md, including that
  auth's latest tag resolves an older build than admin's peer floor requires.
- Add docs/VERSION-ALIGNMENT.md: the supported core floor, how each downstream
  form declares it, the rule against publishing an unsatisfiable peer, and the
  publish-core then raise-floors then regenerate ordering.
- Add docs/OPEN-DECISIONS.md: nine decisions documentation cannot make, each
  with what is true today, the options and the cost of leaving it open.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RGEwCLf6egztgdcFPbLGaE
…schema

#158 recorded declarative-first as a design principle and, in the same change,
told agents to "never invent an `auth` field". Route-level `auth` is
implemented: schemas/urlcode.schema.json defines it, normalizeRouteAuth in
src/config.ts expands it to policies.extensions.auth, src/types.ts types it and
test/recipes.test.ts asserts both `auth: true` and `auth: {role: admin}`. The
guidance therefore steered agents away from a supported short form and toward
the long policy form it expands to, which is the opposite of the principle it
was introducing. The sibling `cache` short form was not mentioned at all.

- src/agents-guide.ts, and starters/default/AGENTS.md regenerated from it: teach
  both short forms, conditioned on an `auth` extension being declared, within
  the guide's 80-line bound.
- skills/urlcode/SKILL.md: name the short forms as the highest-level form, which
  is what choosing the highest-level supported abstraction means here.
- docs/PROJECT-DIRECTION.md: the showcase example used `roles: [admin]`; the
  schema's routeAuth defines singular `role`, so the flagship example of what a
  route should read like would not have validated.
- llms.txt: state that this revision is 0.4.0-alpha.2 and what its default is,
  rather than calling 0.4.0-alpha.1 current; llms-full.txt regenerated.

Add scripts/check-guidance-claims.ts, wired into npm run check, so this cannot
recur. It derives its rules from the schema rather than a hand-maintained list:
a schema-defined field may not be described as invented or unsupported; a line
enumerating route handlers may name only handlers the schema still defines; a
field the reader is told to declare must resolve. Verified against both real
regressions -- reintroducing the "never invent an `auth` field" sentence fails
it, and returning the removed `link` handler to the inventory line fails it --
and clean on the current tree. A documented marker exempts text that is
deliberately about another version.

docs/OPEN-DECISIONS.md records the check as delivered and leaves open whether it
should also be a required status check rather than only a member of npm run
check.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RGEwCLf6egztgdcFPbLGaE
@jimhoyd
jimhoyd merged commit 20e2c7f into main Sep 19, 2026
10 checks passed
@jimhoyd
jimhoyd deleted the claude/tender-edison-4gammr branch September 19, 2026 15:37
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.

2 participants