Skip to content

Archive sources instead of deleting ingested history#231

Merged
user1303836 merged 2 commits intomainfrom
codex/source-remove-archive
Mar 8, 2026
Merged

Archive sources instead of deleting ingested history#231
user1303836 merged 2 commits intomainfrom
codex/source-remove-archive

Conversation

@user1303836
Copy link
Owner

Summary

  • change /source remove to stop monitoring a source instead of deleting it
  • preserve existing content items and semantic-search history
  • update confirmation copy and tests to match the archived/paused behavior

Testing

  • PYTHONPATH=/Users/user1303836/Development/intelstream-codex-source-archive/src /Users/user1303836/Development/intelstream/.venv/bin/pytest tests/test_discord/test_source_management.py -q
  • /Users/user1303836/Development/intelstream/.venv/bin/ruff check src/intelstream/discord/cogs/source_management.py tests/test_discord/test_source_management.py
  • /Users/user1303836/Development/intelstream/.venv/bin/ruff format --check src/intelstream/discord/cogs/source_management.py tests/test_discord/test_source_management.py

Closes #226

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Owner Author

@user1303836 user1303836 left a comment

Choose a reason for hiding this comment

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

Review

Overall

Small, focused, well-tested. The concept is sound -- preserving content on remove is safer than permanent deletion.

Issues

  1. Inconsistent error message. The SourceNotFoundError handler still says "Source **{name}** was already removed." (line ~480 on main). This should be updated to match the new "archive" language (e.g., "was already archived" or "no longer exists").

  2. delete_source is now dead code. This was the only caller of repository.delete_source(). After this PR, nothing calls it. Worth noting -- should it be kept for future use or removed?

  3. No path to actual deletion. If a user adds a source by mistake, they can only pause it now. The embed says "This source can be resumed later with /source toggle" but there's no way to truly delete a source and its content. Is this intentional?

  4. ConfirmSourceRemoveView naming mismatch. The view class name still says "Remove" but the operation is now "archive/pause." Not blocking, but a naming inconsistency that could confuse future readers.

CI

Lint failure is pre-existing (7 unrelated files on main). Tests and type checks pass.

Verdict

Near-ready. Fix the stale error message wording, then good to merge.

@user1303836 user1303836 merged commit 304b38b into main Mar 8, 2026
4 checks passed
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.

[P2] /source remove should preserve ingested history instead of hard-deleting it

1 participant