feat(reconcile): generic runner + Cycle interface#508
Merged
Conversation
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>
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.
Completes the provider-agnostic reconcile primitive (the runner half of github-warden#20).
Previously
@intentius/chant/reconcileexported the change-set model,diffCollection, and the guardrail framework — but the runner +Cycleinterface 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+BudgetExhaustedErrorand the result types (CycleResult,CycleError,DeferredWork,ReconcileResult).runReconcile— the orchestration loop, generic, withdiffandguardrailsinjected andscopes(wasconfig.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+eslintclean; 24 reconcile tests green. github-warden will consume this and drop its vendored runner next.🤖 Generated with Claude Code