Skip to content

test(windows): write the materialize fixtures with LF, skip the symlink case - #23788

Merged
KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
leonlaiyc:claude/windows-lf-fixture-xfails
Oct 30, 2026
Merged

KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
leonlaiyc:claude/windows-lf-fixture-xfails

Conversation

@leonlaiyc

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: the three artifact-materialize tests listed as Windows xfails run on the Windows matrix: the two that need no symlink pass, and the one that does skips only where symlinks cannot be made.

The three test/test_artifact_materialize.py entries in test/windows-expected-failures.txt sit under a comment saying they need symlink-creation privilege because they "exercise copytree's handling of in-tree POSIX symlinks". None of them calls copytree, and two create no symlink. On a Windows host:

  • test_materialize_recorded_document_succeeds: assert '# hello\r\n' == '# hello\n'
  • test_safe_read_with_identity_authorized: assert b'# ok\r\n' == b'# ok\n'
  • test_materialize_symlinked_request_resolves_to_recorded_inode: OSError: [WinError 1314] on a host without the privilege

The first two write their fixture with Path.write_text, which on Windows turns \n into \r\n, and then compare the bytes the code read with the LF the test meant.

Why it matters

The materialize path decides which recorded document an artifact may read, by inode identity. As strict xfails, its success path and the identity-checked byte read assert nothing on Windows.

Not a goal

  • How _materialize_and_pin or safe_read_file_bytes_with_identity read a file; both return exactly the bytes on disk.
  • Granting symlink privilege on any runner.

What changed (motivation → approach → change)

  • Symptom: two tests compare CRLF bytes with an LF literal on Windows; the third cannot build its symlink without the privilege.
  • Root cause: the fixtures are written in text mode, and the symlink case is listed instead of skipped.
  • Change, in test/test_artifact_materialize.py: _write_doc writes encoding="utf-8", newline="\n", and the identity read's fixture is write_bytes(b"# ok\n"), so the file holds what the test asserts on every platform. test_materialize_symlinked_request_resolves_to_recorded_inode takes @requires_symlinks, the rootdir marker its refused-case sibling test_materialize_symlink_to_unrecorded_file_refused already carries. Where symlinks can be made it runs, now against an LF fixture, and elsewhere it skips with the marker's reason.
  • The three strict-xfail lines and the inaccurate comment above them are gone from test/windows-expected-failures.txt.

Backwards compatibility

Compatible: test-only; no product code changes. On POSIX the fixtures hold the same bytes they did.

Removes nothing: three strict-xfail lines go; one test that needs a symlink now skips by the shared marker where none can be made, as its sibling does, and no assertion is dropped.

Tests

Proof: not provable -- test-only change

Manual verification

N/A — test-only change; the Windows run above is the check, and the Windows matrix runs these tests on this PR, including the symlink case where the runner can make one.

Related Issues

Fixes #23787

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

🤖 Generated with Claude Code

@leonlaiyc
leonlaiyc requested review from a team and KiroCrewCaptain as code owners October 24, 2026 16:52
@leonlaiyc
leonlaiyc requested a review from iamwhatever October 24, 2026 16:52
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision fca6ca8aa288141818014e425afb6ec7cb7c32e4 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ⏭️ skipped

Revision fca6ca8aa288141818014e425afb6ec7cb7c32e4 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of fca6ca8aa288141818014e425afb6ec7cb7c32e4 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level concerns. This is a test-only change: the fixtures now write the exact bytes the tests assert, and the symlink case uses the same shared requires_symlinks marker its sibling already carries.

[DESIGN-REVIEWED] fca6ca8

Description read

[DESCRIPTION-READ] 6b30fdb6632d7960566fdb4495d80fe3351c9cc786b94e48c08410d55baa6e3e

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed fca6ca8aa288141818014e425afb6ec7cb7c32e4 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] fca6ca8

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed fca6ca8aa288141818014e425afb6ec7cb7c32e4 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] fca6ca8

@leonlaiyc

Copy link
Copy Markdown
Contributor Author

CI on 86a2fd5cd6 is red for an infrastructure reason, not a verdict on the code.

  • CI run 40113560393: Detect changed surface started at 17:02 UTC and was cancelled at its 15-minute job ceiling, and Coverage Gate then failed closed ("surface detection (changes) never reported -- failing closed").
  • Fast Gate passed on this head, and the Design, Opus 5.5 and GPT 6.1 reviews have no blocking findings.

A fork cannot re-run workflows. Could a maintainer re-run CI run 40113560393? The same 17:01–17:02 stall cancelled Fast Gate on #23781.

…nk case

Two of the three test_artifact_materialize strict xfails create no
symlink at all: they write a fixture with write_text, which on Windows
turns "\n" into "\r\n", and then compare the bytes the code read with
the LF the test meant. Write the fixtures with newline="\n" (and bytes
where the test compares bytes). The third really does need a symlink,
so it takes requires_symlinks, as its refused-case sibling already
does, instead of a list line. Drop the three lines and the comment
above them, which named copytree, a call none of the three makes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iamwhatever
iamwhatever force-pushed the claude/windows-lf-fixture-xfails branch from 86a2fd5 to fca6ca8 Compare October 30, 2026 04:48
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Security Scope Review (fork) — 🔴 BLOCK (blocking)

Which legitimate operations does fca6ca8aa288141818014e425afb6ec7cb7c32e4 newly refuse? Model proposes, scripts/deny_diff.py decides — updated in place on each push. A script-confirmed regression blocks PR readiness.

no leg reported, and this was not the nothing-to-adjudicate short circuit

No [SCOPE-REVIEWED] marker for this head was produced, so the model's text is withheld: it cannot be shown to describe this revision. See the job logs.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 30, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) October 30, 2026 07:06

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: test (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: Windows test fixtures write LF bytes and skip the symlink case without privilege; removes three now-passing entries from the Windows expected-failures list.

@KiroCrewCaptain
KiroCrewCaptain merged commit c3f5cfb into kirodotdev:main Oct 30, 2026
100 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two artifact-materialize Windows xfails are CRLF fixtures, not missing symlink privilege

2 participants