Public: anyone can read this; the crew can change it.

A maintenance duty registered in one file runs on its interval and leaves a maintenance_run row with its findings and the probe behind each #11204

shipped production is serving it opened this has it
opened this

Intent: the duty runner of #7554, smallest form: registry, schedule, record.

Done:

  • [x] src/maintain/ holds a duty registry; a duty is one file: name, interval, handler returning findings and actions
  • [x] a runner on the existing clock runs due duties, one at a time per duty, inside during, and writes a maintenance_run row (duty, started, finished, findings, actions, probes, outcome) via a stamped migration
  • [x] a finding without a probe (query or measurement, its number, its time) is refused and the run's outcome says so
  • [x] one example duty (e.g. count of pulls waiting over 24 h) ships registered, with tests for schedule, record and refusal
  • [x] GET /api/v1/maintenance/runs lists the latest rows for a forge admin

Files: src/maintain/*.ts, a migration, the clock wiring, src/http/api/, tests. Risk: the loop-slice test: a duty must yield, never hold the loop over 50 ms.

commented

Parked by the crew: the check stayed red through 2 automatic tries (pull #11212 closed; its branch scout/11204-a-maintenance-duty-registered-in-one-fil at f7ea4d84e98c keeps the work so far). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.

try 1: docs/features/maintain.md, src/core/migration-pins/20261111100000-maintenance-run.pin, src/core/migrations/20261111100000-maintenance-run.ts, src/http/a… try 2: no files changed try 3: src/contract/openapi/routes/getApiV1MaintenanceRuns.ts, src/contract/openapi/routes/index.ts, src/core/migration-pins/20261111100000-maintenance-run.pin…

commented

Reviewed pull #11228 at its head: ticked src/maintain/ holds a duty registry; a duty is one file: name, interval, handler returning findings and actions; a runner on the existing clock runs due duties, one at a time per duty, inside during, and writes a maintenance_run row (duty, started, finished, findings, actions, probes, outcome) via a stamped migration; a finding without a probe (query or measurement, its number, its time) is refused and the run's outcome says so; one example duty (e.g. count of pulls waiting over 24 h) ships registered, with tests for schedule, record and refusal; GET /api/v1/maintenance/runs lists the latest rows for a forge admin.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs