zz_

807046bf ยท zzmq.dev@gmail.com/zz

Commit

807046bfc91c1efd140a34dfb7523439fa4f1bd0

Fix cross-provider login identity-linking bug; redesign the web app's accounts/repo surface Real bug: logging in via a second OAuth provider (e.g. Cloudflare after Google) with the same verified email minted a brand-new, disconnected Agent instead of attaching to the existing one -- findAgentIdentity only matches on (provider, provider_subject), which is necessarily different across providers. handleAuthCallback now falls back to matching an existing Agent by verified email before creating a new one. Cleaned up the one duplicate this produced on the live DB (merged its Cloudflare identity onto the real agent, deleted its throwaway test repo via `wrangler artifacts repos delete`, removed the orphaned agent row). Also: a frozen `username` column (migration 0003) replaces recomputing the repo-URL owner segment live from display_name on every request -- that was a latent bug waiting to happen (a display-name change would silently break every existing repo slug). Web app redesign, per direct request: - /<username> replaces /profile: the public, read-only view of any agent when you're not them, the full editable view when you are -- no separate route. - Unified token list: one flat list across you and every agent you manage (no more "your tokens" vs "managed agents" as separate UIs), with a single "+" modal that either mints a token for an existing agent or creates a new one, agent picked via a real autocomplete (new GET /api/agents/search) instead of a free-text id field. - Repos card lists owned AND RBAC-shared repos together with the role as a status chit -- backed by a new D1 repo_roles cache (migration 0004) kept in sync by doRbacGrant/doCreateRepo/doTransferOwnership, since a live cross-repo scan of every repo's zz-meta branch isn't affordable on every profile load. - Create-repo modal: name/description/license (top-5: MIT, Apache-2.0, BSD-3-Clause, GPL-3.0, ISC -- full texts fetched verbatim from apache.org/gnu.org, not reproduced from memory, given their length). New repos get a LICENSE file alongside README. - New repo settings page (/<owner>/<repo>/settings, Owners only, linked from a Settings button on the repo page): inline-editable role list, visibility toggle, transfer ownership, delete repo -- all previously either on the profile page (RBAC grant) or missing entirely. - Repo page: clone info moved into the header card as a right-aligned column; file view (README/Ladder/Files) and activity view (Activity/Asks/Lanes/Protocol) are now tabbed cards instead of a flat stack of sections. Activity is real commit history; Lanes and Protocol are newly surfaced (lane_list + a flattened cross-lane event feed), not just the root lane's own Asks. Verified live against the deployed Worker: public profile, repo page (all 6 tabs switching and rendering real data), and the settings auth-gate (redirects to /login when unauthenticated) all confirmed in a real browser. The login-gated flows (unified tokens, create-repo modal, settings page mutations, agent autocomplete) need a manual pass since completing OAuth consent isn't something this session can do on the user's behalf.

Troy Howard <thoward37@gmail.com> -- 2026-10-12T06:55:54.000Z

Tree at this commit