Skip to content

fix(update): retain authority through fallback publication - #188034

Merged
vincentkoc merged 1 commit into
mainfrom
fix/update-fallback-publication-authority-20261030
Oct 30, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/update-fallback-publication-authority-20261030

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Unjournaled package updates could publish packages or launchers after their forward executor was revoked. Copy-fallback moves could publish a backup or candidate and then fail before the swap owner recorded that fact.

User Impact

Forward admission now reaches POSIX rename/copy fallback, canonical symlink activation, native backup cleanup, and launcher publication. Published backups register compensation before later errors; published candidates report the correct active root. Rollback keeps its independent executor authority.

Why This Change Was Made

Reuse fs-safe's existing guarded publication callbacks and record ownership facts at commit time. Launcher restoration moves into the existing filesystem owner without changing its behavior. Windows bounded exact-rename retries and npm backup EXDEV refusal remain unchanged. No dependency, configuration, or persistence surface is added.

Evidence

  • Five real-filesystem regressions cover revocation during local override work, between launchers, EXDEV candidate publication, EXDEV native backup publication, and symlink canonicalization. Compensation uses an independent assertion.
  • Direct fs-safe 0.26.13 implementation inspection confirms publication callback ordering and guarded source cleanup.
  • Independent final scoped review: no actionable P0–P2 findings. Formatter, precommit freshness, and diff checks pass.
  • Native red/green: all five added regression cases fail against base production and pass against the candidate. The full focused filesystem, swap, Windows-fixture, forward-authority and launcher suites pass: 70 tests across five files (46.95s). No live installation was updated.

Production delta: +44 lines to carry authority and record publication at the owning boundary. Tests: +210 lines with a dedicated allocation.

@vincentkoc vincentkoc self-assigned this Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vincentkoc
vincentkoc marked this pull request as ready for review October 30, 2026 02:04
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@vincentkoc
vincentkoc enabled auto-merge (squash) October 30, 2026 02:08
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR carries executor authority through fallback package and launcher publication and records completed moves before later cleanup failures.

Example: An update from package version 1.0.0 to 2.0.0 loses forward authority while preserving local edits.

  • Before: Fallback activation can still publish version 2.0.0 after authority is revoked.
  • After: Publication stops, the previous package remains backed up, and an independently authorized rollback restores version 1.0.0.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused repair with distinct filesystem regressions and verified dependency semantics; evidence remains at the in-process authority boundary rather than an installed updater.
Proof confidence 🦐 gold shrimp (3/6) Sufficient (none): The maintainer-authored PR supplies production-owner filesystem harness coverage for authorized publication, revoked forward execution, retained EXDEV sources and backups, and independently authorized rollback, with reported red/green execution; this supports the authority-specific assessment without claiming a shipped CLI update or latest-stable upgrade.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A revoked updater can continue publishing fallback package or launcher bytes, while a completed copy followed by failure can leave recovery bookkeeping inaccurate.
Reason: The maintainer-authored direction restores the existing live-authority contract without adding configuration, dependencies, or persisted formats.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a current update-authority gap, preserves existing recovery behavior, and has no concrete introduced defect identified in this review.

Priority: P2
Reviewed head: 537e77696555bd6be9bcc3c91ef88513d499d973

Before merge

None.

Findings

None.

Agent review details

How this fits together

The package swap owner receives a staged installation and executor assertion, delegates filesystem publication to existing helpers, and returns installation status plus retained rollback operations.

flowchart TD
  A[Update executor] --> B[Package swap owner]
  B --> C[Filesystem publication owner]
  C --> D[fs-safe guarded moves]
  D --> E[Package and launchers]
  D --> F[Publication callbacks]
  F --> B
  B --> G[Independent rollback executor]
Loading

Technical review

Best possible solution:

Retain the existing swap and filesystem owners, carrying live authority to publication and recording committed effects before fallible cleanup.

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

Current-main source exposes the missing authority propagation, and the PR supplies focused real-filesystem regressions with reported base-red/head-green results; this review did not execute them.

Is this the best way to solve the issue?

The patch fixes the owning boundary by reusing existing guarded operations and commit callbacks, while preserving independent rollback authority and Windows exact-rename behavior.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned change and current-main behavior: The introduced diff adds authority checks and publication callbacks absent from fetched main; current main still publishes fallback launchers without passing the executor assertion. (src/infra/package-update-swap.ts:604, 537e77696555)
  • Affirmative dependency contract: The patch directly imports movePathWithCopyFallback from pinned fs-safe 0.26.13. Its implementation reports committed destinations before post-rename checks and guards copied-source cleanup, supporting the patch's callback placement; the dependency's filesystem-boundary policy was also read. (src/move-path.ts, 6c8627eb55a0)
  • Authority and compensation regressions: The added tests exercise real filesystem effects through the swap owner: revocation during override work, between launcher publications, and after EXDEV candidate or native-backup publication, followed by independently authorized rollback; a separate test rejects symlink publication after canonicalization revokes authority. (src/infra/package-update-swap.forward-authority.test.ts:17, 537e77696555)
  • Existing recovery intent: fix(update): preserve recovery files after ownership refusal #148890 established retained ownership refusals; fix: recover interrupted npm package updates #158491 retained separate recovery owners for native layouts and local overrides. This PR extends those contracts without replacing their recovery policy. (src/infra/package-update-swap.ts:604, b107d4af14d7)
  • Supplied execution evidence and inspection limits: The full PR body reports all five regressions failing on base and passing on the candidate, plus passing focused suites, and explicitly disclaims an installed update. Comments supply no additional behavior artifacts. GitHub job-log retrieval was blocked by the artifact-host allowlist; no tests or target code were run during this review. (537e77696555)

Likely related people:

  • Peter Steinberger: Raw commit b107d4a adds src/infra/package-update-swap.ts:618 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b107d4af14d7; files: src/infra/package-update-swap.ts)
  • Vincent Koc: Raw commit d69a5e7 adds src/infra/package-update-filesystem.ts:152 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d69a5e74895c; files: src/infra/package-update-filesystem.ts)

PR surface

Source +44, Tests +210, Other +2. Total +256 across 5 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 2 87 43 +44
Tests 2 210 0 +210
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 5 299 43 +256

Review metrics

Metric Value Why it matters
Production versus regression growth Production net +44 lines; tests +210 lines Growth wires existing authority and publication contracts and covers five distinct failure boundaries without adding a new manager or persisted state.

Labels

Label changes:

  • add P2: The change repairs fallback-update publication and recovery bookkeeping under executor revocation, with no established widespread outage.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The change repairs fallback-update publication and recovery bookkeeping under executor revocation, with no established widespread outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

Reviewed October 29, 2026, 10:10 PM ET / October 30, 2026, 02:10 UTC.

@vincentkoc
vincentkoc merged commit ca7ef93 into main Oct 30, 2026
205 of 206 checks passed
@vincentkoc
vincentkoc deleted the fix/update-fallback-publication-authority-20261030 branch October 30, 2026 02:14
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 30, 2026
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Backport #188034 and its regression coverage.

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant