Repository navigation
test(proofs): native-storage proof, the owner's own database behind auth: true (#1052 S7) - #1060
Merged
Merged
Conversation
…uth: true (#1052 S7) proofs/native-storage keeps its notes with node:sqlite, called directly from trusted function routes, and signs users in with auth: true through the independent Auth.js provider. Neither the store nor the audit extension is installed. The data directory is the operator's URLCODE_DATA_DIR grant, and a fresh temporary directory for every test and audit run. test/native-storage.integration.ts (npm run test:proof:native, in verify:workspaces and the packed-integration CI job) packs core and the provider, then checks validate, explain, review, test twice, audit ready, a refusal without the data directory, served owner isolation and concurrent writes, and that extensions.store without the store extension is refused before serving rather than emulated. No new dependency: node:sqlite is built in; @auth/core is the Auth.js proof's. Part of #1052. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 30, 2026 15:40
jimhoyd
added a commit
that referenced
this pull request
Sep 30, 2026
…pact in the paths-filter plan Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Sep 30, 2026
Closed
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.
Part of #1052 (slice S7, the owner-choice acceptance proof).
What
proofs/native-storageis a small notes application that:node:sqlite, called directly from trusted function routes (app/functions/notes.mjs:DatabaseSync, prepared statements, an explicit transaction). No URLCode store, adapter or descriptor is involved.auth: truethrough the independent Auth.js provider (proofs/authjs-provider), exactly as the Auth.js proof does. The function readscontext.capabilities.authjs.identity.userId.host.mjscomposes onlyauthjs.env: {DATA_DIR: {env: URLCODE_DATA_DIR}}. That is an operator grant for serving (proposed byurlcode permissions) and a fresh temporary directory for everyurlcode test/auditrun. The operator's Auth.js secret and accounts go indata/, or inNATIVE_STORAGE_DATA.The README explains the split: URLCode supplies routing, validation, the
auth: truegate, review and tests. The owner chooses the storage library, and none of the store's guarantees carry over.Test:
npm run test:proof:nativetest/native-storage.integration.tsis inverify:workspaces, the packed-integration CI job,ci-planhigh-impact paths and docs/CI.md. It packs core as a release does and the provider as a tarball, installs them into a copy of the site, and checks:validate --local,explain(extensions.authjs, theidentitycapability, trusted execution) andreview(functions/notes.mjshashed, no packages, no observations);URLCODE_DATA_DIR, validate refuses before serving (Missing required environment binding);urlcode testpasses twice. The first signed-in step expects zero notes, so the second run passes only on a fresh database. Arestartstep shows the file survives a restart;urlcode audit --expect-routes 3is ready;extensions.storeand anextension: storemount added,validate,testandserveall refuse. Both the declaration and the mount are named (Not registered by the host file: store);node:sqlite.Dependency cost
None added.
node:sqliteis built into Node, so there are no native builds and no network.@auth/core0.41.3 is the Auth.js proof's existing dependency, installed only into the proof's temporary copy. Nopackage-lock.jsonentries changed. Proofs are not in the packedfiles, so package budgets are unaffected.Docs
auth: truesection.Evidence and limits
npm run verifypassed locally (macOS, Node 26.10), including all proofs. This is not a statement about other databases: the proof exercises one library,node:sqlite. The Auth.js gaps (JWT sessions without server-side revocation) apply as recorded in the Auth.js proof. The missing-binding error names the route but not the variable (URLCODE_DATA_DIR).🤖 Generated with Claude Code