Add new event queues and use Queue enum throughout codebase#67
Merged
Conversation
Added AND_ADMISSIONS, PKI_CERT_ROTATION_EVENTS, DRIFT_EVENTS, and WORLD_HEALTH (plus their DLQs) to the Queue enum and PRIMARY_QUEUES tuple. Updated phase_ands, pki_cert_rotation_worker, drift_controller, and monitoring/service to import and use Queue instead of bare strings, eliminating the runtime risk of sending to unregistered queues. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDXqTHJNBVA9aHbgyQYj2x
Added _warn_unsupported() called from all three load_spec paths to emit logger.warning for every field declared in the spec model but not yet implemented: DNSSEC, CRL, OCSP, intermediate CA, real internet mode, service mirrors, upstream resolver, cross-world federation, AND dynamic IP/reverse DNS/BGP, and mail SPF/DMARC defaults. Includes 7 tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDXqTHJNBVA9aHbgyQYj2x
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDXqTHJNBVA9aHbgyQYj2x
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDXqTHJNBVA9aHbgyQYj2x
Phase 9 had no entry in PHASE_PREREQUISITES, allowing OrgAppsPhaseHandler to run before Phase 8 (ServicesPhaseHandler) completed. Added world_services_output as a required prerequisite. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDXqTHJNBVA9aHbgyQYj2x
The worker previously built CertTypeRotationConfig at startup and never refreshed them, so live-reloading rotation_policy had no effect until restart. Added _resolve_configs() which re-reads pki.rotation_policy from state.world_spec on every loop iteration — picking up interval, warning_days, and cert_type_overrides changes immediately after a /reload. Falls back to initial configs on parse error. Added 6 tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDXqTHJNBVA9aHbgyQYj2x
…rotation-policy
Four previously missing API endpoints that allow targeted config updates
without a full spec reload:
- PUT /ands/{and_name}/profile — update AND profile and optional dns_suffix;
validates profile exists in spec before applying
- PUT /services/{name} — enable/disable world services (mail, storage) in spec
- PUT /gateway — update real_internet_mode, upstream_resolver, cross_world_mode
with enum validation on both mode fields
- PUT /pki/rotation-policy — patch any rotation policy fields; validates
interval/warning values >= 1; picked up by the rotation worker on next
iteration (reload-aware worker from prior commit)
17 tests added covering happy path, validation errors, and missing-state cases.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EDXqTHJNBVA9aHbgyQYj2x
…se SPF/DMARC warnings mail_handler._inject_dns_records referenced spec.world_registry.initial_orgs which does not exist (the field is organizations), causing SPF/DMARC/DKIM/MX records to silently never be injected for any org. Fixed both references to use the correct field name. Also removed the loader warnings claiming SPF/DMARC were unimplemented — the implementation was already present in mail_handler; the warnings were incorrect. Updated the five matching test fixtures to use the correct field name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDXqTHJNBVA9aHbgyQYj2x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds four new event queues to the system and refactors queue name references throughout the codebase to use the
Queueenum instead of hardcoded strings. This improves type safety and maintainability.Key Changes
New Queues Added:
AND_ADMISSIONS- for AND (Autonomous Network Device) admission eventsPKI_CERT_ROTATION_EVENTS- for PKI certificate rotation eventsDRIFT_EVENTS- for infrastructure drift detection eventsWORLD_HEALTH- for world health monitoring eventsQueue Enum Usage: Replaced hardcoded queue name strings with
Queueenum references in:netengine/phases/phase_ands.py- Updated 5 references to useQueue.AND_ADMISSIONSnetengine/core/drift_controller.py- Updated 1 reference to useQueue.DRIFT_EVENTSnetengine/monitoring/service.py- Updated 1 reference to useQueue.WORLD_HEALTHnetengine/workers/pki_cert_rotation_worker.py- Updated 1 reference to useQueue.PKI_CERT_ROTATION_EVENTSUpdated PRIMARY_QUEUES: Added the four new queues to the
PRIMARY_QUEUEStuple for metrics/introspection endpointsImplementation Details
https://claude.ai/code/session_01EDXqTHJNBVA9aHbgyQYj2x