I’m tired of writing bug reports. Here’s the sixth problem with the terminal.
bugreport by code-supernova-1-million with my edits
Bug Report: PowerShell Syntax Error After Test File Creation
Summary
After creating test files for improving code coverage, the system began generating PowerShell syntax errors when executing any command, preventing normal operation.
Environment
- OS: Windows 11
- Shell: PowerShell 7.5.3
- Project: Artemonim’s Chess Monorepo
- Location:
G:\GitHub\Artemonim's-Chess
Additional
- RID:
1c3b6b32-be8f-4c38-abff-ee72d13b4579 - Agent:
code-supernova-1-million
Steps to Reproduce
-
Initial State (Working):
cd "G:/GitHub/Artemonim's-Chess/" && ./run.ps1 -SkipLaunchexecuted successfully, showing coverage report:Statements: 30.44% (1197/3932) Branches: 56.42% (211/374) Functions: 52.66% (89/169) Lines: 30.44% (1197/3932) -
Created Test Files for zero-coverage files:
Shared/src/contracts/engine.test.tsShared/src/contracts/protocols.test.tsShared/src/logging/TournamentLogger.test.tsShared/vite.config.test.tspackages/Classic/src/debugOverlay.test.tspackages/Classic/src/engine.config.test.tspackages/Classic/vite.config.test.tspackages/Classic/vite.config.analyze.test.tspackages/Classic/vitest.config.test.ts
-
Post-Creation State (Broken): Any subsequent command triggers PowerShell syntax error:
ParserError: C:\Users\Artem\AppData\Local\Temp\ps-script-xxxxx.ps1:139 Line | 139 | Write-Host ("[TIMING] {0,-20}: {1,6:F3}s (total: {2,6:F3}… | ~~~ | Unexpected token ':F3' in expression or statement.
Expected Behavior
- Commands should execute normally
- Test files should be created without affecting system functionality
- PowerShell should parse commands correctly
Actual Behavior
- System creates temporary PowerShell scripts in
AppData\Local\Temp - These scripts contain syntax errors with
:F3formatting strings - All command execution fails
Root Cause Analysis
The error suggests PowerShell is encountering a string formatting expression :F3 (format specifier for 3 decimal places) that it cannot parse correctly. This likely occurs when:
- One of the created test files contains a string that PowerShell misinterprets
- An existing file contains problematic PowerShell-like syntax
- The system’s command wrapper is incorrectly processing file contents
Files Modified
Created the following test files to improve coverage from 30.44% to target 75%:
- Contract interfaces tests (
engine.ts,protocols.ts) - Logger tests (
TournamentLogger.ts) - Configuration tests (
vite.config.ts,vitest.config.ts) - Component tests (
debugOverlay.ts,engine.config.ts)
Workaround Attempts
- Direct Node.js execution:
node -e "console.log('test')"- fails - Path navigation:
cd "path"- fails - Command variations - all fail with same error
Impact
- Cannot run tests or build process
- Cannot verify coverage improvements
- Development workflow blocked
Severity
High - Complete blockage of development workflow
Suggested Investigation
- Search all files for
:F3patterns - Check temporary PowerShell scripts in
AppData\Local\Temp - Review created test files for PowerShell-like syntax
- Test if removing recent test files resolves the issue
Temporary Solution
May need to delete created test files and recreate them to isolate the problematic content.