fix(conformance): trust Windows sources with Git path separators - #145
Conversation
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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 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 routessafe.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.
# 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
left a comment
There was a problem hiding this comment.
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.
Root cause
The protected Windows platform job failed at
phase1.stage.checkouts.chat.failed.Git compares
safe.directoryentries 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'sD:/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 onsafe.directorybeing honoured — and therefore the only one that failed.Fix
Adds
toGitSafeDirectoryPathinscripts/phase1-conformance-lock.mjsand routes everysafe.directory=${...}override through it (lock harness, conformance harness, schema v2 producer).Tests (written first, observed failing)
safe.directory=${...}construction to route through the normalizerAuthority chain
94b586ebehavior + tests + governed workflow bytes + docs digests17cc811frozen lock + lock authority test86b00e9non-governed type declarationValidation
test:unit:normal(552 passed),test:unit:heavy(396 passed),phase1-conformance.test.tsheavy (285 passed),lint,typecheck,format:check,build— all pass.