Skip to content

fix: release checks survive owned process exits - #155

Merged
RomneyDa merged 3 commits into
mainfrom
release-ci/cpu-census-owner-1790591000
Sep 28, 2026
Merged

RomneyDa merged 3 commits into
mainfrom
release-ci/cpu-census-owner-1790591000

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: stable release qualification is blocked when a product process is visible to the Linux ps census but exits before Kova's first /proc counter read.

User Impact

Kova treats a never-counter-observed process consistently with product work that starts and finishes entirely between censuses, while a previously tracked process that disappears during collection still leaves CPU coverage incomplete.

Why This Change Was Made

Kova already accounts for fully inter-census short-lived work through the product command tree's waited-child counters. A process merely glimpsed by ps has no accepted counter identity yet, so making that glimpse fatal imposed a stricter and race-dependent rule on equivalent work. The sampler now retries that first-glimpse disappearance; its existing tracked-PID gate continues to fail closed when an accepted identity is lost.

This replaces the earlier SQLite-specific and aggregate-owner recovery completely. There is no command allowlist or ambiguous per-child attribution.

Evidence

  • OpenClaw FRV performance run 36405138873 reproduced the race twice. Exact artifacts show generic first-glimpse exits across ocm status, node --version, git, tar, runtime build tooling, and SQLite workers—not one provider-specific child contract.
  • Pre-fix one-shot reproduction on clean main@17304ab throws Product process exited during CPU collection for a role-bearing PID that disappears before its first counter read.
  • After: that first-glimpse case returns the already-read wait owner and retries cleanly; the existing previously tracked PID case still throws LinuxCpuSnapshotChangedError.
  • Focused regression: 3 pass, 1 platform skip.
  • npm run test:cpu-accounting: 78 total; 57 pass, 21 platform skips, 0 failures.
  • Production delta: +1/-1. Tests: +12/-17. Changelog: +1.

@clawsweeper

clawsweeper Bot commented Sep 28, 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.

@RomneyDa
RomneyDa marked this pull request as ready for review September 28, 2026 10:22
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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

Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 6:57 AM ET / 10:57 UTC (Revision 4).

ClawSweeper review

What this changes

Kova’s Linux CPU sampler omits processes that exit before their first counter read, with corresponding test, report-schema, and changelog updates.

Merge readiness

✅ Ready for maintainer review

Keep open for review and landing. Current main still blocks the reported first-glimpse exit. The latest MEMBER comment explicitly accepts first counter observation as Kova’s coverage boundary, resolving the earlier objection as a deliberate release-tooling tradeoff.

Priority: P2
Reviewed head: fa0a259f718c017868e7ec4ee38a16027c6d7909

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is narrow and consistent with the accepted contract; the completed after-fix evidence supplied here is focused simulation rather than the pending frozen-candidate run.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This MEMBER-authored PR is exempt from the contributor proof gate. Focused synthetic tests exercise the changed Linux counter path, and the cited real performance run demonstrates the pre-fix race; the after-fix frozen-candidate run was still active in the reviewed snapshot. No stored-data model migration is involved.
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 contributor proof gate. Focused synthetic tests exercise the changed Linux counter path, and the cited real performance run demonstrates the pre-fix race; the after-fix frozen-candidate run was still active in the reviewed snapshot. No stored-data model migration is involved.
Evidence reviewed 8 items Current main behavior: On the pinned main revision, an ENOENT or ESRCH for any role-bearing process throws even when no counter identity was previously accepted.
Introduced boundary: The introduced guard throws for a vanished process only when its PID was previously tracked; the parent-first read order remains in place.
Coverage path: The resource sampler passes previously tracked PIDs to the Linux snapshot reader and retries a census when that reader throws a snapshot-change error.
Findings None None.
Security None None.

How this fits together

Kova samples Linux process and CPU data while running OpenClaw commands. It stores resource samples and uses their coverage status when qualifying performance results.

flowchart LR
A[OpenClaw command tree] --> B[Process census]
B --> C[Linux counter reads]
C --> D{Process vanished?}
D -->|No| E[CPU sample]
D -->|Yes| F{Previously measured?}
F -->|No| E
F -->|Yes| G[Incomplete coverage]
E --> H[Release qualification]
G --> H
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch footprint production +4/-4; tests +12/-17 A small sampler change affects the release coverage decision.

Technical review

Best possible solution:

Keep release qualification tied to the accepted counter-observation boundary while preserving incomplete coverage when a previously measured identity disappears.

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

Yes. Current main’s source takes the failure path when a role-bearing PID exits between the process census and its first counter read; the PR supplies a focused synthetic case, though this read-only review did not execute it.

Is this the best way to solve the issue?

Yes for the explicitly accepted coverage contract. The narrow guard retains failure for previously measured PIDs while treating a ps-only row as unaccepted counter evidence.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 17304ab9d7aa.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit. Replaced prior rating: 🧂 unranked krab.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: A race in Linux CPU collection can block release qualification, but the affected surface is limited to Kova validation.
  • merge-risk: 🚨 automation: The changed counter boundary affects whether release automation accepts CPU coverage; the no-wait limitation is explicitly accepted in the MEMBER discussion.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit. Replaced prior rating: 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This MEMBER-authored PR is exempt from the contributor proof gate. Focused synthetic tests exercise the changed Linux counter path, and the cited real performance run demonstrates the pre-fix race; the after-fix frozen-candidate run was still active in the reviewed snapshot. No stored-data model migration is involved.

Evidence

What I checked:

  • Current main behavior: On the pinned main revision, an ENOENT or ESRCH for any role-bearing process throws even when no counter identity was previously accepted. (src/collectors/linux-cpu.mjs:51, 17304ab9d7aa)
  • Introduced boundary: The introduced guard throws for a vanished process only when its PID was previously tracked; the parent-first read order remains in place. (src/collectors/linux-cpu.mjs:51, fa0a259f718c)
  • Coverage path: The resource sampler passes previously tracked PIDs to the Linux snapshot reader and retries a census when that reader throws a snapshot-change error. (src/collectors/resources.mjs:176, fa0a259f718c)
  • Focused regression coverage: The test distinguishes an unmeasured first-glimpse exit from an exit involving a previously tracked PID. (tests/linux-cpu-accounting.mjs:770, fa0a259f718c)
  • Accepted coverage tradeoff: In fix: release checks survive owned process exits #155 (comment), the MEMBER author explicitly sets the completeness boundary at the first accepted /proc counter identity and acknowledges the no-wait blind spot. This addresses the prior review’s loss-of-evidence objection as a maintainer policy choice, not as proof of an attributable wait transfer.
  • Re-review continuity: The source and test files are unchanged since the earlier reviewed head; the latest commit changes documentation. The earlier P1 concern was therefore evaluated against the current maintainer disposition. (docs/REPORT_SCHEMA.md:1118, fa0a259f718c)

Likely related people:

  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Attach the completed frozen-candidate performance result for this exact head when available, with private details redacted.

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 (3 earlier review cycles)
  • reviewed 2026-09-28T10:26:44.882Z sha 3883b7c :: blocked before merge. :: [P1] Keep vanished processes incomplete without proven wait transfer
  • reviewed 2026-09-28T10:38:34.865Z sha 448a8b3 :: blocked before merge. :: [P1] Require the vanished worker's wait transfer before clearing loss
  • reviewed 2026-09-28T10:47:02.150Z sha 7eaec94 :: blocked before merge. :: [P1] Keep unmeasured product exits incomplete until CPU is accounted

@RomneyDa
RomneyDa force-pushed the release-ci/cpu-census-owner-1790591000 branch from 3883b7c to e669b86 Compare September 28, 2026 10:31
@RomneyDa

Copy link
Copy Markdown
Member Author

Addressed the P1 rather than accepting the role-only exception.

The current head recovers only OpenClaw's explicit SQLite worker contract (execFile/spawnSync in the frozen candidate). It now requires:

  • an accepted interval, or a wait owner born within one;
  • the same owner PID and Linux start-tick identity after the census retry; and
  • an observed increase in that owner's child CPU ticks.

Focused regressions cover ordinary wait, SIGCHLD/no-wait-equivalent unchanged counters, orphaned owner, first-census loss, and an unrecognized worker command. Only the proven ordinary transfer qualifies. The new regression fails on clean main@17304ab; the CPU suite is 82/82 green.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa
RomneyDa force-pushed the release-ci/cpu-census-owner-1790591000 branch from e669b86 to 448a8b3 Compare September 28, 2026 10:33
@RomneyDa

Copy link
Copy Markdown
Member Author

One additional owner-ordering hardening is now on 448a8b32ffbc: a transfer is recorded as recovered only after the accountant accepts the same snapshot. If accounting rejects that snapshot, the pending loss remains fail-closed for the retry.

Focused wait/no-wait/orphan/startup/unrecognized and existing lost-census tests remain 8/8 green.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 28, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

Replaced the aggregate-owner recovery rather than waiving the sibling-attribution finding.

The FRV artifacts show this is a generic first-glimpse race (ocm status, node --version, git/tar/build tooling, and SQLite), not a SQLite-only contract. Current Kova already accepts equivalent work that starts and finishes wholly between censuses through wait-owner accounting. Head 7eaec94e8caf now makes the ownership boundary explicit:

  • a PID that disappears before any accepted counter read is ignored and the census is retried;
  • a previously tracked PID disappearing during collection still throws and leaves coverage incomplete;
  • all command-specific and aggregate-counter recovery code is removed.

Pre-fix clean-main reproduction throws on the first-glimpse case. Focused tests pass 3/3 (1 platform skip); the CPU suite passes 57/57 with 21 platform skips. Production delta is +1/-1.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Applied the contract-alignment Rank-up move at fa0a259a: docs/REPORT_SCHEMA.md now names the accepted identity boundary instead of claiming that a ps-only glimpse has counter evidence.

Maintainer decision for this release tooling: Kova's completeness boundary is the first accepted /proc counter identity, not a transient ps row. This does not claim an attributable transfer for the vanished PID. It treats that PID exactly like product work that completed wholly between censuses, which the existing aggregate wait-owner model necessarily covers. Once a PID has any accepted counter identity, disappearance remains fail-closed and durable in cpuLostProcesses.

The no-wait blind spot is real but pre-existing for wholly inter-census work; this PR neither adds nor pretends to solve it. The stricter ps-glimpse rule was race-dependent and produced the current false release blocks across ordinary ocm, Node, git, tar, build, and SQLite commands.

Fresh focused proof is 3/3 green. Exact-head CI and the real frozen-candidate performance run are active.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Real frozen-candidate proof is now terminal green: https://github.com/openclaw/openclaw/actions/runs/36411738246

Exact identities:

  • workflow tooling: openclaw/openclaw@fc168b2f6c16312181ce15bcb56d36a14e2c4849
  • frozen candidate: f773aa06a1a93b36b050f1a3f4b57d3d91311541
  • tested Kova behavior: 7eaec94e8caf77236207bb1610166930926a6ebc (identical code to final docs-only head fa0a259f718c)

Kova mock-provider release performance, OpenClaw source performance, artifact-only verification, and all dispatched supporting lanes passed. The prior FRV's census-loss blocker did not recur.

@RomneyDa
RomneyDa merged commit ec90fe4 into main Sep 28, 2026
11 checks passed
@RomneyDa
RomneyDa deleted the release-ci/cpu-census-owner-1790591000 branch September 28, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant