Skip to content

P5 O3-A: the data's owners and the writer guard (settings split, spine.lock, the browser's tables out of the index) - #311

Merged
SSFSKIM merged 21 commits into
masterfrom
p5-o3-a
Oct 28, 2026
Merged

SSFSKIM merged 21 commits into
masterfrom
p5-o3-a

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026

Copy link
Copy Markdown
Owner

P5 O3-A, "The data's owners and the writer guard": the brief child of docs/doperpowers/plans/2026-10-28-p5-o3-spine.md (child O3-A; parent pin blob e499132f4 on master 94a69b5). Ledger: docs/doperpowers/ledgers/2026-10-28-p5-o3-a.md.

Every file of the profile now has one owner and one writer. The process that runs the spine takes spine.lock first, and an older build is refused rather than raced. Moving the spine into mawsd (O3-D) then changes which process runs it, not the data.

What changes

  • The settings split (§3).
    • settings.json becomes the client file at version 21 (theme, keymap, notifications, appearance, voice, browser, usage, the supervisor's shape and quit default, the comments view, the export author).
    • machine-settings.json holds the machine's fields on its own version line from 1 (engine, gateway, permissions, mods, the idle time, the design-system defaults, the sweep).
    • The split runs once and idempotently under the lock: the machine file is written first, then the client file. A profile with no settings.json still gets the client file, as the version fence for older builds.
    • The renderer's settings.* keeps one merged Settings; each field of a patch goes to its owner's file.
    • The client half moved to src/main/client/settings.ts, so MACHINE_BOUND_ALLOWED drops its settings exception.
  • The readers.
    • The engine host's customization inventory and configured delivery read MAWS's MCP servers from machine-settings.json, falling back to a unified settings.json while no split build has run.
    • The app scope's OAuth identity keeps naming <profile>/settings.json, so saved sign-ins survive the split.
    • The catalog watches the machine file.
  • The writer guard (§2).
    • <profile>/spine.lock uses O2's takeLock. Main takes it after settling the launch's shape (read from the client file without the lock) and before either settings file or the index. It waits up to 5 s for an exiting holder and releases the lock at process exit.
    • A run that finds a live holder starts none of the spine's writers or launches, and relays none of the machine settings. It opens the index unavailable without opening its file, and reads the machine settings without writing them. It names the holder in host.status (new optional spineRefused) and in a Diagnostics row.
  • The browser's tables leave the index (§4).
    • Index migration 14 drops browser_history, browser_bookmarks and browser_activity. Inside the same migration transaction, they are first staged into <profile>/browser/browser.sqlite.
    • The browser promotes staging only once it reads the index at 14 or above. Until then its tables stay inert.
    • The activity's FK cascade becomes three things: deleting rows on a session's removal, a reconciliation at each complete snapshot of the spine's sessions, and an in-memory known-session check on append.
    • An index no connection holds has its version read from the file header, so no -wal or -shm is ever created by the reader.
  • e2e.
    • e2e/spine-lock.spec.ts, in e2e:settings: the refused launch beside a live holder, proven over the files.
    • The settings, smoke, voice, design-systems, browser-chrome, library, daemon-idle and connector-cold-delivery specs follow the split and the new database.
    • e2e:cross-build's (downgrade, daemon) scene now keys on the attacher's build, see below.

No wire change and no WIRE_MINOR bump. Numbers used: settings version 21, machine settings version 1, index migration 14 (P5 Decision Log 101).

Gates

  • Full set on ccadfc2f7 (--gates all, hosted lane), run 40733209172: green with no flaky line. This covers class 1a, unit:darwin, e2e:default and every class-1 e2e group.
  • The late delta, e2e/cross-build.spec.ts alone plus the ledger: static and e2e:cross-build against master's post-O2 peer, run 40743259057 on 471c361, green: all four cross-build scenes passed, (downgrade, daemon) among them.
    • Before, the (downgrade, daemon) scene was red on master itself against a post-O2 peer: run 40736947722 (master 1bf619c, peer 94a69b5).
    • It is red on O3-A's tree too: run 40733229010.
  • packaged on ccadfc2f7: 199 of 200 twice, runs 40733229010 and 40736955873. The one failure is the known relay-down sessions.spec.ts fork test (tracker row of 2026-10-27). The fork runs direct against the runner's custom base URL, so no relay card appears. The same test fails on master's tree too: run 40740460276 on 1bf619c, 198 passed and 1 failed.
  • Earlier runs:
    • Class 1a on 17ccbb1: run 40724138962, green.
    • Hosted acceptance-9 groups on 0799f15: run 40725948664, 12 of 13 green. e2e:settings caught the -wal/-shm creation, fixed in ccadfc2.

Review

doperpowers:reviewer-high, three rounds with 2, then 1, then 0 findings:

  • Round 1: the version fence on a profile with no settings.json, and a real OAuth round trip for acceptance 4.
  • Round 2: the lock's release had been moved to a will-quit step; it is back to process exit only.

Each fix came with a test that failed first.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…used option)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…rowser.sqlite (index migration 14, staged; the browser promotes once it reads 14, and keeps the activity's cascade itself)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…-A build's rows in between, a restored index, the browser waiting on the index), the index's 1-to-13 opener, and the e2e rewind and bookmark reads at the new file

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…handlers' test

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…ile, and spine.lock with the refused run

settings.json becomes the client file at version 21 and machine-settings.json the machine's at its own version 1 (the O3
document §3's table, held by a partition test); the split runs once and idempotently under spine.lock, after the launch's
shape is read from the client file without the lock and settled; a run refused the lock starts none of the spine's
writers, opens the index unavailable, reads the machine settings without writing them, and says why in host.status and
Diagnostics. The engine host's inventory and configured delivery read MAWS's servers from the machine file (a unified
settings.json while it is absent); the app scope's identity keeps naming settings.json. The catalog watches the machine file.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…x migrated again) is promoted at its next reattach; the index's version is read with a short busy timeout

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…d the index

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…'s staging is promoted

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
… in progress left to the holder; the refused launch end to end

engine.configure, the budget's policy, host.configure and the design-system defaults are the spine's relays: a run
refused spine.lock pushes none, so nothing it read before the holder changed a setting overwrites the holder's push. A
refused run meeting the holder's split in progress (its machine file written, settings.json still unified) reads both
halves and finishes nothing. e2e/spine-lock.spec.ts (e2e:settings): beside a live holder every spine file stays
byte-identical with none new, the split is not finished, host.status names the holder; once the holder is gone the next
launch takes the lock, finishes the split, and releases it at quit.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…keeps every value and row, each in its owner's file

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…er's M5 and acceptance-1 decisions

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…h no settings.json; a saved app-scope grant adopted across the split

A profile whose settings were never changed now gets settings.json at 21 beside machine-settings.json (and a start that
finds the machine file without a client file writes it), so a build before the split runs on its defaults with writes
refused instead of writing a unified file whose machine fields a later split would lose. The OAuth round trip: a grant
sealed under <profile>/settings.json before the split is delivered by route D after it through the host's own source
conversion, with no Connect.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
… to 114)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…ne, never at a will-quit step

The will-quit steps' promises settle after the last step is called, so a release there let a writer still finishing
(an intent's rename) run beside a candidate that took the lock meanwhile. Electron 44's main emits Node's exit on both a
plain quit and the held app.exit(0) path (a scratch-profile probe), so the exit-only release holds the lock for the
process's life.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
… creating no -wal or -shm beside it

Hosted e2e:settings (run 40725948664) caught it in e2e/spine-lock.spec.ts: in a run refused the spine the browser's
read-only check of the index's version opened a WAL database no connection held, and SQLite created index.sqlite-wal and
-shm, files of the spine's. With no -wal the file is whole and its header holds the committed version, read as bytes;
with one, a read-only connection reads what the WAL committed beyond the header.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…ttacher's build makes it go

An attacher that knows the daemon shape (P5 O2, wire minor 5) ends the profile's mawsd by SIGTERM before its own hosts
start, as it leaves the daemon shape, so mawsd logs exiting (signal) and the attacher's main logs ending it; one from
before O2 takes the engine host and mawsd logs that it was taken. The scene was red against every post-O2 peer, master
included (run 40736947722); the poll that the keeper's mawsd exits and everything after it about the kept session and its
tail are kept.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…d outcome

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-28T18:30:49.710357Z a0168b4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SSFSKIM
SSFSKIM merged commit e1c8d35 into master Oct 28, 2026
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…esidue and flow-back; O3-C dispatchable; tracker flakes

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
The conflict was daemon-idle.spec.ts's imports: O3-A's machineSettingsDefaults with M10's enrolled readers.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
SSFSKIM added a commit that referenced this pull request Oct 29, 2026
…t, O8/O13 fixes)

One textual conflict:
- .github/scripts/e2e-default-specs.test.mjs: both sides moved the bare total from 98 to 99, O9 for e2e/lane-a.spec.ts
  and O3-A for e2e/spine-lock.spec.ts. Merged: 100 (116 e2e/*.spec.ts, 16 excluded by testIgnore/testMatch), both
  notes kept, O9's first. The relaunch case's 'bare set's N specs' regex, which auto-merged at 99 (identical on both
  sides), is set to 100 too.

Auto-merged and checked: gate.yml (CLASS1_E2E keeps lane-a beside master's lists; HOSTED_MAC_JOBS is master's
packaged); ci-gate-pool-demand.test.mjs keeps 2x37 (Lane: hosted) and 2x35 (Runner: macos), no group added by master;
routes.json and address-paths.json equal a fresh regeneration; wireFingerprint() 162aa56eba3e5352, master's.
src/main/index.ts auto-merged; the lane A composition's guard against O3-A's refused spine follows separately.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
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