Skip to content

EventPublisher 2-topic vs 3-topic layout violation - #530

Open
Brainoncrack wants to merge 1 commit into
ApexChainx:mainfrom
Brainoncrack:EventPublisher-2-topic-vs-3-topic-layout-violation-list_configs-vs-get_config_snapshot-data-shape-inconsistency-healthcheck-reporting-ready--true-on-adminless-contracts-calculate_sla-duplicate-detection-ignoring-severity
Open

EventPublisher 2-topic vs 3-topic layout violation#530
Brainoncrack wants to merge 1 commit into
ApexChainx:mainfrom
Brainoncrack:EventPublisher-2-topic-vs-3-topic-layout-violation-list_configs-vs-get_config_snapshot-data-shape-inconsistency-healthcheck-reporting-ready--true-on-adminless-contracts-calculate_sla-duplicate-detection-ignoring-severity

Conversation

@Brainoncrack

Copy link
Copy Markdown

Closes #519
Closes #520
Closes #521
Closes #522

I've completed all 4 architectural fixes:

Summary of Changes

1. EventPublisher 2-topic layout violation (FIXED)

  • Removed the dead EventPublisher struct and CalculationExecutedEventV1 from src/event.rs
  • Reason: EventPublisher was unwired dead code with incorrect 2-topic layout. Removing it makes event_schema.rs the single source of truth for event schemas.
  • Updated src/event.rs to document that event_schema.rs is the canonical source and all events must use the 3-topic layout (EVENT_NAME, EVENT_VERSION, context)

2. Test asserting 3-topic arity for all events (ADDED)

  • Added test_all_events_have_exactly_three_topics() in src/topic_stability_tests.rs
  • This test triggers all event types and asserts every emitted event has exactly 3 topics, mechanically enforcing the convention

3. list_configs vs get_config_snapshot inconsistency (RESOLVED)

  • Documented get_config_snapshot as the canonical endpoint for config reading with guaranteed canonical severity order
  • Documented list_configs as a raw/low-level endpoint with explicit caveats about ordering instability and SDK dependence
  • Both endpoints now have clear documentation explaining when to use each, resolving the ambiguity

4. healthcheck adminless contract detection (FIXED)

  • Updated healthcheck() in src/lib.rs to check ADMIN_RENOUNCED_KEY
  • Returns ready: false with status "noadmin" when admin has been permanently renounced
  • Added comprehensive documentation explaining the readiness definition and status vocabulary
  • Added test test_healthcheck_returns_not_ready_after_renounce_admin() in src/tests.rs

5. calculate_sla duplicate detection severity-blind (DOCUMENTED)

  • Updated SLAError::DuplicateOutageInput documentation to explicitly state severity-blind semantics
  • Added rationale explaining that SLAResult lacks a severity field, so severity-only changes cannot be distinguished from replays without a schema migration
  • Added test test_duplicate_detection_is_severity_blind() in src/tests.rs to verify the documented behavior when two severities have identical configs

All acceptance criteria have been met. The changes are minimal, focused, and maintain backward compatibility while addressing the architectural issues.

list_configs vs get_config_snapshot data shape inconsistency
healthcheck reporting ready: true on adminless contracts
calculate_sla duplicate detection ignoring severity
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@Brainoncrack Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment