Skip to content

Milestone 3 design: sessions, drafts, and attribution (owner decisions needed) #22

Closed

Description

@TusanHomichi

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, and view_assigned_records to the implemented vocabulary, with Trainer and Coordinator bundles (view_own_records and acknowledge_own_record wait for Milestone 4's trainee-facing timeline), plus the mutable profile fields (employee identifier, title) that Milestone 4 snapshots will present. A training_assignment connects 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_event stream (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_event is 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_session carries 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_record is 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_event is append-only with the same database enforcement as audit_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

  1. 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.
  2. 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_evaluation can be added to a session ad hoc (holdover and coverage are real), with the addition audited. Strict assignment-only gating punishes real staffing.
  3. Review depth in v1: single-step capability-gated review — any review_evaluation holder 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.
  4. 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.
  5. 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

Activity

  1. TusanHomichi commented on Aug 28, 2026

    @TusanHomichi
    MemberAuthor

    Owner direction from the working session: all five recommendations are adopted as decided.

    1. Draft history depth: metadata-only contributor events, plus a full content snapshot at exactly two workflow points — submission and change-request return.
    2. Draft access: both grants — durable trainer-to-enrollment assignment for ongoing access, session trainer membership for that session's records; ad-hoc audited addition of an author_evaluation holder to a session is allowed.
    3. Review depth: single-step capability-gated review, no self-review; configured chains deferred behind demonstrated need plus their own ADR; whether review is required before finalization becomes Milestone 4 completion-rule configuration.
    4. Backdated phase transitions: allowed — effective instant distinct from recorded instant, both kept, ordering by effective, gated on assign_training.
    5. Daily draft coverage: one daily draft per training session in v1; the session join table leaves multi-session or per-business-date coverage open as later policy, not schema.

    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

  2. TusanHomichi commented on Aug 30, 2026

    @TusanHomichi
    MemberAuthor

    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

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