Rotation check: tried dinners and keep/drop decisions #116

Member

Maestro task a1887d1c-c405-478c-ac7d-8cb8b40d280d - "Rotation check: tried dinners and keep/drop decisions" (Feature 14).

Done-condition: per D-021 (owner-confirmed, never automatic), plan.MarkTried(localDate) moves every quest_log dinner that sat on a plan day dated localDate (household timezone, any plan status) to tried and records a rotation_reviews row {dinner_id, plan_date, status pending}, idempotently; GET /api/v1/rotation-reviews returns pending reviews {dinner {id, name, photo}, plan_date}; POST /api/v1/dinners/{id}/rotation-review applies keep -> regular (origin unchanged), drop -> archived with the name kept for dedupe so it is never re-suggested, not_made -> quest_log, closing the review with decided_at and updated_by, with a second decision returning 409; no code path sets regular without a keep; tests cover MarkTried idempotency, each decision, the repeat 409, and the no-automatic-promotion rule.

Also feeds rotation-dropped dinners into the suggestion dedupe inputs so a dropped dish is never re-suggested (hence the touched suggestions/household-context queries, harness context and suggest package). The scheduler (Feature 20) and the Home prompt UI (Feature 21) remain later.

Maestro task `a1887d1c-c405-478c-ac7d-8cb8b40d280d` - "Rotation check: tried dinners and keep/drop decisions" (Feature 14). Done-condition: per D-021 (owner-confirmed, never automatic), plan.MarkTried(localDate) moves every quest_log dinner that sat on a plan day dated localDate (household timezone, any plan status) to tried and records a rotation_reviews row {dinner_id, plan_date, status pending}, idempotently; GET /api/v1/rotation-reviews returns pending reviews {dinner {id, name, photo}, plan_date}; POST /api/v1/dinners/{id}/rotation-review applies keep -> regular (origin unchanged), drop -> archived with the name kept for dedupe so it is never re-suggested, not_made -> quest_log, closing the review with decided_at and updated_by, with a second decision returning 409; no code path sets regular without a keep; tests cover MarkTried idempotency, each decision, the repeat 409, and the no-automatic-promotion rule. Also feeds rotation-dropped dinners into the suggestion dedupe inputs so a dropped dish is never re-suggested (hence the touched suggestions/household-context queries, harness context and suggest package). The scheduler (Feature 20) and the Home prompt UI (Feature 21) remain later.
orchestrator-agent added 1 commit 2026-10-07 07:20:37 -04:00
Add the Rotation check: MarkTried and keep/drop decisions
CI / ci (push) Successful in 3m28s
CI / ci (pull_request) Successful in 3m7s
f97b4c7b8c
Per D-021, plan.MarkTried(date) moves every Quest log dinner planned on
a household-local date (any plan status) to tried and opens a pending
rotation_reviews row; a dinner already checked for the date is left as
it is, so it is idempotent and never re-marks a dinner returned to the
Quest log.

GET /api/v1/rotation-reviews lists the pending checks as
{dinner {id, name, photo}, plan_date}. POST
/api/v1/dinners/{id}/rotation-review {decision} applies keep (Regular,
origin kept), drop ("Not for us", archived) or not_made ("We didn't
make it", back to the Quest log), closing the check with decided_at and
the session's updated_by; a second decision is 409 no_pending_review.

A dropped dinner's name joins the passed names: ListDeclinedSuggestionNames
and ListRecentDeclinedNames become ListPassedNames and
ListRecentPassedNames, which also read Rotation checks decided drop, so
the Side quest dedupe and household context never suggest it again.

A static test guards that keep is the only path to Regular: every query
writing dinners.status and every use of the regular status is reviewed.

Maestro: a1887d1c-c405-478c-ac7d-8cb8b40d280d

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-07 07:24:44 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-07 07:32:08 -04:00
Keep a dropped dinner's name immutable and 404 a never-checked dinner
CI / ci (push) Successful in 3m37s
CI / ci (pull_request) Successful in 3m14s
cca6a82810
R-01: a Rotation check decided drop now records the dinner's name at the
decision in rotation_reviews.name (migration 0014, a table rebuild as 0012
did for suggestions; checks dropped before it take their dinner's name).
ListPassedNames and ListRecentPassedNames read that name instead of the
mutable dinners.name, so renaming the archived dinner no longer lets the
dropped dish back into a Side quest batch. A CHECK keeps a name on drops
only.

R-02: deciding on a dinner that has never had a Rotation check is now
ErrReviewNotFound, 404 not_found; a dinner whose checks are all decided,
such as a second decision, stays 409 no_pending_review.

Tests: TestLaterBatchNeverResuggestsRenamedDrop (drop, rename, next batch
still refuses the original name), TestMigrateRotationReviewName (0013 to
0014 upgrade and constraints), TestPostRotationReviewNeverChecked (404),
and TestDecideReview/TestDecideReviewRefused updated.

Maestro: a1887d1c-c405-478c-ac7d-8cb8b40d280d

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent left a comment
Member

Independent Codex gpt-6-sol review: APPROVED for this exact commit.

Independent Codex gpt-6-sol review: APPROVED for this exact commit.
approver_agent merged commit 0a47b26af6 into feature/ca2a118d-0beb-49f9-b2ef-d5ed0ac1fa2a-weekly-plan-builder 2026-10-07 07:39:23 -04:00
Sign in to join this conversation.
No Reviewers
No labels
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/MealQuest#116