Skip to content

test(update): assert closed-tick advice with retained post-completion steps - #207759

Merged
obviyus merged 1 commit into
mainfrom
w16/update-ledger-closed-tick-test
Nov 28, 2026
Merged

obviyus merged 1 commit into
mainfrom
w16/update-ledger-closed-tick-test

Conversation

@obviyus

@obviyus obviyus commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Scheduled CI on main fails deterministically in src/infra/update-run-ledger.post-activation.test.ts ("retains post-activation advice from a closed tick scope without reopening the update"): the run history holds only requested, so the assertion at line 86 fails (scheduled run 46186339900, job checks-node-compact-large-38). Reproduced locally on a737f425: 1 failed, 2 passed.

Cause: #207640 removed the post-terminal admission of the post-activation doctor inspections step names from applyUpdateRunStep (src/infra/update-run-write.ts), because #207585 deleted the native inspection writer that recorded them. This test still writes those names after the run finishes, so the ledger now drops them correctly. Putting the four names back makes the test pass again, which confirms the cause.

Fix

Test only. The test keeps covering the live contract: the update-run watcher takes advisory work after the caller's tick scope closes, and stop() joins that work. Plugin maintenance uses this contract (schedulePluginMaintenance in src/update/gateway-trial.ts). The test now writes step families that the ledger still admits after a run finishes:

  • recovery-artifact-cleanup receipts;
  • the plugins step that plugin maintenance writes.

User Impact

None. No production code changes. No user loses advice: no current code records post-activation doctor inspections through recordUpdateRunStep after a run finishes. The shipped legacy update finish path writes those receipts through recordUpdateRunDiagnostic (src/cli/update-cli/update-command-migrate.ts), which upserts without the terminal-admission check.

Evidence

  • Base a737f425: the test fails as on scheduled CI (steps contain only requested).
  • Base plus the 4 removed admission names put back: 3/3 pass (cause confirmed; experiment not committed).
  • This head: src/infra/update-run-ledger.post-activation.test.ts 3/3 pass; oxfmt and oxlint clean.

… steps

#207640 removed post-terminal admission of the deleted native post-activation
inspection steps. This test still wrote those step names, so main dropped them
and failed deterministically. Keep the watcher's closed-tick advisory custody
contract and assert it with the step families that are still admitted
(recovery-artifact-cleanup receipts and the plugins step that plugin maintenance writes).
@clawsweeper

clawsweeper Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added the P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. label Nov 28, 2026
@obviyus
obviyus merged commit 03d2d88 into main Nov 28, 2026
103 checks passed
@obviyus
obviyus deleted the w16/update-ledger-closed-tick-test branch November 28, 2026 22:02
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
… steps (openclaw#207759)

## What Problem This Solves

Scheduled CI on `main` fails deterministically in `src/infra/update-run-ledger.post-activation.test.ts` ("retains post-activation advice from a closed tick scope without reopening the update"): the run history holds only `requested`, so the assertion at line 86 fails (scheduled run 46186339900, job `checks-node-compact-large-38`). Reproduced locally on `6bdbd80a`: 1 failed, 2 passed.

Cause: openclaw#207640 removed the post-terminal admission of the `post-activation doctor inspections` step names from `applyUpdateRunStep` (`src/infra/update-run-write.ts`), because openclaw#207585 deleted the native inspection writer that recorded them. This test still writes those names after the run finishes, so the ledger now drops them correctly. Putting the four names back makes the test pass again, which confirms the cause.

## Fix

Test only. The test keeps covering the live contract: the update-run watcher takes advisory work after the caller's tick scope closes, and `stop()` joins that work. Plugin maintenance uses this contract (`schedulePluginMaintenance` in `src/update/gateway-trial.ts`). The test now writes step families that the ledger still admits after a run finishes:
- `recovery-artifact-cleanup` receipts;
- the `plugins` step that plugin maintenance writes.

## User Impact

None. No production code changes. No user loses advice: no current code records `post-activation doctor inspections` through `recordUpdateRunStep` after a run finishes. The shipped legacy `update finish` path writes those receipts through `recordUpdateRunDiagnostic` (`src/cli/update-cli/update-command-migrate.ts`), which upserts without the terminal-admission check.

## Evidence

- Base `6bdbd80a`: the test fails as on scheduled CI (steps contain only `requested`).
- Base plus the 4 removed admission names put back: 3/3 pass (cause confirmed; experiment not committed).
- This head: `src/infra/update-run-ledger.post-activation.test.ts` 3/3 pass; oxfmt and oxlint clean.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant