Skip to content

Add engine queue checkpoint hooks - #23

Merged
rbtr merged 1 commit into
mainfrom
copilot/engine-state-snapshots
Jun 24, 2026
Merged

rbtr merged 1 commit into
mainfrom
copilot/engine-state-snapshots

Conversation

@rbtr

@rbtr rbtr commented Jun 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add consumer-side engine checkpoint hooks for queue snapshots
  • keep snapshot DTOs in neutral internal/checkpoint and the default bbolt implementation in internal/checkpoint/bolt
  • save pending candidates, active batch metadata, linger state, and bisection counters
  • wire SHUNT_STATE_PATH for single-repo and topic-managed queues
  • restore active batches by re-staging them before landing, avoiding stale pre-restart CI results
  • document persistence behavior and add Helm/Kubernetes knobs for mounting durable state

Ordering

This is now the generic engine state/snapshot boundary plus the default built-in local store, and should land before PR #22. It stays based on main; PR #22 is stacked behind it for external/Postgres store work.

Validation

  • go test ./internal/checkpoint ./internal/checkpoint/bolt ./internal/engine ./internal/manager ./cmd/shunt
  • make lint test build
  • helm lint charts/shunt
  • helm template shunt charts/shunt --set config.statePath=/var/lib/shunt/shunt.db --set persistence.enabled=true
  • package architecture review: no leaf package imports engine; engine owns the consumer-side store interface

@rbtr
rbtr force-pushed the copilot/engine-state-snapshots branch 4 times, most recently from f51ebc6 to a9b3c79 Compare June 24, 2026 15:38
@rbtr
rbtr force-pushed the copilot/engine-state-snapshots branch 2 times, most recently from 4586e4a to 869bdc4 Compare June 24, 2026 16:24
Comment thread internal/state/bbolt.go Resolved
@rbtr
rbtr force-pushed the copilot/engine-state-snapshots branch from 869bdc4 to 227bd78 Compare June 24, 2026 17:10
Introduce a pluggable checkpoint store boundary around engine queue state so pending candidates, active batches, linger state, and bisection counters can be saved and restored.

Add the default local bbolt checkpoint store and wire it through SHUNT_STATE_PATH for both single-repo and topic-managed queues while preserving in-memory behavior by default.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rbtr
rbtr force-pushed the copilot/engine-state-snapshots branch from 227bd78 to 6b4e868 Compare June 24, 2026 18:16
@rbtr
rbtr merged commit 93c0d4e into main Jun 24, 2026
4 checks passed
@rbtr
rbtr deleted the copilot/engine-state-snapshots branch June 24, 2026 19:47
rbtr added a commit that referenced this pull request Jun 24, 2026
## Summary
- add root-context shutdown and graceful HTTP server shutdown
- propagate context through reconcile, checkpoint, forge API, and git
staging operations
- replace freeform daemon logs with stdlib slog JSON and stable
component/repo fields
- raise the minimum Go/toolchain baseline to 1.25
- add CI race testing and pinned govulncheck coverage

## Validation
- make lint test build
- go test -race ./...
- go run golang.org/x/vuln/cmd/govulncheck@v1.4.0 ./...
- helm lint charts/shunt
- independent code review/rubber-duck pass

Stacked on PR #23.

Co-authored-by: Evan Baker <2940321+rbtr@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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