Skip to content

fix: correct RCH topic subscriptions and diagnostics - #234

Merged
brothercorvo merged 3 commits into
mainfrom
codex/rch-topic-technical-corrections
Aug 7, 2026
Merged

fix: correct RCH topic subscriptions and diagnostics#234
brothercorvo merged 3 commits into
mainfrom
codex/rch-topic-technical-corrections

Conversation

@brothercorvo

Copy link
Copy Markdown
Member

Summary

  • Make the Rust topic subscriber map authoritative and validate normalized topic/subscriber invariants during snapshot restore.
  • Add the v3 additive SQLite topic/subscriber index migration and cascade subscriber cleanup when topics are deleted.
  • Route identity updates through the SDK import/activate/announce contract, preserve SDK errors, and expose topic/subscriber runtime diagnostics.
  • Preserve the existing /Topic, /Subscriber, Python-shaped fields, snapshot, MessagePack, fan-out, and UI-facing contracts.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace (all executed tests passed; one existing external-mesh test ignored)

UI files were not changed, so UI checks were not required.

@brothercorvo
brothercorvo marked this pull request as ready for review August 6, 2026 15:03
@brothercorvo

Copy link
Copy Markdown
Member Author

@codex review

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

Copy link
Copy Markdown

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: 38ca474a72

ℹ️ 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 thread crates/r3akt-rch-core/src/lib.rs Outdated
Comment on lines +4136 to +4139
if !self.topics.contains_key(topic_id) {
return Err(RchCoreError::InvalidPayload(format!(
"subscriber invariant violation: topic '{topic_id}' is missing"
)));

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 Allow compatibility subscribers without topics

When /Subscriber or /Subscriber/Add creates a record with an omitted or unknown TopicID—which create_subscriber_record still permits via unwrap_or_default() without checking state.topics—the subscriber is persisted and later included by load_r3akt_read_snapshot; this new rejection then makes with_r3akt_core and full-snapshot r3akt_command requests return 500. The same failure affects pre-v3 databases containing orphan subscribers left by the previous topic-deletion behavior. Repair or exclude these compatibility rows during migration/snapshot construction, or validate them at the northbound route before enforcing this invariant.

AGENTS.md reference: AGENTS.md:L132-L137

Useful? React with 👍 / 👎.

@brothercorvo
brothercorvo merged commit 72f444e into main Aug 7, 2026
3 of 10 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.

1 participant