Skip to content

fix(ci): honor loaded stop policy in upgrade fixtures - #160000

Merged
roboclaw-bot merged 3 commits into
mainfrom
fix/survivor-loaded-stop-budget
Sep 28, 2026
Merged

roboclaw-bot merged 3 commits into
mainfrom
fix/survivor-loaded-stop-budget

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes upgrade-survivor fixtures rejecting the effective stop-policy query and enforcing a hardcoded 30-second deadline when the loaded generated unit specifies a different budget.

User Impact

Internal acceptance-harness correction only; no updater runtime or production configuration change. The fixture reports and enforces its loaded unit policy, retains admitted state until reload, and does not report successful stop while owned processes remain or policy inspection failed.

Why This Change Was Made

The existing loaded-unit parser owns the effective stop budget for the maintenance query, supervisor and outer wait. Ordinary inspection cannot unload a removed on-disk unit. Supervisor-side policy errors trigger fatal cleanup and observed process-group extinction rather than abandoning the child or restarting.

The additional outer-entrypoint finding is also addressed: failed pre-signal policy inspection still signals the supervisor and joins through the existing five-second settlement allowance—not a replacement service timeout. Failure remains nonzero after cleanup; uncertain settlement retains supervisor/custody files. Normal, zero/infinite, reload and process/cgroup guards remain intact.

Existing extracted-supervisor test callers now supply the narrow manager dependency and their original timing budgets through it. Graceful drain, descendant extinction, restart overlap and sanitized-diagnostics assertions remain unchanged. This repairs demonstrated fixture defects; it does not establish the cause of the earlier inaccessible updater failure.

Evidence

  • Original effective-policy mismatch and the outer-stop failure were reproduced through the actual installed shim in isolated state.
  • Outer-stop regressions before correction: 3 failed, 1 successful-stop control passed; 3.00 s wall.
  • After correction: all 19 stop-policy and 3 cgroup tests passed; 6.78 s wall, 4.936 s policy-test time. Includes a real TERM-ignoring child, unit removal, daemon-reload and outer stop, requiring nonzero failure and extinct process group.
  • Tests also cover uncertain settlement and preserving the original query failure when a later settlement check succeeds.
  • Caller regression: all 10 originally reported cases plus bootstrap sibling passed; 11/11 in 7.69 s. Combined callers and native-auth siblings passed 13/13 in 13.63 s with command-scoped loopback proxy exclusion.
  • Full Docker-helper file: 333/344 passed, not a green suite. Two loopback cases passed scoped replay; nine setup/parser failures reproduced on the unchanged base test file. Hosted exact-head CI remains required.
  • Formatting, shell syntax and diff-whitespace checks passed. Test processes were joined.
  • All four selected hosted Node rows passed on 3aa2c63; the hosted lint job failed and fail-fast cancelled other static jobs. Its log download was denied. Local reproduction found four fixture-script lint errors and nine test lint errors. The correction is mechanical: braces, a non-shadowing Promise callback name, Number.NaN and sorting a fresh array with toSorted; no assertions or failure behavior changed.
  • Corrected full scripts lint passed on all 1,231 files (31.5 s); targeted test lint passed and the policy/cgroup replay passed 22/22 in 6.47 s. A subsequent three-file replay also passed those 22 cases, but the existing full systemd suite could not load because its compiled-subprocess build lacked quickjs-wasi. No full-suite pass or dependency installation is claimed.

Independent reviews cleared the earlier two P2 fixes and caller-only adaptation. Final combined outer-entrypoint re-review is scoped-clean P0–P2; it independently confirmed the caller delta was unchanged. Reviews were static; executed proof is listed above. No installed-package release qualification is claimed.

Use the admitted unit stop budget for inspection and termination. Preserve loaded snapshots until reload and retain process custody through failed policy reads and group settlement.

Co-authored-by: RomneyDa <[email protected]>
@roboclaw-bot roboclaw-bot added the release-fast-lane Release tooling PR: narrow ci-gate, ClawSweeper advisory (RELEASING.md) label Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 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 scripts Repository scripts size: M labels Sep 28, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 28, 2026 01:04
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 9:56 PM ET / September 28, 2026, 01:56 UTC (Revision 3).

ClawSweeper review

What this changes

The upgrade acceptance fixture now reads the loaded systemd stop timeout, waits for owned processes to settle after stop failures, and tests those paths.

Merge readiness

✅ Ready for maintainer review

Current main still gives the upgrade fixture a 30-second stop deadline for a generated 330-second unit. The current PR head addresses that mismatch and the earlier stop-cleanup finding. I found no introduced blocking defect.

Priority: P2
Reviewed head: 5178910c3254fe3ea377fd19fd1b855b2aad0345

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused installed-shim before-and-after evidence supports a coherent fixture repair, with broader suite limits disclosed.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The installed systemctl shim is exercised with a real child and process group through removal, reload, and stop; the PR reports failing before-fix cases and 22 passing focused cases after the fix, including observed extinction and nonzero failure. The transient runtime JSON adds a stop-failure field, while an absent field remains compatible with earlier fixture state.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The installed systemctl shim is exercised with a real child and process group through removal, reload, and stop; the PR reports failing before-fix cases and 22 passing focused cases after the fix, including observed extinction and nonzero failure. The transient runtime JSON adds a stop-failure field, while an absent field remains compatible with earlier fixture state.
Evidence reviewed 9 items Generated unit budget: The shared Gateway stop budget totals 330 seconds and supplies the generated systemd unit.
Current-main mismatch: Current main still hardcodes 30 seconds in the fixture supervisor and 35 seconds in its outer stop loop.
Introduced policy owner: The branch parses the admitted unit's stop timeout and preserves its loaded snapshot until reload.
Findings None None.
Security None None.

How this fits together

OpenClaw's upgrade acceptance harness installs a simulated systemd manager around a Gateway process. It reads a generated service unit, supervises the process during an update, and reports whether the stop and restart settled.

flowchart LR
A[Generated service unit] --> B[Fixture loader]
B --> C[Loaded stop policy]
C --> D[Supervisor and outer stop]
D --> E[Process settlement]
E --> F[Upgrade acceptance result]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +522, Other +89. Total +611 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 543 21 +522
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 103 14 +89
Total 6 646 35 +611

Review metrics

Metric Value Why it matters
Production versus test growth fixture code +89 net lines; tests +522 net lines The fixture growth serves policy and settlement handling; the larger test addition covers loaded policy, failure, and real process paths.
Focused policy-test cost 4.936 s test time; 6.78 s wall The reported test time stays under the repository's five-second per-file target.

Stored data model

Persistent data-model change detected: migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/systemd-fixture.mjs, serialized state: scripts/e2e/lib/upgrade-survivor/systemd-fixture.mjs, unknown-data-model-change: scripts/e2e/lib/upgrade-survivor/systemd-fixture.mjs, unknown-data-model-change: scripts/e2e/lib/upgrade-survivor/update-restart-auth.sh. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Keep one loaded-unit policy source for fixture stop paths and retain process custody until the owned process group is observed extinct.

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

Yes. Current-main source supplies a 330-second generated unit but enforces 30 seconds in the fixture supervisor; the installed-shim scenario gives a focused reproduction path. I did not execute the checkout.

Is this the best way to solve the issue?

Yes. Reading the loaded policy through the fixture's existing unit parser and observing process settlement addresses the mismatch at its owner boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8a14f266fcc9.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded internal upgrade-acceptance defect without changing the updater's user-facing runtime.
  • merge-risk: 🚨 automation: The changed fixture determines whether automated upgrade acceptance reports a service stop as successful.
  • 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. Sufficient (terminal): The installed systemctl shim is exercised with a real child and process group through removal, reload, and stop; the PR reports failing before-fix cases and 22 passing focused cases after the fix, including observed extinction and nonzero failure. The transient runtime JSON adds a stop-failure field, while an absent field remains compatible with earlier fixture state.
  • proof: sufficient: Contributor real behavior proof is sufficient. The installed systemctl shim is exercised with a real child and process group through removal, reload, and stop; the PR reports failing before-fix cases and 22 passing focused cases after the fix, including observed extinction and nonzero failure. The transient runtime JSON adds a stop-failure field, while an absent field remains compatible with earlier fixture state.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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 (2 earlier review cycles)
  • reviewed 2026-09-28T01:11:51.614Z sha 2d85893 :: blocked before merge. :: [P2] Settle the supervisor when stop-policy inspection fails
  • reviewed 2026-09-28T01:46:10.901Z sha 3aa2c63 :: needs maintainer review before merge. :: none

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

I confirmed the actionable outer-stop finding in the reviewed head. The current pre-signal policy lookup can return before notifying the live supervisor; that path needs an installed-shim regression and a fix before merge. It is distinct from the supervisor-side signal/child-close cases already tested. The correction is in progress, with process custody and nonzero failure reporting retained.

The CI caller-integration repair is also prepared: extracted supervisors now receive the required narrow manager dependency, and existing timing/process assertions use their original test budgets through that dependency. All 10 reported failures plus the bootstrap sibling pass (11/11). The full local helper file is not claimed green: 333/344 passed; two loopback-proxy cases passed with command-scoped loopback exclusion, and the remaining nine setup/parser failures reproduced against the unchanged base test file. Hosted exact-head gates will still be required.

No production fallback to the old hardcoded timeout, acceptance weakening, merge override, or duplicate review request. I will push the cohesive correction after the outer-entrypoint proof and review are complete.

Signal the existing cleanup owner when outer stop-policy inspection fails, retain failure after observed settlement, and supply loaded-policy dependencies in supervisor tests.

Co-authored-by: RomneyDa <[email protected]>
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026
Preserve reviewed behavior while adding required braces, avoiding a shadowed callback name, and using Number.NaN and nonmutating fresh-array sorting. Full scripts lint and targeted regression proof verified.

Co-authored-by: RomneyDa <[email protected]>
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 28, 2026
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) September 28, 2026 01:59
@roboclaw-bot
roboclaw-bot merged commit 8232c28 into main Sep 28, 2026
96 of 98 checks passed
@roboclaw-bot
roboclaw-bot deleted the fix/survivor-loaded-stop-budget branch September 28, 2026 02:00
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
Use the fixture's admitted loaded-unit stop budget for policy inspection and cleanup. Preserve loaded snapshots until reload, retain supervisor custody through failed policy reads, and report failed stops only after observed cleanup. Adapt supervisor test callers without weakening their behavior checks.

Independent and ClawSweeper reviews resolved the outer-stop failure; installed-shim regressions cover policy loss, process extinction and uncertain settlement. Focused policy/cgroup and caller proofs passed. Full local suite setup limitations and exact-head hosted evidence are recorded in the PR. No product runtime changes or completed release qualification are claimed.

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

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. release-fast-lane Release tooling PR: narrow ci-gate, ClawSweeper advisory (RELEASING.md) scripts Repository scripts size: L 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