Skip to content

feat(j5): J5 Connect requests tell declined from ran out, and someone here adds a sign-in - #1316

Merged
Jacksondr5 merged 5 commits into
j5/mainfrom
j5code/j5-connect-admin-server
Dec 1, 2026
Merged

Jacksondr5 merged 5 commits into
j5/mainfrom
j5code/j5-connect-admin-server

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Problem

The J5 Connect admin design (#1271) needs server pieces that aren't there yet:

  • someone already on a server can't add a sign-in to themselves;
  • a waiting browser is never told when it's let in, and can't collect its way in;
  • declined and ran out look the same;
  • the People read doesn't show each person's account, or which devices came from sign-in.

This is PR A of #1271: contracts and server only, no UI. The web and desktop UI follows, stacked on #1323 and #1324, which stack on this. Part of #1271.

What changed

Carried from #1258. The first commit carries #1258's server and contracts parts, which the #1271 builder took over:

  • the app scheme on a sign-in (migration 062);
  • the app link a pairing sign-in goes back to;
  • a refresh keeps the old token when the new one is empty.

#1258's Inbox count on the server is taken back out (see below). #1258's web screens are replaced by the UI PR.

Admin-ux items 4 to 8 and 11:

  • Adding a sign-in to yourself (J5 Connect AC50). j5.identity.startAddSignIn starts a sign-in that carries the person asking. When it comes back, the account becomes theirs, and the browser lands on /pair?j5-add-sign-in=added|taken|failed.
    • An account that's already someone's is refused, and so is a second one for the same person (AC20).
    • A request that account had waiting goes away, so no one is let in twice.
  • The waiting page's signal (AC18). Waiting, declined and ran-out outcomes carry a request ticket in the /pair fragment. The server keeps only its hash.
    • The page reads the request at POST /api/j5/identity/request.
    • With wait: true, a waiting read is held until people change, or for 25 seconds. It reads again on every change, starting with the one right after it subscribes, so a decision made in between isn't missed.
    • A request that was let in is answered once, with a pairing credential, or with the app's <scheme>://pair link when an app started the sign-in.
  • Declined, apart from ran out (AC19).
    • A decline answers declined, with the date the account can ask again.
    • A request that ran out answers ran-out once, with the date it was made, at sign-in or on the waiting page. The next sign-in asks afresh.
    • A decline whose week is over answers ended.
  • A failed or cancelled sign-in goes back to what it was for: adding a sign-in, or the app that started it.
  • The People read (AC26, AC30).
  • The identity and describe reads.
    • IdentityState is { connect, door, requests }.
    • j5.identity.getOwnSignIn gives anyone their own account and the J5 Connect's host and issuer.
    • Describe gives the server's label and the J5 Connect's host and issuer. The desktop app checks the issuer against its machine's policy.
  • Removed: matching an account to someone already here (AC17 retired). bind and the name-match suggestions go, and unbind becomes removeSignIn.
  • The server's Inbox count no longer counts waiting requests (Inbox AC27). For now, the mobile app neither shows nor counts them, and mobile reads the same count. The web and desktop bell counts them in the UI PR.

Migration 063 adds two columns to the sign-in table, purpose (pair | join | attach) and person_id, and adds the ticket table.

Reviews

Sol (gpt-6.2-sol, high) checked accuracy in two rounds.

  • Round 1 fixed three things:
    • a ran-out request was told twice;
    • a failed sign-in lost what it was for;
    • the last-confirmed time could go stale.
  • Round 1 declined five, with reasons:
    • a ticket only ever pairs the account that earned it, as the person that account is now;
    • decisions act on the account's request that is waiting now (AC16);
    • a lost answer falls back to "sign in again", which pairs at once;
    • revoking a device doesn't remove its person;
    • notify-after-commit matches the rest of the module.
  • Round 2 raised one item, declined: reloading an old decline page after the same account asked again shows "Waiting", which is that account's true status now.
  • J5 Connect: a lapsed account suspends its person instead of ending their devices #1305's builder caught the mobile count issue above.

Checklist

Built by Claude Opus 5.5 in Claude Code, running in J5 Code.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Dec 1, 2026 2:22am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 15169aa and d5f6436.

Files selected for processing: 16

  • apps/server/src/j5/a2a/Migrations.test.ts
  • apps/server/src/j5/a2a/Migrations.ts
  • apps/server/src/j5/a2a/migrations/062_IdentityAppReturn.ts
  • apps/server/src/j5/a2a/migrations/063_IdentityRequests.ts
  • apps/server/src/j5/identity/Identity.test.ts
  • apps/server/src/j5/identity/Identity.ts
  • apps/server/src/j5/identity/IdentityHttp.ts
  • apps/server/src/j5/identity/Oidc.ts
  • apps/server/src/j5/identity/identityRpc.ts
  • apps/server/src/j5/sharing/People.ts
  • apps/server/src/j5/wsRpc.test.ts
  • apps/server/src/j5/wsRpc.ts
  • apps/web/src/j5/sharing/people.logic.test.ts
  • packages/contracts/src/j5/clientRpcPermissions.ts
  • packages/contracts/src/j5/identity.ts
  • packages/contracts/src/j5/people.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Jacksondr5 and others added 2 commits November 30, 2026 20:49
…quests

Carried from #1258's server and contracts (its five commits, split from the web
screens #1271 replaces): migration 062's app scheme on a sign-in, the app link a
pairing sign-in goes back to, the Inbox count of accounts waiting for an Owner,
and a refresh that keeps the old token when the new one is empty.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… here adds a sign-in

The server side of the admin design (#1271, admin-ux items 4 to 8 and 11):

- A person adds a sign-in to themselves from a device they already use
  (J5 Connect AC50): startAddSignIn starts a sign-in that carries the person,
  and its account becomes theirs when it comes back. An account already
  someone's is refused, as is a second one (AC20).
- A device told to wait, declined or ran out gets a request ticket in the
  pairing page's fragment. The page reads its request with it, and a waiting
  read holds until an Owner decides, then answers once with the way in: the
  credential, or the app's link (AC18).
- Declined and ran out are told apart (AC19): a decline keeps its week, and a
  request that ran out is told so once and asks afresh at the next sign-in.
- The People read gives each person's account, when it was last confirmed and
  a suspendedAt for #1305 to fill (AC30), and marks devices that signed in.
- The identity read gives the door (links or invitations); describe gives the
  server's label.
- Owners no longer match a waiting account to someone already here (AC17
  retired): bind and its name suggestions go, and unbind is removeSignIn.

Migration 063 adds the sign-in's purpose and person, and the ticket table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Jacksondr5
Jacksondr5 force-pushed the j5code/j5-connect-admin-server branch from ea4ca48 to b36e906 Compare December 1, 2026 01:49
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). labels Dec 1, 2026
…es back where it started

From the accuracy review of #1316:
- A waiting page told its request ran out clears it, so the next sign-in asks
  afresh at once; a decline whose week is over answers ended, not ran out.
- A sign-in that fails or is cancelled at J5 Connect goes back to what it was
  for: adding a sign-in, or the app that started it.
- An answered confirmation pass, and a sign-in that pairs, move People, so the
  last-confirmed time it shows stays current (AC26).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ssuer

A managed desktop client signs in only through the J5 Connect its machine's
policy allows (J5 Connect AC46, AC47), and that policy names an issuer, not a
host. Describe and getOwnSignIn now give both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ile doesn't count them

Inbox AC27: the mobile app neither shows nor counts a waiting request for now,
and mobile reads the same count. The web and desktop bell counts the requests
it already lists for each owned server instead (#1271's UI), as #1305 does for
suspensions. Reverts the count #1258 added to readOpenInboxCount.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Jacksondr5
Jacksondr5 added this pull request to stack #1330 December 1, 2026 02:45
@Jacksondr5
Jacksondr5 merged commit 3ba4ed0 into j5/main Dec 1, 2026
40 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/j5-connect-admin-server branch December 1, 2026 02:59

This branch was successfully deployed

1 active deployment
Preview — d5f64366 Deployed Dec 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant