Repository navigation
fix: retain human co-author credit through delegation - #157268
Conversation
Capture bounded contributor provenance at trusted child creation and retain it across nested delegation and resets. Join accepted participant writes before the snapshot, and resolve current GitHub identities and credit preferences through existing read workers without changing participation or access. Related: #156978. Existing delegated sessions are not backfilled; optional metadata requires no schema migration.
|
🦞👀 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 maintainer review before merge. Reviewed September 24, 2026, 4:09 PM ET / 20:09 UTC (Revision 11). ClawSweeper reviewWhat this changesThe branch stores a bounded contributor snapshot in delegated child sessions and uses current identity and consent checks when agent prompts and GitHub publication add human co-author credit. Merge readiness✅ Ready for maintainer review Keep open. Current main still derives co-author credit from a child session’s direct participants, so delegated work can lose the originating humans’ credit. This branch addresses that gap through the existing session and publication owners. The maintainer explicitly accepted session-wide eligibility and the older-build reset limit; this review found no remaining introduced blocker. Priority: P2 Review scores
Verification
How this fits togetherGateway session creation records contributor provenance when an agent delegates work. Agent prompts and GitHub publication read the child session and current profile preferences before producing commit and pull-request credit. flowchart LR
A[Source session participants] --> B[Delegation snapshot]
B --> C[Child session metadata]
C --> D[Current identity and consent]
E[Direct child participants] --> D
D --> F{Eligible for credit?}
F -->|Yes| G[Commit and PR credit]
F -->|No| H[No new human credit]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +667, Tests +817, Docs +6. Total +1490 across 66 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep inherited credit bounded and private, resolve eligibility through the current profile owner before public effects, and handle task-specific or unlinked-channel qualification through their separate contracts. Do we have a high-confidence way to reproduce the issue? Yes at the source boundary: current main reads only a child session’s direct participant records, so a delegated child without direct human records has no originating human to credit. This review did not execute current main. Is this the best way to solve the issue? Yes. Capturing provenance at trusted child creation and resolving current consent in the existing attribution owner is a narrow fit for the established publication path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fd0b79614de5. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
Integrate current main and repair the CI fixture boundary for authenticated artifact download and publish-input sealing. Keep real descriptor validation and sealing logic, with synthetic external transport and registry responses.
Bind prepared credit to profile authority through the final commit, push and pull request guards. Fence canonical credit preference writes before commit and reject stale credit on unpushed recovery commits while preserving observed public effects.
|
The four release-artifact fixture failures also blocked release-repair PRs #157239 and #157318. We reproduced the exact failure on CI merge 3bd801e: the newer writer requires qualified npm preflight sealing, while the older fixtures supplied empty credentials. The author-head pass was not relevant proof. I independently verified the exact two-file repair from a34af46: Node24, owned frozen dependencies, 164/164 ordered cases. Since then main landed canonical fixture correction 3928d51. We now consume that single mainline owner and have removed the temporary copied helper, rather than retaining a duplicate implementation. The canonical main fixture independently passed 164/164 on Node24 in 16.34 seconds. PR157239 now carries conflict-resolved head 3366cfd with eight changed files and fresh ordinary CI/review required. No changes to this attribution-feature branch, production authentication, or sealing policy were made; its broader feature was not qualified or taken over here. |
Seed the obsolete-row fixture from the current generated catalog before introducing the exact obsolete row. Pending post-merge translation refreshes no longer contaminate the strict validation case; malformed, referenced and missing-row assertions remain unchanged.
Resolve the Android fixture overlap with the upstream version and retain main’s complete wrapper inventory. These repairs are no longer duplicated in the PR; attribution and CLI lock changes retain their reviewed bytes. Validation: 160 integration cases pass with one existing platform skip; core types and full-candidate P2 review pass.
Integrate the focused existing-PR repair from #157420. Parse the pinned commit with Git before reusing its credit; missing recognized trailers produce one forward-only commit with the same tree. Retain current contributor-consent checks after the read and the request-owned recovery footer guards. The real-Git publication regression covers malformed historical credit, unchanged tree/history, valid repeat reuse, no-current-human publication, and a failed trailer read. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: steipete <[email protected]>
Preserve both additive worker inventories while integrating current main. Restore the Android Access job’s existing release reservation and explicit sealing dependency, without changing its Ubuntu/KVM execution contract. Retain the Doctor fixture IPC channel while its synthetic prompt awaits SIGTERM and disconnect through cleanup. Workflow baseline reproduced both contract failures;793 active owner tests and workflow/changed checks pass. Doctor original-order873 cases and8 focused process cases pass; its owning test type graph and lint pass. Both focused repairs passed independent review through P2.
Use the shared workflow evaluator to retain the ordinary Ubuntu runner contract after release reservation routing. Preserve the existing Android platform and packaged-evidence assertions. Add required braces to the existing missing-report guard without changing behavior. The original assertion failed against the valid reservation expression; 60 focused workflow cases, final Android 11 cases, types, lint and independent P2 review pass. Production workflow bytes are unchanged.
Integrate main through 056f627, including the canonical config snapshot kernel inventory fix in 5b210a8. Preserve delegated-credit behavior across the additive config diagnostic worker changes. The complete extracted closure, publication attribution and profile suites pass; core types and fresh full-candidate P2 review pass.
|
Merged via squash.
|
* fix: retain human co-author credit through delegation Capture bounded contributor provenance at trusted child creation and retain it across nested delegation and resets. Join accepted participant writes before the snapshot, and resolve current GitHub identities and credit preferences through existing read workers without changing participation or access. Related: openclaw#156978. Existing delegated sessions are not backfilled; optional metadata requires no schema migration. * test: keep nested admission and drain lifetimes explicit * fix: resolve current contributor consent through a leaf worker contract * fix: admit schema facts only when opening native readers * fix: retain current contributor consent through publication Bind prepared credit to profile authority through the final commit, push and pull request guards. Fence canonical credit preference writes before commit and reject stale credit on unpushed recovery commits while preserving observed public effects. * fix(test): isolate obsolete Android locale fixture drift Seed the obsolete-row fixture from the current generated catalog before introducing the exact obsolete row. Pending post-merge translation refreshes no longer contaminate the strict validation case; malformed, referenced and missing-row assertions remain unchanged. * fix: preserve Git-recognized credit through publication Build and verify the canonical terminal credit footer at the publication message owner. Title and body text cannot suppress or impersonate metadata; both recovery paths retain consent checks and reject malformed prepared credit. Document the existing session-level contributor boundary. Complete the native PR wrapper runtime inventory and make the command-lock fixture clock deterministic without increasing its timeout or weakening assertions. Focused publication and CLI tests, negative controls, changed-file checks and independent P2 review pass. * fix: verify Git trailers before reusing published credit Integrate the focused existing-PR repair from openclaw#157420. Parse the pinned commit with Git before reusing its credit; missing recognized trailers produce one forward-only commit with the same tree. Retain current contributor-consent checks after the read and the request-owned recovery footer guards. The real-Git publication regression covers malformed historical credit, unchanged tree/history, valid repeat reuse, no-current-human publication, and a failed trailer read. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: steipete <[email protected]> * test(ci): verify the resolved Android Access runner Use the shared workflow evaluator to retain the ordinary Ubuntu runner contract after release reservation routing. Preserve the existing Android platform and packaged-evidence assertions. Add required braces to the existing missing-report guard without changing behavior. The original assertion failed against the valid reservation expression; 60 focused workflow cases, final Android 11 cases, types, lint and independent P2 review pass. Production workflow bytes are unchanged. --------- Co-authored-by: vincentkoc <[email protected]> Co-authored-by: steipete <[email protected]>
* fix(release): restore PR checks after large validation pauses Co-authored-by: steipete <[email protected]> * fix(release): preserve independent PR checks during restore Co-authored-by: steipete <[email protected]> * fix(release): leave intentionally skipped CI runs alone Co-authored-by: steipete <[email protected]> * fix(release): revalidate deferred attempts before dispatch Co-authored-by: steipete <[email protected]> * test(release): reuse qualified manifest sealing fixtures Reuse the fixture-only repair from #157268 (f0cb7b3), byte-identical to the two files at a34af46. Keep the actual writer and validation policy, with controlled external transport. Co-authored-by: steipete <[email protected]> * test(tooling): capture nested cleanup failure state Record bounded failure-only process facts without changing the liveness predicate, assertion, deadlines or cleanup. This improves evidence for the unexplained CI failure; it does not claim a lifecycle fix. Co-authored-by: steipete <[email protected]> * fix(release): report skipped restore candidates in CLI output Show run IDs and recovery guidance when dispatch revalidation declines a rerun. Keep cancellation labeling distinct and preserve JSON, selection, mutation counts and retry behavior. Cover the actual CLI with portable secretless transport fixtures. Co-authored-by: steipete <[email protected]> --------- Co-authored-by: steipete <[email protected]>
…aw#157239) * fix(release): restore PR checks after large validation pauses Co-authored-by: steipete <[email protected]> * fix(release): preserve independent PR checks during restore Co-authored-by: steipete <[email protected]> * fix(release): leave intentionally skipped CI runs alone Co-authored-by: steipete <[email protected]> * fix(release): revalidate deferred attempts before dispatch Co-authored-by: steipete <[email protected]> * test(release): reuse qualified manifest sealing fixtures Reuse the fixture-only repair from openclaw#157268 (f0cb7b3), byte-identical to the two files at a34af46. Keep the actual writer and validation policy, with controlled external transport. Co-authored-by: steipete <[email protected]> * test(tooling): capture nested cleanup failure state Record bounded failure-only process facts without changing the liveness predicate, assertion, deadlines or cleanup. This improves evidence for the unexplained CI failure; it does not claim a lifecycle fix. Co-authored-by: steipete <[email protected]> * fix(release): report skipped restore candidates in CLI output Show run IDs and recovery guidance when dispatch revalidation declines a rerun. Keep cancellation labeling distinct and preserve JSON, selection, mutation counts and retry behavior. Cover the actual CLI with portable secretless transport fixtures. Co-authored-by: steipete <[email protected]> --------- Co-authored-by: steipete <[email protected]>
Related: #156978. Originally reported by Vincent Koc (@vincentkoc). Includes the focused existing-PR repair and real-Git regression from #157420, preserving its verified human co-author credit for @vincentkoc and @steipete.
What Problem This Solves
Delegating implementation to a child session dropped the originating humans from Git co-author credit because publication read only the child’s direct participants. Trusted delegation now carries bounded contributor provenance into the child, and the existing attribution owner resolves current verified GitHub identity and consent for prompts and publication.
User Impact
The snapshot retains at most 32 unique profile IDs, survives current-version session resets, and propagates through nested delegation. Creation joins already accepted participant writes before capturing it. Later source participants are excluded. Inherited credit remains separate from child activity, ownership, and access; private provenance is omitted from public session entries, and incognito sessions remain excluded.
Eligibility deliberately remains session-level: consenting, verified people already recorded in the source conversation are eligible, including earlier work in that conversation. A separate source conversation gives a separate contributor set. Task-specific causal attribution and unlinked channel-to-profile qualification are separate companion work. The real publication test intentionally credits an inherited-only earlier contributor alongside a direct child contributor, and excludes a late source participant and an opted-out profile.
Existing children are not backfilled. The field is optional and requires no database-schema migration or operator action. Current-version reset and upgrade preserve it. An older build without this feature can discard the new field during reset; that documented feature-version boundary is accepted for this scope, and existing session records remain readable.
Why This Change Was Made
Contributor reads use existing database workers and lifecycle-owned schema facts. Publication retains the existing profile owner’s authority through final commit, push, and PR dispatch. Canonical preference writes fence that owner before COMMIT; cosmetic preferences and rejected preference updates do not interrupt publication. Recovery refuses stale unpushed credit while retaining observed GitHub effects.
The existing publication-message owner now builds one canonical terminal Git footer independently of matching title/body text. Both adapters verify that footer’s exact request marker and current co-author set before resuming an unpushed commit. The repository API path acquires no Git executable dependency. This also fixes an allowed title equal to a co-author line suppressing the actual trailer. Reusing an already-published PR head reads Git-recognized trailers from that pinned commit and rechecks current consent after the read. Missing credit creates one forward-only commit with the same tree; historical commits stay intact. The real-Git regression also verifies repeat-request reuse, quoted examples, a Markdown separator, unavailable trailer reads, and no-current-human publication.
Evidence
89e428539e09d7a74900a4c1136bb830fb28f7a1. Independent review and the current-head ClawSweeper review are clean. The native workflow merged that exact head as1b66d30351da0d52041b882d2401da7eb000bff3, and GitHub recognizes @vincentkoc as a co-author.interpret-trailers --parse --no-dividerverifies one recognized human trailer for the title-collision case. Replacing only the repaired message logic makes all three generation/recovery regressions fail for missing metadata or incorrect publication. Earlier guard-removal proof likewise made all seven mid-publication opt-out/recovery regressions fail.Attribution/consent tests use synthetic Git/GitHub transport with real profile storage and publication owners. The history suite uses real Git and a local bare remote; its GitHub API transport remains synthetic. No live Gateway deployment or retrospective history rewrite is included. The original PR’s visible acknowledgment of Vincent was corrected separately.
CI investigations and scoped repairs
36001823109exposed an extra catalog freshness read and a reader-cleanup fixture omission. Admission now occurs only at native reader open; the unchanged five-read budget passes the original-order 605-case shard, with 47 schema/cleanup siblings passing. An earlier declaration cycle was repaired with a leaf worker reply type; runtime and Madge checks report zero cycles.3928d51bf8ee; this PR uses that test unchanged and removes its superseded helper. The upstream 64-case fixture passes and preserves actual artifact validation/sealing with synthetic transport.36010941397had one unexplained yielded-session requester metadata failure. One original-order replay on exact mergeaa9ed66d887fpassed all 511 cases across nine files. That is non-reproduction, not a claimed fix; assertions and timeouts were retained.36015903204failed the Android obsolete-row fixture because committed generated translations were still pending. Exact mergeb937a720a32breproduced 35 passing cases and one failure. The fixture now seeds the in-memory generated catalog before intentional obsolete drift, retaining every strict malformed/reference/missing-row assertion; all 36 cases pass. Actual translations were separately refreshed upstream in chore(i18n): refresh native locales #157337. The equivalent fixture repair subsequently landed in fix(ci): isolate obsolete Android localization fixture #157397; this PR now uses that canonical test unchanged.36023822699exposed the extracted PR wrapper’s missing eager plugin-state contract. Its existing module is added to the canonical inventory (+1 line). Exact merge549644721f87reproduced both closure failures; 84 selected native cases pass after repair, including 75 main-refresh cases, with unchanged assertions and guards. Changed checks and independent P2 review pass. The exact inventory addition subsequently landed in fix(maintainer): restore cold PR worktree provisioning #157394; this PR now uses main’s complete inventory unchanged.36036974175on35a2cf29da32completed with exactly three failed jobs plus its aggregate gate. The newly added Android Access job omitted the existing release reservation and explicit sealing dependency. On exact merge49d7bb5ad2b6, unchanged contract tests reproduced two failures; the two-line workflow repair passes 793 tests across five owner suites (12 existing skips), workflow lint/security checks, changed checks and independent P2 review. The sealing dependency was already transitive throughci-gate; this restores its required explicit workload inventory. Ubuntu/KVM labels, commands, matrix, permissions and deadlines remain unchanged.36045991157passed the repaired workflow and Doctor lanes; the Android runner-contract file passed 11 tests with native Vitest duration 0.808s. Its sole failing job was a new main integration omission: the extracted PR wrapper lackedconfig-journal-snapshot.kernel.ts, introduced by fix(config): apply Gateway writes without waiting for file events #157372. The canonical one-row inventory fix landed upstream as5b210a8eea75; this PR integrates it through main056f6278dd99rather than duplicating it. The original missing-module failure was reproduced, and the identical repaired closure/native-bootstrap/provisioning checks pass. On the integrated candidate, the full 15-case eager-closure suite, 11 publication-attribution cases and five profile cases pass (three wrapper shards, 100.14s), core types pass, and fresh full-candidate P2 review is clean. The accepted auto-merge request was retired through native recovery before this replacement head was published.36041813649exposed the Android job-specific test’s literalruns-oncomparison after the valid release-reservation wrapper was added. The test now uses the existing workflow evaluator and still requires the ordinary runner to resolve toubuntu-24.04; APK, ABI, page-size and evidence assertions remain intact. Its original assertion failed with 10 sibling cases passing; the repaired Android/release-routing/sealing selection passes 60 cases, and the final Android file passes 11 cases in 4.16s command wall. Owning test-root types, exact-file lint, formatting and fresh P2 review pass. The broader changed sequence was deliberately stopped during an unrelated export scan; it is not represented as a completed gate. Production YAML is unchanged from the prior 793-case proof.finally. The original 68-file baseline replay passed 873 cases locally, so this is an intermittent CI failure, not a claimed deterministic reproduction. The candidate passes the same 873 cases (186.16s) and all eight focused interruption cases (27.92s); signal/exit/event assertions and deadlines are unchanged, and independent P2 review is clean.e843a9a1d794includes upstream boundary-parser repair ci: reduce Node fixture overhead and defer seven release matrices #157341 and the reviewed outbound-readiness repair74b00d7de1b. That main-only fixture change replaced one-second polling with callback signals and guaranteed drain settlement; 78 files/1,273 cases, focused proof, changed checks and independent review passed.Two local production builds passed on earlier attribution heads, including
61993b9093d3. They emitted unchanged UI budget warnings (startup 363.0/362.6 KiB gzip; isolated Mermaid 1555.8/960.0 KiB). A final-head local full build is not claimed. The final credit follow-up’s changed-file checks complete successfully, including all 25 core-test graphs, unused-export scans and zero runtime cycles. Earlier aggregate changed-check attempts stopped at findings that were corrected; the final follow-up’s scoped changed check completed successfully, including all 25 core-test type graphs, core/scripts lint, line limits and repository guards. It is recorded separately from those earlier attempts.Measured test cost
Wall measurements use
pnpm test <file> --maxWorkers=1and include imports, worker compilation and cleanup. Some independent invocations overlapped. Initial-feature rows are retained evidence, not a claim that every file was rerun on every head; final follow-up rows are labeled.src/agents/cli-runner/helpers.system-prompt.test.tssrc/agents/embedded-agent-runner/run/run-attempt-dispatch.owner.test.tssrc/agents/git-coauthor-attribution.test.tssrc/agents/git-coauthor-prompt.test.tssrc/agents/runtime-prompt.test.tssrc/agents/subagents/spawn/acp-spawn.authority.test.tssrc/agents/subagents/spawn/acp-spawn.test.tssrc/agents/subagents/spawn/subagent-spawn-session-patch.test.tssrc/agents/subagents/spawn/subagent-spawn.test.tssrc/agents/subagents/spawn/subagent-spawn.workspace.test.tssrc/agents/system-prompt-params.test.tssrc/gateway/github-publication-attribution.test.ts(consent and terminal footer)src/gateway/github-user-identity.oidc.test.tssrc/gateway/server-methods/sessions-create.child-custody.test.tssrc/gateway/server.sessions.reset-models.test.tssrc/sessions/session-participant-recording.test.tssrc/state/openclaw-state-db-read-connection.test.tssrc/state/user-profiles-multi-account.test.ts(final consent correction)src/gateway/github-publication.test.ts(recovery/footer cases)src/gateway/github-publication-history.test.ts(existing-PR trailer repair)src/commands/agent-via-gateway.test.ts(deterministic lock fixture)src/commands/doctor-maintenance.interruption.process.test.ts(IPC lifetime fixture)test/scripts/android-app-i18n.test.ts(isolated obsolete-row fixture)test/scripts/android-access-workflow.test.ts(resolved runner contract)Additional proof: original-order catalog 605 cases/184.41s; native reader/schema siblings 47 cases/30.95s; release-artifact with its original predecessor 164 cases/51.16s; Android final integrated file 36 cases/9.00s; selected native-wrapper repair 84 cases/751.76s. The queued-writer case took 1.253s. The command-lock fixture retains a virtual 15ms budget; its real focused wall time is the table measurement.
Hosted run
36015903204, checkoutb937a720a32b, passed the earlier publication suites: attribution 9 cases totaling 13.987s of case execution, publication 20 totaling 14.468s, and multi-account 5 totaling 1.690s. These are case-duration sums, not file wall times. The unchanged upstream release-artifact file passed 64 cases with native Vitest file duration 2.863s. These preceding-head measurements are not claimed for the later added footer cases.The GitHub run archive download was interrupted, but the cited timing members were recovered offline and validated by CRC32 and compressed/uncompressed sizes. No incomplete member supplied a measurement.
Contributor provenance for the integrated repair: original implementation session.