{"schema":"barkday.ai-pack-docs.v1","repo":"CandidQuality/Barkday","commit":"9e38500d723ed1e8e1ca93eb8ae821c831f1414d","updated_utc":"2026-05-05T03:48:27.039Z","count":18,"items":[{"path":"docs/Barkday_MASTER-NOTE_v2025-10-09-1.md","size":27000,"sha":"2b0bb84824c3ec92d1241b3e1971bc418d92ac0b","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/Barkday_MASTER-NOTE_v2025-10-09-1.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/Barkday_MASTER-NOTE_v2025-10-09-1.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Barkday™ MASTER-NOTE.md (v2025-10-08 Consolidated Edition)\n\n## Table of Contents\n1. Executive Summary & Purpose\n2. Core Logic & Aging Model\n3. Breed Expansion & Hybrid Cohorts\n4. Paid Tier Architecture & Hosting Gate\n5. Monetization, Limits & Abuse Prevention\n6. Certificate & Branding System\n7. Security & Hosting Transition\n8. Quality Assurance & Governance\n9. Open Items & Forward Plan\n10. Appendix — Sample Schemas & Snippets\n\n---\n\n### **1. Executive Summary & Purpose**\n\nBarkday™ is a progressive web application (PWA) that helps dog owners celebrate, plan, and better understand their pets’ “dog-year” birthdays.\nThe project began as a single-page calculator and evolved into a full data-driven experience with breed-specific health, training, and enrichment recommendations.\n\nThe current public build runs on **GitHub Pages** for open testing.\nThe commercial release will transition to **private API-hosted data** where proprietary JSON files (recommendations, hybrid logic, affiliate lists, etc.) are fetched based on each user’s paid-tier credentials.\n\nPrimary goals:\n\n* Deliver accurate, enjoyable, and personalized results instantly in-browser (no user accounts required for free tier).\n* Protect proprietary data sets and design logic once monetized.\n* Maintain a single codebase that can serve all tiers by switching endpoints and unlock flags at runtime.\n* Present Barkday™ as both a utility and a keepsake—each calculation can generate a printable **certificate-style PDF**.\n\n---\n\n### **2. Core Logic & Aging Model (v0)**\n\n#### **2.1 Overview**\n\nDog-to-human aging is modeled using a hybrid exponential curve tuned per breed group.\nAge “bands” represent developmental stages; recommendations are stored by group × band.\nFallback logic ensures a valid plan for any combination of known/unknown breed.\n\n#### **2.2 Primary Data Files**\n\n| File | Purpose |\n| --------------------- | -------------------------------------------------------- |\n| `breed_groups.json` | Maps AKC/FCI group names to canonical clusters. |\n| `breed_aliases.json` | Normalizes user input (synonyms, alternate spellings). |\n| `breed_taxonomy.json` | Connects canonical breeds to their group and meta-group. |\n| `reco-breed.json` | Per-breed recommendation sets. |\n| `reco-banded.json` | Group × age-band fallback recommendations. |\n| `rules_library.json` | Governs tone, category ordering, and formatting rules. |\n\nEach JSON file uses version query tags (`?v=YYYY-MM-DD-N`) for cache-busting.\n\n#### **2.3 Computation Flow**\n\n```js\n// Pseudocode from app.js (simplified)\nfunction computeDogAge(dob) {\n const now = new Date();\n const ageDays = (now - dob) / 864e5;\n const ageYears = ageDays / 365.25;\n const humanEquivalent = 16 * Math.log(ageYears + 1) + 31; // example curve\n return { ageYears, humanEquivalent };\n}\n```\n\nThe UI presents both *dog years* (chronological) and *human-equivalent years* (behavioral maturity).\n\n#### **2.4 Grouping Logic**\n\nIf a user specifies a known breed:\n\n```js\ngroup = taxonomy[breed].group;\n```\n\nIf not, Barkday™ falls back to group dropdown selection → default `reco-banded` entry.\n\n✅ **Implemented:** automatic fallback prevents “empty plan” placeholders.\n⚙️ **Future refinement:** per-breed curve coefficients sourced from ongoing veterinary datasets.\n\n---\n\n### **3. Breed Expansion & Hybrid Cohorts (v1)**\n\n#### **3.1 Purpose**\n\nDesigner and hybrid breeds represent a multibillion-dollar market.\nTo remain relevant, Barkday™ must map cross-breed DNA results to intelligent averages of parent group traits.\n\n#### **3.2 Hybrid Algorithm**\n\n```js\n// Example weighting for hybrid breeds\nfunction hybridProfile(parents){\n let total = 0, result = {};\n for (const p of parents){\n const g = taxonomy[p.breed].group;\n result[g] = (result[g]||0) + p.percent;\n total += p.percent;\n }\n for (const g in result) result[g] = +(result[g]/total).toFixed(2);\n return result; // e.g. { \"Sporting\":0.6, \"Working\":0.4 }\n}\n```\n\nRecommendations are blended across the weighted groups.\n\n#### **3.3 Designer Cohort Registry**\n\n* Each designer type (e.g., Labradoodle) references its parent breeds.\n* Aliases file contains all known commercial spellings.\n* Mixed inputs still resolve to a valid meta-group for `reco-banded` lookup.\n\n✅ **Implemented:** alias resolution for hybrids.\n⚙️ **Future:** automated weighting from DNA imports (e.g., Embark, Wisdom Panel).\n\n---\n\n### **4. Paid Tier Architecture & Hosting Gate (v2)**\n\n#### **4.1 Single Codebase Model**\n\nThe web app remains one build; pay tiers only change *which endpoints* the data fetches from.\n\n```js\nconst BASE = isPaid ? 'https://api.barkday.app/v1/' :\n 'https://candidquality.github.io/Barkday/data/';\nfetch(`${BASE}reco-breed.json`);\n```\n\n#### **4.2 Tier Levels**\n\n| Tier | Access | Storage | Notes |\n| ------------- | -------------------- | ------------ | ------------------------------------------ |\n| Free | Local data only | 5 saved dogs | Uses public GitHub JSONs |\n| Plus | Fetch via API key | 20 dogs | Adds premium breed data |\n| Pro / Breeder | Full API + analytics | Unlimited | Enables litter tracking, export, reminders |\n\n#### **4.3 Security Model**\n\n* All proprietary JSON files move off GitHub once live.\n* Requests validated by API key or token; each tier limited by key scope.\n* Core UI functions stay identical; only data sources differ.\n* Keys are **never stored in the app**—only short-lived tokens returned from login.\n\n#### **4.4 Monetization Hooks**\n\n* Upgrade banner appears when user reaches save-limit.\n* Certificate print screen remains available in all tiers.\n* Gift ideas are visible to everyone. Premium may include optional partner perks (e.g., discounts/coupons), not paywalled access to gifts.\n\n✅ **Implemented:** structural separation and version-tag fetches.\n⚙️ **Future:** integrate Stripe or Play Store billing endpoint for token refresh.\n\n---\n\n\n## **Barkday™ MASTER-NOTE.md (v2025-10-08 Consolidated Edition)**\n\n### **Sections 5 – 7**\n\n*(Monetization & Abuse Prevention → Certificate System → Security & Hosting)*\n\n---\n\n### **5. Monetization, Limits & Abuse Prevention (v3)**\n\n#### **5.1 Overview**\n\nThe free version allows a maximum of 5 saved dog records in `localStorage`.\nThis encourages upgrades while still allowing functional use.\n\n```js\n// app.js excerpt\nconst MAX_FREE = 5;\nif (!isPaid && saved.length >= MAX_FREE) {\n alert(\"Save limit reached — upgrade to Barkday™ Plus for more!\");\n return;\n}\n```\n\n#### **5.2 Record Identification and Integrity**\n\nEach record (run) receives a unique timestamp ID (`ts`) when created.\nThis ID becomes the “Certificate #” and QR payload for PDF export.\n\n```js\nconst run = {\n ts: Date.now(), // unique key\n dog: dogName,\n dob: dobISO,\n group: group,\n ...\n};\nlocalStorage.setItem(\"barkday.runs.v1\", JSON.stringify(allRuns));\n```\n\n✅ Implemented: Unique identifier generated at creation.\n⚙️ Future: Server-side hash signing for paid records.\n\n#### **5.3 Anti-Circumvention Logic**\n\n* Local save limit tracked via array length.\n* Deleting or reinstalling will lose records, but certificate hash remains embedded in PDF for future import.\n* Re-imports detect duplicate `ts` and merge gracefully.\n\n```js\nfunction importRun(data){\n const exists = store.find(r=>r.ts===data.ts);\n if(!exists) store.push(data);\n}\n```\n\n✅ Implemented: Duplicate run merge by timestamp.\n⚙️ Future: Rate-limit or IP log for API-tier users.\n\n---\n\n### **6. Certificate & Branding System**\n\n#### **6.1 Purpose**\n\nEvery Barkday™ record can produce a printable PDF certificate representing the dog’s next birthday plan.\n\n#### **6.2 Layout**\n\nHeader → Dog profile + DNA breeds → QR + Certificate # → Body plan → Fixed footer.\n\nThe latest version (`app-pdf.js v8`) implements a professional, single-page layout:\n\n* Fixed header (top logo and dog info)\n* Two wide columns of plan content\n* Fixed footer (bottom margin 80 px)\n\n✅ Implemented in v8.\n\n#### **6.3 Branding Standards**\n\n* Always display name as **Barkday™** (one word, capital B).\n* Logo should appear at top-left; QR at top-right.\n* Font and kerning set for print clarity (11–12 pt main text).\n\n#### **6.4 Certificate Number & QR**\n\n```js\nconst certNo = run.id || run.hash || run.ts;\nconst qrText = JSON.stringify({ v:'1', id:String(certNo) });\nconst qrDataURL = await renderQRCodeToDataURL(qrText); // local lib or network PNG → dataURL\ndoc.addImage(qrDataURL,'PNG', qrX, qrY, qrSize, qrSize);\ntx(\"Certificate #\", qrX+qrSize/2-26, qrY+qrSize+10, 9, true);\ntx(certNo, qrX+qrSize/2-28, qrY+qrSize+22, 10);\n```\n\n✅ Implemented: Certificate # label and ID below QR.\n⚙️ Future: Embed encrypted import payload to re-load record in app.\n\n#### **6.5 Logo Loading**\n\n```js\ntry {\n const svg = await fetch('barkday-logo-vector.svg').then(r=>r.text());\n await doc.svg(svg,{x:M,y:headerTop,width:logoW,height:logoH});\n} catch {\n doc.rect(M,headerTop,logoW,logoH);\n tx(\"Barkday™\", M+10, headerTop+48, 12, true);\n}\n```\n\n✅ Implemented: Failsafe logo placeholder.\n⚙️ Future: Use signed asset path for private build.\n\n#### **6.6 Footer Content**\n\n```\nBarkday™ — Generated locally \nPrivacy: Barkday™ stores data only on this device. \nDisclaimer: General guidance only — not veterinary advice.\n```\n\nFixed position ~72 px above page bottom.\n\n---\n\n### **7. Security & Hosting Transition**\n\n#### **7.1 Current Stage**\n\n* Public GitHub Pages site used for testing and feedback.\n* All JSON data in `/data/` folder is open for read-only testing.\n* Browser localStorage persists user records only on device.\n\n#### **7.2 Target Architecture**\n\nWhen monetized, Barkday™ will move to a private host with tiered API keys.\n\n```js\nconst API = \"https://api.barkday.app/v1/\";\nfetch(`${API}reco-breed.json?key=${userKey}`);\n```\n\n* Each tier key grants access only to its data scope.\n* Keys expire periodically; tokens refreshed via auth endpoint.\n* Data served over HTTPS only and CORS locked to official domains.\n\n✅ Planned for Phase II (deployment transition).\n\n#### **7.3 Intellectual Property Protection**\n\n* Proprietary JSON files moved off public repos.\n* All exported records include hash but not raw data payloads.\n* Barkday™ logo and name filed for trademark protection.\n\n#### **7.4 Offline Behavior**\n\nFree version remains functional offline; cached via PWA service worker.\nPaid tiers require API reachability for data fetch.\n\n⚙️ Future consideration: Encrypted local cache for offline premium use.\n\n---\n\n\n### **Sections 8–10**\n\n*(Quality Assurance → Open Items → Appendix)*\n\n---\n\n### **8. Quality Assurance & Governance**\n\n#### **8.1 QA Workflow**\n\nAll releases follow a manual QA pass before commit to GitHub main.\nTesting covers:\n\n| Area | Test | Status |\n| ------------- | -------------------------------------------- | ------------------------------------------ |\n| UI | Responsive layout, dark mode readability | ✅ |\n| Data | Breed dropdowns load full taxonomy | ✅ |\n| Save | localStorage operations limited to 5 entries | ✅ |\n| PDF | Generates on both desktop and Android Chrome | ✅ |\n| Offline | PWA loads when cached | ⚙️ pending formal SW cache manifest review |\n| Accessibility | Tab order, ARIA roles | ⚙️ in progress |\n\n#### **8.2 Versioning & CHANGELOG**\n\nEach file’s cache-bust string (`?v=YYYY-MM-DD-N`) doubles as version tag.\nExample:\n\n```html\n\n```\n\nThe **CHANGELOG.md** records visible build milestones:\n\n```\n2025-10-06-2 app.js: stable release, JSON v-sync, placeholder removed\n2025-10-08-v8 app-pdf.js: final certificate layout\n```\n\n#### **8.3 MAINTAINERS Policy**\n\n* Primary maintainer: project owner (you).\n* Secondary AI assistant: documentation & automation support.\n* All code merges occur through reviewed pull requests.\n* Proprietary assets never pushed to public repos.\n* GitHub remains testing ground only; production build moved to private host.\n\n#### **8.4 Release Steps**\n\n1. Verify all JSONs pretty-printed and schema-consistent.\n2. Run browser console to confirm no `fetch` or `SyntaxError`.\n3. Confirm PWA manifest valid.\n4. Commit → push → verify GitHub Pages rebuild.\n5. Update `CHANGELOG.md` with summary.\n\n---\n\n### **9. Open Items & Forward Plan**\n\n| Category | Action | Priority |\n| ------------------- | ----------------------------------------------------- | -------- |\n| **Affiliate Data** | Implement curated gift lists per breed/age. | Medium |\n| **DNA Imports** | Parse Embark/Wisdom exports for hybrid weighting. | High |\n| **Paid Tier API** | Deploy private JSON API with key validation. | High |\n| **Offline Mode** | Service worker for premium cache fallback. | Medium |\n| **UI Polish** | Theme color selector & confetti timing adjustments. | Low |\n| **Accessibility** | Add full ARIA labels and keyboard nav. | Medium |\n| **Mobile Printing** | Optimize Android print dialog scaling. | Medium |\n| **Analytics** | Add anonymized usage counters (local opt-in). | Low |\n| **Legal** | Finalize trademark submission Barkday™. | Done |\n| **Docs** | Merge and maintain single MASTER-NOTE.md (this file). | Done |\n\n---\n\n### **10. Appendix — Sample Schemas & Snippets**\n\n#### **10.1 Example reco-banded.json Entry**\n\n```json\n{\n \"Working / Herding\": {\n \"puppy_1_6\": {\n \"Training & Enrichment\": [\n \"Channel motion focus into tasks (targeting, flank cues)\",\n \"Short, frequent reps; end while engagement is high\"\n ],\n \"Health & Wellness\": [\n \"Protect thin skin with padded beds\",\n \"Monitor for cold sensitivity\"\n ]\n }\n }\n}\n```\n\n#### **10.2 app.js Save Payload (Simplified)**\n\n```js\n{\n \"dog\": \"Finn\",\n \"dob\": \"2024-07-04\",\n \"group\": \"Working / Herding\",\n \"weight\": 55,\n \"chewer\": \"Normal\",\n \"smooth\": true,\n \"ts\": 1728394847000,\n \"kpi\": {\n \"hy\": 3.94,\n \"dogAge\": \"0y 3m\",\n \"nextDate\": \"Thu Oct 09 2025\",\n \"nextAge\": 4\n }\n}\n```\n\n#### **10.3 Certificate Layout Constants (app-pdf.js)**\n\n```js\nconst W=792, H=612, M=36;\nconst RULE=[210,210,210];\nconst footerTop = H - 72;\n```\n\n#### **10.4 Future Private API Endpoint Structure**\n\n```\nGET /v1/data/breeds\nGET /v1/data/reco?group=Working%20/%20Herding&band=puppy_1_6\nGET /v1/data/gifts?tier=pro\n```\n\nAll requests require `Authorization: Bearer ` in paid tiers.\n\n---\n# Barkday™ MASTER-NOTE — Addendum (2025-10-09)\n\nThis addendum records **new decisions** made after the `MASTER-NOTE.md (v2025-10-08)`\nso nothing is lost while the owner is mobile. These items should be merged back into\nthe next full revision of the Master Note.\n\n---\n\n## A. Bark Day Milestone Model (15 + 9) — Clarified & Final\n- **Bark Days** are the **dog-year birthdays**, not human months.\n- We surface **24 milestones** in the early life stage:\n - **15 Bark Days** in the first human year\n - **9 Bark Days** in the second human year\n- Implementation uses **precomputed schedules** (human-years since DOB at each Bark Day index `k = 1..24`) per curve.\n - We avoid on-device numeric inversion for reliability and performance.\n\n### A.1 Curves Registry (new file: `data/curves.json`)\n```json\n{\n \"curves\": {\n \"group_default_v1\": {\n \"label\": \"Group default (smoothed 15/9)\",\n \"barkdays\": { \"1\": 0.07, \"2\": 0.13, \"...\": \"...\", \"24\": 2.10 },\n \"source\": \"AKC 15/9 smoothed (internal fit)\",\n \"notes\": \"Human years at each Bark Day index (1..24)\"\n },\n \"breed:LABRADOR_RETRIEVER:v1\": {\n \"label\": \"Labrador Retriever (v1)\",\n \"barkdays\": { \"1\": 0.075, \"2\": 0.14, \"...\": \"...\", \"24\": 2.05 },\n \"source\": \"Breed-specific study (DOI TBD)\",\n \"notes\": \"Distinct 2nd-year profile vs default\"\n }\n },\n \"defaults\": {\n \"group_curve\": \"group_default_v1\",\n \"overrides\": {\n \"Labrador Retriever\": \"breed:LABRADOR_RETRIEVER:v1\"\n }\n }\n}\n```\n- **Future-proofing:** Add additional curves as peer‑reviewed data appears.\n- **Display:** When an override is used, show a discreet note: “Using [Curve Label]”.\n\n### A.2 Converting to dates\nFor Bark Day `k`, compute human years `t_k` from `curves.json`, then:\n```\ndate_k = DOB + t_k * 365.25 days\n```\n\n---\n\n## B. Breed Size Scaling (Age-Banding Factor) — NEW\nWe will modulate the Bark Day schedule by a **breed scaling factor** `S` where **1.00** is baseline.\n- Small breeds → **S < 1.00** (faster early development); example: **Chihuahua S = 0.88**\n- Large/Giant breeds → **S > 1.00** (slower early development); example: **Mastiff S = 1.16**\n- Range: **0.80–1.20** reserved; current working band **0.88–1.16**.\n\n### B.1 Application of S\nFor a given Bark Day index `k` with default human-years `t_k` from the selected curve:\n```\nt_k_scaled = t_k * S\ndate_k = DOB + t_k_scaled * 365.25 days\n```\n- **Mixed breeds:** compute a **weighted S** from components (max 3 parents):\n `S_mix = Σ (w_i * S_breed_i)` with Σw = 1.0\n- **Designer breeds with explicit curve:** If a breed override provides its own schedule,\n apply **S = 1.00** unless that curve’s documentation specifies otherwise.\n\n### B.2 Storage\nAdd to taxonomy a `size_scale` field per breed (fallback at group level):\n```json\n{\n \"Chihuahua\": { \"group\": \"Toy / Companion\", \"size_scale\": 0.88 },\n \"English Mastiff\": { \"group\": \"Working / Herding\", \"size_scale\": 1.16 },\n \"...\": { \"group\": \"Sporting\" }\n}\n```\nFor missing values, use group median or default `1.00`.\n\n---\n\n## C. Mixed-Breed Blending (up to 3 components) — Finalized\n- Accept **up to 3** breeds with percentages.\n- **Priority order of sources at Bark Day k:**\n 1) **Breed-level** Bark Day content (if present; weighted union)\n 2) **Group-level** Bark Day defaults (`reco-barkday-banded.json` at index k)\n 3) **Trait inserts** (`trait-inserts-barkday.json` expanded for k)\n 4) **Universal puppy** (`universal-puppy-barkday.json` at k)\n- **Deduplicate** bullets and **cap 3–5** per lane for printability.\n\n```js\n// Sketch\nfunction resolvePlan({breeds, group, k, traits}) {\n const breedBlocks = weightedBreedBlocksAtK(breeds, k); // union by weight\n const groupBlock = RECO_BARKDAY_BANDED[group][String(k)] || {};\n const traitAdds = resolveTraitInserts(traits, k);\n const puppyAdds = UNIVERSAL_PUPPY_BARKDAY[String(k)] || {};\n\n let plan = mergeAll([breedBlocks, groupBlock]);\n plan = mergeAdditive(plan, traitAdds);\n plan = mergeAdditive(plan, puppyAdds);\n return clampItemsPerLane(dedupe(plan), {min:3, max:5});\n}\n```\n\n---\n\n## D. Data Files — Bark Day–centric (new & confirmed)\n- **NEW:** `reco-barkday-banded.json` — group defaults for Bark Days 1..24\n- **NEW:** `trait-inserts-barkday.json` — cluster/range-based inserts (e.g., brachy, coat_care_high, giant_growth, noise_sensitive)\n- **NEW:** `universal-puppy-barkday.json` — universal early-life inserts 1..24\n- **NEW (planned):** `curves.json` — per-curve Bark Day schedules; defaults + overrides (e.g., Labrador Retriever)\n\n> These files exist alongside the current adult **banded** and **per-breed** sets. Bark Day files are checked first for k=1..24.\n\n---\n\n## E. PDF / UI Notes — Confirmations\n- Header phrasing: **“Next Bark Day Plan — turning {k} on {DATE}”** (no “dog years” wording).\n- Barkday™ brand: single word, capital B; ™ symbol shown where appropriate.\n- Certificate area: QR at right; **“Certificate #”** label above unique ID; Labrador curve note if applied.\n\n---\n\n## F. Outreach (breed clubs & registries) — Question Set\nWe will contact clubs and specialty registries with this standardized request (see long-form email in previous message). Key areas we’ll ask for per-breed truth:\n1) Growth/maturity timeline for first 2 human years (behavioral + skeletal)\n2) Early red flags owners should recognize (breed-specific)\n3) Exercise surfaces/dose limits by early Bark Days\n4) Socialization priorities; fear-period timing\n5) Core training focus owners often miss (recall, impulse control, engagement)\n6) Health screenings/upfront exams recommended by 24 months\n7) Orthopedic/respiratory/derm risks + prevention tips\n8) Thermal tolerance & coat-care realities\n9) Nutrition specifics (growth diet, Ca:P notes, BCS targets)\n10) Grooming/handling basics to start immediately\n11) Gear advisories (e.g., harness vs collar for brachy)\n12) Enrichment styles that match drives\n13) Environmental risks (stairs, slick floors, water, prey drive)\n14) Official standards/resources and peer-reviewed references\n15) Contact for review prior to publication\n\n---\n\n## G. Open Items / TODOs (to carry into next Master Note revision)\n- [ ] Generate `data/curves.json` with **group_default_v1** schedule and **Labrador v1** override.\n- [ ] Add `size_scale` per breed (taxonomy) and compute mixed-scale `S_mix` for schedule.\n- [ ] Implement Bark Day resolver in `app.js` (loader + blending + PDF header update).\n- [ ] Begin content authoring for **Bark Days 1..24** in `reco-barkday-banded.json` (start with Working/Herding, Toy/Companion, Terrier).\n- [ ] Author **trait inserts** for brachy, giant_growth, coat_care_high, noise_sensitive, independence_high.\n- [ ] Outreach to clubs using the question set; store responses and citations for future curves.\n- [ ] When peer-reviewed curves publish, add to `curves.json` and credit sources.\n- [ ] QA checklist additions: verify no placeholder lanes; cap bullets 3–5; PDF remains single-page.\n\n---\n\n*This addendum is intended to be merged back into the main `MASTER-NOTE.md` during the next editing session. Keep both files in `/docs/` until merged.*\n\n# Barkday™ MASTER-NOTE — Addendum (2025-10-09 • v2)\n\nThis update locks a critical rule about **breed-specific curves** and how they override the default 15/9 model.\n\n---\n\n## A. Piecewise Breed Curves (Override From a Start Bark Day Onward)\n\n**Rule:** If a peer‑reviewed, breed‑specific curve exists, it **inherits** the default\nfirst-year Bark Days (1–15) *unless the study provides its own first-year values*, and then\n**overrides from a specified start point onward** (typically Bark Day 16 = human month 13).\nThe override **continues forward** (year 2 and beyond) using that breed’s data. We do **not**\nrevert to the default after year 2.\n\n- Default site-wide cadence for breeds without data: **15 in year 1 + 9 in year 2**, via `group_default_v1`.\n- **Labrador Retriever**: identical to default for **Bark Days 1..15**; **diverges at Bark Day 16** and\n continues with the lab-specific schedule for all later Bark Days.\n- Future breeds: same mechanism — piecewise override from the curve’s documented start point (Bark Day index or human-year threshold).\n\n### A.1 Curves Registry — Schema (supports partial overrides)\n```json\n{\n \"curves\": {\n \"group_default_v1\": {\n \"label\": \"Group default (smoothed 15/9)\",\n \"barkdays\": { \"1\": 0.07, \"2\": 0.13, \"...\": \"...\", \"24\": 2.10 },\n \"source\": \"AKC 15/9 smoothed (internal fit)\",\n \"notes\": \"Human years since DOB at each Bark Day index (1..24).\"\n },\n \"breed:LABRADOR_RETRIEVER:v1\": {\n \"label\": \"Labrador Retriever (v1)\",\n \"inherits\": \"group_default_v1\",\n \"override_start\": { \"barkday\": 16 },\n \"barkdays_override\": { \"16\": 1.05, \"17\": 1.12, \"...\": \"...\", \"24\": 2.05 },\n \"extend\": \"table\", // how to continue if more Bark Days are defined later\n \"source\": \"Breed-specific study (DOI TBD)\",\n \"notes\": \"Overrides from Bark Day 16 onward; does not revert.\"\n }\n },\n \"defaults\": {\n \"group_curve\": \"group_default_v1\",\n \"overrides\": {\n \"Labrador Retriever\": \"breed:LABRADOR_RETRIEVER:v1\"\n }\n }\n}\n```\n**Loader behavior:**\n1) Read chosen curve ID (breed override or default). \n2) If `override_start` exists, take `inherits` for indices below that start, then apply `barkdays_override` from the start onward.\n3) If both define the same index, the **override wins**.\n\n**Display:** When a breed override is applied, show: \n“Using **{Curve Label}** from Bark Day {start} onward.”\n\n---\n\n## B. Size Scaling Factor `S` (±0.2) With Overrides\n\n- **Baseline S = 1.00**. Example working values: **Chihuahua S = 0.88**, **Mastiff S = 1.16**.\n- **Application:** If a breed uses the **default** curve, scale all Bark Day times: \n `t_k_scaled = t_k * S` → `date_k = DOB + t_k_scaled * 365.25 days`.\n- **When a breed has its own curve override:** We assume the curve already reflects size for that breed. \n → **Do not apply S** to the overridden segment **unless** the curve entry explicitly sets `\"apply_scale\": true`.\n\nSchema extension (optional, per breed or per default):\n```json\n{\n \"curves\": {\n \"breed:LABRADOR_RETRIEVER:v1\": {\n \"inherits\": \"group_default_v1\",\n \"override_start\": { \"barkday\": 16 },\n \"barkdays_override\": { \"...\": \"...\" },\n \"apply_scale\": false\n }\n }\n}\n```\n\n**Mixed-breed scaling:** Weighted factor across up to 3 breeds: \n`S_mix = Σ (w_i * S_breed_i)` (fallback to group or 1.00 when missing).\n\n---\n\n## C. Bark Day Resolver (restate, Bark Day–centric)\n\nPriority at Bark Day `k`:\n1) Breed-level Bark Day content (weighted union for mixed), if present. \n2) Group Bark Day defaults (`reco-barkday-banded.json` at `k`). \n3) Trait inserts (`trait-inserts-barkday.json`, ranges expanded to include `k`). \n4) Universal puppy (`universal-puppy-barkday.json` at `k`). \n→ Deduplicate + cap **3–5 bullets** per lane.\n\n**Curves selection:** \n- Choose curve: breed override (if any) else default. \n- Build `t_k` table (piecewise inherit/override). \n- Apply `S` only if allowed for this curve/segment (see above). \n- Convert to dates; set “Next Bark Day Plan — turning {k} on {DATE}”.\n\n---\n\n## D. TODOs to merge into next MASTER-NOTE revision\n- [ ] Add `curves.json` with piecewise override schema (above). \n- [ ] Populate **Labrador** `barkdays_override` (Bark Days 16..24) from the study. \n- [ ] Add `size_scale` values to taxonomy; compute `S_mix` for mixed breeds. \n- [ ] Implement loader in `app.js`: curve selection, piecewise inherit/override, conditional scaling. \n- [ ] Update PDF header note to reflect curve override usage when applicable.\n\n\n\n\n\n### **End of Document**\n\n> Barkday™ — because every dog deserves their day.\n\n---\n","inline_bytes":26720,"content_sha256":"91e4db06d5bd2fb33fc03e7283afeae8cd0e57fc30ca9d27bd5cf9e8e8cbb663"},{"path":"docs/CHANGELOG.md","size":738,"sha":"75ce8e68502f66376b4663eea28cf5c4aea1174f","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/CHANGELOG.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/CHANGELOG.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Barkday Data Changelog\n\n## 2025-10-06-1 - Companion/Hybrid Cohort + Version-Lock\n\n### Summary\n\nUnified `?v=` cache-bust tags across all data sources in `app.js`. Added Companion/Hybrid\n(Designer/Doodle) cohort to aliases, taxonomy, and groups in Task #1 (previous commit).\n\n### Files Updated\n\n- app.js: synchronized `BREED_GROUPS_URL`, `RECO_BANDED_URL`, `RECO_BREED_URL`,\n `BREED_ALIASES_URL`, `TAXONOMY_URL`, and `GIFT_FEED_URL` to `?v=2025-10-06-1`\n\n### Notes\n\n- Gift feed versioned for cache consistency with local JSON.\n- Runtime verified with hard refresh (Ctrl+F5) to confirm new versions load.\n- Added observer-based aria sync for drawers; fixed aria-hidden warnings.\n- Added functional Saved-drawer cap cue (x/5); no styling.\n","inline_bytes":738,"content_sha256":"c8bce6aad9148d7323bdfde7628d100a1e926eaad203a11cf6e6355bff201c45"},{"path":"docs/DAILY_NOTES.md","size":1356,"sha":"c844c68729b214e040c19a4fb379e71137057a2c","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/DAILY_NOTES.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/DAILY_NOTES.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Barkday — Daily Notes (Running Log)\r\n\r\n## 2025-10-25\r\n- Installed repo-wide “everything” pack (sharded) + manifest; added CI pack to `ai-pack-all`.\r\n- Added explicit `inline_state` completeness flags to all packs.\r\n- Agreed operating procedure: (1) verify context from packs, (2) propose surgical diffs with file names, (3) deploy.\r\n- Governance: confirmed Gift Access policy; prepared MASTER-NOTE §4.4 patch; ensured MAINTAINERS bullet formatting.\r\n- Cleaned up workflow expectations: Pages deploy on push; “Validate dog-gifts.json” kept; optional nightly link check to use pack (not repo-committed files).\r\n\r\n### Short next steps\r\n1) Apply the §4.4 MASTER-NOTE wording patch.\r\n2) Confirm MAINTAINERS has the Gifts Access Policy bullet.\r\n3) (Optional) Switch “AI Health Checks” to manual or pack-based link checker.\r\n\r\n## 2025-10-26\r\n- Added `ai-pack-all.html` router with links to per-area packs (`docs`, `data-config`, `core`, `ci`) and the “everything” manifest.\r\n- Packs also emit `.txt` mirrors for robust fetching.\r\n- Confirmed §4.4 policy (“gifts visible to everyone; premium = optional perks”) across MAINTAINERS and MASTER-NOTE.\r\n- Created docs policy lint to block “gifts behind paywall” regressions.\r\n- Agreed workflow: paste `ai-pack-all.html`, I read packs (commit-accurate), then propose file-named diffs only.","inline_bytes":1327,"content_sha256":"8df78a80e8d283ff12c1598c48ec67b8525d3efad12588eef6e697a317d28044"},{"path":"docs/Data expansion plan.md","size":16415,"sha":"69fca21f322ecc6450b8e848fe5a5209034b95be","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/Data%20expansion%20plan.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/Data%20expansion%20plan.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"Barkday Project Governance & Data Update Guide\r\nPurpose & Vision\r\nBarkday exists to celebrate every dog's next birthday and to use that milestone as a positive teaching opportunity. Beyond simply converting a canine's age into \"dog years,\" the app delivers breed-specific care guidance, training games, enrichment suggestions, and gentle reminders that evolve as a dog moves through life. By surfacing the very real differences between breeds-energy needs, guardian instincts, coat care, health risks, etc.-we help guardians make better day-to-day decisions, improving dogs' well-being around the world. The educational content in Barkday is not veterinary advice; it should always be paired with a disclaimer to consult a veterinarian for specific medical concerns.\r\nThe platform also offers optional links to gift ideas. Gift panels are hidden by default; users only see affiliate recommendations if they choose to explore them. This keeps the primary purpose on education rather than commerce. The affiliate revenue is meant to offset development costs, not to compromise trust.\r\nData File Overview\r\nBarkday's personalization engine relies on a small set of structured JSON files. Each serves a distinct role and should be updated carefully:\r\nFile\r\nRole\r\nKey fields\r\nbreed_aliases.json\r\nMaps common misspellings, local names, and abbreviations back to a canonical breed name. This enables search and free-text entry to \"just work.\"\r\nTop-level keys are canonical breed names; values are lists of strings. Meta keys beginning with _ (e.g., _dataset_id) are reserved.\r\nbreed_taxonomy.json\r\nProvides high-level classification for each breed. It specifies an akc_group (or the closest functional group) and a list of clusters describing behaviour, physiology, coat, etc. Optional meta_groups_hint can tag breeds for umbrella group pages.\r\nKeys are breed names; each value has an akc_group string and a clusters array. See clusters defined in the rules library.\r\nbreed_groups.json\r\nDefines umbrella groups displayed in the UI (e.g., \"Working / Herding\", \"Terriers\"). Each entry lists example breeds, core traits, enrichment ideas, owner tips, a short notification line, cautions, and gift tags. Groups are additive; new ones can be added without impacting existing logic.\r\nIt is an array of objects. Each object has an id, name, examples, core_traits, enrichment, owner_tips, notification_short, cautions, and gift_tags.\r\nreco-breed.json\r\nProvides breed-specific overrides across \"lanes\" (training, health, exercise, bonding, gear, nutrition) for specific age markers. When a breed is not listed, defaults cascade from clusters and general rules.\r\nThe root object has a breeds property; each breed can define one or more age keys (e.g., \"2\", \"7\", \"12\"). Each age contains a lanes object with lists of bullet points.\r\nreco-banded.json\r\nStores fully materialised recommendations for each breed across age \"bands\" (puppy, young, adult, senior). Most entries are currently empty. When filled, these will override cluster-based defaults for the entire age range.\r\nbands ? band names ? breed names ? lanes.\r\nrules_library.json\r\nHouses curated rule fragments keyed by selectors such as akc_group, clusters, or other tags. Each rule defines which age bands it applies to and per-lane bullet lists. This file acts as a toolbox of reusable guidance and can be expanded safely.\r\nContains a defaults object with baseline lanes, and a rules array. Rules should be non-conflicting; more specific selectors take precedence.\r\nGovernance Principles & Workflow\r\n1. Major vs Minor Updates\r\n2. Major push: When adding or refactoring many breeds or structural metadata, bundle all changes into a single coordinated release. Updating aliases, taxonomy, groups, and overrides together minimises transient states that could break search or recommendations. Always increment the query-parameter version (?v=) for each updated file in app.js to bust caches.\r\n3. Minor fixes: Typo corrections, adding a single alias, or adjusting a bullet can be applied ad-hoc. These should not remove existing content unless it is clearly erroneous. Avoid regressing the richness of data-placeholders should always be replaced with substantive guidance rather than deleted.\r\n4. Adding a New Breed\r\n5. Research. Collect data from reputable, primary sources such as breed registries, veterinary bodies, or peer-reviewed literature. Identify the breed's original purpose, temperament, exercise needs, coat type, and health considerations. For example, the Kangal is a traditional Turkish livestock guardian used to protect sheep from wolves, while the Thai Ridgeback is a primitive pariah-type dog with high prey drive and independent temperament[1].\r\n6. Alias mapping. Append synonyms, local names, and abbreviations to breed_aliases.json. Do not duplicate canonical keys. Use consistent capitalisation for keys, but preserve local casing in alias lists (e.g., \"Kangal Çoban Köpeği\").\r\n7. Taxonomy. Add an entry to breed_taxonomy.json with the closest akc_group (or FCI/FSS approximation) and an appropriate set of clusters. Reuse existing clusters where possible (e.g., guardian_protection, independence_high, prey_drive_high, coat_double, muzzle_brachy). If a new behavioural phenotype emerges across multiple breeds, propose a new cluster via the rules library.\r\n8. Group assignment. If the breed belongs to an umbrella group already defined in breed_groups.json, there is nothing to do. Otherwise, either extend an existing group's examples list or create a new group entry. New groups must include all fields (examples, core traits, enrichment, tips, etc.) to avoid UI gaps.\r\n9. Breed-specific overrides. Only create entries in reco-breed.json when a breed's needs differ materially from its clusters. Use specific, actionable bullet points. Keep lane names consistent (training, health, exercise, bonding, gear, nutrition). Omitting a lane or age means the defaults will apply.\r\n10. Banded recommendations. Populate reco-banded.json for breeds that warrant broad, multi-age guidance. For many breeds it suffices to rely on the rules library; banded overrides should be used sparingly to avoid duplication.\r\n11. Version bump. Update the version query in app.js for any modified file (e.g., breed_aliases.json?v=2). This ensures users download the new data.\r\n12. Data Quality Standards\r\n13. Comprehensiveness. Avoid leaving \"blank\" guidance. If a lane is empty, inherit from clusters or defaults; only override when you have high-confidence, breed-specific advice. Never cut existing content to shorten an entry-replace it with richer, evidence-based recommendations.\r\n14. Consistency. Use the same grammatical style across bullet points (present-tense commands; second-person point of view). Keep lists short (typically 2-4 bullets) and actionable.\r\n15. Attribution. When deriving cluster assignments or traits from external sources, capture the justification in internal comments or commit messages. For example, the Africanis is a landrace dog shaped by natural selection and exhibits watchful territorial behaviour with high survival instincts[2]; this supports classifying it as independent and guardian oriented.\r\n16. Localization. The dataset should remain culturally neutral. Do not embed region-specific advice or brand names in the core guidance. Gift tags can be mapped to different marketplaces through the affiliate configuration.\r\n17. Monetization & Ethics\r\n18. Gift recommendations must be additive and optional. They should never replace or obscure care guidance. Mark affiliate links clearly within the hidden gift panel, and include an earnings disclaimer as required by law.\r\n19. Avoid promoting products that could harm dogs or contradict veterinary best practices.\r\n20. Memory Reset & Usage of this Document\r\n21. In some tool environments, memory may reset between messages. Save this guidance file (guidance.md) in your working directory and refer to it before making any proposal. The presence of this file should prevent accidental truncation of data or schema misunderstandings.\r\n22. When uncertain, err on the side of more detail and preserve prior work. Never drop existing bullet lists without a strong reason and a better replacement.\r\nExample Expansion: International Guardians & Pariah Types\r\nBelow is a template illustrating how to add two umbrella groups and a handful of breeds. Adapt names, clusters, and examples as needed.\r\nA. New umbrella groups (breed_groups.json)\r\n[\r\n // ... existing group entries ...,\r\n {\r\n \"id\": \"international_guardian\",\r\n \"name\": \"International Guardian Breeds\",\r\n \"examples\": [\"Kangal\", \"Caucasian Shepherd Dog\", \"Central Asian Shepherd Dog\", \"Boerboel\", \"Spanish Mastiff\"],\r\n \"core_traits\": [\r\n \"Livestock guardians with strong protective instincts\",\r\n \"Independent decision makers; thrive on space and clear boundaries\",\r\n \"Large/giant breeds requiring steady, confident handling\"\r\n ],\r\n \"enrichment\": [\r\n \"Calm patrol walks or perimeter scent searches\",\r\n \"Boundary and neutrality training with structured greetings\",\r\n \"Puzzle feeders and low-impact nosework to satisfy problem-solving drives\"\r\n ],\r\n \"owner_tips\": [\r\n \"Provide secure fencing and defined territories; avoid leaving unattended with strangers\",\r\n \"Early socialization is crucial-introduce new people and animals gradually\",\r\n \"Use positive reinforcement and patient leadership; harsh corrections erode trust\"\r\n ],\r\n \"notification_short\": \"Reinforce calm neutrality with a patrol or scent game today.\",\r\n \"cautions\": [\r\n \"Can be aloof or reactive to perceived threats; manage interactions carefully\",\r\n \"Heat sensitivity and joint stress are concerns for heavy breeds\"\r\n ],\r\n \"gift_tags\": [\"training\", \"scent\", \"puzzle\", \"place_mat\", \"cooling_mat\"]\r\n },\r\n {\r\n \"id\": \"village_landrace_type\",\r\n \"name\": \"Pariah / Landrace Types\",\r\n \"examples\": [\"Thai Ridgeback\", \"Canaan Dog\", \"Carolina Dog\", \"Africanis\"],\r\n \"core_traits\": [\r\n \"Primitive dogs shaped by natural selection; highly intelligent and alert\",\r\n \"Independent with strong survival and prey drives\",\r\n \"Bond deeply with family but remain reserved with strangers\"\r\n ],\r\n \"enrichment\": [\r\n \"Scent work and foraging games to channel instincts\",\r\n \"Long-line hikes or safe off-lead exploration in secure areas\",\r\n \"Recall and engagement games focusing on voluntary check-ins\"\r\n ],\r\n \"owner_tips\": [\r\n \"Use positive reinforcement to build trust; avoid coercive methods\",\r\n \"Provide robust containment (secure fencing, long lines) to prevent wandering\",\r\n \"Socialize early but avoid overwhelming environments; allow choice and control\"\r\n ],\r\n \"notification_short\": \"Plan a scent game and recall session to harness that primitive drive.\",\r\n \"cautions\": [\r\n \"High prey drive-manage small animals and wildlife encounters\",\r\n \"May not thrive in dense urban settings without ample outlets\"\r\n ],\r\n \"gift_tags\": [\"scent\", \"foraging\", \"long_line\", \"puzzle\"]\r\n }\r\n]\r\nB. Breed aliases (breed_aliases.json)\r\n{\r\n // ... existing meta keys and breeds ...,\r\n \"Kangal\": [\"Kangal Shepherd\", \"Turkish Kangal\", \"Kangal Çoban Köpeği\"],\r\n \"Central Asian Shepherd Dog\": [\"Central Asian Ovcharka\", \"CASD\", \"Alabai\"],\r\n \"Caucasian Shepherd Dog\": [\"Caucasian Ovcharka\", \"Caucasian Mountain Dog\"],\r\n \"Boerboel\": [\"South African Mastiff\", \"Boerbull\", \"Boerboel Dog\"],\r\n \"Spanish Mastiff\": [\"Mastín Español\", \"Spanish Mastin\"],\r\n \"Thai Ridgeback\": [\"TRD\", \"Mah Thai Lung Ahn\"],\r\n \"Canaan Dog\": [\"Israeli Canaan\", \"Canaan\", \"Kelev K'naani\"],\r\n \"Carolina Dog\": [\"American Dingo\", \"Dixie Dingo\", \"Carolina Dingo\"],\r\n \"Africanis\": [\"Africanis Dog\", \"African Dog\", \"Bantu Dog\"]\r\n}\r\nC. Taxonomy entries (breed_taxonomy.json)\r\n{\r\n // ... existing breeds ...,\r\n \"Kangal\": {\r\n \"akc_group\": \"Working\",\r\n \"clusters\": [\"guardian_protection\", \"independence_high\"],\r\n \"meta_groups_hint\": [\"International-guardian\"]\r\n },\r\n \"Central Asian Shepherd Dog\": {\r\n \"akc_group\": \"Working\",\r\n \"clusters\": [\"guardian_protection\", \"independence_high\", \"coat_double\", \"coat_shed_heavy\"],\r\n \"meta_groups_hint\": [\"International-guardian\"]\r\n },\r\n \"Caucasian Shepherd Dog\": {\r\n \"akc_group\": \"Working\",\r\n \"clusters\": [\"guardian_protection\", \"independence_high\", \"coat_double\", \"coat_shed_heavy\", \"climate_heat_sensitive\"],\r\n \"meta_groups_hint\": [\"International-guardian\"]\r\n },\r\n \"Boerboel\": {\r\n \"akc_group\": \"Working\",\r\n \"clusters\": [\"guardian_protection\", \"bulldog_molosser\", \"independence_high\", \"chew_power\"],\r\n \"meta_groups_hint\": [\"International-guardian\"]\r\n },\r\n \"Spanish Mastiff\": {\r\n \"akc_group\": \"Working\",\r\n \"clusters\": [\"guardian_protection\", \"bulldog_molosser\", \"independence_high\"],\r\n \"meta_groups_hint\": [\"International-guardian\"]\r\n },\r\n \"Thai Ridgeback\": {\r\n \"akc_group\": \"Hound\",\r\n \"clusters\": [\"sight_hound\", \"prey_drive_high\", \"independence_high\"],\r\n \"meta_groups_hint\": [\"Village/Landrace/Type\"]\r\n },\r\n \"Canaan Dog\": {\r\n \"akc_group\": \"Herding\",\r\n \"clusters\": [\"guardian_protection\", \"prey_drive_high\", \"independence_high\"],\r\n \"meta_groups_hint\": [\"Village/Landrace/Type\"]\r\n },\r\n \"Carolina Dog\": {\r\n \"akc_group\": \"Hound\",\r\n \"clusters\": [\"sight_hound\", \"prey_drive_high\", \"independence_high\"],\r\n \"meta_groups_hint\": [\"Village/Landrace/Type\"]\r\n },\r\n \"Africanis\": {\r\n \"akc_group\": \"Hound\",\r\n \"clusters\": [\"guardian_protection\", \"prey_drive_high\", \"independence_high\"],\r\n \"meta_groups_hint\": [\"Village/Landrace/Type\"]\r\n }\r\n}\r\nD. Breed-specific overrides (reco-breed.json)\r\nOnly include ages and lanes where the general rules do not suffice. Below is a minimal example for two breeds to illustrate the structure; expand as data becomes available.\r\n{\r\n \"breeds\": {\r\n // ... existing breeds ...,\r\n \"Kangal\": {\r\n \"ages\": {\r\n \"12\": {\r\n \"lanes\": {\r\n \"training\": [\r\n \"Neutrality > friendliness: reward calm observation of strangers\",\r\n \"Teach solid boundary cues (backyard perimeter, 'place' mat)\"\r\n ],\r\n \"exercise\": [\r\n \"Long, slow patrol walks (45-60 min) plus mental scent games\",\r\n \"Avoid repetitive fetch; focus on varied terrain and nosework\"\r\n ],\r\n \"health\": [\r\n \"Monitor joints; avoid jumping until growth plates close\",\r\n \"Heat management in summer; provide shade and water\"\r\n ]\r\n }\r\n },\r\n \"36\": {\r\n \"lanes\": {\r\n \"training\": [\r\n \"Maintain neutrality training; practice controlled greetings with visitors\",\r\n \"Introduce advanced scent discrimination games to mimic patrol duties\"\r\n ],\r\n \"exercise\": [\r\n \"Daily patrol or perimeter walk (60+ min) with decompression sniff time\"\r\n ],\r\n \"gear\": [\r\n \"Well-fitted Y-harness; sturdy long line for field scent games\",\r\n \"Cooling mat in warm months\"\r\n ]\r\n }\r\n }\r\n }\r\n },\r\n \"Thai Ridgeback\": {\r\n \"ages\": {\r\n \"12\": {\r\n \"lanes\": {\r\n \"training\": [\r\n \"High-value recall games; long-line play in safe areas\",\r\n \"Trick chaining (spin ? down ? touch) to engage independent mind\"\r\n ],\r\n \"exercise\": [\r\n \"Daily sprints (5-10 min) in fenced area + decompression walks\",\r\n \"Foraging and scent puzzles on rest days\"\r\n ],\r\n \"bonding\": [\r\n \"Massage and cooperative care sessions to build trust\",\r\n \"Interactive toy play to satisfy prey drive\"\r\n ]\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\nFinal Notes\r\nThis guide is meant to be an evolving reference. As you continue to refine Barkday's data, append new clusters, breeds, and rules in a way that always adds value and never removes richness. Use versioned data files and treat major changes as coordinated releases. Above all, remember that your work directly influences how guardians care for their dogs; accuracy and compassion matter.\r\n\r\n[1] Thai Ridgeback - Wikipedia\r\nhttps://en.wikipedia.org/wiki/Thai_Ridgeback\r\n[2] Africanis - Dog of Africa\r\nhttps://sa-breeders.co.za/org/africanis/index.htm\r\n","inline_bytes":16407,"content_sha256":"e254c51f63f9224101c5f14d77b285e704318570f345a29b6419d52ce450e724"},{"path":"docs/MAINTAINERS.md","size":8114,"sha":"3e247c5c0c5fd5fedcd9afba783d1e70588a86f9","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/MAINTAINERS.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/MAINTAINERS.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# MAINTAINERS - Barkday(TM) (PRIVATE)\n\n> **Confidential.** Do not share outside the core team.\n> This document describes internal governance, release workflow, data versioning, and distribution\n> for the Barkday(TM) app\n> and datasets.\n\n## 1) Purpose & Scope\n\nThis file is the single source of truth for:\n\n- Release governance (major vs. minor)\n- Data file ownership and versioning\n- Staging -> production workflow\n- Play Store (TWA) packaging steps\n- Security, IP protection, and trademark usage\n- Incident response & rollback\n\n## 2) Contacts & Ownership\n\n- **Product/Brand:** Owner (Trademark)\n- **Tech Lead:** [Name]\n- **Data Steward (Breeds/Rules):** [Name]\n- **Release Manager (Play/TWA):** [Name]\n- **Security/Access Control:** [Name]\n\n> Maintain a separate private contact sheet with phone/email + recovery methods.\n\n---\n\n## 3) Repos & Environments\n\n### Repositories\n\n- **Public app host (static):** `candidquality.github.io/Barkday` (public, minimal; no IP-heavy docs)\n- **Private ops/docs repo:** `barkday-internal` (PRIVATE) - holds: this file, data governance docs,\n release checklists, packaging scripts, keys/secrets (via GitHub Environments),\n and staging artifacts.\n- **Optional local-only archive:** Encrypted drive or DMS (e.g., Google Drive w/ client-side encryption, or\n 1Password Documents).\n\n### Environments\n\n- **Local dev:** developer machines; never commit secrets\n- **Staging:** private preview build (same origin-path as prod; different branch/URL)\n- **Production:** `candidquality.github.io/Barkday` (Pages)\n\n> **Rule:** No private docs, keys, or internal scripts in the public repo. The public README stays marketing-level only.\n\n---\n\n## 4) Data Model - Files & Responsibility\n\n> Keep all schema & file details **out of public READMEs**. This section is PRIVATE.\n\n- `breed_aliases.json` - Data Steward\n- `breed_taxonomy.json` - Data Steward\n- `breed_groups.json` - Data Steward\n- `reco-breed.json` - Data Steward\n- `reco-banded.json` - Data Steward\n- `rules_library.json` - Data Steward\n- `barkday_expansion_breeds_v1.json` - Data Steward (expansion sets)\n- External feed (read-only): Gift suggestions (affiliate-safe list)\n\n## Principles\n\n- Defaults live in `rules_library.json`; overrides only where justified.\n- Avoid deletions that reduce guidance richness; replace with better specifics.\n- Localization-neutral; no brand names in core guidance.\n\n---\n\n## 5) Versioning & Cache Busting\n\n**Why:** GitHub Pages + service worker caching require explicit busting.\n\n## Policy\n\n- Every change to any data file requires bumping its `?v=` query in `app.js` (e.g.,\n `data/breed_aliases.json?v=3` -> `v=4`).\n- Bundle related changes (aliases + taxonomy + groups + reco) in **one major** release to avoid transient mismatches.\n- Minor typo/alias additions may ship alone but still require a `?v=` bump for the touched file(s).\n- Update `app version` log line in `app.js` console (e.g., `[Barkday] vYYYY-MM-DD-n`).\n\n## Cache-bust checklist\n\n- [ ] Increment `?v=` on each changed data file\n- [ ] Increment `app.js` version banner\n- [ ] Invalidate SW: bump a comment hash in `service-worker.js`\n- [ ] Test: hard-refresh and first-run load on Android + desktop\n\n---\n\n## 6) Release Types\n\n## Major (coordinated)\n\n- Adds/refactors multiple breeds or structural metadata\n- Changes umbrella group definitions or cluster logic\n- Requires: full data QA + cross-file alignment + coordinated `?v=` bumps\n\n## Minor\n\n- Typos, single alias additions, small bullet fixes\n- Single-file `?v=` bump + smoke test\n\n---\n\n## 7) Staging -> Production Workflow\n\n1. **Feature branch** in private repo (`barkday-internal`) with data edits + unit checks.\n2. **Staging sync** to a staging branch of the public repo (or a separate staging site if needed).\n3. **QA Checklist**\n - [ ] Aliases resolve to canonical names (no orphan breeds)\n - [ ] Taxonomy groups/clusters exist and are spelled consistently\n - [ ] No empty lanes when an override exists (inherit or fill)\n - [ ] Console shows all data files loaded without 404/parse errors\n - [ ] Birthday calc sanity tests (rounding, edge dates)\n - [ ] Gift panel hidden by default; disclosure visible **in-app** after clicking to open the gift links,\n and before first affiliate interaction\n4. **Production publish** by PR/MR with required reviewers (CODEOWNERS).\n5. **Post-release**: verify SW update prompt & first-run experience on Android and desktop.\n\n---\n\n## 8) Play Store (TWA) Packaging - High Level\n\n- Generate AAB via PWABuilder/Bubblewrap (TWA).\n- Host **Digital Asset Links** at `/.well-known/assetlinks.json` with package name + SHA-256.\n- Create listing: title, short/long description, category, privacy URL, icon, feature graphic, screenshots.\n- Policy forms: Data Safety (no collection), Target Audience, Ads (No), Content rating.\n- Upload AAB, accept Play App Signing; note Google's signing certificate SHA-256.\n- If SHA-256 changes, update `assetlinks.json` and re-deploy site.\n- Roll out to Production after internal testing.\n\n> Keep a separate `DEPLOYMENT.md` (PRIVATE) with exact command invocations, fingerprints, and image specs.\n\n---\n\n## 9) Security & IP Protection\n\n- **License:** (c) 2025 [Owner]. **All Rights Reserved.** (no redistribution/derivatives)\n- **Repo visibility:** Public app repo contains **only** the app and public-safe README.\n All internal docs/scripts live in **`barkday-internal` (PRIVATE)** or encrypted local storage.\n- **Branch Protection (private repo):** require reviews, signed commits, status checks.\n- **Secrets:** never in code; use GitHub Environments/Secrets (private repo only).\n- **Data exfiltration risk:** Don't push schemas or internal docs to the public repo, even temporarily.\n- **Trademark:** Barkday(TM) name/logo only in approved assets; disallow third-party use.\n- **Affiliate disclosure:** in-app, contextually adjacent to gift panels **before** link interaction.\n\n---\n\n## 10) Incident Response & Rollback\n\n### Trigger examples\n\n- Broken data load (404/JSON parse)\n- Incorrect birthday math or UI blocker\n- SW caching trap or stale data\n- Public IP leak (docs or schemas)\n\n### Immediate actions\n\n1. **Revert** to last-known-good commit on public repo.\n2. **Purge SW:** bump service worker and `?v=` parameters; post a quick release note.\n3. **If IP leak:** remove files, rotate credentials, and invalidate caches; review Git history & purge if necessary.\n4. **Log incident** in private repo with root cause + corrective actions.\n\n---\n\n## 11) Governance References (PRIVATE)\n\n- `DATA-GOVERNANCE.md` - detailed schemas, editorial standards, curation sources\n- `DEPLOYMENT.md` - TWA/Bubblewrap commands, fingerprints, image specs, store copy\n- `RELEASE-CHECKLIST.md` - step-by-step ship list\n- `AFFILIATE-POLICY.md` - placement language + examples (app-only)\n- **Gifts Access Policy** - Gifts are available to all users. Premium tiers may include optional partner perks\n (discounts/coupons), but access to the gifts list itself is never paywalled.\n\n---\n\n## 12) Roadmap Notes (Internal)\n\n- Designer/Companion hybrid breeds (commercial segment)\n- Premium add-ons (reminders, widgets, PDF export)\n- i18n content pipeline\n- Structured feedback capture (opt-in)\n\n---\n\n## Policy - Version-Lock (Data Sources)\n\nAll core JSON data endpoints must share the same cache-bust query tag.\n\n- Allowed tags: ISO-like date with sequence (YYYY-MM-DD-N), e.g., 2025-10-06-1.\n- Required files: BREED_GROUPS_URL, RECO_BANDED_URL, RECO_BREED_URL, BREED_ALIASES_URL, TAXONOMY_URL, GIFT_FEED_URL.\n- On change: Update all constants together in app.js and add a matching /docs/CHANGELOG.md entry.\n\n## Policy - Free-Tier Limits & A11y Drawer State\n\nFree-tier behavior:\n\n- Max unique dogs per device: **5** (case-insensitive by name).\n- Max saved runs per device: **50** (tier-aware).\n- Exceeding cap shows a toast; user retains full offline functionality.\n\nDrawer accessibility:\n\n- Any `.bd-drawer` with `.is-open` **must** have `aria-hidden=\"false\"`.\n- When closed, set `aria-hidden=\"true\"`.\n- Site code includes an observer-based safety net to enforce the attribute automatically.\n","inline_bytes":8114,"content_sha256":"cb9ad01cccf66e85f789709338169e797777173a2ed86991a0e73846c74226a7"},{"path":"docs/Master_Note_v0_Barkday_Aging-Model_Integration_Master_Note.md","size":5349,"sha":"a19350eb433e428090b97279ef6716b16a447756","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/Master_Note_v0_Barkday_Aging-Model_Integration_Master_Note.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/Master_Note_v0_Barkday_Aging-Model_Integration_Master_Note.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"Barkday Aging-Model Integration Master Note\r\n(Full instruction set — safe to paste into any new session for continuation)\r\nPurpose\r\nIntegrate 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.\r\n \r\nA. Core Age Curve Baseline\r\n•\tKeep current 15-9 rule (≈15 dog-years first human year, +9 second year) with existing weight-based smoothing.\r\n•\tThis mapping is identical for all breeds until 24 months.\r\n•\tDivergence begins after 24 months, using weight-specific curve modifiers already in place.\r\n•\tBase function remains baseDogYears(weightClass, months).\r\n \r\nB. Post-24-Month Breed Aging Modifiers\r\nConcept\r\nAdd a per-breed age_rate multiplier applied only to months beyond 24.\r\nIt scales how quickly the “dog-years” accumulate after the puppy stage.\r\nTypical Range\tMeaning\r\n1.00\tStandard curve (default)\r\n1.10–1.20\tShorter-lived breeds (giants, brachies)\r\n0.85–0.95\tLong-lived breeds (toys, spitz)\r\nImplementation\r\n1.\tAdd age_rate field to each breed in breed_taxonomy.json.\r\nExample: \r\n2.\t\"Great Dane\": { \"age_rate\": 1.15 },\r\n3.\t\"Chihuahua\": { \"age_rate\": 0.90 }\r\n4.\tClamp all values to 0.80–1.20 to prevent extremes.\r\n5.\tIf a breed lacks age_rate, use a cluster fallback (e.g., giant_size → 1.12, toy_long_lived → 0.90).\r\nCode Hook\r\nIn app.js, wrap existing call:\r\nif (months <= 24) return baseDogYears(weightClass, months);\r\nconst rate = getBreedAgeRate(breed, taxonomy, fallbacks);\r\nconst beyond = months - 24;\r\nreturn baseDogYears(weightClass, 24 + beyond * rate);\r\n \r\nC. Cluster Fallback Map (global default)\r\n{\r\n \"giant_size\": 1.12,\r\n \"large_brachy\": 1.10,\r\n \"bulldog_molosser\": 1.07,\r\n \"sighthound\": 1.03,\r\n \"herding_athlete\": 1.02,\r\n \"retriever_common\": 1.00,\r\n \"spitz_nordic\": 0.98,\r\n \"hound_small\": 0.96,\r\n \"dachshund_type\": 0.95,\r\n \"toy_long_lived\": 0.90\r\n}\r\n(Store in rules_library meta or app.js constant.)\r\n \r\nD. Mixed-Breed (DNA) Age-Rate Blending\r\nData Entry\r\nUser enters top 2–3 breeds and percentages (Embark results).\r\nEffective Age Rate Formula\r\n1.\tCompute weighted average of component rates.\r\n2.\tCompute max component rate.\r\n3.\tEffective rate = max(weightedAvg, maxRate × 0.95) (conservative blend).\r\n4.\tApply safety floors/caps by cluster share: \r\no\tgiant_size ≥ 30 % → ≥ 1.10\r\no\tlarge_brachy ≥ 30 % → ≥ 1.08\r\no\tbulldog_molosser ≥ 40 % → ≥ 1.06\r\no\ttoy_long_lived ≥ 60 % → ≤ 0.92\r\n5.\tClamp to 0.80–1.20.\r\nOutput\r\nReturn adjustedMonths = 24 + (months − 24) × rateEff.\r\n \r\nE. Expansion & Data Granularity\r\nPhase\tGoal\tNote\r\nPhase 1\tImplement interpolation between existing 6 bands (weighted blend of adjacent)\tNo data growth\r\nPhase 2\tExpand to 24 birthday sub-bands (0–24 mo)\tAuto-inherit + override only new bullets\r\nPhase 3\tAdd age_rate modifiers (this spec)\tMinimal file bloat\r\nExpected total JSON size ≈ 5–6 MB compressed (well within GitHub Pages limits).\r\n \r\nF. Hosting Model (retain $0 cost)\r\n•\tSee file: Master Note v2 — Paid Tier & Hosting Gate (Single Codebase).md for more advanced guidance on paid tier and hosting gate. \r\n•\tStatic: GitHub Pages (free).\r\n•\tDynamic/Premium Data: Cloudflare Workers + KV (free tier) \r\no\t100 k req/day free, 1 GB storage.\r\no\tOnly serves premium JSON (rules overlays, hybrid data) via JWT token.\r\n•\tNo paid server required.\r\n \r\nG. Monetization (future-ready)\r\nTier\tKey Unlocks\tPrice\r\nFree\tBasic calculator + general guidance\t$0\r\nPlus\tBreed-specific + hybrid data, PDF export\t$2.99 mo / $24.99 yr\r\nPro\tDNA mix composer, backup/sync\t$4.99 mo / $39.99 yr\r\nBreeder\tCertificates > 4 dogs\t$9.99 mo\r\n \r\nH. Abuse / Breeder Controls\r\n•\tLimit 4 concurrent dogs per license (localStorage + KV license check).\r\n•\tHash dog records to detect repetitive “add-delete” cycles.\r\n•\tPaid tier unlocks higher count & export rights.\r\n \r\nI. File Update Summary\r\nFile\tAction\r\nbreed_taxonomy.json\tAdd age_rate fields (~110 lines).\r\nrules_library.json\tAdd age_rate_fallbacks map.\r\napp.js\tAdd dog-years wrapper + mix blending logic.\r\nbreed_groups.json\t(optional) no change.\r\nbarkday_expansion_breeds_v1.json\tuntouched.\r\n \r\nJ. Rollout Order (single-pass checklist)\r\n1.\t✅ Confirm current breed list & weight curves stable.\r\n2.\t✅ Add age_rate_fallbacks map to rules or app.js.\r\n3.\t✅ Add age_rate per-breed lines (clamped 0.8–1.2).\r\n4.\t✅ Add helper functions: getBreedAgeRate(), effectiveAgeRateForMix().\r\n5.\t✅ Replace dog-years calc with new post-24-mo logic.\r\n6.\t✅ Verify pure-breed & mix both return valid results.\r\n7.\t✅ (Optional) Interpolation between sub-bands for early life.\r\n8.\t✅ Cache JSON + measure size (< 6 MB).\r\n9.\t✅ Test under GitHub Pages (no backend).\r\n10.\t✅ Add Cloudflare Worker only if/when premium gating needed.\r\n \r\nK. Future Enhancements\r\n•\tPer-breed health/longevity metadata for UI notes (“Typical lifespan 10–12 years”).\r\n•\tUser-visible “Breed adjusted aging applied” badge.\r\n•\tMonthly “Barkday certificate” generator using interpolated data.\r\n \r\nEnd of Master Note\r\n \r\nYou can literally paste this back later with:\r\n“Resume Barkday Aging-Model Integration per Master Note version 1.0”\r\nand any GPT-5 instance will have everything it needs to pick up exactly where we left off — sequence, priorities, and limits included.\r\n\r\n","inline_bytes":5215,"content_sha256":"b27b6f211f2817b6bc26f268d31e8eff048c92d67c79b8e1bdc57a514afe0daf"},{"path":"docs/QA_CHECKLIST.md","size":1008,"sha":"64d09439660d69575df7418d5f76a206b39c1446","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/QA_CHECKLIST.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/QA_CHECKLIST.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Barkday — QA Checklist (Core)\r\n\r\n## Data & Versions\r\n- [ ] All loader URLs share the same `?v=` tag (verify in `console.table`)\r\n- [ ] Startup banner prints the same version tag as the data files\r\n\r\n## Designer/Hybrid Cohort\r\n- [ ] Aliases resolve for Goldendoodle, Labradoodle, Bernedoodle, Cockapoo, Cavapoo, Maltipoo\r\n- [ ] Group “Companion / Hybrid Breeds” renders\r\n\r\n## Save Logic (Free Tier)\r\n- [ ] 5 unique dogs can save; 6th is blocked with toast\r\n- [ ] Multiple saves for same dog allowed\r\n- [ ] Saved drawer shows `Saved dogs: x/5 (free tier)` and updates correctly\r\n\r\n## Premium Loader (Inert)\r\n- [ ] `typeof loadPremiumOverlays === 'function'` is true\r\n- [ ] No `/premium/*` requests without a JWT\r\n\r\n## Accessibility — Drawers\r\n- [ ] When open, drawer has `aria-hidden=\"false\"`; when closed, `\"true\"`\r\n- [ ] No console warnings about focus inside aria-hidden ancestors\r\n\r\n## Offline\r\n- [ ] App loads and basic compute/save works with network disabled (static assets cached)\r\n","inline_bytes":1000,"content_sha256":"15b90495994d1ee36857c5a62eee1ae4787ed81a450fc8dd9ca8a00b7625a3ed"},{"path":"docs/README_barkday-curves.md","size":1553,"sha":"e730bb63a69f8151f93b44e56eeb24c40a1b44f9","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/README_barkday-curves.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/README_barkday-curves.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Barkday Curves Helpers — How to Integrate\n\n## Files\n- `js/barkday-curves.js`: helpers to generate Bark Day schedules\n- `data/curves.json`: tiny config (no big tables)\n - LOCT (Year1/Year2) params\n - Optional `analytic` anchors for t >= 2y (PCHIP)\n\n## Steps\n1. Copy files to your repo:\n - `js/barkday-curves.js`\n - `data/curves.json`\n\n2. In `app.js` (where you compute the next Bark Day):\n ```js\n import { buildBarkdayTimes, barkdayDate, nextKAfterNow } from './js/barkday-curves.js';\n\n // Load curves.json (your existing loader or fetch)\n // const CURVES = await fetch('data/curves.json').then(r=>r.json());\n\n const curveId = CURVES.defaults.overrides[dog.primaryBreed] || CURVES.defaults.group_curve;\n const conf = CURVES.curves[curveId];\n\n const times = buildBarkdayTimes(conf, { maxK: 80, tMaxYears: 12 });\n const { k, tYears } = nextKAfterNow(dog.dob, times);\n const nextDate = barkdayDate(dog.dob, tYears);\n ```\n\n3. PDF header text:\n - “Next Bark Day Plan — turning {k} on {DATE}”\n - Optionally, if breed curve is an override, show a small note: “Using {conf.label}”.\n\n4. Tuning knobs:\n - LOCT Year1: `a0_days` (default 10) — raise to avoid early compression.\n - LOCT Year2: `a0_hint_days` (default 38) — start Y2 not below last Y1 gap.\n - For Labs (and future breeds), edit `analytic.anchors` to shape later years smoothly.\n\n## Notes\nKeep `curves.json` small (labels + anchors), and compute schedules on the client.\nWhen a breed override is applied, show a small note “Using {conf.label}”.","inline_bytes":1533,"content_sha256":"51353f4812d53188ec1e06d7cd64ea9295356f40ce85309c8e0ed003faf3142e"},{"path":"docs/ai/PROJECT_RULES.md","size":904,"sha":"cc8cb45de9bf1c881f9d56de89317ed3f1d8d953","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/ai/PROJECT_RULES.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/ai/PROJECT_RULES.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Barkday Local AI Rules (Read First)\n\n1) No guessing.\n\n- If behavior is unclear, read the actual file(s) first.\n- Quote the exact code you are relying on.\n- Do not invent functions, file paths, or existing logic.\n\n2) Propose before editing.\n\n- Before any edit, provide:\n\n - Proposed change summary\n - Files to touch\n - Risks / side effects\n - Verification steps to run\n\n- Only edit after explicit approval.\n\n3) Decision record required for every change set.\n\n- Add: docs/decisions/DEC-YYYYMMDD-XX-short-title.md\n- Include: goal, approach, files changed, verification run, rollback plan.\n\n4) Keep changes small and reversible.\n\n- One focused objective per change set.\n- Use git commits so every change can be reverted.\n\n5) Verification is mandatory.\n\n- Run: tools/verify.ps1\n- If it fails, fix before asking to push.\n\n6) Do not change affiliate or outbound link behavior unless explicitly requested.\n","inline_bytes":904,"content_sha256":"fa175f2271b132ab30f7d2f353adf21c949f9fde00db8d5705c9d106fb465699"},{"path":"docs/architecture-notes.md","size":1586,"sha":"bed51d0b32ba6c09be3cab5d9d210c5684c58f93","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/architecture-notes.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/architecture-notes.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Barkday Amazon and catalog architecture notes\n\n## Launch phase\n\nUse Barkday-owned curated JSON as the main source of truth. Keep Amazon use limited to Special Links.\n\nThe public page should not call Amazon catalog APIs directly.\n\n## Recommended public-card fields at launch\n\n- title\n- benefit\n- category\n- tags\n- ageAxis\n- minAge / maxAge or minDogYears / maxDogYears\n- sizes\n- chew\n- affiliate.url\n- affiliate.asin\n\n## Later enrichment phase\n\nUse a server-side service that enriches only selected ASINs.\n\nRecommended workflow:\n\n1. Admin discovers or selects ASINs.\n2. Barkday stores those ASINs in its own catalog.\n3. A scheduled server job calls Amazon `GetItems` for those ASINs.\n4. The job writes reduced fields back into an overlay or cache layer.\n5. The front end consumes only Barkday-owned merged output.\n\n## Why `GetItems` should be primary later\n\n- Stable product identity by ASIN\n- Batching up to 10 ASINs per request\n- Better fit for pre-curated catalog entries\n- Lower rate risk than live user-triggered search\n\n## Why `SearchItems` should be admin-only later\n\n- Useful for curation and discovery\n- Not ideal as a public runtime dependency\n- Easier to burn rate limits if every user hits live search\n\n## Cache notes for later implementation\n\nKeep the front end free of Amazon credentials and avoid client-side product-content caching.\n\nServer-side enrichment should separate:\n\n- low-volatility fields like title or image URL\n- higher-volatility fields like offers\n\nEven when you later enrich from Amazon, Barkday's own catalog should remain the ranking and policy layer.\n","inline_bytes":1586,"content_sha256":"df69fa9a1cbec4b50d225910e3299a882e3be2023d3442b81928061f189c6704"},{"path":"docs/barkday_code_review_2025-10-26.md","size":5667,"sha":"19a44571f344ee9b1c6eb28f928dc18bdcc4342e","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/barkday_code_review_2025-10-26.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/barkday_code_review_2025-10-26.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Barkday™ Repo Review — 2025-10-26 14:54:48 CT\n\nBelow is a concise review of the uploaded fileset. Items are ordered by impact.\n\n## Findings\n\n- **High** — **.github/workflows/ai-health.yml**: Workflow references docs/ai-pack-all.txt endpoint that does not exist in repo; will 404 in CI.\n - _Suggested fix:_ Either (A) switch PACK_URL to '/Barkday/dog-gifts.json' (simple) or (B) add a pack builder to emit docs/ai-pack-all.txt.\n- **High** — **app.js**: GIFT_FEED_URL reads from raw.githubusercontent.com; loadGifts() has no local fallback path if the network blocks or rate-limits.\n - _Suggested fix:_ Use BarkdayFetch.fetchJSONWithETag first; if null, fallback to local 'dog-gifts.json'. See patch below.\n- **High** — **app.js**: Chewer mapping collapses to non-schema enums. dog-gifts.schema.json allows 'any','gentle','normal','power'. Current code maps 'power'→'strong' and 'gentle'→'normal', breaking matches.\n - _Suggested fix:_ Normalize synonyms into the canonical four enums. See patch below.\n- **Medium** — **service-worker.js**: Cache-first with ignoreSearch for all requests except index/app.js. JSON under /data/ and gift feed may serve stale copies despite ?v= bumps.\n - _Suggested fix:_ Handle JSON (and /data/) as network-first with cache fallback, or stop ignoring search for .json. Patch below shows a safe rule.\n- **Medium** — **index.html**: No visible affiliate disclosure near 'Gift ideas' section; only appears in Privacy page.\n - _Suggested fix:_ Insert a short affiliate note under the Gift section for compliance.\n\n## What’s already good\n\n- Service Worker precache list resolves to existing assets; maskable icons present.\n- ICS export uses UTC (`toISOString()` → `Z`), which is correct for cross-timezone calendars.\n- PDF add‑on already uses `QR_SCALE = 0.6` (~60%), per your request.\n- Breed naming is corrected to “Greater Swiss Mountain Dog” in all uploaded data files.\n- All `data/*.json` parsed successfully (no syntax errors detected).\n- Manifest `start_url` and `scope` = `/Barkday/` matches GitHub Pages base path.\n\n## Ready-to-apply patches (surgical)\n\n### app.js\n\n```diff\n// --- Replace the chewer normalization block in app.js with this ---\nconst normChew = (s) => {\n // Map synonyms → canonical set: 'any','gentle','normal','power'\n let t = String(s || '').toLowerCase();\n // Strip obvious filler and punctuation\n t = t.replace(/\\bchew(ers?)?\\b/g, '').replace(/[^a-z]/g, '').trim();\n const map = {\n any: 'any', all: 'any', whatever: 'any',\n gentle: 'gentle', soft: 'gentle', light: 'gentle',\n normal: 'normal', regular: 'normal', medium: 'normal',\n power: 'power', strong: 'power', tough: 'power', super: 'power', heavy: 'power'\n };\n return map[t] || t;\n};\n\n// ...\n// In loadGifts(), replace the initial fetch with ETag + local fallback:\nasync function loadGifts(){\n els.gifts.innerHTML=''; els.giftMeta.textContent='Loading…';\n try{\n let items = await (window.BarkdayFetch?.fetchJSONWithETag\n ? BarkdayFetch.fetchJSONWithETag(GIFT_FEED_URL, { cacheMinutes: 120, lsKey: 'giftFeed' })\n : fetch(GIFT_FEED_URL, { cache:'no-store' }).then(r=>r.json())\n );\n if (!items) {\n // robust local fallback if remote is blocked or returns HTML\n try { items = await fetch('dog-gifts.json', { cache:'no-store' }).then(r=>r.json()); }\n catch {}\n }\n if (!Array.isArray(items)) throw new Error('Gift feed unavailable');\n // ... (rest of the existing filtering code follows unchanged)\n } catch (e) {\n console.warn('[Barkday][Gifts] failed:', e);\n els.giftMeta.textContent = 'Gift ideas are temporarily unavailable (network/cache). Try again in a bit.';\n return;\n }\n}\n```\n\n### service-worker.js\n\n```diff\n// --- Insert in service-worker.js, replacing the fetch handler with this policy ---\nself.addEventListener('fetch', (event) => {\n const req = event.request;\n const url = new URL(req.url);\n const isNav = req.mode === 'navigate';\n const isAppJs = url.pathname.endsWith('/app.js') || url.pathname.endsWith('app.js');\n const isJSON = url.pathname.endsWith('.json') || url.pathname.includes('/data/');\n\n // Network-first for index.html, app.js, and JSON/data (to avoid stale packs)\n if (isNav || isAppJs || isJSON) {\n event.respondWith(\n fetch(req).then((res) => {\n const copy = res.clone();\n const key = isAppJs ? new Request(url.origin + url.pathname) : req;\n caches.open(CACHE).then((c) => c.put(key, copy));\n return res;\n }).catch(() => {\n // Return cached copy (match ignores search for resilience on ?v= cache-busters)\n const fallbackKey = isAppJs ? new Request(url.origin + url.pathname) : req;\n return caches.match(fallbackKey, { ignoreSearch: true });\n })\n );\n return;\n }\n\n // Everything else: cache-first\n event.respondWith(\n caches.match(req, { ignoreSearch: true }).then((cached) => {\n if (cached) return cached;\n return fetch(req).then((res) => {\n const copy = res.clone();\n caches.open(CACHE).then((c) => c.put(req, copy));\n return res;\n });\n })\n );\n});\n```\n\n### .github/workflows/ai-health.yml\n\n```diff\n# --- Replace PACK_URL line in .github/workflows/ai-health.yml ---\nconst PACK_URL = 'https://candidquality.github.io/Barkday/dog-gifts.json';\n// And remove the pack parsing; gifts = await (await fetch(PACK_URL)).json();\n```\n\n### index.html\n\n```diff\n\n

\n As an Amazon Associate, Barkday™ earns from qualifying purchases. This does not affect which products are shown.\n

\n```\n","inline_bytes":5633,"content_sha256":"fd251e2fac56848394fe9fc11bfc57fedcff4555dadda4bd988c7d43b3709a5e"},{"path":"docs/decisions/DEC-20260106-01-local-ai-rails.md","size":1260,"sha":"76612520e9c4ff1fe0fdbbcf316f745389152f24","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/decisions/DEC-20260106-01-local-ai-rails.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/decisions/DEC-20260106-01-local-ai-rails.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# DEC-20260106-01 - Local AI rails\n\nStatus: Accepted\nDate: 2026-01-06\n\n## Goal\n\nEstablish minimal, repo-local rails that prevent AI-assisted edits from breaking Barkday data integrity,\ndocs policy, and local verification.\n\n## Intended outcome\n\n- A repo-local rules file exists and is referenced in contributor guidance.\n- Any AI-assisted change must be accompanied by a decision record and must run local verification before commit.\n- Changes are made on a branch and are reversible via version control.\n\n## Non-goals\n\n- Selecting a specific local model, inference engine, or hardware stack.\n- Automating commit signing or branch protection from within this repo.\n\n## Constraints\n\n- No secrets or private operational details in the public repo.\n- The rails must be easy to follow for a novice contributor.\n\n## Acceptance criteria\n\n- The rails are documented, repeatable, and do not block normal manual edits.\n- A contributor can follow the rails to make a change and pass checks on Windows.\n- The rails do not require external paid services.\n\n## Rollback plan\n\n- Revert the commit(s) that introduced the rails.\n- Remove the rules file and any new tooling, then restore prior documentation.\n\n## Notes\n\nThese rails are about safety and repeatability, not speed.\n","inline_bytes":1260,"content_sha256":"faf537bb3d0d65209e5892d5d4d098aea02a69e410f9952ff24c1b9140eda11a"},{"path":"docs/decisions/DEC-20260106-02-data-integrity-verify.md","size":1478,"sha":"e7b95bde67585ab1b9e56f2b8bc25cd9bef7e20f","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/decisions/DEC-20260106-02-data-integrity-verify.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/decisions/DEC-20260106-02-data-integrity-verify.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# DEC-20260106-02 - Data integrity verify\n\nStatus: Accepted\nDate: 2026-01-06\n\n## Goal\n\nAdd automated verification that catches alias/taxonomy drift and encoding-related read issues before merges.\n\n## Intended outcome\n\n- `tools/verify-breed-data.ps1` and `tools/verify-breed-data.sh` return exit code 1 if any of the following are true:\n - Any canonical key in `data/breed_aliases.json` (excluding keys starting with `_`) does not exist as a top-level key\n in `data/breed_taxonomy.json`.\n - Any alias string (case-insensitive, trimmed) appears under more than one canonical key.\n\n- Windows PowerShell reads JSON as UTF-8 explicitly to prevent false failures caused by encoding issues (e.g.,\n `\"Vend\\u00e9en\"` becoming `\"Vend\\u00c3\\u00a9en\"`).\n\n## Non-goals\n\n- Fixing historical data problems inside the JSON files as part of this decision.\n- Adding a full schema validator for every data file.\n\n## Constraints\n\n- Must run on Windows (PowerShell 7) without requiring a separate runtime.\n- Must not rely on network access.\n\n## Acceptance criteria\n\n- The verification scripts fail fast with a clear error message and non-zero exit code.\n- The verification scripts pass on a clean repo checkout on Windows and Linux/macOS.\n\n## Rollback plan\n\n- Remove the verification scripts and any workflow hooks that call them.\n- Revert the commit(s) that introduced the checks.\n\n## Notes\n\nThis is intentionally minimal: it protects core cross-file relationships and prevents silent drift.\n","inline_bytes":1478,"content_sha256":"5a7167bd3714a540b338b7c657db18bd965f5a7e5ba051920ff6c4cff5c66baf"},{"path":"docs/decisions/DEC-20260504-01-v2-gift-runtime-feed.md","size":1758,"sha":"1372b25e7fc0e1625d3ece77e724b4e17cbe121e","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/decisions/DEC-20260504-01-v2-gift-runtime-feed.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/decisions/DEC-20260504-01-v2-gift-runtime-feed.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Decision Record: V2 Gift Runtime Feed\n\nDate: 2026-05-04\nChange ID: DEC-20260504-01\nBranch: main\n\n## Decision\n\nThe canonical gift system is the v2 pipeline.\n\nCanonical source inputs:\n\n- `data/dog-gifts-base.json`\n- `data/gift-batches/*.json`\n- `data/dog-gifts-preferred.json`\n\nCanonical generated outputs:\n\n- `data/dog-gifts-catalog.json`\n- `data/dog-gifts-merged.json`\n\nThe canonical runtime gift feed path is `data/dog-gifts-merged.json`. GitHub Pages publishes that same repo path at `https://candidquality.github.io/Barkday/data/dog-gifts-merged.json`. There is no separate promote step in the current workflow; rebuilding and committing the merged output lets the normal Pages deployment publish the updated feed.\n\nRoot-level `dog-gifts.json` and `dog-gifts.schema.json` are legacy compatibility artifacts only. New product work should not be added to that path unless a temporary compatibility export is explicitly needed.\n\nRaw Amazon files under `data/raw-amazon/` are evidence and import material only, not runtime feeds.\n\n## Update Workflow\n\n1. Edit only v2 source inputs: base, batch, or preferred overlay files.\n2. Run `.\\tools\\run-barkday-checks.ps1`.\n3. Inspect the source and generated output diffs.\n4. If runtime behavior changed, verify gift loading locally.\n5. Commit the source changes and regenerated v2 outputs together.\n\nThe helper rebuilds `data/dog-gifts-catalog.json`, validates v2 catalog/preferred data, merges `data/dog-gifts-merged.json`, runs gift smoke checks, and runs `node .\\scripts\\barkday-doctor.mjs`.\n\n## Guardrail\n\n`node .\\scripts\\barkday-doctor.mjs` reports the canonical local feed path, the published Pages feed URL, the expected 182-item launch catalog size, and the deprecated status of the root legacy gift files.\n","inline_bytes":1758,"content_sha256":"b03a8fe10090684469f8c06fd7abd79ec3c5e62961ee9d98b7b083c375e3fd52"},{"path":"docs/decisions/DEC-TEMPLATE.md","size":634,"sha":"47066b214484b270995a0f1f86f6e62b5b9c1c34","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/decisions/DEC-TEMPLATE.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/decisions/DEC-TEMPLATE.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Decision Record: DEC-YYYYMMDD-XX-short-title\n\nDate: YYYY-MM-DD\nChange ID: DEC-YYYYMMDD-XX\nBranch: change/...\n\n## Goal\n\n(What problem are we solving?)\n\n## Intended outcome\n\n(What should be true after this change? Be specific.)\n\n## Plan summary\n\n(Short plan, bullets are fine.)\n\n## Files changed\n\n- file1\n- file2\n\n## Verification run\n\nCommands executed:\n\n- powershell -NoProfile -ExecutionPolicy Bypass -File tools/verify.ps1\n\nResults:\n\n- PASS/FAIL\n- Notes (if any)\n\n## Rollback plan\n\n(How to revert if wrong.)\n\n- git revert COMMIT_SHA\nor\n- git reset --hard COMMIT (only if not pushed)\n\n## Notes\n\n(Anything important for future you.)\n","inline_bytes":634,"content_sha256":"93a99b4567e1e2f0af874e0a7cd0e13844ffa83dd17ee75fcaff93097b446812"},{"path":"docs/principles/guardian-education-and-veterinary-guidance.md","size":3105,"sha":"3281ba5bce1447ca20fe31bb570aae5fa2dd2a96","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/principles/guardian-education-and-veterinary-guidance.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/principles/guardian-education-and-veterinary-guidance.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Guardian Education and Veterinary Guidance Principle\n\nLast updated: 2026-05-04\n\nThis document captures a core Barkday principle for health, wellness, training, and care content.\n\nBarkday is not a veterinary diagnostic tool. It does not diagnose conditions, prescribe treatment, replace a veterinarian-client-patient relationship, or tell guardians to ignore qualified veterinary care.\n\nAt the same time, Barkday should not train guardians to be passive. The app exists partly to help people become more informed, observant, and prepared advocates for their dogs.\n\n## Core Position\n\nBarkday provides general education and planning support. It helps guardians notice patterns, understand breed and life-stage risks, track changes, ask informed questions, and seek qualified veterinary guidance or a second opinion when something does not seem right.\n\nThe intended balance is:\n\n- Do not diagnose.\n- Do not prescribe.\n- Do not claim certainty where evidence is limited.\n- Do not imply that all veterinary advice is automatically correct.\n- Do encourage observation, documentation, informed questions, and appropriate professional care.\n- Do normalize seeking a second opinion when symptoms, explanations, or treatment response do not match what the guardian is seeing.\n\n## Preferred Content Pattern\n\nUse wording that helps guardians observe and communicate clearly.\n\nPreferred style:\n\n- \"Track changes in appetite, mobility, stool, breathing, energy, or comfort, and bring clear notes to a qualified veterinarian.\"\n- \"Ask your veterinarian whether screening is appropriate for your dog's age, breed, history, and symptoms.\"\n- \"If the explanation or treatment plan does not match what you are seeing, consider a qualified second opinion.\"\n- \"Keep simple notes on when the issue started, what changed, and what improves or worsens it.\"\n\nAvoid wording that sounds like Barkday is diagnosing or prescribing.\n\nAvoid:\n\n- \"This means your dog has...\"\n- \"Treat this with...\"\n- \"Give your dog...\"\n- \"This will prevent...\"\n- \"Your vet knows best\" as a blanket statement.\n- \"Just ask your vet\" as a substitute for useful education.\n\n## Veterinary Guidance Standard\n\nReferences to veterinarians should be respectful but not blindly deferential.\n\nGood Barkday wording should encourage guardians to work with qualified professionals while also helping them understand enough to notice when a concern deserves clearer answers, follow-up testing, or a second opinion.\n\nThe app should help users prepare better questions, such as:\n\n- What signs should I monitor?\n- What would make this urgent?\n- What are the common breed or age-related risks?\n- What test would confirm or rule out the concern?\n- What side effects or warning signs should I watch for?\n- When should I seek a second opinion?\n\n## Launch Content Rule\n\nBefore release, public health, wellness, nutrition, exercise, senior-care, and behavior guidance should be reviewed against this principle.\n\nThe goal is not to weaken the content. The goal is to make it educational, careful, and useful without crossing into diagnosis, prescription, or unsupported certainty.","inline_bytes":3105,"content_sha256":"f7267761e80661565eb434cc48a647fe54099fe103155e582a7b74254deb612b"},{"path":"docs/roadmap/barkday-continuity-roadmap.md","size":10808,"sha":"b9d9f7ccd07566ff4d5a5e40cecbd6d71316fa8b","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/roadmap/barkday-continuity-roadmap.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/roadmap/barkday-continuity-roadmap.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Barkday Continuity Roadmap\n\nLast updated: 2026-05-04\n\nThis note reconciles the current Barkday direction with older master notes and project notes. It is a continuity guide, not a full master-note replacement and not an implementation plan.\n\n## Current Baseline\n\n- Barkday is app-first: the core value is the calculator, Bark Day planning, care guidance, training, enrichment, and a positive celebratory experience.\n- GitHub Pages is staging/testing and the current public hosting path.\n- The v2 gift feed is canonical. See `docs/decisions/DEC-20260504-01-v2-gift-runtime-feed.md`.\n- Approved-only gift display is present. Missing `publishStatus` must not make bulk/API candidates visible.\n- API and bulk product output is candidate inventory, not live recommendation inventory.\n- Gift recommendations are optional and additive. They must not displace Barkday's core care, training, enrichment, life-stage, and bonding purpose.\n- Barkday(TM) name/trademark baseline is documented in `README.md` and maintainer notes.\n\n## Gift and Affiliate System\n\n- V2 gifts are canonical. Root `dog-gifts.json` remains legacy compatibility only.\n- Gift source should remain rebuildable from v2 source inputs into `data/dog-gifts-catalog.json` and `data/dog-gifts-merged.json`.\n- Candidate rows should remain `review`, `draft`, or `retired` until explicitly promoted to `approved`.\n- Amazon Associates, PA-API, Chewy links, Amazon storefront options, and other affiliate/store paths remain compliance-sensitive topics.\n- Affiliate disclosure must remain clear and near gift surfaces before affiliate interaction.\n- Do not fetch new product data or add products without routing through the candidate and curation pipeline.\n\n## Paid Model - On Hold\n\n- Older notes describe Plus, Pro, Breeder, Cloudflare Worker/KV, JWT, Stripe, Play Billing, premium JSON, dog-count limits, litter mode, and abuse controls.\n- Treat those paid-tier notes as future reference, not current marching orders.\n- Paid implementation is paused until affiliate/program compliance, app-store policy, user-trust, and launch-timing concerns are resolved.\n- Do not plan or implement Plus/Pro/Breeder gates in the next development cycle.\n- Do not move proprietary JSON, add license checks, add payment endpoints, or add premium data loaders as the next active implementation path.\n- The old paid-tier architecture may still be useful later if Barkday has a stable free launch, clear policy review, and a durable value proposition for heavy users.\n\n## Affiliate and Monetization Compliance Gate\n\n- Open question: whether Amazon affiliate links remain safe if the app later becomes paid, partially paid, or gated in any way.\n- Current conservative assumption: affiliate links remain optional, clearly disclosed, and not hidden behind a paywall.\n- Before paid work resumes, review current official Amazon Associates/PA-API rules, Google Play policy, and Apple App Store policy.\n- Avoid monetization structures that risk Amazon demonetization, app-store rejection, misleading affiliate placement, or user trust damage.\n- Long-term income must be compliant and durable, not a quick launch shortcut.\n- Partner perks or discounts may be considered later, but gift access itself should remain public unless policy review explicitly supports a different approach.\n\n## PA-API and Official API Parking Lot\n\n- The official Amazon API path has been explored conceptually.\n- Secrets and signing material must stay server-side. The public app shell must not call Amazon APIs directly.\n- PA-API output should feed candidate generation and local/server-side curation, not direct display.\n- Future work should connect PA-API `SearchItems`/`GetItems` outputs to the candidate pipeline and preserve ASIN, affiliate URL, source title, and source features for traceability.\n- Rate limits, content freshness, image/content caching, and offer display rules must be solved before any Amazon-enriched runtime data is shown.\n\n## Launch Strategy Parking Lot\n\n- Current leaning: launch free or free-to-try first if paid work would double the launch window.\n- Paid model may later focus on breeders, designers, trainers, multi-dog households, or heavy users who receive real value.\n- Barkday certificate printing remains a positive hook and a potential free-advertising mechanism.\n- The certificate angle should feel celebratory and useful, not extractive.\n- GitHub Pages can continue serving as staging/testing while production origin, app links, service worker scope, and wrapper behavior are verified deliberately.\n\n## Aging Model and Bark Day Logic\n\n- The current baseline is the 15/9 model: about 15 Bark Days in the first human year and 9 in the second.\n- Existing weight/size-aware curves and smoothing remain baseline until a specific curve task starts.\n- Older aging-model notes preserve useful future ideas: post-24-month breed modifiers, size scaling, curve registry, piecewise overrides, and breed-specific curve labels.\n- Future curve work should support:\n - default 15/9 curve behavior\n - weight or size scaling\n - post-24-month breed modifiers\n - a small curve registry such as `curves.json`\n - future breed-specific curve overrides when evidence is strong\n- Do not implement curve registry, Labrador overrides, or taxonomy `age_rate`/`size_scale` fields until scoped as a separate data/model task.\n\n## Mixed-Breed DNA and Breed Logic Parking Lot\n\n- Mixed-breed support should start with the top three breed percentages, not an unbounded breed list.\n- Embark/Wisdom-style paste parsing is future work and should include manual review/correction before applying recommendations.\n- Weighted logic should consider size, age-rate, energy, chew tendency, health, training, exercise, care, and enrichment guidance.\n- Designer/companion hybrid cohort work is separate from DNA-mix mode:\n - designer/hybrid cohort can use curated known breed-group content\n - DNA-mix mode should weight user-provided breed percentages\n- Breed group and top-breed data should support recommendations without replacing the calculator baseline.\n- Mixed-breed DNA work remains planned until data shape, safety text, UI review, and launch priorities are settled.\n\n## Non-Gift Launch Content\n\nBefore a release candidate, review non-gift recommendation content for:\n\n- health and wellness\n- training and enrichment\n- diet and nutrition\n- exercise needs\n- play and bonding\n- helpful gear\n- age and life-stage messaging\n\nThis content needs safety review. Barkday should frame recommendations as general guidance only, not veterinary advice, diagnosis, treatment, or guaranteed outcomes.\n\n### Guardian Education Principle\n\nSee `docs/principles/guardian-education-and-veterinary-guidance.md`.\n\nBarkday does not diagnose, prescribe, or replace veterinary care. It should help guardians observe patterns, track changes, ask informed questions, and seek qualified veterinary guidance or a second opinion when symptoms, explanations, or treatment response do not make sense.\n\nHealth and care guidance should stay practical and empowering without reducing every recommendation to passive \"ask your vet\" language.\n\n## Deployment and Protected Data\n\n- Private, premium, or protected data should not live in the public repository or shipped app shell.\n- Public runtime data can be remotely fetched, but proprietary overlays should stay behind a protected endpoint if they are ever created.\n- The app-store wrapper path still needs readiness testing, including external opening behavior for affiliate links, production domain/scope alignment, and store policy review.\n- Do not treat old paid-hosting notes as permission to start production backend work before policy and launch sequencing are resolved.\n\n## Historical or Superseded Findings\n\nTreat these as verify-only unless current symptoms remain:\n\n- old raw gift-feed findings from before the v2 runtime feed decision\n- old chewer enum bug and `strong`/`power` mismatch\n- old service-worker JSON cache warning\n- old affiliate disclosure warning\n- broken button fixes\n- dog age calculator fixes\n- data update checks\n- popup modal/result UI work\n- calendar notification improvements\n- chart value and milestone comparison questions\n- custom 404 image handling\n- save-result button necessity and placement\n- slider usability adjustments\n- markdown/readme cleanup topics\n\nIf symptoms recur, reproduce against current `main` and fix the current code path rather than reapplying old chat snippets.\n\n## Next Recommended Stages\n\n1. Finish and freeze the gift curation gate.\n2. Inventory all runtime data and classify each source as public, candidate, generated, protected, or legacy.\n3. Classify public versus protected content before adding premium/proprietary overlays.\n4. Clean and safety-review non-gift launch content.\n5. Plan the mixed-breed DNA feature around explicit input shape and weighted recommendation rules.\n6. Review affiliate/app-store policy before paid model work resumes.\n7. Verify wrapper/store behavior against the intended production origin.\n8. Prepare a release candidate with validation, local browser checks, and deployment-path checks.\n\n## Older Notes Status\n\n- `docs/Master_Note_v0_Barkday_Aging-Model_Integration_Master_Note.md`: useful future aging-model reference; not active scope.\n- `docs/Master_Note_v1—Designer_Companion_Hybrid_Cohort.md`: useful designer/hybrid reference; separate from DNA-mix mode.\n- `docs/Master_Note_v2—Paid_Tier_&_Hosting_Gate_(Single_Codebase).md`: paid-tier reference only; on hold.\n- `docs/Master_Note_v3—Monetization_Limits_&_Abuse_Prevention.md`: monetization/limits reference only; on hold.\n- `docs/Barkday_MASTER-NOTE_v2025-10-09-1.md`: broad historical master note; some paid/API sections are superseded by this on-hold guidance.\n- `docs/Data expansion plan.md`: valuable data governance and launch-content guidance; still useful.\n- `docs/barkday_code_review_2025-10-26.md`: historical review; verify findings only against current symptoms.\n- `docs/principles/guardian-education-and-veterinary-guidance.md`: core wording standard for health, care, training, and wellness content.\n\n## Resume Point\n\n## Next Recommended Stages\n\n1. Confirm the gift curation gate remains stable during normal validation.\n2. Inventory all runtime data and classify each source as public, candidate, generated, protected, or legacy.\n3. Classify public versus protected content before adding premium/proprietary overlays.\n4. Clean and safety-review non-gift launch content.\n5. Plan the mixed-breed DNA feature around explicit input shape and weighted recommendation rules.\n6. Review affiliate/app-store policy before paid model work resumes.\n7. Verify wrapper/store behavior against the intended production origin.\n8. Prepare a release candidate with validation, local browser checks, and deployment-path checks.\n","inline_bytes":10802,"content_sha256":"da5175717d900f2b12450146a12f27b114c7dcfdce0bb85c157a187be24548d3"},{"path":"docs/roadmap/non-gift-runtime-data-inventory.md","size":9080,"sha":"66d9a3c22b4b4bd07fad5d8e0467ed1f9fc611f1","media_type":"text/markdown","raw_url":"https://raw.githubusercontent.com/CandidQuality/Barkday/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/roadmap/non-gift-runtime-data-inventory.md","html_url":"https://github.com/CandidQuality/Barkday/blob/9e38500d723ed1e8e1ca93eb8ae821c831f1414d/docs/roadmap/non-gift-runtime-data-inventory.md","inline_state":"full","max_inline_text_bytes":614400,"max_inline_bin_bytes":204800,"preview_text_bytes":65536,"encoding":"utf8","content":"# Non-Gift Runtime Data Inventory\n\nLast updated: 2026-05-04\n\nThis inventory covers Barkday runtime-used and runtime-adjacent data outside the v2 gift workflow. Gift catalog data, raw Amazon data, and gift curation outputs are handled separately by the v2 gift stabilization path.\n\nHealth, training, nutrition, exercise, care, and enrichment content must remain framed as general guidance only, not veterinary advice.\n\n## Classification Key\n\n- public runtime data: fetched or used by the public app shell today.\n- generated/public output: generated or shipped output that can be public if source and content review are acceptable.\n- candidate/source input: input material for future generation or editorial review, not a live recommendation source.\n- protected/proprietary future data: planned premium or proprietary data that must not be bundled into the public app shell.\n- legacy/historical: older data or code retained for reference or compatibility.\n- unknown/needs review: role or safety is not clear enough to treat as launch-ready.\n\n## Runtime Fetch Map\n\n| Loader or constant | Path | Current role | Notes |\n| --- | --- | --- | --- |\n| `app.js` `BREED_GROUPS_URL` | `data/breed_groups.json` | Public breed group guidance and gifts tags | Active runtime fetch. |\n| `app.js` `BREED_ALIASES_URL` | `data/breed_aliases.json` | Breed name normalization | Active runtime fetch. |\n| `app.js` `TAXONOMY_URL` | `data/breed_taxonomy.json` | Breed-to-group taxonomy | Active runtime fetch. |\n| `app.js` `RECO_BREED_URL` | `data/reco-breed.json` | Breed-specific recommendation lanes | Active runtime fetch. |\n| `app.js` `RECO_BANDED_URL` | `data/reco-banded.json` | Older banded recommendation source | Active fetch, but current shape appears legacy for the loader. |\n| `app.js` `GROUP_RULES_URL` | `data/rules_group_defaults.json` | Group/life-stage recommendation fallbacks | Active runtime fetch. |\n| `app-curves-inline.js` `CURVES_URL` | `data/curves.json` | Barkday curve schedule data | Active runtime fetch. |\n| `app.js` `PREMIUM_BASE` | `/premium/plus_overlays.json`, `/premium/puppy_24band_deltas.json` | Future premium overlays | Not active without a token; must remain protected/future. |\n| `js/runtime-fetch.js` | generic fetch helper | Runtime data fetch utility | Public shell helper; not content by itself. |\n\n## Inventory\n\n| Source | Current role | Classification | Launch relevance | Review needed | Safe public for launch? | Notes and risks |\n| --- | --- | --- | --- | --- | --- | --- |\n| `data/breed_aliases.json` | Breed alias map used for input normalization | public runtime data | High | Low | Yes, if intended public | Includes dataset/license metadata. Review alias accuracy and avoid surprising canonicalization. |\n| `data/breed_taxonomy.json` | Breed taxonomy and group mapping | public runtime data | High | Medium | Yes, if intended public | Review breed-to-group accuracy before launch; supports recommendations and future mixed-breed weighting. |\n| `data/breed_groups.json` | Breed group traits, enrichment, tips, cautions, gift tags | public runtime data | High | High | Yes, after content review | Contains care/training/enrichment guidance. Needs safety and tone review for general-guidance framing. |\n| `data/rules_group_defaults.json` | Runtime group/life-stage fallback recommendation rules | public runtime data | High | High | Yes, after content review | Contains health, nutrition, exercise, bonding, gear lanes. Metadata references upgrade-oriented positioning, which should be reconciled with paid work being on hold. |\n| `data/reco-breed.json` | Runtime breed-specific recommendation lanes | public runtime data | High | High | Yes, after content review | Large public recommendation source with copyright/license metadata. Review health, training, diet, exercise, and care wording. |\n| `data/reco-banded.json` | Older banded recommendation data | legacy/historical | Low | Medium | Yes, but not launch-critical | Still fetched, but the current loader appears to rely on `rules_group_defaults.json` for group fallbacks. Keep as verify-only unless symptoms remain. |\n| `data/rules_library.json` | Broader rules library source with defaults, rules, overrides, and auxiliary data | candidate/source input | Medium | High | Not as live runtime data yet | Useful source material, but not fetched by the app today. Requires editorial and safety review before any runtime promotion. |\n| `data/reco-barkday-banded.json` | Bark Day banded group recommendation source | candidate/source input | Medium | High | Not as live runtime data yet | Could support future Bark Day-specific recommendations. Needs review before wiring. |\n| `data/trait-inserts-barkday.json` | Trait-specific inserts for Bark Day guidance | candidate/source input | Medium | High | Not as live runtime data yet | Contains sensitive trait guidance such as brachy, giant growth, coat care, and sensitivity notes. Treat as general guidance only and review carefully. |\n| `data/universal-puppy-barkday.json` | Puppy-stage Bark Day guidance | candidate/source input | Medium | High | Not as live runtime data yet | Puppy socialization, health, and training guidance needs safety review before launch use. |\n| `data/proposed_rules_from_gaps.json` | Proposed rule coverage from data gaps | candidate/source input | Low | High | No | Auto-proposed material only; do not display without curation. |\n| `data/curves.json` | Active Barkday curve registry data | public runtime data | High | Medium | Yes | Review model assumptions, source notes, and size-scaling behavior before release candidate freeze. |\n| `data/curves-1.json` | Alternate or older curve registry data | legacy/historical | Low | Medium | Unknown | Not the active runtime URL. Keep for comparison only unless deliberately promoted. |\n| `app-curves-inline.js` | Loads `data/curves.json` and exposes curve helpers | generated/public output | High | Medium | Yes | Public shell curve loader. Any model changes should stay data-driven and validated against core calculator behavior. |\n| `js/barkday-curves.js` | Curve helper module | generated/public output | Medium | Medium | Yes | Present as a helper module; verify whether it is still part of the active runtime path before changing. |\n| `milestones_dog_barkdays_1_95-1.json` | Root-level Barkday milestone guidance from 1-95 | unknown/needs review | Medium | High | Unknown | Contains training and care guidance. Not clearly wired in current runtime; review before any use. |\n| `app.js` calendar/reminder generation | Builds calendar text and reminder links from current result | public runtime data | Medium | Medium | Yes | No separate data file. Review wording and privacy expectations for generated reminder text. |\n| `app-pdf.js` certificate/PDF content | Certificate add-on code and generated certificate text | legacy/historical | Medium | Medium | Yes if deliberately enabled | Disabled in `index.html` today. Contains external CDN and QR fallback paths that need review before re-enabling. |\n| `manifest.json` | Public app metadata for install/wrapper behavior | public runtime data | Medium | Low | Yes | Public shell metadata, not guidance content. Keep aligned with launch naming and domain decisions. |\n| `/premium/plus_overlays.json` | Future Plus overlay placeholder path | protected/proprietary future data | Future | High | No | Must stay remote/protected if implemented. Paid tier is on hold. |\n| `/premium/puppy_24band_deltas.json` | Future puppy premium delta placeholder path | protected/proprietary future data | Future | High | No | Must stay remote/protected if implemented. Do not bundle into public shell. |\n| `data/pending-items.json` | Pending gift item source | candidate/source input | Gift-only | High | No | Gift workflow only; included here only to mark out of scope for non-gift launch content. |\n| `data/raw-amazon/*` | Raw affiliate/API evidence and candidate source files | candidate/source input | Gift-only | High | No | Gift workflow only. API/bulk product output remains candidate inventory, not live recommendations. |\n\n## Launch Review Priorities\n\n1. Review active public recommendation text in `data/breed_groups.json`, `data/rules_group_defaults.json`, and `data/reco-breed.json` for health, nutrition, training, exercise, care, and enrichment safety.\n2. Reconcile upgrade-oriented wording in `data/rules_group_defaults.json` with the current paid-model hold.\n3. Decide whether `data/reco-banded.json`, `data/curves-1.json`, `js/barkday-curves.js`, and `milestones_dog_barkdays_1_95-1.json` are historical, active, or future source material.\n4. Keep all `/premium/` overlay data remote and protected if that path resumes later.\n5. Treat PDF/certificate behavior as a separate launch-readiness review because it can involve external libraries, QR generation, certificate wording, and wrapper behavior.\n\n## Recommended Next Stage\n\nWith the gift curation gate in place, do a focused non-gift content safety pass on the active public runtime sources before adding mixed-breed DNA logic, paid-tier behavior, or protected overlays.\n","inline_bytes":9080,"content_sha256":"61d6daabbc082bb0218ada9a4b2bd4c355a17bc9382d4791da675fe8b7babf63"}]}