feature/m6plus-event-bus #509

Merged
aditya merged 6 commits from feature/m6plus-event-bus into master 2026-03-06 13:29:04 +00:00

6 Commits

Author SHA1 Message Date
aditya 3d2b138379 Merge branch 'master' into feature/m6plus-event-bus
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 23s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 1m16s
CI / unit_tests (pull_request) Successful in 2m10s
CI / docker (pull_request) Successful in 39s
CI / integration_tests (pull_request) Successful in 3m6s
CI / coverage (pull_request) Successful in 4m36s
CI / benchmark-regression (pull_request) Successful in 29m17s
2026-03-06 12:44:37 +00:00
aditya 7348ca1911 fix(events): update tests for DecisionService.record_decision API change
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 14s
CI / quality (pull_request) Successful in 16s
CI / security (pull_request) Successful in 30s
CI / typecheck (pull_request) Successful in 47s
CI / unit_tests (pull_request) Successful in 2m13s
CI / docker (pull_request) Successful in 38s
CI / integration_tests (pull_request) Successful in 3m3s
CI / coverage (pull_request) Successful in 3m58s
CI / benchmark-regression (pull_request) Successful in 24m40s
- Update event_bus_steps.py to call record_decision() with individual
  parameters (plan_id, decision_type, question, chosen_option, rationale)
  instead of passing a Decision object, matching the master branch API
- Remove ctx.test_decision construction from DecisionService setup steps
  as it is no longer needed with the new signature
- Update robot/helper_event_bus.py decision_service_emits_event() to use
  the new record_decision() parameter signature
- All 9 Robot Framework event bus tests passing
- Behave scenarios at lines 125 and 131 now passing

Fixes event bus test failures after master merge.
2026-03-03 15:42:53 +00:00
aditya 5bd7a507b8 Merge branch 'master' into feature/m6plus-event-bus
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 22s
CI / security (pull_request) Successful in 32s
CI / typecheck (pull_request) Successful in 51s
CI / unit_tests (pull_request) Failing after 3m13s
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Failing after 3m58s
CI / coverage (pull_request) Successful in 3m57s
CI / benchmark-regression (pull_request) Has been cancelled
2026-03-03 15:20:19 +00:00
aditya 89bc776381 refactor(events): address PR-509 review comments
- Fix CHANGELOG EventType count from 40 to 38 and add missing domains
  (invariant, context) for accurate documentation
- Document correlation_id field as spec extension for request traceability
  in DomainEvent model
- Add thread safety documentation to ReactiveEventBus and LoggingEventBus
  noting single-threaded design and external sync requirements
- Document _persist_audit deferral in ReactiveEventBus.emit() explaining
  audit logging via handler subscription or LoggingEventBus following
  single-responsibility principle
- Replace bare MagicMock() with create_autospec(Settings, instance=True)
  at 5 locations for type-safe test mocking
- Replace nested bare MagicMock for UnitOfWork with create_autospec at 3
  locations to prevent silent breakage on API changes

All changes maintain backward compatibility. No linter errors.
2026-03-03 15:15:55 +00:00
aditya 69efec9a65 Merge branch 'master' into feature/m6plus-event-bus
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / security (pull_request) Successful in 31s
CI / typecheck (pull_request) Successful in 32s
CI / unit_tests (pull_request) Successful in 1m45s
CI / docker (pull_request) Successful in 38s
CI / integration_tests (pull_request) Successful in 2m45s
CI / coverage (pull_request) Successful in 3m40s
CI / benchmark-regression (pull_request) Successful in 22m31s
2026-03-02 12:00:13 +00:00
aditya d17895dae2 feat(events): add EventBus protocol and ReactiveEventBus implementation
- Add EventType StrEnum with 38 typed domain event identifiers across 8
  domains (plan lifecycle, decision, actor, tool, resource, sandbox,
  validation, session, budget)
- Add frozen DomainEvent Pydantic model with event_type, auto-UTC
  timestamp, auto-ULID correlation_id, plan_id, root_plan_id,
  session_id, actor_name, project_name, and details fields
- Add @runtime_checkable EventBus Protocol with emit() and subscribe()
- Add ReactiveEventBus backed by RxPY Subject for in-process reactive
  streaming with synchronous handler dispatch and raw Observable stream
- Add LoggingEventBus using structlog for audit-trail-only environments
- Wire DecisionService to emit DECISION_CREATED on record_decision()
- Wire PlanLifecycleService to emit PLAN_CREATED and PLAN_PHASE_CHANGED
  on use_action() and execute_plan() respectively
- Register ReactiveEventBus as Singleton in DI container and inject into
  DecisionService and PlanLifecycleService providers
- Add Behave BDD unit tests: 27 scenarios, 75 steps, 100% branch coverage
- Add Robot Framework integration tests: 9 smoke cases
- Add ASV performance benchmarks: 5 suites covering emit throughput and
  subscriber fan-out
- Add reference documentation at docs/reference/event_bus.md

ISSUES CLOSED: #473
2026-03-02 11:54:53 +00:00