Skip to content

feat(github): surface team-session attribution - #129012

Merged
steipete merged 2 commits into
mainfrom
steipete/roboclaw-attribution
Aug 25, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/roboclaw-attribution

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #128944

What Problem This Solves

RoboClaw and other team-session publishers could put the automation account front and center while human contributors were visible only in commit trailers or by opening the pull request. Gateway-created pull requests could also omit the canonical session backlink, making it difficult to trace published work to the team session that produced it.

Why This Change Was Made

Session participant admission now records an additive, same-schema count of authenticated profile prompts. Public attribution keeps the existing verified-identity and opt-in consent boundary, orders eligible humans by contribution count with deterministic ties, and carries that canonical order into commit trailers, a visible Worked on by block, and Gateway-created pull requests. The publication broker also appends the exact externally configured team-session URL as the final PR footer when one is available.

Cross-store doctor repair uses idempotent aggregate merging because the source remains available until archival; same-store alias repair can safely combine counts transactionally before deleting aliases. Existing databases lazily gain the nullable count column without a schema-version bump, and older rows count as one observed contribution.

Production LOC: +157/-38 (net +119) | Tests: +304/-12 (net +292)

User Impact

Commits and pull requests produced from shared team sessions now clearly show the consenting, verified humans who worked on them in contribution order. Reviewers can follow the final session link back to the originating team-server conversation when the Gateway exposes a public HTTPS session URL. Self-hosted publishers without an external session URL continue to publish normally without a footer.

Worked on by

Evidence

  • node scripts/run-vitest.mjs src/agents/git-coauthor-attribution.test.ts src/config/sessions/session-accessor.sqlite-participants.test.ts src/config/sessions/session-accessor.test.ts src/gateway/github-publication.test.ts src/gateway/github-publication-attribution.test.ts src/auto-reply/reply/session.test.ts — focused attribution, persistence, publication, and session projections passed.
  • node scripts/run-vitest.mjs src/config/sessions/session-accessor.sqlite-participants.test.ts — cross-store retry regression passed after the idempotency tightening.
  • node scripts/check-changed.mjs — formatting, SQLite schema baseline, production/test typechecks, core lint, dead exports, database-first, import-cycle, and repository guards passed.
  • pnpm build — full build passed.
  • Pre-commit autoreview completed with no accepted or actionable findings.
  • git diff --check — passed.

The current coding session does not expose a canonical OpenClaw sessionUrl, so no session footer is fabricated on this maintainer-created PR. The shipped Gateway path is covered with an exact canonical-footer regression.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation r: skill Auto-close: skills should be published on ClawHub, not added to core. gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Aug 25, 2026
@steipete
steipete marked this pull request as ready for review August 25, 2026 04:43
@steipete
steipete requested a review from a team as a code owner August 25, 2026 04:43
@clawsweeper clawsweeper Bot added 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 1:20 AM ET / 05:20 UTC.

ClawSweeper review

What this changes

The PR records authenticated profile-prompt counts and uses verified opt-in identities to add ordered contributor credit and an optional team-session link to Gateway-created GitHub publications.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for normal maintainer landing review. The prior PR-body content-loss finding is fixed at the current head, and the feature reuses the existing verified opt-in attribution boundary; its persisted-session upgrade surface remains intentionally maintainer-reviewed.

Priority: P2
Reviewed head: 1098ccf5423e9579473dfa703680c1a4d5fe6d95

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent feature implementation with focused boundary coverage; the earlier content-preservation finding is addressed.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; it supplies focused after-change publication and persistence test evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; it supplies focused after-change publication and persistence test evidence.
Evidence reviewed 5 items Current main lacks this publication feature: Current main creates the prior Participants block from co-author attribution and does not generate the ordered Worked on by block or team-session footer, so this PR remains necessary.
Consent boundary retained: The existing attribution resolver emits an identity only when the canonical profile has the Git co-author preference enabled and a verified GitHub identity; the changed attribution path consumes that resolver.
Authoritative ordering is producer-owned: Profile-sourced prompts increment the persisted count and retain the earliest profile prompt; non-profile collisions do not increase that count.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

pnpm openclaw --help
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129012-2CF49u/target$ pnpm openclaw --help
$ node scripts/run-node.mjs --help
pnpm openclaw --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 98.68 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 13.3s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4231ms (slowest: built plugin control-plane loads 3444ms)

OpenClaw 2026.8.1 (1098ccf) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console 
… output truncated …

Assertions:

  • PASS expect_output: OpenClaw

How this fits together

Gateway publication turns a reconciled session workspace into commits and pull requests. Session participant records supply eligibility and ordering facts, which are rendered into Git metadata and the published PR body.

flowchart LR
  A[Authenticated session prompts] --> B[Session participant records]
  B --> C[Verified opt-in attribution]
  C --> D[Gateway publication]
  D --> E[Commit trailers and credit]
  D --> F[Pull request body and session link]
Loading

Before merge

  • Resolve merge risk (P1) - This adds a nullable persisted contribution count to existing session databases; upgrade and repair behavior must retain the tested legacy-row and retry semantics.
  • Resolve merge risk (P1) - Existing Git co-author opt-ins now make the same verified public login more visible in generated pull requests, as documented by the maintainer decision in the PR discussion.
Agent review details

Security

None.

PR surface

Source +121, Tests +292, Docs +3, Generated +1. Total +417 across 21 files.

View PR surface stats
Area Files Added Removed Net
Source 10 159 38 +121
Tests 6 304 12 +292
Docs 3 7 4 +3
Config 0 0 0 0
Generated 2 2 1 +1
Other 0 0 0 0
Total 21 472 55 +417

Review metrics

Metric Value Why it matters
Production versus test LOC production +157/-38; tests +304/-12 The production growth implements one new persisted attribution fact and publication rendering, while focused tests cover ordering, repair retries, legacy rows, and PR-body output.
Persisted session shape 1 nullable column added Existing agent databases lazily add contribution_count, so upgrade behavior matters even without a schema-version bump.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-session-canonical-keys.ts, serialized state: src/config/sessions/session-accessor.sqlite-canonical-repair.ts, serialized state: src/config/sessions/session-accessor.sqlite-node-artifacts.ts, serialized state: src/config/sessions/session-accessor.sqlite-participant-projection.ts, serialized state: src/config/sessions/session-accessor.sqlite-participants.test.ts, serialized state: src/config/sessions/session-accessor.sqlite-participants.ts, and 4 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Retain the additive upgrade path (recommended)
    Accept the documented nullable-column migration and legacy-row-as-one behavior, with the focused upgrade and retry coverage preserved.
  2. Pause for a different persistence contract
    Do not merge if maintainers want contribution counts to be a separately versioned or differently reconciled session-state contract.

Technical review

Best possible solution:

Land the canonical owner-boundary implementation with its additive lazy schema ensure, verified opt-in resolver, and focused publication/upgrade coverage intact.

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

Not applicable: this is a new publication capability, not a report of broken current behavior. The PR includes focused after-change tests for attribution ordering, legacy database rows, repair retry behavior, and generated PR bodies.

Is this the best way to solve the issue?

Yes. The feature records counts at the session-participant owner, reuses the existing verified opt-in identity resolver, and uses the canonical Control UI session URL helper rather than adding a parallel attribution or link source.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e9017714c2d6.

Labels

Label changes:

  • add merge-risk: 🚨 session-state: The PR adds and reconciles a persisted participant contribution count in existing per-agent session databases.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; it supplies focused after-change publication and persistence test evidence.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 security-boundary: Current PR review merge-risk labels are merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded user-visible publication and session-attribution feature under active maintainer review.
  • merge-risk: 🚨 compatibility: An existing Git co-author opt-in now also controls visible pull-request attribution for already configured users.
  • merge-risk: 🚨 session-state: The PR adds and reconciles a persisted participant contribution count in existing per-agent session databases.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; it supplies focused after-change publication and persistence test evidence.

Evidence

What I checked:

Likely related people:

  • steipete: History shows Peter Steinberger authored the original publication broker and the preceding identity/co-author and session-owner work, as well as both commits on this PR. (role: introduced the Gateway publication path and recent session-attribution contributor; confidence: high; commits: 0606e31d0e62, 4048ae26e0db, 1098ccf5423e; files: src/gateway/github-publication-executor.ts, src/agents/git-coauthor-attribution.ts, src/config/sessions/session-accessor.sqlite-node-artifacts.ts)

Rank-up moves

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

  • Confirm exact-head CI before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-25T04:49:49.930Z sha 667b22f :: found issues before merge. :: [P2] Preserve content following replaced attribution blocks

@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the latest ClawSweeper review on 1098ccf5423e9579473dfa703680c1a4d5fe6d95.

  • Fixed the P2 content-loss defect by limiting replacement to the exact generated Worked on by heading plus GitHub-login bullet list. Later ordinary prose and lower-level Markdown headings are now preserved.
  • Added a regression with a generated attribution block followed by ### Verification notes and ordinary paragraph content.
  • Maintainer decision: the existing Git co-author credit opt-in authorizes the same verified public GitHub identity to appear visibly in GitHub publication metadata. This is intentional—the feature request is to make consenting contributors discoverable without opening commit trailers. The canonical team-session link is publication provenance and is appended only when the Gateway already exposes an external HTTPS session URL; no URL is synthesized and local-only deployments omit it.

Proof:

  • node scripts/run-vitest.mjs src/gateway/github-publication-attribution.test.ts — 2/2 passed.
  • node scripts/check-changed.mjs -- src/gateway/github-publication-executor.ts src/gateway/github-publication-attribution.test.ts — passed.
  • Fresh uncommitted autoreview — no accepted/actionable findings.
  • Remote branch head verified at 1098ccf5423e9579473dfa703680c1a4d5fe6d95.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 25, 2026
@steipete
steipete merged commit 8f05036 into main Aug 25, 2026
241 checks passed
@steipete
steipete deleted the steipete/roboclaw-attribution branch August 25, 2026 05:57
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
* feat(github): surface team-session attribution

Worked on by:
- @steipete

* fix(github): preserve PR body after attribution

Worked on by:
- @steipete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. r: skill Auto-close: skills should be published on ClawHub, not added to core. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant