Skip to content

P5 O11 M7: the app's hub connection (OX8) and U9 - #208

Merged
SSFSKIM merged 9 commits into
masterfrom
p5-o11-m7
Oct 27, 2026
Merged

SSFSKIM merged 9 commits into
masterfrom
p5-o11-m7

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 27, 2026

Copy link
Copy Markdown
Owner

P5 O11 M7: the app's hub connection (OX8) and U9 (docs/doperpowers/plans/2026-10-27-p5-o11-hub-v2.md, M7).

What this lands

  • U9 is decided: Access's login transfer (the flow cloudflared access login uses: the system browser plus a polled transfer token). Per-device service tokens are discarded by the spec's tie rule, because the login transfer adds no Access credential per device.
    • The hub needs no device principal and no X-Desk-Device. worker.ts and src/identity/ are unchanged. Access turns the app's cf-access-token into the assertion the Worker already verifies.
  • The Registry socket, for apps.
    • A socket opened with ?app=1 gets state {version} notices, a listings {records, last} snapshot paged at 256 KiB of records at most, and a listing frame for each stored listing. The flag is kept across hibernation.
    • Desk-web's grid socket gets the grid alone, as today.
  • A Node reference client in apps/org-protocol/test-support/. It holds the Registry, Project and Machine sockets as a device's member, registers a device-bound push subscription, and closes every opened socket on any failure.
    • It has a CLI: pnpm -s --filter org-protocol reference-client --hub <url>, with DESK_ACCESS_TOKEN= on stdin.
    • M6's RelayApp moved here, and fake-machine/relay-app.ts re-exports it.
  • The O11 document. M7 is ticked, its decisions and discoveries are folded in, and §B's registry-socket row now names ?app=1.

Validation Evidence

  • U9 spike, against staging only.
    • Both candidates were prototyped in Node.
    • The login transfer's app token lives 720 h, the staging app's session_duration.
    • The owner ran the Node prototype's live sign-in. The transfer completed, and both tokens arrived about a minute after the URL was built. /api/me with that token and renewal without a browser were not captured.
    • The service-token spike's two staging tokens were deleted, and a listing by name shows none left.
    • Production's X-Desk-Build was hub@3486527c before and after.
  • Tests. On M7's fix heads: desk-hub 873/873 (65 files), org-protocol 42/42 and desk-web 919/919. Typechecks are clean, and eslint is clean on the touched files.
    • Fixes were test-first. Undoing either half of the snapshot fix reproduces desk-web's PartsBudgetError loop.
  • Review. doperpowers:reviewer-medium found three P2s; the fixes went through two waves.
    • Fixed: the unbounded snapshot that looped desk-web's grid socket past 16 MiB of listings, and two socket leaks in the reference client.
    • Dismissed, with the dispatching session's agreement: "U9 is not proved live". The verdict was accepted, and M8's acceptance 6 runs the reference client with a login-transfer token.
    • The last re-review closed everything but the readiness leak, which was fixed in 179c9fc and checked by reading the diff.
  • Staging. Acceptance 6 is proved in the suites. Its staging run is part of M8's acceptance run.
  • CI: ci-gate GREEN on c29074620 (static, unit, probes, e2e:desk-web), with master and M6 merged in: https://github.com/SSFSKIM/MAWS/actions/runs/40452563529. The run before it, on ed0adcfe3 (the same code before master's docs commits), failed only the tracked desk-web chromium flake e2e/stream-scroll.spec.ts:231. Its rerun passed: https://github.com/SSFSKIM/MAWS/actions/runs/40451754521 (attempt 2).

For O13

  • web-cards opts in with ?app=1 when the phone needs listings, and then gets the same bounded pages.
  • Renewing the login transfer's org token without a browser is unproven. Until it is, the app's sign-in costs one browser trip per 720 h.
  • The login transfer rides undocumented Cloudflare endpoints, the same ones cloudflared uses.

For the architect's tech-debt tracker

  • apps/desk-hub/deploy/deploy.ts:72: child.stdin.end(input) has no error handler. Under load, an unhandled EPIPE failed a full desk-hub run once even though every test passed.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)

…5-o11-m7

M4 and M6 were cut from M3 before its review fixes, and M5 from after them, so the
M7 branch lacked M3's fix waves 2-4, the landed M1 and M5's v2 events. The five
conflicts were both sides adding: the push subscription keeps M3's member check and
M4's device; an accepted state is stored as M3's durable announcement to each
project and announced to each active machine's object as M6 does; the Worker takes
M3's submitTransition(you, ...) and pendingDevices Result beside M4's routes; the
test seams keep both sets. One semantic conflict: M1's revoked delegation holder
now carries its prefix, so M4's delegation test names it.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
U9 is settled by the spike against staging: Access's CLI login transfer (the
flow cloudflared access login uses) and a per-device service token both pass
the promote rule, and the tie goes to the login transfer. So no device
principal: the app sends Access's app token as cf-access-token and the hub
admits it as the person's member, as for a browser.

The Registry socket gains the app's frames beside DX3's grid, which stays
first: on connect the org state's head version (state) and every listing
held (listings), then a state notice at each accepted state and a listing
as each is stored; a repeated or refused listing is not relayed.

apps/org-protocol/test-support holds the Node reference client: the routes,
the Registry, Project and Machine sockets (M6's RelayApp moved here, the old
path re-exporting it), acceptance 6 as one run, and a CLI that takes the
token on stdin.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Six files conflicted, each where M5 (merged into M7 before) and M6's fix wave
both touched the same lines. submitState takes M6's durable announcements to
every project and relay object (the announcements table, owe), which
supersedes M7's earlier in-memory announceToMachine, and keeps M7's state
notice to the registry sockets. The Worker takes M6's machineEndpoint(you, ...);
project.ts imports both M5's resendNonce and M6's Sent; the test seams keep
both milestones' paths. fake-machine/relay-app.ts was not changed by M6's fix
wave, so the moved RelayApp needed no port.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
The three test-seam files conflicted only on order: M6's registry-RPC seam and
M5's head-fault and state-cache seams, the same lines in two orders. M7's
side is kept as it stands. The O11 document is p5-o11-m5's, with M1-M5
ticked.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…leaked sockets

The Registry socket sends the app's frames only to a socket opened as an
app's (/api/registry/socket?app=1); desk-web's grid socket, without the
query, keeps the grid alone. The listings snapshot comes as listings pages
of at most 256 KiB of records each (a larger record alone), the last one
marked, so no frame grows with the org's listings. Before, 20 listings of
about 900 KB passed desk-web's 16 MiB parts bound, and its grid socket
closed and reconnected into the same snapshot forever.

The reference client opens its three sockets with openTogether: when one
is refused, every socket that opened is closed, including those that open
after the refusal.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
The Registry and Project sockets wait, after the upgrade, for the last
listings page and the welcome. When that wait failed, open rejected without
the socket, so neither openTogether nor anything else could close it, and
the CLI could stay alive after reporting failure. The wait now closes the
socket before it rethrows, and open takes the wait's bound. The Machine
socket has no wait after its upgrade.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…y socket row

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit cccfd1a into master Oct 27, 2026
SSFSKIM added a commit that referenced this pull request Oct 27, 2026
…login transfer; tracker row for deploy.ts's unhandled EPIPE

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