Skip to content

P5 O13 M5: the cards on the phone - #266

Merged
SSFSKIM merged 10 commits into
masterfrom
p5-o13-m5
Oct 28, 2026
Merged

SSFSKIM merged 10 commits into
masterfrom
p5-o13-m5

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

P5 O13 M5: the cards on the phone.

The phone now has a cards route (spec M5).

  • /cards lists the sessions waiting on cut-over machines.
    • The machines come from machines.ts (cutOverMachines, the package's machineKeys rule). Entries come from the head, plus delegated machines that hold a live certificate, verified one by one. A machine leaves the list when its delegation expires.
    • Each machine's relay presence supplies the counts.
    • Titles and lanes come from M3's verified listings, and only the member's own sessions are shown.
    • A machine whose socket is down reads offline and keeps its rows.
    • No DX6 session appears here; those stay in the project views.
  • /cards/<ref>/<session> opens the session's channel and its cards subscription. Each card is drawn with RequestCard's pieces (QuestionBody, ToolPreview, the same copy):
    • a permission offers Allow and Deny, with no reason field and no scope;
    • a question offers Submit and cannot be declined from the phone.
  • Card states come from one table-tested adapter, Outcome → CardState, so a done that carries a failure is never drawn as sent. It covers:
    • open, sending, sent, failed (answerable anew), uncertain with Retry of the retained operation, disconnected, and closed;
    • the request changed, and not yet actionable.
  • The Face ID line is drawn from the card the attempt was built from, e.g. Face ID approves: Allow pnpm test in maws-45.
  • Before following a session, the view checks the device's standing in the org store.
  • Entry points: Cards in the top bar and in the phone menu, with a dot while any count is above 0.
  • Load cost: the cards code is a lazy chunk outside the entry, and a browser with no device loads no device chunk at start.

The decline, and an amendment to O10's contract

A native question is declined from the phone on both lanes, as DX6's card declines one whose every question was skipped. Async questions stay undeclinable.

  • Lane A sends sminos.decide {decision: 'deny', digest}.
  • Lane B sends the engine's only decline form for a question, session.answer with {kind: 'permission', decision: 'deny'} (src/engine-host/broker.ts isQuestionSkip).
  • src/endpoint/authorize.ts #asPending is amended for web-cards only. It admits that plain deny, with no updatedInput and no message, only when the pending kind is question.requested. maws.ask.opened (the async ask) and deny_and_stop stay refused.
    • This is made under the O10 owner's ruling: the bound at line 300 was narrower than its own intent, since a scopeless deny refuses exactly the pending question (P5 DL 64).
    • #asPending's only caller is authorize.ts:243, inside step 7's if (webCards && …) branch (lines 239–244; webCards is set at line 207). Other classes were never bound by it, so nothing changes for them.
  • The Face ID assertion covers the decision itself, so a deny cannot be signed from a screen that shows an answer:
    • step 8 (authorize.ts:251–254) checks a web-cards act with verifyWebAuthn (src/endpoint/step-up.ts:48–53);
    • verifyWebAuthn refuses unless the challenge equals base64url(actionDigest(action)) (apps/org-protocol/src/webauthn.ts:96);
    • actionDigest is SHA-256 of actionSigningInput, which is signingInput(SIGNING_DOMAINS.action, the action without stepUp and webauthn) (apps/org-protocol/src/action.ts:148–153);
    • signingInput is utf8("<domain>\n" + canonicalize(body)) (apps/org-protocol/src/keys.ts:64–65);
    • so the signed bytes are the whole canonical action, args.answer included. A new grades case pins that an assertion made for an answer is refused step-up on a deny.
  • remote-architecture's ruling: the decline falls within RL §5.10, because declining is an answer within web-cards' grade to answer a question. The RL spec is not amended.
  • remote-architecture's pins:
    • (i) A decline with no assertion, or with the assertion made for a different answer, is refused step-up.
    • (ii) A decline is refused on another member's session and on a converse share (grade, at the floor), and on an approve share (class, at step 7). On a request that is no longer pending it is refused by the broker (not_pending, pinned by src/engine-host/broker.test.ts:169).
  • src/shared/ipc/wire-manifest.json and wire.ts are untouched in 488a097..head: git diff 488a0978d..a41b26c5d --stat over both prints nothing. The decline adds no command.
  • M4's never-sends pin now also drives the decline on both lanes. Its set stays exactly session.answer, sminos.answer and sminos.decide.
  • For the O10 owner: by-effect.ts grades a question's decline approve, while answering one is graded converse. A native client with only a converse share can therefore answer but not decline. This rule predates the change, and the phone is unaffected.

No frozen view changes. The branch also carries the spec's living sections.

Validation Evidence

  • Unit tests, run one file at a time: 70/70 across the touched files, including the 33-row adapter table and machines.test.ts:
    • a delegated machine known only by a live certificate is listed by its name;
    • an expired certificate is not listed;
    • a forged certificate placed before the authentic one names nothing.
  • e2e-hub/cards.spec.ts: 8/8 in Chromium with the virtual authenticator, against M4's real-endpoint harness, with the phone paired by M3's flow. It covers:
    • the list showing the lane A session's row and count;
    • a question's card drawn with its choices and answered, and a permission denied, each through the virtual authenticator, each settling within 5 s with one answer recorded;
    • a lane B card opened from a cold load of its landing URL;
    • the fresh lane B card shown as not answerable, with its reason;
    • a withheld ack leaving the card uncertain, then settled by Retry;
    • the channel dropped (reads disconnected), then current again;
    • no overflow at 390 and 320 px;
    • side by side: a DX6 permission from desk-hub's fake machine answered in the project view with the org key, and a channel permission answered in the cards view with the passkey, from one browser signed in once.
  • Existing suites, unchanged: cards-device 9/9, cards.local 15/15, phone 20/20, phone-load 5/5 (grid 123 kB of a 160 kB budget; entry 36.9 kB gzipped), chunk-recovery 2/2.
  • Typecheck and lint: root pnpm typecheck and pnpm --filter desk-web typecheck pass, and eslint is clean.
  • The removed device, proved below the browser: cards.local.test.ts's ends a removed device's subscription and refuses its next handshake checks both the channel's removed end and, after a sync against the real hub, deviceStateIn judging the device removed.
  • Endpoint tests: test/endpoint/grades.test.ts 31/31 and by-effect.test.ts 12/12. cards.local.test.ts is now 17/17, including the lane B decline: done, delivered once, one ledger record.
  • Review: doperpowers:reviewer-medium, two rounds.
    • Round 1 found four P2s, all fixed failing-first:
      • the Face ID line described the current card rather than the attempt's;
      • a forged certificate could supply a machine's name;
      • a delegated machine stayed listed past its expiry;
      • a landing whose fallback lookup found nothing waited forever.
    • Round 2: correct, no findings.
  • Review, a second track: doperpowers:reviewer-high, three rounds.
    • Round 1 (on 488a097..1d8ffdf, the dispatching session's) found one P1 and two P2s, all fixed:
      • landing fallbacks survived a loss of trust (now admitted through the store's checks, at take time);
      • Retry previewed the replacement request (now the retained one, labelled);
      • the capped-input warning was missing.
    • Round 2 found one P2: a fallback could undo a snapshot's removal. It is now admitted inside the store's serialized queue.
    • Round 3, over the race fix and the decline: correct.
  • ci-gate on 92509fd (the PR head, master merged): --gates static,unit,probes,e2e:desk-web,e2e:desk-web-hub,e2e:supervisor --class1a pool --runner macos --lane hosted --label o13-m5-r3, GREEN, run 40655644175 (e2e:desk-web on the pool; e2e:desk-web-hub and e2e:supervisor on GitHub's hosted Macs, since src/endpoint changed). An earlier run on 1d8ffdf (40648401761, green) predates the fix rounds.

Residue

  • Lane B sessions have no Cards-list row and no push yet. The endpoint's notifier learns pending counts only from sminos's pending set. The real sminos never carries lane B requests, because they go through the engine's broker, which no bridge sees. O10 fills this on the endpoint side: plane B feeds the notifier. Until then, a lane B card opens only from its landing URL, and acceptance 2's lane B push leg and M7's live lane B round trip wait on that fix (spec Decision Log, 2026-10-28).

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

… machines and their presence, a session's cards over its channel drawn with RequestCard's pieces and answered with the passkey

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…a certificate names its machine only when it verifies, a delegated machine leaves at its expiry, a landing's unlisted session settles; lane B counts no longer faked in the spec's pending set

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

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…anding's listing taken through the store, the retained request drawn on Retry, a capped input said (O13 M5 review round 2)

Skipping every question of a native lane A question sends sminos.decide deny over its digest under Face ID, as DX6's card and Esc decline it; an async one is never declined, and a lane B decline is refused class by the endpoint, so the client builds none. A landing's hub-read records go into the listings store as its frames do, verified against the trust held when taken and dropped when the store drops or supersedes them. While an answer is retained the card draws its own request, labelled, and a lane A input the bridge capped says so. The local suite pins both lanes' declines against the real endpoint and the removed device's standing.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…he phone, a landing's records admitted only before the snapshot (O13 M5 round 3)

The web-cards class bound admits the plain permission deny on a pending question.requested alone (no updatedInput, no message, no deny_and_stop); the async ask, maws.ask.opened, stays undeclinable. The phone declines a lane B question as it does a lane A one, under the same gesture over the question's own digest. A landing's hub-read records enter the listings store in one serialized step that skips them once a snapshot is in, so a snapshot judged meanwhile is never undone.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit 91ad4df into master Oct 28, 2026
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
… question declines from the phone; tracker row for the decline's grade

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers 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