Skip to content

autonomousRunner split, slice F (AGT-4867): runnerMaintenance.ts and its MaintenanceHost also take maybeRunLedgerRetrosp - #966

Merged
unohee merged 1 commit into
mainfrom
goal/63-autonomousrunner-split-slice-f
Nov 21, 2026
Merged

unohee merged 1 commit into
mainfrom
goal/63-autonomousrunner-split-slice-f

Conversation

@unohee

@unohee unohee commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Milestone of an auto-claude run.

Check: (test -d node_modules || npm ci --prefer-offline --no-audit --no-fund) && npm run lint && npm run typecheck && test -f src/automation/runnerProviderConfig.ts && test -f src/automation/runnerProviderConfig.test.ts && test "$(wc -l < src/automation/autonomousRunner.ts)" -le "$(( $(git show origin/main:src/automation/autonomousRunner.ts | wc -l) - 200 ))" && node scripts/loc-check.mjs && test -z "$(git diff --name-only --diff-filter=MD origin/main...HEAD -- 'src/*.test.ts' 'src/**/*.test.ts' 'tests/*' | grep -v -e runnerProviderConfig -e runnerMaintenance)" && npx vitest run src/automation/autonomousRunner src/automation/runner src/support/web.provider src/core/service tests/locCheck

Plan: .claude/auto-plan.md (local to the run).

…s out of autonomousRunner (AGT-4867 slice F)

- runnerMaintenance.ts and its MaintenanceHost also take
  maybeRunLedgerRetrospective, completeParentIfChildrenMerged and
  reconcileStalledInProgress.
- New src/automation/runnerProviderConfig.ts takes startPeriodicReviews,
  runPeriodicReviewAcrossProjects, startOrchestrator, getAdapterSummary,
  applyProviderConfig, providerSwitchViolation and switchProvider.
- The provider host is built lazily and is safe during construction:
  - The constructor's applyProviderConfig reads only config.
  - durableRuns and the scheduler are read later, through getters.
  - Building the host reads nothing.
- Late-bound access as in the earlier slices: state through getters,
  rateLimitUntil, periodicReviewJobs and orchestratorSupervisor through
  setters, and every runner method through closures at call time. Moved
  code calls other moved code through the host.
- Public getAdapterSummary, providerSwitchViolation and switchProvider keep
  their signatures as delegators. Private same-name delegators remain for
  every name a test or start() reaches.
- Pure move. No existing test changed. New tests:
  - runnerProviderConfig.test.ts covers the host contract, construction
    safety through a Proxy host, late binding, and that a rejected switch
    leaves the role adapters and the override file unchanged.
  - runnerMaintenance.sweeps.test.ts covers the moved sweeps.
- autonomousRunner.ts goes from 2278 to 1975 lines and from 1689 to 1443
  code LOC (counted with scripts/loc-check.mjs countCodeLines). Its
  .loc-allowlist entry is removed, because a stale entry would fail
  loc-check (AGT-4513's close condition).

Assumption: the frozen runnerMaintenance.test.ts fakeHost does not type-check
against the widened MaintenanceHost. Test files are not type-checked by
tsconfig.check.json, the pre-commit tsc or vitest, so it is left unedited, as
the no-existing-test-changes rule requires.
@unohee
unohee merged commit 912e598 into main Nov 21, 2026
9 checks passed
@unohee
unohee deleted the goal/63-autonomousrunner-split-slice-f branch November 21, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant