Skip to content

fix: tighten two file read checks on windows - #35684

Merged
bolichen97 merged 1 commit into
mainfrom
fix/9731-windows-read-check-3
Nov 12, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/9731-windows-read-check-3

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: On Windows, two more file reads the gateway makes of files an app controls refuse what their documentation says they refuse at that name, as they already do on Linux and macOS.

Part of the class of cases tracked in #9731: that issue already describes, in public, how a read can keep its documented refusal on Linux and macOS and lose it on Windows. This PR closes the two cases that sit beside the one #34484 closed.

Why it matters

Both reads run in the gateway, on files the app itself can write, on every Windows host that starts such an app, and what they read decides whether the app's installed dependencies are used as they are or installed again. The refusal their documentation promises at that name could be skipped there, and no test pinned it on Windows.

Not a goal

  • The other cases listed in Gate the O_NOFOLLOW-on-Windows no-op: 88 sites, 24 convertible today #9731. Each needs its own check that it is reachable on Windows, so the issue stays open for them.
  • Any change on Linux or macOS: both reads there make the same call as before.
  • Any refusal beyond the one each read already documents, and anything about the folders above the name each read opens.

What changed (motivation → approach → change)

On Windows the two reads did not reliably make the refusal their documentation promises at the name they open. Each now refuses exactly what its documentation names at that name, as the case in #34484 does, and nothing else. Linux and macOS make the same call as before. Two tests in test pin the refusal for each read and run on Windows hosts that can create links. The code change is in src/kiro_crew/apps.

Backwards compatibility

Compatible: Linux and macOS make the same call as before. On Windows the only difference is that what each read documents as refused is refused, and both callers already treat a refused read as "not installed yet": the dependencies are installed again, or the installed ones are not used.

Removes nothing: no caller, key or field changes.

Tests

Two tests check that each read refuses what its documentation says it refuses when the check before the open misses it, as it would when the link lands after that check. One is new; the other is an existing test given a second case. Linux and macOS run them too, where the reads already refused. On Windows they run wherever the host can create links and are skipped where it cannot.

Proof: not provable -- other: the changed reads differ only on Windows and prove.py runs on this Linux host, where they already refused; CI's Windows shards run the tests where they can create links

Determinism: both tests passed 20 runs at -n0 and 10 runs at -n 4 --dist loadgroup --max-worker-restart=2 beside two sibling files; their two files passed in a shuffled order (seed 14958). With the open swapped for one that follows a link, both cases where the check before the open misses it fail, and the case where it does not miss still passes.

Manual verification

N/A — unit coverage sufficient: the tests run on CI's Windows shards wherever their runner can create links; whether they passed or were skipped on this head is read from the Windows shard results.

Screenshots / video

N/A — no user-visible change.

Related Issues

Part of #9731

Sibling sweep

Swept: the same read shape across the codebase, on origin/main @ cf4578c.
Siblings: tracked in #9731 -- each remaining case needs its own check that it is reachable on Windows.

Pattern harvest

Not generalizable: a single repository-wide rule for this class was tried and closed in #17557 because it changed no runtime behaviour, so the class is being closed one reachable case at a time under #9731.

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

Submitted under the project's Apache-2.0 license.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 12, 2026 00:23
@bolichen97
bolichen97 requested a review from CrysisDeu November 12, 2026 00:23
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 555bebb7e197f63a4d0db1b68cbcc00395e344d6 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 Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 555bebb7e197f63a4d0db1b68cbcc00395e344d6 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. This is a two-call fix that uses the existing platform_compat.open_file_no_reparse(links_only=True) helper. That is the same call already at provisioning.py:276 (the #34484 case), and the remaining siblings are deferred to #9731.

Notes

  • Item 1 / 2 — point patch with counted siblings: the pattern os\.open\(.*O_NOFOLLOW", 0\) still matches 3 times in src/kiro_crew/apps, in spec_builder/.../repository_sentinel.py (2) and aws_control/.../supervisor/bundle.py (1). The description defers these to Gate the O_NOFOLLOW-on-Windows no-op: 88 sites, 24 convertible today #9731 ("each remaining case needs its own check that it is reachable on Windows"). Accepted and deferred, not a demand.

What this change ships

Inventory (4 items) — 4 justified

Intent: on Windows, make the deps ABI-marker read and the provision-stamp read refuse a link planted at the name, as they already do on POSIX. This is a FIX.

  1. ABI-marker read in _deps_tree_stamp_current refuses a link or junction at the name on Windows — justified
  2. Provision-stamp read in _provision_app_deps_locked refuses a link or junction at the name on Windows — justified
  3. New test: a stamp link planted after the pre-check never activates the deps tree — justified
  4. Existing stamp-symlink test gains an "after-screen" case — justified

[FIRST-PRINCIPLES-REVIEWED] 555bebb

Description read

[DESCRIPTION-READ] 911cfe7ec59615cba51958a63ed359cca68b48fc974dbc1826732806aca58832

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 555bebb7e197f63a4d0db1b68cbcc00395e344d6 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: both reads now use the same no-reparse open already used at provisioning.py:276. Linux and macOS are unchanged, and a refused read on Windows falls back to reinstalling the dependencies.

[DESIGN-REVIEWED] 555bebb

Description read

[DESCRIPTION-READ] 622f9388da78a82277213bf1a3ac3511fc5c0ecfab644158c03aca786d39db3d

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 Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 555bebb7e197f63a4d0db1b68cbcc00395e344d6 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 555bebb

Verdict parsed from the review's SHA-scoped output markers for commit 555bebb7e197f63a4d0db1b68cbcc00395e344d6.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 555bebb7e197f63a4d0db1b68cbcc00395e344d6 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 555bebb7e197f63a4d0db1b68cbcc00395e344d6 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 555bebb

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 555bebb7e197f63a4d0db1b68cbcc00395e344d6 false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 12, 2026 00:48
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 12, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve on be2d5f4. On Windows, the two reads of the dependency stamp and ABI marker files now refuse a link at the file's name in the same step that opens it, the way the requirements read already does. Linux and macOS make exactly the same call as before. A refused read still means "not installed yet", so the worst a user sees is a dependency reinstall. Each fix has a test that fails when the fix is undone. Decisive lines: src/kiro_crew/apps/backend_runtime/provisioning.py:167, src/kiro_crew/apps/backend_runtime/provisioning.py:742, test/test_app_backend_refactor_characterization.py:443, test/test_apps_backend_coverage_dependency_install.py:1066

On Windows two reads the gateway makes of files an app can write did
not refuse, at the name they open, what their comments say they
refuse there, as they already do on Linux and macOS. Each read now
makes that refusal in the open itself. Linux and macOS make the same
call as before.

Part of #9731
@bolichen97
bolichen97 force-pushed the fix/9731-windows-read-check-3 branch from be2d5f4 to 555bebb Compare November 12, 2026 09:40
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in src/kiro_crew/apps and in test/test_update_boot_apply.py and src/kiro_crew/dashboard/handlers/updates.py (the red-main fix #35625, which clears the two red Backend Tests checks on the old head) since this head's CI ran (ee7a026 -> cf4578c); CI re-running.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 12, 2026
@bolichen97
bolichen97 merged commit 5fbe9e6 into main Nov 12, 2026
97 checks passed
@bolichen97
bolichen97 deleted the fix/9731-windows-read-check-3 branch November 12, 2026 10:43
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants