Fix debug log file race#155
Merged
Merged
Conversation
e01ab48 to
bf699e8
Compare
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.
Summary
stat(debugLogPath)withfd.stat()after opening the debug log, so/debugtails the same file handle it inspected.fs/promisesand fails if pathstatis used beforeopen.Evidence boundary
This is one local remediation for the CodeQL
js/file-system-racequeue item. It does not claim the hosted alert is closed until GitHub code scanning re-runs on the branch/default branch.Primary references used: CodeQL
js/file-system-race, Node.jsFileHandle.stat/read, and CWE-367 TOCTOU guidance.Verification
bun test src\skills\bundled\debug.test.tsbun test src\skills\bundled\debug.test.ts src\skills\bundled\loop.test.ts src\skills\bundled\updateConfig.test.tsbun run typecheck --pretty falsebun run product:github-hosted-trust-posture(RISKS_RECORDED; readiness claims remain blocked)bun run product:code-scanning-remediation-queuebun run product:public-claim-boundarybun run product:evidence-manifestbun run verify:privacybun run buildbun run product:quality(exit 0; terminal condition still records the local VS Code CLI unavailable boundary)git diff --checkNote: running
product:qualityrefreshed generated product-quality reports locally; this PR intentionally commits only the code/test remediation.