Repository navigation
fix(jobs): cancellable, time-limited analysis jobs on the host (S6) - #91
Merged
Merged
Conversation
A shared JobRunner (core/analysis/launch/jobRunner.ts) replaces SingleJobGate for historical comparison, project evolution and the dependency graph: job id and state (queued/running/cancelled/failed/done), a deadline, a cancel that reaches the Git and Python children through the async-context signal, late results discarded, and the slot held until the work unwinds (bounded by a grace period). - bridges reserve the job synchronously before their first await; "busy" goes to the requester only (LAUNCHER-11, HIST-9); the historical refresh flag is set after success - project-evolution-cancel / historical-comparison-cancel: Cancel is not Clear; Clear cancels and waits; leaving the mode no longer clears the movie (EVO-2, EVO-4); a revision commits only once written and wanted - per-revision watchdog (5 min), git command timeout (3 min), job deadlines (30/15/10 min); a killed analysis is never recorded as a deterministic exclusion (EVO-3, HIST-7, DEPGRAPH-9) - references carry the job state so late joiners see it - export worker pool: per-file timeout with one retry, ready timeout 30 s, a worker that cannot start degrades the pool (EVO-17) - projectEvolutionArtifacts.ts split out of the service (file size) - tests: jobRunner.test.cjs, S6 cases in gitHistoryServices.test.cjs; CHANGELOG, feature docs; ESLint budget 155 -> 154 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FkKtAtQus8TVjhG9bhytC
…ad-kvvyg6-job-runner
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FkKtAtQus8TVjhG9bhytC
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.
Requested by Adrián · project thread
Closes #78 (epic #72, S6). Findings: EVO-2, EVO-3, EVO-4, EVO-17, HIST-7, HIST-9, DEPGRAPH-9, LAUNCHER-11.
What changes
Shared
JobRunner(core/analysis/launch/jobRunner.ts) replacesSingleJobGatefor historical comparison, project evolution and the dependency graph. A job has:How it behaves:
execFilewithsignal) kill their child on Windows, macOS and Linux alike.Atomic start. Bridges call
reserve*()synchronously, beforereconcileSession. A "busy" answer goes to the requester only. The reservation is released if the preparation fails. The historical live-refresh flag is set only after success. This covers both the room messages and the LivePanel REST compare.Cancel is not Clear.
project-evolution-cancelandhistorical-comparison-cancel, answered with*-cancelled.cancelAndWait()first.Watchdogs. Each revision's analysis gets 5 min: a hung revision is killed and excluded from the movie. Each Git command gets 3 min and reports
git-command-timeoutorgit-command-cancelled. A killed analysis is never recorded as a deterministic exclusion, which used to hide the commit from both pickers.Late joiners. References replies carry the job state, so a client that joins mid-job renders it as running.
Export worker pool (EVO-17).
projectEvolutionArtifacts.tsis split out of the service to keep it under 500 lines.Docs and changelog: CHANGELOG
[1.2.1]Fixed;PROJECT_EVOLUTION_XR.mdandHISTORICAL_COMPARISON_XR.mdupdated.Verification
npm test: 1,135 of 1,135 pass,tscclean, ESLint 0 errors and 154 warnings (budget lowered from 155 to 154). The guardrail baseline was regenerated: functions over 80 lines 35→34, complexity over 10 51→50.test/analysis/jobRunner.test.cjs(8 tests): reservation, states, release, cancel reaching the async-context signal, deadline, late result discarded, grace release,withTimeout.gitHistoryServices.test.cjs, run against a real Git repository with a stub analyzer that "dies" on abort like the real spawner:revision-2is written;test:project-evolution-harness,test:xr-mode-harness,test:xr-harness.Needs a manual check: the kill path with a real Python child. In tests it is covered by the stub; with real Python it relies on the S5
executePythonkill-on-abort.Not in scope: HIST-10 (stale "Loading comparison datasets..." status) and the dependency dataset revisions piling up (second half of DEPGRAPH-9).
Generated by Claude Code