Skip to content

feat(identity): support configurable GitHub Enterprise coauthor credit - #173513

Merged
roboclaw-bot merged 5 commits into
openclaw:mainfrom
galiniliev:galiniliev/factory-coauthor-identity
Oct 16, 2026
Merged

roboclaw-bot merged 5 commits into
openclaw:mainfrom
galiniliev:galiniliev/factory-coauthor-identity

Conversation

@galiniliev

@galiniliev galiniliev commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #173512

What Problem This Solves

GitHub Enterprise users need Git coauthor credit tied to their verified enterprise account and commit address.

User Impact

Operators configure the enterprise hostname through the existing gateway.github.host setting. Users retain their saved coauthor preference through consecutive profile merges and refreshed sign-in; eligible commits use the broker-verified enterprise address, and the Profile page explains that this address becomes visible in commit history. Missing addresses and stale principal bindings withhold credit until refreshed sign-in. Enterprise accounts do not match public-GitHub role rules.

Why This Change Was Made

Trusted GitHub Enterprise metadata flows through the existing canonical profile worker and attribution owner. Identity keys include the host, and publication selects contributors for its selected GitHub host, preventing equal numeric IDs on different hosts from sharing credit. No tenant hostname is hardcoded, no enterprise noreply address is synthesized, and verified addresses stay out of profile responses and sign-in aliases.

The smallest coherent scope includes sign-in, persisted identity, attribution, publication, and profile disclosure together. It reuses the existing host configuration, profile consent and authority invalidation; one additive nullable identity field retains the verified binding. Simplification retained one principal parser and one attribution path. GitHub Enterprise writes settle in the existing profile worker transaction, independently of the identity reader; the credit disclosure covers both host-selected address forms even when the displayed primary account is public GitHub.

Evidence

Review repairs — 2026-10-16

Public-GitHub consumers now retain issuer scope, so an Enterprise login collision cannot block public visitor revocation or misattribute a team report. Coauthor consent remains editable when multiple Enterprise hosts leave no single display-primary account; the existing profile-wide preference remains the owner.

63 focused identity/consumer tests and 33 Profile unit tests pass. The actual Profile browser scenario fails with the old disabled control and passes after repair, including saving opt-out.

Before — merged Enterprise identities disable the consent control

Before: unavailable consent control

After — profile-wide consent remains editable

After: editable consent with multiple Enterprise identities

The composed repair stack passes 191 focused tests plus Profile browser proof, core/UI/plugin types, touched lint/format, mock-export ratchet, documentation checks, architecture and build. Independent review found no actionable P0–P2 issues. This is isolated synthetic boundary proof, not live broker or deployment qualification.

Earlier evidence

  • Rebased onto a9e86934eb289bd0e90bd15834f8a337826bb704 (main). Feature naming, internal types/operations and filenames now use GitHub Enterprise. Existing trusted-proxy header names remain unchanged. Enterprise identity projection also follows main's resident profile catalog; the retired full-profile reader was not restored.

  • Rebased-source validation: 66 selected backend tests pass across Gateway identity and profile/multi-account suites, including two enterprise hosts, public-ID collisions, missing addresses, opt-out, consecutive merges without intervening sign-in, and host-selected credit after linking public and enterprise profiles. The 6-test GitHub Enterprise suite includes a new users.list catalog regression that fails before the rebase integration and passes afterward.

  • Prior repair evidence (fcf942776e4): 3 focused Profile browser scenarios and the UI typecheck pass, including public and enterprise identity disclosures. The rendered UI code is unchanged by this naming/rebase update. Before/after screenshots below are from the actual mocked-Gateway UI and were inspected.

  • Rebased-source core typecheck, touched lint, formatting, and git diff --check pass. Prior UI/i18n proof is retained for unchanged UI source. Both import-cycle checks report zero cycles; the database-worker ratchet reports no T1 growth (222 → 222).

  • Independent source review and the publication Codex autoreview found no actionable P0/P1 findings in the repair.

  • Backend proof ran on an isolated, credential-free AWS lease. The rebased backend invocation took 55 seconds wall time including compilation/worker setup. The prior browser invocation took 27 seconds. These tests exercise the durable profile/merge/attribution boundary and real UI controls; they do not validate a live GitHub Enterprise broker or deployment. Broad CI for the pushed head is separate evidence.

Before — public primary described only noreply credit

Before: Profile credit disclosure with a public primary account

After — disclosure covers the address selected for publication

After: Profile credit disclosure covers public and enterprise publication

CI integration repair

The first root-PR CI run exposed stale generated database artifacts when GitHub integrated this branch with main. The Enterprise schema insertion changed SQLite catalog fingerprints and shifted the PostgreSQL state-port SQL ranges. Integrated that exact CI base (c070b119aa11) and regenerated the canonical outputs with pnpm db:postgres:gen; no SQL translator or schema semantics changed.

Secretless AWS proof reproduced the catalog failure before regeneration. After regeneration, pnpm db:postgres:check, 13 identity/schema tests, and all 5 focused PostgreSQL 17 backup/update-recovery conformance tests passed. The local complete source delta matches the tested tree. Current-head GitHub CI is still required before landing.

Contributor: @galiniliev. Review repairs requested and credited to @galiniliev.

Work sessions

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 6db8840b5fe514981fe1792a172acc75eba02fef
  • Maintainer: @galiniliev
  • Repository role: maintain

These security sensitive changes were made:

  • src/agents/git-coauthor-attribution.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/http-auth-user-profile.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server/ws-connection/connect-session.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: L labels Oct 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR adds host-scoped Enterprise GitHub identities and verified commit addresses to shared-session coauthor credit.

Example: Account 101 on ghe.example.test signs in as enterprise-ada with verified address [email protected].

  • Before: The enterprise account cannot supply verified shared-session coauthor credit.
  • After: Eligible enterprise publication adds Co-authored-by: enterprise-ada <[email protected]> while keeping public account 101 separate.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The feature has clear value and meaningful owner-level tests, but an introduced consumer regression and unresolved authority and upgrade evidence prevent approval.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Enterprise GitHub participants cannot receive shared-session commit credit tied to their verified enterprise account and address.
Reason: Maintainer direction supports the capability, and the implementation reuses existing configuration and identity ownership.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open: this maintainer-directed feature remains absent from main, and the prior reader/catalog finding is resolved, but existing plugin consumers still conflate enterprise and public GitHub usernames.

Priority: P2
Reviewed head: 7780f92024606c234e8fe0fd585bd0f151c99f2e

Before merge

  • Add real behavior proof - Authority-chain proof required: inspected screenshots establish the Profile disclosure, and supplied tests exercise canonical profile, merge, consent, and attribution owners with synthetic authenticated inputs, but no supplied trace reaches publication through real HTTP/WebSocket admission; provide redacted terminal output or logs showing an allowed enterprise contributor, rejection of forged and wrong-host metadata, and consent withdrawal or principal reassignment stopping the final publication effect. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Preserve issuer identity in existing username-based consumers (P2) - Adding enterprise identities to this shared projection changes users.list for bundled consumers that still assume every login belongs to github.com. For an enterprise profile ghe.example.test/alice, Visitor Access's assertGithubSelection("alice", publicAccountId) treats that enterprise profile as a conflicting public binding and aborts public-account revocation before policy cleanup. Team Reports also strips host in profilesSchema and resolves a public roster alias alice to the enterprise profile, showing that person's session preview under the wrong member. Carry the host through these consumers and match the intended issuer before comparing usernames; add collision coverage for distinct public and enterprise accounts.
  • Resolve security review attention item - Enterprise identity persistence and email publication require proof of trusted metadata admission and final-effect invalidation.
  • Resolve merge risk - Confirm that the deployed trusted proxy overwrites client-supplied enterprise metadata and that stale or reassigned bindings cannot authorize subsequent publication.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Preserve issuer identity in existing username-based consumers — src/state/user-profile-github-identity.ts:279-283

Tests

  • Missing end-to-end proof: Missing production sign-in-to-publication controls for allowed, forged, wrong-host, withdrawn-consent, and reassigned identities, plus a latest-stable upgrade preserving profiles and preferences.
Agent review details

How this fits together

Trusted-proxy sign-in supplies identity metadata to the canonical profile worker; attribution combines persisted identity, session participation, and consent to produce host-selected publication credit.

flowchart LR
  A[Trusted sign-in proxy] --> B[Gateway admission]
  B --> C[Canonical profile worker]
  C --> D[Profile identity store]
  D --> E[Host and consent selection]
  F[Session participants] --> E
  E --> G[GitHub publication]
  D --> H[Profile and roster responses]
Loading

Technical review

Best possible solution:

Complete host-aware identity consumption across bundled plugins while retaining the canonical profile worker and publication attribution owner.

Do we have a high-confidence way to reproduce the issue?

Source establishes both the missing main capability and the introduced collision path: an enterprise profile named alice is returned to consumers that compare it directly with public GitHub alice; no target code was executed.

Is this the best way to solve the issue?

The canonical profile-worker and host-selected attribution approach fits the existing architecture, but widening the identity response also requires migrating consumers that currently discard the issuer.

Full review comments:

  • [P2] Preserve issuer identity in existing username-based consumers — src/state/user-profile-github-identity.ts:279-283
    Adding enterprise identities to this shared projection changes users.list for bundled consumers that still assume every login belongs to github.com. For an enterprise profile ghe.example.test/alice, Visitor Access's assertGithubSelection("alice", publicAccountId) treats that enterprise profile as a conflicting public binding and aborts public-account revocation before policy cleanup. Team Reports also strips host in profilesSchema and resolves a public roster alias alice to the enterprise profile, showing that person's session preview under the wrong member. Carry the host through these consumers and match the intended issuer before comparing usernames; add collision coverage for distinct public and enterprise accounts.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against efbe024a9aa3.

Merge-risk options

Maintainer options:

  1. Verify the proxy-to-publication authority contract (recommended)
    Provide production-boundary evidence that forged metadata and retired principal bindings are rejected before persisted credit reaches publication.

Provenance checked

  • Authenticated identity keeps the original intent (6775075: Derive verified GitHub identity from authenticated ingress rather than user-entered account claims.)
  • Enterprise host and public identity separation changes intended behavior with a stated reason (feat: prepare cloud workers for enterprise repositories #160108: Support host-bound enterprise repositories while keeping public sign-in lookup separate.)
  • Attribution and publication currency keeps the original intent (1b66d30: Resolve current identity and consent for direct and inherited human contributors before publication.)
  • Profile catalog projection keeps the original intent (39ca16f: Serve existing profiles and rosters from the committed catalog without additional writer admissions.)
  • Profile screenshot capture keeps the original intent (08324bb: Preserve viewport recordings while producing meaningful element screenshots.)

Testing

Proof path: in-process harness.

Security

Needs attention: Enterprise identity persistence and email publication require proof of trusted metadata admission and final-effect invalidation.

Evidence

What I checked:

  • Introduced changes and clean checkout: Reviewed the pinned merge-base-to-head hunks, rather than endpoint drift; git status remained clean. (7780f9202460)
  • Existing consumers lose issuer identity: Enterprise identities now populate the shared githubIdentity projection. Visitor Access compares that login against public account selections without checking host; Team Reports strips host from its response schema and resolves session owners by login alone. (src/state/user-profile-github-identity.ts:280, 7780f9202460)
  • Prior finding addressed: Enterprise writes are implemented in the profile worker transaction, separately from the identity reader; resident catalog projection uses the shared identity projection. (src/state/user-profile-enterprise-github-write.worker.ts:121, 7780f9202460)
  • Current main still lacks enterprise attribution: Fetched main projects only public GitHub identities and constructs public noreply trailers; the enterprise sign-in branch is absent. (src/state/user-profile-github-identity.ts, efbe024a9aa3)
  • Supplied visual evidence inspected: Downloaded before/after Profile images show the expanded enterprise-address disclosure. The other prepared images belong to the earlier repository-selection feature and do not prove this identity flow. (ui/src/i18n/locales/en-profile.ts:57, 7780f9202460)
  • Maintainer direction and related foundation: The security guard verifies galiniliev has maintain access. The linked issue requests host-separated identity and credit; the earlier merged Enterprise repository work explicitly preserved public sign-in identity lookup: feat: prepare cloud workers for enterprise repositories #160108. (db01f6d520b8)

Likely related people:

  • Shakker: Raw commit 82a6425 adds src/gateway/github-user-identity.ts:129 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 82a6425d120e; files: src/gateway/github-user-identity.ts)

PR surface

Source +521, Tests +378, Docs +4, Other +1. Total +904 across 34 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 27 556 35 +521
Tests 4 471 93 +378
Docs 2 5 1 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 34 1033 129 +904

Review metrics

Metric Value Why it matters
Persistent identity extension 1 nullable column verified_email_json stores the verified commit address and its profile/binding association in the existing identity table.
Configuration additions 0 The feature reuses gateway.github.host and the existing coauthor preference.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Useful Enterprise attribution support with limited blast radius and a concrete cross-host consumer regression.
  • merge-risk: 🚨 compatibility: Existing users.list consumers assume githubIdentity.login denotes a public GitHub account.
  • merge-risk: 🚨 security-boundary: Trusted ingress metadata becomes durable identity evidence and controls publication of a verified email address.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add final-effect proof for forged or wrong-host identity metadata and show that consent withdrawal or principal reassignment invalidates publication before I/O.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-15T22:40:07.440Z sha 34d7a63ceffd2844002b1cf0f7457d529ac2cb79 :: needs real behavior proof before merge. :: [P2] Break the Factory identity reader's dependency on the profile catalog

Reviewed October 15, 2026, 9:53 PM ET / October 16, 2026, 01:53 UTC (Revision 2).

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XL and removed size: L labels Oct 16, 2026
Galin Iliev and others added 3 commits October 16, 2026 01:22
Keep enterprise credit preferences through chained profile merges, explain host-selected credit independently of the displayed primary account, and separate worker writes from identity readers.

Co-authored-by: galiniliev <[email protected]>
Rename the feature, internal types, worker operations and source files to Enterprise GitHub while retaining the deployed proxy header names. Carry enterprise identities through the resident profile catalog introduced on main, using the same identity projection as direct reads.

Co-authored-by: galiniliev <[email protected]>
@roboclaw-bot
roboclaw-bot force-pushed the galiniliev/factory-coauthor-identity branch from fcf9427 to 7780f92 Compare October 16, 2026 01:22
@roboclaw-bot roboclaw-bot changed the title feat(identity): support configurable Factory GitHub coauthor credit feat(identity): support configurable Enterprise GitHub coauthor credit Oct 16, 2026
@galiniliev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 16, 2026
@galiniliev galiniliev changed the title feat(identity): support configurable Enterprise GitHub coauthor credit feat(identity): support configurable GitHub Enterprise coauthor credit Oct 16, 2026
Integrate the exact failing CI base and regenerate canonical schema artifacts. This restores SQLite catalog fingerprints and PostgreSQL port offsets after the Enterprise identity schema insertion.

Co-authored-by: galiniliev <[email protected]>
@roboclaw-bot
roboclaw-bot merged commit 23a5696 into openclaw:main Oct 16, 2026
175 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Merged via squash.

steipete added a commit that referenced this pull request Oct 16, 2026
The dependency check found three exports without production importers.
All three implementations still have same-module production callers:
Enterprise identity validation was added with its current sign-in caller
in 23a5696 (#173513), and the MCP merge remains used by catalog
loading and peeking after b646675 (#174347) removed its test facade.
No trust decision or caller was lost.

Keep the live helpers private and exercise catalog merging through the
combined runtime, preserving every existing test assertion. Do not
remove the Enterprise proxy, issuer or account-id checks.

Proof: 97 focused tests passed with --maxWorkers=1 (138.97s), dependency
scans, core and owning test types, lint/format, and clean P2 review.
The stricter full-tree exports audit still reports two unrelated Discord
namespace members in unchanged owners; production/script scans pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
openclaw#173513)

* feat(identity): support configurable Enterprise GitHub coauthor credit

Co-authored-by: galiniliev <[email protected]>

* fix(identity): preserve enterprise credit consent across profile merges

Keep enterprise credit preferences through chained profile merges, explain host-selected credit independently of the displayed primary account, and separate worker writes from identity readers.

Co-authored-by: galiniliev <[email protected]>

* refactor(identity): name Enterprise GitHub coauthor support consistently

Rename the feature, internal types, worker operations and source files to Enterprise GitHub while retaining the deployed proxy header names. Carry enterprise identities through the resident profile catalog introduced on main, using the same identity projection as direct reads.

Co-authored-by: galiniliev <[email protected]>

* fix(identity): preserve issuer scope and editable coauthor consent

Co-authored-by: galiniliev <[email protected]>

---------

Co-authored-by: galiniliev <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
The dependency check found three exports without production importers.
All three implementations still have same-module production callers:
Enterprise identity validation was added with its current sign-in caller
in b985092 (openclaw#173513), and the MCP merge remains used by catalog
loading and peeking after d3c8c52 (openclaw#174347) removed its test facade.
No trust decision or caller was lost.

Keep the live helpers private and exercise catalog merging through the
combined runtime, preserving every existing test assertion. Do not
remove the Enterprise proxy, issuer or account-id checks.

Proof: 97 focused tests passed with --maxWorkers=1 (138.97s), dependency
scans, core and owning test types, lint/format, and clean P2 review.
The stricter full-tree exports audit still reports two unrelated Discord
namespace members in unchanged owners; production/script scans pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. plugin: team-reports plugin: visitor-access proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts security-sensitive-changed size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Factory enterprise sign-in needs host-scoped Git coauthor credit

2 participants