Skip to content

Add Postgres queue state foundation - #22

Merged
rbtr merged 1 commit into
mainfrom
roadmap-postgres-state
Jun 25, 2026
Merged

rbtr merged 1 commit into
mainfrom
roadmap-postgres-state

Conversation

@rbtr

@rbtr rbtr commented Jun 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add a Postgres-backed implementation of the merged engine checkpoint boundary in internal/checkpoint/postgres
  • include an embedded Postgres migration for shunt_queue_state
  • keep bbolt checkpoint JSON compatibility pinned while using Postgres-specific JSON DTOs for snake_case JSONB
  • document Postgres as a reference external checkpoint store while bbolt remains the built-in configured store
  • refresh the live forge integration harness for the context-aware client API currently on main

Validation

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

@rbtr
rbtr force-pushed the roadmap-postgres-state branch 4 times, most recently from 8c9f882 to 71c8e16 Compare June 24, 2026 15:41
@rbtr
rbtr changed the base branch from main to copilot/engine-state-snapshots June 24, 2026 15:57
@rbtr
rbtr marked this pull request as draft June 24, 2026 16:04
@rbtr
rbtr force-pushed the copilot/engine-state-snapshots branch 4 times, most recently from 227bd78 to 6b4e868 Compare June 24, 2026 18:16
rbtr added a commit that referenced this pull request Jun 24, 2026
## 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

Co-authored-by: Evan Baker <2940321+rbtr@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Base automatically changed from copilot/engine-state-snapshots to main June 24, 2026 19:47
Add a durable queue-state package with a Postgres migration and store implementation for per-queue snapshots. Document that runtime engine checkpoint/resume wiring remains pending.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rbtr
rbtr marked this pull request as ready for review June 24, 2026 20:39
@rbtr
rbtr force-pushed the roadmap-postgres-state branch from 71c8e16 to ea1a44b Compare June 24, 2026 20:39
@rbtr
rbtr merged commit 09e9565 into main Jun 25, 2026
4 checks passed
@rbtr
rbtr deleted the roadmap-postgres-state branch June 25, 2026 04:51
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