Skip to content

test(temp): share workspace observation fixtures and merge split suites - #809

Closed
steipete wants to merge 1 commit into
mainfrom
steipete/deslop-r4-tests-temp
Closed

steipete wants to merge 1 commit into
mainfrom
steipete/deslop-r4-tests-temp

Conversation

@steipete

@steipete steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Temp-workspace, staged-file, and directory-durability suites re-implemented the same support code: 23 successful-open observers and lifecycle fixtures copied across temp-workspace suites, hostile-error fixtures duplicated between the staged file and symlink settlement suites, repeated inert cleanup bindings, directory-durability error routes written out one by one, and a canonical-admission suite split off from root discovery to stay under the file-size limit.

User Impact

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

Why This Change Was Made

  • test/helpers/temp-workspace.ts, test/helpers/staged-errors.ts, and test/helpers/cleanup-binding.ts hold the shared observers, lifecycle fixtures, hostile errors, and cleanup bindings.
  • Directory-durability error routes run from two tables (rejection and unsupported receipt) covering every platform, variant, site, and code; the two ordinary-file tests that exercised the same pinDirectory(filePath) call become one test asserting both the not-file code and the error class.
  • temp-workspace-missing-canonical.test.ts merges into temp-workspace-root-discovery.test.ts with its 22 cases unchanged.

Net -256 lines.

Evidence

  • Expanded tests 481 → 480: only the merged ordinary-file pair; every other case keeps its name and body.

  • 458 passed, 22 platform skips across the surviving files and every helper importer.

  • 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 14:06
@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, 10:09 AM ET / 14:09 UTC.

ClawSweeper review

What this changes

The PR shares temporary-workspace and hostile-error test fixtures, consolidates directory-durability cases into tables, and merges canonical-admission tests into root discovery.

Merge readiness

✅ Ready for maintainer review

Keep open: this useful test consolidation is not on main, and no introduced correctness defect was found. The author has verified repository administrator access.

Priority: P3
Reviewed head: 5c12c65ebf65ca55bbca09e25bdc01167ed770f8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, useful consolidation with preserved regression scenarios and no actionable introduced defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: Verified repository-administrator authorship exempts ordinary contributor runtime proof; the diff changes test infrastructure only, with no production authority or stored-data contract change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Verified repository-administrator authorship exempts ordinary contributor runtime proof; the diff changes test infrastructure only, with no production authority or stored-data contract change.
Evidence reviewed 9 items Introduced scope: The pinned base-to-head delta changes 20 test files only, with 514 additions and 770 deletions. Production source, native code, dependencies, package metadata, and workflows are unchanged.
Fixture lifecycle preserved: The shared fixture registers real-directory cleanup first, then retains the previous mock restoration, registered-path cleanup, native-loader reset, and configuration reset sequence. The existing fixture explicitly documents reverse afterEach ordering.
Moved regression coverage: A read-only text comparison verified that the entire 278-line block containing afterMkdir and the canonical-admission case bodies is preserved exactly in root discovery. The durability tables retain all 15 previous error routes; the removed ordinary-file test's FsSafeError assertion is incorporated into the surviving test.
Findings None None.
Security None None.

How this fits together

fs-safe creates private temporary workspaces and guards their filesystem identity, permissions, and cleanup. These regression suites exercise creation, replacement races, error settlement, and directory synchronization using filesystem fixtures and injected failures.

flowchart TD
  A[Temporary directories] --> B[Shared test fixtures]
  C[Injected errors and replacements] --> B
  B --> D[Workspace and staged operations]
  B --> E[Directory synchronization]
  D --> F[Identity and cleanup assertions]
  E --> G[Strict failure or unsupported assertions]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Test consolidation production +0/-0; tests +514/-770; net -256 lines The reduction is confined to regression infrastructure and introduces no production growth.

Technical review

Best possible solution:

Use shared test fixtures while preserving independent assertions for filesystem identity, permission checks, failure settlement, and cleanup.

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

Not applicable: this PR consolidates existing tests and reports no runtime bug; source comparison establishes the duplicated support code.

Is this the best way to solve the issue?

Yes: focused shared helpers and table-driven failure routes reduce duplication while retaining the moved case bodies and existing assertions.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is test-maintenance work with no changed runtime behavior or identified urgent regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Verified repository-administrator authorship exempts ordinary contributor runtime proof; the diff changes test infrastructure only, with no production authority or stored-data contract change.

Label justifications:

  • P3: This is test-maintenance work with no changed runtime behavior or identified urgent regression.
  • 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: Verified repository-administrator authorship exempts ordinary contributor runtime proof; the diff changes test infrastructure only, with no production authority or stored-data contract change.

Evidence

What I checked:

  • Introduced scope: The pinned base-to-head delta changes 20 test files only, with 514 additions and 770 deletions. Production source, native code, dependencies, package metadata, and workflows are unchanged. (5c12c65ebf65)
  • Fixture lifecycle preserved: The shared fixture registers real-directory cleanup first, then retains the previous mock restoration, registered-path cleanup, native-loader reset, and configuration reset sequence. The existing fixture explicitly documents reverse afterEach ordering. (test/helpers/temp-workspace.ts:31, 5c12c65ebf65)
  • Moved regression coverage: A read-only text comparison verified that the entire 278-line block containing afterMkdir and the canonical-admission case bodies is preserved exactly in root discovery. The durability tables retain all 15 previous error routes; the removed ordinary-file test's FsSafeError assertion is incorporated into the surviving test. (test/temp-workspace-root-discovery.test.ts:190, 5c12c65ebf65)
  • Validation boundaries: git diff --check passed and the checkout remained clean. The captured PR body reports 458 passing tests, 22 platform skips, and passing TypeScript and boundary/file-size checks; these were not rerun during this read-only review. (5c12c65ebf65)
  • Current implementation and release status: Main still contains the duplicated fixtures and split canonical-admission suite. GitHub confirms this PR is open and unmerged at the pinned head; no local release tag contains that head. No merged fixing PR establishes that this consolidation is already implemented. (5c12c65ebf65)
  • Verified author role: Although the pull endpoint reports CONTRIBUTOR, the repository permission endpoint independently verifies steipete has administrator access, supporting trusted-author handling.

Likely related people:

  • Peter Steinberger: Raw commit e8cc7e3 adds test/staged-file-error-settlement.test.ts:21 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e8cc7e3dcfe9; files: test/staged-file-error-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.

steipete added a commit that referenced this pull request Oct 1, 2026
…es (#809)

Share temp-workspace observers and lifecycle fixtures, staged-settlement hostile errors, and cleanup bindings through test helpers; table directory-durability error routes; merge the split canonical-admission suite into root discovery. 481 to 480 expanded tests (one merged duplicate scenario keeps both assertions); tests only, net -256 lines.
@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Landed on main as 6989b01 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
…es (#809)

Share temp-workspace observers and lifecycle fixtures, staged-settlement hostile errors, and cleanup bindings through test helpers; table directory-durability error routes; merge the split canonical-admission suite into root discovery. 481 to 480 expanded tests (one merged duplicate scenario keeps both assertions); tests only, net -256 lines.
@steipete
steipete deleted the steipete/deslop-r4-tests-temp 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