Repository navigation
Closed
Description
Problem or outcome
Second slice of Milestone 3 per the settled design in #22 and ADR 0008, on the slice-1 substrate (#23, merged in #24). Delivers TrainingSession from the domain model: an actual period of training with agency-local operational meaning and UTC ordering kept separate (PRINCIPLES.md 6), one-or-more trainer membership, phase context, and a disposition — the anchor the slice-3 evaluation drafts attach to.
Scope
In scope:
training_session: enrollment, agency-local business date, IANA timezone snapshot, stored local start/end representation (never derived), UTC start/end instants (end open while in progress), phase context from the pinned version, and a closed disposition set (completed, interrupted, cancelled; created open or recorded retroactively complete, closed explicitly)session_trainermembership: one or more trainers per session; members must holdauthor_evaluation(ad-hoc audited addition per Milestone 3 design: sessions, drafts, and attribution (owner decisions needed) #22 decision 2); at least one trainer always remains- database-enforced domain invariants: UTC end cannot precede start (6); active training intervals for one trainee cannot overlap, where an open session is unbounded, contiguous sessions are legal, and cancelled sessions do not occupy their interval (7); no uniqueness assumes one session per trainee and date (8); session phases belong to the enrollment's currently pinned version
- server-side local-time resolution: the local representation is stored verbatim as entered and UTC is computed once at entry from local + IANA timezone (embedded tzdb), with a documented DST gap/fold policy — ADR 0009
- scoped access: coordinators (
assign_training) manage everything; an assigned trainer holdingauthor_evaluationlogs sessions for their trainees; session members read and work their own sessions - web interface: sessions panel on the enrollment page (create with browser-default timezone, edit open sessions, close with disposition, member management) and a "My sessions" view for trainers
Out of scope:
- drafts and contributor history (slice 3), review workflow (slice 4), corrections to closed sessions (arrives with the record-correction machinery), weekly summaries and finalization (Milestone 4)
Acceptance criteria
- a trainer or coordinator can record a session open or retroactively complete; local representation round-trips verbatim while ordering and duration use UTC
- overlapping active intervals for one trainee are refused by the database, including against an open session; contiguous and same-date sessions remain legal; cancelled sessions release their interval
- DST gap and fold local times resolve deterministically per the documented policy, proven by tests
- session reads and writes are refused without the documented capability-plus-scope combinations
- all repository gates green
Expected proof
cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace- database-invariant tests: interval overlap (open end, contiguity, cancelled exclusion), end-before-start, phase pinned to the current version, trainer floor
- timezone resolution goldens for a DST gap and fold
npm run check,npm run build,npm run e2einweb/
Related roadmap, decisions, or issues
- Refs Milestone 3 design: sessions, drafts, and attribution (owner decisions needed) #22 (design record; stays open across slices); ADR 0008;
docs/roadmap.mdMilestone 3;docs/domain-model.mdTrainingSession; builds on Milestone 3 slice 1: capabilities, assignments, and enrollment lifecycle #23
Metadata
Metadata
Assignees
Labels
No labels
Activity
sessions(time): training sessions with explicit time semantics
sessions(edit): normalize blank ends, keep historic phases on edit
sessions(pin): stamp each session's program version at creation
sessions(members): membership identity never moves
sessions(tzdb): bundle the timezone database; order creation audits
sessions(structure): split by capability owner; freeze enrollment ide…
sessions(integrity): freeze closed sessions at the database