Skip to content

Batch-60: Router docs, perf, TTL, and event naming fixes - #2

Open
thelux134 wants to merge 1 commit into
mainfrom
batch-60-features
Open

thelux134 wants to merge 1 commit into
mainfrom
batch-60-features

Conversation

@thelux134

Copy link
Copy Markdown
Owner

Summary

  • Add comprehensive documentation for grant_role_batch parameters, fail_fast semantics, and BatchResult return structure
  • Optimize transfer_role_membership by checking blacklist before storage mutations
  • Protect router-middleware instance storage from archival by adding extend_instance_ttl calls
  • Complete EVENT_NAMING_CONVENTION.md documentation for all 20 router-core events

Issues Closed

Closes Maki-Zeninn#1268
Closes Maki-Zeninn#1267
Closes Maki-Zeninn#1269
Closes Maki-Zeninn#1270

…eturn type

Documented fail_fast parameter behavior (stop vs continue on error), BatchResult return structure distinguishing between fatal authorization errors (Err) and per-account failures (Ok with failures list). Mapped AccessError variants to BatchItemError via access_error_to_batch, explained how callers interpret storage atomicity and failure semantics.

Reorder blacklist check before deactivate_role_grant in transfer_role_membership

Moved is_blacklisted_internal check before deactivate_role_grant call for performance optimization. Blacklist check is a single cheap storage read, while deactivate_role_grant performs multiple reads and writes. On failure (blacklisted destination), invocation is reverted anyway, so reordering has no behavioral change.

Add extend_instance_ttl calls to all router-middleware state-mutating functions

Added router_common::extend_instance_ttl calls to initialize, set_global_enabled, set_rate_limit_strategy, configure_caller_rate_limit, and remove_caller_rate_limit functions. Prevents instance storage (Admin, GlobalEnabled, RateLimitConfig) from archival by extending TTL after each mutation.

Update EVENT_NAMING_CONVENTION.md to document all 20 router-core events

Updated router-core section from 5 events to complete list of 20: added missing alias_removed, alias_resolved, best_route_selected, router_paused, route_overwritten, route_paused, route_removed, route_resolve_expired, route_resolve_paused, route_scored, route_tag_added, route_tag_removed, route_ttl_extended, route_ttl_set, route_updated.

Closes Maki-Zeninn#1268
Closes Maki-Zeninn#1267
Closes Maki-Zeninn#1269
Closes Maki-Zeninn#1270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment