Repository navigation
feat(core,auth,audit): refuse a second host and a network filesystem without the store (#941) - #949
Merged
Merged
Conversation
…ork filesystem without the store (#941) The network filesystem check and the host lease move from the store into core (packages/core/src/host-lease.ts, exported by @jimhoyd/urlcode/extensions as refuseNetworkFilesystem and joinHostLease). Each SQLite extension keeps its lease in its own database: store_servers (unchanged), auth_servers (one row per auth activation) and audit_servers (from the first audit activation until the audit host closes). Auth now also refuses a database directory on a Linux network filesystem, at activation and in the urlcode-auth commands. Audit drops its own copy of the filesystem list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 29, 2026 19:00
…se and hermetic seeding compose Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y is removed (Windows hang) Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
* fix(scripts): pack-addons refuses unbuilt add-ons, and install names a missing ./extension file (#960) pack-addons packs with --ignore-scripts, like every pack in the repository, so it never builds. It now refuses, before packing anything, a package whose exports or bin name a file that is not there, naming each file and the build that makes it. Installing an add-on whose ./extension export points at a missing file now says so and names the file, instead of claiming the package has no ./extension entry. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Merge main into claude/pack-addons-960 (#949, #967); re-measure budgets Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Sep 29, 2026
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.
Fixes #941
What changes
packages/core/src/host-lease.ts, re-exported from@jimhoyd/urlcode/extensions:refuseNetworkFilesystem(directory, what, probe?),joinHostLease(db, {table, what, probe?, now?}),hostProbe,NETWORK_FILESYSTEMS,SERVER_LEASE, and the types. It is the store'stopology.tslogic made generic: the table name and the database name in the error are parameters. The lease table is created when it is missing (CREATE TABLE IF NOT EXISTS).dbcan be a plainnode:sqliteDatabaseSync(the helper runs its ownBEGIN IMMEDIATE, and does it outside itstry, so a failedBEGINnever rolls back a transaction someone else opened) or an object withtransaction/run/all(the store'sStoreDatabase).topology.tsis now a thin wrapper.joinServerscallsjoinHostLease(db, {table: 'store_servers', what: 'store'})and re-exports the rest. The store's behavior, table, messages and tests are unchanged, and its test files are untouched.urlcode-authcommands (migrate,create-user,find-user) refuse a database directory on a Linux network filesystem, using the samestatfslist. Each activation joinsauth_serversinauth.sqliteand is refused while a live peer runs on another host.close()releases the lease.createAuthExtensiontakes aprobetest seam.NETWORK_FILESYSTEMS/refuseNetworkFilesystemand uses core's. The first activation joinsaudit_serversinaudit.sqlite, and the audit host holds that lease untilclose(). A refused join is retried by the next activation.activateis now async.createAudit/openAuditStoretake aprobetest seam.Why a core helper
Before this PR the logic had two copies (store, audit), and #941 would have added a third (auth). Core's
@jimhoyd/urlcode/extensionsalready exports shared extension helpers for exactly this reason:assertSafePattern"instead of maintaining its own copy that can drift",isSameOriginRequest,clientKey,readBody. The helper is generic: it has no store tables or types and no knowledge of any package. Each extension names its own table in its own database. Core still imports no package (the core boundary check passes). I did not make it a store-exported helper, because auth and audit would then depend on the store, and the point of #941 is sites that do not have it.Tests
test/host-lease.test.ts(core rules):nowclock) does not count;closedeletes the row;f_type); ext4 passes, and darwin/win32 are not checked.packages/auth/test/auth.test.ts:probe, and not checked on darwin;startServer, a same-kernel container starts, and an expired leftover lease does not count.packages/audit/test/audit.test.ts: the same lease cases throughcreateAudit/activate, including that the refused audit stays inactive and activates once the peer closes.npm run test:multiprocessstill pass, so several processes on one host stay supported.Run locally on macOS, Node 26:
npm run verify(everything up to the package audit passed on the first run; the rest passed after the budget update),npm run audit:packages,npm run test:addons,test:proof,test:proof:authjs,test:ecosystem,test:multiprocess,npm run test:package.Budgets
Core measured 1019347 packed / 4025827 unpacked bytes and 519 entries (Node 26). Its budget goes to 1000 KiB packed and 3935 KiB unpacked, which leaves room for Node 24's roughly 800 extra packed bytes plus about 3 KiB of headroom. The audit and store packages shrank (27304 and 130904 packed bytes); auth is at 18276, under its 21 KiB budget.
Docs
RIM-STORE-PERSIST-001card now points at the core seam.Limitations
probe.BEGINfails) and retried 5 s later, well inside the 20 s TTL.🤖 Generated with Claude Code