Skip to content

refactor(test): share raw ratchet fixture writes - #189798

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/test-ratchet-fixture-write-owner-next100-20261101
Nov 1, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/test-ratchet-fixture-write-owner-next100-20261101

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

The dated TODO and ratchet tests maintained three private raw-file writers. Use the existing fixtureFiles(root).write owner for the same 25 writes and remove the duplicate wrappers.

Ownership: test/scripts/script-fixture-files.test-support.ts retains recursive parent creation and raw byte writes. These callers discard the return value; their invalid JSON/source, staged/unmerged index, debt pruning, policy, and path-order assertions remain unchanged.

Validation: all three complete owners pass under Node and Bun; original-source controls pass under Node. Temporary original/candidate probes pass for empty/raw invalid JSON, CRLF, Unicode/NUL, file modes, overwrite order, and blocked-parent errors on both runtimes. Injecting a trailing newline into the shared writer produces three expected failures. Both relevant test type lanes, targeted lint, formatting, and git diff --check pass.

LOC: tooling/production 0; tests/support -15. No process-count, elapsed-time, billed-minute, or native Windows savings claim.

Independent source review: scoped clean, confidence 0.99. Required hosted and native landing gates remain authoritative.

@clawsweeper

clawsweeper Bot commented Oct 31, 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 self-assigned this Oct 31, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 31, 2026 21:55
@clawsweeper clawsweeper Bot added 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. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces three private raw-file writers with the existing shared fixture writer.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A correct, narrow consolidation supported by source equivalence and passing CI; its evidence is test execution rather than shipped-entry-point proof.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only refactor changes no shipped behavior; existing suites exercise the script owners, and exact-head CI passes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored change reduces duplicated fixture ownership without changing product behavior or weakening retained coverage.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is a focused, maintainer-authored cleanup that preserves fixture behavior and assertions, with no actionable defects found and passing exact-head CI.

Priority: P3
Reviewed head: 97a4c313b7acbb3513ab2870c1b636a31fa6aab8

Before merge

None.

Findings

None.

Agent review details

How this fits together

Script tests create temporary source and baseline files, run repository checks, and assert diagnostics and results; the shared fixture helper owns file creation.

flowchart LR
  A[Test fixture strings] --> B[Shared fixture writer]
  B --> C[Temporary repository files]
  C --> D[Ratchet and TODO checks]
  D --> E[Existing assertions]
Loading

Technical review

Best possible solution:

Merge the focused consolidation through the normal landing gates.

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

This is a fixture refactor rather than a reported product bug; source inspection confirms equivalent filesystem operations without running target code.

Is this the best way to solve the issue?

Reusing the existing writer is the smallest complete change: preserve exact fixture bytes and ordering while removing all three redundant implementations.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Assertion-safety fixture writes keeps the original intent (a8e4569: Consolidate repetitive test setup while preserving distinct report, policy, and failure contracts.)
  • Max-lines fixture writes keeps the original intent (e94486b: Reduce repeated fixture scaffolding while retaining meaningful behavior checks.)
  • Dated TODO fixture writes keeps the original intent (4596fd2: Exercise deterministic dated-commitment candidate scanning against real repository files.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction: Every introduced hunk removes a private writer or redirects its callers; fixture strings, write ordering, and assertions remain unchanged. (97a4c313b7ac)
  • Equivalent existing owner: The shared writer performs the same path join, recursive parent creation, and raw writeFileSync operation; its additional return value is discarded by these callers. (test/scripts/script-fixture-files.test-support.ts:8, 97a4c313b7ac)
  • Current main comparison: Tree entries show that all three affected suites and the shared helper have identical blobs on fetched main and the introduction base, so this consolidation remains distinct work. (7eb8696d22cb)
  • Exact-head validation: REST check results confirm successful ci-gate, changed Node tests, baseline-ratchet tests, test types, and lint for the reviewed head; GitHub reports a clean merge. (97a4c313b7ac)
  • Prior consolidation intent: test(sessions,ui,infra): remove low-value tests (batch d328) #178500 introduced the existing helper while consolidating fixture scaffolding and preserving distinct contracts; this PR follows that direction. (test/scripts/script-fixture-files.test-support.ts:6, 3a304be62a75)
  • Policy and inspection limits: Read the complete root and test AGENTS.md files and applied simplification and test-value guidance; no maintainer-notes directory exists. An extended historical lookup encountered a missing promisor object; pinned blobs, relevant commits, and current-main tree identities were independently inspected. The checkout remains clean. (test/AGENTS.md:1, 97a4c313b7ac)

Likely related people:

  • Peter Steinberger: Raw commit 3a304be adds test/scripts/script-fixture-files.test-support.ts:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3a304be62a75; files: test/scripts/script-fixture-files.test-support.ts)

PR surface

Tests -15. Total -15 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 29 44 -15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 29 44 -15

Labels

Label changes:

  • add P3: Behavior-preserving test fixture cleanup with no production 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:

  • P3: Behavior-preserving test fixture cleanup with no production changes.
  • 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 October 31, 2026, 6:09 PM ET / 22:09 UTC.

@vincentkoc
vincentkoc merged commit eef4074 into main Nov 1, 2026
134 of 135 checks passed
@vincentkoc
vincentkoc deleted the refactor/test-ratchet-fixture-write-owner-next100-20261101 branch November 1, 2026 00:24
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 1, 2026
…ed-backup-search-exports-20261101

* commit 'cde4bfe4f10ce470ded7264c68d9a72ae03594cc':
  fix(ci): keep backup and chat search internals private (#189894)
  fix(codex): recover unused native threads without dropping history (#189900)
  fix(oc-path): use last duplicate JSON key to match runtime parsing (#189855)
  perf(test): parse the Mantis resolver workflow once (#189801)
  fix(agents): revert default hard context admission (#189891)
  refactor(test): use canonical tracked temp paths (#189800)
  chore(ui): refresh control ui locales (#189898)
  improve: show gateway commit and build time on About
  refactor(test): share SDK export fixture JSON writes (#189799)
  fix: restore Files navigation from unavailable previews (#189879)
  refactor(test): share raw ratchet fixture writes (#189798)
  fix(ai): honor Model Studio compatible-mode output limits (#189870)
  fix: hold queued messages through inline edits (#189869)
  perf(test): reuse the baseline fixture Node resolver (#189790)
  test(qa): correlate handoff replies by run identity (#189885)
  fix(ui): normalize canonical Unicode in local search comparisons (#189874)
  fix(ui): explain unsupported browsers without module scripts (#189883)

# Conflicts:
#	ui/src/pages/chat/components/chat-search-highlight.browser.test.ts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 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: S 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