Skip to content

fix(native-eval): rebootstrap replacement leases - #58

Closed
vincentkoc wants to merge 1 commit into
mainfrom
fix/native-fleet-rebootstrap
Closed

fix(native-eval): rebootstrap replacement leases#58
vincentkoc wants to merge 1 commit into
mainfrom
fix/native-fleet-rebootstrap

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 29, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Rehydrates replacement native-eval leases before dispatch.

Why?

The controller previously treated an old bootstrap timestamp as proof that a
new lease contained the runner. Recovery could then fail before the harness
started, producing a false benchmark failure.

Fixes #55

Changes

  • record the exact bootstrapped_lease_id
  • reuse bootstrap state only when it matches the active lease
  • add a regression test for recovery with an old timestamp and replacement lease

Live proof

Recovered a legacy OpenClaw run whose manifest had an old bootstrap timestamp
but no bootstrapped_lease_id.

  • rebound the run to its active replacement lease
  • performed the full native-runner bootstrap on that lease
  • persisted the exact active lease as bootstrapped_lease_id
  • dispatched the OpenClaw harness successfully
  • exported a verified final artifact with 4/4 completed results
  • run exit code: 0

This is the exact recovery state the regression test covers; the controller no
longer trusts timestamp-only bootstrap state.

Tests

  • 40 focused fleet tests pass
  • Python 3.11 and Python 3.12 CI pass
  • Ruff passes on the touched files
  • fresh Codex autoreview reports no actionable findings
  • live replacement-lease recovery completes a four-task OpenClaw run

@clawsweeper clawsweeper Bot added 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. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Jul 29, 2026
@clawsweeper

clawsweeper Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed August 22, 2026, 12:09 PM ET / 16:09 UTC.

ClawSweeper review

What this changes

The PR records the lease ID used to hydrate a native-evaluation machine and rehydrates a replacement lease before dispatching recovery work.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open: current main still uses timestamp-only hydration, while this MEMBER-authored PR is the focused candidate fix for the linked open recovery report. No concrete patch defect was found; maintainers need to accept the deliberate one-time hydration for legacy manifests.

Priority: P2
Reviewed head: 8949dc8328e9b86a0cf1f80bcf3a976c67c4837a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The repair is narrow, source-backed, and regression-covered; the remaining question is the explicit legacy-recovery operating trade-off.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless documents an after-fix recovery through final artifact verification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless documents an after-fix recovery through final artifact verification.
Evidence reviewed 4 items Current main remains affected: Current main decides hydration from bootstrapped_at_utc alone and contains no stored lease-ID comparison.
Focused recovery invariant: The PR compares the active lease with bootstrapped_lease_id and persists that ID only after hydration.
Regression coverage: The added test models a timestamp-only legacy recovery, asserts replacement-lease hydration, dispatch, and persistence of the active lease ID.
Findings None None.
Security None None.

Live Verification

Command: python -m pytest tests/test_native_eval_fleet.py -k replacement_lease -q

Result: FAIL (failed) — execution before step 1 run: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

Assertions:

  • FAIL expect_output: 1 passed

How this fits together

ShellBench’s native-evaluation fleet controller resumes benchmark runs on remote Crabbox leases. It reads a persisted manifest, prepares the active machine when needed, dispatches the harness, and records verified results.

flowchart LR
  A[Persisted recovery manifest] --> B[Fleet controller]
  B --> C[Resolve active Crabbox lease]
  C --> D{Hydrated lease ID matches?}
  D -->|No| E[Hydrate runner and tasks]
  D -->|Yes| F[Reuse prepared lease]
  E --> G[Dispatch native harness]
  F --> G
  G --> H[Verify and persist results]
Loading

Decision needed

Question Recommendation
Should recovery prioritize safe rehydration over avoiding one additional hydration for legacy timestamp-only manifests? Accept safe legacy recovery: Merge the PR and allow timestamp-only manifests to hydrate once before dispatching a replacement lease.

Why: The patch intentionally changes persisted-manifest recovery behavior, so maintainers own the resulting provider-cost trade-off.

Before merge

  • Resolve merge risk (P1) - Legacy manifests that only have bootstrapped_at_utc will perform one full hydration during their next missing-run recovery, adding bounded setup time and provider cost.
  • Complete next step (P2) - This MEMBER-authored PR has no mechanical repair finding; maintainers need to decide whether to accept its intentional legacy recovery behavior.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch scope 2 files affected; production +3/-1, tests +29/-0 The implementation changes one recovery decision and directly covers the legacy replacement-lease case.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #55
Summary: This PR is the concrete candidate fix for the linked replacement-lease recovery bug.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Merge with bounded legacy hydration (recommended)
    Accept the one-time setup cost for timestamp-only manifests so recovery cannot dispatch against an unprepared replacement machine.
  2. Pause for migration policy
    Defer the PR if maintainers require an explicit legacy-manifest migration or operator-facing recovery notice first.

Technical review

Best possible solution:

Accept the lease-ID invariant and merge the focused repair, retaining safe one-time hydration for legacy manifests.

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

Yes—the linked report and focused test define a timestamp-only recovery manifest that obtains a replacement lease; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes—the active lease ID is the missing identity needed to distinguish stale bootstrap metadata from a prepared active machine, and the change is confined to recovery.

AGENTS.md: not found in the target repository.

Codex review notes: model internal, reasoning high; reviewed against 884dd1bb5511.

Labels

Label changes:

  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.

Label justifications:

  • P2: An unprepared replacement lease can cause false native benchmark failures, but the affected recovery path is limited.
  • merge-risk: 🚨 compatibility: Timestamp-only manifests created before the new field will receive a newly required hydration on their next missing-run recovery.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless documents an after-fix recovery through final artifact verification.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Introduced the native matrix runner and authored subsequent fleet-path fixes visible in current history. (role: feature introducer and recent area contributor; confidence: high; commits: 69f75c6629c4, b9acd9f7a010, 884dd1bb5511; files: scripts/native_eval/fleet.py, tests/test_native_eval_fleet.py)

Rank-up moves

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

  • Confirm that the bounded one-time hydration cost for legacy manifests is acceptable.

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 (68 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-09T15:19:34.221Z sha 8949dc8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-09T19:46:17.199Z sha 8949dc8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-09T22:01:49.988Z sha 8949dc8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-09T22:30:57.871Z sha 8949dc8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-11T23:14:48.211Z sha 8949dc8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-12T01:18:10.142Z sha 8949dc8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-12T06:18:56.769Z sha 8949dc8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T09:37:12.881Z sha 8949dc8 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc marked this pull request as ready for review July 29, 2026 17:29
@vincentkoc
vincentkoc requested a review from a team as a code owner July 29, 2026 17:29
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jul 29, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 5, 2026
@clawsweeper clawsweeper Bot removed the proof: sufficient Contributor real behavior proof is sufficient. label Aug 22, 2026
steipete added a commit that referenced this pull request Aug 28, 2026
Integrate PR #58 onto current main while preserving active-harness
hydration. Cover legacy manifests, mismatched and matching lease IDs,
active-run preservation, and retry after a failed bootstrap.

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
@steipete

Copy link
Copy Markdown
Contributor

Superseded by #72 (merged), a reviewed integration of this repair from current main with the legacy timestamp-only manifest case verified — thank you @vincentkoc, credit preserved in the landed commit and changelog.

@steipete steipete closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rebootstrap native evals when recovery replaces a lease

2 participants