Skip to content

Harden hosted siftd runtime and deployment baseline#1

Merged
t3chn merged 3 commits intomainfrom
codex/hosted-retention
Mar 8, 2026
Merged

Harden hosted siftd runtime and deployment baseline#1
t3chn merged 3 commits intomainfrom
codex/hosted-retention

Conversation

@t3chn
Copy link
Copy Markdown
Contributor

@t3chn t3chn commented Mar 8, 2026

Summary

  • add configurable hosted retention window to siftd with a 30-day default
  • apply retention in the shared sync runtime and remove orphaned events in both Postgres and SQLite stores
  • add regression coverage for retention and standalone store cleanup behavior
  • add single-node deployment assets for siftd: systemd unit, environment template, and operator runbook

Issue ID

  • N/A

Test Plan

  • go test ./...
  • jq . project.manifest.json >/dev/null
  • git diff --check

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 23eae9f8e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +203 to +207
if opts.RetentionWindow > 0 {
cutoff := now().Add(-opts.RetentionWindow)
if err := store.ApplyRetention(ctx, cutoff); err != nil {
return Summary{}, err
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make retention and event rebuild atomic

Applying retention in a separate committed transaction before rebuilding events can leave canonical state inconsistent when any later step fails (for example ListArticlesForClustering/ReplaceEvents returning an error). In that case, old articles/event_articles are already deleted but events is still the previous snapshot, so hosted reads can continue serving out-of-retention events and event payloads whose supporting article rows no longer exist until a later successful sync. This regression was introduced by the new store.ApplyRetention call path and is likely to violate the intended retention/provenance guarantees under transient DB failures.

Useful? React with 👍 / 👎.

@t3chn t3chn changed the title Add hosted retention window Harden hosted siftd runtime and deployment baseline Mar 8, 2026
@t3chn t3chn merged commit f9cc487 into main Mar 8, 2026
2 checks passed
@t3chn t3chn deleted the codex/hosted-retention branch March 8, 2026 17:01
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