Skip to content

fix: bind queued GitHub publication to its requester - #154477

Merged
shakkernerd merged 12 commits into
mainfrom
fix/publication-request-authority
Sep 22, 2026
Merged

shakkernerd merged 12 commits into
mainfrom
fix/publication-request-authority

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A shared GitHub publication can wait for a workspace checkpoint or survive a Gateway restart. Previously, that request retained its publishing account and workspace but could lose the person whose permission admitted it. Publication could continue after the original guest access expired or was revoked. A new invitation or promotion to staff could also make an old request appear authorized again.

User Impact

Queued publication keeps its original requester, accepted permission ceiling, and governing access grant across deferral and restart. Every new GitHub action checks that original authority. Reinviting the person, promoting them, or moving an original email alias away and back cannot revive the old request. Display changes and aliases added after admission preserve it. Independently authorized staff requests, saved work, existing PRs, publisher selection, and human credit retain their existing behavior.

Work GitHub already accepted remains recoverable. Recovery can observe a previous push or PR and settle its receipt without authorizing another write. An unresolved outcome stays pending when safe observation is unavailable. Accepted-result and Git-index settlement are supplied by #155321; this PR composes those semantics with the original requester's durable authority.

Implementation

The publication lifecycle owner records an immutable requester snapshot when accepting shared work in either local-worktree or repository-checkpoint storage. It retains the original scopes and plugin grant. Current profile, role, alias, session, and membership facts come from the existing worker-backed read owners. Canonical writers refresh retained facts before commit observers run. A synchronous boundary check reads current identity facts together, applies the session policy, resumes the original grant, and rechecks after plugin callbacks. Preparation requires an existing session generation and retains observations of every searched store, so a new conflicting row cannot appear unnoticed.

The original invocation's cancellation, client, session, and retained-source checks remain separate from the saved requester policy. Immediate idempotent retries combine those current invocation checks with the first accepted snapshot and digest. Unknown storage facts defer recovery; a definitively ended or replaced grant prevents further publication. Execution custody separately protects accepted-result bookkeeping.

The maintainer-approved storage contract uses state schema 18, refuses older readers, requires fresh admission for unfinished legacy shared publications, and restores a verified pre-migration backup for downgrade. State schema 18 adds nullable requester metadata to the two existing publication stores. The profile schema owner initializes an opaque binding ID on each email alias and changes it when the alias changes owners. Request snapshots contain those IDs, without credentials, email addresses, or profile display data. Historical completed receipts remain readable. Unfinished unbound shared work requires fresh authorized admission after existing effects are reconciled. Older readers reject schema 18; downgrade requires a verified pre-migration backup and does not undo GitHub effects. Canonical schema, SDK, Visitor Access, and user-model documentation are updated.

Evidence

Head 36f84f37db5c integrates main 485fa310fc91, including the accepted-result prerequisite and native scope adapter in #154922. The current profile mutation owner publishes changed alias-binding facts with its established native commit outcome, installs all retained facts before observers, and preserves newer facts when older receipts arrive late. Unsettled mutations keep accepted publication pending. The original invocation and grant checks remain separate.

The integration passed 388 selected cases across 23 files and both native subprocess scenarios on Testbox. Both new ordering regressions fail against the original unpublished integration and pass on the correction. Real held-settlement cases in both publication backends preserve the original receipt and resume after settlement. Current-source independent reviews, complete scoped P2 review, formatting, typed lint and ratchets pass. The runtime-tested source differs only by a block-local variable rename required by lint; the declaration and both uses were verified equivalent. Core production types and all four affected test type graphs pass. Removing the specific unsettled-profile error mapping makes both local and repository recovery cases fail; the corrected source was restored and verified. ClawSweeper revision 19 rates this exact head Platinum, with Diamond proof confidence and no code findings.

The current full CI tests the composition with main 21cbb3cd7243. Its ten completed failing jobs reproduce pre-existing QA/MCP fixture or prepared-plugin disposal failures. The QA/MCP fixture repairs are delivered in 54c312971a40, and 44559eb315e0 removes the three QA Slack suppressions. The prepared-plugin disposal failure remains with its shared owner. All CI jobs are complete, including passing Apple, Android and Windows lanes. The failed statuses remain recorded.

The prospective composition with main 9455d642e8f3 also passes both existing recovery-continuation authorization cases and the Gateway server type graph on Testbox. These checks preserve the original client and revocation guard when continuation targets a linked session. Later target changes leave all 138 W7 paths and this recovery owner unchanged.

The earlier 39a47d707a96 composition has green full CI, all 25 core test graphs, 259 selected cases, both native scenarios, and an exact-head Platinum review with no findings. Those results retain their original source identity; the profile-owner integration receives its own affected proof and final-head checks.

The original revoked-access failure was reproduced through both publication backends. Source-bound regressions cover grant expiry/replacement, alias transfer and restoration, role changes, idempotent retries, requester loss during execution, worker unavailability, accepted results, and registered RPC handlers. The historical-recovery counterfactual terminalizes an uncertain prior attempt when its guard is removed; both corrected cases preserve that outcome while fresh credential and unsafe-Git failures still terminate normally.

The retained published-2026.9.5 populated-profile upgrade proof used the unmodified package built from 5a437dbc. It preserves every original profile and alias field, initializes four distinct binding IDs, preserves them through same-owner linking and Gateway reopen, admits schema 18, rejects an old reader, and restores the exact schema-17 backup. Earlier published-driver cells also preserve existing agent history and publication receipts through service replacement. These package receipts retain their actual source identities. The current agent-schema-23 owner supplied its own published-updater and backup-restoration evidence; the relevant Doctor/schema implementation is qualified separately.

The native publication scenarios use isolated state, real Git and child processes, and controlled checkpoint/GitHub responses. They cover restart and in-flight revocation, join every child process, and permit only independently authorized staff publication. They make no live GitHub write or child-process cancellation claim.

@clawsweeper

clawsweeper Bot commented Sep 21, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling plugin: file-transfer plugin: visitor-access size: XL maintainer Maintainer-authored PR labels Sep 21, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 22, 2026, 12:29 AM ET / 04:29 UTC (Revision 19).

ClawSweeper review

What this changes

The PR preserves the original requester’s permissions across queued GitHub publication and restarts, adds durable identity metadata, and updates recovery, migrations, tests, and documentation.

Warning

SQLite table change

This PR modifies persisted SQLite tables in src/state/openclaw-state-schema.sql, src/state/user-profiles-schema.ts. Prefer a design that avoids changing persisted SQLite tables. If the change is necessary, verify migration and upgrade compatibility against an existing database before merge.

Merge readiness

⛔ Blocked before merge - 5 items remain

This remains useful work absent from current main. No actionable correctness defect was found; the documented storage compatibility change still needs the repository-required design acceptance.

Priority: P1
Reviewed head: 36f84f37db5c592e473cbeae5b2c043a63a17a52
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent repair with strong boundary evidence and no identified blocking code defect; storage acceptance is a separate merge decision.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The source-qualified native scenarios exercise both production publication owners with isolated SQLite, real Git and child processes, showing restart and in-flight revocation block further publication while independent staff work succeeds. GitHub responses are controlled; no live GitHub-write claim is made. The latest integration adds held-settlement recovery evidence, while older upgrade receipts retain their original source identities.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The source-qualified native scenarios exercise both production publication owners with isolated SQLite, real Git and child processes, showing restart and in-flight revocation block further publication while independent staff work succeeds. GitHub responses are controlled; no live GitHub-write claim is made. The latest integration adds held-settlement recovery evidence, while older upgrade receipts retain their original source identities.
Evidence reviewed 10 items Pinned introduction and clean checkout: Reviewed the introduced delta from pinned base 485fa31 to head 36f84f3. The supplied test merge is stale and was not used to infer removal of main behavior. The checkout remained clean.
Original authority is revalidated: The requester policy checks current identity bindings, the accepted scope ceiling, current role and session permissions, and the original plugin grant; it checks prepared facts again after plugin callbacks. Unsettled profile mutations defer recovery.
Profile mutation integration: Committed profile and binding facts are installed before observers run, with pending authority fences settled afterward. Binding witnesses and supersession tracking prevent delayed receipts from restoring older alias authority.
Findings None None.
Security None None.

How this fits together

The Gateway publishes session work through a shared GitHub account using either local Git worktrees or repository checkpoints. Requester authorization controls new writes, while execution ownership allows already-accepted results to be recorded safely.

flowchart TD
  A[Authenticated publication request] --> B[Capture requester and permission ceiling]
  B --> C[Durable publication receipt]
  C --> D[Queue or restart recovery]
  D --> E{Original authority still current?}
  E -->|Yes| F[Publish through selected GitHub account]
  E -->|No| G[Observe existing effects only]
  F --> H[Settle original receipt]
  G --> H
Loading

Decision needed

Question Recommendation
Accept schema 18’s older-reader refusal and fresh admission for unbound pending publications, with rollback through a verified pre-upgrade backup? Record acceptance: Accept the documented migration and rollback contract and link that decision from the PR.

Why: The implementation and upgrade evidence explain the tradeoff, but repository storage policy requires a linked acceptance that the inspected discussion does not provide.

Before merge

  • Resolve merge risk (P1) - Schema 18 prevents older binaries from reopening migrated state, and unfinished legacy shared publications require fresh admission after reconciliation. The required acceptance of this upgrade and backup-based rollback contract remains unlinked.
  • Complete next step (P2) - Link the maintainer decision accepting schema 18, fresh admission for unbound pending publications, and backup-based rollback.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test growth Production net +3,140 lines; tests and test support net +3,685 lines The stated growth supports durable authority, worker-prepared facts, reconciliation, and regression coverage across both publication backends.
Persistent compatibility change State schema 17 → 18; 2 receipt columns and 1 alias-binding column The migration changes downgrade and pending-request recovery behavior.

Stored data model

Persistent data-model change detected: database schema: src/state/openclaw-state-schema.sql, database schema: src/state/user-profiles-schema.ts, migration/backfill/repair: src/state/openclaw-state-db-maintenance.ts, migration/backfill/repair: src/state/openclaw-state-db-schema-repair.ts, unknown-data-model-change: src/state/user-profiles-schema.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Accept the documented migration (recommended)
    Record the storage decision covering older-reader refusal, legacy request readmission, and backup-based rollback.
  2. Pause for another compatibility design
    Defer landing if the storage owner cannot accept the documented schema transition.

Technical review

Best possible solution:

Keep requester authorization with the existing publication owners and land the durable binding after recording acceptance of its documented upgrade and rollback contract.

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

Yes, the current-main recovery path lacks durable requester binding, and the supplied evidence describes revoked-access reproductions through both backends. This read-only review verified the source mechanism without executing it.

Is this the best way to solve the issue?

Yes, retaining the original requester in existing receipts and separating write authorization from accepted-result settlement fits the existing owners; the schema compatibility decision remains distinct from correctness.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: Queued shared-account publication must stop issuing new writes after the original requester’s access ends.
  • merge-risk: 🚨 compatibility: Migrated state rejects older binaries and unbound pending publications require fresh admission, making the documented upgrade decision merge-relevant.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The source-qualified native scenarios exercise both production publication owners with isolated SQLite, real Git and child processes, showing restart and in-flight revocation block further publication while independent staff work succeeds. GitHub responses are controlled; no live GitHub-write claim is made. The latest integration adds held-settlement recovery evidence, while older upgrade receipts retain their original source identities.
  • proof: sufficient: Contributor real behavior proof is sufficient. The source-qualified native scenarios exercise both production publication owners with isolated SQLite, real Git and child processes, showing restart and in-flight revocation block further publication while independent staff work succeeds. GitHub responses are controlled; no live GitHub-write claim is made. The latest integration adds held-settlement recovery evidence, while older upgrade receipts retain their original source identities.

Evidence

What I checked:

Likely related people:

  • shakkernerd: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (18 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-21T18:42:22.765Z sha d41923b :: blocked before merge. :: none
  • reviewed 2026-09-21T19:51:06.867Z sha c97a78b :: blocked before merge. :: none
  • reviewed 2026-09-21T20:03:04.658Z sha c97a78b :: blocked before merge. :: none
  • reviewed 2026-09-21T22:43:05.372Z sha 57a3334 :: blocked before merge. :: none
  • reviewed 2026-09-22T00:45:43.137Z sha 8e2d128 :: blocked before merge. :: none
  • reviewed 2026-09-22T01:01:09.102Z sha 8f1ccaa :: blocked before merge. :: none
  • reviewed 2026-09-22T01:18:48.498Z sha 8f1ccaa :: blocked before merge. :: none
  • reviewed 2026-09-22T02:52:52.447Z sha 39a47d7 :: blocked before merge. :: none

@shakkernerd shakkernerd self-assigned this Sep 21, 2026
@shakkernerd
shakkernerd force-pushed the fix/publication-request-authority branch from 74b947d to 121ca22 Compare September 21, 2026 08:12
@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call cli CLI command changes labels Sep 21, 2026
@shakkernerd
shakkernerd force-pushed the fix/publication-request-authority branch 2 times, most recently from bbb3877 to e301e8c Compare September 21, 2026 09:58
@shakkernerd
shakkernerd force-pushed the fix/visitor-active-access branch 2 times, most recently from 09d10c0 to 82a1b0d Compare September 21, 2026 11:09
@shakkernerd
shakkernerd force-pushed the fix/publication-request-authority branch from e301e8c to e2696bf Compare September 21, 2026 11:11
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Sep 21, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed 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. labels Sep 21, 2026
@shakkernerd
shakkernerd merged commit 65e49fa into main Sep 22, 2026
234 of 246 checks passed
@shakkernerd
shakkernerd deleted the fix/publication-request-authority branch September 22, 2026 05:20
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: Queued GitHub publication now retains its original requester and access grant while preserving accepted results.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
Queued shared GitHub publication retains its original requester and access grant across deferral and restart. Accepted results remain recoverable after access ends.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: voice-call Channel integration: voice-call cli CLI command changes 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. P1 High-priority user-facing bug, regression, or broken workflow. plugin: file-transfer plugin: visitor-access proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security-sensitive-changed size: XL 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