Repository navigation
feat(x): verify repository writers through GitHub profiles - #168071
Conversation
Add opt-in GitHub collaborator verification with inherited SecretRef configuration, guarded reads, paid lookup caching, and the existing allowlist revocation fence. Preserve last-good access during failures and show GitHub attribution in X replies.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR optionally derives X maintainer access from repository collaborators’ GitHub profile declarations and displays their attribution. Example: GitHub collaborator @Example-dev declares X handle @example, resolving to user ID 123.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 5 items remain Keep this PR open: it adds useful, owner-backed functionality, but permanent handle caching can retain maintainer access for the wrong X account. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe X plugin reads GitHub collaborator permissions and profile declarations, resolves handles through its budgeted X client, and publishes persisted grants to the existing ingress and reply authorization owner. flowchart LR
A[GitHub collaborators and profiles] --> B[Verification service]
B --> C[Budgeted X identity lookup]
C --> D[Persisted derived grants]
D --> E[Allowlist authorization fence]
E --> F[Agent dispatch and public replies]
D --> G[X replies settings page]
Technical reviewBest possible solution: Keep the plugin-owned synchronization and existing authorization fence, while bounding identity-cache freshness and revoking mappings when revalidation changes the numeric X ID. Do we have a high-confidence way to reproduce the issue? Source shows that a persisted alice→101 mapping survives every healthy sync while alice remains declared, even if a new X lookup would return 102; no target code was executed. Is this the best way to solve the issue? The existing plugin service, budgeted client, and authorization fence are appropriate owners, but the persisted identity cache needs an invalidation lifecycle before it can safely supply current grants. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1f307d61d0f7. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionProvenance checked
TestingProof path: in-process harness. SecurityNeeds attention: Persisted handle mappings can outlive the identity relationship that granted maintainer access. EvidenceSecurity concerns:
What I checked:
PR surfaceSource +856, Tests +764, Docs +179, Generated 0. Total +1799 across 31 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 9, 2026, 9:31 PM ET / October 10, 2026, 01:31 UTC. |
|
Merged via squash.
|
…168071) Add opt-in GitHub collaborator verification with inherited SecretRef configuration, guarded reads, paid lookup caching, and the existing allowlist revocation fence. Preserve last-good access during failures and show GitHub attribution in X replies.
What Problem This Solves
Repository collaborators currently need a separate manual X allowlist entry before they can ask the bot to do maintainer work.
User Impact
Operators can opt into
channels.x.verifiedFromGitHubto verify everyone with push, maintain, or admin access to a repository through the X handle declared on their own GitHub profile. The feature is off by default and inherits per account. The X replies page shows read-only GitHub attribution and self-enablement guidance.This implementation needs a configured GitHub token, preferably a SecretRef, with access to list the repository's collaborators. Existing managed GitHub identities do not expose a supported authenticated REST capability for these reads; the fallback uses the existing guarded fetch and channel-secret contracts without expanding the SDK.
Why This Change Was Made
A service refreshes collaborator permissions and profile declarations, resolves only new or changed X handles through the existing spend gate, and atomically replaces the derived keyed-state snapshot. Config and administrator entries remain effective. Successful removals retire the existing allowlist authorization fence; failed syncs retain the last good set and report stale status. Unchanged refreshes preserve in-flight authorization; successful paid lookup batches are checkpointed even when later batches fail. GitHub profiles use conditional ETag requests, and X lookups cost $0.01 per returned user.
The trust decision is explicit: the GitHub account already has repository write access and declares its X identity. A collaborator could declare a handle they do not own. The page exposes the originating GitHub login for every derived entry, and the next successful sync removes entries after permission or profile changes. This does not grant GitHub credentials or new host identity privileges to an X user.
The existing X secret artifact now also exports the standard registry/collector surface, so all X credential paths participate in secret configuration and audit discovery.
Evidence
pnpm test extensions/x --maxWorkers=1: 247 tests across 20 files passed; final wall time 62.90 s. Fetch stubs and fake clocks cover permission/pagination/profile sources, lookup caching and charging, in-flight revocation, stale-set recovery, and default-off behavior.oxfmt --check, andgit diff --checkpassed.Independent Codex autoreview is scoped-clean through P2 after resolving all three findings. Exact-head CI run 38013090418 passed all 67 jobs without failures on
25ae31e3147d9c71fd46221e6ff05997f716271b. The extension test job took 123 s; UI checks 101 s; UI E2E shards 181 s and 263 s. No reruns were needed. Both embedded screenshots were verified rendered in GitHub.Review disposition and final behavior proof
The selected contract caches the resolved numeric X identity and only looks up new or changed GitHub declarations. ClawSweeper proposed periodically rebinding unchanged handles. That proposal is declined because it changes the explicit maintainer-selected lookup/cost policy: a renamed X account retains its numeric identity, while a new owner of its recycled handle must not automatically inherit the original grant. A collaborator must update/remove the GitHub declaration to change that binding; losing repository permission still removes it at the next successful sync. The cache is not a promise to continuously follow handle ownership.
A supplemental in-process smoke exercised the committed production sync, ingress, monitor, dispatch, delivery, and X API request owners with synthetic transport/runtime fixtures. Two cases passed in 38.00 s (73 ms test bodies): the derived numeric ID reached agent dispatch and one reply POST while an unverified neighboring ID was dropped; removing the collaborator while reply authorization awaited final I/O produced
PlatformMessageNotDispatchedErrorand zero reply POSTs. This was a temporary task proof, not a live X send or additional committed CI suite.Existing configured/admin allowlist storage shapes are unchanged. The new GitHub data uses a separate keyed-state namespace; the existing allowlist tests and explicit configured/stored-entry retention assertions pass. There is no migration of pre-existing allowlist data in this change.