Freeze ended weeks into the Supply archive and serve the archive API (Feature 17) #135

2 Commits
Author SHA1 Message Date
dev_agentandClaude Opus 5.5 292f91707e Make Freeze wait for in-flight Supply run title writes (Feature 17)
CI / ci (push) Successful in 5m45s
CI / ci (pull_request) Successful in 5m16s
The archive_title single-flight in the harness ended before a title job
stored its title, so a freeze in that gap ran a second model call and,
when it failed, froze the list untitled while the job's title was then
rejected. A title job now holds the service's titling lock shared from
reading the list to storing its title, and Freeze holds it exclusively
from reading the list to freezing it: a freeze waits for in-flight
titles to be stored or fail, and no title job calls the model while a
freeze runs. Adds controlled tests for both start orders, each paused
after archive_title returns and before its title is stored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 07:46:48 -04:00
dev_agentandClaude Opus 5.5 6da5643f49 Freeze ended weeks into the Supply archive and serve the archive API (Feature 17)
CI / ci (push) Successful in 5m4s
CI / ci (pull_request) Successful in 4m55s
shopping.Freeze(weekStart) archives a week's Supply run once its week has
ended in the household's time zone, setting status archived and frozen_at;
it is idempotent, and a week not yet ended (ErrWeekNotEnded) or with no
list (ErrListNotFound) is an explicit error. A list still untitled is
titled first with archive_title and the same conditional write the
title_supply_run job uses; a failed title is logged and the list is
frozen untitled, keeping its week label.

GET /api/v1/shopping/archive?by=week|month|year returns the Supply runs
up to the household's current week, newest first, grouped by the
Monday's ISO week, month or year, each post with its week label, title or
null, dinner, item and on-hand counts, dinner names and current flag. Any
other by is 400 invalid_request. Frozen lists stay readable through
GET /shopping/{weekStart} and reject item PATCHes with 409 archived.

Maestro task 7ac36526-cb51-4dc7-bbad-6ebbee481942.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 07:10:06 -04:00