Three-layer fix for runtime files leaking into git commits: 1. Stage-then-unstage: replace pathspec excludes with git add -A followed by git reset HEAD for each exclusion. The old approach failed when .gsd/ was in .gitignore — git exited non-zero before evaluating the excludes, and the catch fallback staged everything unconditionally. 2. Auto-cleanup: on first smartStage call per session, remove any runtime files that are already tracked in the index (from the fallback bug) via a dedicated commit. This is a one-time migration that self-heals repos where runtime files were accidentally committed. 3. Pre-checkout discard: after pre-switch auto-commits that exclude .gsd/, run git checkout -- .gsd/ to clear dirty runtime files that would otherwise block git checkout when the target branch has different tracked versions. Also adds completed-units.json to RUNTIME_EXCLUSION_PATHS and BASELINE_PATTERNS (was missing — metrics.json was listed but completed-units.json was not). |
||
|---|---|---|
| .. | ||
| resources | ||
| tests | ||
| app-paths.ts | ||
| cli.ts | ||
| loader.ts | ||
| logo.ts | ||
| onboarding.ts | ||
| pi-migration.ts | ||
| resource-loader.ts | ||
| tool-bootstrap.ts | ||
| wizard.ts | ||