Skip to content

Milestone 3 slice 4: single-step review workflow for daily drafts #30

Closed

Description

@TusanHomichi

Problem or outcome

Fourth and final slice of Milestone 3 per the settled design in #22 and ADR 0008, on the draft substrate merged in #29. Delivers the review workflow: a submitted draft is decided by a qualified reviewer — approved, returned with change requests, or returned plain — completing the milestone exit: trainers document an invented session collaboratively without losing attribution, and the documentation moves through review.

Scope

In scope:

  • review_decision: the decision record — reviewer, decision from the closed set (approved, changes_requested, returned), comment (required for change requests, held by a CHECK), decided instant; append-only at the database; a decision row is accepted only while the record's latest contributor event is submitted-for-review, and the database also refuses a reviewer who appears in the record's attribution
  • single-step, capability-gated review (ADR 0008): any review_evaluation holder who is not a contributor decides; self-review refused — a contributor is the current owner, an actor of created/contributed/submitted events, or an ownership recipient (a coordinator who only moved ownership between others stays eligible); a reviewer who requested changes earlier remains eligible for the resubmission
  • decision effects, derived from the stream plus the latest decision (never stored beside them): approved keeps the working copy frozen — it awaits Milestone 4 finalization; changes_requested takes the second snapshot (change_request_return, per ADR 0008's two snapshot points) and reopens the copy; returned reopens without a snapshot; resubmission repeats the submission contract (snapshot, freeze, viewed revision)
  • migration 0009 reworks the 0008 freeze triggers onto the derived frozen state (submitted or approved ⇒ frozen; the 0006 drop-and-recreate precedent), keeping the database backstop exact through the new states
  • the review_decided contributor event (the kind slice 3 reserved) pairs with each decision; creation, and every decision, audited (draft_review_decided)
  • workflow notices (0003 table): submission notifies review_evaluation holders except the submitter; each decision notifies the owner (draft_approved, draft_changes_requested, draft_returned)
  • reads: review_evaluation holders read records that have been submitted at least once; a review queue read lists currently submitted drafts with the caller's eligibility
  • web: a Review queue card on home for reviewers; a decision panel on the draft workspace (approve / request changes with required comment / return) shown exactly when the caller may decide; decisions with comments presented in the workspace; reopened drafts editable with the change request visible; approved drafts frozen with their status shown; resubmission from the reopened state

Out of scope:

  • configured multi-step review chains (ADR 0008 rejected for v1), whether review is required before finalization (Milestone 4 completion rules, versioned configuration), weekly summaries, finalization, acknowledgments, amendments (Milestone 4)

Acceptance criteria

  • a qualified non-contributor reviewer can approve, request changes (comment required, refused typed without one), or return a submitted draft; deciding an unsubmitted draft is refused
  • self-review is refused for the owner, authors, the submitter, and ownership recipients — at the service and the database — while an uninvolved coordinator may decide
  • approval keeps the draft frozen at the service and the database; a change request snapshots the reviewed content with reason change_request_return and reopens the copy; plain return reopens without a snapshot
  • the reopened draft edits and resubmits under the same revision contract, and the earlier reviewer may decide the resubmission
  • the decision stream is append-only, decision rows are refused on unsubmitted records, and every decision appears in the attribution stream and the audit log
  • submission and decisions produce the documented notices to the affected users
  • all repository gates green

Expected proof

  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace
  • database tests: append-only decisions, submitted-only decision inserts, self-review backstop, frozen-when-approved and thawed-when-returned raw refusals
  • service tests: eligibility matrix, comment requirement, full submit → changes → edit → resubmit → approve cycle, notices, queue gating
  • npm run check, npm run build, npm run e2e in web/ — the e2e drives request-changes → revise → resubmit → approve 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