Repository navigation
Description
Problem or outcome
Milestone 2 is complete: #12 settled the configuration design, ADR 0007 encodes it, and #14/#16/#19 shipped it — enrollments now pin published program versions. Milestone 3 (roadmap: sessions and drafts) is where training work actually gets documented: users/capabilities expansion with assignment-scoped access, enrollment lifecycle and phase history, training sessions with explicit time semantics, daily evaluation drafts with contributor and ownership-transfer history, manual and automatic draft persistence, the review/change-request workflow, workflow notices, and the trainer/coordinator interface.
Design comes first again because every shape here is what Milestone 4 freezes: drafts become immutable EvaluationVersions, contributor events become the attribution the milestone exit promises ("without losing attribution"), and session time semantics become permanent record content (PRINCIPLES.md 6). Implementation should not start until the owner settles the questions below; this issue is the design work record.
Proposed shape (for reaction, not a fait accompli)
- Users, capabilities, assignments: add
author_evaluation,review_evaluation, andview_assigned_recordsto the implemented vocabulary, with Trainer and Coordinator bundles (view_own_recordsandacknowledge_own_recordwait for Milestone 4's trainee-facing timeline), plus the mutable profile fields (employee identifier, title) that Milestone 4 snapshots will present. Atraining_assignmentconnects a trainer to an enrollment with start/end instants and attribution — the durable grant behind assignment-scoped access (PRINCIPLES.md 10). Domain services evaluate actor + capability + assignment scope together (application-service invariant 1). - Enrollment lifecycle and phase history: an append-only
enrollment_eventstream (version change with actor and reason, withdraw, complete, reinstate) replaces migration 0005's "refuse silent repointing" trigger with the modeled event it promised, and re-enrollment may relax 0005's one-row-per-(user, version) uniqueness.phase_eventis the domain model's phase history stream — advance, return, restart, pause, resume, complete — validated against the pinned version's transition graph. Phase numbers stay presentation; nothing assumes monotonic progress. - Training sessions:
training_sessioncarries the enrollment, agency-local business date, IANA timezone snapshot, stored local start/end representation, UTC start/end instants (end open while in progress), one-or-more trainer membership rows, phase context, and a disposition (proposed closed set: completed, cancelled, interrupted; sessions are created open and closed explicitly). Database-enforced: UTC end cannot precede start (domain invariant 6), active intervals for one trainee cannot overlap (invariant 7), and no uniqueness assumes one session per trainee and date (invariant 8). The local representation is stored, never derived, so a timezone-database change can't rewrite history. - Drafts and attribution:
evaluation_recordis the continuing identity, typed by the pinned form's record type, with sessions attached through a join table so multi-session coverage later is data, not a schema break. The draft is one mutable working copy — ratings per form competency validated against the pinned scale kind, modifiers, narratives per form prompt.contributor_eventis append-only with the same database enforcement asaudit_event: created, contributed, ownership transferred, submitted for review, review decided. Autosave persists content; consecutive saves by the same contributor coalesce into one contributed event per working stretch, so attribution stays honest without keystroke noise. - Review workflow and notices: draft states working → in_review → approved or changes_requested → working. Review decisions are attributed rows with a required comment on changes_requested. Workflow notices reuse the 0003 notice table with new kinds (review_requested, changes_requested, approved, ownership_transferred, assignment_created) targeted at the affected user.
- Vertical slice order, mirroring Milestone 2: (1) users/capabilities/assignments plus enrollment and phase events; (2) training sessions with the time-semantics invariants; (3) drafts, contributor history, and autosave; (4) review workflow, notices, and the trainer/coordinator interface that completes the milestone. Web interface in every slice, per the architecture.
Decisions that need the owner
- Draft history depth: what does attribution preserve — metadata-only contributor events (who, when, which kind of action), or intermediate draft content too? My recommendation: metadata-only events, plus a full content snapshot at exactly two workflow points (submission and change-request return) so a review is anchored to what was actually reviewed. Every-save content history creates discoverable draft archaeology and a disposition burden with no exit-criterion payoff.
- What grants draft access: durable trainer-to-enrollment assignment, session trainer membership, or both? My recommendation: both — an assignment gives ongoing access to the trainee's work; being a session's trainer gives access to that session's records; and an unassigned trainer holding
author_evaluationcan be added to a session ad hoc (holdover and coverage are real), with the addition audited. Strict assignment-only gating punishes real staffing. - Review depth in v1: single-step capability-gated review — any
review_evaluationholder who is not a contributor to that draft, no self-review, refused and tested — or configured multi-step chains? My recommendation: single-step now; chains follow ADR 0007's pattern of demonstrated need from a real center plus their own ADR. Whether review is required before finalization becomes versioned configuration in Milestone 4's completion rules, not code. - Backdated phase transitions: paper catches up late in real centers. Allow effective-dated phase events (effective instant distinct from recorded instant, both kept, ordering by effective, gated on
assign_training), or recorded-time only? My recommendation: allow, with both instants always visible — honest backfill beats falsified contemporaneity. - Daily draft coverage in v1: one daily draft per training session (my recommendation — the join table already permits widening to multi-session or per-business-date coverage later as policy, not schema), or business-date-oriented from the start? Distinct record types (daily report, phase evaluation) may still cover the same session either way.
Explicitly not in this milestone
Task signoffs (versioned-record machinery that belongs with Milestone 4 finalization), finalization and immutable EvaluationVersions, acknowledgments, weekly summaries, the trainee-facing timeline, concurrent-active-enrollment policy limits (needs an agency-level versioned-settings concept; the event stream supports it later), and configured review chains.
Expected proof (once design is settled)
- ADR 0008 for the session, draft, and attribution model
- Migrations and domain services with database-invariant tests: interval-overlap rejection, append-only contributor events, no self-review, ratings validated against pinned scale kinds
- e2e for the milestone exit: two trainers collaboratively document an invented session — autosave, ownership transfer, review returns changes, resubmission, approval — with the full contributor history intact and attributed
Related roadmap, decisions, or issues
docs/roadmap.mdMilestone 3;docs/domain-model.mdTraining, Evaluations, Review; PRINCIPLES.md 6 and 10; ADR 0007- Builds on Milestone 2 design: versioned program configuration schema (owner decisions needed) #12, Milestone 2 slice 1: program-version schema, domain services, and export/import #14, Milestone 2 slice 2: program authoring API and web interface #16, Milestone 2 slice 3: enrollment pinning and minimal user creation #19; migration 0005's enrollment triggers are the seam this milestone replaces with modeled events
Activity
TusanHomichi commentedon Aug 28, 2026
Owner direction from the working session: all five recommendations are adopted as decided.
author_evaluationholder to a session is allowed.assign_training.ADR 0008 will encode these alongside slice 1, which is #23. This issue stays open as the milestone design record until the exit criterion is proven.
Generated by Claude Code
sessions(time): training sessions with explicit time semantics
drafts(attribution): daily evaluation drafts with contributor history
TusanHomichi commentedon Aug 30, 2026
Closing as complete, per the owner's decision (2026-08-29).
All five design decisions were settled in this issue, encoded in ADR 0008, and delivered across the four slices exactly as planned: #24 (assignments, enrollment events, phase history — honest backfill included per decision 4), #26 (training sessions with the time semantics ADR 0009 pinned), #29 (daily drafts, contributor attribution, both access grants, metadata-only history with the two snapshot points, one-draft-per-session as policy), and #31 (single-step capability-gated review with the required change-request comment).
The milestone exit criterion holds and is proven end-to-end: two invented trainers collaboratively document an invented session — saves attributed and coalesced, ownership transferred by event, submission frozen and snapshotted, review returning changes with a comment, revision, resubmission, approval — with the full contributor history intact, in a real browser (
web/e2e/drafts.spec.ts) and across the service and raw-database test suites.Follow-on records: #33 updates
docs/roadmap.md's current position and files ADR 0010 for the authorization boundary the #31 review probed; #32 opens the Milestone 4 design (defensible records), where finalization consumes this milestone's draft substrate and the content-hashing question lands at the layer where it is provable. #27 keeps the deferred-transaction retrofit; #34 keeps the stale-save usability nicety.Generated by Claude Code