Skip to content

feat(storage): add persistence for schedule_runs, alert_events, and candidate_suggestions - #55

Merged
CrisSTEM merged 1 commit into
mainfrom
feat/processing-storage
Apr 21, 2026
Merged

feat(storage): add persistence for schedule_runs, alert_events, and candidate_suggestions #55
CrisSTEM merged 1 commit into
mainfrom
feat/processing-storage

Conversation

@CrisSTEM

Copy link
Copy Markdown
Owner

Summary

Add the SQLite migration and storage-layer persistence helpers for schedule_runs, alert_events, and candidate_suggestions.

This PR covers fresh bootstrap, upgrade from the current ingestion baseline, representative persistence operations, and preservation of existing observation history across SyncPack runs.

Linked issue(s)

Milestone fit

This PR adds the storage substrate required for the v0.4.0 backend-processing baseline while keeping scheduler orchestration, alert evaluation, candidate discovery heuristics, and API/frontend read models intentionally out of scope.

It also preserves the current separation between catalog/config synchronization and persisted observation history.

What changed

  • added SQLite migration 003_processing.sql for:
    • schedule_runs
    • alert_events
    • candidate_suggestions
  • added storage helpers for:
    • schedule run lifecycle persistence
    • alert event insert/resolve flows
    • candidate suggestion upsert/status update flows
  • added deterministic tests for:
    • fresh bootstrap
    • upgrade from the v0.3.0 schema baseline
    • representative persistence operations
    • preserving persisted history across SyncPack catalog updates

Out of scope

  • scheduler execution and due-check orchestration
  • alert rule evaluation logic
  • candidate discovery heuristics
  • API or frontend read models
  • new source adapters

Validation

Mark what you actually ran:

  • python3 ./scripts/trim-whitespace.py --check
  • go vet ./...
  • go test ./...
  • make ci
  • Manual CLI verification was performed if runtime behavior changed

Documentation impact

  • No docs update needed
  • README.md
  • SPEC.md
  • docs/
  • repository governance docs (AGENTS.md, CONTRIBUTING.md)
  • CHANGELOG.md
  • release notes

Reviewer focus

Call out the highest-risk files, behaviors, or assumptions to review.

  • migrations/003_processing.sql for constraints, foreign keys, and index shape
  • internal/storage/processing.go for writer/read helper boundaries and config-context lookups
  • internal/storage/processing_test.go for upgrade-path coverage and preservation of persisted history across SyncPack

Auditability checklist

  • Branch name follows project convention
  • PR scope matches the linked issue and milestone
  • Commits were pushed progressively, not as one final dump
  • Relevant tests were added or updated for behavior changes
  • No secrets or sensitive credentials were introduced
  • Deferred follow-up work is documented explicitly
  • Unimplemented work is not implied as completed

Notes for merge

Preferred merge method:

  • Issue PRs: Rebase and merge
  • Release aggregation PRs: Merge commit
  • Use Squash and merge only when the branch became noisy and preserving intermediate commits no longer adds value

@CrisSTEM
CrisSTEM merged commit a32a37d into main Apr 21, 2026
1 check passed
@CrisSTEM
CrisSTEM deleted the feat/processing-storage branch April 21, 2026 19:10
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.

feat(storage): add persistence for schedule_runs, alert_events, and candidate_suggestions

1 participant