Skip to content

feat(reconcile): generic runner + Cycle interface#508

Merged
lex00 merged 1 commit into
mainfrom
feat/reconcile-runner
Jun 19, 2026
Merged

feat(reconcile): generic runner + Cycle interface#508
lex00 merged 1 commit into
mainfrom
feat/reconcile-runner

Conversation

@lex00

@lex00 lex00 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Completes the provider-agnostic reconcile primitive (the runner half of github-warden#20).

Previously @intentius/chant/reconcile exported the change-set model, diffCollection, and the guardrail framework — but the runner + Cycle interface were still vendored in github-warden, the exact GitHub-ism a second warden would have to copy.

Adds (to packages/core/src/reconcile.ts)

  • Cycle<TClient, TConfig, TLive, TScope> — generic over provider client, per-scope config slice, live snapshot, and caller scope.
  • RateBudget + BudgetExhaustedError and the result types (CycleResult, CycleError, DeferredWork, ReconcileResult).
  • runReconcile — the orchestration loop, generic, with diff and guardrails injected and scopes (was config.orgs) parameterized. Budget-aware + fault-tolerant, same semantics as before.

The diff/guardrail primitives stay pure/clock-free; the runner is the one I/O-driving part (through the provider's cycles).

Tests

+6 runner tests driven by a fake provider (no GitHub) — dry-run, multi-scope apply, guardrail block/override, budget-deferred, errored-cycle-continues. That's the portability proof.

tsc + eslint clean; 24 reconcile tests green. github-warden will consume this and drop its vendored runner next.

🤖 Generated with Claude Code

Lift the reconcile orchestration into the primitive: a Cycle<TClient,
TConfig, TLive, TScope> interface, RateBudget/BudgetExhaustedError, the
result types, and runReconcile — generic over provider client/config/
live/scope with diff + guardrails injected. Completes the provider-agnostic
core (github-warden#20): a second warden (gitlab/forgejo) now builds on the
shared harness instead of vendoring it. +6 runner tests with a fake
provider (no GitHub).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lex00 lex00 merged commit fa96a63 into main Jun 19, 2026
5 checks passed
@lex00 lex00 deleted the feat/reconcile-runner branch June 19, 2026 22:16
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