Skip to content

P5 O3-C: the spine as a library with two roots - #349

Merged
SSFSKIM merged 42 commits into
masterfrom
p5-o3-c
Oct 29, 2026
Merged

SSFSKIM merged 42 commits into
masterfrom
p5-o3-c

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

P5 O3-C moves the spine into a library, src/services/, with two roots, so O3-D can move a process without moving a design. The index and read model, attention, the owner channel, the session service, settings' machine half, lane A (O9's local half, folded per D35), git, scm and files now live under src/services/. Lint rule A keeps that tree free of Electron and src/main/.

Two roots compose the library, both reached through one entry, out/main/services.js:

  • openSpineData / startSpine
  • startCheckouts

Main's root imports only that entry and holds the SpineView, the machine settings and the stop functions. Every staying reader goes through the view. The inactive sweep reads the machine's interest set. Nothing a person sees changes. The wire is unchanged (wire-manifest.json, WIRE_MINOR), and there is no settings version or index migration.

  • Spec: docs/doperpowers/plans/2026-10-28-p5-o3-c-spine-library.md. Decision Log D26 to D38 were added during execution, and Outcomes & Retrospective is written.
  • Report: docs/doperpowers/plans/2026-10-28-p5-o3-c-report.md.
  • Parent: docs/doperpowers/plans/2026-10-28-p5-o3-spine.md, O3-C.

Behaviour changes that came from the reviews:

  • Each root's stop attempts every part, whatever an earlier part threw (D31 (6)).
  • Attention's stop writes what it owes and arms no retry after the stop (D34). This fixes a quit-time race that production had too.
  • e2e/browser.spec.ts's popup case now expects the close it causes.

Validation Evidence

All gates ran through scripts/ci-gate.sh. Class 1a used --gates static,unit,probes --class1a pool --peer none. The hosted line used --runner macos --lane hosted --peer none. Measured groups ran on the mini.

Landing head 8544c48 (master 5b7f510 merged; 4181c45 adds only the spec record and the report):

  • Class 1a: 40866274156, green, no flaky lines.
  • All 36 HOSTED_MAC_E2E groups on the daemon shape, e2e:browser included: 40866279797, green, no flaky lines.
  • e2e:default: 40868072929, green, --lane no-hosted on ci-kit-mac-ec2. 211 passed, 238 skipped, no flaky lines. The tested tree is 320683dc, which is 85f5e06's (8544c48 plus the spec record).
  • Local: pnpm typecheck clean; eslint clean on the touched files; vitest run test/support/daemon-idle.test.ts 42/42.

Acceptance 5, the idle reading (e2e:daemon-idle-spine, the mini, measured tree 4c3fcbe). Fixture: D19's 5,000 sessions in 50 projects, 300 attention items (40 pending), 1,000 library rows, 50 drafts, 2,000 prompt-history lines. gc ran twice before each released window, and CPU was 0.00 s in every window.

Run Loaded KiB Released KiB Peak (loaded / released) Old peak rule Rule B (#340)
40854697391 39,937 32,273 3.1 / 7.6 (released pair 4.38) void valid
40859096497 39,473 32,481 9.5 / 7.9 (pairs 3.90 / 3.09) void valid
40859186626 40,065 37,809 4.6 / 2.5 valid valid

The architect accepted the series under Rule B. The spread in the released column is explained in D38: the spine has no quiet collection, and a plain gc() keeps the young generation's pages.

Bundle. services.js and its three chunks on 8544c48 are byte-identical to the measured tree 4c3fcbe:

  • identity-CRq8a5DV 4d2987d2…
  • identity-file-BQq3c_d9 a8b64298…
  • identity-HxLrgFmc bb7e28df…
  • services.js 7c576dcd…7267

Acceptance 6. e2e:local-latency-daemon 40859143874:

  • delta-to-frame p50 / p95: 24.1 / 37.5 ms, against limits of 26.45 / 42.56;
  • round trip: 1.2 / 1.4 ms, against limits of 2.9 / 6.3;
  • load 3.3.

Master's last run, 40606738513, read 25.9 / 38.4 and 1.1 / 1.6 ms.

Per milestone:

Milestone Head Class 1a darwin Hosted
M1 87ce79b 40757701506 — 40757466033
M2 5e30b6d 40771214235 40771212882 40771215030
M3 6328850 40787907930 40787362983 40787363217, with default
M4 9d0dd95 40794436385 40794459408 40794459778, 34 groups plus default
M4 fix c61750e 40803494215 — —
M5 30697b8 40807345581 — —
M5 fix c7707ca 40809391057 — —
fold 50d16aa 40814662740 — —
429eef9 — — 40816175078 40816183920, reruns 40819766589 and 40819767307
e89b043 — — 40830986296 lane-a 40833262076
b1f1aa4 — — — mini e2e:default + unit:darwin 40839426977
4c3fcbe 40852627425 — — 40852606918, 36 groups

Reviews:

  • A task review at every milestone: clean, after the M2, M4 and M5 fixes.
  • reviewer-high on the whole branch, 87af670..8fc6408: no material findings.
  • Task reviewer and reviewer-high on the lane A fold: both clean.
  • reviewer-medium on the browser fix and the landing merge's resolution: no material findings.
  • CI-opt reviewed the .github hunk 30697b8 (52 to 56 of 60 minutes; no E2E_MINUTES entry).

D32's lists, pinned by src/services/spine-root.test.ts:

  • The held run registers 82 commands: 65 plus 17 laneA.*.
  • The refused run registers 22.
  • startCheckouts registers 26.

Flaky passes explained:

  • connectors-direct.spec.ts:701 is admitted as hosted signature 15, after the latency bound above.
  • browser.spec.ts:34 is fixed by bc4d9da.
  • design-systems:140 is signature 10.

Unresolved Review Findings

  • SQLite ExperimentalWarning lines in vitest and e2e output. Raised as a Minor in the M1, M2, M4 and fold reviews. Node's node:sqlite prints them. They are noise only and were left to keep output handling out of this branch.
  • ci-gate's advisory warnings in validation output. These are "unit omitted", the "missing e2e:…" reach notes and "unreadable package script" for e2e:daemon-idle*. Raised in the M2 and M3 reviews. They are advisory; the landing head's hosted line and e2e:default cover the reach notes.

Residue

  1. The bundle guard's require member-call trap. The guarded-entry scanner reads any method named require as a load. M4 renamed SessionStore.requireRecord (src/services/index/sessions.ts) and StubStore.requireRecord (src/services/sessions/stub-store.ts) to work around it. The next library class with such a method will fail the services guard.
  2. Stale comments naming src/main/ paths. They remain in the eight src/shared files of D31 (9), in src/shared/engine/launch-spec.ts, in e2e/support/live-budget.ts, and in lane A's schema and renderer comments that still name src/main/lane-a/. They are comments only; refreshing them here would have widened this branch's e2e reach.
  3. The diagnostic release should use lastResortCollect. Switch idleReading's release to lastResortCollect, and log the heap before and after in the spine case, so a re-run of e2e:daemon-idle-spine measures what mawsd will do. It was left alone so the accepted series stands (D38).
  4. spine-root.test.ts's refused run waits about 5 s of real time. openSpineData takes no wait option for SPINE_LOCK_WAIT_MS, so the case sits in the timing project. A wait port would make it fast.
  5. [parent-impact] for O3-D:
    • a refused run still registers the index's record commands;
    • scenario projects against the RL6 listings (D28);
    • whether mawsd runs launch mode scenario;
    • the restored-attention mark the wire does not carry;
    • the dynamic-import() ban against §11's cold core;
    • D38's footprint estimate: about 48.5 to 54.1 MB for mawsd with the spine released, against 33,048 KiB of headroom. The spine's release in mawsd should call idleCollector.dropped().
  6. gate-affected.mjs's SOURCE_READERS lacks two readers. It names neither test/services/boundary.test.ts nor test/artifacts/portability.test.ts. Both read eslint.config.js, which already sends a selected run to the full suite, so nothing is missed today.
  7. Lane A's case in spine-root.test.ts covers sessions only at start. It covers sessions the index holds when the spine starts, not a terminal session whose holder changes later.
  8. Flakes seen:
    • OrgSection.test.tsx useNow: seen, owner O8.
    • connectors-direct:701: hosted signature 15.
    • design-systems:140: signature 10.

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

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
The spine's and the checkouts' modules register, intercept, emit and tap through an injected ServicesBus (src/shared/spine/bus.ts) that main's root binds to its router and emit; their handlers fail with HostCommandError, and their host types come from @shared/host/host-supervisor. The two compositions that straddled the line are cut in place: main composes registerLibraryFiles beside startLibrary (D22) and startArtifactDefaults beside startArtifacts (D23). Their suites run against test/support/fake-bus.ts, which answers through the registry's codec as the router does.

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)
SpineView (src/shared/spine/view.ts) with its in-process backing createSpineView (src/main/sessions/spine-view.ts), built by main's root over the read model, the index's project sets and library, the intent store, the attention service's restored ids and the session service's acquire. Every reader of the reader map (R1 to R15) takes the narrowest Pick of the view: the notifier (restored marks in band as an attention change's silent set; a hidden project names none), notification actions, the quit guard, the chat panels, the interest report, the browser (reconciled again at each availability change), its agent reach, connectors' routes E and D, the export authors, the org rows, Settings' reveal, files' allowlist and admission, git.lsFiles' roots and scm. The inactive sweep takes interest() in place of the layout; main computes one memoized set (appInterest) for the report and the sweep. openSessionTabs and dropPanelKeysOfRemovedSessions (D17) are gone; the panels' cases now drive registerChatPanels. Every reader's tests drive it through test/support/fake-spine-view.ts.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
midTurnCountOf leaves @shared/engine/status (which nearly every e2e spec reaches, so ci-gate asked for the layout, delivery, desk-web-hub and default groups for an additive helper) for @shared/engine/mid-turn; status.ts is master's again.

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

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…and O3-D's listing question

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

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
The org rows stay composed over the view below it; the roster, onRoster and the client port are master's earlier declarations (#314 made the client port before the org session).

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…o src/shared/

The disposition table applied with git mv: the spine (index, sessions but the client's interest, panel lifetime and
launch mode, side threads, prompt history, the owner channel, attention's core, settings' machine half, the library's
derived index, worktrees, the defaults relay, the machine identity) and the checkouts (git, scm, files, files'
admission, the release fences) under src/services/ with their tests; atomic write, the tail reader, the settings file
store and paths, the launch mode, session directories, the engine's config directory, sminos's project ids and the
MachineSettingsService interface under src/shared/. Every import re-pointed across src, test and e2e, with the
TIMING_NODE_TESTS, tsconfig.e2e.json and tsconfig.web.json entries; tsconfig.node.json and the node project include
src/services/. No logic changes.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Rule A over src/services/: no import from main, mawsd, the renderer or the preload, nor Electron or main's
open-external, with src/'s Yjs and endpoint patterns restated and the dynamic forms refused. Rule B over src/main/ but
its suites and its root (exempt until M4 narrows it to the services entry): no import from src/services/; staying code
reads the spine through @shared/spine/view. MACHINE_BOUND keeps what stays machine-bound under src/main/ (the
library's files, connectors, delivery, the catalog, usage, the gateway), with oauth-root.ts the one allowed file.
test/services/boundary.test.ts lints scratch sources through the repository's config to show both rules fire; it runs
in node-timing beside the portability test.

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

startSpine (with openSpineData before it) and startCheckouts compose their sets from injected dependencies; the spine reads the machine half of the settings alone (D12); main holds the view, the checkouts' readResolved and the two stops. Rule B narrows main's root to src/services/entry. spine-root.test.ts composes both under plain Node and pins each root's commands, intercepts and taps (D25).

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

out/main/services.js and its chunks are a guarded entry under P5 Decision Log 114's rule: Node's builtins, zod and the MCP SDK, never electron (D13, D26). Two private methods named require are renamed requireRecord, since the guard reads every require( call as a module load.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…m (D30's residue, the files this run reaches)

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

A root's stop runs its parts in today's order and logs each failure by name ([shutdown] <root>: <part> failed; going on), as main's shutdown steps did when each part was a step (D21). spine-root.test.ts injects an index-close and a git-dispose failure and sees every later part stop, stops the roots in production's order (spine, then checkouts), and pins the replayed turn's last assistant line.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…dpoint fixes, desk-hub eyJ fix) into p5-o3-c at M5's start

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…fixture, e2e:daemon-idle-spine)

The services entry exports idleReading: the spine composed alone over a profile with stand-in ports (no engine host, a clientless bus, a noClient port, no interest), logging what it read, and on SIGUSR2 stopping the root, dropping it and collecting twice under --expose-gc. test/support/spine-fixture.ts writes D19's profile (5,000 sessions over 50 folders, 300 attention items with 40 pending, 1,000 library rows, 50 drafts, 2,000 prompt-history lines) through the index's stores and the prompt history, from a seeded generator. e2e/daemon-idle.spec.ts's sixth case, 'spine alone', runs the built out/main/services.js under the Electron binary as Node (argv0 maws-spine) and reads IDLE_RUN's window loaded and SPINE_RELEASED_RUN's after the release, printing spineLine; pnpm e2e:daemon-idle-spine runs it alone and the two inverting scripts leave it out.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
The spine's idle reading is a measured group like its five neighbours in e2e/daemon-idle.spec.ts. No E2E_MINUTES entry: its two settles and windows take 19 minutes and the fixture and composition seconds, within the about 28 minutes a measured build's 60 leaves after both settle guards' 15-minute bounds and the prebuild.

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

The task review found a release right after composing left attention's startup writes queued: the root's stop closed the index in the same pass, each queued write then failed ('database is not open') and armed a retry the stop had already cleared, so the service and index outlived the release. The attention service now writes what is still owed inside stop() (the index store writes synchronously, before the root closes it), and a write queued or failing after the stop neither runs nor arms a retry. idle-reading.test.ts's immediate release asserts no console line, no timer left and the attention items still stored. The fixture's attention items are of the kinds a profile keeps across runs (error, interrupted, auto_mode_unavailable): broker kinds were dropped from the store at the spine's start, so the loaded spine held none of them.

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

rows.ts keeps O8 M5's memberNames import and takes repoProjectId from @shared/machine/project-ids, where M3 moved it.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…rds at 3d1f3ff) into p5-o3-c at M6

Conflicts, each resolved so both sides hold:
- src/main/index.ts: M4's side. O9's lane A block sat in the stretch of startMain that M4 moved into startSpine (the
  index, attention and the index source it reads are the spine root's now), so it and its three imports leave main's
  root here; the fold that follows composes lane A in startSpine (O3-C D20, O3 Decision Log 13). At this commit lane A
  is not composed.
- src/main/attention/notifier.ts: both comments; the notifier reads through the view (R1) and keeps lane A's in-app-only
  rule (O9 M6, Q5).
- eslint.config.js: M3's narrowed MACHINE_BOUND (and its tests' list) gains lane-a while it is under src/main/.

Beyond the conflicts: lane A's imports of paths M3 moved are re-pointed (atomic-write to @shared/fs, git's runner to
src/services/git/, the two value imports marked as rule B's exception until the fold moves lane A); O9's new notifier
case drives the fake view rather than a read model writer.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
- src/main/lane-a/** moves to src/services/lane-a/** (git mv, tests included); MACHINE_BOUND loses lane-a; the
  driver's MainHandler type becomes the bus's ServiceHandler, and its imports reach git's runner beside it.
- startSpine composes the driver, registerLaneA through the bus, lane A's attention list and the index wiring O9 put in
  main's root (the records observed at start, the index's onChange to observe/forget, the transcript path, the bridged
  digest), only while the run holds spine.lock. Its stops ('lane A attention', 'lane A') sit after attention's and
  before the read model's and the index's close, today's relative order. The sminos home reads SpineDeps.env and the
  shell capture, the profile is its userData, the machine ref its writer: no new port.
- isLaneAItem moves to src/shared/attention/lane-a-item.ts, since the client's notifier reads it and rule B forbids it
  the library.
- spine-root.test.ts pins the 17 laneA.* commands in the held run's set (none in the refused run's; no intercept or
  tap), and drives a terminal session the index held at start through a fake bridge: laneA.state live, its raised
  request a pending attention item, its digest waiting.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…o3-c for landing

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…for the measured series

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…ub) into p5-o3-c for landing

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…, bd6b4b0) into p5-o3-c for landing

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…uses (browser.spec.ts:34's flaky)

#close calls window.close(), so the click can reject with 'Target page, context or browser has been closed' when the page goes before the click resolves. Wait for the close event beside the click and let the click's rejection pass only when the page did close.

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

The three daemon-idle files: the imports join both sides; the spine case keeps M5's spineLine, SPINE_RELEASED_RUN and the 'spine alone' case on master's Rule B. SPINE_RELEASED_RUN gains pairLoad (IdleRun now names it), the spine line prints each window's 30 s pair as master's lines do, and its test fixtures carry loadPair. services.js and its three chunks are byte-identical to 4c3fcbe's.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…s, the released spread, O3-D's estimate, the browser fix, the landing merge), Outcomes & Retrospective

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

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

chatgpt-codex-connector Bot commented Oct 29, 2026 •

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 ✅ Completed 2026-10-29T12:19:57.571600Z 4181c45 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 00c6b1f into master Oct 29, 2026
SSFSKIM added a commit that referenced this pull request Oct 29, 2026
…pine a library with two roots; O3-D dispatchable with its parent-impact notes; six tracker rows and hosted signature 15; today's merge shas shortened

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 29, 2026
…9-remote

One conflict, in src/main/index.ts's import block: O8 M4a's page-fixture import beside remote lane A's; both kept.

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