Skip to content

feat(reconcile): schedule incremental passes - #91

Merged
tbhb-agent merged 1 commit into
mainfrom
agent/gm-rec-f2-codex
Nov 23, 2026
Merged

tbhb-agent merged 1 commit into
mainfrom
agent/gm-rec-f2-codex

Conversation

@tbhb-agent

Copy link
Copy Markdown
Collaborator

Why

The reconciler pass from #90 has no caller. This change adds a loop that runs it at startup and every 15 minutes, with self-metrics and a log line per pass. It also adds the recorder test that debt row D-89a asked for.

Behavior change

reconcile.Loop runs one pass at startup and then on a 15-minute ticker. A busy pass drops ticks, so passes never overlap. Each pass gets a 14-minute deadline. An error from the pass function ends the loop and returns to the caller. Cancelling the context stops the loop after the running pass.

Each pass records four metrics with no repository attribute: runs, duration, repairs, and last success time. It also writes one info log line with counts only.

A later change wires Loop into the service.

Decisions

The loop takes a pass function and a clock that supplies the ticker, so tests control time and the loop doesn't depend on the signature of Run.

The repairs metric counts merges only. Ended counts arrive with the first-end read.

Deviations from the task

The task asked for a requests counter. RunResult has no field for a request error count, so this change leaves it out.

Needs human judgment

None.

Risk

The change adds code that no binary calls, so it can't alter running behavior. The recorder test only adds coverage.

Verification

bazelisk test //... passes 33 tests, with one skipped. The lint target passes. The size check shows 368 of 400 code lines.

Human steering

None.

Opened-by: LLM effort=medium;harness=claude-code:2.1.330;model=anthropic:claude-sonnet-5-5;session=sha-256-64:6507fa80a17e0653;surface=cli
Generated-by: LLM effort=high;harness=codex:0.171.0;model=openai:gpt-6.2-sol;session=sha-256-64:0041532240a38cf8;surface=exec
Assisted-by: LLM effort=medium;harness=claude-code:2.1.330;model=anthropic:claude-sonnet-5-5;session=sha-256-64:6507fa80a17e0653;surface=cli

Generated-by: LLM effort=high;harness=codex:0.171.0;model=openai:gpt-6.2-sol;session=sha-256-64:0041532240a38cf8;surface=exec
@tbhb-agent
tbhb-agent merged commit 3b68843 into main Nov 23, 2026
8 checks passed
@tbhb-agent
tbhb-agent deleted the agent/gm-rec-f2-codex branch November 23, 2026 12:07
tbhb-agent added a commit that referenced this pull request Nov 23, 2026
Why
Main failed its lint check at 5348ca7.
#91 built a `RunResult` literal in its loop test.
#92 then added five fields to that type. Each PR
passed alone, and the merged result broke the `exhaustruct` lint rule at
`internal/reconcile/loop_test.go:137`.

Behavior change
None. The change only lists the five new fields, each set to zero, in
one test literal.

Decisions
The fields stay at zero, which matches what the test built before. The
test reads only the merge counts and the result.

Deviations from the task
None.

Needs human judgment
None.

Risk
The change touches one test line and no production code.

Verification
`bazelisk test //:golangci_lint_test //internal/reconcile/...` passes
both targets locally.

Human steering
None.

Generated-by: LLM effort=medium;harness=claude-code:2.1.330;model=anthropic:claude-sonnet-5-5;session=sha-256-64:6507fa80a17e0653;started_at=2026-11-15T17:24:44Z;surface=cli
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