Skip to content

test(update): verify the recorded preparation failure - #205363

Merged
vincentkoc merged 1 commit into
mainfrom
test-update-prepare-failure-oracle-20261125
Nov 25, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
test-update-prepare-failure-oracle-20261125

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Related: #204700

What Problem This Solves

The update preparation test can pass when preparation fails before reaching the bookkeeping fault it injects. That leaves maintainers without proof that the intended failure path was exercised.

User Impact

No runtime behavior changes. The existing test now verifies that the persisted failed run records the injected bookkeeping error, while retaining its terminal-state and no-trial checks.

Why This Change Was Made

Extend the existing persisted-record assertion with the failed outcome step and its injected error message. This keeps all three tests and avoids another fixture, helper, or production seam.

Evidence

  • Baseline: all 3 tests passed.
  • Mutation control: replacing the activation bookkeeping write with an earlier error still passed the original target test (1 passed, 2 filtered).
  • With this change, the same mutation failed at the persisted-error assertion; restoring the producer passed all 3 tests.
  • Format, file-scoped lint, and the owning test/tsconfig/tsconfig.core.test.other.json typecheck passed.
  • Independent review approved the assertion and its persisted-state boundary.
  • Full local ClawSweeper review: base 50843248783698f099aabbcb2f0e735d4f27035e, head 26272c921285bed22545b6256a23c5ccbe3c9c56; no priority filter, 0 findings, security cleared. This offline review did not run tests; execution evidence is listed above.

@vincentkoc vincentkoc self-assigned this Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 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.

@vincentkoc
vincentkoc marked this pull request as ready for review November 25, 2026 13:10
@clawsweeper clawsweeper Bot added the P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. label Nov 25, 2026
@vincentkoc
vincentkoc enabled auto-merge (squash) November 25, 2026 13:16
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR requires the saved update failure to contain the injected preparation bookkeeping error.

Example: Preparation fails before reaching the injected activating-phase bookkeeping error.

  • Before: The test can pass because the run failed and no trial exists.
  • After: The test fails because the saved outcome lacks "preparation outcome bookkeeping failed".

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A correct, minimal test improvement supported by source inspection and reported mutation testing; execution was not independently repeated.
Proof confidence 🦐 gold shrimp (3/6) This test-only change has no shipped behavior requiring live proof; the supplied evidence describes a targeted mutation control and passing owner tests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Maintainers could receive a passing preparation-failure test without exercising its intended bookkeeping failure.
Reason: The maintainer-authored change improves failure-path confidence with one focused assertion and no runtime cost.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it strengthens a meaningful failure-path test with the smallest focused assertion, and no actionable patch defects were found.

Reviewed head: 26272c921285bed22545b6256a23c5ccbe3c9c56

Before merge

None.

Findings

None.

Agent review details

How this fits together

CLI and Gateway updates call prepareUpdate, which records preparation failures in the update ledger before a launcher trial is published; this test reads that ledger through the existing reader.

flowchart TD
A[CLI or Gateway update] --> B[prepareUpdate]
B --> C[Activation bookkeeping]
C --> D[Failure recording]
D --> E[Update ledger]
E --> F[Persisted failure assertion]
B --> G[Launcher trial publication]
Loading

Technical review

Best possible solution:

Keep the existing fixture and strengthen its persisted failure assertion exactly as this PR does.

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

Source confirms the original assertion accepts any earlier failure producing failed/finished with no trial; the author reports a matching mutation control, which was not rerun during this read-only review.

Is this the best way to solve the issue?

The added assertion observes the real persisted result rather than a mock call, distinguishes the intended injected failure, and needs no new fixture, helper, or production seam.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Preparation bookkeeping failure regression keeps the original intent (d000ca3: Ensure preparation failure is recorded and a trial is not published when activation bookkeeping throws.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced diff only extends the existing persisted-record assertion with a failed outcome step containing the injected error; it preserves terminal-state and no-trial assertions. (src/update/prepare-failure.test.ts:65, 26272c921285)
  • Failure reaches the persisted owner: prepareUpdate catches the injected exception and passes its stack to failure recording; applyUpdateRunDiagnostics creates the failed outcome step before the ledger run is finished. (src/update/run.ts:509, 26272c921285)
  • Current main retains the weak assertion: Fetched main still checks only failed/finished and no trial in this case, so this PR supplies a distinct test improvement. (src/update/prepare-failure.test.ts:62, ea0116a6dfcb)
  • Original test intent and ownership: The merged change at fix: report update outcomes from the Gateway that is serving #204700 added this test to ensure preparation bookkeeping completes before trial publication; this assertion preserves and strengthens that intent. (src/update/prepare-failure.test.ts:41, d000ca3af201)
  • Reported mutation control: The PR body reports that an earlier injected failure passed the old assertion, failed the strengthened assertion, and that restoring production code passed all three tests; this review did not execute tests. (26272c921285)
  • Policy and inspection limits: Root and update-scoped instructions, simplification guidance, and test-boundary policy were applied; maintainer notes are absent. Older-blob history traversal and blame encountered missing objects, so GitHub commit patches verified the relevant history instead. (src/update/AGENTS.md:3, 26272c921285)

Likely related people:

  • Ayaan Zaidi: Raw commit d000ca3 adds src/update/prepare-failure.test.ts:41 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d000ca3af201; files: src/update/prepare-failure.test.ts)

PR surface

Tests +7. Total +7 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 7 0 +7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 7 0 +7

Preflight source

Source matches. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • 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 execution lanes are retired.

Reviewed November 25, 2026, 8:26 AM ET / 13:26 UTC.

@vincentkoc
vincentkoc merged commit 7fb9075 into main Nov 25, 2026
186 of 188 checks passed
@vincentkoc
vincentkoc deleted the test-update-prepare-failure-oracle-20261125 branch November 25, 2026 14:07
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

vincentkoc added a commit that referenced this pull request Nov 25, 2026
* commit '92569e37ab84a8cb1e4a12c3dcbb45acb97977c9':
  fix: distinguish Desktop sources without wrapping their names or IDs (#203747)
  fix(ui): Greek sigma searches miss matches outside Sessions and Files (#189518)
  fix: keep agent skill names on one line beside their switches (#203734)
  test(cron): admit scheduled occurrences in cron fixtures and fix Node 24 toHex in Vitest (#205383)
  fix: keep the Agents menu usable after copying an ID (#203739)
  fix(whatsapp): preserve code table spaces across message chunks (#205327)
  refactor(cron): admit legacy scheduled requesters through operator admission (#205346)
  fix: keep silent Codex turns healthy with running commands (#196062)
  test(update): verify the recorded preparation failure (#205363)
  fix(test): prove sibling imports on the active update path
  fix(chat): complete mentions without leaving part of the name behind (#205326)
  fix(test): restore Side chat hydration and retry checks (#205376)
  refactor: plugin-run turns get owner status from commands.ownerAllowFrom, like text messages (#205373)
  chore(ui): refresh control ui locales (#205378)
  fix: keep Telegram rich <details> and list blocks in one message when replies stream in chunks (#205318)
  refactor(gateway): one refusal owner with a required next step (#205337)
  fix(discord): keep long table labels bold across messages (#205328)
  feat: invitation, sharing and participant controls in the Control UI (#204920)
  fix(test): distinguish stamped Skill Library upgrade policies
  fix(markdown): preserve trailing inline-code spaces in plain-text tables (#205317)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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