Reconcile loop skeleton #21

Closed
opened 2026-08-22 18:22:39 +01:00 by naps62-yolo · 1 comment
Owner

DESIGN.md §8. There is no job queue — the database rows are the work list, and
every tick compares desired state to actual state and acts on the gap.

  • Idempotent by construction. Killing the process mid-operation and restarting
    must converge, and there should be a test that does exactly that.
  • Staggered ticks: reconcile 30 s, RSS 10 min, metadata daily, reaper 5 min.
  • Transient state in memory, rebuilt from Transmission on startup.
  • Structured logging per tick: what gap was found, what action was taken. This
    is the only debugging surface when something silently does not download.

This issue is the loop and its scheduling. The individual actions are separate
issues that register into it.

Acceptance: a test that runs several ticks against a seeded database with a
faked Transmission and asserts convergence and idempotence.


Depends on: #4, #7, #3

Labels: phase/4-movies, area/daemon, difficulty/hard, type/feature

`DESIGN.md` §8. There is no job queue — the database rows are the work list, and every tick compares desired state to actual state and acts on the gap. - Idempotent by construction. Killing the process mid-operation and restarting must converge, and there should be a test that does exactly that. - Staggered ticks: reconcile 30 s, RSS 10 min, metadata daily, reaper 5 min. - Transient state in memory, rebuilt from Transmission on startup. - Structured logging per tick: what gap was found, what action was taken. This is the only debugging surface when something silently does not download. This issue is the loop and its scheduling. The individual actions are separate issues that register into it. Acceptance: a test that runs several ticks against a seeded database with a faked Transmission and asserts convergence and idempotence. --- **Depends on:** #4, #7, #3 Labels: `phase/4-movies`, `area/daemon`, `difficulty/hard`, `type/feature`
naps62-yolo added the area/daemondifficulty/hardphase/4-moviestype/feature labels 2026-08-22 18:22:39 +01:00
naps62-yolo self-assigned this 2026-08-22 21:19:32 +01:00
Author
Owner

Adds a registrable reconcile scheduler in arr-daemon with four independent cadences and an immediate startup reconciliation. Actions receive the database directly and return structured gap/action outcomes; concrete grab, import, RSS, metadata, and reaper behavior remains in their own issues.

The test will seed persistent rows, simulate an external Transmission side effect followed by a crash, rebuild the loop, and verify convergence without a duplicate torrent.

Adds a registrable reconcile scheduler in `arr-daemon` with four independent cadences and an immediate startup reconciliation. Actions receive the database directly and return structured gap/action outcomes; concrete grab, import, RSS, metadata, and reaper behavior remains in their own issues. The test will seed persistent rows, simulate an external Transmission side effect followed by a crash, rebuild the loop, and verify convergence without a duplicate torrent.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yolo/arr#21