Barkday Aging-Model Integration Master Note (Full instruction set — safe to paste into any new session for continuation) Purpose Integrate advanced age modeling into Barkday’s existing 15-9 rule system while keeping hosting free, data compact, and logic extensible for both pure-breed and mixed-breed (DNA) dogs. A. Core Age Curve Baseline • Keep current 15-9 rule (≈15 dog-years first human year, +9 second year) with existing weight-based smoothing. • This mapping is identical for all breeds until 24 months. • Divergence begins after 24 months, using weight-specific curve modifiers already in place. • Base function remains baseDogYears(weightClass, months). B. Post-24-Month Breed Aging Modifiers Concept Add a per-breed age_rate multiplier applied only to months beyond 24. It scales how quickly the “dog-years” accumulate after the puppy stage. Typical Range Meaning 1.00 Standard curve (default) 1.10–1.20 Shorter-lived breeds (giants, brachies) 0.85–0.95 Long-lived breeds (toys, spitz) Implementation 1. Add age_rate field to each breed in breed_taxonomy.json. Example: 2. "Great Dane": { "age_rate": 1.15 }, 3. "Chihuahua": { "age_rate": 0.90 } 4. Clamp all values to 0.80–1.20 to prevent extremes. 5. If a breed lacks age_rate, use a cluster fallback (e.g., giant_size → 1.12, toy_long_lived → 0.90). Code Hook In app.js, wrap existing call: if (months <= 24) return baseDogYears(weightClass, months); const rate = getBreedAgeRate(breed, taxonomy, fallbacks); const beyond = months - 24; return baseDogYears(weightClass, 24 + beyond * rate); C. Cluster Fallback Map (global default) { "giant_size": 1.12, "large_brachy": 1.10, "bulldog_molosser": 1.07, "sighthound": 1.03, "herding_athlete": 1.02, "retriever_common": 1.00, "spitz_nordic": 0.98, "hound_small": 0.96, "dachshund_type": 0.95, "toy_long_lived": 0.90 } (Store in rules_library meta or app.js constant.) D. Mixed-Breed (DNA) Age-Rate Blending Data Entry User enters top 2–3 breeds and percentages (Embark results). Effective Age Rate Formula 1. Compute weighted average of component rates. 2. Compute max component rate. 3. Effective rate = max(weightedAvg, maxRate × 0.95) (conservative blend). 4. Apply safety floors/caps by cluster share: o giant_size ≥ 30 % → ≥ 1.10 o large_brachy ≥ 30 % → ≥ 1.08 o bulldog_molosser ≥ 40 % → ≥ 1.06 o toy_long_lived ≥ 60 % → ≤ 0.92 5. Clamp to 0.80–1.20. Output Return adjustedMonths = 24 + (months − 24) × rateEff. E. Expansion & Data Granularity Phase Goal Note Phase 1 Implement interpolation between existing 6 bands (weighted blend of adjacent) No data growth Phase 2 Expand to 24 birthday sub-bands (0–24 mo) Auto-inherit + override only new bullets Phase 3 Add age_rate modifiers (this spec) Minimal file bloat Expected total JSON size ≈ 5–6 MB compressed (well within GitHub Pages limits). F. Hosting Model (retain $0 cost) • See file: Master Note v2 — Paid Tier & Hosting Gate (Single Codebase).md for more advanced guidance on paid tier and hosting gate. • Static: GitHub Pages (free). • Dynamic/Premium Data: Cloudflare Workers + KV (free tier) o 100 k req/day free, 1 GB storage. o Only serves premium JSON (rules overlays, hybrid data) via JWT token. • No paid server required. G. Monetization (future-ready) Tier Key Unlocks Price Free Basic calculator + general guidance $0 Plus Breed-specific + hybrid data, PDF export $2.99 mo / $24.99 yr Pro DNA mix composer, backup/sync $4.99 mo / $39.99 yr Breeder Certificates > 4 dogs $9.99 mo H. Abuse / Breeder Controls • Limit 4 concurrent dogs per license (localStorage + KV license check). • Hash dog records to detect repetitive “add-delete” cycles. • Paid tier unlocks higher count & export rights. I. File Update Summary File Action breed_taxonomy.json Add age_rate fields (~110 lines). rules_library.json Add age_rate_fallbacks map. app.js Add dog-years wrapper + mix blending logic. breed_groups.json (optional) no change. barkday_expansion_breeds_v1.json untouched. J. Rollout Order (single-pass checklist) 1. ✅ Confirm current breed list & weight curves stable. 2. ✅ Add age_rate_fallbacks map to rules or app.js. 3. ✅ Add age_rate per-breed lines (clamped 0.8–1.2). 4. ✅ Add helper functions: getBreedAgeRate(), effectiveAgeRateForMix(). 5. ✅ Replace dog-years calc with new post-24-mo logic. 6. ✅ Verify pure-breed & mix both return valid results. 7. ✅ (Optional) Interpolation between sub-bands for early life. 8. ✅ Cache JSON + measure size (< 6 MB). 9. ✅ Test under GitHub Pages (no backend). 10. ✅ Add Cloudflare Worker only if/when premium gating needed. K. Future Enhancements • Per-breed health/longevity metadata for UI notes (“Typical lifespan 10–12 years”). • User-visible “Breed adjusted aging applied” badge. • Monthly “Barkday certificate” generator using interpolated data. End of Master Note You can literally paste this back later with: “Resume Barkday Aging-Model Integration per Master Note version 1.0” and any GPT-5 instance will have everything it needs to pick up exactly where we left off — sequence, priorities, and limits included.