Skip to content

fix(upgrade): linked runtime targets skip readiness preflight - #1005

Merged
vincentkoc merged 1 commit into
mainfrom
fix/symlinked-runtime-preflight
Nov 5, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/symlinked-runtime-preflight

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Related: #132.

What Problem This Solves

A target registered through an entrypoint symlink could skip its package's advertised readiness preflight and switch runtimes even when that preflight would block startup.

User Impact

Blocked linked targets now fail preparation before source shutdown, checkpoint creation or binding replacement. Ready targets and packages without the capability retain their existing behavior.

Why This Change Was Made

Resolve actual entrypoint symlinks when discovering the package manifest, while retaining the registered launch path and stored metadata. Preserve legacy standalone artifacts whose staged executable is not published yet.

The broader issue remains open: the native isolated-core-startup protocol does not cover plugin convergence.

Evidence

  • Before: the new CLI regression on the original discovery code skipped preflight and reported a successful switch with a snapshot for a blocked target.

  • After: seven availability tests pass, including relative links under paths containing spaces, unrelated metadata beside the alias, an exit-zero blocked receipt, ready and legacy controls, and batch source availability.

  • The blocked case preserves registry bytes and the source binding, creates no snapshot and never invokes cold finalization. Batch refusals preserve source health and desired-running state; existing failure-after-cutover recovery assertions still pass.

  • Ordered remote baseline completed: formatting, 41 release-policy and 5 native-Gateway Python tests, all-target compilation, Rust suite and isolated installation (0.3.8). The first full Rust run caught a legacy staging regression; after correction, all 138 upgrade-command tests, seven availability tests and the unrun remainder passed. Unaffected preceding results were retained under the contribution guide's correction procedure.

  • Remote Linux x86_64: Rust/Cargo 1.98.1, Node.js 24.19.0, npm 11.19.1. CI passed all nine jobs, including Linux/macOS full suites and install smoke tests, Windows native checks, Rust 1.88 and all four npm matrices. All four CodeQL analyses passed.

  • CI qualified candidate 93d2f2a on base 7abac7d. The squash landed as dcdccff after #1004 merged concurrently. All three fix files and the Cargo/CI inputs match the qualified candidate; the concurrent delta only extracts shared official-install handling in two CLI handlers.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

🦞👀
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.

@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 priority bug or improvement 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 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR resolves target entrypoint symlinks before discovering package preflight metadata while preserving registered launch paths.

Example: Run ocm upgrade demo --runtime new --json when new links to OpenClaw 2026.8.14 and its advertised preflight returns blocked.

  • Before: Metadata beside the alias could cause preflight to be skipped and the runtime switch to proceed.
  • After: Preparation rejects the candidate without a snapshot, binding replacement, or cold finalization.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported, with meaningful reported integration coverage; behavior evidence remains fixture-based.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its supplied validation exercises the OCM upgrade command with synthetic package receipts and service fixtures, without independent live-output artifacts.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Upgrading to a linked runtime can bypass its advertised readiness check and proceed with a candidate that would report blocked startup.
Reason: The maintainer-authored change restores an established upgrade contract at low production complexity and correctly uses Related for the broader unresolved issue.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored draft fixes a current-main preflight bypass with a focused change; no actionable correctness or security defect was found.

Priority: P2
Reviewed head: 93d2f2ac6deb5e679afea4dfbc27fe6b25efab1e

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No separate shipped-CLI trace demonstrates linked-target rejection against a real capable OpenClaw package; supplied execution claims concern synthetic integration fixtures.
Agent review details

How this fits together

OCM's upgrade preparation reads the selected runtime's package capability and runs native readiness checks before entering the checkpoint and service-cutover transaction.

flowchart TD
 A[Upgrade command] --> B[Prepared runtime entrypoint]
 B --> C[Resolve link for package discovery]
 C --> D[Read preflight capability]
 D --> E[Run existing native preflight]
 E --> F[Reject before cutover]
 E --> G[Checkpoint and runtime cutover]
Loading

Technical review

Best possible solution:

Keep package discovery in the existing preflight owner, resolve actual entrypoint links, and preserve launch paths, legacy staging, and cold-finalization boundaries.

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

Current-main source directly shows the alias-parent metadata lookup bypass, and the PR reports a failing-before/passing-after CLI regression; this read-only review did not execute it.

Is this the best way to solve the issue?

The focused discovery fix restores the documented capability contract without replacing the registered launch path or forcing unpublished standalone artifacts to exist.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Change size Production +9/-1; tests +168/-16; changelog +1 Production growth is confined to discovery; test growth covers distinct refusal, success, legacy, and batch-availability outcomes.

Labels

Label changes:

  • add P2: A limited registered-runtime configuration bypasses an advertised safety check and can cause avoidable upgrade downtime.
  • 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: A limited registered-runtime configuration bypasses an advertised safety check and can cause avoidable upgrade downtime.
  • 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.

Rank-up moves

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

  • Attach redacted CLI output showing a linked capable target rejected before cutover, with ready and legacy controls.

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 5, 2026, 5:32 AM ET / 10:32 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 5, 2026 10:51
@vincentkoc
vincentkoc merged commit dcdccff into main Nov 5, 2026
14 checks passed
@vincentkoc
vincentkoc deleted the fix/symlinked-runtime-preflight branch November 5, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant