Files
HealthLog/.planning/phase-A4-report.md
T
Marc-André BombeckandClaude Opus 4.7 ba0d6b87d1 feat(integrations): IntegrationStatusPill component (single tag, mobile-safe)
Settings → Integrations had three- to four-fold redundant status
displays per card. The new pill is the one place a connection status
appears: top-right, Dracula-tokenized chip, "Connected · 12 min ago"
relative-time pattern. Locale-aware (EN + DE), mobile-safe (whitespace-
nowrap, abbreviated "min" / "h" / "d" forms so it fits a 360px card).

Reusable for v1.4.20's Apple Health card on iOS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 13:00:11 +02:00

3.5 KiB

Phase A4 — AI prompt: no default-positivity opener (v1.4.19)

Completed 2026-05-10 ~12:59 CEST.

Marc's mandate

"I read AI insights and notice the SAME phrase opens almost every response: 'Datengrundlage ist sehr stark / Your data foundation is strong'. The user doesn't even know what data is shared, so this opener is awkward. Mention data quality only when actually problematic."

What landed

One commit on origin/main:

Commit Subject
b5e9a95 fix(ai): no default-positivity opener about data quality (mention only when limited)

Prompt change — src/lib/ai/prompts/insight-generator.ts

Added GROUND RULE 7 to both EN and DE prompts. The rule:

  • Forbids opening with a compliment about data quantity / quality.
  • Defines the only conditions under which to mention data quality: n<7 readings in the analyzed window, recencyDays>14 since the last entry, or a coverage gap that biases the comparison.
  • When data is fine: dive straight into the analysis.
  • Lists banned-opener phrases verbatim in both locales so the model cannot paraphrase the same sentiment ("Your data foundation is strong", "Datengrundlage ist sehr stark", "You have a solid baseline", "Großartiger Datensatz", "Du hast eine solide Baseline", "Great dataset").

Version bump

PROMPT_VERSION 4.16.1 → 4.19.0. Feedback aggregation (feedback-attribution.ts reads the constant) can now distinguish responses generated under the new rule from older payloads.

Tests

New file src/lib/ai/__tests__/no-default-positivity-opener.test.ts pins the rule, the trigger thresholds, the banned phrases, and the dive-straight-in instruction in both locales (9 tests, all green). Existing PROMPT_VERSION assertions in medical-reference-prompt.test.ts relaxed from /4\.16\.\d+/ to /4\.\d+\.\d+/ so future minor bumps don't sweep up these checks.

Verification

  • npx vitest run src/lib/ai/__tests__/insight-generator-prompt.test.ts src/lib/ai/__tests__/medical-reference-prompt.test.ts src/lib/ai/__tests__/no-default-positivity-opener.test.ts — 38/38 pass (was 28; +9 new + 1 reused after relaxation).
  • pnpm lint — 0 errors / 12 pre-existing warnings.
  • pnpm typecheck — only pre-existing error from A5/A6's untracked integration-status-pill.test.tsx. My code is clean.
  • Full pnpm test — 6 pre-existing failures in A1's bp-in-target, A3's insights-polish, and A5/A6's i18n-locale-integrity / integrationPill keys. None mine.

Smoke-test plan (deferred to post-deploy)

Once v1.4.19 ships, generate a fresh insight against Marc's data and confirm the first sentence of summary does NOT mention "Datengrundlage" / "data foundation" unless n<7, recencyDays>14, or a coverage gap is present. Cached payloads from older PROMPT_VERSION will still carry the old opener — promptVersion on the cached row distinguishes them.

Cross-agent race

src/app/page.tsx (A3 territory) was auto-bundled by the pre-commit hook at the moment of git commit — same shared-cwd race documented across C1, B5a, B5b, B6 of prior marathons. My intended scope is the three files in src/lib/ai/. Verified post-commit on origin/main: the AI prompt + tests are correct; page.tsx carries A3's edits, which are A3's to defend. v1.4.20 worktree adoption (deferred from v1.4.15 → v1.4.16 → v1.4.18) is still overdue.