Skip to content

docs: insert Phases 8–11 (feeding intake → scheduling → trends → synthesis) ahead of launch; renumber launch 8→12, post-launch 9→13#5

Merged
blokzdev merged 1 commit into
mainfrom
claude/petpal-feeding-restructure
May 30, 2026
Merged

docs: insert Phases 8–11 (feeding intake → scheduling → trends → synthesis) ahead of launch; renumber launch 8→12, post-launch 9→13#5
blokzdev merged 1 commit into
mainfrom
claude/petpal-feeding-restructure

Conversation

@blokzdev
Copy link
Copy Markdown
Owner

Docs-only restructure that inserts four new feature phases ahead of
the current launch phase and earns two durable harness primitives.

Why

Feeding is the highest-frequency thing an owner does with a pet —
multiple times daily — which makes it the richest source of compounding
memory we can add, and it touches almost every part of the harness
(photo intake stack, deterministic guardrails layer, wiki frontmatter,
scheduling/reminders, trends repo, both synthesis runners).

Building it as four sequenced phases (intake-with-hazard-gate →
schedule → trends → synthesis) lets each phase ship one
independently-shippable PR per DECISIONS row 40 while preserving the
safety-critical invariant that intake is hazard-screened the moment
it exists
— the hazard gate is in the same phase as logging, not
after.

The two durable harness primitives (CLAUDE.md §3.5)

The food feature is how we earn these. Future husbandry dimensions
(grooming, environment, activity, body-condition-over-time) drop into
the same shape without reinventing infrastructure.

  1. Intake intent routerlib/harness/intake/intent_router.dart.
    A snapped photo today always resolves to generalMemory. The
    router takes {photo, optional caption, optional explicit toggle}
    and resolves to an intent (logMealAfter, checkMealBefore,
    generalMemory; lens-extensible). Hybrid resolution: explicit
    user toggle is authoritative when present; lightweight LLM
    classification handles only the soft cases ("is this a meal at
    all / what kind").
  2. Lens pattern — each husbandry dimension is a bundle of five
    things: extraction schema · structured frontmatter · deterministic
    rules · synthesis signals · reminder kind. Food is lens fix(ci): restore green analyze + test across Phase 7 work #1.

The two product walls

Both hold across all four phases. Both stay inside the existing
clinical-vision boundary (DECISIONS row 25):

  • Detect hazards, never treat. FoodHazardScreener is a
    deterministic sibling to RedFlagScreener — code, not LLM. Matches
    extractor identified_items against assets/hazards/food_toxins.yaml
    (chocolate, xylitol incl. "birch sugar", grapes/raisins, alliums,
    macadamia, the rest of the canonical list). On hit: existing coral
    RedFlagBadge + escalation to vet/poison-control. US locale appends
    ASPCA APCC (888) 426-4435 + Pet Poison Helpline (number
    verified at implementation, never from memory). Numbers in
    assets/hazards/escalation.yaml, never in any LLM prompt
    (DECISIONS row 101). Over-warn posture per row 29. No treatment
    advice generated — mirrors ASPCA's own "general info only, call your
    vet" posture exactly.
  • Surface patterns, never predict. Feeding synthesis (Phase 11)
    describes what's in the journal (frequency, variety, table-scrap
    rate, hazard-flag count). System-prompt boundary appended after the
    existing "You are not a vet" line: "Describe feeding patterns from
    the journal; never forecast diet-driven health outcomes." Assertion
    tests pin the sentence verbatim (DECISIONS row 103).

Free / Pro split

Safety can't sit behind a paywall (DECISIONS row 102):

  • FREE: intake + hazard gate (Phase 8), feeding scheduling
    (Phase 9), descriptive feeding trends on the SOUL profile
    (Phase 10).
  • Pro: feeding-aware weekly/monthly synthesis (Phase 11), gated
    via the existing Phase 7 entitlement seam (no new gate).

Phases inserted

Phase Goal Tasks
8 Feeding intake A food photo becomes a structured, hazard-screened feeding memory 8.0 router · 8.1 food extractor · 8.2 structured food frontmatter · 8.3 FoodHazardScreener · 8.4 capture-flow branching · 8.5 wrap
9 Feeding scheduling "Feed this later" → deterministic reminder 9.0 ReminderKind.feeding · 9.1 yaml template · 9.2 schedule path · 9.3 surfaces · 9.4 wrap
10 Feeding trends Descriptive feeding patterns on the profile 10.0 TrendsRepo extension · 10.1 fl_chart surface · 10.2 wrap
11 Feeding synthesis (Pro) Weekly/monthly reports surface feeding patterns 11.0 weekly digest · 11.1 monthly report · 11.2 system-prompt boundary · 11.3 Pro gate verification · 11.4 wrap

Current Phase 8 (Play Store Prep & Launch) renumbers to Phase 12.
Current Phase 9 (post-launch on-device inference) renumbers to
Phase 13 (V1X-deferred / scoping-only per row 85, posture
unchanged).

What this PR changes

7 files, 207 insertions, 36 deletions. All docs, no code.

  • ROADMAP.md — Phases 8–11 inserted with full task lists;
    Phase 8 → 12 with all task IDs renumbered (8.X12.X,
    8.4b12.4b); post-launch Phase 9 → 13; forward references
    in line 5 / line 7 (Current phase state) / line 387 (scope wall) /
    task 7.H.2 (Phase 8+Phase 12+) all updated.
  • CLAUDE.md — new §3.5 "Intake dimensions: router + lens
    pattern"; new §10 sub-section "Food hazard gate (Phase 8.3)"
    covering the screener posture + US-first escalation + fixture
    floor (≥10 phrasings per toxin category mirroring the 6.7
    vision-cadence floor); §15 sentence reflects twelve build
    phases
    .
  • DECISIONS.md — 7 new rows (append-only invariant preserved):
    97 architecture (restructure rationale + renumber discipline),
    98 architecture (router primitive + lens pattern),
    99 storage (food entry structured frontmatter, backward-compat),
    100 agent (FoodHazardScreener posture),
    101 privacy (US-first escalation + numbers-in-config rule),
    102 monetization (free/Pro split),
    103 agent ("describe never predict" boundary).
  • PRODUCT.md — feeding-dimension paragraph after "What it is"
    naming both product walls.
  • VOICE.md §6 — examples 21 (clean meal capture) + 22 (hazard
    escalation with locale-conditional contacts) in the existing §6
    cadence.
  • V1X_BACKLOG.md — Phase 9 → Phase 13 / Phase 10 → Phase 14
    inside the on-device-inference entry; row 85 posture unchanged.
  • DESIGN.md — new "Lens reuse — no new tokens per husbandry
    dimension" sub-section under §6 Composition rules. Feeding reuses
    Phase 5 capture form, EditorialCard, RedFlagBadge,
    PhosphorIconsRegular.warningOctagon. Future lenses inherit the
    no-new-tokens constraint.

Renumber scope discipline (DECISIONS row 97)

Forward-looking docs touched (ROADMAP / CLAUDE.md §15 / PRODUCT /
V1X_BACKLOG / VOICE / DESIGN). DECISIONS.md is append-only
(CLAUDE.md §14) — historical rows that mention "Phase 8" or "Phase 9"
stay verbatim as the numbering at write time. Row 97 anchors the
renumber: rows 1–96 use pre-restructure numbering, rows 98+ use
post-restructure. Code comments that name phase numbers stay as
historical attribution (the same posture).

Test plan

Out of scope (lands in subsequent phase-task PRs)

  • Any code in lib/harness/intake/ (Phase 8.0's first task).
  • assets/hazards/food_toxins.yaml + assets/hazards/escalation.yaml
    (Phase 8.3).
  • New Tool catalog (§7) entries for log_meal / food_hazard_check
    (deferred so each tool lands with its implementation PR per the §7
    footnote rule).
  • lib/harness/agent_loop.dart pre-screener wiring for the food
    hazard screener (Phase 8.3).

Next session

After merge, planning the first subphase of the new Phase 8 — most
likely Phase 8.0 (intake intent router) as the harness primitive
that Phases 8.1–8.4 build on. The router is purely unit-testable
(no UI dependency), small enough to ship in one PR, and its enum +
contract design is the load-bearing decision the rest of the phase
inherits.

https://claude.ai/code/session_019ZiQQgMegczk4jZm4Ef3pB


Generated by Claude Code

…hesis) ahead of launch; renumber launch 8→12, post-launch 9→13

Docs-only restructure that earns two durable harness primitives — an
intake intent router (lib/harness/intake/, hybrid resolution: explicit
toggle authoritative, LLM for soft cases) and the lens pattern (each
husbandry dimension = {extraction schema, structured frontmatter,
deterministic rules, synthesis signals, reminder kind}). Food is lens
#1; grooming, environment, activity, body-condition-over-time inherit
the shape.

Two product walls that hold across all four phases: detect hazards
never treat (deterministic FoodHazardScreener + US-first poison-control
escalation, no LLM treatment advice ever); surface patterns never
predict (feeding synthesis describes the journal, never forecasts
diet-driven health outcomes).

Free/Pro split: intake + hazard gate FREE (safety can't sit behind a
paywall); feeding-aware weekly/monthly synthesis Pro (uses the existing
Phase 7 entitlement seam wired by 7.10).

Changes:

- ROADMAP.md: Phases 8–11 inserted with full task lists (8.0 router /
  8.1 food-mode extractor / 8.2 structured food frontmatter / 8.3
  FoodHazardScreener + assets/hazards/food_toxins.yaml / 8.4 capture-
  flow branching / 8.5 wrap; 9.0–9.4 feeding scheduling; 10.0–10.2
  feeding trends; 11.0–11.4 feeding synthesis). Current Phase 8 → 12
  with all task IDs renumbered; post-launch Phase 9 → 13. Forward
  references in Phase 7 wrap-up + H.2 historical narrative + line-387
  scope wall updated to match.
- CLAUDE.md: new §3.5 'Intake dimensions: router + lens pattern';
  new §10 sub-section 'Food hazard gate (Phase 8.3)' covering the
  screener posture, US-first escalation, fixture floor (≥10 phrasings
  per toxin category); §15 sentence reflects twelve build phases.
- DECISIONS.md: 7 new rows (append-only invariant preserved):
  - 97 architecture — Phase 8 restructure rationale + renumber
    discipline
  - 98 architecture — Intake intent router primitive + lens pattern
  - 99 storage — Food entry structured frontmatter (backward-compat
    with freeform food entries; fed_at distinct from index ts;
    MealPhase enum)
  - 100 agent — FoodHazardScreener as deterministic sibling to
    RedFlagScreener; known toxins only; over-warn posture
  - 101 privacy — US-first hazard escalation; ASPCA APCC confirmed,
    Pet Poison Helpline verify-at-implementation; numbers in
    assets/hazards/escalation.yaml never in any prompt
  - 102 monetization — feeding free/Pro split; intake + hazard gate
    FREE, synthesis Pro
  - 103 agent — synthesis boundary 'describe never predict' reinforces
    row 25 verbatim into the feeding domain
- PRODUCT.md: feeding-dimension positioning paragraph after 'What it
  is' — names both product walls.
- VOICE.md §6: examples 21 (clean meal capture) + 22 (hazard escalation
  with locale-conditional poison-control contacts) added in §6
  cadence.
- V1X_BACKLOG.md: Phase 9 → Phase 13 / Phase 10 → Phase 14 inside the
  on-device-inference entry; row 85 posture unchanged.
- DESIGN.md: new 'Lens reuse — no new tokens per husbandry dimension'
  sub-section under §6 Composition rules. Feeding flow reuses the
  Phase 5 capture form, EditorialCard, RedFlagBadge (coral medical-
  attention register), PhosphorIconsRegular.warningOctagon. Future
  lenses inherit the no-new-tokens constraint.

Renumber scope discipline: forward-looking docs updated;
DECISIONS.md is append-only (row 97 anchors the renumber; historical
rows 1–96 use pre-restructure numbering, rows 98+ post-restructure);
code comments that name phase numbers stay as historical attribution.

Verification: flutter analyze --fatal-infos exit 0 (no issues),
flutter test exit 0 (1756/1756 unchanged from PR #4 baseline). No
code changed; the 4 new phases ship implementation as separate PRs
(one per task per DECISIONS row 40).

https://claude.ai/code/session_019ZiQQgMegczk4jZm4Ef3pB
@blokzdev blokzdev merged commit 8ae2056 into main May 30, 2026
2 checks passed
@blokzdev blokzdev deleted the claude/petpal-feeding-restructure branch May 30, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants