# Trigger package boundaries

`internal/trigger` owns trigger definition management, scheduler dispatch, run persistence, and provider-event integration. Keep refactors semantic-preserving unless the canonical trigger specs require behavior changes.

## Management files

- `manage.go` owns management DTOs, owner-scoped list/detail/run reads, validation views, and shared request error helpers.
- `manage_mutation.go` owns owner-scoped definition lifecycle mutations: create, update, pause, resume, delete, mutation normalization, next-occurrence storage decisions, and relative one-shot schedule materialization.
- `manage_definition_persistence.go` owns definition write persistence helpers that serialize owner snapshots and persist mutable definition columns.
- `manage_target.go` owns management target resolution and target-kind inference for stored scope refs.

Management queries must stay bounded by explicit owner/workspace/trigger IDs or by the documented list limit. Do not add workspace-wide hydration or read-path cleanup to list/detail/mutation paths.

File placement is a maintainability convention, not runtime behavior.
Executable tests should protect trigger ownership, validation, occurrence
calculation, and bounded queries rather than pinning functions to filenames.
