Skip to content

fix: retain Doctor failure evidence in release validation - #166852

Open
RomneyDa wants to merge 1 commit into
mainfrom
fix/frv-doctor-diagnostics-20261007
Open

RomneyDa wants to merge 1 commit into
mainfrom
fix/frv-doctor-diagnostics-20261007

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Repair update — November 25, 2026

Main already contains the original onboarding failure-log reporting and Doctor lint capture. After resolving conflicts, this PR retains only the remaining attempt-isolation fix: clear doctor-lint.json and doctor-lint.err beside other attempt-owned diagnostics so an early failure cannot publish a previous attempt's Doctor failure as current evidence.

  • Extended the existing stale-attempt regression; it fails on the pinned main with the previous attempt's text retained, and passes with this fix.
  • node scripts/run-vitest.mjs test/scripts/upgrade-survivor-migration-diagnostics.test.ts --maxWorkers=1: 42 passed.
  • Shell syntax, targeted type-aware lint, and git diff --check pass.
  • Independent source review found no actionable findings. Local ClawSweeper completed the committed range ba6d94ec1771..1f0fad517328f with no findings (high confidence).
  • No release qualification, publication, or live Gateway modification was performed.

Original PR context (before main integration)

What Problem This Solves

Doctor failures in release validation can lose their diagnostic output: npm onboarding emits failure logs into the failing command's redirected log, and legacy-operator upgrade capture omits Doctor lint output entirely.

User Impact

No production runtime or configuration changes. Maintainers receive bounded, redacted failure evidence without changing the original command's exit status. The original FRV Doctor/update timeouts remain unresolved; this PR does not claim to fix them or qualify the frozen release candidate.

Why This Change Was Made

Use the existing failure-diagnostics owner, which preserves stderr across inherited ERR traps. Admit the two existing Doctor lint output artifacts through the existing capture, redaction, limits, and stale-attempt reset. The onboarding test adapter now delegates real registry PIDs to the existing process cleanup owner instead of recording them as fake Gateway stops.

Evidence

  • Actual onboarding container-program regression: a redirected synthetic Doctor failure exits 37 before and after; its first failure becomes visible on stderr only after this repair. Pre-fix regression failed; post-fix passed.
  • Onboarding shell siblings: 19/19 passed; pnpm test test/scripts/npm-onboard-channel-agent-shell.test.ts --maxWorkers=1, 31.21 s wrapper / 28.88 s Vitest. No new serial configuration or timers.
  • Upgrade capture siblings: 41/41 passed, pnpm test test/scripts/upgrade-survivor-migration-diagnostics.test.ts --maxWorkers=1, 19.17 s wrapper / 15.64 s Vitest, including bounded/redacted Doctor lint artifacts and stale-attempt reset. The prior capture omitted the same synthetic Doctor lint error; the repaired capture retains it.
  • Changed-file gates passed ratchets, guards, core compiler boundary, all four root-test type rows, formatting, coercion guard, script lint, and focused test lint. The full checker stopped on the inherited scripts/publish-model-catalog.mts:readRecommendedModels unused export; its blob is identical on this base and current main (2a1d4aacda88ab892ab31ac8286ac21e94f5cec8), with package/Knip configuration unchanged. No export was ignored or baseline expanded. Bash syntax and git diff --check passed.
  • New-test CI timing: pending CI; the new shell-boundary regression took 1.8–2.4 s locally. It reuses the suite's existing synthetic CLI fixture; a helper-only test cannot exercise inherited command redirections.
  • Full existing npm onboarding Docker entrypoint passed for Slack on Linux ARM64 with the exact frozen candidate tarball (SHA-256 ca071413b2eff971ffab6cd1b65c34e1afe38f7575438ad2b95a9dcb3c79c15f) and sealed plugin registry (manifest SHA-256 c49e5511de4310767558399b11db6448e2c159104b8502ccfc23597d933f8b42). Doctor completed within the unchanged 300-second command budget; the subsequent agent turn and Gateway restart checks passed. This is local diagnostic replay, not original hosted-lane qualification and not evidence of repairing the original timeout.
  • Frozen beta FRV: C/Q remains e4c6c8714da4. Exact-payload local Docker investigation is diagnostic-only, not replacement release qualification.

Applicability: the same diagnostic faults and shared helper exist on both release/2026.10.1 and release/2026.9.9; this is source-reviewed applicability, not execution proof on those branches. No version or changelog change, release recut, or merge.

Artifact compatibility boundary

The two upgrade-survivor paths are diagnostic capture/reset owners, not persistent data-model migrations. The patch changes no production database, schema, config, migration, backfill, or installed updater. It adds two already-produced fixed-name log files to the existing bounded/redacted artifact allowlist and removes those same files during attempt reset. Existing failure-report structure and prior artifact readers remain unchanged; absent logs remain optional. The 41 capture/reset cases cover stale files, redaction, bounds, and unchanged phase/exit behavior, and the exact clean release-branch cherry-pick passed all 60 focused cases. The source-reviewed applicability on both older branches concerns the same artifact-only contract, not an upgrade schema change.

Completed root-managed diagnostic replay

The existing published 2026.9.8-to-frozen-C Docker entrypoint exited 124 at update-candidate under its unchanged 900-second command cap. Both captured candidate Doctor invocations exited 0 with status ok; post-update config validation passed and the installed version was 2026.10.2-beta.1. The update result remained incomplete/empty, and restart/survivor coverage was not reached. Live observation attributed roughly 12 minutes to repeated full package-tree hashing by the immutable published driver, followed by candidate finalization/npm work; the captured terminal artifacts do not establish the original hosted root cause or a new backportable repair. Existing main/C integrity optimizations cannot retroactively patch that published updater. This is local Linux ARM64 diagnostic evidence, not frozen-C FRV qualification. Automatic failure collection completed and the owned container was removed by the entrypoint.

Drained-parent timeout attribution

The terminal diagnostic manifest for parent 37694088337 is blocked_complete, with no active children, collector errors, or requested child cancellations. The parent verifier fails on the selected failed child jobs, not a new orchestration error.

Legacy-operator artifacts distinguish process and container status: the retained phase is legacy-operator-doctor-clean, with exitStatus 143 / SIGTERM, while the Docker lane reports 124, after 2318 seconds wall time against its 2280-second whole-container cap (including host setup/cleanup). Three earlier captured candidate Doctor invocations exited 0/status ok; they do not prove the final doctor --lint --json completed. Its redirected lint files were omitted by the old capture owner, so the reason the final command failed to finish remains unestablished.

Update-auth reached recovery-update-restart after the first-hop migration, Doctor/config checks, survival, pairing, and auth preparation. It reports 137, after 3470 seconds wall time, with a configured 3420-second whole-container cap and timeout --kill-after=30s. That timing and the exact timeout owner make deadline enforcement a concrete explanation to investigate, rather than treating 137 alone as proof of OOM. There is no retained timeout signal receipt or kernel OOM record, and Docker OOMKilled=false does not exclude a killed child. The underlying second-hop stall and precise kill attribution remain unresolved; no budget, assertion, candidate, or timeout policy was changed.

These are diagnostic refinements, not repairs or release qualification. Original failures and all source/backport holds remain.

@RomneyDa RomneyDa added the release-fast-lane Release tooling PR: narrow ci-gate, ClawSweeper advisory (RELEASING.md) label Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 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 docker Docker and sandbox tooling labels Oct 8, 2026
@RomneyDa
RomneyDa marked this pull request as ready for review October 8, 2026 00:48
@RomneyDa

RomneyDa commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper review

Please review exact head cd3346e. Redirected Doctor evidence and the fixed-name Doctor lint capture/reset are repaired with before/after shell-boundary proof, 19 onboarding cases, and 41 capture cases. The known inherited catalog script unused export is documented; no production ignore or baseline expansion. Original FRV Doctor/update timeouts remain unresolved. No merge requested.

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 7, 2026, 9:58 PM ET / October 8, 2026, 01:58 UTC (Revision 4).

ClawSweeper review

What this changes

The branch preserves redirected Doctor failure output and includes Doctor lint logs in existing bounded, redacted capture and attempt cleanup.

Example: Release validation encounters a Doctor failure with exit status 37.

  • Before: The redirected diagnostic output can hide doctor-fixture-first-failure.
  • After: The failure appears on stderr while the command retains exit status 37.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused repair is clean, with strong boundary regression evidence; the full Docker success does not directly prove the changed failure path.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This MEMBER-authored internal-tooling PR is exempt from the external-contributor proof gate. Supplied before/after shell-boundary evidence exercises the stderr owner with exit 37, and capture cases exercise real redaction, bounds, and reset; the Linux ARM64 Slack Docker success supports integration only. The artifact allowlist changes no operator data model or migration contract.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Release maintainers cannot see the Doctor output needed to diagnose certain validation failures.
Reason: The patch restores the established diagnostic contract with a small change that reuses existing owners. It accurately leaves the original timeout causes and release qualification unresolved.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR is a useful, focused diagnostic repair with no actionable functional or security findings. Current main still has the diagnostic gaps, and the earlier data-model concern does not apply to these log artifacts.

Priority: P2
Reviewed head: cd3346e5a90aec8f3ce72f391087e7c68585fd7b

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

None.

Tests

  • Missing end-to-end proof: The full Docker replay demonstrates successful onboarding; the changed failure-output behavior is demonstrated by the actual container-program harness with a synthetic CLI, rather than a failing installed Doctor in Docker.
Agent review details

How this fits together

Release-validation scripts install and exercise prepared OpenClaw packages in Docker. Their diagnostic helpers collect failed-command output and publish bounded, redacted evidence for maintainers.

flowchart TD
  A[Prepared OpenClaw package] --> B[Docker validation scenario]
  B --> C[Doctor command]
  C --> D{Command fails}
  D --> E[Reserved stderr handler]
  D --> F[Fixed-name diagnostic logs]
  F --> G[Bounded capture and host redaction]
  E --> H[Maintainer failure evidence]
  G --> H
Loading

Technical review

Best possible solution:

Retain one shared failure-diagnostics owner and its existing redaction, limits, and attempt cleanup while investigating the original release stalls separately.

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

Yes: the existing redirected ERR trap and omitted fixed-name lint logs establish the diagnostic defects in source; the supplied before/after regression preserves exit 37 and demonstrates visible failure output. This review did not execute code.

Is this the best way to solve the issue?

Yes: adopting the existing stderr owner and extending its capture/reset allowlist is the narrowest repair and preserves existing failure semantics.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • scripts/e2e/npm-onboard-channel-agent-docker.sh: failure trap keeps the original intent (61dfbd7: The commit added npm tarball onboarding Docker E2E with failure-log dumping; no associated PR was returned by the commit-to-PR lookup.)
  • scripts/e2e/lib/upgrade-survivor/diagnostics.mjs: captured log allowlist keeps the original intent (b85a049: Retain sanitized upgrade diagnostics and observed post-core outcomes through bounded capture and host-owned publication.)
  • scripts/lib/upgrade-survivor-diagnostics.sh: attempt reset keeps the original intent (test(docker): retain self-upgrade failure diagnostics #133505: Share one host publication path for bounded, redacted failure evidence while preserving the original exit status and cleanup lifecycle.)
  • test/scripts/npm-onboard-channel-agent-shell.test.ts: process cleanup adapter keeps the original intent (fdae00f: Qualify installed-package execution identity across restart and lifecycle boundaries without changing production runtime behavior.)

Testing

Proof path: in-process harness. Added test files: 2.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The verified merge-base-to-head diff replaces the onboarding ERR trap with the existing failure-diagnostics helper and adds doctor-lint.json and doctor-lint.err to capture and reset. (scripts/e2e/npm-onboard-channel-agent-docker.sh:158, cd3346e5a90a)
  • Existing stderr owner: The shared helper reserves descriptor 4 from stderr and directs inherited ERR-trap diagnostics there before exiting with the original status; log printing retains canonical redaction and bounded output. (scripts/lib/openclaw-e2e-instance.sh:149, cd3346e5a90a)
  • Existing log producer and compatible capture: The legacy-operator scenario already writes doctor-lint.json and doctor-lint.err. The patch admits those files through the existing safe-file reader, 256 KiB input cap, host redaction, and 16 KiB per-log output cap; absent logs remain optional. No production database, configuration, schema, or migration changes. (scripts/e2e/lib/upgrade-survivor/run.sh:1111, cd3346e5a90a)
  • Regression and supplied execution evidence: The added regression executes the actual container program with a synthetic CLI failure, checks exit 37 and visible stderr, and prevents progression to Gateway startup. The PR body reports baseline failure followed by a passing repair, 19 onboarding cases, 41 capture cases, and a full Linux ARM64 Slack Docker success. The full Docker success supports integration but does not demonstrate the failing Doctor path or qualify the frozen release; no tests were executed during this read-only review. (test/scripts/npm-onboard-channel-agent-shell.test.ts:267, cd3346e5a90a)
  • Current-main necessity and base safety: All five touched files are identical between the merge base and fetched current main, so the diagnostic gaps remain and there are no overlapping target-branch hunks. The test-merge raw parents match the pinned base and exact PR head, and its resulting delta contains only the five introduced paths. (109bd4791099)
  • Diagnostic ownership history: Pickaxe history locates the existing capture allowlist at b85a049. Its commit describes sanitized upgrade diagnostics. The merged shared-publication repair at test(docker): retain self-upgrade failure diagnostics #133505 explicitly preserves failure status, host redaction, and one publication path. (scripts/e2e/lib/upgrade-survivor/diagnostics.mjs:89, b85a049da5e8)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

PR surface

Tests +20, Other +3. Total +23 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 24 4 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 4 1 +3
Total 5 28 5 +23

Stored data model

Persistent data-model change detected: migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/diagnostics.mjs, migration/backfill/repair: scripts/lib/upgrade-survivor-diagnostics.sh. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: canonical
Canonical: #166852
Summary: This is the main diagnostic repair; the related draft carries the same repair to a release branch.

Members:

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Missing failure evidence impedes release diagnosis, with a bounded internal-tooling repair and no production-runtime change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • 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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-08T00:53:52.894Z sha cd3346e :: blocked before merge. :: none
  • reviewed 2026-10-08T01:04:00.281Z sha cd3346e :: needs maintainer review before merge. :: none
  • reviewed 2026-10-08T01:28:03.251Z sha cd3346e :: needs maintainer review before merge. :: none

@RomneyDa

RomneyDa commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please reconsider the persistent-data-model classification on exact unchanged head cd3346e using the updated artifact compatibility boundary and full Docker evidence in the PR body. The named upgrade-survivor files only capture/reset diagnostic logs; no production schema, config, migration, backfill, or installed updater changes. Existing report structure and optional-log behavior are unchanged. The original Doctor/update timeouts remain unresolved. Full existing Slack Docker onboarding now passed locally with the exact sealed candidate and registry, unchanged 300-second Doctor budget, agent turn, and Gateway restart checks; diagnostic-only, not frozen C/Q qualification. No merge or repair requested.

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. labels Oct 8, 2026
@RomneyDa
RomneyDa force-pushed the fix/frv-doctor-diagnostics-20261007 branch from cd3346e to 1f0fad5 Compare November 25, 2026 19:55
@openclaw-barnacle openclaw-barnacle Bot removed the docker Docker and sandbox tooling label Nov 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. release-fast-lane Release tooling PR: narrow ci-gate, ClawSweeper advisory (RELEASING.md) 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