Skip to content

bug(harness): AllEventTypes() omits the three plan.approval_* events that plan_mode emits #1393

Description

@dennisonbertram

Work type

Bug / regression

Observed behavior

AllEventTypes() in internal/harness/events.go:392 omits plan.approval_required, plan.approval_granted, and plan.approval_denied, which plan_mode.go emits (verified live: a plan-mode run streams all three). Anything that treats AllEventTypes() as the canonical list (event catalog generation, schema validation, TUI/macapp event allowlists if any) misses them. Found while regenerating docs/design/event-catalog.md for #1379.

Expected behavior

AllEventTypes() returns every EventType constant; a test enforces that the list and the constants stay in sync.

Reproduction

awk '/func AllEventTypes/,/^}/' internal/harness/events.go | grep -c PlanApproval → 0; grep -c EventPlanApproval internal/harness/events.go → 3.

User and operational impact

Consumers relying on the list silently drop three plan-mode events; documentation generated from it is incomplete.

Suspected seam and search evidence

internal/harness/events.go list vs constants; searched callers of AllEventTypes (rg AllEventTypes).

Blast-radius impact map

Callers of AllEventTypes only; no wire change. Tests: add a reflection/parse-based sync test in internal/harness.

Regression test first

Named below per item; red command go test <pkg> -run <Test>.

Fix boundaries

In scope: the single seam named. Out of scope: any wire or schema change.

Diagnostic and observability evidence

Grep evidence cited above.

Verification plan

Red/green; go test <pkg> -race; full regression script.

Rollout and rollback

None — no persisted or deployed behavior changes beyond populating an existing column / list; revert PR.

Documentation and handoff

Engineering log entry.

Definition of done

  • Red test preserved and green
  • Regression green

Process acknowledgement

  • I will preserve the failing regression test, update the issue if the root cause changes, and record any newly discovered bug as its own issue.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcorrectnessCorrectness bugs and logic errors

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions