Skip to content

test(update): compare capture directory entries without readdir order - #186728

Merged
steipete merged 1 commit into
mainfrom
upd/readdir-order
Oct 28, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/readdir-order

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

#186663 added the capture privacy marker to the status recovery fixtures. Two assertions in src/cli/update-cli/status.recovery.test.ts then compared raw fs.readdir output against a fixed order. readdir order depends on the filesystem: macOS returns the dotfile first, Linux ext4 often does not. So the test fails on hosted Linux CI, which showed up as reports standalone Doctor captures as manual evidence and validates forward resolution against retained generations without writing failing on #186648.

Why This Change Was Made

Both assertions check that inspection wrote nothing new into the capture directory. That is a property of the set of entries, not their order, so they now compare sets.

User Impact

None. Test-only.

Evidence

@clawsweeper

clawsweeper Bot commented Oct 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.

@steipete
steipete marked this pull request as ready for review October 28, 2026 11:40
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS labels Oct 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T11:42:01.206752Z b0d6cf2 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 28, 2026
@clawsweeper

clawsweeper Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR compares capture-directory entries as sets in two recovery-status tests.

Example: readdir returns ["manifest.json", ".openclaw-private-update-capture"].

  • Before: The assertion fails because it expects the marker first.
  • After: The assertion passes, while missing or unexpected entries still fail.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A minimal, correct test repair supported by focused CI and source inspection.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored, test-only PR changes no shipped behavior; focused checks passed on the reviewed head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Recovery-status tests can fail on a filesystem that enumerates the same capture files in a different order.
Reason: The change removes an incidental ordering assumption without weakening the no-added-or-missing-files contract or adding test machinery.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes two filesystem-order-dependent assertions while preserving their exact directory-content checks; no actionable defect was found.

Priority: P3
Reviewed head: b0d6cf2576fdf0a974f795cbbea2856dc39f29c8

Before merge

None.

Findings

None.

Agent review details

How this fits together

Recovery-status tests create on-disk captures, invoke the update-status command in process, and verify reported recovery state and unchanged capture contents.

flowchart LR
  A[Capture fixtures] --> B[Update status command]
  B --> C[Recovery inspection]
  C --> D[Filesystem evidence]
  B --> E[Status assertions]
  D --> F[Directory content assertions]
Loading

Technical review

Best possible solution:

Keep the two set comparisons so inspection tests enforce exact contents without depending on filesystem enumeration order.

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

The base assertions visibly reject the reversed ordering of the same two filenames; no target code was executed during this read-only review.

Is this the best way to solve the issue?

Set equality is the smallest complete repair because directory entry names are unique and the protected invariant is exact membership.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Capture-directory inventory assertions keeps the original intent (0f1de69: The capture-discovery repair added the producer's privacy marker to fixtures and expected inventories.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

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

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

Labels

Label changes:

  • add P3: This focused test portability repair has no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This focused test portability repair has no production behavior 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 execution lanes are retired.

Reviewed October 28, 2026, 7:54 AM ET / 11:54 UTC.

@steipete
steipete merged commit 5c91550 into main Oct 28, 2026
192 of 196 checks passed
@steipete
steipete deleted the upd/readdir-order branch October 28, 2026 12:04
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 29, 2026
…openclaw#186728)

Two status recovery assertions compared raw fs.readdir output against a fixed order; readdir order is filesystem-dependent, so they failed on hosted Linux after openclaw#186663 added the capture marker. They now compare entry sets.
tideclaw-bot pushed a commit that referenced this pull request Nov 4, 2026
Only privacy-marked directories are captures. Preserve marked incomplete/corrupt handling and filesystem errors while ignoring OS metadata and unrelated entries. Include order-independent fixture assertions from the necessary test-only companion #186728.

(cherry picked from commit 5c91550)

(cherry picked from commit 0f1de69)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 13325c05ca33424858dc1193b1c4a522ecaf6079)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes 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