Skip to content

Milestone 3 slice 3: daily evaluation drafts with contributor history #28

Closed

Description

@TusanHomichi

Problem or outcome

Third slice of Milestone 3 per the settled design in #22 and ADR 0008, on the session substrate merged in #26. Delivers EvaluationRecord as a collaborative daily draft: one mutable working copy documenting a training session, typed by the pinned form, with metadata-only contributor attribution from the first keystroke — so collaborative documentation never has an unattributed era.

Scope

In scope:

  • evaluation_record: the continuing identity — enrollment, stamped program version (the session's stamp; form checked by composite foreign key against it), the pinned daily_report form, and a current owner; sessions attached through a join table whose session must share the record's enrollment and stamped version
  • one daily draft per training session as v1 policy in the service (typed refusal), deliberately not schema — multi-session and per-business-date coverage stay open per ADR 0008
  • contributor_event: append-only metadata attribution — created, contributed, ownership transferred, submitted for review, review decided (schema carries the full closed set; this slice writes the first four) — with UPDATE and DELETE refused by the database; consecutive saves by the same contributor coalesce into one contributed event per working stretch
  • mutable working copy: one rating per form competency (validated against the pinned scale kind: anchored bounds, pass/fail, narrative-only takes no value), optional rating modifiers from the pinned vocabulary, one text per form narrative
  • ownership transfer is event-mediated: the database accepts the owner update only when the latest contributor event records exactly that transfer; the new owner is notified (0003 notices)
  • submission: full content snapshot (draft_snapshot, append-only; the change_request_return reason is in schema for slice 4) and a submitted draft is frozen — service refusal plus a database backstop while the latest event is submitted-for-review
  • gates per Milestone 3 design: sessions, drafts, and attribution (owner decisions needed) #22 decision 2: contributing takes author_evaluation plus an active assignment or session membership (coordinators with assign_training manage everything); reads mirror session reads
  • audit events for creation, transfer, and submission; contributed saves stay in the contributor stream, not the audit log
  • web: a draft workspace page — form rendered from the pinned vocabulary, debounced autosave, contributor history, transfer and submit controls — entered from the enrollment sessions panel and from "My sessions"

Out of scope:

  • review decisions and the change-request return path (slice 4), weekly summaries and finalization (Milestone 4), rating/narrative completeness rules (Milestone 4 completion rules), attachments, corrections to submitted content (slice 4 returns it; Milestone 4 owns post-finalization correction)

Acceptance criteria

  • an authorized trainer can create the draft for a session, and a second draft for the same session is refused as policy with a typed refusal
  • content saves validate against the pinned scale kinds and vocabulary ids; a foreign version's form, competency, scale, or modifier is refused
  • every contributor appears in the attribution stream exactly once per working stretch; interleaved contributors produce separate events; the stream refuses UPDATE and DELETE at the database
  • ownership transfer requires the mediating event (raw owner update refused), notifies the recipient, and only eligible authors may receive
  • submission snapshots the full content and freezes the draft at the service and the database
  • draft reads and writes are refused without the documented capability-plus-scope combinations, including for unassigned non-members
  • all repository gates green

Expected proof

  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace
  • database tests: append-only contributor stream, event-mediated owner update, frozen submitted content, join-table version/enrollment agreement
  • service tests: one-per-session policy, scale-kind validation per kind, coalescing, gates
  • npm run check, npm run build, npm run e2e in web/ — the e2e drives create → collaborate (two contributors) → transfer → submit in a real browser

Related roadmap, decisions, or issues

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