You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What does "log in once and reach everything you have access to" mean? Who a user is (a person at a company); how they sign in (the company's IdP, SSO, Patchy accounts); what access means for a patch (who can open it, who can edit and publish it); how sharing works, from "somebody shares a static page with you" through to a CRM; how a machine credential for uploading (CLI / npx, CI, an agent) binds to a person or a company; and the who's-who glossary (user / agent / operator / reader), resolving the "operator" collision between the two CONTEXT.md files.
Product-level; auth implementation stays out of scope. Output: glossary entries and the Identity section of docs/product.md. Input: Comparable platforms — companies, identity, and access.
Clerk is the identity provider; Patchy holds the company, access and machines. Sign-in is Google, Microsoft or an emailed code — no passwords. One session across everything; a link without a session shows the door and lands back on the patch. Company SSO (SAML/OIDC) is self-served by the admin once Patchy flips the flag, enforced on the verified domain, paid. Clerk facts that shaped this: sign-in methods are per instance, not per company; Clerk cannot cap a user at one org (our invariant); no last-admin rule (ours); the B2B add-on is effectively required (20-member cap without it).
Getting in: invite by default; a verified domain (never consumer domains, one domain one company) opts into auto-join; inviting always stays available. No person without a company — a fresh sign-in lands on create-or-join, and creating means full onboarding, card included. Exactly one company, hard: an invite to someone in another company is refused, they leave first; a company of one must be deleted or handed off. Merge is fog.
Roles: member and admin only; everyone builds. A "can't publish" setting is fog, not a role.
Access: scope decides who opens; the owner alone changes (publish, roll back, scope, retire, delete) — no editors, admins reassign when needed. Admins see everything. Inside the company or public — no guests. Wrong person: door / "ask the owner" + request access (same company) / "no such patch" (other company).
Machines: patchy login is a device login — URL + code (JSON for the agent), the person confirms the code in a signed-in browser (the anti-phishing measure that costs nothing) and names the machine on a fresh login. One machine token per machine, shared by every agent on it, Patchy's own rather than a Clerk API key (local verification, no Clerk on the publish path, inactivity expiry, revoke-on-deactivate — all columns on the existing token machinery), 90 days absolute / 30 idle, listed and revoked on Your machines; deactivation revokes all and ends open sessions including tier 1/2. CI uses an ordinary machine token via PATCHY_API_TOKEN. Self-service minting retires. Loopback fast path is fog.
Agent is not a principal: it acts with its user's token; the version-records-the-token line answers "which agent".
Who's who: person / user / agent / member, admin / owner / viewer (reader at tier 0) / operator. The collision is closed: the CLI's agent is its driver; operator is Patchy only.
Activity
allisonmahmood commentedon Sep 1, 2026
Resolution
Grilled across three rounds with two research passes in between (Clerk — organizations, SSO, domains, sessions, machine auth, CLI device login — how Claude Code, Codex, gh, Vercel, Fly, Stripe and gcloud do it); landing in #96 as the Identity and access section of
docs/product.mdplus glossary entries in the Auth, Publishing, Patches and ServingCONTEXT.mds.patchy loginis a device login — URL + code (JSON for the agent), the person confirms the code in a signed-in browser (the anti-phishing measure that costs nothing) and names the machine on a fresh login. One machine token per machine, shared by every agent on it, Patchy's own rather than a Clerk API key (local verification, no Clerk on the publish path, inactivity expiry, revoke-on-deactivate — all columns on the existing token machinery), 90 days absolute / 30 idle, listed and revoked on Your machines; deactivation revokes all and ends open sessions including tier 1/2. CI uses an ordinary machine token viaPATCHY_API_TOKEN. Self-service minting retires. Loopback fast path is fog.docs(product): define identity and access (#19) (#96)