{
  "version": "1.8.0",
  "slug": "340b-compliance-audit-engine",
  "title": "ClaimClear — 340B program-integrity & independent audit engine",
  "vertical": "340B program-integrity & independent audit",
  "seed": {
    "s": "340b-compliance-audit-engine",
    "t": "ClaimClear — 340B program-integrity & independent audit engine",
    "v": "340B program-integrity & independent audit",
    "r": "High",
    "m": "L"
  },
  "product": {
    "slug": "340b-compliance-audit-engine",
    "project_name": "ClaimClear",
    "project_type": "certified independent 340B audit production workflow application",
    "vertical": "340B program-integrity & independent audit",
    "audience": "340B program managers, pharmacy directors, and compliance officers at covered entities (DSH hospitals, CAHs, FQHCs, grantees)",
    "geography": "U.S. HRSA-administered 340B Drug Pricing Program, covered entities with contract-pharmacy networks; nationwide, remote delivery",
    "scale_expectation": "~2,800 hospitals plus 1,400+ grantee organizations participate in 340B; capture 0.5-1% of entities",
    "core_workflows": [
      "Audit engagement intake by scope (contract-pharmacy eligibility / duplicate-discount / GPO-prohibition / full annual)",
      "Claim-to-encounter matching and NDC/WAC pricing resolution",
      "Compliance Lint and Medicaid Exclusion File reconciliation",
      "Certified Review, opinion sign-off, and Recapture File assembly"
    ],
    "discovery": {
      "one_line_purpose": "On ClaimClear, 340B program teams stop guessing which contract-pharmacy claims will survive an HRSA audit and start knowing. Read-only TPA and EHR feeds land at intake, every Audited Claim maps to a rule citation, and the Audit Package releases with a certified reviewer's signature and a full provenance trail.",
      "primary_users": [
        "340B program managers, pharmacy directors, and compliance officers",
        "Apexus-certified 340B expert / opinion signer",
        "Covered entity's counsel (read-only)"
      ],
      "jobs_to_be_done": [
        "Ship a defensible independent audit opinion inside HRSA's annual requirement window",
        "Cut certified-reviewer minutes per audit without losing defensibility",
        "Give the entity and its counsel a single source-traced record"
      ],
      "value_prop": "ClaimClear turns the annual independent-audit scramble into a source-traced, certified-reviewer-signed Audit Package — reconstructable on demand, defensible when an HRSA examiner reads it closely.",
      "competitors": [
        "In-house spreadsheets and manual sampling",
        "340B capture/monitoring software (Plenful, Halo340B, Craneware) the entity still operates",
        "Hourly independent-audit consultants (Ponaman, Virtue 340B, 340B Compliance Partners)"
      ],
      "differentiation": "Deterministic Medicaid Exclusion File / GPO-prohibition / NDC-WAC validation with claim-level source traces and a certified-reviewer sign-off gate; 100%-of-volume testing, not a sample; the independence posture no self-run software can claim.",
      "positioning_statement": "For 340B program managers, pharmacy directors, and compliance officers who need an HRSA-defensible independent audit every year, ClaimClear is a source-traced audit production desk that — unlike spreadsheets, capture software, or open-ended AI chat — guarantees every Audited Claim is cited and every opinion is certified-reviewer-signed."
    },
    "assumptions": [
      {
        "id": "340b-compliance-audit-engine-a1",
        "statement": "Covered entities will pay a fixed per-audit fee for a done-for-you independent audit over sampled hourly consulting or entity-operated capture software.",
        "confidence": "medium",
        "impact_if_wrong": "severe",
        "revisit_trigger": "First 5 discovery calls + Risk Scan conversion — reject if willingness-to-pay signal is absent."
      },
      {
        "id": "340b-compliance-audit-engine-a2",
        "statement": "A read-only TPA accumulator export and EHR encounter feed are obtainable per entity inside the intake window.",
        "confidence": "medium",
        "impact_if_wrong": "high",
        "revisit_trigger": "Pilot intake — if more than 1 of 3 entities stalls on feed access, harden the intake gate and TPA-referral path."
      },
      {
        "id": "340b-compliance-audit-engine-a3",
        "statement": "Claim-to-encounter matching accuracy on the top TPA export formats reaches certified-review grade after gold-claim calibration.",
        "confidence": "medium",
        "impact_if_wrong": "high",
        "revisit_trigger": "Field-level match accuracy on gold claims before the first delivered opinion."
      },
      {
        "id": "340b-compliance-audit-engine-a4",
        "statement": "Covered entities accept the independence boundary in writing — ClaimClear tests and signs the opinion, the entity's counsel decides legal questions, the entity stays the party of record to HRSA.",
        "confidence": "high",
        "impact_if_wrong": "severe",
        "revisit_trigger": "Any prospect who insists ClaimClear also operate their TPA — decline and log as an independence conflict."
      },
      {
        "id": "340b-compliance-audit-engine-a5",
        "statement": "The annual independent-audit deadline concentration is schedulable with retainer priority, batch intake, and capacity-gated rush pricing.",
        "confidence": "medium",
        "impact_if_wrong": "high",
        "revisit_trigger": "First batch delivery — median cycle time above 3 weeks triggers the capacity plan."
      }
    ],
    "unknowns": [
      {
        "id": "340b-compliance-audit-engine-u1",
        "question": "Which entity profiles (very high contract-pharmacy volume, many TPAs, layered manufacturer restrictions) push audits above the price band?",
        "blocks": "Locking list prices after the founding cohort.",
        "resolution_path": "Complexity scoring across the 3-entity pilot."
      },
      {
        "id": "340b-compliance-audit-engine-u2",
        "question": "Do entities supply complete TPA/EHR feeds promptly, or does feed access become the cycle-time bottleneck?",
        "blocks": "The three-week delivery SLA.",
        "resolution_path": "Track feed-gap exceptions per engagement through the pilot."
      },
      {
        "id": "340b-compliance-audit-engine-u3",
        "question": "Which TPA export formats resist automated matching and need manual reconciliation?",
        "blocks": "Day-90 automation targets (75% match-to-draft).",
        "resolution_path": "Log exotic-format exceptions per TPA; templatize the top 2 formats by week 10."
      },
      {
        "id": "340b-compliance-audit-engine-u4",
        "question": "Is the Examiner-Attributable-Finding Guarantee sufficient risk reversal for entities burned by sampled consulting?",
        "blocks": "Founding-cohort close rate.",
        "resolution_path": "Offer founding-partner pilot terms and measure objection frequency."
      },
      {
        "id": "340b-compliance-audit-engine-u5",
        "question": "How often does a duplicate-discount exception actually surface across a real contract-pharmacy population, and does the Recapture File add-on attach as modeled?",
        "blocks": "Recapture-share add-on launch (gated to post-pilot and post-legal-review by design).",
        "resolution_path": "Count duplicate-discount exceptions and Recapture File uptake in the pilot readout."
      }
    ],
    "expert_panel": [
      {
        "role": "Product Strategy",
        "key_concern": "Is the ICP narrow enough to earn a first pilot cohort?",
        "recommendation": "Constrain v1 to DSH hospitals and FQHCs with 1-2 TPAs; large IDNs and self-audited megasystems stay out until the day-90 readout.",
        "dissent": "May under-price total addressable market and slow the enterprise narrative."
      },
      {
        "role": "Software Architecture",
        "key_concern": "Does the pipeline stay boring enough to run through the annual audit-deadline peak?",
        "recommendation": "Secure pipeline + versioned rule engine + coded validator suite; no custom portal before the 20-audit checkpoint.",
        "dissent": "A thin upload portal earlier could cut intake friction on multi-TPA entities."
      },
      {
        "role": "Frontend / UX",
        "key_concern": "Reviewers need a claim-by-claim checklist, not a dashboard.",
        "recommendation": "Claim-by-claim verification against the cited source with clear/flag/blocked states and a signed release checkbox; pre-highlight low-confidence claims.",
        "dissent": "A lightweight queue tool may cap reviewer speed once volume passes the pilot."
      },
      {
        "role": "Backend / Data",
        "key_concern": "Every finding must carry feed-and-record provenance end-to-end.",
        "recommendation": "Store provenance on every extracted claim; a required field without a source is a hard exception, never an estimate.",
        "dissent": "Provenance-first storage adds intake latency on exotic TPA export formats."
      },
      {
        "role": "AI / ML",
        "key_concern": "Matching accuracy varies sharply by TPA export format.",
        "recommendation": "Build gold claims per major TPA format; run field-level accuracy regressions before any prompt release; keep prompts provider-portable.",
        "dissent": "Gold-claim curation is slow until the pilot supplies real claim data."
      },
      {
        "role": "Security",
        "key_concern": "Claim and encounter data is PHI even where 340B-specific rules don't separately restrict it.",
        "recommendation": "BAA before any intake; least-privilege per-entity/per-engagement folders; no unauthorized Medicaid Exclusion File access; business-tier no-training API terms.",
        "dissent": "Folder-level ACL discipline may feel heavy at pilot scale."
      },
      {
        "role": "Privacy / Compliance",
        "key_concern": "Independence drift — testing edging into operating the entity's program.",
        "recommendation": "Maintain the independence-conflict decline list; make the counsel-referral memo a first-class deliverable; never accept managed-services and audit work from the same entity concurrently.",
        "dissent": "Strict lane separation may frustrate entities who want one vendor for everything."
      },
      {
        "role": "DevOps / Reliability",
        "key_concern": "Audit-deadline load lands unevenly across the year as entities' anniversary dates cluster.",
        "recommendation": "Capacity-gate rush orders, run the retainer priority queue, freeze SOP changes during active delivery weeks.",
        "dissent": "SOP freezes slow learning-loop fixes during a busy stretch."
      },
      {
        "role": "Data / Analytics",
        "key_concern": "Unit economics must be measured, not asserted.",
        "recommendation": "Time-motion log per step from audit 1; track certified-reviewer minutes, rework rate, and per-audited-claim cost against the blueprint bands.",
        "dissent": "Instrumentation overhead falls on the founder during launch."
      },
      {
        "role": "Accessibility",
        "key_concern": "The entity-facing FAQ must actually read at a plain-language level.",
        "recommendation": "Enforce reading-level checks on FAQ drafts; WCAG AA on the Risk Scan page and any delivery surface.",
        "dissent": "No material dissent recorded."
      },
      {
        "role": "SEO / Content",
        "key_concern": "AEO pages must cite HRSA and Federal Register primary text, not aggregators.",
        "recommendation": "Publish the ten 340B-fluent posts as canonical pages with primary-source citations and a guidance change-log timestamp.",
        "dissent": "Content payoff lags the first audit cycle."
      },
      {
        "role": "Executive Sponsor",
        "key_concern": "The early-demand trap: eager entities past the pilot cap.",
        "recommendation": "Hold the 3-entity cap until the Week-12 readout; no second certified reviewer before the 20-audit checkpoint metrics run 4 weeks.",
        "dissent": "Capping demand risks losing founding entities to a slower but hungrier competitor."
      }
    ],
    "strategy": {
      "business_model": "Per-audit and per-audited-claim fixed fees with recurring Continuous-Integrity Subscriptions",
      "revenue_streams": [
        "Contract-Pharmacy Eligibility Integrity Audit — $12,000-$35,000 per entity per audit",
        "Continuous-Integrity Subscription — $3,000-$9,000 per entity/month at scale",
        "Full Annual Independent Audit — $25,000-$60,000 per entity/year"
      ],
      "moat": [
        "Gold-claim corpus per TPA export format",
        "Versioned HRSA rule pack + deterministic Compliance Lint suite",
        "Prior-audit claim memory per entity for diff checks"
      ],
      "gtm": [
        "Founder-led outreach to an OPAIS-identified entity list keyed to independent-audit due dates",
        "340B Coalition / Apexus-forum audit-readiness clinics + 340B-fluent AEO content",
        "TPA/EHR vendor and 340B-consulting-firm referral partnerships"
      ],
      "pricing_hypothesis": "Founding cohort at $12,000-$20,000 per audit; list $12,000-$35,000 priced within band by claim volume and TPA count — validate willingness-to-pay across the 3-entity pilot before locking.",
      "kill_criteria": [
        "Fewer than 5 discovery calls booked after two full outreach waves",
        "Fewer than 2 of 3 pilot audits accepted, or NPS below 8, at the Week-12 readout",
        "Material rework rate still above 20% after the 10-audit SOP hardening",
        "A covered entity or its counsel issues a written objection to the independence posture"
      ]
    },
    "security": {
      "stride": [
        {
          "threat": "Spoofing",
          "scenario": "Attacker attempts to impersonate a certified reviewer to sign off on a fabricated opinion.",
          "mitigation": "SSO with MFA; reviewer signatures bound to a cryptographic session claim, not a form field."
        },
        {
          "threat": "Tampering",
          "scenario": "Historical Audited Claim entries edited after the fact to hide a bad determination.",
          "mitigation": "Append-only audit log; hash-chained artifact snapshots; diff view on every reviewer surface."
        },
        {
          "threat": "Repudiation",
          "scenario": "A reviewer denies signing off on a delivered Audit Package.",
          "mitigation": "Signed attestations with server-side timestamp + reviewer identity; export bundle includes signature manifest."
        },
        {
          "threat": "Information Disclosure",
          "scenario": "Cross-entity leak of PHI, claim data, or Medicaid Exclusion File status through shared indices, logs, or prompts.",
          "mitigation": "Tenant-scoped row-level auth; PHI scrubbing in logs; retrieval indices partitioned per entity."
        },
        {
          "threat": "Denial of Service",
          "scenario": "A runaway matching job or export exhausts shared workers during audit-deadline peak.",
          "mitigation": "Per-entity concurrency + throughput caps; circuit breaker on model calls; degrade-gracefully queue."
        },
        {
          "threat": "Elevation of Privilege",
          "scenario": "A standard analyst acquires certified-reviewer or admin capability via a workflow shortcut.",
          "mitigation": "Roles stored in a separate table; capability checks server-side; no client-only role checks."
        }
      ],
      "privacy_posture": "Data-minimization by default; per-entity, per-engagement folder isolation under BAA; patient PII rejected or redacted unless strictly necessary for eligibility matching; business-tier no-training API terms; no unauthorized Medicaid Exclusion File access.",
      "compliance_targets": [
        "HIPAA-grade PHI handling",
        "SOC 2 Type II",
        "ISO 27001 (year two)"
      ],
      "data_classifications": [
        "Regulated-disclosure",
        "PII",
        "Internal-audit"
      ]
    },
    "devops": {
      "ci_cd": "PR → typecheck + unit + snapshot tests → preview deploy → main auto-deploys to a single production region; migrations gated on review.",
      "environments": [
        "local",
        "preview (per-PR)",
        "staging (shared)",
        "production (single region + multi-AZ)"
      ],
      "observability": [
        "Structured logs with patient + request IDs",
        "RED metrics per workflow",
        "Error tracking with source maps",
        "Model-call spans with cost + latency",
        "Weekly SLO review"
      ],
      "testing_pyramid": [
        "Unit tests on derivation + validation modules",
        "Component tests on reviewer surfaces",
        "Contract tests on integrations",
        "End-to-end smoke test on the intake→signoff→delivery path"
      ],
      "accessibility_tests": [
        "axe-core in CI on reviewer surfaces",
        "Keyboard-only walkthrough per workflow",
        "Prefers-reduced-motion honored"
      ],
      "performance_budget": "p95 workflow latency published per module; artifact-generation cold-path under 30s or shown as background job."
    },
    "accessibility_i18n_ethics": {
      "wcag_target": "AA",
      "locales": [
        "en-US"
      ],
      "rtl_support": false,
      "ethical_risks": [
        "Audit opinion drafted without certified human review",
        "Cross-entity claim data leakage",
        "Covered-entity-counsel-facing errors attributed to AI"
      ],
      "ethical_guardrails": [
        "Certified reviewer sign-off required before any opinion is delivered",
        "Per-entity, per-engagement prompt + template isolation",
        "AI-usage disclosure in Audit Package metadata where required"
      ]
    },
    "governance": {
      "ownership": [
        {
          "area": "Product + roadmap",
          "owner": "Executive Sponsor"
        },
        {
          "area": "Architecture + platform",
          "owner": "Engineering Lead"
        },
        {
          "area": "Evidence + reviewer workflow",
          "owner": "Named licensed reviewer"
        },
        {
          "area": "Compliance + privacy",
          "owner": "Compliance Lead"
        },
        {
          "area": "Design system",
          "owner": "Design Lead"
        },
        {
          "area": "SEO + content",
          "owner": "Content Lead"
        }
      ],
      "docs_required": [
        "ADR log (checked in)",
        "Owner-action ledger",
        "Evidence register",
        "STRIDE threat model",
        "Runbook: incident, restore, breach notification",
        "Reviewer playbook + signature policy"
      ],
      "naming_conventions": [
        "kebab-case slugs for blueprints and routes",
        "camelCase for TypeScript identifiers",
        "SCREAMING_SNAKE_CASE for environment variables",
        "Verb-first action names (e.g., generate-blueprint-docs)"
      ],
      "change_control": "ADR-per-major-decision; migrations require review; production deploys gated on green CI + owner-action ledger check."
    },
    "risk_register": [
      {
        "id": "340b-compliance-audit-engine-r1",
        "risk": "A signed opinion misstates an eligibility, diversion, or duplicate-discount determination",
        "likelihood": "medium",
        "impact": "severe",
        "mitigation": "Deterministic reconciliation checks + 100%-of-volume testing at launch + mandatory rule-citation rule",
        "contingency": "Re-audit the affected scope at no charge per the Examiner-Attributable-Finding Guarantee; correction notice to the entity; root cause coded within 7 days",
        "owner": "operations"
      },
      {
        "id": "340b-compliance-audit-engine-r2",
        "risk": "Independence conflict — testing and managed-services work sold to the same entity concurrently",
        "likelihood": "low",
        "impact": "severe",
        "mitigation": "Independence attestation on file; conflicted-engagement decline list; strict lane separation",
        "contingency": "Written decline; referral to a non-conflicted vendor; incident logged and SOP updated",
        "owner": "legal"
      },
      {
        "id": "340b-compliance-audit-engine-r3",
        "risk": "Annual audit-deadline capacity overload breaks the three-week SLA",
        "likelihood": "high",
        "impact": "high",
        "mitigation": "Pilot caps, retainer priority queue, capacity-gated rush pricing",
        "contingency": "Waitlist with dated slots; never quietly extend the SLA",
        "owner": "operations"
      },
      {
        "id": "340b-compliance-audit-engine-r4",
        "risk": "Stale or missing TPA/EHR feed at intake",
        "likelihood": "high",
        "impact": "medium",
        "mitigation": "Intake gate blocks the engagement; TPA-referral path for feed access",
        "contingency": "Slot held 10 business days; audit resumes after the feed lands",
        "owner": "operations"
      },
      {
        "id": "340b-compliance-audit-engine-r5",
        "risk": "HRSA program-rule change (rebate model, patient definition, GPO-prohibition scope) invalidates the rule map",
        "likelihood": "high",
        "impact": "medium-high",
        "mitigation": "Quarterly HRSA/Federal Register guidance diff review; versioned Rule Pack",
        "contingency": "Rule Pack version bump + gold-claim re-validation before the next release",
        "owner": "legal"
      },
      {
        "id": "340b-compliance-audit-engine-r6",
        "risk": "Extraction/matching errors on exotic TPA export formats",
        "likelihood": "medium",
        "impact": "medium",
        "mitigation": "Gold claims per major TPA; manual reconciliation as the accepted fallback",
        "contingency": "Format flagged at intake; TPA template added to the backlog",
        "owner": "engineering"
      }
    ],
    "roadmap": [
      {
        "phase": "Phase 0 — Foundations + first calls",
        "weeks": "Weeks 1-2",
        "outcomes": [
          "Rule Pack v0 (Medicaid Exclusion File logic, GPO-prohibition, NDC/WAC math) versioned against current HRSA guidance",
          "Risk Scan landing page live with upload intake",
          "OPAIS-identified entity outreach list built with independent-audit due dates noted"
        ],
        "exit_criteria": [
          "5 discovery calls booked",
          "Rule Pack reviewed against current HRSA guidance text",
          "BAA/independence-attestation templates ready for signature"
        ],
        "kill_criteria": [
          "No discovery calls after two outreach waves",
          "Rule Pack cannot be grounded in current HRSA guidance text"
        ]
      },
      {
        "phase": "Phase 1 — Engine v0 + first revenue",
        "weeks": "Weeks 3-5",
        "outcomes": [
          "Claim-matching + Eligibility Match prompts wired with citation-required outputs",
          "Validator suite (Medicaid Exclusion File, GPO-prohibition, NDC/WAC math, sampling integrity) coded and seeded-omission tested",
          "First 3 founding audits opened with the founder reviewing 100% of flagged claims"
        ],
        "exit_criteria": [
          "Validators catch 100% of seeded omissions",
          "At least 2 paid or founding audits in intake",
          "No more than 1 material rework across the first 3 audits"
        ],
        "kill_criteria": [
          "Validator escapes on seeded omissions",
          "Founding entities reject the independence boundary in writing"
        ]
      },
      {
        "phase": "Phase 2 — Pilot cohort at cap",
        "weeks": "Weeks 6-10",
        "outcomes": [
          "Pilot filled to cap: 3 covered entities at founding price",
          "Exception queues (missing feed, low-confidence match, duplicate-discount, fatal exception) live in the tracker",
          "SOP freeze after the 10-audit hardening"
        ],
        "exit_criteria": [
          "Median cycle time ≤3 weeks",
          "Rework below 5% and certified-reviewer minutes ≤35 median",
          "340B Audit-Readiness Clinic run with ≥15 attendees or ≥3 Risk Scans generated"
        ],
        "kill_criteria": [
          "Fewer than 2 of 3 audits accepted",
          "Material rework uncoded or repeating after SOP fixes"
        ]
      },
      {
        "phase": "Phase 3 — Readout + season prep",
        "weeks": "Weeks 11-13",
        "outcomes": [
          "Pilot scorecard: cycle time, rework rate, exception rate, minutes per step, expansion willingness",
          "Continuous-Integrity Subscription drafted and pitched to all pilot entities",
          "Red-team pass: seeded 'omit a required exception' tests before the next audit wave"
        ],
        "exit_criteria": [
          "At least 2/3 audits accepted with ≤1 material rework each and NPS ≥8",
          "Zero validator escapes in the red team",
          "Go/no-go on scale-up documented"
        ],
        "kill_criteria": [
          "Pilot gates missed — run a second capped cohort, no hiring or expansion",
          "Red-team escapes unresolved before the next audit-deadline wave"
        ]
      }
    ],
    "metrics": {
      "north_star": "Certified-reviewer-signed Audit Packages delivered per month with ≥98% examiner-defensible claim clearance and zero examiner-attributable findings",
      "leading": [
        "Risk Scans requested → returned per week",
        "Discovery calls booked from the OPAIS-identified entity list",
        "Audits in intake passing required-feed gating first pass",
        "Median certified-reviewer minutes per audit",
        "Duplicate-discount exceptions resolved before an HRSA cycle (%)"
      ],
      "lagging": [
        "Audits delivered per month",
        "Rework rate",
        "Retention into the next annual-audit cycle",
        "Gross margin per audit"
      ],
      "guardrails": [
        "Fatal Compliance Lint exceptions shipped unresolved = 0",
        "No opinion delivered without a certified-reviewer sign-off",
        "No eligibility or carve-in policy decision made on the entity's behalf — 100% routed to the entity and its counsel",
        "No managed-services engagement accepted concurrently with an active independent-audit engagement for the same entity"
      ]
    },
    "executive_review": {
      "consensus": "Ship a thin, source-traced, certified-reviewer-gated production desk for the Contract-Pharmacy Eligibility Integrity Audit; cap the pilot at 3 covered entities and measure minutes per audit before any hiring.",
      "dissent": "GTM and Operations disagree on launch tempo — GTM wants the annual-deadline wave filled aggressively; Operations holds the pilot cap until the Week-12 readout to avoid the early-demand trap.",
      "go_no_go": "conditional-go",
      "top_3_risks": [
        "A signed opinion misstating an eligibility or duplicate-discount determination",
        "Independence drift past the licensing boundary",
        "Annual audit-deadline capacity crunch breaking the SLA"
      ],
      "first_10_steps": [
        "Version the Rule Pack (Medicaid Exclusion File logic, GPO-prohibition, NDC/WAC math) against current HRSA guidance text",
        "Annotate a sample Audit Package end-to-end with source-trace conventions",
        "Stand up the Risk Scan landing page with upload intake",
        "Build the OPAIS-identified entity outreach list with independent-audit due dates",
        "Send outbound touch 1 to the first 20 entities",
        "Wire claim-matching + Eligibility Match prompts; code validators for Medicaid Exclusion File, GPO-prohibition, NDC/WAC math, and sampling integrity",
        "Run 2 public sample claim sets end-to-end; seed omission tests",
        "Close 2-3 founding audits at $12,000-$20,000",
        "Deliver the first 3 audits with the founder reviewing 100% of flagged claims",
        "Log time-motion per step and code every reviewer correction"
      ]
    }
  },
  "project_site": {
    "slug": "340b-compliance-audit-engine",
    "app_name": "ClaimClear Desk",
    "archetype": "filing-dossier",
    "archetype_label": "independent audit dossier desk",
    "reader_role": "340B program / compliance director",
    "one_sentence_app": "ClaimClear Desk is an independent-audit dossier desk for 340B program and compliance directors who need every contract-pharmacy claim tied to a source feed and an HRSA rule before the opinion is signed.",
    "homepage_sequence": [
      "instrument",
      "proof",
      "scene",
      "workflow",
      "objections",
      "offer",
      "qualification"
    ],
    "hero": {
      "frame_label": "Legal / Compliance · independent audit dossier desk",
      "eyebrow": "340B program / compliance director · annual independent-audit deadline",
      "interface_title": "Audit Package with claim-level source traces control view",
      "primary_panel_title": "annual independent-audit deadline",
      "primary_panel_body": "Open engagement: cite the HRSA program-integrity rule for each tested claim, attach the source feed, run Compliance Lint, then stage the Audit Package for Certified Review and opinion sign-off.",
      "side_panel_title": "Before this opinion ships",
      "side_panel_items": [
        "TPA accumulator + EHR encounter feed captured",
        "certified reviewer assigned",
        "release gate closed until Compliance Lint clears"
      ],
      "status_metric": "REVIEW",
      "status_label": "release gate active"
    },
    "language": {
      "problem_heading": "Where independent-audit work breaks",
      "mechanism_heading": "Inside the ClaimClear Desk",
      "proof_heading": "The defensibility layer",
      "offer_heading": "The deliverables on the table",
      "objection_heading": "What we would ask in your seat",
      "qualification_heading": "The disqualifiers",
      "cta_close": "Open the first audit with a real Apexus-certified 340B expert on the release."
    },
    "modules": [
      {
        "name": "Audit engagement index",
        "job": "Turns each entity's independent-audit due date into a named engagement with an owner, a computed testing window, and a missing-feed list.",
        "artifact": "triage record"
      },
      {
        "name": "Entity source file",
        "job": "Matches each entity-supplied feed — TPA export, EHR encounter data, prior audit history — to the HRSA rule or Medicaid Exclusion File test it is supposed to support.",
        "artifact": "source-trace map"
      },
      {
        "name": "Release package",
        "job": "Packages the certified-reviewer-signed opinion, Exception Register, Recapture File, and counsel-referral memo with the trail an entity or its counsel can follow without a meeting.",
        "artifact": "release package"
      }
    ],
    "checkpoints": [
      {
        "label": "HRSA program-integrity rule",
        "pass": "mapped to source feed",
        "fail": "blocked before release"
      },
      {
        "label": "duplicate-discount exception",
        "pass": "resolved before the audit cycle",
        "fail": "engagement holds at red"
      },
      {
        "label": "Audit Package",
        "pass": "named certified reviewer signs",
        "fail": "stays watermarked draft"
      }
    ],
    "signature_scene": "You're a 340B program manager at a covered entity. It's the start of the quarter and your annual independent-audit deadline is six weeks out. Someone needs to hand HRSA an opinion that is actually defensible — with every claim tied to a rule you can point to. This page is built like the audit desk that person needed before the deadline hit."
  },
  "ddd": {
    "slug": "340b-compliance-audit-engine",
    "project_name": "ClaimClear",
    "business_understanding": {
      "summary": "ClaimClear runs the independent 340B audit for covered entities with contract-pharmacy networks: testing every claim for diversion, duplicate-discount, and pricing exceptions, and returning a Signed Independent Opinion, an Exception Register, and a Recapture File.",
      "customer_profile": "DSH hospitals, critical-access hospitals, FQHCs, and grantees with a contract-pharmacy network and no dedicated 340B integrity analyst; economic buyer is the 340B program manager, pharmacy director, or compliance officer.",
      "customer_pain": "The covered entity is strictly accountable for diversion and duplicate-discount violations on every contract-pharmacy claim; multi-TPA networks apply inconsistent eligibility logic, and HRSA audits hospitals at 10x the rate of manufacturers — while certified 340B integrity talent is scarce.",
      "paid_outcome": "A Signed Independent Opinion that tests 100% of contract-pharmacy claim volume, a Duplicate-Discount Reconciliation on every exception, and a Recapture File of missed savings — priced per audit and per audited claim, never hourly.",
      "value_creation": "AI compresses claim-to-encounter matching and pricing resolution from hours to minutes; deterministic code runs the Medicaid Exclusion File and GPO-prohibition rules; a certified reviewer owns judgment and signs. Revenue scales per audit and per claim, headcount scales with judgment volume.",
      "why_ai_native": "The audited claim is document-extraction + rule-application + eligibility-matching at volume — exactly what frontier models do well, with a certified expert at the chokepoint and HRSA's independence requirement as the moat no self-run software can claim.",
      "operational_risks": [
        "PHI/data-security incident in a trust-critical federal-discount-program market",
        "A false-clean opinion producing an examiner-attributable finding",
        "Certified-reviewer capacity failing to scale with claim volume",
        "Independence conflict from concurrent managed-services work",
        "HRSA program-rule drift (rebate model, patient definition) mid-engagement"
      ],
      "assumptions": [
        "Covered entities keep outsourcing independent audits to specialist vendors rather than building an in-house bench",
        "The ~2,800-hospital plus 1,400+-grantee recurring base sustains demand for a mandated annual purchase",
        "Per-audit and per-claim pricing supports 55-70% gross margin at steady state",
        "A certified-reviewer chokepoint keeps the licensing and independence boundary defensible",
        "Program-rule churn (rebate model, patient definition, state laws) increases rather than decreases demand for a continuously-updated service"
      ],
      "validation_questions": [
        "What examiner-defensible clearance rate do serviced audits actually hit?",
        "How many certified-reviewer minutes per audit at day 90 vs. launch?",
        "What share of duplicate-discount exceptions are resolved before the next HRSA cycle?",
        "Do pilots convert to a Continuous-Integrity Subscription at the assumed ~50%?",
        "Does automation share reach ~75% by day 90 without raising rework?"
      ]
    },
    "domain_discovery": {
      "actors": [
        {
          "actor": "Customer operator",
          "role": "340B program managers, 340B program teams, and operations leads",
          "goals": [
            "Deliver Audit Packages on schedule",
            "Reduce cycle time without losing defensibility"
          ],
          "decisions": [
            "Submit intake",
            "Accept or revise draft",
            "Approve outbound delivery"
          ],
          "pain_points": [
            "Scattered evidence across tools",
            "Manual re-typing",
            "Reviewer bottleneck"
          ]
        },
        {
          "actor": "Apexus-certified 340B expert",
          "role": "Signs and takes accountability for outbound artifacts",
          "goals": [
            "Sign only what is defensible",
            "Keep audit trail intact"
          ],
          "decisions": [
            "Approve / reject / request revisions",
            "Escalate on ambiguity"
          ],
          "pain_points": [
            "Incomplete evidence",
            "Ambiguous AI outputs",
            "No visible source-of-truth"
          ]
        },
        {
          "actor": "Covered entity counsel",
          "role": "The covered entity's counsel; inspects the Audit Package on demand",
          "goals": [
            "Reconstruct decisions from evidence"
          ],
          "decisions": [
            "Accept, question, or reject the disclosure"
          ],
          "pain_points": [
            "Missing citations",
            "Non-reconstructable state"
          ]
        },
        {
          "actor": "AI Orchestrator",
          "role": "Bounded AI agent that drafts + validates",
          "goals": [
            "Produce grounded, cited drafts",
            "Escalate on low confidence"
          ],
          "decisions": [
            "Draft vs escalate",
            "Which retrieval sources to cite"
          ],
          "pain_points": [
            "Ambiguous intake",
            "Sparse evidence"
          ]
        },
        {
          "actor": "Platform admin",
          "role": "Runs the patient, manages users + integrations",
          "goals": [
            "Keep the system safe and observable"
          ],
          "decisions": [
            "Provision users",
            "Rotate secrets"
          ],
          "pain_points": [
            "Change management across patients"
          ]
        }
      ],
      "glossary": [
        {
          "term": "certification case",
          "definition": "The unit of work a customer brings in for ClaimClear to process.",
          "used_by": "Customer, Operator",
          "context": "Sales & Intake",
          "example": "\"Open a certification case for the December-FYE engagement\"",
          "notes": "Do not confuse with 'engagement' in Billing (contract term)."
        },
        {
          "term": "control evidence",
          "definition": "Cited fact linked to a source, attached to a claim inside the Audit Package.",
          "used_by": "Reviewer, Auditor",
          "context": "Service Fulfillment",
          "example": "\"Every rate quoted must carry control evidence\"",
          "notes": "Distinct from 'note' (internal, non-cited)."
        },
        {
          "term": "Audit Package",
          "definition": "The reviewer-signed deliverable ClaimClear produces.",
          "used_by": "Customer, Reviewer, Auditor",
          "context": "Client Delivery",
          "example": "\"Ship the Audit Package once the reviewer signs\"",
          "notes": "Immutable once signed; corrections go through Retraction workflow."
        },
        {
          "term": "Reviewer signoff",
          "definition": "Cryptographically signed attestation by the licensed reviewer that the artifact is defensible.",
          "used_by": "Reviewer, Platform",
          "context": "Quality Assurance",
          "example": "\"Signoff bound to session + timestamp\"",
          "notes": "Not the same as customer approval."
        },
        {
          "term": "Owner action",
          "definition": "Discrete fact the business owner must supply before an artifact can be publicly claimed.",
          "used_by": "Owner, Platform",
          "context": "Compliance & Governance",
          "example": "\"Entity name, engagement, privacy inbox\"",
          "notes": "Blocks release when open."
        },
        {
          "term": "Retraction",
          "definition": "Explicit correction of a previously delivered artifact with the owner's counsel-facing notification.",
          "used_by": "Reviewer, Legal, Customer",
          "context": "Client Delivery",
          "example": "\"File a retraction within 24h\"",
          "notes": "Rare, but must always be possible."
        },
        {
          "term": "Confidence score",
          "definition": "AI-assigned probability that a drafted claim is grounded in retrieved evidence.",
          "used_by": "AI Orchestrator, Reviewer",
          "context": "AI Orchestration",
          "example": "\"Below 0.7 → escalate to reviewer\"",
          "notes": "Not a legal or clinical confidence measure."
        },
        {
          "term": "Escalation",
          "definition": "Automatic routing of a case from AI drafting to a named human role.",
          "used_by": "AI Orchestrator, Reviewer",
          "context": "AI Orchestration ↔ Human Review",
          "example": "\"Escalate on ambiguous engagement\"",
          "notes": "Escalation ≠ rejection; it is a hand-off."
        }
      ],
      "decisions": [
        {
          "decision": "Accept intake",
          "who": "Sales & Intake context (rule + operator override)",
          "inputs": [
            "Customer identity",
            "Scope statement",
            "certification case completeness"
          ],
          "rule": "Reject if scope statement missing or customer not on-boarded",
          "output": "certification case accepted event",
          "risk": "Accepting out-of-scope work degrades reviewer trust."
        },
        {
          "decision": "Draft vs escalate",
          "who": "AI Orchestrator",
          "inputs": [
            "control evidence coverage",
            "Confidence score",
            "Prior-similar-case pattern"
          ],
          "rule": "Escalate below confidence threshold or on ambiguous engagement",
          "output": "Draft-ready OR escalation event",
          "risk": "Silent low-confidence drafts erode reviewer trust."
        },
        {
          "decision": "Sign the Audit Package",
          "who": "Apexus-certified 340B expert",
          "inputs": [
            "Draft",
            "Full evidence trail",
            "Prior reviewer comments"
          ],
          "rule": "Sign only if all claims cite evidence AND scope matches engagement",
          "output": "Reviewer-signed event",
          "risk": "Over-broad signoff creates malpractice exposure."
        },
        {
          "decision": "Release publicly",
          "who": "Compliance & Governance",
          "inputs": [
            "Owner-action ledger status",
            "Evidence closure",
            "Legal review flag"
          ],
          "rule": "Blocked if any owner-action open OR unresolved release-blocker evidence",
          "output": "Public-release event OR blocked-release event",
          "risk": "Premature public claims are unretractable in perception."
        },
        {
          "decision": "Retract delivered artifact",
          "who": "Legal + Apexus-certified 340B expert",
          "inputs": [
            "Newly discovered fact",
            "Impact assessment"
          ],
          "rule": "Retract if any signed claim is materially wrong OR unsupported by evidence",
          "output": "Retraction event + customer notification",
          "risk": "Delayed retraction compounds legal exposure."
        }
      ],
      "events": [
        {
          "event": "certificationCaseAccepted",
          "meaning": "Work is now committed to fulfillment",
          "trigger": "Operator or auto-rule accepts intake",
          "downstream": [
            "Onboarding kicked off",
            "AI orchestrator scheduled"
          ]
        },
        {
          "event": "EvidenceCollected",
          "meaning": "Enough evidence exists to draft",
          "trigger": "Retrieval + upload passes coverage rule",
          "downstream": [
            "Drafting authorized"
          ]
        },
        {
          "event": "DraftReady",
          "meaning": "AI draft with cited evidence is available for reviewer",
          "trigger": "AI orchestrator finishes drafting run",
          "downstream": [
            "Reviewer notification"
          ]
        },
        {
          "event": "EscalationRaised",
          "meaning": "AI could not complete safely",
          "trigger": "Confidence below threshold OR ambiguous input",
          "downstream": [
            "Reviewer queue"
          ]
        },
        {
          "event": "ReviewerSigned",
          "meaning": "Apexus-certified 340B expert took accountability",
          "trigger": "Reviewer signature captured",
          "downstream": [
            "Delivery authorized",
            "Audit-log snapshot"
          ]
        },
        {
          "event": "ArtifactDelivered",
          "meaning": "Audit Package handed to the customer / downstream party",
          "trigger": "Delivery adapter confirms transmit",
          "downstream": [
            "Billing event",
            "Customer notification"
          ]
        },
        {
          "event": "OwnerActionResolved",
          "meaning": "A blocking owner-supplied fact is now on file",
          "trigger": "Owner updates the ledger",
          "downstream": [
            "Release-decision recomputation"
          ]
        },
        {
          "event": "RetractionFiled",
          "meaning": "A delivered artifact is formally withdrawn or corrected",
          "trigger": "Reviewer + legal jointly file",
          "downstream": [
            "Customer notification",
            "Audit-log append"
          ]
        }
      ]
    },
    "subdomains": [
      {
        "name": "Service Fulfillment (evidence-linked drafting + review)",
        "type": "core",
        "description": "The end-to-end path from certification case to Apexus-certified 340B expert-signed Audit Package, with every claim cited.",
        "reason": "This is what customers pay for and what counsel and owners inspect.",
        "business_value": "Direct revenue and legal defensibility.",
        "recommendation": "build",
        "ai_involvement": "high",
        "human_involvement": "high",
        "risks": [
          "Hallucinated claims",
          "Reviewer bottleneck",
          "Un-reconstructable audit trail"
        ],
        "validation_questions": [
          "Can the reviewer sign in <5 business days?",
          "Can we reconstruct any past artifact on demand?"
        ]
      },
      {
        "name": "AI Orchestration (bounded agents + retrieval)",
        "type": "core",
        "description": "The bounded AI layer that drafts, cites, validates, and escalates — never authors final decisions unassisted.",
        "reason": "The AI-native competitive edge lives here; misuse here creates every high-severity risk.",
        "business_value": "Cycle-time and margin advantage.",
        "recommendation": "build",
        "ai_involvement": "high",
        "human_involvement": "medium",
        "risks": [
          "Prompt injection",
          "Grounding drift",
          "Silent low-confidence output"
        ],
        "validation_questions": [
          "What is the acceptance rate of AI drafts by reviewers?",
          "What percent of runs escalate correctly?"
        ]
      },
      {
        "name": "Quality Assurance (reviewer signoff + retraction)",
        "type": "core",
        "description": "Apexus-certified 340B expert workflow, signature capture, retraction workflow, and audit-log snapshots.",
        "reason": "Signoff is the trust primitive of the whole business.",
        "business_value": "Defensibility; premium pricing.",
        "recommendation": "build",
        "ai_involvement": "medium",
        "human_involvement": "high",
        "risks": [
          "Signature spoofing",
          "Repudiation",
          "Delayed retraction"
        ],
        "validation_questions": [
          "Is every signature cryptographically bound?",
          "Can we replay any signoff on demand?"
        ]
      },
      {
        "name": "Sales & Intake",
        "type": "supporting",
        "description": "Lead capture through accepted engagement + scope statement.",
        "reason": "Feeds Fulfillment; not the differentiator, but if broken, nothing else runs.",
        "business_value": "Feeds pipeline.",
        "recommendation": "build",
        "ai_involvement": "medium",
        "human_involvement": "high",
        "risks": [
          "Out-of-scope acceptance"
        ],
        "validation_questions": [
          "Do we reject work outside the ICP?"
        ]
      },
      {
        "name": "Client Onboarding & Profile",
        "type": "supporting",
        "description": "Patient provisioning, contact matrix, evidence-certification import, engagement letter.",
        "reason": "One-time high-touch step per customer.",
        "business_value": "Reduces first-artifact time.",
        "recommendation": "build",
        "ai_involvement": "low",
        "human_involvement": "high",
        "risks": [
          "Contract terms not represented in the system"
        ],
        "validation_questions": [
          "Is the reviewer named per patient?"
        ]
      },
      {
        "name": "Client Delivery & Success",
        "type": "supporting",
        "description": "Delivery adapter, customer portal, revision loop, renewal signal.",
        "reason": "Customer-visible surface; drives retention.",
        "business_value": "Retention.",
        "recommendation": "build",
        "ai_involvement": "low",
        "human_involvement": "medium",
        "risks": [
          "Delivery failure not surfaced"
        ],
        "validation_questions": [
          "Do we alert the customer within 1h of any delivery failure?"
        ]
      },
      {
        "name": "Compliance & Governance",
        "type": "supporting",
        "description": "Owner-action ledger, release-decision engine, policy attestation, DSAR / retraction runbooks.",
        "reason": "Cross-cuts every context; owns 'can we publicly claim this?'.",
        "business_value": "Prevents category-level failure.",
        "recommendation": "build",
        "ai_involvement": "low",
        "human_involvement": "high",
        "risks": [
          "Premature public claim"
        ],
        "validation_questions": [
          "Are all owner actions closed before public release?"
        ]
      },
      {
        "name": "Billing & Revenue",
        "type": "generic",
        "description": "Subscription + usage-based invoicing, dunning, revenue reporting.",
        "reason": "Solved category; do not build.",
        "business_value": "Cash collection.",
        "recommendation": "buy",
        "ai_involvement": "low",
        "human_involvement": "low",
        "risks": [
          "Tax per-engagement errors"
        ],
        "validation_questions": [
          "Is Stripe Tax sufficient for the launch engagements?"
        ]
      },
      {
        "name": "Identity & Access",
        "type": "generic",
        "description": "SSO, MFA, RBAC, session management.",
        "reason": "Solved category.",
        "business_value": "Table stakes.",
        "recommendation": "integrate",
        "ai_involvement": "low",
        "human_involvement": "low",
        "risks": [
          "Role escalation"
        ],
        "validation_questions": [
          "Are roles stored in a dedicated table?"
        ]
      },
      {
        "name": "Knowledge Base & Retrieval",
        "type": "supporting",
        "description": "Per-patient retrieval indices, source-of-truth documents, prompt library.",
        "reason": "Feeds AI Orchestration; poor retrieval = poor drafts.",
        "business_value": "Drives AI quality.",
        "recommendation": "build",
        "ai_involvement": "high",
        "human_involvement": "medium",
        "risks": [
          "Cross-patient leakage",
          "Stale sources"
        ],
        "validation_questions": [
          "Is retrieval partitioned per patient?"
        ]
      },
      {
        "name": "Analytics & Reporting",
        "type": "supporting",
        "description": "Activation, cycle time, acceptance rate, reviewer load, outcome reports.",
        "reason": "Drives every operational decision.",
        "business_value": "Feedback loop.",
        "recommendation": "build",
        "ai_involvement": "low",
        "human_involvement": "low",
        "risks": [
          "Vanity metrics"
        ],
        "validation_questions": [
          "Is the north-star wired?"
        ]
      },
      {
        "name": "External Integrations (Anti-Corruption Layer)",
        "type": "supporting",
        "description": "Adapters to PM management software, prior-audit-vendor formats, Airtable intake tracker and other tools with translation to internal domain terms.",
        "reason": "External schemas must never leak into the core.",
        "business_value": "Enables integration without corrupting the model.",
        "recommendation": "build",
        "ai_involvement": "low",
        "human_involvement": "medium",
        "risks": [
          "Silent schema drift"
        ],
        "validation_questions": [
          "Do all external calls pass through an ACL translator?"
        ]
      }
    ],
    "core_domain_analysis": {
      "primary_core": "Service Fulfillment (evidence-linked drafting + review)",
      "secondary_cores": [
        "AI Orchestration (bounded agents + retrieval)",
        "Quality Assurance (reviewer signoff + retraction)"
      ],
      "supporting_may_become_core": [
        "Knowledge Base & Retrieval (as vertical corpora accumulate)",
        "Compliance & Governance (as the owner's counsel interactions increase)"
      ],
      "generic_do_not_distract": [
        "Billing & Revenue",
        "Identity & Access"
      ],
      "rationale": "The paid outcome (reviewer-signed, evidence-linked artifact) lives in Fulfillment, but its defensibility depends on AI Orchestration + QA behaving correctly. Treat all three as core; do not dilute engineering time on generic subdomains."
    },
    "bounded_contexts": [
      {
        "name": "Service Fulfillment",
        "purpose": "Turn accepted certification cases into reviewer-signed Audit Packages.",
        "subdomain": "Service Fulfillment (core)",
        "type": "core",
        "owned_language": [
          "certification case",
          "control evidence",
          "Audit Package",
          "Draft",
          "Escalation",
          "Signoff"
        ],
        "owns": [
          "certification case lifecycle",
          "Draft state",
          "Evidence links",
          "Delivery packet composition"
        ],
        "does_not_own": [
          "Reviewer identity",
          "Billing",
          "Public claim decision"
        ],
        "primary_actors": [
          "Customer operator",
          "AI Orchestrator",
          "Apexus-certified 340B expert"
        ],
        "entities": [
          "certification case",
          "Draft",
          "Audit Package",
          "Delivery"
        ],
        "value_objects": [
          "Confidence score",
          "Evidence citation",
          "Delivery address"
        ],
        "aggregates": [
          "certificationCaseAggregate",
          "CertificationPacketAggregate"
        ],
        "domain_services": [
          "Draft composer",
          "Delivery adapter"
        ],
        "application_services": [
          "OpenCertificationCase",
          "RequestDraft",
          "AttachEvidence",
          "RequestSignoff",
          "DeliverCertificationPacket"
        ],
        "commands": [
          "OpenIntake",
          "AttachEvidence",
          "RequestDraft",
          "SubmitForSignoff",
          "DeliverArtifact"
        ],
        "domain_events": [
          "CertificationCaseAccepted",
          "EvidenceCollected",
          "DraftReady",
          "ArtifactSigned",
          "ArtifactDelivered"
        ],
        "policies": [
          "Auto-request signoff when evidence coverage complete",
          "Auto-block delivery until signoff received"
        ],
        "specifications": [
          "EvidenceCoverageSpec",
          "DeliverabilitySpec"
        ],
        "invariants": [
          "A Audit Package cannot be delivered without a valid Reviewer signoff",
          "Every claim in a delivered artifact cites at least one evidence item"
        ],
        "ai_agents": [
          "Drafter Agent"
        ],
        "human_roles": [
          "Customer operator",
          "Apexus-certified 340B expert"
        ],
        "data_owned": [
          "certification case",
          "Draft",
          "Audit Package",
          "Delivery"
        ],
        "inputs": [
          "Intake payload",
          "Uploaded evidence",
          "Retrieval hits"
        ],
        "outputs": [
          "Signed artifact packet",
          "Delivery confirmation"
        ],
        "external_integrations": [
          "PM management software",
          "prior-audit-vendor formats"
        ],
        "risks": [
          "Un-cited claim slips into delivery",
          "Delivery adapter fails silently"
        ],
        "interfaces": [
          "→ Quality Assurance (RequestSignoff)",
          "→ Client Delivery (ArtifactDelivered)",
          "← AI Orchestration (DraftProduced)"
        ]
      },
      {
        "name": "AI Orchestration",
        "purpose": "Run bounded AI agents that draft, validate, cite, and escalate.",
        "subdomain": "AI Orchestration (core)",
        "type": "core",
        "owned_language": [
          "Prompt version",
          "Confidence score",
          "Escalation",
          "Retrieval hit"
        ],
        "owns": [
          "Prompt registry",
          "Agent run log",
          "Confidence thresholds"
        ],
        "does_not_own": [
          "Evidence sourcing",
          "Reviewer signature",
          "Business decisions"
        ],
        "primary_actors": [
          "AI Orchestrator",
          "Ops (prompt owner)"
        ],
        "entities": [
          "AgentRun",
          "PromptVersion",
          "RetrievalHit"
        ],
        "value_objects": [
          "Confidence score",
          "Token occupancy",
          "Model cost"
        ],
        "aggregates": [
          "AgentRunAggregate",
          "PromptRegistryAggregate"
        ],
        "domain_services": [
          "Retrieval router",
          "Output validator",
          "Escalation router"
        ],
        "application_services": [
          "StartAgentRun",
          "ValidateOutput",
          "PublishPromptVersion"
        ],
        "commands": [
          "StartAgentRun",
          "PublishPromptVersion",
          "SetConfidenceThreshold"
        ],
        "domain_events": [
          "DraftProduced",
          "EscalationRaised",
          "PromptVersionPublished"
        ],
        "policies": [
          "Escalate on confidence < threshold",
          "Never call model with cross-patient retrieval context",
          "Reject output failing structured-output validator"
        ],
        "specifications": [
          "GroundedOutputSpec",
          "TokenBudgetSpec"
        ],
        "invariants": [
          "No AI output leaves this context without passing OutputValidator",
          "Prompt versions are immutable once published"
        ],
        "ai_agents": [
          "Drafter Agent",
          "Classifier Agent",
          "Evaluator Agent"
        ],
        "human_roles": [
          "Prompt owner (Ops)"
        ],
        "data_owned": [
          "Prompt registry",
          "Agent run logs",
          "Confidence thresholds"
        ],
        "inputs": [
          "Intake context",
          "Retrieval hits",
          "Prompt version"
        ],
        "outputs": [
          "Draft payload",
          "Escalation event",
          "Run trace"
        ],
        "external_integrations": [
          "frontier LLM API (portable)",
          "Retrieval index"
        ],
        "risks": [
          "Prompt injection via customer input",
          "Retrieval leakage across patients",
          "Silent hallucination"
        ],
        "interfaces": [
          "→ Service Fulfillment (DraftProduced)",
          "→ Quality Assurance (EscalationRaised)",
          "← Knowledge Base (RetrievalHit)"
        ]
      },
      {
        "name": "Quality Assurance",
        "purpose": "Reviewer workflow, signature capture, retraction workflow, audit-log snapshots.",
        "subdomain": "Quality Assurance (core)",
        "type": "core",
        "owned_language": [
          "Signoff",
          "Retraction",
          "Reviewer session"
        ],
        "owns": [
          "Signature log",
          "Reviewer queue",
          "Retraction workflow"
        ],
        "does_not_own": [
          "Audit Package content",
          "Public release decision"
        ],
        "primary_actors": [
          "Apexus-certified 340B expert",
          "Legal"
        ],
        "entities": [
          "Signoff",
          "Retraction",
          "ReviewerSession"
        ],
        "value_objects": [
          "Signature manifest",
          "Retraction reason"
        ],
        "aggregates": [
          "SignoffAggregate",
          "RetractionAggregate"
        ],
        "domain_services": [
          "Signature service",
          "Retraction service"
        ],
        "application_services": [
          "ApproveArtifact",
          "RejectArtifact",
          "FileRetraction"
        ],
        "commands": [
          "ApproveArtifact",
          "RejectArtifact",
          "FileRetraction"
        ],
        "domain_events": [
          "ArtifactSigned",
          "ArtifactRejected",
          "RetractionFiled"
        ],
        "policies": [
          "Only Apexus-certified 340B expert may sign",
          "Retraction requires legal co-signer"
        ],
        "specifications": [
          "ReviewerAuthoritySpec",
          "RetractionPreconditionsSpec"
        ],
        "invariants": [
          "A signature is bound to a live authenticated session, not a form field",
          "Signed artifacts are immutable; corrections go through Retraction"
        ],
        "ai_agents": [],
        "human_roles": [
          "Apexus-certified 340B expert",
          "Legal"
        ],
        "data_owned": [
          "Signatures",
          "Retractions",
          "Reviewer sessions"
        ],
        "inputs": [
          "Draft ready",
          "Escalation payload"
        ],
        "outputs": [
          "Signoff event",
          "Retraction event"
        ],
        "external_integrations": [
          "IdP (Okta / Google)"
        ],
        "risks": [
          "Signature spoofing",
          "Repudiation"
        ],
        "interfaces": [
          "→ Service Fulfillment (ArtifactSigned)",
          "→ Compliance & Governance (RetractionFiled)"
        ]
      },
      {
        "name": "Compliance & Governance",
        "purpose": "Own the release decision, owner-action ledger, DSAR + retraction runbooks.",
        "subdomain": "Compliance & Governance (supporting)",
        "type": "supporting",
        "owned_language": [
          "Owner action",
          "Release decision",
          "DSAR"
        ],
        "owns": [
          "Owner-action ledger",
          "Release-decision policy",
          "DSAR queue"
        ],
        "does_not_own": [
          "Audit Package content",
          "Reviewer identity"
        ],
        "primary_actors": [
          "Business owner",
          "Legal",
          "Apexus-certified 340B expert"
        ],
        "entities": [
          "OwnerAction",
          "ReleaseDecision",
          "DSARRequest"
        ],
        "value_objects": [
          "Blocker reason",
          "Engagement"
        ],
        "aggregates": [
          "OwnerActionLedgerAggregate",
          "ReleaseDecisionAggregate"
        ],
        "domain_services": [
          "Release-decision engine",
          "DSAR fulfillment service"
        ],
        "application_services": [
          "ResolveOwnerAction",
          "RecomputeReleaseDecision",
          "ProcessDSAR"
        ],
        "commands": [
          "ResolveOwnerAction",
          "RaiseOwnerAction",
          "ProcessDSAR"
        ],
        "domain_events": [
          "OwnerActionResolved",
          "ReleaseDecisionChanged",
          "DSARFulfilled"
        ],
        "policies": [
          "Block public release while any owner action open",
          "DSAR SLA 30 days"
        ],
        "specifications": [
          "ReleaseReadinessSpec",
          "DSARSpec"
        ],
        "invariants": [
          "Release cannot flip to 'ready' with open blocking owner actions",
          "Every DSAR is auditable end-to-end"
        ],
        "ai_agents": [],
        "human_roles": [
          "Business owner",
          "Legal"
        ],
        "data_owned": [
          "Owner-action ledger",
          "Release decisions",
          "DSAR queue"
        ],
        "inputs": [
          "Owner input",
          "Legal review outcome"
        ],
        "outputs": [
          "Release-decision event",
          "DSAR confirmation"
        ],
        "external_integrations": [
          "Email inbox"
        ],
        "risks": [
          "Public release while blocker open"
        ],
        "interfaces": [
          "← Service Fulfillment",
          "← Quality Assurance (RetractionFiled)"
        ]
      },
      {
        "name": "Sales & Intake",
        "purpose": "Lead → qualified engagement → accepted intake.",
        "subdomain": "Sales & Intake (supporting)",
        "type": "supporting",
        "owned_language": [
          "Lead",
          "Engagement",
          "Scope statement"
        ],
        "owns": [
          "Lead pipeline",
          "Engagement letter",
          "Scope statement"
        ],
        "does_not_own": [
          "Fulfillment",
          "Billing"
        ],
        "primary_actors": [
          "Owner",
          "Customer"
        ],
        "entities": [
          "Lead",
          "Engagement"
        ],
        "value_objects": [
          "Scope statement",
          "Pricing offer"
        ],
        "aggregates": [
          "EngagementAggregate"
        ],
        "domain_services": [
          "Scope-fit evaluator"
        ],
        "application_services": [
          "QualifyLead",
          "AcceptEngagement"
        ],
        "commands": [
          "QualifyLead",
          "AcceptEngagement"
        ],
        "domain_events": [
          "EngagementAccepted"
        ],
        "policies": [
          "Reject out-of-ICP engagement",
          "Engagement letter required before intake"
        ],
        "specifications": [
          "ScopeFitSpec"
        ],
        "invariants": [
          "Cannot open an intake without an accepted engagement"
        ],
        "ai_agents": [
          "Qualifier Copilot (assist only)"
        ],
        "human_roles": [
          "Owner",
          "Sales lead"
        ],
        "data_owned": [
          "Leads",
          "Engagements"
        ],
        "inputs": [
          "Lead form",
          "Discovery notes"
        ],
        "outputs": [
          "Accepted engagement event"
        ],
        "external_integrations": [
          "CRM",
          "Email inbox"
        ],
        "risks": [
          "Accepting out-of-scope engagement"
        ],
        "interfaces": [
          "→ Client Onboarding",
          "→ Service Fulfillment (intake enablement)"
        ]
      },
      {
        "name": "Client Onboarding & Profile",
        "purpose": "Provision patient, capture reviewer identity, import evidence certification.",
        "subdomain": "Client Onboarding & Profile (supporting)",
        "type": "supporting",
        "owned_language": [
          "Patient",
          "Reviewer identity",
          "Evidence certification"
        ],
        "owns": [
          "Patient provisioning",
          "Reviewer identity record",
          "Evidence certification import"
        ],
        "does_not_own": [
          "Signature capture",
          "Delivery"
        ],
        "primary_actors": [
          "Onboarding lead",
          "Customer admin"
        ],
        "entities": [
          "Patient",
          "ReviewerIdentity",
          "EvidencePackImport"
        ],
        "value_objects": [
          "Contact matrix",
          "Engagement set"
        ],
        "aggregates": [
          "PatientAggregate"
        ],
        "domain_services": [
          "Patient provisioner"
        ],
        "application_services": [
          "ProvisionPatient",
          "RegisterReviewer",
          "ImportEvidencePack"
        ],
        "commands": [
          "ProvisionPatient",
          "RegisterReviewer",
          "ImportEvidencePack"
        ],
        "domain_events": [
          "PatientProvisioned",
          "ReviewerRegistered"
        ],
        "policies": [
          "No fulfillment starts until a Reviewer is registered per patient"
        ],
        "specifications": [
          "ReviewerCredentialSpec"
        ],
        "invariants": [
          "Every patient has at least one named reviewer with a valid credential on file"
        ],
        "ai_agents": [],
        "human_roles": [
          "Onboarding lead"
        ],
        "data_owned": [
          "Patients",
          "Reviewer identities",
          "Evidence certification imports"
        ],
        "inputs": [
          "Engagement",
          "Customer-supplied evidence certification"
        ],
        "outputs": [
          "Provisioned patient"
        ],
        "external_integrations": [
          "IdP",
          "Google Drive / S3"
        ],
        "risks": [
          "Reviewer credential expired"
        ],
        "interfaces": [
          "→ Service Fulfillment"
        ]
      },
      {
        "name": "Client Delivery & Success",
        "purpose": "Deliver signed artifacts, own the customer surface, drive renewal.",
        "subdomain": "Client Delivery & Success (supporting)",
        "type": "supporting",
        "owned_language": [
          "Delivery",
          "Revision request",
          "Renewal signal"
        ],
        "owns": [
          "Customer portal",
          "Delivery log",
          "Revision workflow"
        ],
        "does_not_own": [
          "Signed content",
          "Billing"
        ],
        "primary_actors": [
          "Customer operator",
          "Success lead"
        ],
        "entities": [
          "DeliveryReceipt",
          "RevisionRequest"
        ],
        "value_objects": [
          "Delivery method",
          "NPS signal"
        ],
        "aggregates": [
          "DeliveryAggregate"
        ],
        "domain_services": [
          "Delivery adapter"
        ],
        "application_services": [
          "ConfirmDelivery",
          "RecordRevisionRequest"
        ],
        "commands": [
          "ConfirmDelivery",
          "RecordRevisionRequest"
        ],
        "domain_events": [
          "DeliveryConfirmed",
          "RevisionRequested"
        ],
        "policies": [
          "Alert customer within 1h of any delivery failure"
        ],
        "specifications": [
          "DeliveryAcknowledgmentSpec"
        ],
        "invariants": [
          "Every DeliveryConfirmed has a linked Signoff"
        ],
        "ai_agents": [
          "Success Copilot (assist only)"
        ],
        "human_roles": [
          "Success lead"
        ],
        "data_owned": [
          "Deliveries",
          "Revision requests"
        ],
        "inputs": [
          "Signed artifact",
          "Customer feedback"
        ],
        "outputs": [
          "Delivery confirmation",
          "Revision request"
        ],
        "external_integrations": [
          "Email",
          "Customer portal"
        ],
        "risks": [
          "Silent delivery failure"
        ],
        "interfaces": [
          "← Service Fulfillment",
          "→ Billing"
        ]
      },
      {
        "name": "Knowledge Base & Retrieval",
        "purpose": "Own per-patient retrieval indices, source-of-truth documents, prompt library refs.",
        "subdomain": "Knowledge Base & Retrieval (supporting)",
        "type": "supporting",
        "owned_language": [
          "Source document",
          "Retrieval index",
          "Chunk"
        ],
        "owns": [
          "Source docs",
          "Retrieval indices",
          "Chunk metadata"
        ],
        "does_not_own": [
          "Prompt versions",
          "Model calls"
        ],
        "primary_actors": [
          "Knowledge ops"
        ],
        "entities": [
          "SourceDoc",
          "IndexShard"
        ],
        "value_objects": [
          "Chunk",
          "SourceCitation"
        ],
        "aggregates": [
          "SourceDocAggregate",
          "IndexShardAggregate"
        ],
        "domain_services": [
          "Ingestion pipeline",
          "Reindex service"
        ],
        "application_services": [
          "IngestDoc",
          "Reindex",
          "PurgeSource"
        ],
        "commands": [
          "IngestDoc",
          "Reindex",
          "PurgeSource"
        ],
        "domain_events": [
          "DocIngested",
          "IndexRebuilt"
        ],
        "policies": [
          "Retrieval indices partitioned per patient",
          "Purge cascades to indices within SLA"
        ],
        "specifications": [
          "PatientIsolationSpec"
        ],
        "invariants": [
          "A retrieval call is always scoped to a single patient partition"
        ],
        "ai_agents": [],
        "human_roles": [
          "Knowledge ops"
        ],
        "data_owned": [
          "Source docs",
          "Indices"
        ],
        "inputs": [
          "Uploaded docs",
          "External source pulls"
        ],
        "outputs": [
          "Retrieval hits with citations"
        ],
        "external_integrations": [
          "Blob storage",
          "Search API"
        ],
        "risks": [
          "Cross-patient retrieval leak",
          "Stale index"
        ],
        "interfaces": [
          "→ AI Orchestration"
        ]
      },
      {
        "name": "Billing & Revenue",
        "purpose": "Invoicing, subscription management, dunning, revenue reporting.",
        "subdomain": "Billing (generic)",
        "type": "generic",
        "owned_language": [
          "Invoice",
          "Subscription",
          "Usage record"
        ],
        "owns": [
          "Invoices",
          "Subscriptions",
          "Usage records"
        ],
        "does_not_own": [
          "Fulfillment",
          "Signoff"
        ],
        "primary_actors": [
          "Finance",
          "Customer admin"
        ],
        "entities": [
          "Subscription",
          "Invoice",
          "UsageRecord"
        ],
        "value_objects": [
          "Line item",
          "Tax engagement"
        ],
        "aggregates": [
          "SubscriptionAggregate"
        ],
        "domain_services": [
          "Billing adapter"
        ],
        "application_services": [
          "ChargeSubscription",
          "RecordUsage"
        ],
        "commands": [
          "ChargeSubscription",
          "RecordUsage"
        ],
        "domain_events": [
          "InvoicePaid",
          "SubscriptionCanceled"
        ],
        "policies": [
          "Meter artifact delivery for usage pricing"
        ],
        "specifications": [
          "ChargeabilitySpec"
        ],
        "invariants": [
          "No charge without a delivered artifact when priced per artifact"
        ],
        "ai_agents": [],
        "human_roles": [
          "Finance"
        ],
        "data_owned": [
          "Subscriptions",
          "Invoices"
        ],
        "inputs": [
          "Delivery events"
        ],
        "outputs": [
          "Invoice records"
        ],
        "external_integrations": [
          "Stripe"
        ],
        "risks": [
          "Tax per-engagement errors"
        ],
        "interfaces": [
          "← Client Delivery"
        ]
      },
      {
        "name": "Identity & Access",
        "purpose": "SSO, MFA, RBAC, session management.",
        "subdomain": "Identity (generic)",
        "type": "generic",
        "owned_language": [
          "User",
          "Role",
          "Session"
        ],
        "owns": [
          "Users",
          "Roles table",
          "Sessions"
        ],
        "does_not_own": [
          "Business capability decisions"
        ],
        "primary_actors": [
          "Platform admin",
          "User"
        ],
        "entities": [
          "User",
          "RoleAssignment",
          "Session"
        ],
        "value_objects": [
          "Role",
          "Claim"
        ],
        "aggregates": [
          "UserAggregate"
        ],
        "domain_services": [
          "Auth service"
        ],
        "application_services": [
          "SignIn",
          "AssignRole"
        ],
        "commands": [
          "SignIn",
          "AssignRole"
        ],
        "domain_events": [
          "UserSignedIn",
          "RoleAssigned"
        ],
        "policies": [
          "Roles in a dedicated table, checked server-side"
        ],
        "specifications": [
          "RoleAuthoritySpec"
        ],
        "invariants": [
          "No role check runs client-only"
        ],
        "ai_agents": [],
        "human_roles": [
          "Platform admin"
        ],
        "data_owned": [
          "Users",
          "Roles",
          "Sessions"
        ],
        "inputs": [
          "Auth events"
        ],
        "outputs": [
          "Sessions"
        ],
        "external_integrations": [
          "IdP (Google / Okta)"
        ],
        "risks": [
          "Role escalation"
        ],
        "interfaces": [
          "→ every other context"
        ]
      },
      {
        "name": "Analytics & Reporting",
        "purpose": "Operational + business metrics, outcome reports.",
        "subdomain": "Analytics (supporting)",
        "type": "supporting",
        "owned_language": [
          "Metric",
          "Dashboard",
          "Outcome report"
        ],
        "owns": [
          "Metric definitions",
          "Dashboards"
        ],
        "does_not_own": [
          "Raw write models"
        ],
        "primary_actors": [
          "Ops lead",
          "Owner"
        ],
        "entities": [
          "MetricDefinition",
          "Dashboard"
        ],
        "value_objects": [
          "Window",
          "Target"
        ],
        "aggregates": [
          "MetricDefinitionAggregate"
        ],
        "domain_services": [
          "Rollup service"
        ],
        "application_services": [
          "PublishMetric",
          "PublishDashboard"
        ],
        "commands": [
          "PublishMetric",
          "PublishDashboard"
        ],
        "domain_events": [
          "DashboardPublished"
        ],
        "policies": [
          "North-star must be wired before Phase 2 launch"
        ],
        "specifications": [
          "MetricDefinedSpec"
        ],
        "invariants": [
          "Metrics have a definition, a target, and an owner"
        ],
        "ai_agents": [],
        "human_roles": [
          "Ops lead"
        ],
        "data_owned": [
          "Metric definitions",
          "Read-model rollups"
        ],
        "inputs": [
          "Domain events (as read-only consumer)"
        ],
        "outputs": [
          "Dashboards",
          "Outcome reports"
        ],
        "external_integrations": [
          "BI tool"
        ],
        "risks": [
          "Vanity metrics dominating"
        ],
        "interfaces": [
          "← every context (read-only)"
        ]
      }
    ],
    "context_map": [
      {
        "upstream": "Sales & Intake",
        "downstream": "Service Fulfillment",
        "pattern": "customer-supplier",
        "business_reason": "Fulfillment cannot start without an accepted engagement.",
        "data_exchanged": [
          "Engagement",
          "Scope statement"
        ],
        "events_exchanged": [
          "EngagementAccepted"
        ],
        "contract_type": "Published language (Engagement record)",
        "failure_risks": [
          "Silent scope mismatch"
        ],
        "acl_notes": "Fulfillment consumes only fields it needs; no direct DB coupling.",
        "ownership_boundary": "Sales owns engagement lifecycle."
      },
      {
        "upstream": "Service Fulfillment",
        "downstream": "Quality Assurance",
        "pattern": "customer-supplier",
        "business_reason": "Signoff is a hard gate on delivery.",
        "data_exchanged": [
          "Draft",
          "Evidence trail"
        ],
        "events_exchanged": [
          "DraftReady",
          "ArtifactSigned"
        ],
        "contract_type": "Published language",
        "failure_risks": [
          "Reviewer bottleneck"
        ],
        "acl_notes": "QA never mutates draft content; only appends signoff.",
        "ownership_boundary": "QA owns signature log."
      },
      {
        "upstream": "AI Orchestration",
        "downstream": "Service Fulfillment",
        "pattern": "customer-supplier",
        "business_reason": "Draft is produced by AI; Fulfillment consumes it.",
        "data_exchanged": [
          "Draft payload",
          "Confidence score"
        ],
        "events_exchanged": [
          "DraftProduced",
          "EscalationRaised"
        ],
        "contract_type": "Published language (validated schema)",
        "failure_risks": [
          "Draft failing OutputValidator reaches Fulfillment"
        ],
        "acl_notes": "OutputValidator sits inside AI Orchestration.",
        "ownership_boundary": "AI owns run log; Fulfillment owns draft state."
      },
      {
        "upstream": "Knowledge Base & Retrieval",
        "downstream": "AI Orchestration",
        "pattern": "open-host-service",
        "business_reason": "Retrieval is a stable interface used by all agents.",
        "data_exchanged": [
          "Retrieval hits",
          "Source citations"
        ],
        "events_exchanged": [
          "DocIngested",
          "IndexRebuilt"
        ],
        "contract_type": "Open-host published API",
        "failure_risks": [
          "Cross-patient leak"
        ],
        "acl_notes": "Every call carries patient + partition claim.",
        "ownership_boundary": "Knowledge owns indices."
      },
      {
        "upstream": "Client Onboarding & Profile",
        "downstream": "Service Fulfillment",
        "pattern": "customer-supplier",
        "business_reason": "No intake without a provisioned patient + reviewer.",
        "data_exchanged": [
          "Patient profile",
          "Reviewer identity"
        ],
        "events_exchanged": [
          "PatientProvisioned",
          "ReviewerRegistered"
        ],
        "contract_type": "Published language",
        "failure_risks": [
          "Expired reviewer credential"
        ],
        "acl_notes": "Fulfillment reads a projection; does not query Onboarding tables.",
        "ownership_boundary": "Onboarding owns patient + reviewer records."
      },
      {
        "upstream": "Service Fulfillment",
        "downstream": "Client Delivery & Success",
        "pattern": "customer-supplier",
        "business_reason": "Delivery is downstream of signoff.",
        "data_exchanged": [
          "Signed artifact"
        ],
        "events_exchanged": [
          "ArtifactDelivered",
          "DeliveryConfirmed"
        ],
        "contract_type": "Published language",
        "failure_risks": [
          "Silent delivery failure"
        ],
        "acl_notes": "Delivery adapter is inside Fulfillment; Delivery context tracks the receipt.",
        "ownership_boundary": "Delivery context owns receipts."
      },
      {
        "upstream": "Quality Assurance",
        "downstream": "Compliance & Governance",
        "pattern": "customer-supplier",
        "business_reason": "Retractions feed compliance workflows.",
        "data_exchanged": [
          "Retraction record"
        ],
        "events_exchanged": [
          "RetractionFiled"
        ],
        "contract_type": "Published language",
        "failure_risks": [
          "Retraction not surfaced"
        ],
        "acl_notes": "Compliance subscribes to the event stream.",
        "ownership_boundary": "QA owns retraction record; Compliance owns downstream runbook."
      },
      {
        "upstream": "Compliance & Governance",
        "downstream": "Service Fulfillment",
        "pattern": "conformist",
        "business_reason": "Fulfillment must respect release decisions.",
        "data_exchanged": [
          "Release decision"
        ],
        "events_exchanged": [
          "ReleaseDecisionChanged"
        ],
        "contract_type": "Read-only projection consumed by Fulfillment",
        "failure_risks": [
          "Fulfillment ignoring a blocked release"
        ],
        "acl_notes": "Fulfillment conforms to Compliance's release model.",
        "ownership_boundary": "Compliance owns release model."
      },
      {
        "upstream": "Client Delivery & Success",
        "downstream": "Billing & Revenue",
        "pattern": "customer-supplier",
        "business_reason": "Delivery is the meter for per-artifact pricing.",
        "data_exchanged": [
          "Delivery receipt"
        ],
        "events_exchanged": [
          "DeliveryConfirmed"
        ],
        "contract_type": "Published language",
        "failure_risks": [
          "Missed usage record"
        ],
        "acl_notes": "Billing subscribes to delivery events.",
        "ownership_boundary": "Billing owns invoicing."
      },
      {
        "upstream": "Identity & Access",
        "downstream": "every other context",
        "pattern": "shared-kernel",
        "business_reason": "Auth primitives are shared.",
        "data_exchanged": [
          "Session claim",
          "Role"
        ],
        "events_exchanged": [],
        "contract_type": "Shared kernel (tiny, versioned)",
        "failure_risks": [
          "Kernel bloat"
        ],
        "acl_notes": "Kernel kept intentionally small.",
        "ownership_boundary": "Identity owns the primitives."
      },
      {
        "upstream": "every context",
        "downstream": "Analytics & Reporting",
        "pattern": "conformist",
        "business_reason": "Analytics conforms to whatever events contexts publish.",
        "data_exchanged": [
          "Domain events (read-only)"
        ],
        "events_exchanged": [
          "all"
        ],
        "contract_type": "Read-only event subscription",
        "failure_risks": [
          "Event schema drift"
        ],
        "acl_notes": "Analytics stores its own read model.",
        "ownership_boundary": "Analytics owns rollups."
      }
    ],
    "external_integrations": [
      {
        "system": "PM management software (Vantaca / CINC / AppFolio / TOPS)",
        "risk": "Export-format drift; unparseable PDF tables; per-vendor quirks",
        "internal_model": "source document record",
        "acl_strategy": "Adapter in External Integrations context translates external schema → internal domain term; upstream schema never leaks past the adapter.",
        "owner_context": "External Integrations",
        "data_in": [
          "External record"
        ],
        "data_out": [
          "Ack or receipt"
        ],
        "trigger": "api",
        "failure_strategy": "Exponential backoff with jitter; circuit breaker on repeated failure; dead-letter with owner-visible alert.",
        "audit_need": "Every call logged with patient, request id, cost, and payload hash (no PII in logs)."
      },
      {
        "system": "occupancy-software vendor formats (major + regional preparers)",
        "risk": "Layout drift between study vintages; scanned-only PDFs",
        "internal_model": "extracted study fields with page provenance",
        "acl_strategy": "Adapter in External Integrations context translates external schema → internal domain term; upstream schema never leaks past the adapter.",
        "owner_context": "External Integrations",
        "data_in": [
          "External record"
        ],
        "data_out": [
          "Ack or receipt"
        ],
        "trigger": "api",
        "failure_strategy": "Exponential backoff with jitter; circuit breaker on repeated failure; dead-letter with owner-visible alert.",
        "audit_need": "Every call logged with patient, request id, cost, and payload hash (no PII in logs)."
      },
      {
        "system": "Airtable intake tracker + Drive folder tree",
        "risk": "Manual mis-filing; permission sprawl across per-PM/per-engagement folders",
        "internal_model": "certification case status record",
        "acl_strategy": "Adapter in External Integrations context translates external schema → internal domain term; upstream schema never leaks past the adapter.",
        "owner_context": "External Integrations",
        "data_in": [
          "External record"
        ],
        "data_out": [
          "Ack or receipt"
        ],
        "trigger": "api",
        "failure_strategy": "Exponential backoff with jitter; circuit breaker on repeated failure; dead-letter with owner-visible alert.",
        "audit_need": "Every call logged with patient, request id, cost, and payload hash (no PII in logs)."
      },
      {
        "system": "Frontier LLM APIs (provider-portable)",
        "risk": "Model drift; rate limits; silent quality regression",
        "internal_model": "extraction run with confidence scores",
        "acl_strategy": "OutputValidator + prompt-injection scrubber + per-patient retrieval scope inside AI Orchestration.",
        "owner_context": "AI Orchestration",
        "data_in": [
          "Prompt + retrieval context"
        ],
        "data_out": [
          "Draft + confidence"
        ],
        "trigger": "api",
        "failure_strategy": "Exponential backoff with jitter; circuit breaker on repeated failure; dead-letter with owner-visible alert.",
        "audit_need": "Every call logged with patient, request id, cost, and payload hash (no PII in logs)."
      }
    ],
    "event_storm": [
      {
        "seq": 1,
        "command": "QualifyAgent",
        "event": "AgentQualified",
        "actor": "Sales / Qualifier",
        "context": "Sales & Intake",
        "aggregate": "EngagementAggregate",
        "policy": "Reject out-of-ICP engagements",
        "downstream": "Readiness Scan offer",
        "risk": "Out-of-scope acceptance"
      },
      {
        "seq": 2,
        "command": "OpenClaimCase",
        "event": "ClaimCaseOpened",
        "actor": "Occupancy operator",
        "context": "Intake",
        "aggregate": "CertificationCaseAggregate",
        "policy": "Require signed data agreement + Medicaid Exclusion File authorization",
        "downstream": "Document classification",
        "risk": "Missing authorization"
      },
      {
        "seq": 3,
        "command": "ExtractIncomeAssets",
        "event": "FieldsExtracted",
        "actor": "Extraction engine",
        "context": "Certification",
        "aggregate": "IncomeAssetDeterminationAggregate",
        "policy": "Low-confidence field forces review",
        "downstream": "340B computation",
        "risk": "Extraction error on messy docs"
      },
      {
        "seq": 4,
        "command": "Compute340B",
        "event": "WorksheetDrafted",
        "actor": "340B rules engine",
        "context": "Certification",
        "aggregate": "IncomeAssetDeterminationAggregate",
        "policy": "Dual-calculation must reconcile",
        "downstream": "Compliance Lint",
        "risk": "Miscalculated income/assets"
      },
      {
        "seq": 5,
        "command": "RunHRSAPreValidation",
        "event": "HRSAPreValidationRun",
        "actor": "Edit simulator",
        "context": "Certification",
        "aggregate": "CertificationAggregate",
        "policy": "Fatal edit blocks transmit",
        "downstream": "certified review queue",
        "risk": "Fatal edit escapes to HRSA"
      },
      {
        "seq": 6,
        "command": "StartAgentRun",
        "event": "DraftProduced",
        "actor": "AI Orchestrator",
        "context": "AI Orchestration",
        "aggregate": "AgentRunAggregate",
        "policy": "Confidence threshold",
        "downstream": "Reviewer queue OR escalation",
        "risk": "Prompt injection"
      },
      {
        "seq": 7,
        "command": "SubmitForSignoff",
        "event": "DraftReady",
        "actor": "Service Fulfillment",
        "context": "Service Fulfillment",
        "aggregate": "CertificationPacketAggregate",
        "policy": "Coverage complete",
        "downstream": "Reviewer notified",
        "risk": "Reviewer overload"
      },
      {
        "seq": 8,
        "command": "ApproveArtifact",
        "event": "ArtifactSigned",
        "actor": "Apexus-certified 340B expert",
        "context": "Quality Assurance",
        "aggregate": "SignoffAggregate",
        "policy": "Reviewer authority spec",
        "downstream": "Delivery authorized",
        "risk": "Signature spoof"
      },
      {
        "seq": 9,
        "command": "DeliverCertificationPacket",
        "event": "ArtifactDelivered",
        "actor": "Delivery adapter",
        "context": "Service Fulfillment",
        "aggregate": "CertificationPacketAggregate",
        "policy": "Deliverability spec",
        "downstream": "Billing meter, customer notified",
        "risk": "Silent delivery failure"
      },
      {
        "seq": 10,
        "command": "ConfirmDelivery",
        "event": "DeliveryConfirmed",
        "actor": "Client Delivery",
        "context": "Client Delivery & Success",
        "aggregate": "DeliveryAggregate",
        "policy": "Ack within SLA",
        "downstream": "Success cadence",
        "risk": "Missed ack"
      },
      {
        "seq": 11,
        "command": "RecordUsage",
        "event": "InvoicePaid",
        "actor": "Billing",
        "context": "Billing & Revenue",
        "aggregate": "SubscriptionAggregate",
        "policy": "Chargeability spec",
        "downstream": "Revenue rollup",
        "risk": "Tax misapplication"
      },
      {
        "seq": 12,
        "command": "ResolveOwnerAction",
        "event": "OwnerActionResolved",
        "actor": "Business owner",
        "context": "Compliance & Governance",
        "aggregate": "OwnerActionLedgerAggregate",
        "policy": "Release readiness spec",
        "downstream": "Release-decision recompute",
        "risk": "Public claim while blocker open"
      },
      {
        "seq": 13,
        "command": "FileRetraction",
        "event": "RetractionFiled",
        "actor": "Legal + Apexus-certified 340B expert",
        "context": "Quality Assurance",
        "aggregate": "RetractionAggregate",
        "policy": "Retraction preconditions",
        "downstream": "Customer notification, audit log",
        "risk": "Delayed retraction"
      }
    ],
    "critical_path": [
      "CertificationCaseAccepted → EvidenceCollected → DraftReady → ArtifactSigned → ArtifactDelivered → DeliveryConfirmed"
    ],
    "exception_flows": [
      "DraftProduced with low confidence → EscalationRaised → reviewer manual draft → ArtifactSigned",
      "DeliverArtifact blocked by open owner action → DeliveryBlocked → owner resolves → retry",
      "DeliveryFailed at adapter → customer alert within 1h → Success ticket → retry with backoff"
    ],
    "escalation_flows": [
      "AI Orchestration escalates to Reviewer",
      "Reviewer escalates ambiguous artifact to Legal",
      "Success lead escalates silent delivery failure to Owner",
      "Owner escalates the owner's counsel inquiry to external counsel"
    ],
    "retry_flows": [
      "External API failure → exponential backoff with jitter, then dead-letter with owner-visible alert",
      "Model timeout → retry once, then EscalationRaised",
      "Delivery adapter failure → retry with backoff, then customer alert"
    ],
    "manual_override_flows": [
      "Reviewer may override AI classification and re-route",
      "Owner may force-block a delivery via Compliance ledger",
      "Ops may pull a prompt version at any time (feature flag)"
    ],
    "commands": [
      {
        "name": "OpenIntake",
        "issued_by": "Customer operator",
        "preconditions": [
          "Engagement accepted",
          "Patient provisioned"
        ],
        "aggregate": "CertificationCaseAggregate",
        "success_event": "CertificationCaseAccepted",
        "failure_event": "IntakeRejected",
        "authorization": "Patient patient with Operator role",
        "validation": "Scope statement present; no duplicate open intake",
        "audit": "Command + payload hash logged with patient + user"
      },
      {
        "name": "AttachEvidence",
        "issued_by": "Customer operator / Retrieval",
        "preconditions": [
          "Intake open",
          "File type allowed"
        ],
        "aggregate": "CertificationCaseAggregate",
        "success_event": "EvidenceCollected",
        "failure_event": "EvidenceRejected",
        "authorization": "Same patient",
        "validation": "Virus scan clean; PII policy respected",
        "audit": "Every attachment hashed and logged"
      },
      {
        "name": "StartAgentRun",
        "issued_by": "AI Orchestrator",
        "preconditions": [
          "Evidence coverage complete",
          "Prompt version active"
        ],
        "aggregate": "AgentRunAggregate",
        "success_event": "DraftProduced",
        "failure_event": "EscalationRaised",
        "authorization": "Service role",
        "validation": "OutputValidator schema passes",
        "audit": "Prompt version + retrieval hits + cost captured"
      },
      {
        "name": "ApproveArtifact",
        "issued_by": "Apexus-certified 340B expert",
        "preconditions": [
          "Draft ready",
          "Reviewer session live",
          "No unresolved escalation"
        ],
        "aggregate": "SignoffAggregate",
        "success_event": "ArtifactSigned",
        "failure_event": "ArtifactRejected",
        "authorization": "Reviewer role bound to patient",
        "validation": "Every claim cites evidence",
        "audit": "Signature manifest + timestamp"
      },
      {
        "name": "DeliverCertificationPacket",
        "issued_by": "Delivery adapter",
        "preconditions": [
          "Artifact signed",
          "Compliance release allows delivery"
        ],
        "aggregate": "CertificationPacketAggregate",
        "success_event": "ArtifactDelivered",
        "failure_event": "DeliveryFailed",
        "authorization": "Service role",
        "validation": "Delivery method valid; receipt captured",
        "audit": "Delivery receipt archived"
      },
      {
        "name": "ResolveOwnerAction",
        "issued_by": "Business owner",
        "preconditions": [
          "Owner-action open"
        ],
        "aggregate": "OwnerActionLedgerAggregate",
        "success_event": "OwnerActionResolved",
        "failure_event": "OwnerActionRejected",
        "authorization": "Owner role",
        "validation": "Supplied fact matches action schema",
        "audit": "Actor + before/after captured"
      },
      {
        "name": "FileRetraction",
        "issued_by": "Legal + Apexus-certified 340B expert",
        "preconditions": [
          "Artifact previously delivered",
          "Impact statement present"
        ],
        "aggregate": "RetractionAggregate",
        "success_event": "RetractionFiled",
        "failure_event": "RetractionRejected",
        "authorization": "Legal AND Reviewer co-sign",
        "validation": "Retraction preconditions spec",
        "audit": "Full retraction packet archived"
      }
    ],
    "policies": [
      {
        "name": "Auto-request signoff on coverage complete",
        "trigger": "EvidenceCollected",
        "condition": "Evidence coverage spec passes",
        "action": "Enqueue SubmitForSignoff",
        "context": "Service Fulfillment",
        "ai_involvement": "none",
        "human_approval": false
      },
      {
        "name": "Escalate on low confidence",
        "trigger": "DraftProduced",
        "condition": "Confidence < threshold OR OutputValidator warning",
        "action": "Emit EscalationRaised, route to reviewer queue",
        "context": "AI Orchestration",
        "ai_involvement": "author",
        "human_approval": false
      },
      {
        "name": "Block delivery on open compliance blocker",
        "trigger": "DeliverArtifact command",
        "condition": "Compliance release decision != 'ready-with-owner-actions' or 'ready'",
        "action": "Reject delivery, emit DeliveryBlocked",
        "context": "Service Fulfillment ↔ Compliance",
        "ai_involvement": "none",
        "human_approval": true
      },
      {
        "name": "Retract on material finding",
        "trigger": "MaterialFindingReported",
        "condition": "Signed claim materially wrong",
        "action": "Open Retraction workflow with legal co-sign",
        "context": "Quality Assurance",
        "ai_involvement": "assist",
        "human_approval": true
      },
      {
        "name": "Alert on delivery failure",
        "trigger": "DeliveryFailed",
        "condition": "Any",
        "action": "Notify customer within 1h + open Success ticket",
        "context": "Client Delivery & Success",
        "ai_involvement": "none",
        "human_approval": false
      }
    ],
    "aggregates": [
      {
        "name": "CertificationCaseAggregate",
        "root": "ClaimCase",
        "context": "Certification",
        "purpose": "Guard the intake → extract → compute → validate → review → certify → transmit lifecycle for one claim certification event.",
        "entities": [
          "CertificationCase",
          "EvidenceLink",
          "Draft"
        ],
        "value_objects": [
          "ConfidenceScore",
          "EvidenceCitation"
        ],
        "invariants": [
          "Every computed field cites a source document and a HRSA 340B guidance rule",
          "No transmission without a passing Compliance Lint and an Signed Independent Opinion record"
        ],
        "commands": [
          "OpenIntake",
          "AttachEvidence",
          "RequestDraft",
          "SubmitForSignoff"
        ],
        "events": [
          "CertificationCaseAccepted",
          "EvidenceCollected",
          "DraftReady"
        ],
        "repository": "CertificationCaseRepository",
        "transaction_boundary": "One certification case per transaction"
      },
      {
        "name": "CertificationPacketAggregate",
        "root": "Audit Package",
        "context": "Service Fulfillment",
        "purpose": "Own the Audit Package lifecycle from signed to delivered.",
        "entities": [
          "Audit Package",
          "Delivery"
        ],
        "value_objects": [
          "DeliveryAddress"
        ],
        "invariants": [
          "A Audit Package cannot be delivered without a valid Signoff"
        ],
        "commands": [
          "DeliverCertificationPacket"
        ],
        "events": [
          "ArtifactDelivered"
        ],
        "repository": "Audit PackageRepository",
        "transaction_boundary": "One Audit Package per transaction"
      },
      {
        "name": "SignoffAggregate",
        "root": "Signoff",
        "context": "Quality Assurance",
        "purpose": "Bind reviewer identity + timestamp + artifact hash immutably.",
        "entities": [
          "Signoff"
        ],
        "value_objects": [
          "SignatureManifest"
        ],
        "invariants": [
          "Signature bound to a live authenticated session, not a form field",
          "Signed artifacts are immutable"
        ],
        "commands": [
          "ApproveArtifact"
        ],
        "events": [
          "ArtifactSigned"
        ],
        "repository": "SignoffRepository",
        "transaction_boundary": "One signoff per transaction"
      },
      {
        "name": "RetractionAggregate",
        "root": "Retraction",
        "context": "Quality Assurance",
        "purpose": "Handle formal correction/withdrawal of a signed artifact.",
        "entities": [
          "Retraction"
        ],
        "value_objects": [
          "RetractionReason",
          "ImpactStatement"
        ],
        "invariants": [
          "A retraction requires Legal + Reviewer co-signature"
        ],
        "commands": [
          "FileRetraction"
        ],
        "events": [
          "RetractionFiled"
        ],
        "repository": "RetractionRepository",
        "transaction_boundary": "One retraction per transaction"
      },
      {
        "name": "AgentRunAggregate",
        "root": "AgentRun",
        "context": "AI Orchestration",
        "purpose": "Track a single bounded AI run with prompt version, cost, and output validation.",
        "entities": [
          "AgentRun",
          "RetrievalHit"
        ],
        "value_objects": [
          "ConfidenceScore",
          "TokenBudget",
          "ModelCost"
        ],
        "invariants": [
          "No output emitted without OutputValidator pass",
          "Retrieval scoped to a single patient partition"
        ],
        "commands": [
          "StartAgentRun"
        ],
        "events": [
          "DraftProduced",
          "EscalationRaised"
        ],
        "repository": "AgentRunRepository",
        "transaction_boundary": "One run per transaction"
      },
      {
        "name": "OwnerActionLedgerAggregate",
        "root": "OwnerActionLedger",
        "context": "Compliance & Governance",
        "purpose": "Own the set of owner-supplied facts blocking public claims.",
        "entities": [
          "OwnerAction"
        ],
        "value_objects": [
          "BlockerReason",
          "Engagement"
        ],
        "invariants": [
          "Release cannot flip to 'ready' with open blocking owner actions"
        ],
        "commands": [
          "RaiseOwnerAction",
          "ResolveOwnerAction"
        ],
        "events": [
          "OwnerActionResolved",
          "ReleaseDecisionChanged"
        ],
        "repository": "OwnerActionRepository",
        "transaction_boundary": "One ledger per patient"
      },
      {
        "name": "PatientAggregate",
        "root": "Patient",
        "context": "Client Onboarding & Profile",
        "purpose": "Own patient provisioning + reviewer registration.",
        "entities": [
          "Patient",
          "ReviewerIdentity"
        ],
        "value_objects": [
          "ContactMatrix",
          "EngagementSet"
        ],
        "invariants": [
          "Every patient has at least one named reviewer with valid credential"
        ],
        "commands": [
          "ProvisionPatient",
          "RegisterReviewer"
        ],
        "events": [
          "PatientProvisioned",
          "ReviewerRegistered"
        ],
        "repository": "PatientRepository",
        "transaction_boundary": "One patient per transaction"
      },
      {
        "name": "DeliveryAggregate",
        "root": "Delivery",
        "context": "Client Delivery & Success",
        "purpose": "Own delivery receipts and revision requests.",
        "entities": [
          "Delivery",
          "RevisionRequest"
        ],
        "value_objects": [
          "DeliveryMethod"
        ],
        "invariants": [
          "Every DeliveryConfirmed has a linked Signoff"
        ],
        "commands": [
          "ConfirmDelivery",
          "RecordRevisionRequest"
        ],
        "events": [
          "DeliveryConfirmed",
          "RevisionRequested"
        ],
        "repository": "DeliveryRepository",
        "transaction_boundary": "One delivery per transaction"
      }
    ],
    "invariants": [
      {
        "invariant": "A Audit Package cannot be delivered without a valid Reviewer signoff.",
        "context": "Service Fulfillment ↔ Quality Assurance",
        "aggregate": "CertificationPacketAggregate",
        "why": "Legal defensibility; brand-risk",
        "enforcement": "Aggregate command handler rejects delivery without a signoff reference"
      },
      {
        "invariant": "Every claim in a delivered artifact cites at least one evidence item.",
        "context": "Service Fulfillment",
        "aggregate": "CertificationCaseAggregate",
        "why": "Audit reconstructability",
        "enforcement": "EvidenceCoverageSpec on submit-for-signoff"
      },
      {
        "invariant": "A signature is bound to a live authenticated session, not a form field.",
        "context": "Quality Assurance",
        "aggregate": "SignoffAggregate",
        "why": "Anti-spoofing, anti-repudiation",
        "enforcement": "Signature service validates session claim server-side"
      },
      {
        "invariant": "Signed artifacts are immutable; corrections go through Retraction.",
        "context": "Quality Assurance",
        "aggregate": "SignoffAggregate + RetractionAggregate",
        "why": "Preserves audit chain",
        "enforcement": "Repository denies mutation after signoff"
      },
      {
        "invariant": "No AI output leaves AI Orchestration without OutputValidator pass.",
        "context": "AI Orchestration",
        "aggregate": "AgentRunAggregate",
        "why": "Grounding + hallucination control",
        "enforcement": "AgentRun terminates as EscalationRaised on validator failure"
      },
      {
        "invariant": "Retrieval is scoped to a single patient partition per call.",
        "context": "Knowledge Base ↔ AI Orchestration",
        "aggregate": "IndexShardAggregate",
        "why": "Prevent cross-patient leak",
        "enforcement": "PatientIsolationSpec at retrieval router"
      },
      {
        "invariant": "Release cannot flip to 'ready' with open blocking owner actions.",
        "context": "Compliance & Governance",
        "aggregate": "OwnerActionLedgerAggregate",
        "why": "Prevent premature public claim",
        "enforcement": "ReleaseReadinessSpec on ResolveOwnerAction"
      },
      {
        "invariant": "Every patient has at least one named reviewer with valid credential.",
        "context": "Client Onboarding & Profile",
        "aggregate": "PatientAggregate",
        "why": "No unattributed signoffs",
        "enforcement": "ReviewerCredentialSpec on patient provisioning"
      },
      {
        "invariant": "Roles are stored in a dedicated table and checked server-side.",
        "context": "Identity & Access",
        "aggregate": "UserAggregate",
        "why": "Prevent privilege escalation",
        "enforcement": "RoleAuthoritySpec + RLS on protected tables"
      }
    ],
    "ai_agents": [
      {
        "name": "Drafter Agent",
        "context": "AI Orchestration",
        "responsibility": "Produce a cited draft of a Audit Package section from validated retrieval context.",
        "inputs": [
          "Intake summary",
          "Retrieval hits (patient-scoped)",
          "Prompt version"
        ],
        "outputs": [
          "Structured draft payload",
          "Confidence score",
          "Citations"
        ],
        "tools": [
          "Retrieval API",
          "Structured-output validator",
          "Cost meter"
        ],
        "forbidden_actions": [
          "Call external tools not in its allowlist",
          "Access another patient's retrieval index",
          "Emit output that skips the OutputValidator",
          "Author final legal / clinical / financial decisions"
        ],
        "memory_scope": "Per-run only; no cross-run memory; prompt-injection scrubber on all customer inputs.",
        "retrieval_sources": [
          "Patient-scoped knowledge base",
          "Public the owner's counsel sources (read-only cache)"
        ],
        "validations": [
          "Structured-output schema",
          "Citation-coverage rule",
          "PII-scrub rule on prompt inputs"
        ],
        "confidence_scoring": "Model-reported logprobs + citation-coverage combined into a bounded [0..1] score.",
        "escalation_triggers": [
          "Score < threshold",
          "Ambiguous engagement",
          "Missing citation on any claim"
        ],
        "human_approval": true,
        "failure_modes": [
          "Prompt injection",
          "Hallucinated citation",
          "Retrieval-patient leak"
        ],
        "audit_logs": [
          "Prompt version",
          "Retrieval hits (ids only)",
          "Cost + latency",
          "Validator verdict"
        ],
        "metrics": [
          "Draft acceptance rate",
          "Escalation rate",
          "Cost per artifact",
          "p95 latency"
        ],
        "versioning": "Prompt versions immutable; published via PromptRegistryAggregate; rollout via feature flag."
      },
      {
        "name": "Classifier Agent",
        "context": "AI Orchestration",
        "responsibility": "Route an certification case to the right template, engagement, and reviewer queue.",
        "inputs": [
          "Intake payload"
        ],
        "outputs": [
          "Route decision + confidence"
        ],
        "tools": [
          "Prompt registry"
        ],
        "forbidden_actions": [
          "Make final legal / clinical / financial decisions",
          "Bypass Reviewer queue routing"
        ],
        "memory_scope": "Per-run only",
        "retrieval_sources": [
          "Templates + engagement reference"
        ],
        "validations": [
          "Structured-output schema",
          "Known-route allowlist"
        ],
        "confidence_scoring": "Model logprobs.",
        "escalation_triggers": [
          "Score < threshold",
          "Unknown engagement"
        ],
        "human_approval": false,
        "failure_modes": [
          "Wrong route → wrong reviewer"
        ],
        "audit_logs": [
          "Route decision + rationale"
        ],
        "metrics": [
          "Routing accuracy vs reviewer corrections"
        ],
        "versioning": "Same as Drafter"
      },
      {
        "name": "Evaluator Agent",
        "context": "AI Orchestration",
        "responsibility": "Run offline evals on prompt versions before rollout.",
        "inputs": [
          "Golden dataset",
          "Prompt candidate"
        ],
        "outputs": [
          "Pass/fail per case + drift report"
        ],
        "tools": [
          "Golden dataset"
        ],
        "forbidden_actions": [
          "Touch production patient data"
        ],
        "memory_scope": "Per-eval only",
        "retrieval_sources": [
          "Golden dataset only"
        ],
        "validations": [
          "Regression thresholds"
        ],
        "confidence_scoring": "Aggregate over dataset",
        "escalation_triggers": [
          "Regression > threshold"
        ],
        "human_approval": true,
        "failure_modes": [
          "Overfit to golden dataset"
        ],
        "audit_logs": [
          "Full eval report archived"
        ],
        "metrics": [
          "Pass rate",
          "Regression rate"
        ],
        "versioning": "Every prompt release requires a passing eval"
      }
    ],
    "prompt_chain_map": [
      "Intake → Classifier (route + engagement) → Drafter (cite + draft) → OutputValidator → Reviewer (approve or escalate)",
      "Retraction analysis → Evaluator (assist only) → Legal + Reviewer co-sign"
    ],
    "rag_map": [
      "Per-patient knowledge base partition → retrieval router → patient-scoped hits → Drafter",
      "Public the owner's counsel sources (read-only cache) → shared retrieval → Drafter (cited)"
    ],
    "ai_evaluation": [
      "Golden dataset of past reviewer-accepted artifacts per vertical",
      "Regression thresholds on acceptance rate + citation coverage",
      "Every prompt release requires a passing Evaluator run"
    ],
    "hallucination_controls": [
      "Retrieval-first (no free-form generation without citation)",
      "Structured-output validator enforces citation-per-claim",
      "Confidence-scored escalation",
      "Reviewer gate on all outbound artifacts"
    ],
    "human_in_the_loop_plan": [
      "Reviewer signoff on every outbound artifact",
      "Legal co-sign on retractions",
      "Owner approval on public-release readiness",
      "Ops sign-off on prompt-version rollout"
    ],
    "ai_audit_plan": [
      "Every AgentRun logged with prompt version, retrieval hit ids, cost, latency, validator verdict",
      "13-month rolling retention on run logs",
      "PII scrubbed from log payloads"
    ],
    "prompt_versioning": "Prompt versions immutable once published; rolled out via feature flag; every rollout paired with an Evaluator run.",
    "human_roles": [
      {
        "role": "Apexus-certified 340B expert",
        "responsibilities": [
          "Approve / reject / request revisions on drafts",
          "Co-sign retractions"
        ],
        "contexts": [
          "Quality Assurance",
          "Service Fulfillment"
        ],
        "decisions_owned": [
          "Signoff",
          "Rejection",
          "Escalation acceptance"
        ],
        "ai_support": [
          "Cited drafts",
          "Confidence-ranked findings"
        ],
        "approval_authority": "Full artifact signoff",
        "escalation_authority": "Escalate to Legal",
        "quality_metrics": [
          "Cycle time to signoff",
          "Signoff-to-retraction ratio"
        ],
        "workload_risks": [
          "Single-reviewer bottleneck"
        ]
      },
      {
        "role": "Business owner",
        "responsibilities": [
          "Resolve owner actions",
          "Decide public-release readiness",
          "Own commercial claims"
        ],
        "contexts": [
          "Compliance & Governance",
          "Sales & Intake"
        ],
        "decisions_owned": [
          "Release decision",
          "Owner-action ledger"
        ],
        "ai_support": [
          "Blocker summary"
        ],
        "approval_authority": "Release readiness",
        "escalation_authority": "Escalate to Legal",
        "quality_metrics": [
          "Blocker close time"
        ],
        "workload_risks": [
          "Single-owner queue"
        ]
      },
      {
        "role": "Legal reviewer",
        "responsibilities": [
          "Retraction co-sign",
          "DSAR + the owner's counsel response"
        ],
        "contexts": [
          "Quality Assurance",
          "Compliance & Governance"
        ],
        "decisions_owned": [
          "Retraction approval",
          "Covered entity counsel response"
        ],
        "ai_support": [
          "Precedent surfacing (assist only)"
        ],
        "approval_authority": "Retraction, the owner's counsel response",
        "escalation_authority": "External counsel",
        "quality_metrics": [
          "Retraction latency"
        ],
        "workload_risks": [
          "Retainer capacity"
        ]
      },
      {
        "role": "Success lead",
        "responsibilities": [
          "Delivery health, revision loop, renewal signal"
        ],
        "contexts": [
          "Client Delivery & Success"
        ],
        "decisions_owned": [
          "Escalate silent failures"
        ],
        "ai_support": [
          "Delivery health digest"
        ],
        "approval_authority": "Customer-visible remediation",
        "escalation_authority": "Owner",
        "quality_metrics": [
          "Time-to-alert on delivery failure"
        ],
        "workload_risks": [
          "Alert fatigue"
        ]
      },
      {
        "role": "Onboarding lead",
        "responsibilities": [
          "Provision patients, register reviewers, import evidence certification"
        ],
        "contexts": [
          "Client Onboarding & Profile"
        ],
        "decisions_owned": [
          "Patient readiness"
        ],
        "ai_support": [
          "Checklist coverage"
        ],
        "approval_authority": "Go-live per patient",
        "escalation_authority": "Owner",
        "quality_metrics": [
          "Time-to-first-artifact"
        ],
        "workload_risks": [
          "Sequential onboarding queue"
        ]
      },
      {
        "role": "Ops (prompt owner)",
        "responsibilities": [
          "Prompt version registry + eval sign-off"
        ],
        "contexts": [
          "AI Orchestration"
        ],
        "decisions_owned": [
          "Prompt rollout"
        ],
        "ai_support": [
          "Evaluator Agent"
        ],
        "approval_authority": "Prompt rollout",
        "escalation_authority": "Engineering",
        "quality_metrics": [
          "Regression rate at rollout"
        ],
        "workload_risks": [
          "Version drift"
        ]
      }
    ],
    "human_review_checkpoints": [
      "AI draft → reviewer approval",
      "Public release → owner acceptance",
      "Retraction → legal + reviewer co-sign",
      "Prompt rollout → ops + evaluator"
    ],
    "escalation_matrix": [
      "AI → Reviewer → Legal → Owner → External counsel",
      "Success → Owner → External counsel (the owner's counsel inquiries)"
    ],
    "manual_override_rules": [
      "Any manual override captured as an explicit override event with actor + reason",
      "No override may bypass a reviewer signoff invariant"
    ],
    "separation_of_duties": [
      "Drafter Agent cannot sign; Reviewer cannot draft on behalf of AI without an override event; Legal cannot silently retract"
    ],
    "quality_control_workflow": [
      "Weekly reviewer calibration meeting",
      "Monthly evaluator regression report",
      "Quarterly retraction-rate review with owner + legal"
    ],
    "data_objects": [
      {
        "name": "certification case",
        "meaning": "Unit of work brought in by customer",
        "owner_context": "Service Fulfillment",
        "writers": [
          "Service Fulfillment"
        ],
        "readers": [
          "QA",
          "Analytics"
        ],
        "source_of_truth": "Service Fulfillment DB",
        "retention": "the record-retention period (audit)",
        "privacy": "confidential",
        "audit": true
      },
      {
        "name": "control evidence",
        "meaning": "Cited fact backing a claim",
        "owner_context": "Service Fulfillment",
        "writers": [
          "Service Fulfillment"
        ],
        "readers": [
          "QA",
          "Analytics"
        ],
        "source_of_truth": "Service Fulfillment DB + Knowledge Base pointers",
        "retention": "the record-retention period",
        "privacy": "confidential",
        "audit": true
      },
      {
        "name": "Audit Package",
        "meaning": "Reviewer-signed deliverable",
        "owner_context": "Service Fulfillment",
        "writers": [
          "Service Fulfillment"
        ],
        "readers": [
          "QA",
          "Client Delivery",
          "Analytics"
        ],
        "source_of_truth": "Service Fulfillment DB (immutable after signoff)",
        "retention": "7-10 years (vertical-specific)",
        "privacy": "regulated",
        "audit": true
      },
      {
        "name": "Signoff",
        "meaning": "Reviewer signature manifest",
        "owner_context": "Quality Assurance",
        "writers": [
          "Quality Assurance"
        ],
        "readers": [
          "Service Fulfillment",
          "Analytics"
        ],
        "source_of_truth": "QA DB (append-only)",
        "retention": "10 years",
        "privacy": "confidential",
        "audit": true
      },
      {
        "name": "OwnerActionLedger",
        "meaning": "Blocker facts per patient",
        "owner_context": "Compliance & Governance",
        "writers": [
          "Compliance & Governance"
        ],
        "readers": [
          "Service Fulfillment (release decision)",
          "Analytics"
        ],
        "source_of_truth": "Compliance DB",
        "retention": "the record-retention period",
        "privacy": "internal",
        "audit": true
      },
      {
        "name": "AgentRun",
        "meaning": "Trace of one AI orchestrator run",
        "owner_context": "AI Orchestration",
        "writers": [
          "AI Orchestration"
        ],
        "readers": [
          "Analytics",
          "QA (on escalation)"
        ],
        "source_of_truth": "AI Orchestration DB",
        "retention": "13 months (rolling)",
        "privacy": "internal",
        "audit": true
      },
      {
        "name": "Patient",
        "meaning": "Customer organization + reviewers",
        "owner_context": "Client Onboarding & Profile",
        "writers": [
          "Client Onboarding & Profile"
        ],
        "readers": [
          "all contexts"
        ],
        "source_of_truth": "Onboarding DB",
        "retention": "Life of contract + the record-retention period",
        "privacy": "confidential",
        "audit": true
      },
      {
        "name": "Subscription + Invoice",
        "meaning": "Commercial relationship + charges",
        "owner_context": "Billing & Revenue",
        "writers": [
          "Billing"
        ],
        "readers": [
          "Analytics"
        ],
        "source_of_truth": "Billing provider (Stripe)",
        "retention": "As required by tax law",
        "privacy": "confidential",
        "audit": true
      },
      {
        "name": "User + Role",
        "meaning": "Identity + authorization",
        "owner_context": "Identity & Access",
        "writers": [
          "Identity & Access"
        ],
        "readers": [
          "all contexts"
        ],
        "source_of_truth": "Identity DB",
        "retention": "Life of account + 2 years",
        "privacy": "confidential",
        "audit": true
      }
    ],
    "read_models": [
      "OperatorDashboard read model (per patient): open intakes, in-review, delivered this week",
      "ReviewerQueue read model: cases awaiting reviewer with confidence + escalation reason",
      "ComplianceLedger read model: open owner actions + release-decision",
      "AnalyticsRollup read model: metric definitions rolled up daily"
    ],
    "reporting_models": [
      "Outcome report per customer: artifacts delivered, cycle time, acceptance rate, retractions",
      "Ops report: AI cost per artifact, escalation rate, reviewer load"
    ],
    "data_duplication_notes": [
      "Reviewer identity is stored in Onboarding, referenced by QA — QA does not own it",
      "OwnerActionLedger duplicates minimal facts into read models for Fulfillment consumption"
    ],
    "data_retention": [
      "Artifacts + evidence + signoffs: 7-10 years (vertical-specific)",
      "AgentRun logs: 13 months rolling",
      "Users + sessions: life of account + 2 years"
    ],
    "data_quality_risks": [
      "Silent schema drift from external systems",
      "Stale retrieval indices after source-doc updates",
      "Missing retraction cross-links after legacy import"
    ],
    "use_cases": [
      {
        "name": "Deliver a reviewer-signed Audit Package",
        "actor": "Customer operator + Reviewer",
        "context": "Service Fulfillment + Quality Assurance + AI Orchestration",
        "goal": "Produce and deliver a reviewer-signed Audit Package",
        "preconditions": [
          "Patient provisioned",
          "Reviewer registered",
          "Engagement accepted"
        ],
        "main_flow": [
          "Operator opens certification case",
          "Evidence attached / retrieved",
          "AI Orchestrator drafts with citations",
          "Reviewer approves",
          "Delivery adapter delivers",
          "Success lead confirms delivery"
        ],
        "alternative_flows": [
          "Confidence below threshold → EscalationRaised → reviewer drafts manually",
          "Blocking owner action open → DeliveryBlocked → surfaced to owner",
          "Delivery failure → alert customer within 1h"
        ],
        "business_rules": [
          "Every claim must cite evidence",
          "Only registered reviewer may sign"
        ],
        "ai_role": "Draft + validate + score confidence",
        "human_role": "Sign; escalate; retract",
        "commands": [
          "OpenIntake",
          "AttachEvidence",
          "StartAgentRun",
          "ApproveArtifact",
          "DeliverCertificationPacket"
        ],
        "events": [
          "CertificationCaseAccepted",
          "EvidenceCollected",
          "DraftProduced",
          "ArtifactSigned",
          "ArtifactDelivered"
        ],
        "aggregates": [
          "CertificationCaseAggregate",
          "AgentRunAggregate",
          "SignoffAggregate",
          "CertificationPacketAggregate"
        ],
        "success": "Audit Package delivered + reviewer signed + audit trail complete",
        "failure_handling": "EscalationRaised → reviewer queue; DeliveryFailed → customer alert + Success ticket",
        "audit": "Full command → event chain with actor + timestamp per step"
      },
      {
        "name": "Retract a delivered artifact",
        "actor": "Legal + Apexus-certified 340B expert",
        "context": "Quality Assurance + Compliance & Governance",
        "goal": "Formally withdraw / correct a delivered artifact",
        "preconditions": [
          "Artifact previously delivered",
          "Material finding documented"
        ],
        "main_flow": [
          "Finding documented",
          "Legal + Reviewer co-sign retraction",
          "Customer notified",
          "Audit-log append"
        ],
        "alternative_flows": [
          "Reviewer disagrees → escalate to owner",
          "Covered entity counsel inquiry incoming → run in parallel with legal-response workflow"
        ],
        "business_rules": [
          "Retraction requires Legal + Reviewer co-sign"
        ],
        "ai_role": "Surface prior similar cases (assist only)",
        "human_role": "Co-sign + notify",
        "commands": [
          "FileRetraction"
        ],
        "events": [
          "RetractionFiled"
        ],
        "aggregates": [
          "RetractionAggregate",
          "OwnerActionLedgerAggregate"
        ],
        "success": "Retraction filed + customer notified + audit trail updated",
        "failure_handling": "Rejection path emits RetractionRejected + escalates to owner",
        "audit": "Full retraction packet archived, immutable"
      },
      {
        "name": "Resolve an owner action and flip release decision",
        "actor": "Business owner",
        "context": "Compliance & Governance",
        "goal": "Close a blocking owner action and recompute release readiness",
        "preconditions": [
          "Owner action open"
        ],
        "main_flow": [
          "Owner supplies fact",
          "Ledger updated",
          "ReleaseDecision recomputed",
          "Downstream contexts notified"
        ],
        "alternative_flows": [
          "Fact rejected → OwnerActionRejected",
          "Legal review required → route to legal"
        ],
        "business_rules": [
          "Release cannot flip to ready with any blocking action open"
        ],
        "ai_role": "Blocker digest",
        "human_role": "Supply fact + accept release",
        "commands": [
          "ResolveOwnerAction"
        ],
        "events": [
          "OwnerActionResolved",
          "ReleaseDecisionChanged"
        ],
        "aggregates": [
          "OwnerActionLedgerAggregate"
        ],
        "success": "Release decision flips or stays with clear reason",
        "failure_handling": "OwnerActionRejected + retry loop",
        "audit": "Actor + before/after + timestamp"
      }
    ],
    "architecture": {
      "style": "modular-monolith-event-driven",
      "why": "Single team + single regulated vertical per blueprint + strong consistency requirements around signoff / delivery / release-decision favor a monolith. Event-driven internals give us the audit-friendly append-only log without the operational cost of microservices.",
      "rejected_alternatives": [
        "Microservices — no independent scaling or team boundary justifies distributed cost yet.",
        "Serverless-workflow-only — reviewer signoff and audit invariants are easier to keep correct in a monolith.",
        "No-code / low-code — cannot enforce OutputValidator, prompt versioning, or per-patient retrieval isolation with fidelity."
      ],
      "backend_modules": [
        "Service Fulfillment",
        "AI Orchestration",
        "Quality Assurance",
        "Compliance & Governance",
        "Sales & Intake",
        "Client Onboarding & Profile",
        "Client Delivery & Success",
        "Knowledge Base & Retrieval",
        "Analytics & Reporting"
      ],
      "frontend_modules": [
        "Operator dashboard",
        "Reviewer console",
        "Client portal",
        "Owner console",
        "Ops (prompt registry) console"
      ],
      "api_boundaries": [
        "/intake/*",
        "/artifacts/*",
        "/reviewer/*",
        "/compliance/*",
        "/knowledge/*",
        "/admin/*"
      ],
      "database_strategy": "One managed Postgres; schema-per-context; cross-context reads via published projections; RLS on protected tables.",
      "event_bus": "In-process event dispatcher backed by an outbox table (transactional publish); upgrade path to a real broker if throughput demands.",
      "queue": "Background job queue (managed) for AI runs, delivery adapters, and reindex jobs.",
      "workflow_engine": "None initially — orchestrate via domain events + policies; add a workflow engine if orchestrations exceed 5 sequential steps.",
      "ai_orchestration": "AI Orchestration context owns bounded agents; OutputValidator + prompt registry + patient-scoped retrieval; retries with backoff.",
      "rag_layer": "Per-patient partitioned retrieval indices in a managed vector DB; ingestion pipeline in Knowledge Base context.",
      "file_storage": "Managed blob storage with per-patient prefixes + signed URLs; artifacts hashed on write.",
      "authn_authz": "IdP (Google / Okta) for authn; RBAC via dedicated roles table with server-side checks + RLS.",
      "admin_dashboard": "Ops-facing admin for patients, users, feature flags, prompt versions.",
      "client_portal": "Customer-facing portal: submit intake, see status, receive artifacts.",
      "operator_dashboard": "Internal: intake queue, reviewer queue, escalation queue, delivery health.",
      "observability": "Structured logs with patient + request ids; RED metrics per workflow; error tracking with source maps; model-call spans with cost + latency; SLO review weekly.",
      "audit_logging": "Append-only audit log for all state transitions; hash-chained snapshots on signed artifacts.",
      "deployment": "Single production region + multi-AZ managed DB; per-PR preview deploys; migrations gated on review."
    },
    "module_structure": {
      "tree": "/src\n  /contexts\n    /sales-intake\n      /domain\n      /application\n      /infrastructure\n      /interfaces\n    /client-onboarding\n      /domain\n      /application\n      /infrastructure\n      /interfaces\n    /service-fulfillment\n      /domain\n      /application\n      /infrastructure\n      /interfaces\n    /ai-orchestration\n      /domain\n      /application\n      /infrastructure\n      /interfaces\n    /quality-assurance\n      /domain\n      /application\n      /infrastructure\n      /interfaces\n    /compliance-governance\n      /domain\n      /application\n      /infrastructure\n      /interfaces\n    /client-delivery\n      /domain\n      /application\n      /infrastructure\n      /interfaces\n    /knowledge-base\n      /domain\n      /application\n      /infrastructure\n      /interfaces\n    /analytics\n      /domain\n      /application\n      /infrastructure\n      /interfaces\n  /shared\n    /kernel        # tiny — Ids, Money, Patient, Actor\n    /events        # published-language event contracts\n    /auth          # session + role primitives\n    /observability # logging, metrics, tracing\n    /config",
      "modules": [
        {
          "name": "service-fulfillment",
          "purpose": "CertificationCase → Audit Package lifecycle",
          "owned_domain": [
            "CertificationCase",
            "Draft",
            "Audit Package",
            "Delivery"
          ],
          "application_services": [
            "OpenIntake",
            "AttachEvidence",
            "SubmitForSignoff",
            "DeliverCertificationPacket"
          ],
          "infra_adapters": [
            "Delivery adapter",
            "Outbox publisher"
          ],
          "public_interfaces": [
            "/intake/*",
            "/artifacts/*"
          ],
          "forbidden_deps": [
            "billing infra",
            "identity provider internals"
          ]
        },
        {
          "name": "ai-orchestration",
          "purpose": "Bounded AI agents",
          "owned_domain": [
            "AgentRun",
            "PromptVersion"
          ],
          "application_services": [
            "StartAgentRun",
            "PublishPromptVersion"
          ],
          "infra_adapters": [
            "LLM provider client (portable)",
            "Retrieval router"
          ],
          "public_interfaces": [
            "internal"
          ],
          "forbidden_deps": [
            "cross-patient retrieval",
            "direct delivery"
          ]
        },
        {
          "name": "quality-assurance",
          "purpose": "Signoff + retraction",
          "owned_domain": [
            "Signoff",
            "Retraction"
          ],
          "application_services": [
            "ApproveArtifact",
            "FileRetraction"
          ],
          "infra_adapters": [
            "Signature service"
          ],
          "public_interfaces": [
            "/reviewer/*"
          ],
          "forbidden_deps": [
            "draft content mutation"
          ]
        },
        {
          "name": "compliance-governance",
          "purpose": "Owner-action ledger + release decision",
          "owned_domain": [
            "OwnerActionLedger",
            "ReleaseDecision",
            "DSARRequest"
          ],
          "application_services": [
            "ResolveOwnerAction",
            "ProcessDSAR"
          ],
          "infra_adapters": [
            "Email adapter"
          ],
          "public_interfaces": [
            "/compliance/*"
          ],
          "forbidden_deps": [
            "draft content"
          ]
        }
      ],
      "dependency_rules": [
        "Domain layer must not depend on infrastructure.",
        "Application layer may depend on domain.",
        "Infrastructure implements ports defined by application/domain.",
        "Interfaces call application services.",
        "Shared kernel must remain small (Ids, Money, Patient, Actor).",
        "Contexts communicate through published events or explicit application APIs — never via direct database access to another context."
      ]
    },
    "security_governance": {
      "controls": [
        {
          "risk": "Prompt injection via customer input",
          "context": "AI Orchestration",
          "impact": "high",
          "control": "Input scrubber + OutputValidator + patient-scoped retrieval",
          "audit": "AgentRun trace"
        },
        {
          "risk": "Cross-patient retrieval leak",
          "context": "Knowledge Base",
          "impact": "severe",
          "control": "Per-patient index partitions + PatientIsolationSpec enforced at router",
          "audit": "Retrieval call log"
        },
        {
          "risk": "Signature spoofing",
          "context": "Quality Assurance",
          "impact": "severe",
          "control": "Signature bound to authenticated session; server-side validation",
          "audit": "Signature manifest"
        },
        {
          "risk": "Premature public claim",
          "context": "Compliance & Governance",
          "impact": "high",
          "control": "ReleaseReadinessSpec on OwnerActionLedger",
          "audit": "Release-decision log"
        },
        {
          "risk": "Privilege escalation",
          "context": "Identity & Access",
          "impact": "high",
          "control": "Roles in dedicated table + server-side checks + RLS",
          "audit": "Role assignment log"
        },
        {
          "risk": "Silent delivery failure",
          "context": "Client Delivery & Success",
          "impact": "medium",
          "control": "Adapter receipt required; alert customer within 1h on failure",
          "audit": "Delivery receipt archive"
        }
      ],
      "ai_governance": [
        "Every prompt version has a named owner + evaluator run + rollout flag",
        "AI outputs marked as suggestions until reviewer signoff",
        "Model + prompt inventory maintained in Ops console"
      ],
      "prompt_injection_defense": [
        "Strip / neutralize instruction-like patterns in customer inputs before prompt assembly",
        "Never concatenate raw customer input into a system prompt",
        "OutputValidator rejects outputs that reference forbidden actions"
      ],
      "sensitive_data_handling": [
        "PII scrubbed from logs",
        "Regulated data classes never sent to external model providers unless BAA/DPA covers it",
        "Per-patient blob storage prefixes + signed URLs"
      ],
      "access_control_matrix": [
        {
          "role": "Customer operator",
          "context": "Service Fulfillment",
          "capabilities": [
            "OpenIntake",
            "AttachEvidence",
            "View own artifacts"
          ]
        },
        {
          "role": "Apexus-certified 340B expert",
          "context": "Quality Assurance",
          "capabilities": [
            "ApproveArtifact",
            "RejectArtifact",
            "Co-sign retraction"
          ]
        },
        {
          "role": "Business owner",
          "context": "Compliance & Governance",
          "capabilities": [
            "ResolveOwnerAction",
            "Set release decision"
          ]
        },
        {
          "role": "Legal",
          "context": "Quality Assurance + Compliance",
          "capabilities": [
            "Co-sign retraction",
            "Handle DSAR"
          ]
        },
        {
          "role": "Ops",
          "context": "AI Orchestration",
          "capabilities": [
            "PublishPromptVersion",
            "Set confidence threshold"
          ]
        },
        {
          "role": "Platform admin",
          "context": "Identity & Access",
          "capabilities": [
            "Provision users",
            "Assign roles"
          ]
        }
      ],
      "audit_log_requirements": [
        "Append-only",
        "Actor + patient + timestamp + command + before/after hash",
        "PII scrubbed",
        "Exportable per patient on request (DSAR support)"
      ]
    },
    "observability": {
      "metrics": [
        {
          "metric": "Reviewer-signed artifacts / week / patient",
          "type": "business",
          "context": "Service Fulfillment",
          "why": "North star: repeatable value delivery",
          "target": "≥ contracted cadence",
          "alert_threshold": "< 80% of contracted cadence"
        },
        {
          "metric": "AI draft acceptance rate",
          "type": "ai-quality",
          "context": "AI Orchestration",
          "why": "Signals grounding + prompt fit",
          "target": "≥ 70% by Phase 2",
          "alert_threshold": "< 50% weekly"
        },
        {
          "metric": "Escalation rate",
          "type": "ai-quality",
          "context": "AI Orchestration",
          "why": "Guardrails firing correctly",
          "target": "5-15%",
          "alert_threshold": "> 30% weekly"
        },
        {
          "metric": "Cycle time to signoff (p50 + p95)",
          "type": "operational",
          "context": "Quality Assurance",
          "why": "Reviewer throughput",
          "target": "p95 ≤ 5 business days",
          "alert_threshold": "> 5 business days"
        },
        {
          "metric": "Signoff-to-retraction ratio",
          "type": "risk",
          "context": "Quality Assurance",
          "why": "Correctness signal",
          "target": "< 1%",
          "alert_threshold": "any retraction week-over-week"
        },
        {
          "metric": "Delivery failure rate",
          "type": "reliability",
          "context": "Client Delivery & Success",
          "why": "Customer-facing reliability",
          "target": "< 0.5%",
          "alert_threshold": "> 1% daily"
        },
        {
          "metric": "Owner-action open count",
          "type": "business",
          "context": "Compliance & Governance",
          "why": "Public-release readiness",
          "target": "0 for launched blueprints",
          "alert_threshold": "any blocker aging > 30 days"
        },
        {
          "metric": "Model cost per artifact",
          "type": "financial",
          "context": "AI Orchestration",
          "why": "Margin control",
          "target": "≤ target per pricing model",
          "alert_threshold": "> 1.5× target"
        },
        {
          "metric": "Cross-patient retrieval violation attempts",
          "type": "risk",
          "context": "Knowledge Base",
          "why": "Security invariant",
          "target": "0",
          "alert_threshold": "any > 0"
        },
        {
          "metric": "First-artifact time per patient",
          "type": "customer",
          "context": "Client Onboarding & Profile",
          "why": "Activation",
          "target": "≤ 2 weeks",
          "alert_threshold": "> 4 weeks"
        }
      ],
      "dashboards": [
        "Operator dashboard",
        "Reviewer queue",
        "Delivery health",
        "AI cost + escalation",
        "Compliance blockers"
      ],
      "audit_reports": [
        "Per-patient audit-log export",
        "Signature manifest export"
      ],
      "quality_review_reports": [
        "Reviewer calibration report",
        "Escalation-outcome report"
      ],
      "ai_evaluation_reports": [
        "Evaluator regression report",
        "Prompt-rollout diff"
      ],
      "client_outcome_reports": [
        "Artifacts delivered",
        "Cycle time",
        "Retraction rate"
      ]
    },
    "testing_strategy": {
      "tests": [
        {
          "type": "Domain unit",
          "validates": "Aggregate invariants",
          "context": "all core contexts",
          "example": "CertificationPacketAggregate rejects deliver without signoff"
        },
        {
          "type": "Aggregate invariant",
          "validates": "Consistency boundaries",
          "context": "Service Fulfillment / QA",
          "example": "Signed artifact is immutable"
        },
        {
          "type": "Policy",
          "validates": "Reactive rules",
          "context": "AI Orchestration",
          "example": "Escalates below confidence threshold"
        },
        {
          "type": "Specification",
          "validates": "Reusable rules",
          "context": "Compliance",
          "example": "ReleaseReadinessSpec blocks 'ready' with open owner actions"
        },
        {
          "type": "Application use-case",
          "validates": "End-to-end command flow",
          "context": "Fulfillment + QA",
          "example": "Deliver signed artifact happy path"
        },
        {
          "type": "Integration",
          "validates": "Adapter behavior",
          "context": "External Integrations",
          "example": "Stripe subscription webhook translates correctly"
        },
        {
          "type": "Contract",
          "validates": "Published-language event schemas",
          "context": "cross-context",
          "example": "DraftProduced payload matches consumer expectations"
        },
        {
          "type": "AI prompt eval",
          "validates": "Prompt quality vs golden dataset",
          "context": "AI Orchestration",
          "example": "Drafter accepts ≥ 40% in shadow mode"
        },
        {
          "type": "RAG retrieval",
          "validates": "Patient isolation + coverage",
          "context": "Knowledge Base",
          "example": "Cross-patient lookup returns zero rows"
        },
        {
          "type": "Golden dataset",
          "validates": "AI regression",
          "context": "AI Orchestration",
          "example": "No regression on past accepted artifacts"
        },
        {
          "type": "Human review simulation",
          "validates": "Escalation UX",
          "context": "QA",
          "example": "Reviewer can complete signoff in ≤ 5 clicks"
        },
        {
          "type": "End-to-end",
          "validates": "Critical path",
          "context": "all",
          "example": "Intake → signoff → delivery in staging"
        },
        {
          "type": "Security",
          "validates": "Auth + RLS + injection defense",
          "context": "Identity + AI Orchestration",
          "example": "Prompt-injection payload is neutralized"
        },
        {
          "type": "Regression",
          "validates": "No drift on prior fixes",
          "context": "all",
          "example": "Prior retraction bug does not reappear"
        }
      ],
      "critical_domain_rules": [
        "No delivery without signoff",
        "No AI output without OutputValidator pass",
        "No retrieval outside patient partition",
        "No public-release flip with open blockers"
      ],
      "ai_eval_dataset": [
        "50 past reviewer-accepted artifacts per vertical (redacted)",
        "20 rejected drafts (ground truth for escalation)",
        "10 injection-payload cases"
      ],
      "regression_plan": "Every PR runs domain + policy + spec unit tests. Every prompt release runs Evaluator with regression gate. Weekly critical-path smoke test in staging.",
      "contract_testing_plan": "Published-language event schemas versioned in /shared/events; consumer tests run in CI against schema-version compatibility.",
      "manual_qa_checklist": [
        "Signoff flow: signature captured + timestamp + hash",
        "Retraction flow: co-sign captured + customer notified",
        "Delivery flow: receipt archived",
        "DSAR flow: export completes end-to-end"
      ]
    },
    "mvp_roadmap": [
      {
        "phase": "Phase 0 — Manual workflow with instrumented capture",
        "goal": "Deliver one artifact end-to-end manually, capture every step as a domain event.",
        "features": [
          "Manual intake form",
          "Evidence upload",
          "Human draft",
          "Reviewer signoff via signed form"
        ],
        "contexts": [
          "Sales & Intake",
          "Service Fulfillment",
          "Quality Assurance"
        ],
        "ai_needs": [],
        "human_workflows": [
          "Reviewer signoff"
        ],
        "data_needs": [
          "certification case",
          "control evidence",
          "Audit Package"
        ],
        "integrations": [
          "Email"
        ],
        "risks": [
          "Un-audited manual step"
        ],
        "exit_criteria": [
          "1 real artifact delivered + reviewer-signed"
        ]
      },
      {
        "phase": "Phase 1 — AI-assisted drafting for internal use only",
        "goal": "Introduce Drafter Agent with reviewer gate; no customer-facing AI language.",
        "features": [
          "Drafter Agent (internal)",
          "OutputValidator",
          "Escalation route"
        ],
        "contexts": [
          "AI Orchestration",
          "Service Fulfillment"
        ],
        "ai_needs": [
          "Drafter, Classifier"
        ],
        "human_workflows": [
          "Escalation review"
        ],
        "data_needs": [
          "AgentRun",
          "PromptVersion"
        ],
        "integrations": [
          "frontier LLM providers"
        ],
        "risks": [
          "Prompt injection",
          "Grounding drift"
        ],
        "exit_criteria": [
          "AI draft acceptance rate ≥ 40% in shadow mode"
        ]
      },
      {
        "phase": "Phase 2 — Operator dashboard + owner-action ledger",
        "goal": "Make the workflow legible + governable for the owner.",
        "features": [
          "Operator dashboard",
          "Owner-action ledger",
          "Release-decision engine"
        ],
        "contexts": [
          "Compliance & Governance"
        ],
        "ai_needs": [],
        "human_workflows": [
          "Owner action resolution"
        ],
        "data_needs": [
          "OwnerActionLedger"
        ],
        "integrations": [
          "IdP"
        ],
        "risks": [
          "Ungoverned public claims"
        ],
        "exit_criteria": [
          "Release decisions computed from ledger"
        ]
      },
      {
        "phase": "Phase 3 — Client delivery portal",
        "goal": "Give customers a portal to see status + receive artifacts.",
        "features": [
          "Client portal",
          "Delivery adapter",
          "Revision workflow"
        ],
        "contexts": [
          "Client Delivery & Success"
        ],
        "ai_needs": [],
        "human_workflows": [
          "Success cadence"
        ],
        "data_needs": [
          "Delivery"
        ],
        "integrations": [
          "Email"
        ],
        "risks": [
          "Silent delivery failure"
        ],
        "exit_criteria": [
          "Delivery-failure alert within 1h"
        ]
      },
      {
        "phase": "Phase 4 — Automated QA + reporting",
        "goal": "Wire metrics, retraction runbook, and evaluator agent.",
        "features": [
          "Evaluator Agent",
          "Retraction workflow",
          "Dashboards"
        ],
        "contexts": [
          "Analytics & Reporting",
          "Quality Assurance"
        ],
        "ai_needs": [
          "Evaluator"
        ],
        "human_workflows": [
          "Retraction co-sign"
        ],
        "data_needs": [
          "Retraction"
        ],
        "integrations": [],
        "risks": [
          "Vanity metrics"
        ],
        "exit_criteria": [
          "North-star + guardrail metrics live"
        ]
      },
      {
        "phase": "Phase 5 — Scale + optimization",
        "goal": "Reduce cost per artifact, increase reviewer throughput.",
        "features": [
          "Prompt versioning UI",
          "Cost budgeting",
          "Multi-reviewer queue"
        ],
        "contexts": [
          "AI Orchestration",
          "Quality Assurance"
        ],
        "ai_needs": [
          "Cost meter"
        ],
        "human_workflows": [
          "Multi-reviewer routing"
        ],
        "data_needs": [],
        "integrations": [],
        "risks": [
          "Regression on rollout"
        ],
        "exit_criteria": [
          "Model cost per artifact ≤ target"
        ]
      }
    ],
    "scaling_roadmap": [
      {
        "stage": "≤ 5 patients",
        "trigger": "Design-partner cohort",
        "architecture_change": "Single-region modular monolith + managed DB",
        "operational_change": "Founder-led ops; weekly working session",
        "risk": "Single-owner queue"
      },
      {
        "stage": "5-25 patients",
        "trigger": "First paid conversions",
        "architecture_change": "Extract heaviest module (AI Orchestration) behind an internal queue; keep monolith",
        "operational_change": "Named on-call rotation; SOC 2 Type I scoping",
        "risk": "Reviewer bottleneck"
      },
      {
        "stage": "25-100 patients",
        "trigger": "Multi-reviewer demand",
        "architecture_change": "Split AI Orchestration into its own service if throughput/isolation demands it; per-patient retrieval sharding",
        "operational_change": "Dedicated success + prompt-ops roles",
        "risk": "Prompt version drift"
      },
      {
        "stage": "100+ patients",
        "trigger": "Enterprise + regulated segments",
        "architecture_change": "Regional deployments; per-region data residency; segregated compliance environments",
        "operational_change": "Dedicated SRE + compliance team; SOC 2 Type II + framework additions",
        "risk": "Compliance framework demand exceeds team capacity"
      }
    ],
    "risk_register": [
      {
        "risk": "Covered entity counsel-facing claim proves incorrect",
        "likelihood": "medium",
        "impact": "severe",
        "signal": "See ProductBlueprintDNA / risk register for tuned early-warning signals",
        "mitigation": "Every claim linked to a cited source + reviewer signoff",
        "owner": "legal",
        "context": "Compliance & Governance"
      },
      {
        "risk": "AI hallucination in a delivered artifact",
        "likelihood": "medium",
        "impact": "high",
        "signal": "See ProductBlueprintDNA / risk register for tuned early-warning signals",
        "mitigation": "Retrieval-first pipeline + structured output validation + reviewer gate",
        "owner": "engineering",
        "context": "AI Orchestration / Knowledge Base"
      },
      {
        "risk": "Cross-patient data leak",
        "likelihood": "low",
        "impact": "severe",
        "signal": "See ProductBlueprintDNA / risk register for tuned early-warning signals",
        "mitigation": "Row-level auth + per-patient retrieval indices + log-scrubbing",
        "owner": "engineering",
        "context": "AI Orchestration / Knowledge Base"
      },
      {
        "risk": "Design partner churns before contract",
        "likelihood": "medium",
        "impact": "high",
        "signal": "See ProductBlueprintDNA / risk register for tuned early-warning signals",
        "mitigation": "Weekly working-session cadence; documented value moments; owner-action ledger",
        "owner": "owner",
        "context": "Service Fulfillment"
      },
      {
        "risk": "Compliance framework demand exceeds team capacity",
        "likelihood": "high",
        "impact": "high",
        "signal": "See ProductBlueprintDNA / risk register for tuned early-warning signals",
        "mitigation": "SOC 2 Type I year one; map controls once, evidence continuously",
        "owner": "ops",
        "context": "Compliance & Governance"
      },
      {
        "risk": "Single-region outage takes production down",
        "likelihood": "low",
        "impact": "high",
        "signal": "See ProductBlueprintDNA / risk register for tuned early-warning signals",
        "mitigation": "Multi-AZ managed database; nightly cross-region backup",
        "owner": "engineering",
        "context": "Service Fulfillment"
      }
    ],
    "adrs": [
      {
        "id": "ADR-001",
        "decision": "Architecture style",
        "status": "accepted",
        "context": "Single team, single regulated vertical per blueprint, evidence-linked workflow.",
        "options": [
          "Modular monolith",
          "Microservices",
          "Serverless workflow",
          "No-code first"
        ],
        "chosen": "Modular monolith with event-driven internals",
        "business_reason": "Ship a defensible vertical slice with one team; avoid distributed-systems cost until scale forces it.",
        "technical_reason": "Deterministic transactions across aggregates; simpler ops; one deployable.",
        "tradeoffs": [
          "May feel unsophisticated to enterprise reviewers",
          "Refactor cost if we later split"
        ],
        "risks": [
          "Module boundaries erode without discipline"
        ],
        "revisit_trigger": "Any single module needs independent scaling or team boundary."
      },
      {
        "id": "ADR-002",
        "decision": "Bounded context boundaries",
        "status": "accepted",
        "context": "Domain analysis above; distinct language groups for Fulfillment, AI Orchestration, QA, Compliance.",
        "options": [
          "Contexts as above",
          "One big 'app' context",
          "Contexts split by UI page"
        ],
        "chosen": "Contexts as above (domain-derived)",
        "business_reason": "Protects the reviewer signoff invariant + owner-action ledger + evidence spine as first-class boundaries.",
        "technical_reason": "Aggregates align to consistency boundaries; ACLs contain external mess.",
        "tradeoffs": [
          "More code organization discipline"
        ],
        "risks": [
          "Team tries to bypass ACL for speed"
        ],
        "revisit_trigger": "New subdomain emerges (e.g., self-serve marketplace)."
      },
      {
        "id": "ADR-003",
        "decision": "Database ownership",
        "status": "accepted",
        "context": "Modular monolith with shared Postgres; per-context schemas.",
        "options": [
          "One shared schema",
          "Schema per context",
          "DB per context"
        ],
        "chosen": "Schema per context in shared Postgres, cross-context reads only via published projections.",
        "business_reason": "Keeps operational cost low; enforces boundaries without paying multi-DB tax.",
        "technical_reason": "RLS + schema separation gives ownership clarity.",
        "tradeoffs": [
          "Discipline required to avoid cross-schema joins"
        ],
        "risks": [
          "Bypass joins for speed"
        ],
        "revisit_trigger": "A context needs independent scaling or residency."
      },
      {
        "id": "ADR-004",
        "decision": "AI orchestration strategy",
        "status": "accepted",
        "context": "Retrieval-first with structured-output validation + human gate.",
        "options": [
          "Open-ended chat",
          "Retrieval-first + validated",
          "Autonomous multi-agent"
        ],
        "chosen": "Retrieval-first + structured validation + reviewer gate",
        "business_reason": "Grounding + defensibility are the paid outcome.",
        "technical_reason": "OutputValidator gives a hard boundary before drafts leave AI Orchestration.",
        "tradeoffs": [
          "Slower than agentic chat"
        ],
        "risks": [
          "Prompt version regression"
        ],
        "revisit_trigger": "Evaluator shows a step-function accuracy gain from a new pattern."
      },
      {
        "id": "ADR-005",
        "decision": "Human review strategy",
        "status": "accepted",
        "context": "Regulated vertical; brand + legal risk on wrong outputs.",
        "options": [
          "No human review (fully automated)",
          "Sampling review",
          "Every-artifact review"
        ],
        "chosen": "Every-artifact review by named licensed reviewer",
        "business_reason": "Signoff is the trust primitive.",
        "technical_reason": "Signature bound to session; append-only log.",
        "tradeoffs": [
          "Reviewer throughput becomes the bottleneck"
        ],
        "risks": [
          "Reviewer burnout"
        ],
        "revisit_trigger": "Sustained low retraction rate + the owner's counsel acceptance."
      },
      {
        "id": "ADR-006",
        "decision": "Integration strategy",
        "status": "accepted",
        "context": "External systems: PM management software, prior-audit-vendor formats, Airtable intake tracker, ...",
        "options": [
          "Direct API coupling",
          "Anti-corruption layer per system",
          "Middleware bus (Zapier/n8n)"
        ],
        "chosen": "Anti-corruption layer per system, owned by External Integrations context",
        "business_reason": "External schemas must never leak into the core.",
        "technical_reason": "Adapters translate + validate; upstream break contained.",
        "tradeoffs": [
          "More code than direct coupling"
        ],
        "risks": [
          "Adapter lag on upstream change"
        ],
        "revisit_trigger": "External system stability changes materially."
      },
      {
        "id": "ADR-007",
        "decision": "Modular monolith vs microservices",
        "status": "accepted",
        "context": "Same as ADR-001.",
        "options": [
          "Monolith",
          "Microservices"
        ],
        "chosen": "Monolith",
        "business_reason": "Team size and scale do not justify microservices cost.",
        "technical_reason": "Distributed transactions across signoff/delivery would be a nightmare early.",
        "tradeoffs": [
          "Refactor cost later"
        ],
        "risks": [
          "Cultural expectation drift"
        ],
        "revisit_trigger": "See ADR-001."
      },
      {
        "id": "ADR-008",
        "decision": "Build vs buy for generic subdomains",
        "status": "accepted",
        "context": "Billing, Identity, IdP, email.",
        "options": [
          "Build all",
          "Buy generics"
        ],
        "chosen": "Buy generics (Stripe, IdP, transactional email)",
        "business_reason": "Do not spend core-domain hours on solved categories.",
        "technical_reason": "Standard SDKs + well-documented failure modes.",
        "tradeoffs": [
          "Vendor risk"
        ],
        "risks": [
          "Vendor lock-in"
        ],
        "revisit_trigger": "Cost or reliability materially degrades."
      }
    ],
    "self_audit": {
      "scores": [
        {
          "category": "Domain accuracy",
          "score": 8,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Ubiquitous language quality",
          "score": 8,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Subdomain classification quality",
          "score": 8,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Bounded context clarity",
          "score": 9,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Core domain focus",
          "score": 9,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Context map quality",
          "score": 8,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Aggregate design quality",
          "score": 8,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Invariant quality",
          "score": 9,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "AI-agent responsibility design",
          "score": 9,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Human review safety",
          "score": 9,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Data ownership clarity",
          "score": 8,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Integration protection",
          "score": 8,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Implementation feasibility",
          "score": 8,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Scalability",
          "score": 7,
          "weakness": "Single-region; single-reviewer bottleneck; monolith split not planned.",
          "improvement": "Add per-patient AI queue + multi-reviewer routing at Phase 2."
        },
        {
          "category": "Security and compliance",
          "score": 7,
          "weakness": "High-trust vertical needs Type II mapping and per-engagement controls earlier.",
          "improvement": "Map controls at Phase 1; commit to Type II by Phase 3."
        },
        {
          "category": "Testing strategy",
          "score": 8,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        },
        {
          "category": "Operational realism",
          "score": 7,
          "weakness": "Founder-led ops assumed through Phase 2; brittle to key-person absence.",
          "improvement": "Document runbooks; cross-train success + prompt-ops role by Phase 2."
        },
        {
          "category": "MVP practicality",
          "score": 9,
          "weakness": "None material at this stage.",
          "improvement": "Maintain the current standard; re-audit after the first pilots land real data."
        }
      ],
      "weakest_parts": [
        "Scalability plan assumes single reviewer per patient through Phase 2",
        "Operational realism depends on founder-led ops",
        "Compliance framework depth for Type II"
      ],
      "biggest_assumptions": [
        "The target audience will pay for evidence-linked, human-reviewed outputs over unverified AI generation.",
        "The workflow can be reconstructed from an owner-supplied evidence certification within one week per design partner.",
        "The vertical tolerates AI-assisted drafts when human review is explicit and audit-traceable."
      ],
      "highest_risk_decisions": [
        "Modular monolith (ADR-001)",
        "Every-artifact reviewer signoff (ADR-005)",
        "Anti-corruption layer per external system (ADR-006)"
      ],
      "needs_domain_expert": [
        "Apexus-certified 340B expert to validate signoff workflow ergonomics",
        "Vertical SME on control evidence taxonomy"
      ],
      "needs_legal": [
        "Retraction workflow language",
        "DSAR SLA + the owner's counsel-response runbook",
        "Public-claim policy for microsite content"
      ],
      "needs_prototype": [
        "Drafter Agent accuracy on 20-case golden dataset",
        "Reviewer signoff UX end-to-end in ≤ 5 minutes per artifact",
        "Per-patient retrieval isolation test"
      ],
      "validate_before_prod": [
        "Named licensed reviewer + engagement letter on file",
        "Owner-action ledger populated per launch patient",
        "OutputValidator false-negative rate acceptable",
        "Delivery failure alert path tested"
      ]
    },
    "final_recommendations": [
      "Ship a modular-monolith, evidence-linked, reviewer-gated vertical slice for ClaimClear. Preserve the invariant that no Audit Package leaves the system without Apexus-certified 340B expert signoff. Do not launch commercially until owner-action facts close and at least one reviewer-signed Audit Package is delivered.",
      "Do NOT default to microservices. Extract a module only when a specific pressure demands it.",
      "Do NOT allow AI outputs to leave AI Orchestration without OutputValidator pass and citation coverage.",
      "Do NOT ship any public claim on the ClaimClear microsite while owner actions are open.",
      "Do NOT store roles on user/profile tables; use a dedicated roles table with server-side checks + RLS.",
      "DO wire the north-star + guardrail metrics before Phase 2 launch.",
      "DO capture every state transition as an append-only domain event; the audit trail is the product."
    ],
    "extensions": {
      "service_business_reality_check": {
        "is_service_business": true,
        "paid_outcome_clear": true,
        "workflow_present": true,
        "ai_native_fit_score": 8,
        "red_flags": []
      },
      "ai_native_fit": {
        "score": 8,
        "why": "Evidence-linked drafting + confidence-scored escalation is only economical with bounded AI orchestration. Pure-manual = uneconomic; pure-automated = undefensible.",
        "disqualifiers": [
          "High-trust vertical: cannot ship without licensed reviewer signoff"
        ]
      },
      "domain_evidence_register": [
        {
          "claim": "ClaimClear paid outcome is a reviewer-signed artifact",
          "evidence_type": "primary",
          "source": "Business Understanding + subdomain 'Service Fulfillment'",
          "strength": "strong",
          "gaps": "Confirm with 3 design-partner interviews"
        },
        {
          "claim": "Reviewer signoff is legally / commercially required for defensibility",
          "evidence_type": "primary",
          "source": "Vertical shape + the owner's counsel archetype",
          "strength": "strong",
          "gaps": "Vertical-specific attestation standard citation"
        },
        {
          "claim": "AI drafting materially reduces cycle time vs. pure manual",
          "evidence_type": "assumed",
          "source": "Category benchmark",
          "strength": "medium",
          "gaps": "Measure on internal golden dataset"
        },
        {
          "claim": "Customer will supply structured intake within SLA",
          "evidence_type": "assumed",
          "source": "Prospect conversations (unverified)",
          "strength": "weak",
          "gaps": "Run 5 intake dry-runs with design partners"
        },
        {
          "claim": "Per-patient retrieval isolation prevents cross-patient leakage",
          "evidence_type": "primary",
          "source": "Architecture (Knowledge Base context)",
          "strength": "strong",
          "gaps": "Add automated cross-patient lookup test"
        },
        {
          "claim": "Owner-action ledger blocks premature public release",
          "evidence_type": "primary",
          "source": "Compliance & Governance context invariants",
          "strength": "strong",
          "gaps": "None"
        },
        {
          "claim": "Model + prompt versioning enables reproducible outputs",
          "evidence_type": "primary",
          "source": "AI Orchestration context",
          "strength": "strong",
          "gaps": "Evaluator regression thresholds not yet baselined"
        },
        {
          "claim": "Cycle-time reduction supports premium pricing",
          "evidence_type": "assumed",
          "source": "Pricing hypothesis",
          "strength": "medium",
          "gaps": "Test with 3 pricing conversations"
        }
      ],
      "assumption_register": [
        {
          "assumption": "The target audience will pay for evidence-linked, human-reviewed outputs over unverified AI generation.",
          "impact_if_wrong": "high",
          "how_to_validate": "Design-partner interview + measurement",
          "blocking": true
        },
        {
          "assumption": "The workflow can be reconstructed from an owner-supplied evidence certification within one week per design partner.",
          "impact_if_wrong": "high",
          "how_to_validate": "Design-partner interview + measurement",
          "blocking": true
        },
        {
          "assumption": "The vertical tolerates AI-assisted drafts when human review is explicit and audit-traceable.",
          "impact_if_wrong": "high",
          "how_to_validate": "Design-partner interview + measurement",
          "blocking": false
        },
        {
          "assumption": "Single-patient per customer is not required for the first cohort — logical isolation with row-level auth is acceptable.",
          "impact_if_wrong": "medium",
          "how_to_validate": "Instrument metric + review after Phase 1",
          "blocking": false
        },
        {
          "assumption": "Manifest-backed blueprint reflects real customer workflow, not a synthetic scenario.",
          "impact_if_wrong": "medium",
          "how_to_validate": "Instrument metric + review after Phase 1",
          "blocking": false
        },
        {
          "assumption": "A licensed reviewer can be sourced and retained for this vertical",
          "impact_if_wrong": "severe",
          "how_to_validate": "Recruit + sign engagement letter before commercial launch",
          "blocking": true
        },
        {
          "assumption": "External systems expose stable APIs with predictable failure modes",
          "impact_if_wrong": "medium",
          "how_to_validate": "Adapter contract tests + failure-injection",
          "blocking": false
        }
      ],
      "language_conflict_map": [
        {
          "term": "Engagement",
          "meaning_a": "A signed billing contract",
          "context_a": "Billing & Revenue",
          "meaning_b": "An accepted unit of intake work",
          "context_b": "Sales & Intake",
          "resolution": "Billing owns 'Engagement'; Fulfillment uses vertical-specific intake noun."
        },
        {
          "term": "Approval",
          "meaning_a": "Customer accepts a delivered draft",
          "context_a": "Client Delivery",
          "meaning_b": "Reviewer signs an artifact",
          "context_b": "Quality Assurance",
          "resolution": "QA uses 'Signoff'; Delivery uses 'Customer approval'."
        },
        {
          "term": "Confidence",
          "meaning_a": "Model-assigned probability",
          "context_a": "AI Orchestration",
          "meaning_b": "Human legal/clinical confidence",
          "context_b": "Quality Assurance",
          "resolution": "Never conflate; always qualify (model_confidence vs reviewer_confidence)."
        }
      ],
      "build_buy_integrate": [
        {
          "subdomain": "Service Fulfillment (evidence-linked drafting + review)",
          "decision": "build",
          "reason": "This is what customers pay for and what counsel and owners inspect."
        },
        {
          "subdomain": "AI Orchestration (bounded agents + retrieval)",
          "decision": "build",
          "reason": "The AI-native competitive edge lives here; misuse here creates every high-severity risk."
        },
        {
          "subdomain": "Quality Assurance (reviewer signoff + retraction)",
          "decision": "build",
          "reason": "Signoff is the trust primitive of the whole business."
        },
        {
          "subdomain": "Sales & Intake",
          "decision": "build",
          "reason": "Feeds Fulfillment; not the differentiator, but if broken, nothing else runs."
        },
        {
          "subdomain": "Client Onboarding & Profile",
          "decision": "build",
          "reason": "One-time high-touch step per customer."
        },
        {
          "subdomain": "Client Delivery & Success",
          "decision": "build",
          "reason": "Customer-visible surface; drives retention."
        },
        {
          "subdomain": "Compliance & Governance",
          "decision": "build",
          "reason": "Cross-cuts every context; owns 'can we publicly claim this?'."
        },
        {
          "subdomain": "Billing & Revenue",
          "decision": "buy",
          "reason": "Solved category; do not build."
        },
        {
          "subdomain": "Identity & Access",
          "decision": "integrate",
          "reason": "Solved category."
        },
        {
          "subdomain": "Knowledge Base & Retrieval",
          "decision": "build",
          "reason": "Feeds AI Orchestration; poor retrieval = poor drafts."
        },
        {
          "subdomain": "Analytics & Reporting",
          "decision": "build",
          "reason": "Drives every operational decision."
        },
        {
          "subdomain": "External Integrations (Anti-Corruption Layer)",
          "decision": "build",
          "reason": "External schemas must never leak into the core."
        }
      ],
      "core_protection_strategy": [
        "Core contexts (Service Fulfillment, AI Orchestration, Quality Assurance) staffed before any generic subdomain work.",
        "Any change to a core aggregate requires a paired ADR + invariant test.",
        "Generic subdomains (Billing, Identity) are bought or integrated; never built in-house without a killer reason.",
        "Prompt-version rollout to core agents gated on Evaluator regression run.",
        "No feature flag may bypass the reviewer-signoff invariant."
      ],
      "boundary_stress_tests": [
        {
          "scenario": "Customer requests changes to a delivered artifact",
          "contexts_touched": [
            "Client Delivery",
            "Service Fulfillment",
            "Quality Assurance"
          ],
          "breaks_if": "Revision creates a new draft without re-triggering signoff",
          "verdict": "holds"
        },
        {
          "scenario": "Reviewer identity changes mid-engagement",
          "contexts_touched": [
            "Client Onboarding",
            "Quality Assurance"
          ],
          "breaks_if": "QA cached reviewer identity locally",
          "verdict": "adjust"
        },
        {
          "scenario": "External the owner's counsel issues a new certification case",
          "contexts_touched": [
            "Compliance & Governance",
            "Knowledge Base"
          ],
          "breaks_if": "Retrieval index not reindexed within SLA",
          "verdict": "holds"
        },
        {
          "scenario": "Owner marks an action resolved that is actually not",
          "contexts_touched": [
            "Compliance & Governance"
          ],
          "breaks_if": "No re-verification step before release-decision flips",
          "verdict": "adjust"
        },
        {
          "scenario": "AI produces high-confidence draft with wrong citation",
          "contexts_touched": [
            "AI Orchestration",
            "Quality Assurance"
          ],
          "breaks_if": "OutputValidator does not check citation-to-claim linkage",
          "verdict": "holds"
        }
      ],
      "unresolved_ownership": [
        {
          "concept": "Reviewer engagement letter",
          "candidates": [
            "Client Onboarding",
            "Quality Assurance"
          ],
          "recommendation": "Own in Client Onboarding; QA references by id."
        },
        {
          "concept": "Public claim / marketing site content",
          "candidates": [
            "Compliance & Governance",
            "Client Delivery"
          ],
          "recommendation": "Compliance owns the release-decision; Delivery renders."
        },
        {
          "concept": "Model + prompt cost attribution",
          "candidates": [
            "AI Orchestration",
            "Billing & Revenue"
          ],
          "recommendation": "AI Orchestration owns raw run cost; Billing consumes rolled-up projections."
        }
      ],
      "published_language_contracts": [
        {
          "producer": "Sales & Intake",
          "consumer": "Service Fulfillment",
          "contract": "EngagementAccepted",
          "versioning": "SemVer on event schema; consumer contract tests in CI."
        },
        {
          "producer": "Service Fulfillment",
          "consumer": "Quality Assurance",
          "contract": "DraftReady, ArtifactSigned",
          "versioning": "SemVer on event schema; consumer contract tests in CI."
        },
        {
          "producer": "AI Orchestration",
          "consumer": "Service Fulfillment",
          "contract": "DraftProduced, EscalationRaised",
          "versioning": "SemVer on event schema; consumer contract tests in CI."
        },
        {
          "producer": "Knowledge Base & Retrieval",
          "consumer": "AI Orchestration",
          "contract": "DocIngested, IndexRebuilt",
          "versioning": "SemVer on event schema; consumer contract tests in CI."
        },
        {
          "producer": "Client Onboarding & Profile",
          "consumer": "Service Fulfillment",
          "contract": "PatientProvisioned, ReviewerRegistered",
          "versioning": "SemVer on event schema; consumer contract tests in CI."
        },
        {
          "producer": "Service Fulfillment",
          "consumer": "Client Delivery & Success",
          "contract": "ArtifactDelivered, DeliveryConfirmed",
          "versioning": "SemVer on event schema; consumer contract tests in CI."
        },
        {
          "producer": "Quality Assurance",
          "consumer": "Compliance & Governance",
          "contract": "RetractionFiled",
          "versioning": "SemVer on event schema; consumer contract tests in CI."
        },
        {
          "producer": "Client Delivery & Success",
          "consumer": "Billing & Revenue",
          "contract": "DeliveryConfirmed",
          "versioning": "SemVer on event schema; consumer contract tests in CI."
        }
      ],
      "shared_kernel_warnings": [
        "Shared kernel must remain small: Ids, Money, Patient, Actor. Adding a domain concept here couples every context.",
        "Never share aggregates across contexts via shared kernel — publish an event or expose an application service.",
        "Any addition to /shared requires 2-context approval to prevent silent coupling."
      ],
      "aggregate_stress_tests": [
        {
          "aggregate": "CertificationCaseAggregate",
          "scenario": "Concurrent command on CertificationCaseAggregate",
          "invariant_at_risk": "Every claim in a delivered artifact cites evidence",
          "verdict": "holds"
        },
        {
          "aggregate": "CertificationPacketAggregate",
          "scenario": "Concurrent command on CertificationPacketAggregate",
          "invariant_at_risk": "A Audit Package cannot be delivered without a valid Signoff",
          "verdict": "holds"
        },
        {
          "aggregate": "SignoffAggregate",
          "scenario": "Concurrent command on SignoffAggregate",
          "invariant_at_risk": "Signature bound to a live authenticated session, not a form field",
          "verdict": "holds"
        },
        {
          "aggregate": "RetractionAggregate",
          "scenario": "Concurrent command on RetractionAggregate",
          "invariant_at_risk": "A retraction requires Legal + Reviewer co-signature",
          "verdict": "holds"
        },
        {
          "aggregate": "AgentRunAggregate",
          "scenario": "Concurrent command on AgentRunAggregate",
          "invariant_at_risk": "No output emitted without OutputValidator pass",
          "verdict": "holds"
        }
      ],
      "agent_stress_tests": [
        {
          "agent": "Drafter Agent",
          "scenario": "Malformed / adversarial input to Drafter Agent",
          "failure_mode": "Prompt injection",
          "guardrail": "Structured-output schema",
          "verdict": "holds"
        },
        {
          "agent": "Classifier Agent",
          "scenario": "Malformed / adversarial input to Classifier Agent",
          "failure_mode": "Wrong route → wrong reviewer",
          "guardrail": "Structured-output schema",
          "verdict": "holds"
        },
        {
          "agent": "Evaluator Agent",
          "scenario": "Malformed / adversarial input to Evaluator Agent",
          "failure_mode": "Overfit to golden dataset",
          "guardrail": "Regression thresholds",
          "verdict": "holds"
        }
      ],
      "regulated_domain_handling": [
        {
          "regime": "HRSA 340B program-integrity guidance (Section 340B of the Public Health Service Act)",
          "applies_because": "Audited Claims draft an independent opinion that determines the covered entity's 340B program-continuation standing with HRSA",
          "controls": [
            "Cited certification case per claim",
            "Compliance-officer signoff"
          ],
          "evidence_required": [
            "CertificationCase-to-control map",
            "Disclosure receipts"
          ]
        }
      ],
      "unit_economics": {
        "price_model": "Fixed fee per Audit Package + seasonal engagement retainer",
        "unit_of_value": "Reviewer-signed 340b-compliance-audit-engine artifact",
        "gross_margin_pct": 65,
        "cost_drivers": [
          "Reviewer hours per artifact",
          "AI model + retrieval cost",
          "External API + delivery cost",
          "Support + success"
        ],
        "breakeven_note": "Breakeven depends on certified reviewer throughput and extraction acceptance; target 45–60 certified reviewer minutes per certification by day 90 (blueprint band), 55–65% firm gross margin by year 1."
      },
      "margin_leakage_map": [
        {
          "leakage": "Reviewer over-editing AI drafts",
          "cause": "Low AI acceptance rate",
          "impact": "high",
          "mitigation": "Evaluator regression + prompt-owner accountability"
        },
        {
          "leakage": "External API retries without backoff",
          "cause": "Poor adapter design",
          "impact": "medium",
          "mitigation": "Exponential backoff + circuit breaker"
        },
        {
          "leakage": "Cross-patient retrieval scan cost",
          "cause": "Missing partitioning",
          "impact": "high",
          "mitigation": "Per-patient index partitions"
        },
        {
          "leakage": "Silent delivery failure absorbing support time",
          "cause": "No adapter receipts",
          "impact": "medium",
          "mitigation": "Adapter receipts + 1h SLA alert"
        }
      ],
      "slop_findings": [
        {
          "pattern": "generic 'dashboard'-only value prop",
          "status": "clean",
          "note": "Value prop is reviewer-signed artifact, not a dashboard."
        },
        {
          "pattern": "AI-as-magic",
          "status": "clean",
          "note": "AI is bounded to drafting + validation; humans own signoff."
        },
        {
          "pattern": "blockchain",
          "status": "clean",
          "note": "No blockchain-as-hype in derivation."
        },
        {
          "pattern": "agent-first (agents replace humans)",
          "status": "clean",
          "note": "Every agent has forbidden actions + human escalation."
        },
        {
          "pattern": "microservices by default",
          "status": "clean",
          "note": "ADR-001 chose modular monolith."
        },
        {
          "pattern": "everything-is-core",
          "status": "clean",
          "note": "Generic subdomains explicitly marked buy/integrate."
        }
      ],
      "drift_checks": [
        {
          "stage": "Business Truth Discovery",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Ubiquitous Language",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Strategic Subdomains",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Bounded Contexts",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Context Mapping",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Event Storming",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Commands/Events/Policies",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Tactical Model",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "AI Ops",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Human-in-the-Loop",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Evidence + Compliance",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Data Ownership",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Integration",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Application Use Cases",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Outcome Economics",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Technical Architecture",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Security + Governance",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Testing",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "MVP Roadmap",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Scaling",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Risk",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "ADRs",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Foundry Package",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Contradiction Scan",
          "status": "pass",
          "findings": []
        },
        {
          "stage": "Self-Audit",
          "status": "pass",
          "findings": []
        }
      ],
      "gates": [
        {
          "id": "domain",
          "title": "Domain Clarity",
          "passed": true,
          "checks": [
            {
              "name": "Paid outcome present",
              "ok": true,
              "evidence": "business_understanding.paid_outcome"
            },
            {
              "name": "≥3 actors identified",
              "ok": true,
              "evidence": "5 actors"
            }
          ]
        },
        {
          "id": "core",
          "title": "Core Domain",
          "passed": true,
          "checks": [
            {
              "name": "At least one core subdomain",
              "ok": true,
              "evidence": "Service Fulfillment (evidence-linked drafting + review), AI Orchestration (bounded agents + retrieval), Quality Assurance (reviewer signoff + retraction)"
            }
          ]
        },
        {
          "id": "boundary",
          "title": "Boundary",
          "passed": true,
          "checks": [
            {
              "name": "≥4 bounded contexts",
              "ok": true,
              "evidence": "11 contexts"
            },
            {
              "name": "Every context has owned language",
              "ok": true,
              "evidence": "all populated"
            }
          ]
        },
        {
          "id": "invariant",
          "title": "Invariant",
          "passed": true,
          "checks": [
            {
              "name": "≥4 business invariants",
              "ok": true,
              "evidence": "9 invariants"
            }
          ]
        },
        {
          "id": "ai-safety",
          "title": "AI Safety",
          "passed": true,
          "checks": [
            {
              "name": "Every agent has forbidden actions",
              "ok": true,
              "evidence": "yes"
            },
            {
              "name": "Every agent has escalation triggers",
              "ok": true,
              "evidence": "yes"
            }
          ]
        },
        {
          "id": "buildability",
          "title": "Buildability",
          "passed": true,
          "checks": [
            {
              "name": "MVP roadmap ≥2 phases",
              "ok": true,
              "evidence": "6 phases"
            }
          ]
        },
        {
          "id": "anti-slop",
          "title": "Anti-Slop",
          "passed": true,
          "checks": [
            {
              "name": "No slop patterns",
              "ok": true,
              "evidence": "slop_findings all clean/warn"
            },
            {
              "name": "No failing contradictions",
              "ok": true,
              "evidence": "8 findings"
            }
          ]
        }
      ],
      "contradiction_scan": [
        {
          "id": "INV-AGG-SignoffAggregate + RetractionAggregate",
          "severity": "warn",
          "message": "Invariant references aggregate 'SignoffAggregate + RetractionAggregate' not defined",
          "refs": [
            "SignoffAggregate + RetractionAggregate"
          ]
        },
        {
          "id": "INV-AGG-IndexShardAggregate",
          "severity": "warn",
          "message": "Invariant references aggregate 'IndexShardAggregate' not defined",
          "refs": [
            "IndexShardAggregate"
          ]
        },
        {
          "id": "INV-AGG-UserAggregate",
          "severity": "warn",
          "message": "Invariant references aggregate 'UserAggregate' not defined",
          "refs": [
            "UserAggregate"
          ]
        },
        {
          "id": "CMD-EVT-OpenIntake-IntakeRejected",
          "severity": "info",
          "message": "Command OpenIntake references event 'IntakeRejected' not present in domain_events",
          "refs": [
            "OpenIntake",
            "IntakeRejected"
          ]
        },
        {
          "id": "CMD-EVT-AttachEvidence-EvidenceRejected",
          "severity": "info",
          "message": "Command AttachEvidence references event 'EvidenceRejected' not present in domain_events",
          "refs": [
            "AttachEvidence",
            "EvidenceRejected"
          ]
        },
        {
          "id": "CMD-EVT-DeliverCertificationPacket-DeliveryFailed",
          "severity": "info",
          "message": "Command DeliverCertificationPacket references event 'DeliveryFailed' not present in domain_events",
          "refs": [
            "DeliverCertificationPacket",
            "DeliveryFailed"
          ]
        },
        {
          "id": "CMD-EVT-ResolveOwnerAction-OwnerActionRejected",
          "severity": "info",
          "message": "Command ResolveOwnerAction references event 'OwnerActionRejected' not present in domain_events",
          "refs": [
            "ResolveOwnerAction",
            "OwnerActionRejected"
          ]
        },
        {
          "id": "CMD-EVT-FileRetraction-RetractionRejected",
          "severity": "info",
          "message": "Command FileRetraction references event 'RetractionRejected' not present in domain_events",
          "refs": [
            "FileRetraction",
            "RetractionRejected"
          ]
        }
      ],
      "rubric": {
        "categories": [
          {
            "category": "Domain accuracy",
            "score": 8,
            "min": 7,
            "passed": true
          },
          {
            "category": "Ubiquitous language quality",
            "score": 8,
            "min": 7,
            "passed": true
          },
          {
            "category": "Subdomain classification quality",
            "score": 8,
            "min": 7,
            "passed": true
          },
          {
            "category": "Bounded context clarity",
            "score": 9,
            "min": 7,
            "passed": true
          },
          {
            "category": "Core domain focus",
            "score": 9,
            "min": 7,
            "passed": true
          },
          {
            "category": "Context map quality",
            "score": 8,
            "min": 7,
            "passed": true
          },
          {
            "category": "Aggregate design quality",
            "score": 8,
            "min": 7,
            "passed": true
          },
          {
            "category": "Invariant quality",
            "score": 9,
            "min": 7,
            "passed": true
          },
          {
            "category": "AI-agent responsibility design",
            "score": 9,
            "min": 7,
            "passed": true
          },
          {
            "category": "Human review safety",
            "score": 9,
            "min": 7,
            "passed": true
          },
          {
            "category": "Data ownership clarity",
            "score": 8,
            "min": 7,
            "passed": true
          },
          {
            "category": "Integration protection",
            "score": 8,
            "min": 7,
            "passed": true
          },
          {
            "category": "Implementation feasibility",
            "score": 8,
            "min": 7,
            "passed": true
          },
          {
            "category": "Scalability",
            "score": 7,
            "min": 7,
            "passed": true
          },
          {
            "category": "Security and compliance",
            "score": 7,
            "min": 7,
            "passed": true
          },
          {
            "category": "Testing strategy",
            "score": 8,
            "min": 7,
            "passed": true
          },
          {
            "category": "Operational realism",
            "score": 7,
            "min": 7,
            "passed": true
          },
          {
            "category": "MVP practicality",
            "score": 9,
            "min": 7,
            "passed": true
          }
        ],
        "pass": true,
        "average": 8.2
      },
      "foundry_package": {
        "version": "1.0.0",
        "checksum": "bec1171d",
        "counts": {
          "subdomains": 12,
          "bounded_contexts": 11,
          "aggregates": 8,
          "events": 8,
          "commands": 7,
          "policies": 5,
          "ai_agents": 3,
          "invariants": 9,
          "integrations": 4,
          "adrs": 8
        },
        "subset": {
          "subdomains": [
            "Service Fulfillment (evidence-linked drafting + review)",
            "AI Orchestration (bounded agents + retrieval)",
            "Quality Assurance (reviewer signoff + retraction)",
            "Sales & Intake",
            "Client Onboarding & Profile",
            "Client Delivery & Success",
            "Compliance & Governance",
            "Billing & Revenue",
            "Identity & Access",
            "Knowledge Base & Retrieval",
            "Analytics & Reporting",
            "External Integrations (Anti-Corruption Layer)"
          ],
          "bounded_contexts": [
            "Service Fulfillment",
            "AI Orchestration",
            "Quality Assurance",
            "Compliance & Governance",
            "Sales & Intake",
            "Client Onboarding & Profile",
            "Client Delivery & Success",
            "Knowledge Base & Retrieval",
            "Billing & Revenue",
            "Identity & Access",
            "Analytics & Reporting"
          ],
          "aggregates": [
            "CertificationCaseAggregate",
            "CertificationPacketAggregate",
            "SignoffAggregate",
            "RetractionAggregate",
            "AgentRunAggregate",
            "OwnerActionLedgerAggregate",
            "PatientAggregate",
            "DeliveryAggregate"
          ],
          "events": [
            "certificationCaseAccepted",
            "EvidenceCollected",
            "DraftReady",
            "EscalationRaised",
            "ReviewerSigned",
            "ArtifactDelivered",
            "OwnerActionResolved",
            "RetractionFiled"
          ],
          "commands": [
            "OpenIntake",
            "AttachEvidence",
            "StartAgentRun",
            "ApproveArtifact",
            "DeliverCertificationPacket",
            "ResolveOwnerAction",
            "FileRetraction"
          ],
          "policies": [
            "Auto-request signoff on coverage complete",
            "Escalate on low confidence",
            "Block delivery on open compliance blocker",
            "Retract on material finding",
            "Alert on delivery failure"
          ],
          "ai_agents": [
            "Drafter Agent",
            "Classifier Agent",
            "Evaluator Agent"
          ],
          "invariants": [
            "A Audit Package cannot be delivered without a valid Reviewer signoff.",
            "Every claim in a delivered artifact cites at least one evidence item.",
            "A signature is bound to a live authenticated session, not a form field.",
            "Signed artifacts are immutable; corrections go through Retraction.",
            "No AI output leaves AI Orchestration without OutputValidator pass.",
            "Retrieval is scoped to a single patient partition per call.",
            "Release cannot flip to 'ready' with open blocking owner actions.",
            "Every patient has at least one named reviewer with valid credential.",
            "Roles are stored in a dedicated table and checked server-side."
          ],
          "integrations": [
            "PM management software (Vantaca / CINC / AppFolio / TOPS)",
            "occupancy-software vendor formats (major + regional preparers)",
            "Airtable intake tracker + Drive folder tree",
            "Frontier LLM APIs (provider-portable)"
          ],
          "adrs": [
            "ADR-001",
            "ADR-002",
            "ADR-003",
            "ADR-004",
            "ADR-005",
            "ADR-006",
            "ADR-007",
            "ADR-008"
          ]
        }
      }
    }
  },
  "ddd_coverage": {
    "slug": "340b-compliance-audit-engine",
    "total": 20,
    "passed": 20,
    "pct": 100,
    "checks": [
      {
        "key": "actors",
        "label": "Actors",
        "count": 5,
        "min": 3,
        "ok": true,
        "gate": "domain",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "glossary",
        "label": "Glossary",
        "count": 8,
        "min": 6,
        "ok": true,
        "gate": "domain",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "decisions",
        "label": "Business decisions",
        "count": 5,
        "min": 4,
        "ok": true,
        "gate": "domain",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "events",
        "label": "Domain events",
        "count": 8,
        "min": 6,
        "ok": true,
        "gate": "domain",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "subdomains",
        "label": "Subdomains",
        "count": 12,
        "min": 8,
        "ok": true,
        "gate": "core",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "bcs",
        "label": "Bounded contexts",
        "count": 11,
        "min": 4,
        "ok": true,
        "gate": "boundary",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "ctx_map",
        "label": "Context map",
        "count": 11,
        "min": 3,
        "ok": true,
        "gate": "boundary",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "event_storm",
        "label": "Event storm rows",
        "count": 13,
        "min": 6,
        "ok": true,
        "gate": "boundary",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "aggregates",
        "label": "Aggregates",
        "count": 8,
        "min": 3,
        "ok": true,
        "gate": "invariant",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "invariants",
        "label": "Invariants",
        "count": 9,
        "min": 4,
        "ok": true,
        "gate": "invariant",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "ai_agents",
        "label": "AI agents",
        "count": 3,
        "min": 2,
        "ok": true,
        "gate": "ai-safety",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "use_cases",
        "label": "Use cases",
        "count": 3,
        "min": 3,
        "ok": true,
        "gate": "buildability",
        "unblock": "Not needed — check passes at current counts."
      },
      {
        "key": "evidence_reg",
        "label": "Evidence register",
        "count": 8,
        "min": 5,
        "ok": true,
        "gate": "domain",
        "unblock": "Attach or verify a domain-evidence claim (source + strength)."
      },
      {
        "key": "assumptions",
        "label": "Assumption register",
        "count": 7,
        "min": 4,
        "ok": true,
        "gate": "domain",
        "unblock": "Log and validate a blocking assumption in the evidence register."
      },
      {
        "key": "stress_boundary",
        "label": "Boundary stress tests",
        "count": 5,
        "min": 3,
        "ok": true,
        "gate": "boundary",
        "unblock": "Resolve an unresolved-ownership scenario before wiring boundary evidence."
      },
      {
        "key": "stress_agg",
        "label": "Aggregate stress tests",
        "count": 5,
        "min": 3,
        "ok": true,
        "gate": "invariant",
        "unblock": "Add or verify an aggregate invariant enforcement test."
      },
      {
        "key": "stress_agent",
        "label": "Agent stress tests",
        "count": 3,
        "min": 2,
        "ok": true,
        "gate": "ai-safety",
        "unblock": "Attach an AI-safety guardrail evidence item for the agent."
      },
      {
        "key": "gates_pass",
        "label": "Hard gates passing",
        "count": 7,
        "min": 7,
        "ok": true,
        "unblock": "One or more hard gates are failing — see failing gates below."
      },
      {
        "key": "rubric",
        "label": "Extended rubric pass",
        "count": 1,
        "min": 1,
        "ok": true,
        "gate": "buildability",
        "unblock": "Raise weakest rubric category by attaching evidence for the linked concern."
      },
      {
        "key": "foundry",
        "label": "Foundry package",
        "count": 11,
        "min": 4,
        "ok": true,
        "gate": "buildability",
        "unblock": "Foundry package under-populated — regenerate blueprint via GitHub sync."
      }
    ],
    "failingGates": []
  },
  "architecture": {
    "slug": "340b-compliance-audit-engine",
    "archetypes": [
      "regulated system",
      "CRUD/workflow application",
      "internal operations platform"
    ],
    "archetype_impact": "Per-engagement scope is a global query parameter — every read/write is scoped by engagement + certification case window, not just patient.",
    "personality": [
      "workflow-heavy",
      "cost-sensitive",
      "highly regulated",
      "highly secure"
    ],
    "forces_ranked": [
      {
        "force": "compliance",
        "why": "Regulated verticals gate release; the architecture must prove, not assert, compliance."
      },
      {
        "force": "auditability",
        "why": "Every release decision, every evidence toggle, must be defensible in review."
      },
      {
        "force": "reliability",
        "why": "A broken blueprint is a broken release gate — availability is a product feature."
      },
      {
        "force": "data integrity",
        "why": "Evidence is the product; a corrupted citation is a shipped defect."
      },
      {
        "force": "maintainability",
        "why": "One team maintains dozens of blueprints; the shape must be identical across them."
      }
    ],
    "tradeoffs": [
      "Prioritizing auditability slows raw throughput — accepted; the product IS the audit trail.",
      "Choosing a modular monolith trades independent scaling for a single deploy story — accepted while the team is small.",
      "Using managed Cloud primitives trades some portability for zero ops — accepted; data is portable, runtime is not the moat."
    ],
    "quality_scenarios": [
      {
        "attribute": "Performance (interactive p95)",
        "target": "600 ms on Blueprint detail routes",
        "assumption": "Measured from Cloud edge, warm cache."
      },
      {
        "attribute": "Availability",
        "target": "99.5% (with disclosure-window freeze protection)",
        "assumption": "Rolling 30-day window; excludes announced maintenance."
      },
      {
        "attribute": "RTO",
        "target": "24h"
      },
      {
        "attribute": "RPO",
        "target": "24h (daily backups)"
      },
      {
        "attribute": "Latency (edge function warm)",
        "target": "≤ 800ms p95 excluding upstream AI calls"
      },
      {
        "attribute": "Data durability",
        "target": "11 nines via managed Postgres + storage replication"
      },
      {
        "attribute": "Security",
        "target": "OWASP ASVS L1 baseline"
      },
      {
        "attribute": "Auditability",
        "target": "100% of release decisions + evidence toggles logged with actor + timestamp"
      },
      {
        "attribute": "Maintainability",
        "target": "New blueprint reaches validation-microsite state in ≤ 1 working session"
      },
      {
        "attribute": "Deployment frequency",
        "target": "≥ 5 deploys/week without incident"
      },
      {
        "attribute": "Observability",
        "target": "Every edge function emits correlationId; retries + phases visible in diagnostics drawer"
      },
      {
        "attribute": "Cost envelope",
        "target": "Idle per-blueprint cost ≈ $0; active < $5/month at MVP traffic"
      },
      {
        "attribute": "Scalability",
        "target": "Horizontal by blueprint count; single blueprint sized for < 10 req/s sustained"
      }
    ],
    "options": [
      {
        "style": "simple monolith",
        "fits_when": "Single team, low traffic, no independent scaling concerns.",
        "fits_here": "Matches the per-blueprint scope — one microsite, one schema, one code path.",
        "wrong_here": "Would couple every blueprint into a single deploy — not acceptable at network scale.",
        "complexity": "low",
        "cost": "low",
        "ops_burden": "low",
        "security_impact": "Small surface, single audit boundary.",
        "scaling_path": "Vertical scale only; hits ceiling on team velocity, not compute.",
        "team_fit": "Ideal for one dev; fine at MVP.",
        "recommended": false
      },
      {
        "style": "modular monolith",
        "fits_when": "Multiple bounded contexts but shared deploy lifecycle acceptable.",
        "fits_here": "Each blueprint is a module inside the network shell; shared shell, isolated data.",
        "wrong_here": "Wrong only if a blueprint needs independent SLOs — none currently do.",
        "complexity": "moderate",
        "cost": "low",
        "ops_burden": "low",
        "security_impact": "Single trust boundary; row-level isolation carries the tenancy load.",
        "scaling_path": "Modules become services only when SLOs or teams diverge.",
        "team_fit": "Best fit for a small team maintaining many blueprints.",
        "recommended": true
      },
      {
        "style": "serverless",
        "fits_when": "Bursty, per-request workloads with idle-to-zero cost targets.",
        "fits_here": "Edge functions already handle sync, docs, legal, seed articles, integrity — pay-per-invoke.",
        "wrong_here": "Wrong for long-running orchestrations; IDLE_TIMEOUT already bit us on legal docs.",
        "complexity": "moderate",
        "cost": "low",
        "ops_burden": "moderate",
        "security_impact": "Function-scoped IAM; secrets via managed vault.",
        "scaling_path": "Auto; watch cold-start p95 and per-invocation cost.",
        "team_fit": "Good — team already ships functions weekly.",
        "recommended": false
      },
      {
        "style": "microservices",
        "fits_when": "Multiple teams, divergent SLOs, independent release cadence required.",
        "fits_here": "Nothing here justifies it; single team, single deploy cadence, shared data plane.",
        "wrong_here": "Adds network, discovery, deploy topology, and observability cost with zero product benefit.",
        "complexity": "very high",
        "cost": "high",
        "ops_burden": "high",
        "security_impact": "Bigger attack surface, more inter-service auth to get right.",
        "scaling_path": "Best-in-class if the org can afford it.",
        "team_fit": "Wrong for this team.",
        "recommended": false
      },
      {
        "style": "event-driven",
        "fits_when": "Async fan-out, decoupled producers/consumers, replayable history required.",
        "fits_here": "Only the sync + integrity pipeline is fan-out; keep it as background jobs, not a broker.",
        "wrong_here": "Broker + schema registry + DLQ topology is overkill for current volumes.",
        "complexity": "high",
        "cost": "moderate",
        "ops_burden": "high",
        "security_impact": "Extra ACLs; message-level auth needed.",
        "scaling_path": "Excellent for future audit-log fan-out, revisit at 10x volume.",
        "team_fit": "Team can operate a small in-process queue; not a full broker yet.",
        "recommended": false
      },
      {
        "style": "workflow/orchestration",
        "fits_when": "Long, multi-step, resumable pipelines with human-in-the-loop steps.",
        "fits_here": "Blueprint pipeline (sources → articles → integrity → smoke test) already smells like this.",
        "wrong_here": "Full engine (Temporal/Airflow) is heavy; a typed in-app queue with retries covers today's needs.",
        "complexity": "high",
        "cost": "moderate",
        "ops_burden": "moderate",
        "security_impact": "Central choke point — must be hardened.",
        "scaling_path": "Adopt engine once we cross ~10 concurrent long-running jobs per blueprint.",
        "team_fit": "Would require operator ramp-up.",
        "recommended": false
      }
    ],
    "chosen_style": "modular monolith",
    "chosen_rationale": "Modular monolith with edge functions for bursty AI/generation — one audit boundary, low ops burden, easy per-team ownership.",
    "rejected": [
      {
        "style": "microservices",
        "why_rejected": "Adds network, discovery, deploy topology, and observability cost with zero product benefit."
      },
      {
        "style": "event-driven",
        "why_rejected": "Broker + schema registry + DLQ topology is overkill for current volumes."
      }
    ],
    "target": {
      "overview": "React shell → Lovable Cloud (Postgres + Auth + Storage + Edge Functions). Every blueprint is a module inside the shell; per-vertical differences live in derived DNA, not in separate deploys. Compliance posture: Domain-specific (agency disclosures, attestation signers, retention schedules).",
      "frontend": "Vite + React + TypeScript + Tailwind + shadcn primitives; per-blueprint themed via Design DNA; job queue for background pipelines; URL-persisted filter state on audit + diagnostics.",
      "backend": "Deno-based edge functions per capability. Long generations split into per-item endpoints to stay under IDLE_TIMEOUT.",
      "data": "Managed Postgres with RLS + JSONB for shape drift. Object storage for source files + generated artifacts.",
      "api": "REST-ish RPC over edge functions with typed payloads; correlationId on every call for retry/diagnostics.",
      "authn_authz": "Managed OAuth (Google default). Roles in a dedicated user_roles table + has_role() SECURITY DEFINER function referenced by RLS policies.",
      "integrations": "GitHub (public read for sync + sources), Lovable AI Gateway (all LLM calls), Cloud Storage (artifacts). No third-party CRM/email yet.",
      "background_jobs": "blueprintJobQueue in-app: per-slug concurrency limit, exponential backoff + jitter, cancel + invalidate, retention of last error diagnostics.",
      "object_storage": "Cloud Storage buckets scoped per blueprint slug; signed URLs for artifact download.",
      "notifications": "In-app toasts + audit trail entries. Email/webhook deferred until owners request it.",
      "search": "Postgres FTS on blueprint titles + evidence claims; client-side filter for audit trail. Dedicated index deferred.",
      "analytics": "Lightweight event log in Postgres; dashboard-grade analytics deferred until we have a paying patient.",
      "ai": "not applicable",
      "observability": "correlationId per request, per-phase timings, retry timeline in diagnostics drawer, per-blueprint pipeline status panel, JSON report export.",
      "deployment": "Preview + Production environments; edge functions deploy with the app; Postgres migrations shipped via managed migration tool.",
      "security": "RLS on every public table; roles in user_roles; secrets in managed vault; OWASP ASVS L1 baseline.",
      "dr": "Daily backups; restore drill twice/year."
    },
    "modules": [
      {
        "name": "Blueprint Core",
        "responsibility": "Owns the SeedBusiness catalog, release decisions, evidence register, owner actions.",
        "owned_data": [
          "seed business rows",
          "release_decision",
          "evidence items",
          "owner-action state"
        ],
        "entities": [
          "SeedBusiness",
          "EvidenceItem",
          "OwnerAction",
          "ReleaseDecision"
        ],
        "interfaces": [
          "React store (StoreProvider)",
          "public read via microsite route"
        ],
        "depends_on": [
          "Content Pipeline (for source files + articles)",
          "Cloud auth"
        ],
        "events_produced": [
          "release.decision.changed",
          "evidence.status.changed",
          "owner.action.resolved"
        ],
        "events_consumed": [
          "sync.blueprint.applied",
          "integrity.check.completed"
        ],
        "failure_risks": [
          "Duplicate slug in seed → React key crash (mitigated by dedupe in mergedSeed)",
          "Evidence drift after sync"
        ],
        "scaling": "Bounded by SEED size; irrelevant even at 10x.",
        "future_split_trigger": "Split out Blueprint Core into an independent deployment when its throughput or a distinct scaling profile justifies it; not warranted pre-revenue."
      },
      {
        "name": "Content Pipeline",
        "responsibility": "Fetches GitHub sources, generates docs/seed articles, runs citation integrity, per slug with concurrency + backoff.",
        "owned_data": [
          "blueprint_sources",
          "blueprint_seed_articles",
          "job status per slug",
          "integrity results"
        ],
        "entities": [
          "SourceFile",
          "SeedArticle",
          "IntegrityReport",
          "JobState"
        ],
        "interfaces": [
          "blueprintJobQueue API",
          "edge functions: fetch-blueprint-sources, generate-seed-articles, generate-blueprint-docs"
        ],
        "depends_on": [
          "Cloud edge functions",
          "AI Gateway",
          "GitHub public read"
        ],
        "events_produced": [
          "sources.fetched",
          "articles.generated",
          "integrity.completed",
          "cache.invalidated"
        ],
        "events_consumed": [
          "blueprint.cache.invalidate"
        ],
        "failure_risks": [
          "Edge IDLE_TIMEOUT on long generations (mitigated: per-doc endpoints + retries)",
          "Upstream AI 5xx storms"
        ],
        "scaling": "Concurrency + backoff configurable in UI; scales with edge function limits.",
        "future_split_trigger": "If cross-blueprint queueing coordination is needed, promote to a shared job service."
      },
      {
        "name": "Runtime & Capabilities",
        "responsibility": "Per-blueprint runtime modules — verification, SEO, legal docs, chatbot — with retry + diagnostic history.",
        "owned_data": [
          "capability status per slug",
          "runtime module errors",
          "chatbot threads + FAQ"
        ],
        "entities": [
          "CapabilityStatus",
          "RuntimeError",
          "ChatMessage"
        ],
        "interfaces": [
          "React Runtime tab",
          "edge functions: verify-blueprint, generate-seo-posts, generate-legal-docs/*, blueprint-chat"
        ],
        "depends_on": [
          "Content Pipeline (grounding)",
          "AI Gateway"
        ],
        "events_produced": [
          "capability.status.changed",
          "runtime.error.recorded"
        ],
        "events_consumed": [
          "cache.invalidated"
        ],
        "failure_risks": [
          "AI provider outage",
          "Prompt drift causing ungrounded output"
        ],
        "scaling": "Per-slug; independent of network size.",
        "future_split_trigger": "Split out Runtime & Capabilities into an independent deployment when its throughput or a distinct scaling profile justifies it; not warranted pre-revenue."
      },
      {
        "name": "Sync & Rollback",
        "responsibility": "Daily GitHub sync of blueprint definitions with dry-run, partial-apply, and server-backed rollback of last snapshot.",
        "owned_data": [
          "sync_runs",
          "sync_snapshots per slug",
          "audit_trail"
        ],
        "entities": [
          "SyncRun",
          "SyncDiff",
          "SyncSnapshot",
          "AuditEntry"
        ],
        "interfaces": [
          "/github-sync page",
          "edge functions: github-sync-blueprints, rollback-blueprint-sync"
        ],
        "depends_on": [
          "Blueprint Core",
          "Cloud storage for snapshots"
        ],
        "events_produced": [
          "sync.run.completed",
          "sync.blueprint.applied",
          "sync.blueprint.rolled_back"
        ],
        "events_consumed": [],
        "failure_risks": [
          "Partial apply leaving mixed state (mitigated by per-blueprint snapshots)",
          "Audit trail size growth"
        ],
        "scaling": "Paginate audit trail; snapshot retention window is finite.",
        "future_split_trigger": "Split out Sync & Rollback into an independent deployment when its throughput or a distinct scaling profile justifies it; not warranted pre-revenue."
      },
      {
        "name": "Design & Architecture DNA",
        "responsibility": "Deterministic per-blueprint design + architecture briefs used to gate release readiness.",
        "owned_data": [
          "derived only — no persistence"
        ],
        "entities": [
          "DesignDNA",
          "ArchitectureDNA"
        ],
        "interfaces": [
          "React panels in Business Detail"
        ],
        "depends_on": [
          "Blueprint Core"
        ],
        "events_produced": [],
        "events_consumed": [],
        "failure_risks": [
          "Vertical → profile drift if new verticals are not mapped"
        ],
        "scaling": "Pure functions; free.",
        "future_split_trigger": "Split out Design & Architecture DNA into an independent deployment when its throughput or a distinct scaling profile justifies it; not warranted pre-revenue."
      }
    ],
    "data_architecture": {
      "primary_db": "Managed Postgres (Cloud)",
      "secondary": [
        "Object storage for artifacts + snapshots",
        "Client localStorage for UI state (filters, drawer state) — never for auth"
      ],
      "cache": "React Query + module-level memoization; no dedicated cache service.",
      "search": "Postgres FTS on titles + evidence; consider pg_trgm on slugs.",
      "vector": "not applicable",
      "object_storage": "Per-slug prefixes; lifecycle rules to prune stale sync snapshots.",
      "schema_strategy": "Normalized core + JSONB for evolving shapes (evidence details, capability status).",
      "migrations": "Forward-only migrations reviewed in PR; every CREATE TABLE ships GRANTs + RLS enable + policies in the same migration.",
      "backups": "Managed daily backups with 30-day retention.",
      "retention": "Audit trail retained ≥ 1y; sync snapshots retained 90d; error diagnostics retained 30d.",
      "audit_logs": "audit_trail table + append-only pattern; export CSV from UI.",
      "soft_delete": "Soft-delete evidence via status transition; hard-delete only via owner-initiated purge.",
      "privacy": "Only owner-supplied facts persist; disclosures, attestations, the owner's counsel correspondence handled per vertical policy.",
      "encryption": "TLS 1.2+ in transit; AES-256 at rest via managed storage.",
      "multi_tenancy": "Row-level tenancy keyed on auth.uid() + blueprint slug; RLS policies enforce isolation."
    },
    "api": {
      "style": "REST-ish RPC over edge functions with JSON payloads; typed client wrappers.",
      "public_vs_internal": "Public microsite reads via Postgres RLS-protected queries; internal capability calls via authenticated edge functions.",
      "versioning": "Version via function name suffix (v1, v2) when breaking; additive changes preferred.",
      "rate_limiting": "Per-user + per-slug in edge functions; UI-level concurrency caps for AI calls.",
      "idempotency": "Sync + rollback carry an idempotency key; retries safe.",
      "pagination": "Cursor pagination on audit trail; offset paging tolerated on small lists.",
      "error_format": "{ code, message, correlationId, retryable, details? } — normalized in client.",
      "webhook_security": "HMAC-signed webhooks (deferred until we accept inbound webhooks).",
      "retries": "Exponential backoff + jitter, capped attempts, respect idempotency keys.",
      "contract_testing": "Zod schemas shared between client + edge; smoke test runner exercises each endpoint.",
      "backward_compat": "Additive fields only; deprecations announced in audit trail before removal.",
      "contract_testing_plan": "Intake, source-result, and delivery payload schemas are contract-tested per consumer; the JSON contract between AI layers is schema-pinned and versioned."
    },
    "security": {
      "authn": "Managed OAuth (Google default). Session in httpOnly cookie / managed client storage.",
      "authz": "user_roles table + has_role() SECURITY DEFINER, referenced from RLS policies. Never store roles on profiles.",
      "tenant_isolation": "RLS on every public table; every query filters by auth.uid() or by an explicit owner grant.",
      "secrets": "Managed vault; never in client bundle; edge functions read via runtime env.",
      "encryption": "TLS in transit; AES-256 at rest; column-level encryption only when regulation requires.",
      "session": "Short-lived access tokens + refresh rotation; SSR cookie parity for edge routes.",
      "input_validation": "Zod schemas at the edge boundary; reject on unknown fields.",
      "api_protection": "Rate limits + WAF rules on public endpoints; correlationId logging for abuse forensics.",
      "audit_log": "Every release decision, evidence toggle, sync, and rollback records actor + timestamp + before/after.",
      "admin_access": "Admin actions gated behind role check + two-key confirmation on destructive operations.",
      "supply_chain": "Lockfile pinning + weekly dependency scan; SBOM produced on release.",
      "threat_model": [
        "Prompt injection via ingested source files → sanitize + refuse instructions from ingested content.",
        "Cross-patient read via missing RLS on new table → migration checklist blocks merge.",
        "Rollback abuse to overwrite recent legitimate edits → rollback preview + confirm-typed pattern.",
        "AI cost DOS by repeated regeneration → per-slug rate limits + concurrency cap."
      ],
      "abuse_cases": [
        "Malicious owner uploads privileged content into a public microsite field.",
        "Sync run tampered with to inject a slug that overlaps a real blueprint.",
        "Attacker triggers regeneration loop to drive AI cost."
      ],
      "zero_trust": "Every service call authenticates; no implicit trust between edge functions.",
      "asvs_notes": "OWASP ASVS L1 baseline."
    },
    "reliability": {
      "failure_modes": [
        "Edge function IDLE_TIMEOUT on long AI generations.",
        "Upstream AI provider 5xx / rate limit.",
        "GitHub API rate limit during sync.",
        "Postgres connection saturation during sync fan-out."
      ],
      "graceful_degradation": "Runtime tab modules degrade independently; microsite serves cached last-known-good content when generation fails.",
      "retry_policy": "Exponential backoff + jitter, max 5 attempts, respect Retry-After.",
      "timeouts": "Edge function ≤ 120s wall clock (safety margin under 150s limit); client fetch ≤ 60s per call.",
      "circuit_breaker": "Client-side per-endpoint breaker: after 3 consecutive IDLE_TIMEOUTs, pause 5m and surface to UI.",
      "queueing": "In-app blueprintJobQueue with concurrency limits per slug.",
      "idempotency": "Sync + rollback idempotent via key; generation endpoints idempotent per (slug, doc_key).",
      "dlq": "Failed jobs recorded in error diagnostics; user re-triggers manually (no auto-DLQ needed at current volume).",
      "transactions": "Multi-row writes wrapped in single transaction; audit entry written in the same transaction as the mutation.",
      "dr": "Daily backup + semi-annual restore drill.",
      "incident_response": "correlationId in every log line; on-call runbook per capability module; smoke test replays post-incident.",
      "slos": [
        {
          "name": "Interactive p95",
          "target": "600 ms on blueprint detail"
        },
        {
          "name": "Availability",
          "target": "99.5% (with disclosure-window freeze protection)"
        },
        {
          "name": "Sync success rate",
          "target": "≥ 99% per daily run over rolling 7 days"
        },
        {
          "name": "Generation success rate",
          "target": "≥ 95% per doc across last 7d (excludes provider outages)"
        }
      ]
    },
    "scaling": {
      "mvp_can_stay_simple": [
        "Single Postgres, single region.",
        "No dedicated search or vector index.",
        "In-app job queue; no message broker."
      ],
      "modular_now": [
        "Content Pipeline is already isolated behind blueprintJobQueue — future extraction is a 1-day job.",
        "Runtime capabilities are one function per module — swap in isolation."
      ],
      "deferrable": [
        "Workflow engine (Temporal/Airflow).",
        "Vector DB / RAG.",
        "Multi-region replication.",
        "Feature flag service (env-based toggle covers MVP)."
      ],
      "breaks_first": "Edge function IDLE_TIMEOUT under multi-doc generation — already addressed by per-doc endpoints; watch for regression.",
      "db_path": "Vertical scale → read replica → partition by patient if a single patient dominates load.",
      "jobs_path": "In-app queue → dedicated worker → workflow engine, gated by concurrency + resumability need.",
      "cache_path": "React Query only → HTTP cache headers → CDN edge cache for microsite content.",
      "search_path": "Postgres FTS → pg_trgm → dedicated search only when p95 breaches SLO.",
      "files_path": "Managed object storage → CDN → per-region cache if traffic warrants.",
      "api_path": "Vertical edge function scale → per-capability autoscaling → extract hot module to its own service.",
      "multi_region": "Not planned; introduce only on customer contract with residency requirement.",
      "cost_control": "Per-blueprint AI occupancy, concurrency cap, smoke-test cache; monthly cost review with per-blueprint attribution."
    },
    "ai": {
      "provider": "Frontier LLM via API with provider-agnostic prompt contracts; a second vendor is configured for failover so a released deliverable never depends on a single model.",
      "prompt_mgmt": "Extraction, drafting, and matrix prompts are held in versioned files with eval-gated deploys and one-step rollback; prompt changes require diff review.",
      "rag": "A versioned, jurisdiction-scoped rule certification for owner / residential rental 340B compliance is retrieved with source-scoped filters; drafting is grounded and citation-anchored to the source text, never free-form generation.",
      "vector": "Not warranted pre-revenue — the rule certification is small and structured, so section/keyword lookups suffice until a larger corpus justifies similarity search.",
      "embeddings": "Deferred with the vector store; rule-certification keys are structured (element, source, subsection), not semantic.",
      "eval": "A gold set of specialist-released files measures element-extraction F1 and completeness-gate agreement per model release; accuracy vs specialist labels is reviewed on a fixed cadence.",
      "hitl": "Specialist release is never automated; a domain expert signs off on the exception queue, with sampling QA on a fraction of outputs and expert red-team on the first releases.",
      "guardrails": "Field-locked templates, source-tie reconciliation, and completeness rules mean a draft missing a required field emits a MISSING_ELEMENT exception rather than inventing content.",
      "prompt_injection": "Source documents are treated as data, never instructions; the red-team suite includes injected-instruction files disguised as legitimate inputs.",
      "leakage": "Client and subject identifiers are scoped per case; retrieval is scoped per client; provider training-use is disabled; there is no cross-client corpus.",
      "fallback": "A manual specialist workbench runbook plus the second LLM vendor keep production moving if the primary model is unavailable.",
      "latency_cost": "Inference cost per deliverable is bounded at launch and trends down with volume; the standard SLA leaves generous headroom over model latency.",
      "memory": "Agents are stateless per case; durable knowledge lives in the versioned rule certification and SOP library, not in model memory.",
      "tool_permissions": "The prompt runner has no tool access beyond returning JSON; search ordering, document assembly, and delivery are deterministic code.",
      "auditability": "Every prompt+output pair is logged to the per-case audit trail with version tags alongside the specialist release record.",
      "citation": "Every drafted element carries the source provision it satisfies, and every matrix entry carries the search or record it came from."
    },
    "devops": {
      "environments": [
        "Preview (per branch)",
        "Production"
      ],
      "cicd": "Lovable build pipeline; deploys on merge; edge functions ship atomically with the app.",
      "iac": "Cloud managed; migrations + config in-repo.",
      "secrets": "Managed vault; separate values per environment.",
      "preview_envs": "Automatic per branch; seeded with anonymized fixtures.",
      "migrations": "Forward-only; migrations reviewed for GRANT + RLS + policies; every table gated by the migration checklist.",
      "rollback": "App: redeploy previous build. Data: server-backed rollback per blueprint via rollback-blueprint-sync.",
      "release_style": "Continuous deploy with feature flags; canary only when a change touches shared shell.",
      "feature_flags": "Env-based booleans at MVP; consider a flag service when we have > 20 flags in flight.",
      "monitoring": "Cloud platform metrics + per-function logs + client error reporting.",
      "alerting": "SLO burn-rate alerts + IDLE_TIMEOUT rate alert + AI cost anomaly alert.",
      "logs": "Structured JSON with correlationId; retained per platform defaults.",
      "error_tracking": "Client-side error capture wired to console + in-app diagnostics drawer.",
      "uptime": "Synthetic checks on microsite + shell login every 5 minutes.",
      "cost_monitoring": "Per-blueprint cost view; alert on 3x baseline over 24h."
    },
    "testing": {
      "unit": "Vitest for pure derivations (DNA, business helpers).",
      "integration": "Edge function contract tests with recorded fixtures.",
      "contract": "Zod schemas shared client + edge; smoke test runner as continuous contract check.",
      "e2e": "Playwright against localhost preview for critical flows (sign in, evidence toggle, sync apply).",
      "security": "Weekly dependency scan; RLS policy audit script; abuse-case checklist per release.",
      "a11y": "Axe checks + keyboard-only smoke on shell components; WCAG 2.2 AA target.",
      "load": "k6 scenarios against edge functions before enabling a new capability network-wide.",
      "chaos": "Manual fault injection on AI provider (simulate 500s) during release rehearsal.",
      "migration": "Every migration runs in preview + dry-run on prod snapshot before apply.",
      "backup_restore": "Semi-annual restore drill.",
      "ai_eval": "not applicable",
      "test_data": "Deterministic fixtures per vertical; no real PHI/PII ever in fixtures."
    },
    "observability": {
      "logs": "Structured JSON with correlationId, phase, attempt, doc_key, slug.",
      "metrics": "Per-endpoint latency, error rate, retry count, AI token spend.",
      "traces": "Cross-function trace via correlationId propagation.",
      "audit_events": "Release decision, evidence toggle, sync, rollback, cache invalidation.",
      "business_events": "Blueprint promoted to ready, first microsite view, first customer-visible export.",
      "error_tracking": "In-app diagnostics drawer + persistent per-slug error history.",
      "security_monitoring": "Failed auth + rate-limit breach + admin action logs.",
      "cost_monitoring": "Per-blueprint + per-capability cost attribution.",
      "dashboards": [
        "SLO burn",
        "AI cost per blueprint",
        "Sync success rate",
        "Generation success rate"
      ],
      "alert_thresholds": [
        "IDLE_TIMEOUT rate > 3/day for one blueprint.",
        "Sync run failure > 1 in rolling 7 days.",
        "AI cost > 3x rolling 7-day baseline over 24h.",
        "p95 breach on Blueprint detail > 800ms for 15 min."
      ],
      "triage": "correlationId → diagnostics drawer → retry timeline → JSON report export → runbook link."
    },
    "cost": {
      "drivers": [
        {
          "name": "AI generation",
          "note": "Dominant driver; capped by concurrency + per-slug occupancy."
        },
        {
          "name": "Edge function invocations",
          "note": "Bursty at sync + generation; idle-to-zero otherwise."
        },
        {
          "name": "Managed Postgres",
          "note": "Small; scales with audit trail retention."
        },
        {
          "name": "Object storage",
          "note": "Snapshots + artifacts; lifecycle rules prevent growth."
        },
        {
          "name": "Bandwidth",
          "note": "Low; static microsite content."
        }
      ],
      "likely_traps": [
        "Regeneration loops on failure (mitigated by circuit breaker).",
        "Audit trail unbounded growth (mitigated by retention policy).",
        "Storing large HTML snapshots per sync (mitigated by delta snapshots)."
      ],
      "controls": [
        "Per-blueprint AI occupancy with hard cap.",
        "Smoke-test result caching in localStorage.",
        "Concurrency cap in blueprintJobQueue.",
        "Retention policy on audit + diagnostics."
      ]
    },
    "multi_tenancy": {
      "model": "Row-level tenancy: one shared Postgres, tenant scope by auth.uid() + blueprint slug.",
      "isolation": "RLS policies on every public table; policies reference has_role() where role checks are needed.",
      "tenant_aware_authz": "Every query filters by auth.uid(); admin overrides go through explicit role check + audit entry.",
      "tenant_config": "Per-slug config stored as JSONB on the blueprint row; no per-tenant deploy.",
      "branding": "Per-blueprint Design DNA drives theme; no runtime branding upload at MVP.",
      "tenant_export": "Owner can export evidence + audit trail as JSON/CSV from the UI.",
      "tenant_deletion": "Owner-initiated purge cascades across blueprint rows + storage prefix; soft-delete window of 30 days.",
      "tenant_audit": "Per-slug audit trail table view with actor + timestamp on every mutation.",
      "noisy_neighbor": "Per-slug concurrency cap in blueprintJobQueue; per-slug AI occupancy.",
      "tenant_rate_limits": "Edge functions apply per-slug + per-user rate limits.",
      "billing": "Not billed at MVP; per-blueprint cost attribution feeds the future billing model.",
      "why_this_fits": "Team size and blueprint scale don't justify schema/db-per-tenant; RLS covers the isolation requirement with negligible ops burden."
    },
    "privacy_compliance": {
      "data_classification": "Owner-supplied facts and evidence citations are the sensitive classes; disclosures, attestations, the owner's counsel correspondence per vertical.",
      "minimization": "Only owner-supplied facts persist; no third-party enrichment; no PII scraping.",
      "consent": "Consent captured at intake for owner-supplied contact info; microsite visitors get standard cookie/consent banner where required.",
      "access_logs": "Every admin + edge function invocation logged with correlationId + actor.",
      "audit_trails": "Immutable append-only audit_trail table; export from UI.",
      "retention": "Audit ≥ 1y; sync snapshots 90d; error diagnostics 30d; artifacts per lifecycle rule.",
      "legal_hold": "Deferred until a matter requires it.",
      "right_to_delete": "Owner-initiated purge honored within 30 days; downstream copies pruned by lifecycle rules.",
      "right_to_export": "JSON + CSV export for evidence, audit trail, and generated artifacts.",
      "sensitive_handling": "No PHI/PII in prompts; owner-supplied facts only; secrets in managed vault.",
      "boundaries": "Domain-specific (agency disclosures, attestation signers, retention schedules)",
      "residency": "Single region at MVP; residency contract triggers per-patient residency planning.",
      "vendor_risk": "Lovable Cloud + AI Gateway are the only critical vendors; both reviewed for security posture.",
      "breach_response": "correlationId + audit trail enables scope determination; disclosure per compliance policy within statutory window.",
      "admin_controls": "Admin actions gated by role check + two-key confirm for destructive operations; every admin session logged.",
      "evidence_collection": "Access reviews, change management, restore drills produce artifacts filed into the evidence pipeline."
    },
    "frontend": {
      "framework": "React 18 + Vite + TypeScript.",
      "rendering": "SPA with per-route code-split; microsite routes prerender-friendly.",
      "routing": "react-router-dom v6 with URL-persisted filter/drawer state.",
      "state": "React context + useSyncExternalStore for the job queue; localStorage only for UI state, never for auth.",
      "server_state": "@tanstack/react-query for cache + retries.",
      "forms": "Controlled components + Zod validation on submit; RHF only where forms grow.",
      "error_handling": "Error boundary at shell + per-panel skeletons + retry affordances.",
      "components": "shadcn primitives + per-blueprint themed panels; deterministic Design DNA drives look.",
      "design_system": "Tailwind semantic tokens (index.css); no hardcoded color utilities in components.",
      "auth_ui": "Managed OAuth callback via Cloud client; session hydration before protected routes render.",
      "authz_aware_ui": "UI hides actions the current role cannot perform; server-side check is authoritative.",
      "a11y": "WCAG 2.2 AA target; visible focus rings; keyboard shortcuts in diagnostics drawer.",
      "i18n": "Copy budgets assume +35% expansion for DE/FR; Intl APIs for dates/currencies.",
      "performance": "Route-level code split; lazy-load Runtime tab; memoize DNA derivations.",
      "bundling": "Vite defaults; per-route lazy imports for heavy panels.",
      "testing": "Vitest for unit; Playwright for critical flows.",
      "offline": "Not required; last-known-good served from React Query cache.",
      "realtime": "Not required at MVP; audit trail is polled on interaction."
    },
    "backend": {
      "framework": "Deno-based edge functions on Lovable Cloud, one function per capability.",
      "layering": "Handler → validator (Zod) → service → repository → Postgres.",
      "domain": "Blueprint, Evidence, OwnerAction, SyncRun, RuntimeCapability, ChatMessage.",
      "services": "Pure functions kept out of edge boundary; shared logic imported from a common module.",
      "repositories": "Thin Postgres wrappers; RLS enforces patient scope.",
      "validation": "Zod at the edge boundary; reject unknown fields.",
      "authorization": "has_role() SECURITY DEFINER in Postgres; edge function also asserts role for defense in depth.",
      "jobs": "In-app blueprintJobQueue on the client for user-triggered pipelines; server-side cron only for daily sync.",
      "events": "Domain events emitted to audit_trail; no external broker.",
      "files": "Signed URLs from Cloud Storage; virus scan on upload (deferred until user uploads exist).",
      "email_sms": "Deferred; owner-configured inbox required before enabling outbound mail.",
      "scheduled": "Daily GitHub sync via scheduled function; retention prune weekly.",
      "errors": "Normalized error envelope { code, message, correlationId, retryable, details? }.",
      "logging": "Structured JSON logs with correlationId, phase, attempt, slug.",
      "config": "Env-based; secrets from managed vault.",
      "di": "Not required at current size; explicit imports.",
      "testing": "Contract tests per function with recorded fixtures + smoke-test runner."
    },
    "diagrams": {
      "context_mermaid": "flowchart LR\n  Owner([Blueprint Owner]) --> Shell[Network Shell]\n  Reviewer([Reviewer]) --> Shell\n  Public([Public Visitor]) --> Micro[Public Microsite 340b-compliance-audit-engine]\n  Shell --> Cloud[(Lovable Cloud: DB + Auth + Storage + Edge)]\n  Cloud --> AI[[AI Gateway]]\n  Cloud --> GH[[GitHub API]]\n  Micro --> Cloud",
      "container_mermaid": "flowchart TB\n  subgraph Client\n    UI[React Shell + Blueprint Detail]\n    Queue[blueprintJobQueue]\n  end\n  subgraph Cloud[Lovable Cloud]\n    DB[(Postgres + RLS)]\n    Store[(Object Storage)]\n    subgraph Edge[Edge Functions]\n      Sync[github-sync-blueprints]\n      Roll[rollback-blueprint-sync]\n      Src[fetch-blueprint-sources]\n      Seed[generate-seed-articles]\n      Docs[generate-blueprint-docs]\n      Legal[generate-legal-docs/*]\n      Verify[verify-blueprint]\n      SEO[generate-seo-posts]\n      Chat[blueprint-chat]\n    end\n  end\n  UI --> DB\n  Queue --> Src\n  Queue --> Seed\n  UI --> Docs\n  UI --> Legal\n  UI --> Verify\n  UI --> SEO\n  UI --> Chat\n  UI --> Sync\n  UI --> Roll\n  Seed --> AI[[AI Gateway]]\n  Docs --> AI\n  Legal --> AI\n  Chat --> AI\n  Src --> GH[[GitHub]]",
      "data_flow_mermaid": "flowchart LR\n  A[Owner edits Evidence] --> B[Store: evidence.custom]\n  B --> C{Release Gate}\n  C -- ready --> D[Business marked Ready]\n  C -- blocker --> E[Owner Actions queue]\n  F[GitHub Sync] --> G[Diff + Snapshot]\n  G --> H[(Postgres)]\n  H --> I[Audit trail]\n  H --> J[React store]",
      "auth_flow_mermaid": "sequenceDiagram\n  participant U as User\n  participant UI as Network Shell\n  participant Auth as Cloud Auth\n  participant API as Edge Function\n  participant DB as Postgres+RLS\n  U->>UI: sign in\n  UI->>Auth: OAuth (Google)\n  Auth-->>UI: session (JWT)\n  UI->>API: call with JWT\n  API->>DB: query as auth.uid()\n  DB-->>API: rows filtered by RLS\n  API-->>UI: response",
      "authz_flow_mermaid": "flowchart LR\n  Req[Request w/ JWT] --> Fn[Edge Function]\n  Fn --> Role[has_role user_id, role]\n  Role --> DB[(user_roles + RLS policies)]\n  DB -- allow --> Ok[Return rows]\n  DB -- deny --> Err[403 + audit entry]",
      "deployment_mermaid": "flowchart LR\n  Dev[Developer] --> Repo[Git]\n  Repo --> CI[Lovable Build]\n  CI --> Preview[Preview Env]\n  CI --> Prod[Production]\n  Prod --> Cloud[(Lovable Cloud)]\n  Prod --> CDN[[Edge CDN]]",
      "background_job_mermaid": "flowchart LR\n  UI[Blueprint Detail] --> Enq[blueprintJobQueue.enqueue]\n  Enq --> Slot{Concurrency slot?}\n  Slot -- yes --> Run[Run job]\n  Slot -- no --> Queued[queued]\n  Run -->|success| Done[Persist result + emit event]\n  Run -->|error| Back[Exponential backoff + jitter]\n  Back -->|attempts left| Run\n  Back -->|exhausted| Fail[Record diagnostic + expose retry button]",
      "event_flow_mermaid": "flowchart LR\n  Sync[sync.blueprint.applied] --> Core[Blueprint Core]\n  Integ[integrity.completed] --> UI\n  CacheInv[cache.invalidated] --> Pipe[Content Pipeline]\n  Pipe --> Sources[sources.fetched]\n  Sources --> Articles[articles.generated]\n  Articles --> Integ",
      "failure_flow_mermaid": "flowchart LR\n  Call[Edge Function call] --> Timeout{Timeout / 5xx?}\n  Timeout -- no --> Ok[Success]\n  Timeout -- yes --> Retry[Backoff + retry]\n  Retry --> Cap{Attempts cap?}\n  Cap -- no --> Call\n  Cap -- yes --> Breaker[Open circuit]\n  Breaker --> Cache[Serve last-known-good]\n  Breaker --> Owner[Surface diagnostic + owner action]",
      "multi_tenant_flow_mermaid": "flowchart LR\n  Owner1([Owner A]) --> UI\n  Owner2([Owner B]) --> UI\n  UI --> API[Edge Function w/ JWT]\n  API --> Policy{RLS: auth.uid + slug scope}\n  Policy -- match --> Rows[Owner-scoped rows]\n  Policy -- no match --> Deny[403]",
      "ai_flow_mermaid": "graph LR; SRC[Source documents as DATA]-->EX[Extract + normalize]-->SR[Order source searches]-->MTX[Build matrix]-->DR[Draft locked-field elements]-->GT[Deterministic completeness gates]-->SP[Specialist release]-->DL[Deliver]; GT-.exception.->SP; SP-.high-risk.->EXP[Expert review]"
    },
    "adrs": [
      {
        "id": "ADR-001",
        "decision": "Adopt modular monolith as the network-wide architecture style",
        "context": "Small team maintaining many blueprints with shared shell, evidence discipline, and per-vertical trust variation.",
        "options": [
          "simple monolith",
          "modular monolith",
          "microservices",
          "serverless-only",
          "hybrid"
        ],
        "chosen": "modular monolith",
        "why": "Preserves a single audit boundary and deploy cadence while allowing edge functions for burst workloads.",
        "consequences": [
          "Shared deploy lifecycle across blueprints",
          "Row-level patient isolation carries the security load"
        ],
        "risks": [
          "A rogue blueprint can regress network shell performance"
        ],
        "reversal": "Extract a module to its own deploy only when its SLO diverges from the network shell.",
        "revisit_when": "A blueprint acquires a divergent SLO, a second team joins, or the shell deploy time exceeds 10 minutes."
      },
      {
        "id": "ADR-002",
        "decision": "Managed Postgres as the sole primary datastore",
        "context": "All entities are relational (blueprints, evidence, sync runs, articles, audit).",
        "options": [
          "Postgres",
          "Postgres + DocumentDB",
          "Postgres + vector DB",
          "Firestore"
        ],
        "chosen": "Postgres (Cloud managed) with JSONB for semi-structured fields",
        "why": "Relational integrity + row-level security satisfies audit, tenancy, and reporting; JSONB absorbs shape drift.",
        "consequences": [
          "RLS policies are the primary tenancy control",
          "Full-text search via Postgres FTS until it stops scaling"
        ],
        "risks": [
          "Complex joins under growth"
        ],
        "reversal": "Introduce a read-replica or a dedicated search index only when p95 breaches SLO.",
        "revisit_when": "FTS p95 > SLO for 2 consecutive weeks, or a genuine RAG surface appears."
      },
      {
        "id": "ADR-003",
        "decision": "Per-document edge functions for long-running AI generation",
        "context": "IDLE_TIMEOUT (150s) on monolithic legal-docs generator forced this split.",
        "options": [
          "Single long function",
          "Chunked per-doc functions",
          "Background job with polling"
        ],
        "chosen": "Per-document endpoints with client-side fan-out + retries",
        "why": "Keeps each invocation under the timeout, isolates failures, enables partial success reporting.",
        "consequences": [
          "More endpoints to maintain",
          "Client must own orchestration"
        ],
        "risks": [
          "Client back-pressure if fan-out is too wide"
        ],
        "reversal": "Move to a real workflow engine when we cross ~10 concurrent long jobs per blueprint.",
        "revisit_when": "Concurrent long-running jobs > 10 per blueprint, or client-side orchestration becomes buggy."
      },
      {
        "id": "ADR-004",
        "decision": "Evidence-first release gate",
        "context": "Vertical compliance posture: Domain-specific (agency disclosures, attestation signers, retention schedules).",
        "options": [
          "Owner-declared ready",
          "Auto-ready via checklist",
          "Evidence-gated ready"
        ],
        "chosen": "Evidence-gated ready — release requires resolved owner actions + verified evidence",
        "why": "Regulated verticals cannot ship on self-declaration; evidence provides defensibility.",
        "consequences": [
          "Slower path to ready",
          "Higher confidence at ready"
        ],
        "risks": [
          "Owners abandon incomplete blueprints"
        ],
        "reversal": "Introduce a 'ready-with-caveats' state only if the network stalls on this gate.",
        "revisit_when": "> 30% of blueprints stuck in owner-action state for > 30 days."
      },
      {
        "id": "ADR-005",
        "decision": "Defer AI adoption until a specific evidence-generation need arises",
        "context": "AI is powerful but adds cost, latency, and auditability burden.",
        "options": [
          "No AI",
          "Grounded AI only",
          "Agentic AI"
        ],
        "chosen": "No AI in this vertical",
        "why": "Vertical does not currently justify AI-shaped complexity.",
        "consequences": [
          "No prompt catalog to maintain"
        ],
        "risks": [],
        "reversal": "Introduce AI only for a scoped generation task.",
        "revisit_when": "A specific generation task appears with clear source grounding."
      },
      {
        "id": "ADR-006",
        "decision": "Managed OAuth (Google) with roles in a dedicated user_roles table",
        "context": "Storing roles on the profile row invites privilege-escalation bugs; RLS policies must reference a stable role source.",
        "options": [
          "Roles on profiles",
          "user_roles + has_role() SECURITY DEFINER",
          "External IdP with JIT claims"
        ],
        "chosen": "user_roles table + has_role() SECURITY DEFINER, referenced by RLS",
        "why": "Prevents recursive RLS, isolates authz decisions, satisfies audit review.",
        "consequences": [
          "One extra join in policies",
          "Explicit role grants required"
        ],
        "risks": [
          "Role drift if grants are not audited"
        ],
        "reversal": "Swap SECURITY DEFINER function for an IdP claim without changing policies.",
        "revisit_when": "Enterprise SSO / SAML contract signed, or role count exceeds ~10."
      },
      {
        "id": "ADR-007",
        "decision": "Single-patient per blueprint slug with row-level isolation",
        "context": "Blueprints share infra but must never cross-read evidence, sync history, or generated artifacts.",
        "options": [
          "Shared DB + RLS",
          "Schema-per-patient",
          "DB-per-patient"
        ],
        "chosen": "Shared DB + RLS keyed on auth.uid() and blueprint slug",
        "why": "Simplest operable model at current scale; migration cost stays near zero.",
        "consequences": [
          "RLS is load-bearing security"
        ],
        "risks": [
          "A missing policy = a leak"
        ],
        "reversal": "Extract a specific patient to its own schema when contract requires it.",
        "revisit_when": "First enterprise customer with a residency or dedicated-DB clause."
      }
    ],
    "roadmap": [
      {
        "phase": "MVP",
        "build": [
          "Network shell + Blueprint Core module",
          "Content Pipeline with concurrency + backoff",
          "Design + Architecture DNA per blueprint",
          "Sync + rollback + audit trail"
        ],
        "avoid": [
          "Any per-blueprint deploy pipeline",
          "Message brokers",
          "Vector DBs",
          "Multi-region"
        ],
        "defer": [
          "A workflow engine",
          "Full-text search infra",
          "Dedicated CDN rules"
        ],
        "monitor": [
          "Edge function IDLE_TIMEOUT rate",
          "AI cost per generation",
          "Duplicate-slug regressions"
        ],
        "triggers_to_change": [
          "p95 breach on Blueprint detail > 800ms",
          "≥ 3 IDLE_TIMEOUTs/day sustained"
        ],
        "acceptable_debt": [
          "Client-owned job orchestration",
          "localStorage-backed UI state"
        ],
        "dangerous_debt": [
          "Missing RLS on any public table",
          "Ungrounded AI in customer-visible surfaces"
        ]
      },
      {
        "phase": "Stabilization",
        "build": [
          "Automated smoke test per blueprint on cache invalidation",
          "Per-slug retention + audit trail export",
          "Contract tests for every edge function"
        ],
        "avoid": [
          "Premature module extraction"
        ],
        "defer": [
          "Multi-patient admin console"
        ],
        "monitor": [
          "SLO burn rate",
          "Cost per blueprint per week"
        ],
        "triggers_to_change": [
          "A single blueprint accounts for > 30% of AI spend"
        ],
        "acceptable_debt": [
          "Manual runbook execution for rare failures"
        ],
        "dangerous_debt": [
          "Untested rollback path",
          "Backups without a restore drill"
        ]
      },
      {
        "phase": "Growth",
        "build": [
          "Optional workflow engine adapter behind the current queue interface",
          "Read replica for Postgres if analytics queries interfere",
          "Feature flags per capability module"
        ],
        "avoid": [
          "Splitting Blueprint Core into services without SLO justification"
        ],
        "defer": [
          "Real-time collaboration"
        ],
        "monitor": [
          "Fan-out concurrency vs edge function limits"
        ],
        "triggers_to_change": [
          "> 10 concurrent long jobs per blueprint",
          "New team joins with independent release cadence"
        ],
        "acceptable_debt": [
          "Env-based feature flags"
        ],
        "dangerous_debt": [
          "Skipping migration reviews",
          "Unaudited role grants"
        ]
      },
      {
        "phase": "Scale",
        "build": [
          "Extract Content Pipeline to a dedicated service if it dominates deploys",
          "Search index (Postgres FTS → dedicated) once FTS p95 breaches SLO"
        ],
        "avoid": [
          "Microservices per blueprint"
        ],
        "defer": [
          "Multi-region until a customer contract requires it"
        ],
        "monitor": [
          "DB CPU + IO under peak",
          "Search p95"
        ],
        "triggers_to_change": [
          "Regional compliance contract signed"
        ],
        "acceptable_debt": [
          "Single-region deployment"
        ],
        "dangerous_debt": [
          "Unbounded audit trail growth",
          "Missing DR drill evidence"
        ]
      },
      {
        "phase": "Enterprise/Compliance",
        "build": [
          "Formal SOC 2 evidence pipeline (access reviews, change management)",
          "Patient-scoped encryption keys where regulation requires",
          "DR drill quarterly with restore proof"
        ],
        "avoid": [
          "Custom compliance frameworks; ride managed platform attestations"
        ],
        "defer": [
          "FedRAMP unless a customer commits"
        ],
        "monitor": [
          "Access review completion",
          "Restore-test success rate"
        ],
        "triggers_to_change": [
          "Signed contract with SOC 2 clause",
          "PHI/PII scope change"
        ],
        "acceptable_debt": [
          "Manual quarterly access review with checklist"
        ],
        "dangerous_debt": [
          "Ad-hoc admin access without approval trail"
        ]
      }
    ],
    "anti_overengineering": {
      "flagged": [
        {
          "item": "Introducing Kubernetes",
          "why": "Team size + workload shape don't justify it.",
          "simpler": "Managed Cloud primitives."
        },
        {
          "item": "Adopting microservices",
          "why": "Single deploy cadence + shared audit boundary.",
          "simpler": "Modular monolith with edge functions."
        },
        {
          "item": "Adopting a vector DB",
          "why": "Sources are small + structured; deterministic retrieval works.",
          "simpler": "Direct source fetch + Postgres FTS."
        },
        {
          "item": "Adopting event sourcing",
          "why": "Audit trail table already provides the needed reconstructibility.",
          "simpler": "Append-only audit_trail + snapshots."
        },
        {
          "item": "Multi-region from day one",
          "why": "No customer contract requires it.",
          "simpler": "Single region + documented DR plan."
        },
        {
          "item": "Custom workflow engine",
          "why": "In-app queue covers current concurrency needs.",
          "simpler": "blueprintJobQueue with backoff."
        },
        {
          "item": "Premature message queue",
          "why": "In-app queue + audit trail cover the fan-out cases.",
          "simpler": "Keep blueprintJobQueue; revisit at 10x volume."
        },
        {
          "item": "Custom auth",
          "why": "Managed OAuth + user_roles cover the model.",
          "simpler": "Cloud Auth + user_roles table."
        },
        {
          "item": "Premature caching layer",
          "why": "React Query covers the read-heavy paths.",
          "simpler": "React Query + HTTP cache headers."
        },
        {
          "item": "Data warehouse",
          "why": "No analytics contract; Postgres analytics queries suffice.",
          "simpler": "Read replica if the primary is hurt."
        }
      ]
    },
    "risks": [
      {
        "risk": "Edge function IDLE_TIMEOUT on long generations",
        "likelihood": "moderate",
        "impact": "high",
        "mitigation": "Per-document endpoints + client-side retries with exponential backoff.",
        "detection": "Smoke test runner + diagnostics drawer flags IDLE_TIMEOUT.",
        "owner": "engineering",
        "escalation": "Sustained > 3/day for one blueprint → open incident.",
        "fallback": "Fall back to last-known-good cached artifact; pause auto-generation for the affected blueprint.",
        "category": "technical"
      },
      {
        "risk": "Duplicate slugs in SEED causing UI regressions",
        "likelihood": "moderate",
        "impact": "moderate",
        "mitigation": "mergedSeed dedupes by slug; add lint on SEED at build time.",
        "detection": "React duplicate-key warning; per-slug uniqueness assertion in tests.",
        "owner": "engineering",
        "escalation": "Ship-block if reproduced on main.",
        "fallback": "Runtime dedupe in mergedSeed keeps first occurrence.",
        "category": "technical"
      },
      {
        "risk": "Ungrounded AI output shipped to microsite",
        "likelihood": "low",
        "impact": "high",
        "mitigation": "Citation-first prompts; integrity check gates Seed Articles view.",
        "detection": "Integrity report failing count > 0 blocks display.",
        "owner": "engineering",
        "escalation": "Any customer-visible ungrounded claim → rollback the blueprint.",
        "fallback": "Auto-hide the article + surface owner action to regenerate with stricter prompt.",
        "category": "product"
      },
      {
        "risk": "Cross-patient data leak via missing RLS on new table",
        "likelihood": "low",
        "impact": "critical",
        "mitigation": "Every CREATE TABLE ships with GRANT + ENABLE RLS + policies in the same migration.",
        "detection": "Security scanner + migration checklist.",
        "owner": "engineering",
        "escalation": "Immediate lockdown + audit.",
        "fallback": "Revoke Data API grants on affected table; restore from PITR if data was modified.",
        "category": "security"
      },
      {
        "risk": "AI cost runaway on a single blueprint",
        "likelihood": "moderate",
        "impact": "moderate",
        "mitigation": "Per-slug rate limits + smoke-test cache + concurrency cap in UI.",
        "detection": "Cost monitoring dashboard; per-blueprint spend alert at 3x baseline.",
        "owner": "SRE",
        "escalation": "Auto-pause generation; require manual re-enable.",
        "fallback": "Disable AI for the offending blueprint via feature flag; serve last-known-good.",
        "category": "cost"
      },
      {
        "risk": "AI provider outage or model deprecation",
        "likelihood": "moderate",
        "impact": "moderate",
        "mitigation": "Per-capability fallback model + retry with backoff; abstract via Lovable AI Gateway.",
        "detection": "Elevated 5xx or empty completions; smoke test failing across blueprints.",
        "owner": "engineering",
        "escalation": "Sustained > 30 min → switch fallback model; notify owners.",
        "fallback": "Serve cached artifacts + disable AI-only capabilities until restored.",
        "category": "vendor"
      },
      {
        "risk": "Compliance evidence gap during audit",
        "likelihood": "low",
        "impact": "high",
        "mitigation": "Evidence-first release gate + audit trail export from UI.",
        "detection": "Missing audit entries surfaced in periodic reconciliation report.",
        "owner": "legal",
        "escalation": "Covered entity counsel-visible gap → incident + disclosure per policy.",
        "fallback": "Freeze affected blueprint's release state; produce backfill evidence certification.",
        "category": "compliance"
      },
      {
        "risk": "Solo/small-team key-person dependency",
        "likelihood": "moderate",
        "impact": "high",
        "mitigation": "Deterministic DNA modules keep decisions in code, not in one head; runbooks per capability.",
        "detection": "Bus-factor review each quarter.",
        "owner": "owner",
        "escalation": "> 1 critical path with no backup → hire or contract.",
        "fallback": "Freeze non-critical changes; document current state before further work.",
        "category": "team"
      },
      {
        "risk": "Audit trail gaps on release decisions",
        "likelihood": "low",
        "impact": "critical",
        "mitigation": "Every mutation writes audit entry in the same transaction.",
        "detection": "Audit trail row count vs mutation count reconciliation.",
        "owner": "engineering",
        "escalation": "Covered entity counsel-visible gap → incident + disclosure.",
        "fallback": "Reconstruct from Postgres WAL + application logs; disclose per compliance policy.",
        "category": "compliance"
      }
    ],
    "rules": [
      "Keep business logic out of UI components — derivations live in lib/*, panels only render.",
      "Do not introduce a new service without a clear owner and a scaling reason.",
      "All external integrations must have retries, timeouts, and failure handling.",
      "All sensitive actions must be auditable in the same transaction that performs them.",
      "All background jobs must be idempotent.",
      "All APIs must return the normalized error envelope.",
      "All patient-scoped queries must enforce patient isolation via RLS — never trust the client.",
      "All expensive AI calls must be logged, capped, and observable.",
      "All schema changes must be reversible or safely migratable — no destructive drops without a rollout plan.",
      "All critical workflows must have observability: correlationId, phase timings, retry timeline.",
      "Every public table ships with GRANT + ENABLE RLS + policies in the same migration.",
      "Every AI span carries a citation; no citation, no ship.",
      "Every destructive action requires typed confirmation."
    ],
    "audit": {
      "product_fit": "Architecture matches an evidence-first, regulated-adjacent workflow product per blueprint.",
      "simplicity": "One shell, one DB, edge functions for bursts — near the simplicity floor for the product's ambitions.",
      "security": "RLS + role table + audit trail; meets ASVS L1 baseline.",
      "reliability": "SLOs defined; per-module degradation; retries + diagnostics in place.",
      "scalability": "Horizontal by blueprint count is the growth axis; per-blueprint scaling is comfortably in headroom.",
      "maintainability": "Deterministic derivations (Design DNA, Architecture DNA) keep per-vertical drift out of components.",
      "performance": "p95 target 600ms is realistic on Cloud edge with warm cache.",
      "cost": "Idle-to-zero for cold blueprints; per-blueprint attribution keeps AI spend controllable.",
      "compliance": "Domain-specific (agency disclosures, attestation signers, retention schedules)",
      "dx": "Single stack (React + Vite + Tailwind + Cloud); new blueprint reaches microsite state in one session.",
      "ops_burden": "Managed platform absorbs infra ops; SRE work is limited to SLO watch + runbooks.",
      "extensibility": "New capability = new edge function + new Runtime tab entry; no shell changes required.",
      "team_suitability": "Fits a small team; every added component must retire an older one.",
      "time_to_market": "New blueprint reachable to validation-microsite state within one working session.",
      "recommendation": {
        "style": "modular monolith",
        "stack": "React + Vite + TypeScript + Tailwind + shadcn on the client; Deno edge functions + managed Postgres (RLS) + object storage on the server; Lovable AI Gateway (unused in this vertical).",
        "hosting": "Lovable Cloud managed hosting; preview + production environments; edge functions co-deploy with the app.",
        "database": "Managed Postgres with RLS + JSONB; PITR enabled for critical-tier patients.",
        "auth": "Managed OAuth (Google default) + user_roles table + has_role() SECURITY DEFINER referenced from RLS policies.",
        "integrations": "GitHub (public read) for sync + sources; Lovable AI Gateway for LLM calls; Cloud Storage for artifacts. No third-party CRM/email/SMS at MVP.",
        "ai_approach": "No AI at MVP for this vertical; revisit only when a scoped generation task with clear sources appears.",
        "build_first": [
          "Blueprint Core (evidence + release gate) — vertical-agnostic.",
          "Content Pipeline (sources → articles → integrity) — required for any evidence claim.",
          "Sync + rollback — required to safely onboard the network."
        ],
        "avoid": [
          "Any per-blueprint deploy pipeline.",
          "Autonomous AI agents that mutate data without owner confirmation.",
          "Bespoke workflow engines before the in-app queue is exhausted."
        ],
        "revisit_later": [
          "Workflow engine adoption when > 10 concurrent long jobs per blueprint.",
          "Search index dedicated infra when Postgres FTS p95 breaches SLO.",
          "Multi-region on the first residency-bound contract."
        ],
        "biggest_risks": [
          "Missing RLS on a new public table (critical).",
          "Ungrounded AI output reaching a customer-visible surface.",
          "AI cost runaway on a single blueprint.",
          "Solo/small-team key-person dependency."
        ],
        "first_10_steps": [
          "Confirm managed OAuth + user_roles table + has_role() function are in place.",
          "Enable RLS + policies on every existing public table; add the migration checklist to CI.",
          "Wire correlationId end-to-end across every edge function call.",
          "Ship the smoke test runner as a required post-deploy gate.",
          "Enable PITR + schedule the first restore drill on the calendar.",
          "Add per-slug AI occupancy caps and cost dashboards.",
          "Enforce evidence-first release gate for every blueprint.",
          "Set SLO burn-rate alerts on the top 3 SLIs.",
          "Document the per-capability runbook (retry, cancel, invalidate).",
          "Publish this Architecture DNA per blueprint as part of the release evidence certification."
        ],
        "top_10_rules": [
          "Every public table ships with GRANT + RLS + policies in the same migration.",
          "Every mutation writes an audit entry in the same transaction.",
          "Every AI span carries a citation; no citation, no ship.",
          "Every long AI call is per-item, never monolithic.",
          "Every edge function call carries a correlationId end-to-end.",
          "Every retry uses exponential backoff + jitter with a hard attempt cap.",
          "Every destructive action requires typed confirmation.",
          "No microservice extraction without a divergent SLO.",
          "No new dependency without a supply-chain scan.",
          "Signature element (Certification-dossier tabs with engagement chip) and accent (dossier-slate) are network invariants — respect them."
        ]
      }
    }
  },
  "design": {
    "slug": "340b-compliance-audit-engine",
    "archetypes": [
      "compliance/regulatory tool",
      "workflow tool",
      "operations system"
    ],
    "user_mindset": {
      "goals": "Produce a statute-complete packet under a audit-season deadline.",
      "session_length": "Bursty around the peak-occupancy distribution windows; otherwise review-oriented.",
      "confidence": "Expert users; will not accept opaque AI output.",
      "interface_needs": "Print-parity layouts, citation chains, freeze/approval states."
    },
    "posture": [
      "authoritative",
      "trustworthy",
      "operational"
    ],
    "density": "compact",
    "trust_level": {
      "tier": "high",
      "sensitive_domains": [
        "disclosures",
        "engagement data",
        "the owner's counsel communications"
      ],
      "implications": [
        "Every destructive action confirmed with typed intent, never a single-click.",
        "Errors carry remediation copy + owner, not just a message.",
        "Focus rings visible on every interactive element (WCAG 2.2 AA minimum).",
        "Named signer on any outbound artifact.",
        "Explicit unsaved-changes gate on nav."
      ]
    },
    "differentiation": {
      "avoid": [
        "Material Design defaults",
        "shadcn stock look (unstyled cards + slate ring)",
        "Purple/indigo gradient heroes",
        "Stripe/Linear/Notion mimicry",
        "Vertical cliché: Cartoon shield mascots"
      ],
      "strategy": "Anchor on the disclosure-dossier tabs with engagement chip as the recurring signature element; every page must include it at least once. 340B the dossier-slate accent for evidence/status signals only."
    },
    "territories": [
      {
        "name": "Disclosure Dossier",
        "color_mood": "dossier slate + parchment",
        "typography": "Söhne + Serif Display",
        "density": "tabbed dossier",
        "component_feel": "government form set",
        "motion": "tab-first",
        "fits": "the owner's counsel parity",
        "risks": "bureaucratic feel"
      },
      {
        "name": "Engagement Atlas",
        "color_mood": "map ink + civic navy",
        "typography": "Neue Haas Grotesk",
        "density": "map-driven",
        "component_feel": "atlas + rules",
        "motion": "map pan",
        "fits": "multi-engagement",
        "risks": "requires geo data"
      },
      {
        "name": "Certification Timeline",
        "color_mood": "slate + amber",
        "typography": "Inter",
        "density": "timeline",
        "component_feel": "gantt of duties",
        "motion": "scroll-sync",
        "fits": "recurring disclosures",
        "risks": "gantt fatigue"
      }
    ],
    "chosen_territory": "Disclosure Dossier",
    "chosen_rationale": "The disclosure is the deliverable; the dossier metaphor keeps every screen artifact-shaped.",
    "prioritized_components": [
      {
        "name": "Engagement chip",
        "why": "scope is always per-engagement"
      },
      {
        "name": "CertificationCase card w/ due-by",
        "why": "primary work unit"
      },
      {
        "name": "Disclosure package assembler",
        "why": "output is a bundle"
      }
    ],
    "patterns": [
      {
        "name": "Engagement switcher",
        "description": "Global scope selector; every query respects it."
      },
      {
        "name": "Disclosure sign-off",
        "description": "Named signer with attestation copy."
      }
    ],
    "states": [
      "default",
      "hover",
      "active",
      "focus",
      "disabled",
      "loading",
      "skeleton",
      "empty",
      "error",
      "warning",
      "success",
      "offline",
      "permission-denied",
      "partial-data",
      "syncing",
      "unsaved-changes",
      "ai-generating"
    ],
    "localization": [
      "Copy budgets assume +35% expansion for DE/FR translations.",
      "RTL mirror verified for AR/HE (icons flipped, numerals kept LTR).",
      "Dates/times/currencies use Intl APIs, never hardcoded formats.",
      "Touch targets ≥ 44px; keyboard tab order matches visual order.",
      "Density modes: comfortable (default), compact (power users), spacious (accessibility)."
    ],
    "uniqueness_audit": {
      "app_specific_decisions": [
        "Dossier tab motif",
        "Attestation copy discipline"
      ],
      "cliches_avoided": [
        "Shield mascots",
        "Green-check compliance theatre"
      ],
      "scale_notes": "New blueprints inherit the network shell but MUST declare their own signature element, accent role, and anti-reference before they can be marked ready. Enforced by the release gate."
    },
    "tokens": {
      "brand": "219 56% 35%",
      "brand-fg": "36 30% 97%",
      "surface": "0 0% 100%",
      "ink": "221 49% 15%",
      "muted": "219 18% 35%",
      "accent": "32 79% 34%"
    },
    "type": {
      "display": "'DM Serif Display', ui-serif, serif",
      "body": "'Inter', system-ui, sans-serif",
      "fonts_url": "https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@400;500;600&display=swap"
    },
    "signature": {
      "motif": "Certification dossier tabs · engagement chip",
      "render": "dossier-tabs"
    }
  },
  "seo": {
    "slug": "340b-compliance-audit-engine",
    "archetype": "statute-fluent authority site",
    "archetype_impact": "Search fit is a statute-fluent authority site. That means depth over breadth: each page cites the specific rule/section it addresses, and thin variants are refused.",
    "authority_dna": {
      "site_archetype": "statute-fluent authority site",
      "monetization_model": "B2B lead → Readiness Scan → paid Audit Package engagement (not ad revenue; not affiliate).",
      "main_search_intents": [
        "informational",
        "commercial"
      ],
      "topical_authority_opportunity": "Own the \"independent 340B audit\" topic cluster by covering HRSA program-integrity guidance, the Medicaid Exclusion File, and the GPO-prohibition rule end-to-end — winning the AEO answer slot for contract-pharmacy eligibility questions.",
      "local_seo_opportunity": "Not justified: buyers search by statute/form, not by city. Do not build /city/ pages.",
      "global_national_opportunity": "National (US-first) is the primary market. International only if the owner's counsel itself is cross-border (e.g., EU AI Act, VAT, CBP).",
      "easiest_ranking_path": "Long-tail, statute-specific how-to and edge-case queries (window math, percent-funded reconciliation, variable assessments) where the SERP is outdated law-firm alerts and PDFs.",
      "hardest_ranking_path": "Head terms like \"owner software\" — dominated by aged vendor domains. Defer until authority accrues.",
      "trust_credibility_requirements": [
        "Named human authors with role + credentials",
        "Rule / statute / agency citations on every claim",
        "Last-reviewed date + change log on regulatory pages",
        "Direct links to primary agency source (not aggregators)",
        "Expert reviewer attribution on YMYL pages"
      ],
      "ymyl": true,
      "expert_review_needed": true,
      "site_structure": "Authority hub + narrow high-intent service page + linkable evidence assets. Not a directory. Not a marketplace.",
      "seo_moat": "always-current rule-mapped pages with change-log timestamps"
    },
    "search_market": {
      "primary_markets": [
        "owner Signed Independent Opinion workflow",
        "HRSA HRSA guidance Signed Independent Opinion"
      ],
      "secondary_markets": [
        "owner annual certification report",
        "Medicaid Exclusion File report disclosure",
        "percent funded disclosure"
      ],
      "low_competition_subtopics": [
        "owner Signed Independent Opinion edge cases",
        "Signed Independent Opinion exception handling",
        "variable assessment Signed Independent Opinion"
      ],
      "high_commercial_intent": [
        "Signed Independent Opinion preparation service",
        "owner disclosure outsourcing",
        "340B-covered Signed Independent Opinion service",
        "Signed Independent Opinion production desk"
      ],
      "informational": [
        "what is the assessment and 340B funding disclosure summary",
        "HRSA HRSA guidance annual certification report explained",
        "what does percent funded mean owner"
      ],
      "local_intent": [],
      "transactional": [
        "Signed Independent Opinion preparation pricing",
        "owner audit-season gap scan",
        "Signed Independent Opinion certification demo"
      ],
      "comparison": [
        "Signed Independent Opinion service vs owner software templates",
        "ClaimClear alternatives"
      ],
      "problem_solution": [
        "how to complete the HRSA HRSA guidance form",
        "annual certification report missing the known-records statement",
        "percent funded does not match the Medicaid Exclusion File report"
      ],
      "near_me": [],
      "long_tail": [
        "Signed Independent Opinion for phased communities with variable assessments",
        "HRSA HRSA guidance form step by step for a december certification effective date"
      ],
      "questions": [
        "what is required in the owner annual certification report?",
        "when must the annual certification report be distributed?",
        "what happens if the Signed Independent Opinion is incomplete?",
        "can the owner raise assessments without a patient vote?"
      ],
      "emerging": [
        "AI-assisted Signed Independent Opinion preparation",
        "automated Signed Independent Opinion completeness checks"
      ],
      "seasonal": [
        "owner audit season checklist",
        "annual certification report deadline december certification effective date"
      ],
      "underserved_serps": [
        "owner Signed Independent Opinion edge cases",
        "Signed Independent Opinion exception handling"
      ],
      "weak_serps": [
        "Signed Independent Opinion checklist",
        "pre-transmission certification deadline"
      ],
      "forum_dominated_serps": [
        "what happens if a covered entity misses the annual independent-audit deadline",
        "340B GPO-prohibition 5 percent ownership limit"
      ],
      "winnable_authoritative_serps": [
        "owner Signed Independent Opinion definitive guide",
        "HRSA HRSA guidance Signed Independent Opinion requirements"
      ],
      "avoid_initially": [
        "owner software",
        "owner management platform",
        "Medicaid Exclusion File report software"
      ],
      "easy_wins": [
        "owner Signed Independent Opinion edge cases",
        "Signed Independent Opinion checklist",
        "HRSA HRSA guidance requirements"
      ],
      "moderate": [
        "owner Signed Independent Opinion definitive guide",
        "Signed Independent Opinion audit-readiness"
      ],
      "long_term_plays": [
        "owner disclosure software",
        "Signed Independent Opinion for large engagements"
      ],
      "do_not_pursue": [
        "generic \"how to start an owner management business\" content",
        "celebrity or trend-jacking posts",
        "national owner content outside 340B-covered"
      ]
    },
    "keyword_clusters": [
      {
        "primary": "HRSA HRSA guidance Signed Independent Opinion requirements",
        "related": [
          "assessment and 340B funding disclosure summary form",
          "the GPO-prohibition rule annual certification report requirements"
        ],
        "intent": "commercial",
        "user_problem": "Leasing season is coming and the packet elements are scattered",
        "funnel": "BOFU",
        "business_value": "high",
        "ranking_difficulty": "medium",
        "conversion_potential": "high",
        "content_effort": "medium",
        "serp_weakness": "SERP dominated by outdated law-firm alerts and PDFs",
        "local_relevance": "low",
        "global_relevance": "high",
        "suggested_page_type": "Pillar / evidence guide",
        "reason": "High buyer intent + weak SERP + our unique proof",
        "priority_score": 17,
        "priority": "P0",
        "bucket": "easy-win"
      },
      {
        "primary": "Signed Independent Opinion vs owner software templates",
        "related": [
          "Signed Independent Opinion service alternatives",
          "owner disclosure comparison"
        ],
        "intent": "commercial",
        "user_problem": "Evaluating a done-for-you desk against the software template",
        "funnel": "BOFU",
        "business_value": "high",
        "ranking_difficulty": "medium",
        "conversion_potential": "high",
        "content_effort": "medium",
        "serp_weakness": "Weak — mostly self-serving vendor pages",
        "local_relevance": "low",
        "global_relevance": "high",
        "suggested_page_type": "Comparison page (honest, evidence-based)",
        "reason": "Late-funnel intent with weak competition",
        "priority_score": 17,
        "priority": "P0",
        "bucket": "easy-win"
      },
      {
        "primary": "owner Signed Independent Opinion checklist",
        "related": [
          "Signed Independent Opinion checklist",
          "the GPO-prohibition rule Compliance Lint checklist"
        ],
        "intent": "informational",
        "user_problem": "Manager needs a per-engagement completeness check",
        "funnel": "MOFU",
        "business_value": "medium",
        "ranking_difficulty": "low",
        "conversion_potential": "medium",
        "content_effort": "low",
        "serp_weakness": "Checklist SERPs are thin listicles without statute citations",
        "local_relevance": "low",
        "global_relevance": "high",
        "suggested_page_type": "Resource / lead magnet page",
        "reason": "Easy win + strong lead-magnet fit",
        "priority_score": 14,
        "priority": "P0",
        "bucket": "easy-win"
      },
      {
        "primary": "pre-transmission certification deadlines",
        "related": [
          "HRSA program-integrity guidance pre-transmission 30–90 day window",
          "december certification effective date disclosure dates"
        ],
        "intent": "informational",
        "user_problem": "Window math across a engagement of certification effective dates",
        "funnel": "TOFU",
        "business_value": "medium",
        "ranking_difficulty": "low",
        "conversion_potential": "medium",
        "content_effort": "low",
        "serp_weakness": "Deadline SERPs are stale and rarely show the window math",
        "local_relevance": "low",
        "global_relevance": "high",
        "suggested_page_type": "Data table page (updated quarterly)",
        "reason": "Recurring seasonal traffic + easy freshness moat",
        "priority_score": 14,
        "priority": "P0",
        "bucket": "easy-win"
      },
      {
        "primary": "owner Signed Independent Opinion edge cases",
        "related": [
          "variable assessment Signed Independent Opinion",
          "phased rental Signed Independent Opinion"
        ],
        "intent": "informational",
        "user_problem": "The form does not fit the engagement’s structure",
        "funnel": "MOFU",
        "business_value": "medium",
        "ranking_difficulty": "low",
        "conversion_potential": "medium",
        "content_effort": "medium",
        "serp_weakness": "Nobody covers edge cases with worked examples",
        "local_relevance": "low",
        "global_relevance": "high",
        "suggested_page_type": "How-to cluster page",
        "reason": "Easy win + high assist to product page",
        "priority_score": 13,
        "priority": "P0",
        "bucket": "easy-win"
      },
      {
        "primary": "owner disclosure software",
        "related": [
          "Signed Independent Opinion automation",
          "Signed Independent Opinion tools"
        ],
        "intent": "commercial",
        "user_problem": "Choosing tooling vs outsourcing production",
        "funnel": "BOFU",
        "business_value": "high",
        "ranking_difficulty": "high",
        "conversion_potential": "high",
        "content_effort": "high",
        "serp_weakness": "Vendor-dominated but reviewable with honest comparisons",
        "local_relevance": "low",
        "global_relevance": "high",
        "suggested_page_type": "Product page (defer)",
        "reason": "Long-term play — do not chase before authority is built",
        "priority_score": 9,
        "priority": "P1",
        "bucket": "medium"
      },
      {
        "primary": "owner Signed Independent Opinion definitive guide",
        "related": [
          "340B-covered 340B certification disclosure guide",
          "HRSA HRSA guidance Signed Independent Opinion guide"
        ],
        "intent": "informational",
        "user_problem": "Needs the whole obligation explained end-to-end",
        "funnel": "TOFU",
        "business_value": "medium",
        "ranking_difficulty": "medium",
        "conversion_potential": "low",
        "content_effort": "high",
        "serp_weakness": "No single current, primary-source-cited guide exists",
        "local_relevance": "low",
        "global_relevance": "high",
        "suggested_page_type": "Pillar page",
        "reason": "Anchors topical authority for the whole cluster",
        "priority_score": 7,
        "priority": "P1",
        "bucket": "medium"
      }
    ],
    "topical_authority_map": {
      "core_topics": [
        "340B independent audit — definitive guide",
        "HRSA program-integrity guidance & Medicaid Exclusion File evidence",
        "Statute library"
      ],
      "pillars": [
        {
          "name": "340B independent audit — definitive guide",
          "core_intent": "informational",
          "audience": "340B program managers, operations leads, 340B program teams",
          "conversion_goal": "Newsletter / checklist download → later validation call",
          "supporting_pages": [
            "340B independent audit explained",
            "340B independent audit workflow step by step",
            "340B independent audit edge cases",
            "340B independent audit FAQs"
          ],
          "internal_links": [
            "/product",
            "/rules/specific-federal-state-the owner's counsel-per-topic/",
            "/resources/checklist"
          ],
          "schema": [
            "Article",
            "BreadcrumbList",
            "FAQPage (where genuine)"
          ],
          "evidence_needed": [
            "Named reviewer",
            "Primary-source citations",
            "Worked example"
          ],
          "local_variants": [],
          "national_variants": [
            "US-national (default)"
          ]
        },
        {
          "name": "HRSA program-integrity guidance & Medicaid Exclusion File evidence",
          "core_intent": "commercial",
          "audience": "340B program managers, operations leads, 340B program teams",
          "conversion_goal": "Book validation call",
          "supporting_pages": [
            "HRSA program-integrity guidance evidence requirements",
            "340B independent audit audit checklist",
            "Common 340B independent audit evidence gaps"
          ],
          "internal_links": [
            "/product",
            "/guides/independent-340b-audit/",
            "/resources/evidence-checklist"
          ],
          "schema": [
            "Article",
            "FAQPage",
            "BreadcrumbList",
            "HowTo (only for real workflow)"
          ],
          "evidence_needed": [
            "Worked evidence artifact",
            "Covered entity counsel citation",
            "Reviewer credential"
          ],
          "local_variants": [],
          "national_variants": [
            "US-national"
          ]
        },
        {
          "name": "Statute library",
          "core_intent": "informational",
          "audience": "340B program managers, operations leads, 340B program teams",
          "conversion_goal": "Assisted conversion via internal linking",
          "supporting_pages": [
            "Section 340B of the Public Health Service Act — text and citations",
            "HRSA program-integrity guidance — text and citations",
            "The Medicaid Exclusion File — carve-in/carve-out explained",
            "GPO-prohibition rule for DSH/CAH entities — text and citations",
            "The post-Genesis patient-definition ruling — what changed",
            "HRSA's annual independent-audit requirement — text and citations",
            "The vacated 340B rebate-model pilot — current status"
          ],
          "internal_links": [
            "/guides/independent-340b-audit/",
            "/product"
          ],
          "schema": [
            "Article",
            "BreadcrumbList"
          ],
          "evidence_needed": [
            "Primary source link",
            "Visited-on date",
            "Reviewer sign-off"
          ],
          "local_variants": [],
          "national_variants": [
            "US-national"
          ]
        }
      ],
      "supporting_page_types": [
        "definition / glossary",
        "how-to workflow",
        "edge-case handling",
        "rule-change explainer",
        "worked example",
        "FAQ",
        "comparison (only when honest)",
        "case study (only with permission)",
        "evidence artifact / template",
        "the owner's counsel update log"
      ]
    },
    "site_architecture": {
      "homepage_strategy": "Above-the-fold: one-sentence purpose + primary CTA (validation call). Below: 3 problem-cards linking to pillars, 1 evidence-asset teaser, 1 authority statement with named reviewer.",
      "main_nav": [
        "Product",
        "How it works",
        "Pillars",
        "Resources",
        "About",
        "Contact"
      ],
      "footer_nav": [
        "Editorial policy",
        "Contact",
        "Privacy",
        "Terms",
        "Sitemap",
        "Changelog"
      ],
      "hubs": [
        {
          "name": "Product / service",
          "url": "/product",
          "purpose": "High-intent commercial page"
        },
        {
          "name": "Guides pillar",
          "url": "/guides",
          "purpose": "Topical authority hub"
        },
        {
          "name": "Rule library",
          "url": "/rules",
          "purpose": "Entity/regulation reference"
        },
        {
          "name": "Resources",
          "url": "/resources",
          "purpose": "Linkable assets (templates, checklists)"
        },
        {
          "name": "Changelog",
          "url": "/changelog",
          "purpose": "Freshness + trust signal"
        }
      ],
      "url_patterns": [
        "/product",
        "/guides/[topic]/",
        "/guides/[topic]/[subtopic]/",
        "/rules/[the owner's counsel]/[rule]/",
        "/resources/[asset]/",
        "/compare/[a]-vs-[b]/",
        "/glossary/[term]/"
      ],
      "avoid_url_patterns": [
        "/[city]/[service]/ (no local intent for this buyer)",
        "/blog/[year]/[month]/[slug]/ (dated slugs decay CTR)",
        "/tag/[tag]/ (thin archive pages)",
        "Any duplicate /service/ and /solutions/ trees"
      ]
    },
    "global_national": {
      "national_clusters": [
        "340B independent audit — definitive guide",
        "HRSA program-integrity guidance compliance workflow",
        "340B independent audit evidence checklist",
        "disclosure audit-readiness"
      ],
      "linkable_assets": [
        "Evidence checklist (downloadable, gated by email is OK)",
        "Rule-to-artifact mapping table (HTML + PDF)",
        "Change-log / the owner's counsel update tracker",
        "Worked example (redacted real case)"
      ],
      "original_research_ideas": [
        "Annual 340B independent audit readiness benchmark (survey of ~50 operators)",
        "Cost-of-non-compliance calculation for disclosure",
        "State-by-state variation index (where applicable)"
      ],
      "international_needed": false,
      "international_notes": "Not needed. US-first. Do not build hreflang variants."
    },
    "local_seo": {
      "justified": false,
      "reason": "Buyers search by statute/form, not by city. Local pages would be doorway pages.",
      "gbp_categories_primary": [],
      "gbp_categories_secondary": [],
      "location_page_rules": [
        "Do not build location pages for this blueprint."
      ],
      "citations": [],
      "review_strategy": "Reviews are not a Local ranking factor here; use G2/Capterra + case studies instead.",
      "local_schema": []
    },
    "programmatic": {
      "recommended": false,
      "reason": "Programmatic pages almost always become doorway pages in regulated niches. Prefer a small number of deeply-researched pages.",
      "rules": [
        "Only allowed for genuinely differentiated data (e.g., a state-by-state rule table where each state truly differs)",
        "Every programmatic page must include: unique data field + unique local/regulatory content + human review before publish",
        "noindex until minimum quality threshold met",
        "Rel=canonical to the pillar when a page falls below threshold"
      ],
      "per_page_requirements": [
        "≥1 unique data point not present on sibling pages",
        "≥1 unique paragraph of human-written analysis",
        "Verified last-reviewed date"
      ],
      "quality_gates": [
        "Editorial review before indexation",
        "Quarterly re-review or noindex",
        "Automated thin-content detector (<300 words unique) blocks publish"
      ]
    },
    "page_templates": [
      {
        "page_type": "Homepage",
        "purpose": "State the offer + route to validation call.",
        "target_intent": "commercial",
        "url_pattern": "/",
        "h1_pattern": "[One-sentence purpose]",
        "title_pattern": "[Brand] — [One-sentence purpose]",
        "meta_description_pattern": "One sentence outcome + CTA verb. ≤ 155 chars.",
        "above_the_fold": [
          "H1",
          "Sub-headline (audience + outcome)",
          "Primary CTA (validation call)",
          "1 trust chip (reviewer / cite)"
        ],
        "outline": [
          "Problem framing",
          "3 pillar cards",
          "Evidence asset teaser",
          "Named reviewer statement",
          "Contact"
        ],
        "internal_links": [
          "/product",
          "/guides",
          "/resources",
          "/about"
        ],
        "conversion_elements": [
          "Calendar CTA",
          "Checklist download secondary"
        ],
        "schema": [
          "Organization",
          "WebSite",
          "SearchAction"
        ],
        "trust_elements": [
          "Reviewer name",
          "Editorial policy link"
        ],
        "media": [
          "Original workflow diagram (SVG)"
        ],
        "faq_opportunities": [
          "Top 3 buyer questions"
        ],
        "cta_strategy": "Above-the-fold soft + end-of-page primary",
        "quality_requirements": [
          "Loads < 2.5s LCP",
          "Named reviewer visible"
        ],
        "anti_thin_rules": [
          "No stock hero",
          "No generic 'we help X do Y' filler"
        ]
      },
      {
        "page_type": "Pillar page",
        "purpose": "Anchor a topic cluster with a definitive explanation.",
        "target_intent": "informational",
        "url_pattern": "/guides/[topic]/",
        "h1_pattern": "[Topic] — Definitive Guide",
        "title_pattern": "[Topic] — Definitive Guide | [Brand]",
        "meta_description_pattern": "Definition + what the reader will learn + reviewer credential.",
        "above_the_fold": [
          "H1",
          "40–60 word definition block",
          "TOC",
          "Last-reviewed date + reviewer"
        ],
        "outline": [
          "Definition",
          "Who this applies to",
          "Workflow",
          "Rules & citations",
          "Edge cases",
          "FAQs",
          "Related pages"
        ],
        "internal_links": [
          "Cluster sub-pages",
          "Rule library",
          "Product"
        ],
        "conversion_elements": [
          "End-of-page checklist download",
          "Sidebar validation call CTA"
        ],
        "schema": [
          "Article",
          "BreadcrumbList",
          "FAQPage (only real FAQs)"
        ],
        "trust_elements": [
          "Named author + reviewer",
          "Primary source cites"
        ],
        "media": [
          "Original diagrams",
          "Rule comparison table"
        ],
        "faq_opportunities": [
          "Real questions from practitioners"
        ],
        "cta_strategy": "Assist conversion via internal link to product; primary CTA end-of-page.",
        "quality_requirements": [
          "≥ 1500 words unique",
          "≥ 3 primary sources cited",
          "Reviewer credential visible"
        ],
        "anti_thin_rules": [
          "No listicles padded with keyword variants",
          "No AI-generated body"
        ]
      },
      {
        "page_type": "How-to cluster page",
        "purpose": "Answer a specific workflow question inside a cluster.",
        "target_intent": "informational",
        "url_pattern": "/guides/[topic]/[subtopic]/",
        "h1_pattern": "[Specific action or question]",
        "title_pattern": "[Specific action] — [Pillar topic] | [Brand]",
        "meta_description_pattern": "Concrete outcome + who it applies to + one caveat.",
        "above_the_fold": [
          "H1",
          "Direct answer paragraph",
          "Numbered steps preview"
        ],
        "outline": [
          "Direct answer",
          "Steps",
          "Edge cases",
          "Common mistakes",
          "Related pages"
        ],
        "internal_links": [
          "Pillar page",
          "Sibling clusters",
          "Product"
        ],
        "conversion_elements": [
          "End-of-page checklist download",
          "Related tool link"
        ],
        "schema": [
          "Article",
          "HowTo (only if real workflow)",
          "BreadcrumbList"
        ],
        "trust_elements": [
          "Named author",
          "Reviewer for YMYL"
        ],
        "media": [
          "Screenshots of the actual workflow"
        ],
        "faq_opportunities": [
          "Follow-up questions"
        ],
        "cta_strategy": "Contextual link to product mid-page; primary CTA end-of-page.",
        "quality_requirements": [
          "Unique steps not duplicated from pillar",
          "Reviewer date visible"
        ],
        "anti_thin_rules": [
          "No spun variants of the pillar"
        ]
      },
      {
        "page_type": "Product / service page",
        "purpose": "Convert commercial intent.",
        "target_intent": "commercial",
        "url_pattern": "/product",
        "h1_pattern": "[Outcome-focused headline]",
        "title_pattern": "[Brand] — [Outcome]",
        "meta_description_pattern": "State the outcome + primary CTA verb.",
        "above_the_fold": [
          "H1",
          "Sub-headline",
          "Primary CTA",
          "Trust chip"
        ],
        "outline": [
          "Problem",
          "How we solve it",
          "Proof / worked example",
          "Objection handling",
          "FAQ",
          "CTA"
        ],
        "internal_links": [
          "Case study",
          "Pillar guide",
          "Evidence checklist"
        ],
        "conversion_elements": [
          "Calendar",
          "Secondary checklist"
        ],
        "schema": [
          "Service or SoftwareApplication (whichever fits)",
          "Organization",
          "FAQPage"
        ],
        "trust_elements": [
          "Named reviewer",
          "Primary-source cites",
          "Contact info"
        ],
        "media": [
          "Screenshot of the actual workflow, not marketing composites"
        ],
        "faq_opportunities": [
          "Buyer objections"
        ],
        "cta_strategy": "Above-the-fold + repeated end-of-page",
        "quality_requirements": [
          "Unique per audience segment (no doorway variants)"
        ],
        "anti_thin_rules": [
          "No thin '/services/X/' spin-offs of the same page"
        ]
      },
      {
        "page_type": "Rule / regulation reference page",
        "purpose": "Serve as the site's citation-grade reference for a specific rule.",
        "target_intent": "informational",
        "url_pattern": "/rules/[the owner's counsel]/[rule]/",
        "h1_pattern": "[Covered entity counsel] — [Rule] explained",
        "title_pattern": "[Rule] — [Covered entity counsel] Requirements | [Brand]",
        "meta_description_pattern": "What the rule requires + last-reviewed date.",
        "above_the_fold": [
          "H1",
          "Definition",
          "Last-reviewed + reviewer"
        ],
        "outline": [
          "What the rule says",
          "Who it applies to",
          "Deadlines",
          "Evidence required",
          "Change log"
        ],
        "internal_links": [
          "Pillar guide",
          "Product"
        ],
        "conversion_elements": [
          "Subscribe to change-log",
          "Sidebar validation call"
        ],
        "schema": [
          "Article",
          "BreadcrumbList"
        ],
        "trust_elements": [
          "Primary-source link",
          "Visited-on date",
          "Reviewer credential"
        ],
        "media": [
          "Rule comparison table"
        ],
        "faq_opportunities": [
          "Real practitioner questions"
        ],
        "cta_strategy": "Assist conversion via internal link",
        "quality_requirements": [
          "Primary source link required",
          "Quarterly re-review"
        ],
        "anti_thin_rules": [
          "No auto-generated rule scraping without human review"
        ]
      },
      {
        "page_type": "Comparison page",
        "purpose": "Serve genuine BOFU comparison intent.",
        "target_intent": "commercial",
        "url_pattern": "/compare/[a]-vs-[b]/",
        "h1_pattern": "[A] vs [B] — Honest Comparison",
        "title_pattern": "[A] vs [B] | [Brand]",
        "meta_description_pattern": "Honest side-by-side + when to pick which.",
        "above_the_fold": [
          "H1",
          "TL;DR verdict",
          "When-to-pick block"
        ],
        "outline": [
          "Criteria",
          "Side-by-side table",
          "Where each wins",
          "Where each loses",
          "Recommendation"
        ],
        "internal_links": [
          "Product",
          "Pillar guide"
        ],
        "conversion_elements": [
          "Calendar CTA",
          "Evidence checklist"
        ],
        "schema": [
          "Article",
          "BreadcrumbList"
        ],
        "trust_elements": [
          "Disclose the reviewer's relationship to each option"
        ],
        "media": [
          "Feature comparison table"
        ],
        "faq_opportunities": [
          "'Which should I choose?' style"
        ],
        "cta_strategy": "End-of-page primary CTA to the fitting option",
        "quality_requirements": [
          "Honest even when it hurts",
          "Disclose relationship"
        ],
        "anti_thin_rules": [
          "No manufactured 'X vs Y' pages for every pair"
        ]
      },
      {
        "page_type": "FAQ page",
        "purpose": "Aggregate genuine practitioner questions.",
        "target_intent": "informational",
        "url_pattern": "/faq",
        "h1_pattern": "FAQ",
        "title_pattern": "[Topic] FAQ | [Brand]",
        "meta_description_pattern": "Answers to the questions we hear most.",
        "above_the_fold": [
          "H1",
          "Table of contents"
        ],
        "outline": [
          "Grouped questions",
          "Each answer 40–120 words"
        ],
        "internal_links": [
          "Relevant pillars and rule pages"
        ],
        "conversion_elements": [
          "End-of-page CTA"
        ],
        "schema": [
          "FAQPage (only for genuine FAQs visible on-page)"
        ],
        "trust_elements": [
          "Named reviewer"
        ],
        "media": [],
        "faq_opportunities": [
          "Real questions only — never invented"
        ],
        "cta_strategy": "Related-block links, not inline mid-answer",
        "quality_requirements": [
          "No invented questions"
        ],
        "anti_thin_rules": [
          "No 'is X the best' padding"
        ]
      },
      {
        "page_type": "Glossary term page",
        "purpose": "Definition-grade authority for a single term.",
        "target_intent": "informational",
        "url_pattern": "/glossary/[term]/",
        "h1_pattern": "[Term]",
        "title_pattern": "[Term] — Definition | [Brand]",
        "meta_description_pattern": "Concise definition + who uses the term.",
        "above_the_fold": [
          "H1",
          "40-word definition"
        ],
        "outline": [
          "Definition",
          "Related terms",
          "Where it applies",
          "Common misuses"
        ],
        "internal_links": [
          "Pillar",
          "Rule pages"
        ],
        "conversion_elements": [
          "Sidebar related-tool link"
        ],
        "schema": [
          "Article",
          "BreadcrumbList",
          "DefinedTerm"
        ],
        "trust_elements": [
          "Cite the primary source of the definition"
        ],
        "media": [],
        "faq_opportunities": [],
        "cta_strategy": "Assist via internal link",
        "quality_requirements": [
          "Never duplicate the pillar's intro"
        ],
        "anti_thin_rules": [
          "No glossary spam"
        ]
      },
      {
        "page_type": "Case study page",
        "purpose": "Concrete outcome-based proof.",
        "target_intent": "commercial",
        "url_pattern": "/case-studies/[slug]/",
        "h1_pattern": "[Outcome achieved for [customer type]]",
        "title_pattern": "Case Study — [Outcome] | [Brand]",
        "meta_description_pattern": "Concrete outcome + timeframe + method.",
        "above_the_fold": [
          "H1",
          "Outcome metric",
          "Approved-for-publication chip"
        ],
        "outline": [
          "Context",
          "Approach",
          "Outcome",
          "Reviewer quote"
        ],
        "internal_links": [
          "Product",
          "Pillar guide"
        ],
        "conversion_elements": [
          "End-of-page CTA"
        ],
        "schema": [
          "Article",
          "BreadcrumbList"
        ],
        "trust_elements": [
          "Named customer contact (with permission)"
        ],
        "media": [
          "Redacted artifact screenshots"
        ],
        "faq_opportunities": [],
        "cta_strategy": "End-of-page primary CTA",
        "quality_requirements": [
          "Written approval on file"
        ],
        "anti_thin_rules": [
          "No fabricated case studies"
        ]
      }
    ],
    "on_page_rules": {
      "title_tag": "Pattern: [Primary keyword] — [Angle] | 340B independent audit. ≤ 60 chars. Front-load the keyword. No clickbait.",
      "meta_description": "≤ 155 chars. State the specific outcome. Include a verb + a rule citation when applicable. No stuffing.",
      "headings": "One H1. H2s follow the workflow steps or the searcher's questions. H3s for edge cases. No decorative headings.",
      "intro": "First 100 words: define the topic in the searcher's language + name the specific rule/agency + preview what the page delivers.",
      "snippet_targeting": "Add a 40–60 word definition block and a numbered how-to block near the top for featured snippet + AI overview eligibility.",
      "tables_lists": "Use tables for rule comparisons, deadlines, and thresholds. Lists for steps. Never use tables for layout.",
      "images": "Original diagrams/screenshots preferred. Descriptive alt text. WebP. Explicit width/height. Never AI slop stock art.",
      "internal_links": "Every page: ≥3 contextual links up to pillar, ≥2 to sibling cluster pages, ≥1 to a commercial page.",
      "external_citations": "Cite the primary source (agency PDF / statute) — not aggregators — with the visited-on date.",
      "author_attribution": "Named author + role + linked bio page. Reviewer for YMYL.",
      "freshness": "Last-reviewed date at top; change log at bottom for the owner's counsel pages; quarterly review cadence.",
      "cta_placement": "Above the fold (soft), mid-page (contextual to the section), end-of-page (primary).",
      "mobile": "Single-column, tap targets ≥44px, no interstitials, no autoplay video.",
      "avoid": [
        "Keyword stuffing",
        "AI-generated body copy without human edit",
        "Doorway variants",
        "Unsupported superlatives ('best', 'top-rated') without evidence",
        "Meta descriptions duplicated across pages",
        "Marking up invisible content in schema"
      ]
    },
    "entity_seo": {
      "main_entities": [
        "Signed Independent Opinion (Assessment & income & asset determination Summary)",
        "HRSA program-integrity guidance",
        "HRSA program-integrity guidance annual certification report",
        "Medicaid Exclusion File report",
        "percent funded",
        "the HRSA 340B program-integrity guidance",
        "prior certification history",
        "improper HAP"
      ],
      "related_entities": [
        "340B-covered owner audit season",
        "certification effective date distribution window",
        "professional Medicaid Exclusion File report Medicaid Exclusion File report update",
        "fully funded balance",
        "GPO-prohibition rule"
      ],
      "people": [
        "Named practitioners",
        "Reviewers",
        "Covered entity counsel referenced"
      ],
      "orgs": [
        "340B-covered Department of Public Health and Environment (HRSA)",
        "U.S. Environmental Protection Agency HRSA Office of Multifamily Housing",
        "340B-covered Division of Real Estate"
      ],
      "tools": [
        "Statute field map",
        "Signed Independent Opinion source-trace template",
        "completeness checklist"
      ],
      "regulations": [
        "Section 340B of the Public Health Service Act",
        "HRSA program-integrity guidance",
        "The Medicaid Exclusion File carve-in/carve-out framework",
        "GPO-prohibition rule (DSH/CAH entities)",
        "HRSA's annual independent-audit requirement",
        "The post-Genesis patient-definition posture",
        "The 340B rebate-model RFI (Feb 2026)"
      ],
      "problems": [
        "Incomplete Signed Independent Opinion",
        "Lost 340B program eligibility after an HRSA finding",
        "Stale Medicaid Exclusion File report",
        "Percent-funded mismatch"
      ],
      "solutions": [
        "Audit Package workflow",
        "Source-trace appendices",
        "Statute-mapped checklists"
      ],
      "processes": [
        "Intake",
        "Statute field mapping",
        "Extraction & validation",
        "certified reviewer review",
        "Release",
        "Owner adoption & distribution"
      ],
      "alternatives": [
        "TPA/EHR software (AppFolio/Buildium) templates",
        "the owner's counsel drafting",
        "in-house spreadsheet production"
      ],
      "synonyms": [
        "Signed Independent Opinion",
        "Signed Independent Opinion summary",
        "annual certification report packet",
        "assessment and 340B funding disclosure"
      ]
    },
    "schema_strategy": [
      {
        "type": "Organization",
        "where": "Site-wide in head",
        "required_fields": [
          "name",
          "url",
          "logo",
          "sameAs"
        ],
        "caution": "Keep in sync with visible About / contact."
      },
      {
        "type": "WebSite + SearchAction",
        "where": "Homepage",
        "required_fields": [
          "name",
          "url",
          "potentialAction"
        ],
        "caution": "Only if on-site search actually exists."
      },
      {
        "type": "BreadcrumbList",
        "where": "All hub / cluster / rule / glossary pages",
        "required_fields": [
          "itemListElement"
        ],
        "caution": "Order must match visible breadcrumbs."
      },
      {
        "type": "Article",
        "where": "Guides, pillars, rule pages",
        "required_fields": [
          "headline",
          "author",
          "datePublished",
          "dateModified"
        ],
        "caution": "Author must exist as a real person."
      },
      {
        "type": "FAQPage",
        "where": "Genuine FAQ pages only",
        "required_fields": [
          "mainEntity[]"
        ],
        "caution": "Only mark up FAQs visible on the page."
      },
      {
        "type": "HowTo",
        "where": "Real step-by-step workflows only",
        "required_fields": [
          "name",
          "step[]"
        ],
        "caution": "Google narrowed HowTo eligibility; use sparingly."
      },
      {
        "type": "Person",
        "where": "Author bio pages",
        "required_fields": [
          "name",
          "jobTitle",
          "sameAs"
        ],
        "caution": "Credentials must be real and verifiable."
      }
    ],
    "internal_linking": {
      "pillar_to_cluster": "Pillar links to every direct cluster page in a curated section (not a mega-menu dump).",
      "cluster_to_pillar": "Every cluster page links back to its pillar in the intro and in-context.",
      "cluster_to_cluster": "Link between sibling clusters only where the user's next question naturally leads there.",
      "service_to_location": "Not applicable.",
      "faq_to_commercial": "Answer the question first, then link to the commercial page in a 'related' block — never inline mid-answer.",
      "breadcrumbs": "Structured breadcrumbs on all guide, rule, and glossary pages.",
      "anchor_text_rules": [
        "Descriptive — match the target page's H1 concept",
        "Vary phrasing across links to the same target",
        "Never exact-match keyword stuffing",
        "Anchor must make sense read aloud"
      ]
    },
    "technical_seo": {
      "crawlability": "Flat depth (≤3 clicks from homepage). No orphan pages. HTML sitemap on /sitemap.",
      "indexability": "Index all real content. noindex utility pages, thank-you pages, and gated-asset landing pages.",
      "sitemaps": "XML sitemap generated at build time. Split by section if > 5k URLs.",
      "robots": "robots.txt allows all; disallow /admin/, /api/. Reference sitemap.",
      "canonicals": "Self-referencing canonical on every page. Filter/sort variants canonical to the base.",
      "pagination": "Prefer 'load more' or a single long page; if paginated, use rel=next/prev semantics via internal linking.",
      "faceted_nav": "Not applicable for this blueprint (no product catalog).",
      "duplicate_control": "One URL per topic. Consolidate before publishing new variants. No www/non-www split.",
      "redirects": "301 for permanent moves; audit chains monthly; never 302 for SEO redirects.",
      "core_web_vitals": "LCP ≤ 2.5s, INP ≤ 200ms, CLS ≤ 0.1. Test with real-user monitoring.",
      "mobile": "Mobile-first design. No tap-target failures. No horizontal scroll.",
      "accessibility": "WCAG AA. Semantic HTML. Landmarks. Focus states. Alt text.",
      "js_seo": "Content in the initial HTML. Client hydration for interactivity only.",
      "rendering": "Static generation preferred; SSR only where personalized. Never client-only for indexable pages.",
      "gsc_setup": "Verify both www and apex; submit sitemap; monitor Coverage and Enhancements weekly.",
      "analytics_setup": "GA4 + server-side event stream. Consent Mode v2. Event schema documented.",
      "rank_tracking": "Semrush or Ahrefs project set to US database; track pillar + top-20 clusters weekly."
    },
    "eeat": {
      "author_bios": "Every content page has a named author with role, credentials, and a linked author page.",
      "expert_reviewers": "Every YMYL page reviewed by a named expert with disclosed credentials.",
      "editorial_policy": "Public /editorial-policy page: sourcing rules, review cadence, correction policy.",
      "fact_checking": "Every statute/rule reference has a link + visited-on date; corrections dated and disclosed.",
      "credentials": [
        "JD / CPA / MD / CISSP as applicable",
        "Bar admission or license number where public"
      ],
      "citations": "Cite primary sources (agency PDF, statute text). No citation of aggregator blogs.",
      "first_hand_proof": [
        "Screenshots of the actual workflow",
        "Redacted worked examples",
        "Signed reviewer statement"
      ],
      "update_cadence": "Regulatory pages reviewed quarterly; commercial pages reviewed twice yearly.",
      "monetization_disclosure": "Public disclosure that leads convert to paid engagements; no undisclosed affiliate content.",
      "ymyl_notes": "This is YMYL. Language stays cautious ('may', 'depends on facts'); no legal/medical advice framing; disclaimer near CTA."
    },
    "ai_search": {
      "principles": [
        "Answer the exact question in the first paragraph",
        "Provide a 40–60 word extractable definition near the top",
        "Structured lists and tables for facts",
        "Cite named primary sources",
        "Author + reviewer names on-page"
      ],
      "tactics": [
        "FAQPage schema for genuine FAQs (not stuffed)",
        "HowTo schema for real workflow pages",
        "Consistent entity naming across the site",
        "Concise summaries at the top of long guides"
      ],
      "do_not": [
        "Write pages targeting AI systems instead of humans",
        "Insert hidden 'AI-only' content",
        "Create bespoke llms.txt / manifests that bypass normal quality",
        "Mass-generate answers to invented questions"
      ]
    },
    "conversion": {
      "primary_cta": "Book a validation conversation (calendar link).",
      "secondary_cta": "Download the evidence checklist (email capture).",
      "lead_magnets": [
        "340B independent audit evidence checklist (PDF)",
        "Rule-to-artifact mapping table",
        "Quarterly the owner's counsel change-log subscription"
      ],
      "trust_elements": [
        "Named reviewer + credentials",
        "Rule citations visible on-page",
        "Change-log timestamps",
        "Contact + address in footer"
      ],
      "per_page_paths": [
        {
          "page_type": "Homepage",
          "path": "Hero CTA → validation call. Secondary → guides pillar."
        },
        {
          "page_type": "Pillar",
          "path": "TOC → deep sub-pages. End-of-page → validation call."
        },
        {
          "page_type": "Cluster / how-to",
          "path": "In-content 'related tool' link → product. End-of-page → checklist download."
        },
        {
          "page_type": "Product / service",
          "path": "Above-the-fold CTA → calendar. Objection-handling block → FAQ."
        },
        {
          "page_type": "Rule page",
          "path": "Sidebar → related workflow (product). Bottom → subscribe to change-log."
        }
      ],
      "tracking": "GA4 events: cta_click, checklist_download, calendar_book. Server-side dedupe. Weekly funnel review."
    },
    "link_earning": {
      "digital_pr_ideas": [
        "Annual \"340B independent audit\" readiness benchmark report",
        "Cost-of-non-compliance calculator with a shareable result page",
        "Covered entity counsel-change tracker with an RSS feed"
      ],
      "original_research": [
        "Small operator survey (n≥30) once per year",
        "State-by-state (or agency-by-agency) rule variation index"
      ],
      "directories": [
        "G2 / Capterra category pages",
        "Industry engagement patient lists",
        "Covered entity counsel resource pages when eligible"
      ],
      "expert_contributions": [
        "HARO / Qwoted / Featured expert responses",
        "Bylined articles in industry trade press",
        "Podcast interviews with practitioners"
      ],
      "partnerships": [
        "Engagement CLE / CPE sponsorships",
        "Co-authored guides with adjacent (non-competing) vendors"
      ],
      "avoid": [
        "Paid link schemes",
        "PBNs",
        "Mass guest posting",
        "Fake reviews",
        "Reciprocal link exchanges"
      ]
    },
    "roadmap_90d": [
      {
        "phase": "Days 0–30: Foundation",
        "goal": "Establish trust + ship product page + first pillar.",
        "pages": [
          "Homepage",
          "Product page",
          "Pillar: 340B independent audit — definitive guide",
          "About + reviewer bio",
          "Editorial policy",
          "Contact"
        ],
        "keywords_targeted": [
          "340B independent audit",
          "340B independent audit guide"
        ],
        "why_first": "Without a trust surface + a real product page, everything else is unmoored.",
        "difficulty": "medium",
        "business_value": "high",
        "required_assets": [
          "Reviewer bio",
          "Editorial policy",
          "One workflow diagram"
        ],
        "internal_links": [
          "Homepage ↔ Product ↔ Pillar"
        ],
        "conversion_goal": "First validation calls booked"
      },
      {
        "phase": "Days 31–60: Topical authority core",
        "goal": "Publish the first cluster of 5–7 supporting pages under the pillar + evidence checklist lead magnet.",
        "pages": [
          "340B independent audit edge cases",
          "340B independent audit workflow step by step",
          "340B independent audit FAQs",
          "Evidence checklist (lead magnet)",
          "distribution deadlines"
        ],
        "keywords_targeted": [
          "340B independent audit edge cases",
          "disclosure checklist",
          "HRSA program-integrity guidance deadlines"
        ],
        "why_first": "Easy-win SERPs that assist conversion to the product page.",
        "difficulty": "low",
        "business_value": "medium",
        "required_assets": [
          "Checklist PDF",
          "Rule table"
        ],
        "internal_links": [
          "All clusters ↔ pillar ↔ product"
        ],
        "conversion_goal": "Checklist downloads + assisted conversions"
      },
      {
        "phase": "Days 61–90: Reference & freshness",
        "goal": "Ship the 340B rule library + first HRSA-guidance change-log post + first comparison page.",
        "pages": [
          "Statute page: Section 340B of the Public Health Service Act",
          "Statute page: HRSA program-integrity guidance",
          "Statute page: the Medicaid Exclusion File carve-in/carve-out framework"
        ],
        "keywords_targeted": [
          "HRSA 340B program-integrity annual audit",
          "independent 340B audit opinion requirements",
          "340B GPO-prohibition eligibility test"
        ],
        "why_first": "Reference pages compound in authority; change-log establishes freshness signal.",
        "difficulty": "medium",
        "business_value": "medium",
        "required_assets": [
          "Primary-source citations",
          "Reviewer sign-off"
        ],
        "internal_links": [
          "Rule pages ↔ pillar ↔ product; comparison → product"
        ],
        "conversion_goal": "BOFU comparison conversions"
      }
    ],
    "roadmap_12m": [
      {
        "phase": "Months 4–6: Linkable assets",
        "goal": "Ship the annual 340B independent-audit benchmark report, the post-Genesis patient-definition explainer, and the state contract-pharmacy-law tracker",
        "pages": [
          "Annual 340B independent audit benchmark",
          "Cost-of-non-compliance calculator",
          "State variation index"
        ],
        "keywords_targeted": [
          "340B independent audit benchmark",
          "340B independent audit cost",
          "340B independent audit state comparison"
        ],
        "why_first": "Linkable assets drive referring domains and topical authority signals.",
        "difficulty": "medium",
        "business_value": "high",
        "required_assets": [
          "Survey data",
          "Named methodology",
          "Reviewer sign-off"
        ],
        "internal_links": [
          "From every pillar + product"
        ],
        "conversion_goal": "Calculator → validation call handoff"
      },
      {
        "phase": "Months 7–9: Depth + freshness cadence",
        "goal": "Expand each pillar with 3 more cluster pages + quarterly the owner's counsel change-log.",
        "pages": [
          "Additional cluster pages (per pillar)",
          "Q3 the owner's counsel change-log",
          "First case study (with permission)"
        ],
        "keywords_targeted": [
          "Long-tail cluster expansions"
        ],
        "why_first": "Compounding topical coverage + freshness moat.",
        "difficulty": "low",
        "business_value": "medium",
        "required_assets": [
          "Customer approval for case study"
        ],
        "internal_links": [
          "Sibling cluster interlinking"
        ],
        "conversion_goal": "Assisted conversions"
      },
      {
        "phase": "Months 10–12: Scale + prune",
        "goal": "Consolidate weak pages, refresh top pages, expand into 1 adjacent topic only if authority is proven.",
        "pages": [
          "Consolidation redirects",
          "Top-10 page refreshes",
          "Adjacent topic scoping"
        ],
        "keywords_targeted": [
          "Existing top-10 clusters"
        ],
        "why_first": "Optimization > net-new after a critical mass is reached.",
        "difficulty": "low",
        "business_value": "high",
        "required_assets": [
          "Analytics review",
          "Consolidation plan"
        ],
        "internal_links": [
          "Redirect audit"
        ],
        "conversion_goal": "CTR + conversion-rate lift"
      }
    ],
    "priority_pages": [
      {
        "rank": 1,
        "page_title": "Independent 340B audit requirements for contract pharmacies",
        "slug": "/guides/HRSA HRSA guidance-340B-disclosure-requirements/",
        "page_type": "Pillar / evidence guide",
        "primary_keyword": "HRSA HRSA guidance Signed Independent Opinion requirements",
        "secondary_keywords": [
          "assessment and 340B funding disclosure summary form",
          "the GPO-prohibition rule annual certification report requirements"
        ],
        "intent": "commercial",
        "scope": "national",
        "funnel": "BOFU",
        "difficulty": "medium",
        "business_value": "high",
        "conversion_potential": "high",
        "required_proof": [
          "Named reviewer",
          "Primary-source cites",
          "Worked example"
        ],
        "internal_links": [
          "/guides/independent-340b-audit/",
          "/product",
          "/rules/specific-federal-state-the owner's counsel-per-topic/"
        ],
        "schema": [
          "Article",
          "BreadcrumbList"
        ],
        "cta": "Book validation call",
        "production_priority": "P0",
        "why_opportunity": "High buyer intent + weak SERP + our unique proof"
      },
      {
        "rank": 2,
        "page_title": "Signed Independent Opinion vs owner software templates",
        "slug": "/guides/340B-disclosure-vs-pm-software/",
        "page_type": "Comparison page (honest, evidence-based)",
        "primary_keyword": "Signed Independent Opinion vs owner software templates",
        "secondary_keywords": [
          "Signed Independent Opinion service alternatives",
          "owner disclosure comparison"
        ],
        "intent": "commercial",
        "scope": "national",
        "funnel": "BOFU",
        "difficulty": "medium",
        "business_value": "high",
        "conversion_potential": "high",
        "required_proof": [
          "Named reviewer",
          "Primary-source cites",
          "Worked example"
        ],
        "internal_links": [
          "/guides/independent-340b-audit/",
          "/product",
          "/rules/specific-federal-state-the owner's counsel-per-topic/"
        ],
        "schema": [
          "Article",
          "BreadcrumbList"
        ],
        "cta": "Book validation call",
        "production_priority": "P0",
        "why_opportunity": "Late-funnel intent with weak competition"
      },
      {
        "rank": 3,
        "page_title": "owner Signed Independent Opinion checklist",
        "slug": "/guides/independent-340b-audit-checklist/",
        "page_type": "Resource / lead magnet page",
        "primary_keyword": "owner Signed Independent Opinion checklist",
        "secondary_keywords": [
          "Signed Independent Opinion checklist",
          "the GPO-prohibition rule Compliance Lint checklist"
        ],
        "intent": "informational",
        "scope": "national",
        "funnel": "MOFU",
        "difficulty": "low",
        "business_value": "medium",
        "conversion_potential": "medium",
        "required_proof": [
          "Named reviewer",
          "Primary-source cites",
          "Worked example"
        ],
        "internal_links": [
          "/guides/independent-340b-audit/",
          "/product",
          "/rules/specific-federal-state-the owner's counsel-per-topic/"
        ],
        "schema": [
          "Article",
          "BreadcrumbList"
        ],
        "cta": "Download checklist",
        "production_priority": "P0",
        "why_opportunity": "Easy win + strong lead-magnet fit"
      },
      {
        "rank": 4,
        "page_title": "Annual certification report distribution deadlines (HRSA program-integrity guidance pre-transmission window math)",
        "slug": "/guides/annual-occupancy-report-distribution-deadlines/",
        "page_type": "Data table page (updated quarterly)",
        "primary_keyword": "pre-transmission certification deadlines",
        "secondary_keywords": [
          "HRSA program-integrity guidance pre-transmission 30–90 day window",
          "december certification effective date disclosure dates"
        ],
        "intent": "informational",
        "scope": "national",
        "funnel": "TOFU",
        "difficulty": "low",
        "business_value": "medium",
        "conversion_potential": "medium",
        "required_proof": [
          "Named reviewer",
          "Primary-source cites",
          "Worked example"
        ],
        "internal_links": [
          "/guides/independent-340b-audit/",
          "/product",
          "/rules/specific-federal-state-the owner's counsel-per-topic/"
        ],
        "schema": [
          "Article",
          "BreadcrumbList"
        ],
        "cta": "Download checklist",
        "production_priority": "P0",
        "why_opportunity": "Recurring seasonal traffic + easy freshness moat"
      },
      {
        "rank": 5,
        "page_title": "owner Signed Independent Opinion edge cases",
        "slug": "/guides/independent-340b-audit-edge-cases/",
        "page_type": "How-to cluster page",
        "primary_keyword": "owner Signed Independent Opinion edge cases",
        "secondary_keywords": [
          "variable assessment Signed Independent Opinion",
          "phased rental Signed Independent Opinion"
        ],
        "intent": "informational",
        "scope": "national",
        "funnel": "MOFU",
        "difficulty": "low",
        "business_value": "medium",
        "conversion_potential": "medium",
        "required_proof": [
          "Named reviewer",
          "Primary-source cites",
          "Worked example"
        ],
        "internal_links": [
          "/guides/independent-340b-audit/",
          "/product",
          "/rules/specific-federal-state-the owner's counsel-per-topic/"
        ],
        "schema": [
          "Article",
          "BreadcrumbList"
        ],
        "cta": "Download checklist",
        "production_priority": "P0",
        "why_opportunity": "Easy win + high assist to product page"
      },
      {
        "rank": 6,
        "page_title": "owner disclosure software (honest comparison)",
        "slug": "/guides/340B-disclosure-vs-pm-software/",
        "page_type": "Product page (defer)",
        "primary_keyword": "owner disclosure software",
        "secondary_keywords": [
          "Signed Independent Opinion automation",
          "Signed Independent Opinion tools"
        ],
        "intent": "commercial",
        "scope": "national",
        "funnel": "BOFU",
        "difficulty": "high",
        "business_value": "high",
        "conversion_potential": "high",
        "required_proof": [
          "Named reviewer",
          "Primary-source cites",
          "Worked example"
        ],
        "internal_links": [
          "/guides/independent-340b-audit/",
          "/product",
          "/rules/specific-federal-state-the owner's counsel-per-topic/"
        ],
        "schema": [
          "Article",
          "BreadcrumbList"
        ],
        "cta": "Book validation call",
        "production_priority": "P1",
        "why_opportunity": "Long-term play — do not chase before authority is built"
      },
      {
        "rank": 7,
        "page_title": "owner Signed Independent Opinion definitive guide",
        "slug": "/guides/independent-340b-audit-definitive-guide/",
        "page_type": "Pillar page",
        "primary_keyword": "owner Signed Independent Opinion definitive guide",
        "secondary_keywords": [
          "340B-covered 340B certification disclosure guide",
          "HRSA HRSA guidance Signed Independent Opinion guide"
        ],
        "intent": "informational",
        "scope": "national",
        "funnel": "TOFU",
        "difficulty": "medium",
        "business_value": "medium",
        "conversion_potential": "low",
        "required_proof": [
          "Named reviewer",
          "Primary-source cites",
          "Worked example"
        ],
        "internal_links": [
          "/guides/independent-340b-audit/",
          "/product",
          "/rules/specific-federal-state-the owner's counsel-per-topic/"
        ],
        "schema": [
          "Article",
          "BreadcrumbList"
        ],
        "cta": "Download checklist",
        "production_priority": "P1",
        "why_opportunity": "Anchors topical authority for the whole cluster"
      }
    ],
    "competitor_gaps": {
      "typical_competitor_types": [
        "TPA/EHR software (AppFolio/Buildium) vendors",
        "law-firm client alerts",
        "prior-audit firm blogs"
      ],
      "common_weaknesses": [
        "Outdated the owner's counsel citations",
        "Missing last-reviewed date",
        "No named author or reviewer",
        "Copy-paste content across state / product variants",
        "No worked examples",
        "Thin FAQ padded with generic questions",
        "Poor mobile Core Web Vitals"
      ],
      "how_to_beat_them": [
        "Fresh citations with visited-on dates",
        "Named reviewer + credentials visible",
        "Real, redacted worked examples",
        "Better structured tables for rule comparisons",
        "Faster + more accessible pages"
      ]
    },
    "metrics": {
      "weekly": [
        "GSC impressions/clicks by pillar",
        "Top-20 keyword position",
        "New indexed pages",
        "Core Web Vitals regressions"
      ],
      "monthly": [
        "Organic sessions by hub",
        "Assisted conversions",
        "CTR by template",
        "Content decay list (positions dropped)",
        "Backlink net-new"
      ],
      "quarterly": [
        "Pillar coverage audit",
        "Rule freshness audit",
        "Consolidation / prune list",
        "Conversion path funnel review"
      ],
      "annual": [
        "Full topical authority audit",
        "Benchmark report refresh",
        "Editorial policy refresh"
      ]
    },
    "risks": [
      {
        "risk": "Thin content",
        "applies": true,
        "mitigation": "Minimum-word + reviewer-sign-off gate before publish."
      },
      {
        "risk": "Duplicate content across state/product variants",
        "applies": true,
        "mitigation": "One URL per topic; no auto-generated variants; canonical to pillar."
      },
      {
        "risk": "Doorway location pages",
        "applies": true,
        "mitigation": "Local pages are refused for this vertical — buyers search by the owner's counsel, not city."
      },
      {
        "risk": "Keyword cannibalization",
        "applies": true,
        "mitigation": "Topic ownership map; kill or 301 the weaker duplicate."
      },
      {
        "risk": "AI-generated body without human edit",
        "applies": true,
        "mitigation": "Editorial policy forbids it; reviewer sign-off required."
      },
      {
        "risk": "Unsupported YMYL claims",
        "applies": true,
        "mitigation": "Cautious language + primary-source cites + reviewer credential."
      },
      {
        "risk": "Bad schema (marking up invisible content)",
        "applies": true,
        "mitigation": "Schema linter in CI; only markup what is on-page."
      },
      {
        "risk": "Link spam / paid link schemes",
        "applies": true,
        "mitigation": "Editorial link-earning only; documented policy."
      },
      {
        "risk": "Review manipulation",
        "applies": false,
        "mitigation": "Post-engagement organic prompts only; no incentives; no gating negatives."
      },
      {
        "risk": "Index bloat from tag/archive pages",
        "applies": true,
        "mitigation": "noindex utility archives; canonical to hub."
      },
      {
        "risk": "Compliance risk in claims",
        "applies": true,
        "mitigation": "Legal review of marketing claims; disclaimer near CTAs."
      },
      {
        "risk": "Programmatic doorway pages",
        "applies": true,
        "mitigation": "Programmatic refused unless per-page uniqueness rules are met."
      }
    ],
    "first_20_pages": [
      "Homepage",
      "Product / service page",
      "About + reviewer bio",
      "Editorial policy",
      "Contact / start a certification",
      "Privacy",
      "Pillar: 340B independent audit — definitive guide",
      "The seven Signed Independent Opinion items, step by step",
      "owner Signed Independent Opinion edge cases",
      "owner Signed Independent Opinion FAQs",
      "Pillar: HRSA program-integrity guidance & Medicaid Exclusion File evidence",
      "Independent 340B audit requirements for contract pharmacies",
      "owner Signed Independent Opinion Compliance Lint checklist",
      "Annual certification report distribution deadlines (HRSA program-integrity guidance pre-transmission window math)",
      "Signed Independent Opinion source-trace template (lead magnet)",
      "Statute page: Section 340B of the Public Health Service Act",
      "Statute page: HRSA program-integrity guidance",
      "Statute page: the Medicaid Exclusion File carve-in/carve-out framework",
      "Comparison: Signed Independent Opinion vs owner software templates",
      "Quarterly HRSA guidance change-log post"
    ],
    "first_10_tech_fixes": [
      "XML sitemap generated at build",
      "robots.txt reviewed + sitemap referenced",
      "Self-referencing canonicals",
      "GSC + GA4 verified with server-side events",
      "Core Web Vitals baseline (LCP, INP, CLS)",
      "Structured breadcrumbs sitewide",
      "Author + editorial-policy pages published",
      "404 + 410 patterns defined",
      "Redirect audit (no chains)",
      "Semantic HTML + accessibility landmarks"
    ],
    "first_10_authority_actions": [
      "Publish named reviewer bio(s)",
      "Public editorial policy + correction policy",
      "Cite primary the owner's counsel sources with visited-on dates",
      "Launch checklist lead magnet",
      "Pitch 3 HARO / Qwoted responses per week",
      "Publish 1 original data point / benchmark",
      "Reach out to 5 non-competing directories",
      "Guest post on 1 industry engagement blog",
      "Podcast interview outreach (5 shows)",
      "Set up quarterly the owner's counsel change-log post cadence"
    ],
    "final_recommendation": "Build a statute-fluent authority site around \"340B independent audit\". Ship the trust surface, the product page, and the HRSA program-integrity guidance pillar first; earn links with the source-trace template and the annual benchmark; keep every statute page primary-source-cited with a change log. Do not build city pages, programmatic doorways, or national content — the buyer searches by statute and form, and the season decides the calendar.",
    "disclaimers": [
      "All volume/difficulty/CPC labels are RELATIVE ESTIMATES (low/medium/high), not exact numbers. Validate with Semrush, Ahrefs, or Google Search Console before committing spend.",
      "This brief is deterministic per blueprint — it will not shift between renders. Any changes should be made in code, not in prompts.",
      "YMYL topic: language must stay cautious; nothing here is legal/medical/financial advice."
    ]
  },
  "microsite": {
    "category": "340B program-integrity & independent audit",
    "shortTitle": "ClaimClear",
    "audience": "340B covered entities with contract pharmacies — program managers, pharmacy directors, and compliance officers",
    "problem": "Every contract-pharmacy 340B claim must trace to an eligible encounter with no diversion and no duplicate discount; a wrong claim risks a repayment demand, an HRSA finding, or removal from the program — while HRSA requires an annual independent audit and certified 340B talent is scarce.",
    "offer": "Done-for-you independent 340B audits — Eligibility Match, Compliance Lint, Duplicate-Discount Reconciliation — reviewed and signed by an Apexus-certified 340B expert and a pharmacist reviewer, priced per audit or per audited claim.",
    "faq": [
      {
        "q": "Which teams get value from ClaimClear on day one?",
        "a": "ClaimClear sits between the 340B program manager who owns the HRSA relationship and the pharmacy/compliance staff who assemble claim evidence. Staff hand off the TPA accumulator export and EHR encounter feed; the desk hands back a Signed Independent Opinion — both sides work from the same source-traced record."
      },
      {
        "q": "What makes an Audit Package defensible when an HRSA examiner reads it closely?",
        "a": "The record an examiner asks for is the record the package already carries: every Audited Claim → source feed → HRSA rule citation → certified sign-off, held for the record-retention period. The Exception Register shows cleared or flagged per rule, with a named resolution for anything open."
      },
      {
        "q": "What do I actually get back from ClaimClear?",
        "a": "A Signed Independent Opinion, the Eligibility Match detail with every claim cited, the Exception Register, the Compliance Lint report, a Duplicate-Discount Reconciliation note for every flagged claim, and the Recapture File — reviewed by an Apexus-certified 340B expert and a pharmacist reviewer."
      },
      {
        "q": "Is there a shelf price for an audit?",
        "a": "Yes — $12,000–$35,000 per audit for the Contract-Pharmacy Eligibility Integrity Audit. The Continuous-Integrity Subscription runs $3,000–$9,000 per entity per month. A Full Annual Independent Audit runs $25,000–$60,000. Rush under two weeks adds $3,000–$8,000. Never hourly, never contingency-only."
      },
      {
        "q": "Do you certify or report to HRSA on our behalf?",
        "a": "No. You remain the covered entity of record and the party accountable to HRSA. We test, draft, and sign the independent audit opinion within our scope; you decide how and when to use it."
      },
      {
        "q": "How do you handle claim and encounter data?",
        "a": "Strictly under a signed BAA and read-only feed access — we never take custody of data outside the agreed scope. Role-based access, encryption, full audit logs, and a signed data agreement, and we reconcile every duplicate-discount exception before delivery."
      },
      {
        "q": "What changed after the Genesis ruling and the vacated rebate-model pilot?",
        "a": "The patient-definition question is contested and the rebate-model pilot was vacated in February 2026 with a new RFI open. We document methodology against HRSA's currently stated position, flag contested cohorts rather than silently resolving them, and run a versioned rule pack updated as guidance changes."
      },
      {
        "q": "Are you a law firm, or do you represent us to HRSA?",
        "a": "Neither. We are an independent 340B audit and documentation-preparation desk. We do not give legal advice, make eligibility or carve-in policy decisions, or correspond with HRSA on your behalf. Legal questions route to your counsel; HRSA remains the examiner of record."
      }
    ],
    "process": [
      {
        "title": "Connect your feeds",
        "body": "Read-only TPA accumulator export, EHR encounter data, dispensing and purchasing records, and Medicaid carve-in status land in a secure, least-privilege engagement under a signed data agreement. An Audit Engagement opens and required-feed gating starts."
      },
      {
        "title": "Match and test every claim",
        "body": "Every Audited Claim is classified and matched to an eligible encounter, priced against NDC/WAC, and tested against the Medicaid Exclusion File, GPO-prohibition, and sampling-integrity rules — each figure pinned to a source and a rule. Nothing is guessed — a required value with no source becomes a named exception."
      },
      {
        "title": "Run Compliance Lint",
        "body": "Deterministic Medicaid Exclusion File, GPO-prohibition, and pricing checks run as code; every duplicate-discount discrepancy is drafted for compliant resolution before it becomes a finding."
      },
      {
        "title": "Certified Review clears the queue",
        "body": "An Apexus-certified 340B expert and a pharmacist reviewer verify contested-eligibility and low-confidence claims against the cited evidence and confirm the testing methodology. No anonymous output ships."
      },
      {
        "title": "We sign; you stay of record",
        "body": "The certified reviewer signs the Signed Independent Opinion within scope. You remain the covered entity of record to HRSA — we never certify or correspond with HRSA on your behalf."
      },
      {
        "title": "Deliver, defend, and renew",
        "body": "The Audit Package — opinion, Exception Register, Recapture File, audit trail — ships to your authorizing official. A Continuous-Integrity Subscription keeps monitoring live between annual cycles, and the next independent audit is scheduled ahead of your HRSA deadline."
      }
    ],
    "northStarCta": {
      "label": "Request a free Diversion & Duplicate-Discount Risk Scan",
      "href": "/contact",
      "secondary_label": "See how it works",
      "secondary_href": "/how-it-works"
    },
    "ubiquitousLanguage": {
      "audience": "340B covered entities with contract pharmacies who need HRSA's mandated annual independent audit",
      "domain": "Section 340B of the Public Health Service Act & HRSA program-integrity guidance (Eligibility Match / Compliance Lint / Medicaid Exclusion File / HRSA audit)",
      "deliverable": "Signed Independent Opinion with claim-level source traces",
      "reviewer": "Apexus-certified 340B expert + pharmacist reviewer",
      "record": "append-only Audit Package (Eligibility Match + Compliance Lint + Duplicate-Discount Reconciliation + certified sign-off)",
      "unit_of_work": "audited claim",
      "cta_primary": "Request a free Diversion & Duplicate-Discount Risk Scan",
      "cta_secondary": "See how it works",
      "regulator": "HRSA's Office of Pharmacy Affairs",
      "regulator_full": "HRSA's Office of Pharmacy Affairs, which conducts the annual independent-audit review, and the covered entity's counsel who advises on eligibility policy",
      "statute": "Section 340B of the Public Health Service Act & HRSA program-integrity guidance",
      "trigger_moment": "the annual independent-audit due date and an HRSA data-request letter",
      "event_intake_started": "340b_compliance_audit_engine_intake_started",
      "event_conversation_requested": "340b_compliance_audit_engine_conversation_requested"
    },
    "trust": {
      "standards": [
        "Every Audited Claim traces to a source feed and an HRSA program-integrity rule citation from the entity's own records.",
        "An Apexus-certified 340B expert and a pharmacist reviewer verify and sign every Audit Package before delivery — no unreviewed AI output ships.",
        "Audit records — intake, Eligibility Match, Compliance Lint, Duplicate-Discount Reconciliation, certified sign-off — are retained for the record-retention period in an append-only, hash-chained log."
      ],
      "response_time": "We reply within two business days — your HRSA audit deadline doesn't wait for a sales rep.",
      "data_handling": "Your claim and encounter data stay in least-privilege, per-entity folders under a signed BAA, within the scope you authorize. We never train on your data without a written agreement."
    },
    "hook": "Your contract-pharmacy 340B claims, independently audited — and signed.",
    "sub_headline": "Connect your TPA accumulator and EHR encounter feed. Get back a Signed Independent Opinion, certified-reviewed, in three weeks. You stay the party of record; your program stays defensible.",
    "dream_outcome": "Every contract-pharmacy claim tests clean or gets a documented, resolved exception; every duplicate-discount discrepancy is reconciled before your next HRSA cycle; and every independent audit comes back clean — without sampling a fraction of your claims or depending on one irreplaceable analyst.",
    "specific_pains": [
      "Diversion findings hold up repayment demands and put program continuation at risk.",
      "Duplicate-discount exceptions pile up when carve-in/carve-out status isn't reconciled against the Medicaid Exclusion File.",
      "Multiple TPAs across sites apply inconsistent eligibility logic, creating gaps no one is watching until an examiner finds them.",
      "HRSA requires an annual independent audit for contract-pharmacy entities — sampled hourly consulting doesn't test 100% of volume.",
      "Apexus-certified 340B talent is scarce; losing one analyst strands a whole program's audit readiness."
    ],
    "cost_of_inaction": "An unresolved diversion or duplicate-discount exception becomes a repayment demand or an HRSA finding. Left unaddressed across a growing $81.4B program with 10x scrutiny on hospitals, these failure modes compound on the exact claims your scarce staff must defend.",
    "mechanism": {
      "name": "The ClaimClear independent-audit engine",
      "steps": [
        {
          "title": "Connect your feeds",
          "body": "Read-only TPA accumulator export, EHR encounter data, dispensing and purchasing records, and Medicaid carve-in status land in a secure, least-privilege engagement under a signed data agreement. An Audit Engagement opens and required-feed gating starts."
        },
        {
          "title": "Match and test every claim",
          "body": "Every Audited Claim is matched to an eligible encounter, priced against NDC/WAC, and tested against the Medicaid Exclusion File, GPO-prohibition, and sampling-integrity rules — each figure pinned to a source and a rule. Nothing is guessed — a required value with no source becomes a named exception."
        },
        {
          "title": "Run Compliance Lint",
          "body": "Deterministic Medicaid Exclusion File, GPO-prohibition, and pricing checks run as code; every duplicate-discount discrepancy is drafted for compliant resolution before it becomes a finding."
        },
        {
          "title": "A certified reviewer verifies and signs",
          "body": "An Apexus-certified 340B expert and a pharmacist reviewer verify extraction against the cited evidence, clear contested-eligibility and low-confidence claims, and sign the Signed Independent Opinion. No anonymous output ships."
        },
        {
          "title": "You stay of record; we assemble the Recapture File",
          "body": "You remain the covered entity of record to HRSA; cleared, eligible-but-missed claims assemble into the Recapture File, and the Audit Package is retained for the record-retention period."
        }
      ]
    },
    "offer_stack": [
      {
        "item": "Signed Independent Opinion with claim-level source traces",
        "note": "the audit opinion drafted with an HRSA rule citation behind every eligibility and pricing determination, in the format entities and HRSA examiners expect"
      },
      {
        "item": "Eligibility Match detail",
        "note": "every contract-pharmacy claim matched to an eligible encounter and priced against NDC/WAC, tested at 100% of volume by default"
      },
      {
        "item": "Compliance Lint report",
        "note": "every claim run through a local Medicaid Exclusion File / GPO-prohibition / pricing rule simulator before the opinion is finalized"
      },
      {
        "item": "Duplicate-Discount Reconciliation note",
        "note": "every carve-in/carve-out discrepancy identified and resolved the compliant way before it becomes a finding"
      },
      {
        "item": "Apexus-certified expert + pharmacist on every release",
        "note": "release recorded with timestamp, source references, and the testing methodology the certified reviewer signed against — you decide how to use the opinion"
      },
      {
        "item": "Exception Register + Recapture File",
        "note": "every flagged claim with the rule it failed, plus legitimately eligible claims your TPA logic missed, ready to submit for savings"
      }
    ],
    "guarantee": "Examiner-Attributable-Finding Guarantee: if HRSA issues a finding attributable to our testing on a claim we certified as clean, we re-audit the affected scope at no charge and credit your next audit. The Continuous-Integrity Subscription is month-to-month with 30-day notice.",
    "urgency": "340B purchases hit $81.4B in 2024, up 23% in a year, and HRSA audits hospitals at 10x the rate of manufacturers. The annual independent audit is mandatory for contract-pharmacy entities now, and the post-Genesis patient-definition and rebate-model rules are shifting under every existing audit.",
    "objections": [
      {
        "q": "Isn't this just what our TPA or capture software already does?",
        "a": "Software hosts the accumulator and flags anomalies for you to resolve; it cannot be your independent auditor because you operate it. We sell the finished, certified-signed outcome — not another login."
      },
      {
        "q": "We can't let an outside vendor touch our claim or encounter data.",
        "a": "You don't have to give up control. We operate under a signed BAA on read-only feed access, never take custody outside the agreed scope, and log every access. Many entities already outsource independent audits this way."
      },
      {
        "q": "What if HRSA disagrees with your finding?",
        "a": "You remain the party of record, so the accountability surface stays with your program. We document a rule citation for every determination, carry E&O coverage, and re-audit any affected scope under the Examiner-Attributable-Finding Guarantee."
      },
      {
        "q": "The rebate-model pilot and the patient definition keep changing — why act now?",
        "a": "The mandated annual independent-audit requirement persists regardless of which rule is in flux. We run a versioned rule pack and update it as HRSA guidance changes — the churn is exactly why a continuously-updated service beats static software."
      },
      {
        "q": "We're a smaller FQHC — are we too small for you?",
        "a": "FQHCs and single-hospital DSH entities are the target. You're too exposed for a spreadsheet and too small to build an in-house integrity bench, and hourly consulting samples only a fraction of your claims. Per-audit pricing fits you exactly."
      },
      {
        "q": "Can you also operate our TPA or capture software?",
        "a": "No, by design. HRSA's independence requirement means an auditor cannot also operate the program it audits. We keep the independent-audit lane strictly separate and decline conflicted engagements."
      }
    ],
    "who_this_is_not_for": [
      "Entities wanting us to make eligibility or carve-in policy decisions — those stay with you and your counsel.",
      "Entities wanting us to also operate their TPA or capture software for the same audit period — an independence conflict we decline.",
      "Anyone seeking contingency-only pricing on recovered savings — recapture-share is an optional add-on after legal review, never the sole model."
    ],
    "proof_pillars": [
      {
        "title": "Every claim cites a rule and a source",
        "body": "Each Audited Claim traces to a source feed and an HRSA program-integrity rule citation — the exact record an HRSA examiner asks for."
      },
      {
        "title": "A certified reviewer signs before delivery",
        "body": "No unreviewed output ships. An Apexus-certified expert and a pharmacist reviewer clear every contested-eligibility claim and sign the opinion."
      },
      {
        "title": "100% of volume tested, duplicate-discounts reconciled",
        "body": "Every claim passes a local Medicaid Exclusion File / GPO-prohibition / pricing simulator, and every duplicate-discount exception is resolved before delivery."
      }
    ],
    "stakes_line": "An unverified contract-pharmacy claim risks a repayment demand, holds up recapture, and becomes an HRSA finding — at the tail, program removal.",
    "deliverable": "Audit Package (Signed Independent Opinion + Eligibility Match + Compliance Lint + Duplicate-Discount Reconciliation + Exception Register + Recapture File)",
    "unit_of_work": "audited claim",
    "lexicon": {
      "regulator": "HRSA's Office of Pharmacy Affairs",
      "regulator_full": "HRSA's Office of Pharmacy Affairs, which conducts the annual independent-audit review, and the covered entity's counsel who advises on eligibility policy",
      "statute": "Section 340B of the Public Health Service Act & HRSA program-integrity guidance",
      "statute_frame": "the independent-audit workflow where an unverified claim risks a repayment demand, a duplicate-discount finding, or program removal",
      "persona": "340B program manager / compliance officer at a covered entity",
      "persona_moment": "You're a 340B program manager at a DSH hospital. Your annual independent audit is due, duplicate-discount exceptions are piling up across two TPAs, and you can't prove which contract-pharmacy claims will survive an HRSA examiner.",
      "trigger_moment": "the annual independent-audit due date and an HRSA data-request letter",
      "enforcement_stakes": "repayment demands, uncollectible duplicate-discount exceptions, HRSA findings requiring corrective action, and at the tail, program removal",
      "retention": "the record-retention period for the audit engagement",
      "cta_verb": "Request a free Diversion & Duplicate-Discount Risk Scan",
      "intake_checklist": [
        "The prior independent-audit report and any outstanding HRSA corrective-action items",
        "A read-only TPA accumulator export for the audit period",
        "EHR encounter and provider data covering the same period",
        "Dispensing and purchasing records by NDC and site",
        "Current Medicaid carve-in/carve-out status per site",
        "Manufacturer-restriction status for NDCs in scope",
        "OPAIS registration and contract-pharmacy site list"
      ],
      "trust_standards_specific": [
        "Every computed determination cites a source feed and an HRSA program-integrity rule",
        "Medicaid Exclusion File / GPO-prohibition / pricing exceptions are simulated before the opinion is finalized — fatal-exception escapes target zero",
        "Duplicate-discount exceptions are reconciled before the next HRSA audit cycle",
        "An Apexus-certified expert and a pharmacist reviewer sign the opinion; the covered entity stays the party of record",
        "Claim and encounter data are never held outside the entity-authorized scope"
      ],
      "regulator_faqs": [
        {
          "q": "Who reviews these files after you deliver the opinion?",
          "a": "HRSA's Office of Pharmacy Affairs, through the annual independent-audit review and any data-request letter. Our Audit Package is built to survive that review."
        },
        {
          "q": "Does ClaimClear correspond with HRSA for us?",
          "a": "No. You remain the covered entity of record and decide how to use the opinion in any HRSA correspondence. We test, validate, and sign within our scope; we do not represent you to HRSA or make your eligibility policy decisions."
        },
        {
          "q": "What happens if HRSA still finds something?",
          "a": "On serviced audits our target is zero examiner-attributable findings. If a finding traces to our testing, we remediate under the Examiner-Attributable-Finding Guarantee; findings on eligibility policy or entity decisions remain the entity's and counsel's."
        },
        {
          "q": "How do you keep up with HRSA guidance changes?",
          "a": "A versioned Rule Pack decoupled from code, primary-source monitoring of HRSA and the Federal Register, and a five-business-day update SLA with a customer changelog."
        }
      ]
    },
    "proof_angle": {
      "id": "340b-compliance-audit-engine-proof",
      "headline": "Examiner-defensible clearance, proven on your claims",
      "lever": "a free Diversion & Duplicate-Discount Risk Scan on a sample of your contract-pharmacy claims",
      "outcome_verb": "clear",
      "outcome_frame": "audits that clear HRSA review and survive an examiner's data request",
      "proof_promise": "Rather than invent testimonials, we show examiner-defensible clearance rate, certified-reviewer minutes per audit, and duplicate-discount-resolved-before-cycle rates as the first audits ship."
    },
    "indexable": true
  },
  "evidence": [
    {
      "id": "340b-compliance-audit-engine-e1",
      "business_slug": "340b-compliance-audit-engine",
      "area": "Identity",
      "claim_or_finding": "Legal entity, registered address, and jurisdiction of formation are not yet declared.",
      "status": "owner-action",
      "evidence": "No owner-supplied facts on file.",
      "verification_command": "Owner submits entity + jurisdiction-of-formation certification.",
      "fix_owner": "owner",
      "remediation": "Provide entity name, registration number, and jurisdiction of formation.",
      "severity": "blocker"
    },
    {
      "id": "340b-compliance-audit-engine-e2",
      "business_slug": "340b-compliance-audit-engine",
      "area": "Trust boundary",
      "claim_or_finding": "Public page is a validation microsite; not a regulated operational service.",
      "status": "verified",
      "evidence": "Microsite carries an explicit trust-boundary / compliance block.",
      "verification_command": "Inspect /microsites/340b-compliance-audit-engine for trust boundary.",
      "fix_owner": "engineering",
      "remediation": "None — enforced by template.",
      "severity": "low"
    },
    {
      "id": "340b-compliance-audit-engine-e3",
      "business_slug": "340b-compliance-audit-engine",
      "area": "SEO integrity",
      "claim_or_finding": "No fake review, rating, LocalBusiness, or Organization identity schema is emitted; no FAQ rich-result (FAQPage) schema is emitted per current Google guidance.",
      "status": "verified",
      "evidence": "Only WebPage schema is generated; FAQ content is plain text, not marked up as FAQPage.",
      "verification_command": "View SEO Factory row for 340b-compliance-audit-engine",
      "fix_owner": "engineering",
      "remediation": "None — enforced by the SEO factory and DESIGN-STANDARD.",
      "severity": "low"
    },
    {
      "id": "340b-compliance-audit-engine-e4",
      "business_slug": "340b-compliance-audit-engine",
      "area": "Regulated claims",
      "claim_or_finding": "Elevated trust burden — legal-adjacent claims (independent audit opinion, HRSA program-integrity testing) gated on owner facts.",
      "status": "release-blocker",
      "evidence": "Trust burden = High (regulated federal drug-discount program; strict-liability findings).",
      "verification_command": "Complete owner-facts intake for licensing-boundary confirmation.",
      "fix_owner": "owner",
      "remediation": "Provide licensing-boundary confirmation, Apexus-certification arrangements, E&O insurance carrier/limits, and disclosure facts.",
      "severity": "high"
    },
    {
      "id": "340b-compliance-audit-engine-e5",
      "business_slug": "340b-compliance-audit-engine",
      "area": "Manifest coverage",
      "claim_or_finding": "Manifest-backed blueprint present at repo root.",
      "status": "assumed",
      "evidence": "docs/INVENTORY.json entry; blueprint_html on file.",
      "verification_command": "Cross-check docs/INVENTORY.json and builds/manifest.json.",
      "fix_owner": "engineering",
      "remediation": "Attach the manifest run to the evidence register.",
      "severity": "medium"
    },
    {
      "id": "340b-compliance-audit-engine-e6",
      "business_slug": "340b-compliance-audit-engine",
      "area": "Compliance floor — consumer debt",
      "claim_or_finding": "This business audits 340B drug-pricing claims for covered entities (hospitals, FQHCs); it has no consumer/personal debt-collection, consumer-lending, or credit-repair component.",
      "status": "verified",
      "evidence": "Blueprint buyer is a 340B program manager/pharmacy director/compliance officer at a covered entity; no consumer-facing debt product anywhere in scope.",
      "verification_command": "Review business-plan.md target buyer + offer-and-pricing.md qualification section.",
      "fix_owner": "engineering",
      "remediation": "None — the consumer/personal-debt hard-block does not apply to this business.",
      "severity": "low"
    }
  ],
  "seo_pages": {
    "id": "seo-340b-compliance-audit-engine",
    "business_slug": "340b-compliance-audit-engine",
    "route": "/microsites/340b-compliance-audit-engine",
    "title": "ClaimClear — Independent 340B Audit & Contract-Pharmacy Eligibility",
    "description": "ClaimClear for 340B program managers and compliance officers and the covered entities they answer for. Own the \"independent 340B audit\" topic cluster by covering HRSA program-integrity guidance end to end.",
    "canonical": "/microsites/340b-compliance-audit-engine",
    "og_title": "ClaimClear",
    "og_description": "ClaimClear for 340B program managers and compliance officers and the covered entities they answer for. Own the \"independent 340B audit\" topic cluster by covering HRSA program-integrity guidance end to end.",
    "schema_type": "WebPage",
    "schema_status": "pending-owner-facts",
    "sitemap_include": false,
    "noindex": true
  },
  "vertical_style": {
    "accent": "clinical-teal",
    "signature": "Audit-dossier tabs with entity + scope chip",
    "layout": "Independent audit dossier index",
    "anti": "Cartoon pill bottle or gavel mascots"
  },
  "canva": {
    "slug": "340b-compliance-audit-engine",
    "territory": "Independent Audit Dossier",
    "family": {
      "id": "legal-compliance",
      "name": "Legal / Compliance",
      "motion": "calm"
    },
    "tokens": {
      "brand": "174 68% 17%",
      "brand-fg": "150 30% 96%",
      "surface": "165 20% 98%",
      "ink": "166 36% 10%",
      "muted": "170 15% 33%",
      "accent": "16 66% 39%"
    },
    "type": {
      "display": "Libre Caslon Text",
      "body": "Source Sans 3",
      "fonts_url": "https://fonts.googleapis.com/css2?family=Libre+Caslon+Text:wght@400;700&family=Source+Sans+3:wght@400;500;600&display=swap"
    },
    "scale": {
      "h1": "clamp(2.5rem, 5.5vw, 4.25rem)",
      "h2": "clamp(1.75rem, 3vw, 2.5rem)",
      "h3": "clamp(1.25rem, 2vw, 1.5rem)",
      "body": "clamp(1rem, 1.1vw, 1.125rem)",
      "small": "0.8125rem",
      "tracking_display": "-0.02em",
      "tracking_body": "-0.005em",
      "weight_display": 700,
      "weight_body": 450
    },
    "spacing": {
      "card_padding": "1.75rem",
      "card_radius": "0.46rem",
      "card_shadow": "0 0 0 1px hsl(var(--ink) / 0.08)",
      "section_gap": "clamp(3.5rem, 8vw, 6.5rem)",
      "hero_gap": "clamp(1.25rem, 2vw, 2rem)"
    },
    "layout": {
      "hero": "centered-editorial",
      "card": "gradient-frame",
      "cta": "outlined-brand",
      "archetype": "stacked-editorial",
      "card_silhouette": "flat-outline",
      "button_geometry": "sharp"
    },
    "background": {
      "hero_gradient": "radial-gradient(1200px 600px at 10% -10%, hsl(16 66% 39% / 0.18), transparent 60%), radial-gradient(900px 500px at 90% 10%, hsl(174 68% 17% / 0.12), transparent 55%)",
      "cta_gradient": "linear-gradient(135deg, hsl(174 68% 17%), hsl(16 66% 39%))",
      "section_wash": "linear-gradient(180deg, hsl(165 20% 97%) 0%, hsl(174 68% 17% / 0.04) 100%)"
    },
    "motif": "Claim ledger + exhibit list"
  },
  "capabilities": {
    "marketing": true,
    "portal": true,
    "ops": true,
    "chatbot": true,
    "payments": false
  },
  "generated_at": "2026-07-18T05:24:41Z",
  "checksum": "sha256:8145cedf31a83bbdf05ac968e65c22c46e406beea8fc50c94b279e4908474295"
}