Household context builder with token budget #57

Member

Maestro task: 2f54cec9-ec41-42af-b8ee-9e24b8c63057 (Feature 09 - AI Harness and Skills Framework).

Done-condition

harness.BuildContext returns a structured household context - Regulars (name, cuisine, method, minutes, favorite), Quest log names, last 60 declined names, last 4 weeks of plans (date -> dinner name), today's date and weekday names in the household timezone - rendered as a compact text block. A configurable budget trims oldest plan history first, then oldest declines, never Regulars. Seeded tests assert content, ordering, oldest-dropped-first trimming, and a valid empty-household block. Go quality floor passes.

Evidence

  • New internal/ai/harness/context.go + context_test.go; sqlc query internal/db/household_context.sql.go generated from migrations/queries/household_context.sql (querier.go updated).
  • Reads in one read transaction; timezone from household settings; missing/invalid timezone errors.
  • gofmt/vet/go test -race/build pass; make sqlc-check no drift; no new dependency.

Layer 3 of the prompt layering from task bceca7a8 is now populated.

Maestro task: 2f54cec9-ec41-42af-b8ee-9e24b8c63057 (Feature 09 - AI Harness and Skills Framework). ## Done-condition harness.BuildContext returns a structured household context - Regulars (name, cuisine, method, minutes, favorite), Quest log names, last 60 declined names, last 4 weeks of plans (date -> dinner name), today's date and weekday names in the household timezone - rendered as a compact text block. A configurable budget trims oldest plan history first, then oldest declines, never Regulars. Seeded tests assert content, ordering, oldest-dropped-first trimming, and a valid empty-household block. Go quality floor passes. ## Evidence - New internal/ai/harness/context.go + context_test.go; sqlc query internal/db/household_context.sql.go generated from migrations/queries/household_context.sql (querier.go updated). - Reads in one read transaction; timezone from household settings; missing/invalid timezone errors. - gofmt/vet/go test -race/build pass; make sqlc-check no drift; no new dependency. Layer 3 of the prompt layering from task bceca7a8 is now populated.
dev_agent added 1 commit 2026-10-05 08:23:44 -04:00
Household context builder with token budget
CI / ci (push) Successful in 2m12s
CI / ci (pull_request) Successful in 1m31s
b3740ddc12
harness.BuildContext reads the household context in one read transaction:
today and its weekday in the household timezone, Regulars (cuisine, method,
minutes, favorite), the Quest log, the last 60 passed Side quests and the
plans of the last four ISO weeks. A character budget trims the oldest plans
first, then the oldest passes, never Regulars; a budget too small for what
is never trimmed is an error.

Maestro task 2f54cec9-ec41-42af-b8ee-9e24b8c63057

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
overseer added 1 commit 2026-10-05 08:23:45 -04:00
Household context builder with token budget
CI / ci (push) Successful in 2m12s
CI / ci (pull_request) Successful in 1m31s
b3740ddc12
harness.BuildContext reads the household context in one read transaction:
today and its weekday in the household timezone, Regulars (cuisine, method,
minutes, favorite), the Quest log, the last 60 passed Side quests and the
plans of the last four ISO weeks. A character budget trims the oldest plans
first, then the oldest passes, never Regulars; a budget too small for what
is never trimmed is an error.

Maestro task 2f54cec9-ec41-42af-b8ee-9e24b8c63057

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 6ff6443db7 into feature/d4a8ed83-9cee-459c-aca3-efd1ccf17ecd-ai-harness 2026-10-05 08:34:45 -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#57