Skip to content

Milestone 3 slice 2: training sessions with explicit time semantics #25

Closed

Description

@TusanHomichi

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_trainer membership: one or more trainers per session; members must hold author_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 holding author_evaluation logs 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 e2e in web/

Related roadmap, decisions, or issues

Activity

  1. added 7 commits that reference this issue on Aug 29, 2026
    5488793
    2a0bbf8
    d03b41c
    4c52a87
    c841b6a
    92200d3
    2088b16
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions