Deferred findings from the reviews of #318:
- Symlinked problem directories are silently skipped.
visitDirectory in src/cli/checkAllProblems.ts uses entry.isDirectory() / entry.isFile(), which are false for symlinks, so a problem reached only through a symlinked directory (or whose problem.md is a symlink) is skipped without failing the check. Resolve symlinks with stat or fail loudly.
close-delay misclassification edge (POSIX). runHarnessProcess settles on the child's close event. If judged code leaves a background process that both escapes the detached process group (e.g. via setsid) and inherits the stdio pipes, a passing run is reported as timed out after 10 minutes even though all TEST_CASE_RESULT lines were printed. Settle on exit plus a short stream-drain grace period, or add a post-kill settle timer.
- Interrupt during the problem copy leaks the partial temp directory. Temporary roots are registered for signal cleanup only when the harness process spawns; a Ctrl-C while
copyProblemDirToTemporaryRoot is still copying leaves the partial problem-utils-isolation_* tree in the OS temp directory. Register the temp root (and install the signal handlers) before the copy starts.
- The whole problem directory is copied once per model answer. A problem with M answers copies all answers and all test cases M times. Copy once per problem and clone per run (ideally with
COPYFILE_FICLONE), and stream-filter TEST_CASE_RESULT lines instead of buffering up to 64 MB of output.
TEST_CASE_RESULT line parsing is triplicated. src/cli/checkAllProblems.ts, isAcceptedJudgeOutput in src/helpers/checkProblemDirIsolation.ts, and test/e2e/debugAndJudge.test.ts each parse the lines with slightly different newline handling. Extract a shared parseTestCaseResultLines(stdout) next to src/types/testCaseResult.ts.
Deferred findings from the reviews of #318:
visitDirectoryinsrc/cli/checkAllProblems.tsusesentry.isDirectory()/entry.isFile(), which are false for symlinks, so a problem reached only through a symlinked directory (or whoseproblem.mdis a symlink) is skipped without failing the check. Resolve symlinks withstator fail loudly.close-delay misclassification edge (POSIX).runHarnessProcesssettles on the child'scloseevent. If judged code leaves a background process that both escapes the detached process group (e.g. viasetsid) and inherits the stdio pipes, a passing run is reported astimed outafter 10 minutes even though allTEST_CASE_RESULTlines were printed. Settle onexitplus a short stream-drain grace period, or add a post-kill settle timer.copyProblemDirToTemporaryRootis still copying leaves the partialproblem-utils-isolation_*tree in the OS temp directory. Register the temp root (and install the signal handlers) before the copy starts.COPYFILE_FICLONE), and stream-filterTEST_CASE_RESULTlines instead of buffering up to 64 MB of output.TEST_CASE_RESULTline parsing is triplicated.src/cli/checkAllProblems.ts,isAcceptedJudgeOutputinsrc/helpers/checkProblemDirIsolation.ts, andtest/e2e/debugAndJudge.test.tseach parse the lines with slightly different newline handling. Extract a sharedparseTestCaseResultLines(stdout)next tosrc/types/testCaseResult.ts.