Repository navigation
fix(copilot): run Windows helpers through Git Bash and repair fixtures - #1
Merged
Merged
Conversation
Prepend shell instructions to every Copilot skill, including skills without a preamble. Preserve Bash syntax and interpreter dispatch instead of opening extensionless scripts through PowerShell. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Install windows-gstack-patch outside gstack-managed directories. Validate owned documents before atomic replacement, retain recovery backups, and verify real helper execution through Git Bash. Focused repair regressions and independent review pass. Windows acceptance remains blocked by 67 named failures and four timed-out shards; publication is not authorized with those failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Do not mistake the Windows temporary directory ancestor for a Local browser root. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use native canonical paths for owned fixture directories and drive-root paths for non-executing provider policy tests. Preserve trusted-path checks and existing deadlines. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass --git-dir for the owned bare repositories without weakening safe.bareRepository=explicit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Accept matching unprefixed generated names in project registrations and parse CRLF frontmatter correctly. Cover content preservation, host metadata, idempotence and refusal of unrelated names. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 87e9e6d0-f8c0-45df-aa50-345aa10adff2
Describe repair of personal and project skill registrations without changing host identity or metadata. Require actual loaded project instructions, explicit exit guards and real startup verification. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 87e9e6d0-f8c0-45df-aa50-345aa10adff2
realpathSync keeps 8.3 short names (KUMARN~1) on Windows while a path resolved through a symlinked directory comes back in long form. The guard compared the two spellings, missed the loop, and rewrote the source SKILL.md through the sidecar symlink. Use realpathSync.native on both sides. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
validateOutputPath resolves components with realpathSync.native, which expands Windows 8.3 short names, but SAFE_DIRECTORIES held only the realpathSync (short) spelling, so valid screenshots under os.tmpdir() were rejected. Keep both spellings of the same directories. Remote serving (TEMP_ONLY) is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The child reports its fixture cwd with 8.3 short names expanded, so canonicalize the parent directory the same way. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why (in your own words)
On Windows, Copilot invoked extensionless gstack helpers directly from PowerShell, which opened the application picker instead of running the script. Bare
bashalso selected WSL on the affected machine. This change makes generated Copilot skills select Git for Windows Bash explicitly and addswindows-gstack-patchto restore that instruction after upgrades. It also fixes five related test fixtures without weakening production guards, assertions, Git hardening, or deadlines.This PR targets
nareshh74/gstack:main. The user authorized publication with the known validation failures disclosed. This is not release acceptance or authorization to merge. The upstream PR garrytan#3047 remains separate.Live evidence
Before the launch fix, direct PowerShell invocation produced empty output or hung during the reported picker incident. That is not evidence that the helper executed. No before screenshot is available.
The installed repair and startup verifier produced the following results on the affected machine. Temporary paths are omitted.
Fixture evidence separates the launch issue from unrelated runtime failures. Before repair, redaction fixtures produced 8 passes and 19 failures because implicit bare-repository discovery conflicted with
safe.bareRepository=explicit. Explicit--git-dirchanged that result to 27 passes and no failures. The Git policy remains enabled.A direct Bun probe showed
import.meta.main=falsewith a short-name fixture working directory andtruewith its native canonical path. Canonical fixture paths restored four planner manifest/report cases. The full-copy offline case still exceeds its original deadlines.The commands below used explicit Git Bash on PATH. The fixture runs used the project runner's unchanged 30-second test timeout. Required generated skills, checksum-verified jq, and the Node browser-server bundle were restored before final acceptance.
bun test test\host-config.test.ts --test-name-pattern 'Copilot host render'bun test test\windows-gstack-patch.test.ts test\context-budget-ratchet.test.ts test\spawnsync-timeout-tripwire.test.tsbun test test\parity-suite.test.ts test\catalog-budget.test.tsbun test browse\test\cookie-import-reliability.test.ts test\provider-model-defaults.test.ts test\docsync-lifecycle-interface.test.ts test\tasks-section-jq.test.ts --timeout=30000 --max-concurrency=1bun test test\redact-prepush-target.test.ts --timeout=30000 --max-concurrency=1bun test test\ci-paid-coordination.test.ts --timeout=30000 --max-concurrency=1bun test test\docsync-command-grammar.test.ts test\docsync-nested-writes.test.ts test\spawnsync-timeout-tripwire.test.ts --timeout=30000 --max-concurrency=1bun test test\spawnsync-timeout-tripwire.test.ts --timeout=30000 --max-concurrency=1bun run typecheckbun run typecheck:testbun run test:windowsgit diff HEADandgit diff origin/main...HEAD, each piped tonode .github\scripts\gate-secret-scan.mjsbefore fixture commitsgit diff --checkThe checks above cover the committed source. No consumed source changed after these runs. The two launch commits were already pushed. Three new test-only commits preserve the five-file diff that was tested. Independent review passed for the four original fixture changes and separately for the planner canonicalization. The comment review found no actionable added comments or suppressions.
Existing validation errors and functionality impact
Focused comparisons ran on both upstream main
c285d88b90d39116ccfa2b901f80ea0fce0b26eband the original base10315cf44d1ea13e3ae4821841873afbf7807935. Each reproduced 56 of the 58 retained enclosing failures by name and primary diagnostic family. The original 67 failure lines included nine nested duplicates. One generated-host prerequisite failure resolved after documented setup. One offline CI diagnostic remains unverified because its fixture failed earlier.This proves recurrence for those original cases, not for every failure in the final run. The comparison was focused, not full acceptance. It retained 90-second outer caps, used the project timeout in corrected controls, and may have resolved dependencies from the parent checkout. Sixty unobserved files from the original timed-out shards remain unverified.
browse/test/temp-dirs.test.tstest/cso-lease-identity.test.tsSNAPSHOT_RACE. This affects crash recovery, not proof that every normal CSO run fails.test/gen-skill-docs-prune-stale.test.tsProcessSingletonprofile lock and cannot complete the headed transition.The five fixture fixes and restored jq/generated prerequisites do not change production behavior. They remove misleading failures. The temporary-path and atomic-recovery defects are genuine functionality risks that this PR leaves in place.
Local Bun 1.4.2 and Node 24.21.0 differ from Windows CI's Bun 1.4.0 and Node 24.18.0. These local results do not establish identical CI behavior. Paid evaluations were not run because
ANTHROPIC_API_KEYwas unavailable. No full Unix suite or complete real upgrade cycle was exercised.Windows 8.3 short-name path fixes (7b9665c, 071feca, acd7f30)
On profiles whose user directory has an 8.3 short name (for example
KUMARN~1),fs.realpathSynckeeps the short spelling whilefs.realpathSync.nativeexpands it. Three comparisons mixed the two:scripts/gen-skill-docs.ts: the symlink-loop guard missed the sidecar alias and rewrote the sourceSKILL.md. Both sides now userealpathSync.native.browse/src/path-security.ts:validateOutputPathrejected screenshots underos.tmpdir().SAFE_DIRECTORIESnow holds both spellings of the same directories; remote serving (TEMP_ONLY) is unchanged.test/ceo-plan-mode-fixture.test.ts: the expectation now uses the long-form directory the child reports.Installed from this branch and exercised:
Focused tests:
gen-skill-docs-prune-stale1 fail -> 4 pass;browse/test/temp-dirs1 fail -> 0 fail;ceo-plan-mode-fixture0/9 -> 9/9;bun run typecheckpasses. Independent read-only review: PASS.bun run test --windows-only(Git Bash on PATH, jq installed): 46 failing tests in 23 files -> 16 in 13 files; still exit 124 with four timed-out shards. Remaining:cso-lease-identity(Windowsctimediffers betweenlstatandfstatin 17/20 local trials; fix not chosen), and timing-sensitive tests that pass in isolation or match the earlier inventory. Acceptance is not complete.Scope
OpenWith.exeprocess.Liveness proof (required for external contributors)
gh api user --jq .loginreturnednareshh74. This PR targets that user's own fork. The template's @garrytan exemption does not apply. No human liveness screenshot is attached.Checklist
GSTACK PRtyped live into a real surface) or PR author is @garrytan (owner exemption)No accepted issue is linked for the standalone repair skill. The reported reproduction and live evidence appear above. Acceptance remains red; this PR is for review, not a claim that the fork is release-ready.