Repository navigation
Align the documented trust model, plan status and version facts, and check guidance against the schema - #160
Merged
Merged
Conversation
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
…4gammr # Conflicts: # llms-full.txt
…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
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.
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.2madefunction/middlewareroutes trusted and unsandboxed by default withsandbox: trueas the per-route opt-in, butdocs/OPERATIONS.md,docs/FRAMEWORK.md,docs/SPECIFICATION.md,docs/RESILIENCE.md, the three provider guides,README.mdandllms.txtstill 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: theROADMAP.md0.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 that0.4.0-alpha.2superseded it.docs/SPIKE-DEFAULT-TRUST-MODEL.mdstill read "not yet implemented" and calledurlcode-dynamic-linkandurlcode-middlewareunbuilt; it now records implementation in0.4.0-alpha.2, evidenced bysandbox/sandboxReasonin the schema, and that the version is not yet published.docs/NEXT-STEPS.mddescribed 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 onlybaseline.jsonwithmodel: stub, so the application-specific code ratio is still unmeasured.No page stated which core version downstream packages support.
docs/VERSION-ALIGNMENT.mddefines 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-middlewarebreakage 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
authguidance inverted its own principle. That change recorded declarative-first and, in the same commit, told agents to "never invent anauthfield". Route-levelauthis implemented — defined inschemas/urlcode.schema.json, expanded bynormalizeRouteAuthinsrc/config.ts, typed insrc/types.ts, asserted intest/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 teachauthand the siblingcacheshort form, conditioned on anauthextension being declared.docs/PROJECT-DIRECTION.md's showcase example usedroles: [admin]; the schema'srouteAuthdefines singularrole, 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.2model 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.mdis new: nine decisions documentation cannot make, each with what is true today, the options and the cost of leaving it open.Verification
npm run verifypasses: lint, typecheck, generated-resource checks, build, 503 tests (501 pass, 0 fail, 2 skipped).npm run checkpasses, including both new checks: trust-model prose scans 138 files clean; guidance-claims scans 10 agent-facing files against 130 schema fields clean.authfield" sentence fails it withno-denied-field; returning the removedlinkhandler to the inventory line fails it withhandler-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.mdis regenerated fromrenderAgentsGuideand stays within its 80-line bound;test/cli.test.tsasserts the committed copy equals whatinitgenerates.llms-full.txtregenerated withnpm 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
authandcacheshort forms described here already shipped; nothing in this branch adds or alters a field. No package is published and no pin is changed — publishing0.4.0-alpha.2remains a separate maintainer action, and it is what unblocks the middleware peer and the downstream repins.🤖 Generated with Claude Code
https://claude.ai/code/session_01RGEwCLf6egztgdcFPbLGaE
Generated by Claude Code