Skip to content

fix(ci): reject stale payloads in legacy upgrade checks - #190798

Merged
vincentkoc merged 1 commit into
mainfrom
fix/upgrade-survivor-legacy-identity-20261102
Nov 2, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/upgrade-survivor-legacy-identity-20261102

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Related: #186506

What Problem This Solves

Legacy upgrade checks could pass after an updater left stale application files installed, including when the baseline and candidate had the same version and build metadata.

User Impact

The legacy upgrade proof now rejects an installed package whose application bytes differ from the selected candidate tarball. This changes the test harness only; it does not change the updater, package version, or operator data.

Why This Change Was Made

Extend the existing candidate and installed package identity checks to legacy-operator-state. The canonical checker already binds the candidate to the selected source, rechecks the tarball hash, and compares package.json, openclaw.mjs, and the complete dist inventory. Reusing it avoids a second identity implementation.

The manual 2026.9.2 flow still observes the deferred-schema Doctor result before checking installed identity. The existing base and sqlite-volume gates remain covered. Production harness LOC is net zero; tests add 30 lines with the matching allocation, and documentation adds four lines.

Evidence

  • Exact source d40fc4cc43e2b988fdd19300b614974d84b2915f, compared with 18e52ca69eae4607807568b1ee6750b7213209c6.
  • Matched negative control substituted only the old shell owner: 16 cases, 12 passes, four intended assertion failures, verified with complete JSON and JUnit results. The current owner was restored before positive tests.
  • Four full suites passed on Node 24.22.1 and the repository-pinned Bun: 96 unique tests per runtime. Coverage includes same-version stale/valid payloads, wrong source, the 2026.9.2 ordering boundary, package identity, schema expectations, and rollback siblings.
  • Targeted formatting/lint, scripts test types, and both line ratchets passed. Source stayed unchanged; proof scratch and the native one-shot resource settled normally.
  • Native Blacksmith proof run: source carrier 440d8171a7a3066d27e835b48356cc9fc0972be8 transported the frozen source; workflow admission baseline a24c7aaffeefe723ed761520495519675807eb23 is separate from the source comparison base above.

Fresh complete source review of the exact commit passed with no findings; all source and process-settlement guards passed. This is focused harness proof; full candidate Docker upgrade witnesses, current-head CI/security, and native landing gates remain separate.

At the same head, both required openclaw/ci-gate results passed, and the completed check rollup contains no failed or pending checks. ClawSweeper's exact-head review reports no findings and no before-merge actions. The optional aggregate CodeQL check is neutral: 18 main-branch configurations are absent from this PR's comparison, so it does not establish alert-delta coverage for those configurations. Native final head, security, and merge admission still govern landing.

Extend the existing source-pinned package identity checks to legacy operator-state upgrades, including equal-version candidates. Preserve the deferred 2026.9.2 Doctor observation before installed payload verification.

Grant 30 test lines for stale same-version payloads, selected-source rejection, valid installation, and deferred-Doctor ordering regressions.
@vincentkoc vincentkoc self-assigned this Nov 2, 2026
@clawsweeper

clawsweeper Bot commented Nov 2, 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 scripts Repository scripts size: XS labels Nov 2, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 2, 2026 02:30
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

Please review current head d40fc4c. The PR body records the exact focused proof and complete source review; full candidate upgrade qualification remains separate.

@clawsweeper

clawsweeper Bot commented Nov 2, 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-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 2, 2026
@clawsweeper

clawsweeper Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR extends existing source and installed-payload identity checks to legacy operator-state upgrade tests.

Example: A legacy upgrade selects an openclaw 2026.10.9 tarball but leaves different application bytes installed under the same version and build metadata.

  • Before: The legacy flow skips the full payload comparison.
  • After: The existing identity checker rejects the stale installed payload.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with useful boundary coverage; the available proof establishes harness behavior rather than a complete packaged upgrade.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored harness repair is outside the ordinary contributor proof gate; supporting evidence exercises real identity checking with fixture installation, while full Docker qualification remains separate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Legacy upgrade qualification can attribute success to a selected candidate even when different application bytes remain installed.
Reason: The maintainer-authored direction closes a concrete verification gap without changing installed runtime behavior, public configuration, or operator data.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR repairs a source-confirmed gap in legacy upgrade verification, with no introduced defect found.

Priority: P2
Reviewed head: d40fc4cc43e2b988fdd19300b614974d84b2915f

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The focused source-extracted flow tests do not exercise the complete Docker survivor entry point; the body explicitly leaves full candidate qualification separate.
Agent review details

How this fits together

The upgrade-survivor harness takes a published baseline and selected candidate tarball, runs the updater, and produces upgrade qualification artifacts.

flowchart TD
A[Published baseline] --> C[Legacy survivor flow]
B[Selected candidate tarball] --> D[Candidate identity check]
D --> C
C --> E[Published updater]
E --> F[Deferred Doctor observation when applicable]
F --> G[Installed payload identity check]
G --> H[Remaining survivor checks]
Loading

Technical review

Best possible solution:

Extend the two existing identity gates to the legacy scenario while preserving deferred Doctor ordering and the generic no-baseline-receipt contract.

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

Current-main conditions visibly omit legacy-operator-state from both identity gates; the supplied regression harness demonstrates how equal-version stale bytes reach that gap, but this read-only review ran no target code.

Is this the best way to solve the issue?

The two condition changes are the smallest complete repair using the existing identity owner, and the added cases cover distinct admission, payload, success, and ordering failures.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Generic survivor payload verification keeps the original intent (286b9b0: Version equality cannot distinguish stale application payloads from the selected candidate.)
  • Audited versus generic candidate admission keeps the original intent (8ae1e87: Generic flows do not produce audited baseline receipts and must validate source and payload without requiring one.)
  • Deferred 2026.9.2 Doctor observation keeps the original intent (2ce8850: Observe the published updater's natural deferred schema header before subsequent candidate checks can affect the witness.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 2ce8850 adds scripts/e2e/lib/upgrade-survivor/run.sh:2861 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2ce885030396; files: scripts/e2e/lib/upgrade-survivor/run.sh)

PR surface

Tests +30, Docs +4, Other +3. Total +37 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 32 2 +30
Docs 1 10 6 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 2 5 2 +3
Total 4 47 10 +37

Labels

Label changes:

  • add P2: False-positive legacy upgrade qualification is a concrete automation defect with a limited affected surface.
  • 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: False-positive legacy upgrade qualification is a concrete automation defect with a limited affected surface.
  • 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.

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 November 1, 2026, 9:35 PM ET / November 2, 2026, 02:35 UTC.

@vincentkoc
vincentkoc merged commit 8ba4604 into main Nov 2, 2026
193 checks passed
@vincentkoc
vincentkoc deleted the fix/upgrade-survivor-legacy-identity-20261102 branch November 2, 2026 02:41
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
Extend the existing source-pinned package identity checks to legacy operator-state upgrades, including equal-version candidates. Preserve the deferred 2026.9.2 Doctor observation before installed payload verification.

Grant 30 test lines for stale same-version payloads, selected-source rejection, valid installation, and deferred-Doctor ordering regressions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XS 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