Skip to content

P5 O8 M1: the app's org session (sign-in from a pairing code, the held org chain, production's OrgSession) - #287

Merged
SSFSKIM merged 13 commits into
masterfrom
p5-o8-m1
Oct 28, 2026
Merged

SSFSKIM merged 13 commits into
masterfrom
p5-o8-m1

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026

Copy link
Copy Markdown
Owner

P5 O8 M1: the app's org session, from docs/doperpowers/plans/2026-10-28-p5-o8-org-interface.md (child O8 of docs/doperpowers/plans/2026-10-27-p5-org.md; P5 Decision Log 92's first milestone, first half). M2, the remote rows, follows on its own branch from this one.

What it does

  • Settings › Org signs this Mac in to the org from a pairing code (deployment admin pair --class native-mac):
    1. Access's login transfer runs in the system browser.
    2. /api/me must name the code's org and member.
    3. The device's keys are made here, for the first time on this profile.
    4. The chain is read from genesis and verified against the code's root pins.
    5. The entry is posted with the code's MAC, and its fingerprint is shown.
    6. The approving device approves.
      A relaunch is signed in again without opening a browser while the Access token lives.
  • Main holds the org chain whole, on disk (<userData>/org/, 0700/0600, excluded from Time Machine).
    • The chain sits behind an anchor that a damaged file can't move. A rollback, a fork or a stale hub can't move it either.
    • The chain follows the hub through the Registry feed (?app=1), with a certificate read every 10 minutes.
  • O7's links come up in production. The production OrgSession replaces the signedOut() arm in src/main/index.ts, and MAWS_DEV_ORG still selects O7's development session.
    • An ended Access token sets hub to null and keeps the device signed in on the direct carrier.
    • A hub that stops admitting the member reads denied and changes no trust.
  • A profile that never signs in is untouched: no keys, no files and no requests.

New dependency: tweetnacl 1.0.3 (exact, devDependencies, bundled into main) for the transfer's sealed box. No WIRE_MINOR, no settings version, no IpcError code and no e2e group. org.* is graded client and stays outside the wire manifest.

Validation Evidence

  • Unit suites, each run alone with npx vitest run --project node <file>, ending Test Files 1 passed:

    Suite Tests passed
    access-login 32
    held 22
    registry-feed 29
    hub-client 3
    org-session 56
  • The sign-in against the real hub: npx vitest run --project node-timing test/org/sign-in.local.test.ts gives 7 passed. It runs on desk-hub's Worker in Miniflare, with O13's real deployment admin rooting the org and pair --class native-mac approving.

    • The fingerprint the app shows equals the line pair prints.
    • A second session over the same profile is signed in with no login and no request until its feed opens.
    • An admin refresh is followed through the feed's notice.
    • A served rollback is refused.
    • O7's createRemoteLink comes up over the hub to an endpoint enrolled in the same org, on the production session.
    • A second member removed from the org reads denied and keeps its held head.
    • remove-device makes current() null.
  • Renderer: npx vitest run --project renderer src/renderer/src/settings-tab/OrgSection.test.tsx gives 13 passed, and SettingsView.test.tsx gives 34.

  • Class 1a (scripts/ci-gate.sh <W> --gates static,unit,probes --class1a pool --peer none): green at b581670, run 40683146373. It was green earlier at ef4bb83, run 40680282723.

  • Hosted e2e:machines and e2e:settings: green at e385fd6, run 40679346865.

  • Final tree 0ea033b: running (filled in below when it ends). It covers class 1a on the pool, the 32 hosted Electron groups (gate.yml's HOSTED_MAC_E2E), and e2e:default, unit:darwin and packaged on the mini, all with --peer none.

  • Review: doperpowers:reviewer-high ran two rounds.

    • Round 1, at ef4bb83, raised 3 P1 and 5 P2, all fixed in 59edeeb, each with a test that fails without its fix.
    • Round 2, on the fix, found nothing material.
  • Still owed: the owner's staging sitting (the live proof).

    • The fingerprint matching on a real Access login.
    • /api/me answered through cf-access-token from the app.
    • A relaunch with no browser trip.
      This is recorded in the document's Outcomes when it runs.

Residue

None needs a ticket of its own. Every residue decision is in the document's Decision Log for P5's writer; the report (docs/doperpowers/plans/2026-10-28-p5-o8-report.md) lists them with the alternatives each rejected. One item is open for the staging sitting: §E does not list cloudflared master's metadata iat check, so the transfer omits it. Whether Access sets iat decides whether to add the check, in a later change.

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

…verbatim from p5-o7-m1, the org timing and <userData>/org/ files

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…he hub client, the Registry feed, the production org session, org.* handlers and main's composition

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…roduction's session handed to startMachines over O7's seam, STANDIN_HEADER from dev-session.ts, the chain re-read from below the head for a recovery

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…pair approving, a relaunch with no login, refresh, rollback, O7's link, denied, remove-device) and the Registry feed's suite; the feed tells onClose when it drops an open socket and retries no socket it dropped

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)
…r moves with every adoption after registration and re-anchoring, an anchor write never undoes a sign-out, no attempt starts during a sign-out or before the files are read, an Access refusal of the registration's chain read is 'access', and a held-chain is retried from the hub on the certificate clock; main's wiring tests take powerMonitor, and the org's quit step holds nothing

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…d commit queue for every durable write and trust change, the org directory excluded from Time Machine in production, hub answers sanitized and certificates checked at the boundary, the feed's part sets bounded, background failures caught

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

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

chatgpt-codex-connector Bot commented Oct 28, 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-28T12:02:57.604340Z 0ea033b 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ea033bee7

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +566 to +567
const access = await files.read(ACCESS_FILE);
if (isAccessFile(access) && access.hub === reg.hub) credential = fromAccessFile(access);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reapply the stand-in admission gate when loading credentials

If a profile previously registered against the local stand-in is reopened without MAWS_DEV_STANDIN_USER, or by a packaged build, startup still restores its stand-in credential here. Unlike loginFor(), this path never checks hubAdmission(), so current() can expose the development identity and main's Registry feed can send x-desk-standin-user to the saved HTTP hub despite the current build/environment disallowing that login. Validate the saved hub and credential kind against the current admission policy before restoring the session.

Useful? React with 👍 / 👎.

Comment on lines +813 to +814
await files.write(REGISTRATION_FILE, { ...registration!, signedOut: false });
fence();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore the signed-out marker when cancelling an in-flight commit

When org.cancel arrives while this registration-file write is pending during sign-in from a signed-out profile, the write can finish with signedOut: false before the following fence throws. Cancellation leaves memory reporting signed out, but both the new credential and cleared marker remain on disk, so restarting the app silently restores the cancelled sign-in and its machine links. Unlike initial registration's post-write cancellation handling, this path performs no rollback; restore the prior sign-out state through the commit queue when cancellation crosses this write.

Useful? React with 👍 / 👎.

Comment on lines +322 to +323
probe() {
if (closed || socket !== null || parked) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Probe existing feed sockets after wake instead of skipping them

If sleep or a network transition leaves the existing WebSocket half-open without delivering a close event, the wake/unlock handlers wired in src/main/index.ts:302-303 call this method, but this guard immediately returns because the stale socket still exists. The feed has no heartbeat or liveness timeout after opening, so it continues reporting connected and receives no state notices until the transport eventually detects the failure; the session's HTTP refresh is only every ten minutes. Reconnect the existing socket on these probes, or perform a bounded liveness check that replaces it when unresponsive.

Useful? React with 👍 / 👎.

@SSFSKIM
SSFSKIM merged commit 7900026 into master Oct 28, 2026
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…8's M1 ticked; the hosted flake row takes the day's P5 signatures

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

- src/main/index.ts: in startMain, O2's settled hosts (createHosts(MAIN_BUILD, launch)),
  then #287's org session, Registry feed and org handlers, then O6's machines, which read
  that session. #287's org shutdown closes startMain. startMain is O2's function (the lock
  callback closes once the launch has settled), so #287's closing line for the lock
  callback is not taken. The P9 guard and the identity, settings and launch order stand.
- grades.ts and schema.test.ts: both sides; daemon, then machine, machines and org.
- Master's wire is 4 and its settings are 19, so no re-bump. The regenerated manifest is
  unchanged.

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