Skip to content

test(authoring): preserve guarded Windows skill snapshots - #1131

Merged
777genius merged 1 commit into
mainfrom
fix/e2e-windows-snapshot-observer-20261127
Nov 27, 2026
Merged

777genius merged 1 commit into
mainfrom
fix/e2e-windows-snapshot-observer-20261127

Conversation

@777genius

@777genius 777genius commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

Problem

The corrected Windows AMD64 Authoring run for #1127 passed both concurrent Skill creation cases and all 14 checked-publication reader-process controls, but three existing replacement tests failed before their attack could run: job 140287944492.

The failure was the test observer itself. skillTree used filepath.WalkDir, whose ordinary Windows directory opens do not share DELETE access. They conflict with the intentionally retained private-stage DELETE guard. The admitted artifact (15170628374, SHA-256 a4f457cbbb8e70a55e175b36955306b549a491f66c03ef117c484e0fed31b53b) records sharing violations while snapshotting .authoring-* inside replacementRenameBlocked, before os.Rename.

Change

Use the existing rooted filesystem APIs for test snapshots. Bootstrap through the parent, open the observed directory relative to that root, and walk its Root.FS(). Preserve every entry, file mode, complete file byte sequence, literal symlink target, platform path spelling and the single-entry behavior of a root file or symlink.

Add two regressions:

  • Portable binary root-file and directory/dangling root-symlink snapshots.
  • Native Windows snapshots of the entire guarded stage and its parent, including empty entries, binary content, read-only mode, a symlink and unrelated sibling content. Ordinary directory reads must fail with the exact sharing violation both before and after the snapshots, and the packageview-style source reader must remain denied.

This changes exactly two test files. Production stage guards, their sharing flags and lifetime, source validation, publication, cleanup, replacement attacks, calibration and accepted native rename errors are unchanged.

Verification

  • Go 1.26.11: full Scaffold and Skills packages 172 test passes, zero failures, zero skips.
  • Windows AMD64 Scaffold test binary cross-compiles successfully. This is compilation evidence only; native sharing semantics still require Windows execution.
  • Pinned gofmt and git diff --check: pass.
  • Two independent source reviews: no findings.
  • Full local make lint was killed during CLI analysis; local make test-core did not pass and did not reach its final CLI stage. See the follow-up below for the precise scope and the subsequent focused checks.
  • Fresh ordinary PR Required, Authoring and Native Client Runtime checks must complete on this head. In particular, Windows must execute the new snapshot regression and all original replacement/concurrency/reader controls.

The reviewed local commit is cf8a42df2545e552c9bc5e3188cb52fc15d1a2a4. The published head cb03f9c856806039424618fcef4d31de736357bb has the identical tree 9b364c850b8f985a96bcb1ded33e2451b55de31a, based on main 864829036a932a8c22ab7074b94b79dc70ff8021. Installation/Marketing harnesses and production inputs are unchanged, so their separately admitted component reports keep their original source attribution.

Follow-up for #1087, #1127 and #1128. Ordinary early merge is authorized by the owner; final E2E qualification remains pending until the selected checks finish successfully.

Snapshot lint correction — 2026-11-27

PR #1132 was merged normally at 04:46:15 UTC. Focused analysis found three unchecked close results and two native-error comparisons in the new test code. Cleanup errors now fail the tests; errors.Is plus exact dynamic-type checks retain the original raw native errno/NTSTATUS contract and reject wrappers. Production code, complete snapshots, guard lifetime and replacement attacks are unchanged.

All four focused Linux/Windows lint passes succeeded with zero issues using base 864829…, so they cover the entire observer change, including #1131. The final reviewed contents also passed 172 Scaffold/Skills tests with zero skips and Windows AMD64 cross-compilation; independent review found no issue. The broader local lint was killed in CLI analysis, and local Core failed with containment/socket prerequisites, sanitized Git setup errors and temporary-storage exhaustion; those partial runs are not full-gate proof.

Head 5742cfc7f0377cad934233e4b0d24d129c9fcced, synthetic commit 7e3df37966fda390e3d48024822ba3cdcc86f3ec, local reviewed commit 1229bcab7cf1f54729554667afb90e020a903509 and main merge 2e8b2eb5d235c76f26720c728e286eb41d2a4333 have exact tree 3a4dc37a3237807e8a20ddbee5e48688e5cb25e7. Fresh Required, Authoring and Native Client Runtime qualification is pending. No CI rerun, cancellation, dispatch, runner change or protection override was used.

@strix-security

Copy link
Copy Markdown

Strix is installed on this repository, but we couldn't run this PR security review because this workspace's trial has ended. Add a card to resume code reviews here.

So far, Strix has reviewed 392 pull requests, surfaced 113 security issues (1 critical/high) and blocked 3 risky merges across this workspace.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8648290 and cb03f9c.

Files selected for processing: 2

  • cli/internal/authoring/scaffold/skill_plan_test.go
  • cli/internal/authoring/scaffold/stage_skill_windows_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@777genius
777genius merged commit f75a1b9 into main Nov 27, 2026
52 of 53 checks passed
@777genius
777genius deleted the fix/e2e-windows-snapshot-observer-20261127 branch November 27, 2026 04:27
777genius added a commit that referenced this pull request Nov 27, 2026
Include the existing guarded Windows authoring snapshot fixes from #1131 and #1132 after the old-head native authoring check reproduced that baseline failure. Preserve all eight reviewed #1129 file blobs.
777genius added a commit that referenced this pull request Nov 27, 2026
Integrate the reviewed fixes from PRs #1131 and #1132 after the Windows ARM64 native lane exposed the same inherited snapshot-observer failures in TestSkillRootAndParentReplacement and TestSkillStageReplacementPreservesUnrelatedContent. Preserve production guards, replacement attacks and all enterprise-policy code. The resulting tree exactly matches the previously computed conflict-free merge tree.
@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.38%. Comparing base (8648290) to head (cb03f9c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1131   +/-   ##
=======================================
  Coverage   64.38%   64.38%           
=======================================
  Files        2353     2353           
  Lines      143080   143080           
=======================================
  Hits        92120    92120           
  Misses      37895    37895           
  Partials    13065    13065           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant