Repository navigation
feat(loop): cross-repo auto mode with work-source and drain-complete - #115
Merged
Merged
Conversation
- 5 tests covering disk fallback, synced repo exclusion, empty dir, missing openspec dir, and sibling discovery - Fix querySpecsync to handle specsync returning null (not []) for empty results
- Add fs.existsSync check in runAuto loop; items with missing repos are recorded as 'skipped' with cause 'repo not found' - Exclude skipped outcomes from ChangeOutcome[] (type only allows completed|quarantined) - Add test verifying a resolvable item starts a run and completes
- Add capacity() helper that probes local providers via parentCapacity, returning max(1, free) to bound concurrent item processing - Replace sequential for loop with worker pool bounded by capacity - Add runningRepos per-repo exclusivity guard (one run per repo at a time) - Add tests: 'concurrency follows the fleet' and 'one working tree, one run'
- Track haltsThisPass per pass in processItem - Accumulate consecutiveHalts across passes when no gate passes - Reset consecutiveHalts when a gate passes or a pass has no halts - Stop run with stalled status when consecutiveHalts >= 3 - Report suspected environmental cause in the run report - Add tests: one bad item among five, three identically broken items All 257 loop tests pass, typecheck clean.
- Add claimedItems set to track which items have been claimed - Claim items via claimChange before running gates - Release claims in finally block via releaseChange - Gate loop checks status at each iteration, so cancelled runs break out and release claims - Add test: cancel stops the run and releases claims All 258 loop tests pass, typecheck clean.
- Add mode === 'auto' to fenced condition - Previously auto runs were only fenced when policy was 'scoped' - Add test: authority ceiling is inherited and not widened All 259 loop tests pass, typecheck clean.
- Report generation in runAuto builds a multi-line report from outcomes - Each item listed with repo, change, and outcome (completed/HALTED/SKIPPED) - Environmental guard report also includes aggregated outcomes - Add test: aggregated report covers all items All 260 loop tests pass, typecheck clean.
- Added everFoundItems flag to track whether any items were ever found - If no items found and no outcomes exist, run ends with 'nothing found' report instead of 'drained' - Add test: distinguishes drained from found nothing All 261 loop tests pass, typecheck clean.
- Added --auto flag to opencode loop with documentation - Documents that auto is fenced with QueueDenyRules - Documents where work comes from (work source: specsync or local openspec) - runAuto already uses getWorkItems which uses the work source All 261 loop tests pass, typecheck clean.
- Added test: two-repository fixture drains to completion - Creates two fixture repos with changes, runs auto mode - Verifies both complete and report mentions both changes All 262 loop tests pass, typecheck clean.
- Added test: halt path end-to-end - Creates two fixture repos: one halts, other completes - Verifies report names both changes All 263 loop tests pass, typecheck clean.
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
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.
Adds cross-repo auto mode (runAuto) with a work-source that discovers repos under a root, per-repo gate options, capacity-bounded concurrency, an environmental guard for consecutive halts, and a claim lifecycle.
Rebased onto origin/dev (899266b). Typechecks clean in a proper environment; the worktree symlink to the main repo causes an unrelated PluginInput type error only there.