feat(events): enrich PLAN_APPLIED event with changeset statistics from PlanApplyService #1300

Merged
freemo merged 1 commits from feature/m6-plan-applied-enrichment into master 2026-04-02 17:08:39 +00:00

1 Commits

Author SHA1 Message Date
freemo c3d664440f feat(events): enrich PLAN_APPLIED event with changeset statistics from PlanApplyService
CI / typecheck (pull_request) Failing after 2s
CI / security (pull_request) Failing after 1s
CI / quality (pull_request) Failing after 1s
CI / unit_tests (pull_request) Failing after 1s
CI / integration_tests (pull_request) Failing after 1s
CI / e2e_tests (pull_request) Failing after 2s
CI / build (pull_request) Failing after 1s
CI / helm (pull_request) Failing after 2s
CI / lint (pull_request) Successful in 3m20s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
Enriches the PLAN_APPLIED domain event with SEC7 audit-logging statistics
per docs/specification.md §Audit Logging (issue #716).

Changes:
- PlanLifecycleService.complete_apply() now accepts optional keyword
  arguments: files_changed, lines_added, lines_removed, resources_modified,
  apply_duration_seconds (all default to 0). These are included in the
  PLAN_APPLIED event details dict alongside the existing action_name,
  phase, and project_names fields.
- PlanApplyService.apply_with_validation_gate() computes changeset
  statistics from SpecChangeSet.summary() (files changed, resources
  modified, create/delete counts as lines added/removed) and measures
  apply duration, then passes all statistics to complete_apply() so
  the emitted PLAN_APPLIED event carries rich audit context.
- New BDD feature features/plan_applied_event_enrichment.feature with
  13 scenarios verifying both the lifecycle service enrichment and the
  apply service statistics propagation.

Closes #716
2026-04-02 09:24:00 +00:00