Ownership and Invariants
Ownership Matrix
| Concern | Manager | Hooks | Module |
|---|---|---|---|
| Trim range state authority | Owns | Reads/projects | Reads/renders |
| Range validation rules | Owns | Must not redefine | Must not redefine |
| Playback end-boundary sync | Owns | Bridges | Triggers via user actions only |
| React lifecycle | Must not depend | Owns bridge lifecycle | Owns component lifecycle |
| UI rendering and layout | Must not own | Must not own | Owns |
| Backend trim workflow (v1.1) | Must not own | Mock-only in useTrimSubmission |
Owns invocation wiring |
Invariants
⚠️ Warning
These are non-negotiable capability rules.
- Manager remains source of truth for trim state.
- Manager stores and computes time in seconds only.
- Validation must prevent illegal ranges (
startTime < endTime, within duration). - Invalid transitions do not corrupt state; prior valid state remains active.
- Playback sync triggers pause + seek-to-start when end boundary is reached.
- Hooks and module never directly mutate internal manager state.
Explicit Boundaries
Forbidden:
- Manager importing React/Next runtime concerns
- Hooks duplicating validation or range engine logic
- Module becoming a second state authority
Allowed:
- Module issues intent actions through hooks
- Hooks forward actions to manager and project state back to UI
- Adapter translates player implementation into contract
Alignment Reference
The ownership model is aligned with:
- ADR-028: Video Trimmer Architecture