Skip to content

fix(conformance): trust Windows sources with Git path separators - #145

Merged
BunsDev merged 6 commits into
mainfrom
fix/protected-matrix-v16
Sep 9, 2026
Merged

fix(conformance): trust Windows sources with Git path separators#145
BunsDev merged 6 commits into
mainfrom
fix/protected-matrix-v16

Conversation

@BunsDev

@BunsDev BunsDev commented Sep 7, 2026

Copy link
Copy Markdown
Member

Root cause

The protected Windows platform job failed at phase1.stage.checkouts.chat.failed.

Git compares safe.directory entries against its own real paths, which always use forward slashes. The harness passed native Windows paths (D:\a\chat\chat), which can never match Git's D:/a/chat/chat. Chat's workspace is the only conformance source owned by a different identity (OPENCOVEN_CHAT_ROOT = $workspace, owned by the runner admin, while every counterpart is created by the restricted identity), so it is the only source that depends on safe.directory being honoured — and therefore the only one that failed.

Fix

Adds toGitSafeDirectoryPath in scripts/phase1-conformance-lock.mjs and routes every safe.directory=${...} override through it (lock harness, conformance harness, schema v2 producer).

Tests (written first, observed failing)

  • unit normalization, including UNC paths
  • a source-scanning guard requiring every safe.directory=${...} construction to route through the normalizer

Authority chain

  1. 94b586e behavior + tests + governed workflow bytes + docs digests
  2. 17cc811 frozen lock + lock authority test
  3. 86b00e9 non-governed type declaration

Validation

test:unit:normal (552 passed), test:unit:heavy (396 passed), phase1-conformance.test.ts heavy (285 passed), lint, typecheck, format:check, build — all pass.

BunsDev and others added 3 commits September 7, 2026 02:57
Git compares safe.directory entries against its own forward-slash real
paths, so the native Windows separators the harness passed never matched.
The protected Windows platform job therefore rejected the differently
owned Chat workspace as dubious ownership and failed the Chat checkout at
phase1.stage.checkouts.chat.failed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@BunsDev BunsDev added the ci:full Run the macOS and Windows CI jobs on this pull request label Sep 7, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@BunsDev
BunsDev marked this pull request as ready for review September 7, 2026 08:08
Copilot AI lite review requested due to automatic review settings September 7, 2026 08:08

Copilot AI 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.

🟡 Changes recommended

Existing assertions in src/phase1-conformance.test.ts still expect un-normalized safe.directory= values (backslashes on win32), which will mismatch the newly normalized arguments and can break Windows test runs.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR fixes Phase 1 conformance failures on protected Windows runners by ensuring all git -c safe.directory=... overrides use Git’s expected forward-slash path separators, even when the host OS provides native Windows paths.

Changes:

  • Adds toGitSafeDirectoryPath() to normalize Windows path separators and routes safe.directory=${...} overrides through it across the Phase 1 harness scripts.
  • Adds unit tests for path normalization (including UNC paths) plus a guard test that checks safe.directory=${...} constructions are routed through the normalizer.
  • Updates conformance lock authority/digests and corresponding documentation/workflow pinned hashes.
File summaries
File Description
src/phase1-conformance.test.ts Adds normalization tests and a guard ensuring safe.directory=${...} uses the normalizer.
src/phase1-conformance-lock.test.ts Updates expected authority revision/tree/blob/sha256 values for the harness.
src/client-v1-conformance-workflow.test.ts Updates workflow string expectation to include toGitSafeDirectoryPath(...) in safe.directory override.
scripts/phase1-schema-v2-producer.mjs Routes safe.directory overrides through toGitSafeDirectoryPath(...) for Git invocations.
scripts/phase1-conformance.mjs Routes safe.directory overrides through toGitSafeDirectoryPath(...) during clone.
scripts/phase1-conformance-lock.mjs Introduces toGitSafeDirectoryPath() and uses it in authority Git calls.
scripts/phase1-conformance-lock.d.mts Exposes toGitSafeDirectoryPath(path: string): string to TS consumers.
phase1-conformance.lock.json Repins harness revision and authority file digests.
docs/phase1-conformance.md Updates documented bytes/SHA-256 values for repinned harness/workflow artifacts.
.github/workflows/client-v1-conformance.yml Updates pinned file sizes/SHA-256s to match the repinned harness artifacts.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/phase1-conformance.test.ts
BunsDev and others added 2 commits September 7, 2026 03:18
# Conflicts:
#	docs/phase1-conformance.md
#	phase1-conformance.lock.json
#	src/phase1-conformance-lock.test.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@BunsDev BunsDev left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maintainer-requested exact-head review of 89cd566ec1280f6be45061854f87ebfc0238db95 against main 4271f47892e362a55a12df1d3926c43c3528b2d2.

No blocking finding in the reviewed diff. The Windows path conversion is restricted to per-command safe.directory values; it does not introduce wildcard trust, ambient/global Git configuration changes, hook execution, or a relaxed authority comparison. The workflow changes are the matching governed-script byte/digest updates. The signed behavior authority b47d347db1073c1b86c23fcf6467f20949a2df26 is the head's direct parent; a merge commit is required to preserve that reachable history.

Disposition of discussion_r3947747818: the two cited raw-path assertions are inside existing test.skipIf(process.platform === 'win32') suites (clones an exact authority ref before inspecting the protected tag and trusts both the schema-v2 local worktree and its Git directory). They cannot cause the claimed Windows assertion failure. The new normalization test explicitly covers drive-letter and UNC paths. This disposition does not claim broader native Windows coverage than CI actually ran.

Hosted exact-head CI run 34100801729 is terminal success across all 10 jobs, including Web/unit checks, Rust/native tests, both Unix producer supervisors, contract canary, Phase 1 real-authority conformance, Desktop build, E2E, and Windows supervisor behavior with the shallow Windows authority-checkout reproduction. I inspected repository source and hosted evidence; I did not run the full repository suite locally in this session.

Scope of approval to proceed: merge #145 with its existing authority ancestry, refresh #146 onto that exact merge, and require fresh exact-head CI. The protected three-platform SDK #38 evidence and SDK publication remain separate gates; this review authorizes no package publication.

@BunsDev
BunsDev merged commit 8daf729 into main Sep 9, 2026
10 of 19 checks passed
BunsDev added a commit that referenced this pull request Sep 9, 2026
Refresh only fix/repin-cave-v0.3.12 with exact main 8daf729. Preserve #146 Cave authority bc310e9753783678014086ed6f7ef7d3fb797967 and reachable Windows behavior authority b47d347. Fresh #146 exact-head CI is required before integration to main; no release or publication is authorized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the macOS and Windows CI jobs on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants