mitai-jinkendo/backend
Lars fbaaf08e29
All checks were successful
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
feat: Body Cluster - Placeholder Registry Implementation
Registers 17 body composition and measurement placeholders with complete metadata:

Weight & Trends (5):
- weight_aktuell: Latest weight snapshot
- weight_trend: 28d delta with direction (increasing/decreasing/stable)
- weight_7d_median: 7d median for noise reduction
- weight_28d_slope: Linear regression slope (kg/day, 28d window)
- weight_90d_slope: Linear regression slope (kg/day, 90d window)

Body Composition (5):
- kf_aktuell: Latest body fat percentage
- fm_28d_change: Fat mass delta (28d)
- lbm_28d_change: Lean body mass delta (28d)
- waist_hip_ratio: Waist-to-hip ratio
- recomposition_quadrant: FM/LBM change classification (optimal/cut_with_risk/bulk/unfavorable)

Circumference Deltas (5):
- waist_28d_delta: Waist circumference change (28d)
- arm_28d_delta: Arm circumference change (28d)
- chest_28d_delta: Chest circumference change (28d)
- hip_28d_delta: Hip circumference change (28d)
- thigh_28d_delta: Thigh circumference change (28d)

Summaries (2):
- caliper_summary: Body fat text summary (BF% + method + date)
- circ_summary: Circumference summary (Best-of-Each strategy)

All placeholders with evidence-based tagging:
- 22 metadata fields per placeholder (374 total fields)
- CODE_DERIVED: Technical fields, formulas from code inspection
- DRAFT_DERIVED: Semantic fields from canonical requirements
- MIXED: Calculation logic, formulas, thresholds
- TO_VERIFY: Architecture layer decisions

Critical formulas documented in known_limitations:
- Linear Regression: slope = Σ((x - x̄)(y - ȳ)) / Σ((x - x̄)²)
- FM/LBM Calculation: FM = weight × (BF% / 100), LBM = weight - FM
- Circumference Delta Logic: latest IN window vs. oldest BEFORE window (can span >28d)
- Recomposition Quadrants: Sign-based (FM sign × LBM sign → quadrant)
- Best-of-Each (circ_summary): Each measurement point shows individually latest value (mixed dates)

Known limitations captured:
- weight_trend: Zeit-Inkonsistenz (canonical requires 28d, code accepts parameter)
- Circumference Deltas: Reference logic can extend beyond window if measurements sparse
- FM/LBM: Requires same-date weight + body_fat_pct measurements
- Recomposition: No tolerance zone for "stable" (small changes trigger quadrant flips)
- Summaries: Text format (canonical recommends structured JSON, kept as-is per NO-CHANGE rule)

Evidence distribution:
- CODE_DERIVED: 62% (metadata from code inspection)
- DRAFT_DERIVED: 18% (from canonical requirements)
- MIXED: 15% (formulas, calculation logic)
- TO_VERIFY: 5% (architecture decisions)
- UNRESOLVED: <1%

Registry now contains 31 placeholders total (14 Nutrition + 17 Body).

Files:
- backend/placeholder_registrations/body_metrics.py (NEW, 1307 lines)
- backend/placeholder_registrations/__init__.py (UPDATED, +body_metrics import)

Framework: PLACEHOLDER_REGISTRY_FRAMEWORK.md (verbindlich ab 2026-04-02)
Change Plan: .claude/task/rework_0b_placeholder/BODY_CLUSTER_CHANGE_PLAN.md
Code Inspection: .claude/task/rework_0b_placeholder/BODY_CLUSTER_CODE_INSPECTION.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 18:57:15 +02:00
..
calculations fix: Convert goal values to float before progress calculation 2026-03-28 12:39:26 +01:00
data_layer fix: Part B protein placeholders - aggregate by date 2026-04-02 12:43:33 +02:00
migrations feat: Phase 0b - add nutrition focus area category (migration 033) 2026-03-28 10:20:08 +01:00
placeholder_registrations feat: Body Cluster - Placeholder Registry Implementation 2026-04-02 18:57:15 +02:00
routers fix: Handle missing TimeWindow enum in export endpoint 2026-04-02 11:54:02 +02:00
tests feat: Placeholder Metadata V2 - Normative Implementation + ZIP Export Fix 2026-03-29 21:23:37 +02:00
apply_v9c_migration.py feat: v9c Phase 1 - Feature consolidation & cleanup migration 2026-03-20 18:57:39 +01:00
auth.py fix: correct indentation in auth.py _check_impl function 2026-03-21 07:06:53 +01:00
check_features.py fix: pipeline typo and add features diagnostic script 2026-03-20 22:32:09 +01:00
check_migration_024.py debug: diagnostic script for Migration 024 state 2026-03-27 07:39:18 +01:00
db_init.py fix: only process numbered migrations (XXX_*.sql pattern) 2026-03-21 10:08:56 +01:00
db.py refactor: move init_db() to db.py 2026-03-19 09:49:46 +01:00
Dockerfile fix: replace psql with Python for DB checks (no apt-get needed!) 2026-03-18 10:01:19 +01:00
evaluation_helper.py fix: convert Decimal to float for JSON serialization in evaluation 2026-03-23 13:28:07 +01:00
feature_logger.py feat: add structured JSON logging for all feature usage (Phase 2) 2026-03-20 22:18:12 +01:00
fix_seed_goal_types.py fix: make Migration 024 idempotent + add seed data fix script 2026-03-27 07:40:42 +01:00
generate_complete_metadata_v2.py feat: Placeholder Metadata V2 - Normative Implementation + ZIP Export Fix 2026-03-29 21:23:37 +02:00
generate_complete_metadata.py feat: Complete Placeholder Metadata System (Normative Standard v1.0.0) 2026-03-29 20:32:37 +02:00
generate_placeholder_catalog.py feat: Complete Placeholder Metadata System (Normative Standard v1.0.0) 2026-03-29 20:32:37 +02:00
goal_utils.py fix: add start_date and created_at to get_active_goals query 2026-03-28 17:18:53 +01:00
main_old.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
main.py feat: Phase 0c - Multi-Layer Data Architecture (Proof of Concept) 2026-03-28 18:26:22 +01:00
migrate_to_postgres.py fix: Migration-Fehler - meas_id Spalte in ai_insights 2026-03-19 08:39:36 +01:00
models.py feat: unified prompt system migration schema (Issue #28 Phase 1) 2026-03-25 10:43:10 +01:00
placeholder_metadata_complete.py feat: Complete Placeholder Metadata System (Normative Standard v1.0.0) 2026-03-29 20:32:37 +02:00
placeholder_metadata_enhanced.py feat: Placeholder Metadata V2 - Normative Implementation + ZIP Export Fix 2026-03-29 21:23:37 +02:00
placeholder_metadata_extractor.py feat: Add Placeholder Metadata Export to Admin Panel 2026-03-29 20:37:52 +02:00
placeholder_metadata.py feat: Placeholder Metadata V2 - Normative Implementation + ZIP Export Fix 2026-03-29 21:23:37 +02:00
placeholder_registry_export.py feat: Placeholder Registry Framework + Part A Nutrition Metrics 2026-04-02 11:46:16 +02:00
placeholder_registry.py feat: Placeholder Registry Framework + Part A Nutrition Metrics 2026-04-02 11:46:16 +02:00
placeholder_resolver.py chore: remove debug logging from placeholder_resolver 2026-03-28 22:02:24 +01:00
profile_evaluator.py feat: Training Type Profiles - Phase 1.1 Foundation (#15) 2026-03-23 10:49:26 +01:00
profile_templates.py feat: Training Type Profiles Phase 2.1 - Backend Profile Management (#15) 2026-03-23 11:50:40 +01:00
prompt_executor.py fix: include stage outputs in debug info for value table 2026-03-26 14:33:00 +01:00
quality_filter.py feat: global quality filter setting (Issue #31) 2026-03-23 22:29:49 +01:00
requirements.txt fix: add python-dateutil dependency for vitals CSV import 2026-03-23 15:41:30 +01:00
rule_engine.py feat: Training Type Profiles - Phase 1.1 Foundation (#15) 2026-03-23 10:49:26 +01:00
run_migration_024.py feat: manual migration 024 runner script 2026-03-27 07:28:43 +01:00
schema.sql fix: add missing meas_id column to photos table 2026-03-18 12:23:13 +01:00
startup.sh fix: replace psql with Python for DB checks (no apt-get needed!) 2026-03-18 10:01:19 +01:00