Skip to content

test(migrations): make checkpoint rehash fixture deterministic - #115269

Merged
vincentkoc merged 1 commit into
mainfrom
fix/audit-checkpoint-mtime-test-20260728
Jul 28, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/audit-checkpoint-mtime-test-20260728

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 28, 2026 •

Copy link
Copy Markdown
Member

Summary

  • stop relying on bit-exact sub-millisecond mtime restoration in the audit checkpoint rehash test
  • align the stored checkpoint metadata with the rewritten file while retaining the stale content hash
  • keep the test focused on the production invariant: matching cheap metadata must still trigger content hashing

Fixes #115268

Verification

Risk

Test-only. The fixture now constructs the metadata/hash mismatch directly instead of depending on filesystem timestamp precision.

@vincentkoc vincentkoc self-assigned this Jul 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 28, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 28, 2026 15:52
@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 28, 2026, 11:48 AM ET / 15:48 UTC.

ClawSweeper review

What this changes

The PR makes the audit checkpoint rehash test deterministic by updating stored file metadata from the rewritten archive while deliberately preserving its stale content hash.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this draft PR open: it is a narrow, test-only repair paired with an open bug report, and its author association plus the maintainer label require normal maintainer handling rather than automated cleanup.

Priority: P2
Reviewed head: f6fe5d66c62be2ed4dba441753c3068e0a26f26b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused, readable test repair with a concrete reproduction and targeted verification; it only needs a current-main refresh before landing.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored test-only PR; the body supplies focused test results, and the external-contributor real-behavior-proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored test-only PR; the body supplies focused test results, and the external-contributor real-behavior-proof gate does not apply.
Evidence reviewed 3 items Focused test fixture change: The supplied PR patch changes only src/infra/state-migrations.audit-logs.test.ts: it removes filesystem timestamp restoration and instead aligns checkpoint metadata with the rewritten file while retaining the old hash, directly expressing the intended rehash invariant.
Concrete paired regression report: The linked report gives a macOS reproduction in which fs.utimes() rounds the restored timestamp and the exact-equality assertion fails before the checkpoint-rehash behavior is exercised; this PR explicitly targets that fixture failure.
Maintainer routing signal: The PR is authored by a repository MEMBER, assigned to its author, and carries the maintainer label. The supplied repository policy requires such items to remain open for explicit maintainer judgment.
Findings None None.
Security None None.

How this fits together

Audit-log migration detection uses cheap file metadata and a stored content hash to decide whether an archived audit file must be rehashed. This test constructs a metadata-match/hash-mismatch checkpoint so the migration detector is proven to hash the archive rather than incorrectly treating it as current.

flowchart LR
  A[Raw audit archive] --> B[File stat metadata]
  C[Stored raw-archive checkpoint] --> D[Checkpoint comparison]
  B --> D
  D --> E[Content rehash decision]
  E --> F[Detected migration source]
  G[Deterministic test fixture] --> C
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; before landing, refresh the focused test against the current migration implementation so the fixture still exercises the intended rehash path.
Agent review details

Security

None.

PR surface

Tests +17. Total +17 across 1 file.

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

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/infra/state-migrations.audit-logs.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #115268
Summary: This PR is the explicit candidate fix for the paired audit-checkpoint fixture regression.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase or refresh this focused test repair on current main, retain the direct metadata/hash-mismatch fixture, and land it with the linked regression once a maintainer is satisfied with the updated proof.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase or refresh this focused test repair on current main, retain the direct metadata/hash-mismatch fixture, and land it with the linked regression once a maintainer is satisfied with the updated proof.

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

Yes, at source level: the paired report supplies a concrete macOS command, assertion failure, and timestamp-rounding mechanism, although this read-only review did not execute the test locally.

Is this the best way to solve the issue?

Yes, based on the supplied diff: directly updating the stored checkpoint metadata while preserving the stale hash tests the production invariant without depending on filesystem timestamp precision.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4e8c2c5248b0.

Labels

Label changes:

  • add P2: This is a bounded test-infrastructure regression that blocks a focused macOS migration test but does not change runtime behavior or user data.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This is a bounded test-infrastructure regression that blocks a focused macOS migration test but does not change runtime behavior or user data.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

  • Focused test fixture change: The supplied PR patch changes only src/infra/state-migrations.audit-logs.test.ts: it removes filesystem timestamp restoration and instead aligns checkpoint metadata with the rewritten file while retaining the old hash, directly expressing the intended rehash invariant. (src/infra/state-migrations.audit-logs.test.ts:203, f6fe5d66c62b)
  • Concrete paired regression report: The linked report gives a macOS reproduction in which fs.utimes() rounds the restored timestamp and the exact-equality assertion fails before the checkpoint-rehash behavior is exercised; this PR explicitly targets that fixture failure. (src/infra/state-migrations.audit-logs.test.ts:203, f6fe5d66c62b)
  • Maintainer routing signal: The PR is authored by a repository MEMBER, assigned to its author, and carries the maintainer label. The supplied repository policy requires such items to remain open for explicit maintainer judgment.

Likely related people:

  • vincentkoc: Authored the focused checkpoint-fixture repair and the paired reproduction report, and is the assigned reviewer-facing contact for this test path. (role: current migration-test contributor; confidence: medium; commits: f6fe5d66c62b; files: src/infra/state-migrations.audit-logs.test.ts)

Rank-up moves

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

  • Rebase or rerun the focused migration test against current main before converting the draft to a landing candidate.

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.

@vincentkoc

Copy link
Copy Markdown
Member Author

Rank-up move reviewed: I am not rebasing solely for conflict-free behind-main drift. The PR is already out of draft, head f6fe5d66c62be2ed4dba441753c3068e0a26f26b is mergeable, the focused migration test passed both alone and as the full 19-test file, Blacksmith Testbox changed gate passed in action https://github.com/openclaw/openclaw/actions/runs/30375016852, and the current openclaw/ci-gate is green. Rebasing would replay the same one-file test fixture and repeat completed coverage without new evidence; the repo-native prepare/merge wrapper will revalidate hosted gates before landing.

@vincentkoc
vincentkoc merged commit a6622dd into main Jul 28, 2026
158 of 162 checks passed
@vincentkoc
vincentkoc deleted the fix/audit-checkpoint-mtime-test-20260728 branch July 28, 2026 16:01
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 28, 2026
…etwork-none

* origin/main:
  fix(macos): signed rebuild no longer stalls on app shutdown (#103957)
  fix(agents): prevent repeated Code Mode output across waits (#115213)
  refactor(ui): split Profile (identity) from Usage (statistics) (#115245)
  fix(channels): report a channel that cannot receive as unhealthy instead of connected (#115229)
  fix(cli): reject malformed infer model refs (#115225)
  feat(ui): finish the Lobsterdex at 42 with wild variants, squish fix, and blink variance (#115264)
  test(migrations): avoid mtime precision in checkpoint fixture (#115269)
  test(signal): verify archive limits without malformed tar (#115270)
  test(ui): reset config route hash between cases
  fix(talk): remove unsupported Codex OAuth realtime
vincentkoc added a commit that referenced this pull request Jul 28, 2026
…-20260728

* origin/main:
  fix(macos): signed rebuild no longer stalls on app shutdown (#103957)
  fix(agents): prevent repeated Code Mode output across waits (#115213)
  refactor(ui): split Profile (identity) from Usage (statistics) (#115245)
  fix(channels): report a channel that cannot receive as unhealthy instead of connected (#115229)
  fix(cli): reject malformed infer model refs (#115225)
  feat(ui): finish the Lobsterdex at 42 with wild variants, squish fix, and blink variance (#115264)
  test(migrations): avoid mtime precision in checkpoint fixture (#115269)
  test(signal): verify archive limits without malformed tar (#115270)
  test(ui): reset config route hash between cases
  fix(talk): remove unsupported Codex OAuth realtime
vincentkoc added a commit to LZY3538/openclaw that referenced this pull request Jul 28, 2026
* origin/main: (199 commits)
  refactor(workboard): tidy Control UI card execution helpers (openclaw#115195)
  perf(agents): amortize history-limit eviction with hysteresis (openclaw#115273) (openclaw#115281)
  fix: schema-version refusal blames a downgrade that never happened and cannot identify the stale install (openclaw#115232)
  fix: restore Fish completion after global CLI options (openclaw#115222)
  refactor(agents): collapse the client-tool catalog branch (openclaw#115212)
  fix(macos): signed rebuild no longer stalls on app shutdown (openclaw#103957)
  fix(agents): prevent repeated Code Mode output across waits (openclaw#115213)
  refactor(ui): split Profile (identity) from Usage (statistics) (openclaw#115245)
  fix(channels): report a channel that cannot receive as unhealthy instead of connected (openclaw#115229)
  fix(cli): reject malformed infer model refs (openclaw#115225)
  feat(ui): finish the Lobsterdex at 42 with wild variants, squish fix, and blink variance (openclaw#115264)
  test(migrations): avoid mtime precision in checkpoint fixture (openclaw#115269)
  test(signal): verify archive limits without malformed tar (openclaw#115270)
  refactor(sessions): isolate legacy transcript fixtures (openclaw#115231)
  fix(discord): clear pending launch watchdog (openclaw#115100)
  fix(agents): stop quadratic subagent prompt rendering (openclaw#115263)
  fix(memory-core): recover dreaming cron reconciliation (openclaw#115174)
  fix(qa-lab): filter incompatible channel scenarios (openclaw#115087)
  fix(android): respect locale in compact labels
  test(i18n): prove iOS discovery catalog ownership
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: audit checkpoint rehash test assumes exact sub-millisecond mtime restoration

1 participant