Skip to content

test: parameterize atomic, copy-fallback and move regression twins - #804

Closed
steipete wants to merge 2 commits into
mainfrom
steipete/deslop-r3-tests-atomic
Closed

steipete wants to merge 2 commits into
mainfrom
steipete/deslop-r3-tests-atomic

Conversation

@steipete

@steipete steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Atomic-write, copy-fallback, and move regression suites wrote most scenarios twice, once for the sync API and once for the async API, with the same fixture preparation and postconditions; copy-fallback settlement repeated 102 operation executions across four near-identical bodies.

User Impact

No user-visible change; tests only (src/ and native/ byte-identical).

Why This Change Was Made

Each twin pair becomes one scenario body over explicit sync/async rows that keep the real sync and async entry points, separately typed filesystem injectors, synchronous throw versus asynchronous rejection assertions, and platform gates. Copy-fallback close settlement and admission run from tables that keep Object.is checks (-0, NaN, undefined) and exactly-once close counts. Move cleanup and staged-mode substitution become small tables. Net -438 lines.

Evidence

  • Expanded test counts identical in all nine files (115 passed, 3 platform skips); all 102 close-settlement executions and 28 admission tests remain.

  • tsc, lint:file-size, lint:fs-boundary: pass. Codex autoreview (P0-P2): clean.

  • Tests added or updated when behavior changed

  • Security and compatibility impact considered

  • CHANGELOG.md updated when release-relevant

  • No credentials, private paths, private hosts, or sensitive contents included

@steipete
steipete requested a review from a team as a code owner October 1, 2026 13:15
@clawsweeper

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

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 11:58 AM ET / 15:58 UTC (Revision 2).

ClawSweeper review

What this changes

The branch replaces duplicated atomic-write, copy-fallback, and move regression tests with shared scenario tables while retaining separate sync and async operations.

Merge readiness

✅ Ready for maintainer review

Keep open: the consolidation is not on current main, and the batch landing PR remains unmerged. No actionable coverage regression was found in the introduced changes.

Priority: P3
Reviewed head: 98c722f9483c57ed1d1ff0057bf88be0a5f4199f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, sound consolidation with preserved regression assertions and no concrete introduced defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER association exempts this test-only maintenance PR from contributor runtime proof; no production authority or stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER association exempts this test-only maintenance PR from contributor runtime proof; no production authority or stored-data contract changes.
Evidence reviewed 7 items Applicable repository policy: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-notes directory was found. Applied the requirements to preserve filesystem regression coverage and omit maintenance-only changelog entries.
Introduced scope and coverage preservation: Read all nine introduced test diffs. Sync throws and async rejections retain their respective entry points and injectors; substitution, descriptor-mode, publication-fence, and move-cleanup assertions remain. The settlement table retains 2 modes × (9 close failures + 8 earlier failures) × 3 layouts = 102 executions, exact Object.is comparisons, and exactly-once close checks.
Production and supply-chain surfaces unchanged: The pinned introduced delta changes only nine test files; production source, native code, package metadata, lockfile, and workflows have no delta. The read-only diff whitespace check passed; tests and builds were not executed.
Findings None None.
Security None None.

How this fits together

fs-safe's publication helpers write or move files while checking filesystem identity and permissions. These regression suites inject substitutions and I/O failures, then check error propagation, preserved contents, and cleanup.

flowchart TD
A[Scenario tables] --> B[Sync or async operation]
B --> C[Atomic write or move helper]
D[Filesystem fault injection] --> C
C --> E[Identity and permission checks]
E --> F[Publication or rejection]
F --> G[Content and cleanup assertions]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Test consolidation production +0/-0; tests +520/-958 across 9 files; net -438 The reduction removes duplicated regression bodies without growing production code.
Close-settlement matrix 102 operation executions retained Both APIs retain every failure value and destination layout with exact-identity and close-count assertions.

Technical review

Best possible solution:

Retain one shared scenario definition per regression while continuing to exercise both APIs and their distinct filesystem failure paths.

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

Not applicable: this PR consolidates existing tests and reports no runtime bug; validation claims were reviewed without executing tests.

Is this the best way to solve the issue?

Yes: explicit scenario rows remove duplication while preserving separate sync and async fault injection, platform gates, and postconditions.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is test-only maintenance with no introduced user-facing behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER association exempts this test-only maintenance PR from contributor runtime proof; no production authority or stored-data contract changes.

Evidence

What I checked:

  • Applicable repository policy: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-notes directory was found. Applied the requirements to preserve filesystem regression coverage and omit maintenance-only changelog entries. (AGENTS.md:1, 98c722f9483c)
  • Introduced scope and coverage preservation: Read all nine introduced test diffs. Sync throws and async rejections retain their respective entry points and injectors; substitution, descriptor-mode, publication-fence, and move-cleanup assertions remain. The settlement table retains 2 modes × (9 close failures + 8 earlier failures) × 3 layouts = 102 executions, exact Object.is comparisons, and exactly-once close checks. (test/copy-fallback-close-settlement.test.ts:118, 98c722f9483c)
  • Production and supply-chain surfaces unchanged: The pinned introduced delta changes only nine test files; production source, native code, package metadata, lockfile, and workflows have no delta. The read-only diff whitespace check passed; tests and builds were not executed. (98c722f9483c)
  • Existing publication contract: The documented atomic contract requires descriptor-bound modes, rejection of substituted staging entries, exact propagation of falsy close failures, preservation of earlier failures, and one destination close attempt. The consolidated tests continue checking these contracts. (docs/atomic.md:265, 98c722f9483c)
  • Current main and batch landing status: GitHub still reports main at dee26f1. test: land ten reviewed test and tooling consolidations #816 is open and unmerged; its supplied body explicitly includes this consolidation as a separate batch commit. It is a landing candidate, not evidence of implementation on main. (dee26f147147)
  • Merged area history: Main history connects Peter Steinberger to the original close-settlement regression suite, staging ownership work, and the merged shared-fixture consolidation at refactor(test): share duplicated fixtures and drop dead test adapters #791. Raw commit inspection records the close-settlement commit's parent; its patch adds the exact-identity assertion retained at checkout line 115. (test/copy-fallback-close-settlement.test.ts:115, 7a55e25586f7)

Likely related people:

  • Peter Steinberger: Raw commit 7a55e25 adds test/copy-fallback-close-settlement.test.ts:124 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7a55e25586f7; files: test/copy-fallback-close-settlement.test.ts)

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-01T13:18:28.993Z sha dd0ec74 :: needs maintainer review before merge. :: none

steipete added a commit that referenced this pull request Oct 1, 2026
)

Parameterize sync/async twin scenarios in the atomic, copy-fallback, and move regression suites over explicit rows that keep the real entry points, typed fault injectors, and throw-versus-rejection assertions. Test counts are identical in all nine files; net -438 lines.
@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Landed on main as 9675120 through the batch PR #816 (rebase merge, one commit per original PR), to avoid ten serial up-to-date CI cycles. Content is identical to this PR's reviewed diff.

@steipete steipete closed this Oct 1, 2026
steipete added a commit that referenced this pull request Oct 1, 2026
)

Parameterize sync/async twin scenarios in the atomic, copy-fallback, and move regression suites over explicit rows that keep the real entry points, typed fault injectors, and throw-versus-rejection assertions. Test counts are identical in all nine files; net -438 lines.
@steipete
steipete deleted the steipete/deslop-r3-tests-atomic branch October 1, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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