{
 "version": "1.8.0",
 "slug": "nyc-outdoor-dining-permit-completeness-pack-engine",
 "title": "PatioClear — NYC Outdoor Dining Permit Completeness Pack Desk",
 "vertical": "Foodservice compliance / municipal permitting",
 "seed": {
  "s": "nyc-outdoor-dining-permit-completeness-pack-engine",
  "t": "PatioClear — NYC Outdoor Dining Permit Completeness Pack Desk",
  "v": "Foodservice compliance / municipal permitting",
  "r": "Medium",
  "m": "M"
 },
 "product": {
  "slug": "nyc-outdoor-dining-permit-completeness-pack-engine",
  "project_name": "PatioClear — NYC Outdoor Dining Permit Completeness Pack Desk",
  "project_type": "DOT-fluent applications-processing workflow application",
  "vertical": "Foodservice compliance / municipal permitting",
  "audience": "owner-operators, restaurant administrators, and RCM leads at restaurants",
  "geography": "US, ministerial applications-processing scope first (verified against New York DFS guidance); state-by-state adjuster/TPA licensing review gated before each new state activates",
  "scale_expectation": "3-22 practice logos in year one; per-application volume tied to each practice's insured-client share; high artifact fidelity",
  "core_workflows": [
   "Visit intake & medical-record/invoice extraction",
   "DOT rule library & completeness-checklist matching",
   "Application packet assembly & hospitality-ops-reviewer release",
   "Submission, status tracking & portal-status reconciliation"
  ],
  "discovery": {
   "one_line_purpose": "On PatioClear, owner-operators stop chasing permit paperwork and start shipping applications. A visit's portal status export and site-plan packet are extracted at intake, checked against that DOT's gap matrix in deterministic code, and every Completeness Pack releases with a hospitality-ops-reviewer signature and a full audit trail.",
   "primary_users": [
    "owner-operators, restaurant administrators, and RCM leads at restaurants",
    "Hospitality-ops reviewer / ops reviewer or ops-reviewer (clinical sign-off)",
    "Restaurant owner (applicant of record, read-only status link)"
   ],
   "jobs_to_be_done": [
    "Get every applicant restaurant's application submitted within 24 hours without a GM staffer rebuilding it from the chart",
    "Catch applications pending past an DOT's normal processing window before the client complains",
    "Hand a client a fast, accurate benefit estimate before they decide on a costly treatment plan"
   ],
   "value_prop": "PatioClear turns a scattered, multi-DOT applications-paperwork burden into a submitted, tracked, reconciled application per visit — reviewer-released, audit-ready, with the practice always the commercial party and the DOT always the one deciding coverage.",
   "competitors": [
    "DOT Portal's single-DOT Vet Portal, which still requires the restaurant to set it up and run it",
    "General restaurant ops-tracker platforms that store policy fields but never assemble or submit a application",
    "The GM staffer with ten free minutes, which is where this work lives today"
   ],
   "differentiation": "Done-for-you application packets, not a portal: a maintained, city-by-city completeness-checklist library, a hospitality-ops-reviewer signature on every submission, ops reviewer/ops-reviewer sign-off on clinical CAR response language, and an status update-reconciliation trail — never a guess at coverage or payment.",
   "positioning_statement": "For owner-operators and GMs at restaurants who inherited the informal job of 'whoever has ten free minutes' filing permit applications, PatioClear is the done-for-you applications-processing desk that turns every applicant restaurant's visit into a submitted, tracked, and reconciled application within 24 hours — unlike DOT Portal's single-DOT Vet Portal, which covers one carrier and still requires restaurant staff to operate it, or general ops-tracker platforms, which store policy fields but never submit a application."
  },
  "assumptions": [
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-a1",
    "statement": "Practices will pay a flat per-application fee for a reviewer-released, audit-traceable submission over doing it in-house.",
    "confidence": "medium",
    "impact_if_wrong": "severe",
    "revisit_trigger": "First 5 design-partner sales calls — reject if willingness-to-pay signal is absent."
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-a2",
    "statement": "A practice's portal status export and site-plan packet contain enough structured data to extract a complete application without a direct ops-tracker integration at launch.",
    "confidence": "medium",
    "impact_if_wrong": "high",
    "revisit_trigger": "First real customer onboarding cycle."
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-a3",
    "statement": "Insured clients will sign a client authorization naming PatioClear as processing agent, modeled on the DOT Portal Express assignment-of-benefits pattern.",
    "confidence": "medium",
    "impact_if_wrong": "high",
    "revisit_trigger": "First client-facing pilot rollout."
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-a4",
    "statement": "Ministerial applications-processing does not trigger adjuster/TPA licensure outside the New York guidance reviewed this run.",
    "confidence": "low",
    "impact_if_wrong": "severe",
    "revisit_trigger": "Counsel review before each new state activates."
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-a5",
    "statement": "Single-tenant per practice is not required for the first cohort — logical isolation with row-level auth is acceptable.",
    "confidence": "medium",
    "impact_if_wrong": "high",
    "revisit_trigger": "Any prospect with a hard single-tenant SOC/ISO clause."
   }
  ],
  "unknowns": [
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-u1",
    "question": "Which specific hospitality-ops reviewer and clinical sign-off contact will practices use at launch?",
    "blocks": "Any commercial application; client-facing delivery.",
    "resolution_path": "Named reviewer + engagement letter on file before commercial engagement."
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-u2",
    "question": "Which insurers and states are in scope for launch?",
    "blocks": "Rule-library build order; licensing-boundary review scope.",
    "resolution_path": "Owner confirms launch DOT list (top 4-5 by application volume) and launch states in the owner-action pack."
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-u3",
    "question": "What is the actual willingness-to-pay per application?",
    "blocks": "Pricing hypothesis; unit economics.",
    "resolution_path": "5 design-partner discovery calls with an explicit pricing conversation."
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-u4",
    "question": "Which ops-tracker export formats must this integrate with day-one?",
    "blocks": "Architecture module boundaries; extraction-prompt design.",
    "resolution_path": "Design-partner tech-inventory questionnaire (DOT portal, Setup Guide, CAR tracker, DOT Marketplace, clearance rulebook)."
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-u5",
    "question": "Is there a data-residency or on-prem constraint from any design partner?",
    "blocks": "Deployment topology; hosting/region choice.",
    "resolution_path": "Vendor-diligence questionnaire from first prospect."
   }
  ],
  "expert_panel": [
   {
    "role": "Product Strategy",
    "key_concern": "Is the ICP narrow enough to earn a first design-partner cohort?",
    "recommendation": "Constrain the ICP to independent/small-group specialty and emergency restaurants for launch; broaden only after 5 signed design partners.",
    "dissent": "May under-price total addressable market and slow fundraising narrative."
   },
   {
    "role": "Software Architecture",
    "key_concern": "Are we defaulting to microservices/serverless without justification?",
    "recommendation": "Single deployable modular monolith with a documented seam for the highest-volume module.",
    "dissent": "May feel unsophisticated to enterprise reviewers who expect a service-mesh diagram."
   },
   {
    "role": "Frontend / UX",
    "key_concern": "Is the evidence spine visible and trustable in every workflow?",
    "recommendation": "Every artifact view must render application → evidence → reviewer signature in one glance.",
    "dissent": "Adds vertical density that non-domain reviewers may call cluttered."
   },
   {
    "role": "Backend / Data",
    "key_concern": "Is the audit trail append-only and reconstructable?",
    "recommendation": "Event-sourced audit log for all state transitions; snapshots for read models.",
    "dissent": "Higher write-path complexity than plain CRUD; discipline required on schema evolution."
   },
   {
    "role": "AI / ML",
    "key_concern": "Are AI outputs grounded, cited, and reviewer-gated?",
    "recommendation": "Retrieval-first with source citations, structured output validation, and human-in-the-loop for external delivery.",
    "dissent": "Slower than open-ended chat; may frustrate prospects expecting 'agentic magic'."
   },
   {
    "role": "Security",
    "key_concern": "Is the STRIDE surface documented and mitigated?",
    "recommendation": "Threat model per module, per-tenant isolation with row-level auth, secrets in managed KMS, dependency scanning in CI.",
    "dissent": "Overhead in early prototype; some controls can wait until first paying customer."
   },
   {
    "role": "Privacy / Compliance",
    "key_concern": "Is the compliance target realistic for year-one team size?",
    "recommendation": "SOC 2 Type I in year one with mapped controls for downstream Type II; defer heavier frameworks until required by a real contract.",
    "dissent": "May lock out enterprise buyers requiring HITRUST/ISO on day one."
   },
   {
    "role": "DevOps / Reliability",
    "key_concern": "Is the ops model boring enough to run without a dedicated SRE?",
    "recommendation": "Single production region + managed database + Vercel/Cloud edge; SLO published as availability + p95 latency only.",
    "dissent": "Single region concentrates risk during regional outages."
   },
   {
    "role": "Data / Analytics",
    "key_concern": "Are the leading indicators wired before launch?",
    "recommendation": "Instrument activation, artifact-completion, and reviewer-signoff events; ship dashboards before first design partner.",
    "dissent": "Analytics scope-creep can steal weeks from core product."
   },
   {
    "role": "Accessibility",
    "key_concern": "Does the workflow meet WCAG 2.2 AA for every screen a reviewer uses?",
    "recommendation": "Enforce keyboard-only walkthrough for every workflow; add axe-core to CI on the reviewer surfaces.",
    "dissent": "Density-heavy vertical UIs are hard to ship AA-clean quickly."
   },
   {
    "role": "SEO / Content",
    "key_concern": "Is the microsite application honest and gated on evidence?",
    "recommendation": "Regulator-fluent topical-authority content only; no fake reviews, no LocalBusiness identity schema until owner-facts close.",
    "dissent": "Slower content velocity than a generic SaaS blog."
   },
   {
    "role": "Executive Sponsor",
    "key_concern": "Is there a written kill criterion?",
    "recommendation": "Kill/pivot decision at 90 days if no design-partner LOI or if reviewer-signoff cycle exceeds 5 business days.",
    "dissent": "Founders often resist naming kill criteria in writing."
   }
  ],
  "strategy": {
   "business_model": "B2B flat per-application fee + per-location monthly retainer, never hourly",
   "revenue_streams": [
    "Completeness Pack (per-application fee)",
    "CAR Response Pack (per-CAR response fee)",
    "Season Desk (per-location monthly)"
   ],
   "moat": [
    "Maintained city-by-city completeness-checklist library",
    "ops-tracker export/integration familiarity",
    "Portfolio-wide application-status tracking + status update-reconciliation audit trail"
   ],
   "gtm": [
    "Founder-led design-partner cohort (5-10 practices)",
    "Specialty/emergency-restaurant outbound + restaurant trade-association presence",
    "Free Application Gap Scan lead magnet"
   ],
   "pricing_hypothesis": "Launch at $12/application (low end of the $12-18 band); validate willingness-to-pay before any tier increase.",
   "kill_criteria": [
    "No signed design-partner LOI in 4 weeks",
    "Applications-reviewer sign-off cycle exceeds 24 hours after Phase 1",
    "No paid conversion by week 20",
    "A state's adjuster/TPA statute is confirmed to sweep in ministerial applications-processing"
   ]
  },
  "security": {
   "stride": [
    {
     "threat": "Spoofing",
     "scenario": "Attacker attempts to impersonate a reviewer to sign off on a fabricated artifact.",
     "mitigation": "SSO with MFA; reviewer signatures bound to a cryptographic session application, not a form field."
    },
    {
     "threat": "Tampering",
     "scenario": "Historical evidence entries edited after the fact to hide a bad application.",
     "mitigation": "Append-only audit log; hash-chained artifact snapshots; diff view on every reviewer surface."
    },
    {
     "threat": "Repudiation",
     "scenario": "Reviewer denies signing off on a delivered artifact.",
     "mitigation": "Signed attestations with server-side timestamp + reviewer identity; export bundle includes signature manifest."
    },
    {
     "threat": "Information Disclosure",
     "scenario": "Cross-tenant leak of Regulated-record, PII, Internal-audit data through shared indices, logs, or prompts.",
     "mitigation": "Tenant-scoped row-level auth; PII scrubbing in logs; retrieval indices partitioned per tenant."
    },
    {
     "threat": "Pause of Service",
     "scenario": "Runaway AI job or export exhausts shared workers.",
     "mitigation": "Per-tenant concurrency + budget caps; circuit breaker on model calls; degrade-gracefully queue."
    },
    {
     "threat": "Elevation of Privilege",
     "scenario": "Standard user acquires 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-tenant isolation; DPA + BAA templates on file; DSAR runbook published.",
   "compliance_targets": [
    "the gap matrix 3-year record retention",
    "SOC 2 Type II",
    "ISO 27001 (year two)"
   ],
   "data_classifications": [
    "Regulated-record",
    "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 tenant + 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": [
    "Application packet submitted without hospitality-ops-reviewer review",
    "Cross-DOT completeness-rule confusion (one DOT's checklist applied to another's application)",
    "DOT-facing or client-facing errors attributed to AI without a human signature"
   ],
   "ethical_guardrails": [
    "Applications-reviewer sign-off required before every submission",
    "Per-DOT rule-set isolation (each RequirementRuleSet versioned and scoped to its own carrier)",
    "AI-usage disclosure available on request; no AI-generated field ships without a source quote"
   ]
  },
  "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": "restaurant-permit-applications-case-acceptance-desk-r1",
    "risk": "A state's adjuster/TPA statute sweeps in ministerial applications-processing more broadly than the New York framework relied on",
    "likelihood": "medium",
    "impact": "severe",
    "mitigation": "Counsel review before each new state activates; ministerial-only scope enforced structurally",
    "contingency": "Pause onboarding in that state; retroactive review of any applications already processed there",
    "owner": "legal"
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-r2",
    "risk": "AI extraction hallucinates a field not present in the source chart/invoice",
    "likelihood": "medium",
    "impact": "high",
    "mitigation": "Retrieval-grounded extraction + structured output validation + 100% hospitality-ops-reviewer review in first 90 days",
    "contingency": "Reviewer-triggered correction; application held until re-verified against source",
    "owner": "engineering"
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-r3",
    "risk": "Cross-practice data leak",
    "likelihood": "low",
    "impact": "severe",
    "mitigation": "Row-level auth + per-practice retrieval indices + log-scrubbing",
    "contingency": "Breach-notification runbook; forced credential rotation; scoped practice kill switch",
    "owner": "engineering"
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-r4",
    "risk": "Design-partner practice churns before signing a paid engagement",
    "likelihood": "medium",
    "impact": "high",
    "mitigation": "Weekly working-session cadence during pilot; the free Application Gap Scan de-risks first commitment",
    "contingency": "Structured exit interview; write learnings into ICP + pricing hypothesis",
    "owner": "owner"
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-r5",
    "risk": "Reviewer bottleneck as application volume grows faster than reviewer capacity",
    "likelihood": "high",
    "impact": "high",
    "mitigation": "Pilot cap (5 practices in month 1); part-time contractor reviewer added around month 7 per financial model",
    "contingency": "Pause new-logo onboarding until reviewer capacity catches up",
    "owner": "ops"
   },
   {
    "id": "restaurant-permit-applications-case-acceptance-desk-r6",
    "risk": "DOT submission-format change breaks the rule library mid-cycle",
    "likelihood": "medium",
    "impact": "high",
    "mitigation": "Versioned rule library + standing rule-watch SOP",
    "contingency": "Freeze new submissions for that DOT until rule library is updated and re-validated",
    "owner": "engineering"
   }
  ],
  "roadmap": [
   {
    "phase": "Phase 0 — Discovery + design-partner LOI",
    "weeks": "Weeks 1-4",
    "outcomes": [
     "3-5 design-partner LOIs",
     "Evidence pack from each partner",
     "Written ICP + pricing hypothesis"
    ],
    "exit_criteria": [
     "≥3 LOIs signed",
     "Owner-action ledger populated per partner",
     "Reviewer identity confirmed"
    ],
    "kill_criteria": [
     "<2 LOIs after 4 weeks",
     "No willingness-to-pay signal above cost baseline"
    ]
   },
   {
    "phase": "Phase 1 — Thin vertical slice",
    "weeks": "Weeks 5-10",
    "outcomes": [
     "Intake → evidence → reviewer signoff → delivery working end-to-end for one workflow",
     "Audit trail wired",
     "Instrumentation live"
    ],
    "exit_criteria": [
     "1 real artifact delivered + reviewer-signed",
     "p95 workflow latency published"
    ],
    "kill_criteria": [
     "Reviewer signoff cycle >5 business days",
     "Evidence pack cannot be reconstructed on demand"
    ]
   },
   {
    "phase": "Phase 2 — Design-partner cohort",
    "weeks": "Weeks 11-20",
    "outcomes": [
     "3 partners in weekly production use",
     "First paid conversion",
     "SOC 2 Type I scoping"
    ],
    "exit_criteria": [
     "≥1 paid contract",
     "NPS or equivalent trust signal captured",
     "Postmortem cadence in place"
    ],
    "kill_criteria": [
     "No paid conversion by week 20",
     "Compliance framework demand exceeds team capacity without contract offset"
    ]
   },
   {
    "phase": "Phase 3 — Commercial launch",
    "weeks": "Weeks 21-36",
    "outcomes": [
     "Public commercial launch of at least one microsite as 'ready'",
     "SOC 2 Type I completed",
     "Owner-action ledger closed for launched blueprints"
    ],
    "exit_criteria": [
     "Zero blocking owner actions for launched blueprints",
     "Publicly indexable microsite with WebPage+FAQPage schema only"
    ],
    "kill_criteria": [
     "Public launch not defensible against a plausible regulator inquiry"
    ]
   }
  ],
  "metrics": {
   "north_star": "Released Application Submission Packs per week, per logo, with zero re-issues for defects of our making",
   "leading": [
    "Design-partner LOIs signed",
    "Intake → artifact cycle time",
    "Reviewer signoff cycle time",
    "Evidence coverage per artifact",
    "Owner-action ledger closure rate"
   ],
   "lagging": [
    "Paid contracts signed",
    "Net revenue retention (post first cohort)",
    "Regulator or auditor objection count (target: 0)",
    "Retraction count on delivered artifacts (target: 0)"
   ],
   "guardrails": [
    "Model spend per tenant per week",
    "PII in logs (target: 0)",
    "Cross-tenant access attempts (target: 0)",
    "p95 workflow latency ceiling"
   ]
  },
  "executive_review": {
   "consensus": "Ship a thin, evidence-linked, reviewer-gated vertical slice for PatioClear. Prefer a boring, single-region modular monolith. Do not launch commercially until owner-action facts close and at least one reviewer-signed artifact is delivered.",
   "dissent": "Executive Sponsor and Privacy/Compliance disagree on launch tempo — Privacy recommends waiting for SOC 2 Type II mapping before any public commercial application.",
   "go_no_go": "conditional-go",
   "top_3_risks": [
    "Regulator-facing application proves incorrect",
    "AI hallucination in a delivered artifact",
    "Cross-tenant data leak"
   ],
   "first_10_steps": [
    "Confirm the named licensed reviewer + engagement letter on file",
    "Populate owner-action ledger with entity, jurisdiction, contact inbox, privacy inbox",
    "Open 5 design-partner discovery calls with explicit pricing conversation",
    "Write ICP + kill/pivot criteria in the plan file",
    "Stand up the evidence-linked intake → artifact → reviewer signoff loop",
    "Wire append-only audit log + hash-chained snapshots",
    "Add row-level auth + tenant-scoped retrieval indices",
    "Instrument activation, artifact-completion, and reviewer-signoff events",
    "Publish the microsite with WebPage+FAQPage schema only and noindex until owner-facts close",
    "Schedule the 90-day kill/pivot review with executive sponsor"
   ]
  }
 },
 "project_site": {
  "slug": "nyc-outdoor-dining-permit-completeness-pack-engine",
  "app_name": "PatioClear Desk",
  "archetype": "filing-dossier",
  "archetype_label": "completeness pack desk",
  "reader_role": "Owner-Operator",
  "one_sentence_app": "PatioClear Desk is a completeness pack desk for owner-operators who need every Dining Out NYC application tied to a portal-ready gap matrix before roadway season opens.",
  "homepage_sequence": [
   "scene",
   "workflow",
   "instrument",
   "offer",
   "proof",
   "qualification",
   "objections"
  ],
  "hero": {
   "frame_label": "Foodservice compliance / municipal permitting · completeness pack desk",
   "eyebrow": "Owner-Operator / Dining Out NYC application paused",
   "interface_title": "PatioClear release desk",
   "primary_panel_title": "Location #2 — Roadway app · confidence 94%",
   "primary_panel_body": "Open pack run: extract portal status and FSEP/insurance fields, match DOT's Setup Guide gap matrix, then stage the Completeness Pack for hospitality-ops reviewer release.",
   "side_panel_title": "Before this ships",
   "side_panel_items": [
    "Insurance certificate named-insured match confirmed",
    "Gap matrix satisfied — zero open Critical items",
    "Upload runbook staged"
   ],
   "status_metric": "REVIEW",
   "status_label": "hospitality-ops reviewer gate active"
  },
  "language": {
   "problem_heading": "The Owner-Operator moment",
   "mechanism_heading": "Inside the PatioClear Desk",
   "proof_heading": "Why this application doesn't stall",
   "offer_heading": "What leaves the room",
   "objection_heading": "The hard questions",
   "qualification_heading": "Who should not use this",
   "cta_close": "Open a pack run from your most recent Dining Out NYC portal status — released by a real hospitality-ops reviewer, escalated to licensed counsel or an RA when legal or stamped-drawing questions come up."
  },
  "modules": [
   {
    "name": "Portal status intake",
    "job": "Turns a forwarded portal screenshot or status email into a named case with an application-type match, extracted fields, and a missing-artifact list.",
    "artifact": "intake record"
   },
   {
    "name": "Setup Guide rule library",
    "job": "Holds the current DOT Setup Guide, clearance geometry, insurance endorsement rules, and season calendar — with the source guidance behind each requirement.",
    "artifact": "gap matrix"
   },
   {
    "name": "Completeness Pack",
    "job": "Packages the gap matrix, corrected drafts, photo set, and upload runbook into the record a restaurant or its counsel can check any time.",
    "artifact": "release package"
   }
  ],
  "checkpoints": [
   {
    "label": "Gap-matrix line",
    "pass": "extracted with source citation",
    "fail": "flagged as an explicit gap"
   },
   {
    "label": "photo evidence",
    "pass": "confidence-scored, reviewer-confirmed below threshold",
    "fail": "blocked before assembly"
   },
   {
    "label": "Completeness Pack",
    "pass": "hospitality-ops reviewer releases (escalation tag on legal/architecture risk)",
    "fail": "stays draft"
   }
  ],
  "signature_scene": "You're an owner-operator. It's the morning after DOT's portal flipped your application to ‘paused — missing legally required information,’ six weeks before roadway season opens. Someone needs to know — today — exactly which artifact is missing, and the only clue is a notice that doesn't say which one. This page is built like the completeness desk that person needed before the season clock ran out."
 },
 "ddd": {
  "slug": "nyc-outdoor-dining-permit-completeness-pack-engine",
  "project_name": "PatioClear — NYC Outdoor Dining Permit Completeness Pack Desk",
  "business_understanding": {
   "summary": "PatioClear — On PatioClear, owner-operators stop chasing permit paperwork and start shipping applications. A visit's portal status export and invoice are extracted at intake, checked against a maintained DOT gap matrix, and every Completeness Pack releases with a hospitality-ops-reviewer signature and a full audit trail.",
   "customer_profile": "owner-operators, restaurant administrators, and RCM leads at independent or small-group (1-5 location) restaurants with meaningful insured-client volume and no dedicated applications-processing staff",
   "customer_pain": "Insured-client invoices missing the fields a specific DOT's application form needs; applications never submitted or submitted incomplete; applications sitting past a normal processing window nobody is tracking; no fast way to tell a client what their permit will likely cover before a costly treatment plan.",
   "paid_outcome": "A submitted, tracked, and reconciled Completeness Pack per paused application, reviewer-released, with ops reviewer/ops-reviewer sign-off on any clinical CAR response language — reconstructable on demand, defensible if a client disputes the outcome.",
   "value_creation": "AI compresses medical-record and invoice extraction, DOT-format matching, and packet drafting; deterministic code owns every completeness check and days-pending calculation; humans own hospitality-ops-reviewer release, clinical sign-off, and anything that touches coverage judgment; the platform binds them with an append-only audit trail and per-practice isolation.",
   "why_ai_native": "The extract-check-assemble-track loop is only economical with a bounded AI layer feeding deterministic completeness rules. A pure-manual service cannot hit $12-18 per-application pricing; a pure-automated tool cannot chase insurers, hold the release gate, or absorb the judgment calls that keep a application from bouncing back for more documentation.",
   "operational_risks": [
    "Applications-reviewer bottleneck as practice count grows faster than reviewer capacity",
    "Prompt injection via invoice/chart content",
    "Cross-practice retrieval leak",
    "DOT submission-format drift breaking the gap matrix mid-cycle",
    "Silent delivery failure on a application pending past its normal window"
   ],
   "assumptions": [
    "Practices will pay a flat per-application fee for a reviewer-released, audit-traceable submission over doing it in-house.",
    "A practice's portal status export and site-plan packet contain enough structured data to extract a complete application without a direct ops-tracker integration at launch.",
    "Insured clients will sign a client authorization naming PatioClear as processing agent.",
    "Ministerial applications-processing does not trigger adjuster/TPA licensure outside the New York guidance reviewed this run.",
    "Single-tenant per practice is not required for the first cohort — logical isolation with row-level auth is acceptable."
   ],
   "validation_questions": [
    "Which hospitality-ops reviewer and clinical sign-off contact will practices use at launch?",
    "Which insurers and states are in scope for launch?",
    "What is the actual willingness-to-pay per application?",
    "Which ops-tracker export formats must this integrate with day-one?",
    "Is there a data-residency or on-prem constraint from any design partner?"
   ]
  },
  "domain_discovery": {
   "actors": [
    {
     "actor": "Owner-operator / restaurant administrator",
     "role": "owner-operators, restaurant administrators, and RCM leads at restaurants",
     "goals": [
      "Get every insured application submitted on time",
      "Reduce GM time lost to applications paperwork"
     ],
     "decisions": [
      "Submit visit intake",
      "Accept or revise a flagged extraction",
      "Approve escalated exceptions"
     ],
     "pain_points": [
      "Scattered applications paperwork across email and ops-tracker exports",
      "Manual re-typing into DOT forms",
      "Applications-reviewer bottleneck at high volume"
     ]
    },
    {
     "actor": "Hospitality-ops reviewer",
     "role": "Signs and takes accountability for every submitted Completeness Pack",
     "goals": [
      "Sign only what's defensible against the DOT's gap matrix",
      "Keep the audit trail intact"
     ],
     "decisions": [
      "Approve or return a packet for correction",
      "Route ambiguous applications to the exception queue"
     ],
     "pain_points": [
      "Volume spikes around paused application surges",
      "DOT format changes invalidating in-flight applications"
     ]
    },
    {
     "actor": "ops reviewer / credentialed restaurant technician",
     "role": "Signs off on any clinical medical-necessity language in a CAR response",
     "goals": [
      "Ensure CAR response language never overstates the chart",
      "Protect the practice's clinical credibility with the DOT"
     ],
     "decisions": [
      "Approve or edit CAR response language",
      "Decline to sign off, sending the CAR response back"
     ],
     "pain_points": [
      "Time pressure when an CAR response deadline is close"
     ]
    },
    {
     "actor": "Restaurant owner (applicant of record)",
     "role": "Signs the client authorization; receives the tracked status link",
     "goals": [
      "Get reimbursed quickly and know the application's status without calling the practice"
     ],
     "decisions": [
      "Sign or decline the client authorization"
     ],
     "pain_points": [
      "No visibility into whether a application was ever submitted"
     ]
    },
    {
     "actor": "DOT (external)",
     "role": "Owns the coverage decision and payment authorization at all times",
     "goals": [
      "Receive a complete, correctly-formatted application"
     ],
     "decisions": [
      "Approve, deny, or request more documentation"
     ],
     "pain_points": [
      "Incomplete submissions requiring back-and-forth"
     ]
    }
   ],
   "glossary": [
    {
     "term": "application run",
     "definition": "One paused application's application, from intake through submission — the unit of work PatioClear turns into a Completeness Pack.",
     "used_by": "Owner-operator, Hospitality-ops reviewer",
     "context": "Applications Intake",
     "example": "\"Open a application run for the dental visit at Location 2\"",
     "notes": "Do not confuse with 'engagement' in Billing (contract term)."
    },
    {
     "term": "gap matrix",
     "definition": "The deterministic, DOT-specific list of required fields/attachments a Completeness Pack must satisfy before release.",
     "used_by": "Hospitality-ops reviewer, AI Orchestrator",
     "context": "DOT Rule Library",
     "example": "\"SLA counsel' gap matrix requires an itemized diagnosis code\"",
     "notes": "Never the same as a generic intake checklist — it is DOT-specific and versioned."
    }
   ],
   "decisions": [
    {
     "decision": "Accept application intake",
     "who": "Applications Intake context (rule + reviewer override)",
     "inputs": [
      "Practice identity",
      "Medical-record export",
      "Itemized invoice"
     ],
     "rule": "Reject if invoice below claimable-visit threshold or client authorization missing",
     "output": "IntakeReceived event",
     "risk": "Accepting an out-of-scope application wastes extraction and reviewer time."
    },
    {
     "decision": "Approve a Completeness Pack for submission",
     "who": "Applications Review context (hospitality-ops reviewer)",
     "inputs": [
      "Assembled CompletenessPack",
      "Gap matrix result",
      "Source chart/invoice data"
     ],
     "rule": "Reject if any completeness_checklist item is open",
     "output": "PackApproved event",
     "risk": "Approving an incomplete packet risks an DOT bounce-back."
    }
   ],
   "events": [
    {
     "event": "claimIntakeReceived",
     "meaning": "A visit's application is now committed to the extraction pipeline",
     "trigger": "Owner-operator or GM submits a application intake",
     "downstream": [
      "Extraction begins",
      "AI Orchestrator scheduled"
     ]
    },
    {
     "event": "claimSubmitted",
     "meaning": "The packet has left PatioClear and is now with the DOT",
     "trigger": "Hospitality-ops reviewer approves and submits",
     "downstream": [
      "Status tracking begins",
      "Client notified"
     ]
    }
   ]
  },
  "subdomains": [
   {
    "name": "Applications Fulfillment (extraction + assembly + submission)",
    "type": "core",
    "description": "The end-to-end path from visit intake to hospitality-ops-reviewer-released, submitted Completeness Pack, with every field cited.",
    "reason": "This is what practices pay for and what a client's status link shows.",
    "business_value": "Direct revenue and client trust.",
    "recommendation": "build",
    "ai_involvement": "high",
    "human_involvement": "high",
    "risks": [
     "Hallucinated field",
     "Reviewer bottleneck",
     "Un-reconstructable audit trail"
    ],
    "validation_questions": [
     "Can the reviewer release in <24 hours?"
    ]
   },
   {
    "name": "DOT Rule Library (completeness checklists)",
    "type": "supporting",
    "description": "Maintained, versioned, city-by-city submission-format and completeness rules.",
    "reason": "Without it, extraction has no target to check against.",
    "business_value": "Durable moat as DOT count grows.",
    "recommendation": "build",
    "ai_involvement": "low",
    "human_involvement": "medium",
    "risks": [
     "DOT format drift",
     "Stale rule versions"
    ],
    "validation_questions": [
     "How often do insurers change submission formats?"
    ]
   },
   {
    "name": "Exception Handling (coverage disputes, clinical judgment)",
    "type": "supporting",
    "description": "Routes coverage disputes and pre-existing-condition questions to human triage instead of the automated pipeline.",
    "reason": "Keeps PatioClear structurally ministerial.",
    "business_value": "Regulatory-boundary protection.",
    "recommendation": "build",
    "ai_involvement": "low",
    "human_involvement": "high",
    "risks": [
     "Misclassified exception proceeding through automation"
    ],
    "validation_questions": [
     "What share of applications route to exceptions at scale?"
    ]
   },
   {
    "name": "Billing & Revenue",
    "type": "generic",
    "description": "Per-application invoicing and retainer billing.",
    "reason": "Not a differentiator.",
    "business_value": "Necessary but not core.",
    "recommendation": "buy",
    "ai_involvement": "low",
    "human_involvement": "low",
    "risks": [
     "Billing errors"
    ],
    "validation_questions": []
   }
  ],
  "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 regulator 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": "Completeness Fulfillment",
    "purpose": "Turn accepted intake into a hospitality-ops-reviewer-signed Completeness Pack.",
    "subdomain": "Completeness Fulfillment (core)",
    "type": "core",
    "owned_language": [
     "portal status",
     "gap matrix",
     "Completeness Pack",
     "Draft",
     "Escalation",
     "Sign-off"
    ],
    "owns": [
     "application-case lifecycle",
     "Draft state",
     "evidence links",
     "delivery-packet composition"
    ],
    "does_not_own": [
     "Reviewer identity",
     "Billing",
     "DOT's approval decision"
    ],
    "primary_actors": [
     "Owner-operator / GM",
     "AI Orchestrator",
     "hospitality-ops reviewer"
    ],
    "entities": [
     "ApplicationCase",
     "Draft",
     "CompletenessPack",
     "Delivery"
    ],
    "value_objects": [
     "ConfidenceScore",
     "SourceCitation",
     "DeliveryAddress"
    ],
    "aggregates": [
     "ApplicationCaseAggregate",
     "CompletenessPackAggregate"
    ],
    "domain_services": [
     "Draft composer",
     "Delivery adapter"
    ],
    "application_services": [
     "OpenIntake",
     "RequestDraft",
     "AttachEvidence",
     "RequestSignoff",
     "DeliverPack"
    ],
    "commands": [
     "OpenIntake",
     "AttachEvidence",
     "RequestDraft",
     "SubmitForSignoff",
     "DeliverArtifact"
    ],
    "domain_events": [
     "IntakeAccepted",
     "EvidenceCollected",
     "DraftReady",
     "ArtifactSigned",
     "ArtifactDelivered"
    ],
    "policies": [
     "Auto-request signoff when gap-matrix coverage is complete",
     "Auto-block delivery until signoff received"
    ],
    "specifications": [
     "GapCoverageSpec",
     "DeliverabilitySpec"
    ],
    "invariants": [
     "A Completeness Pack cannot be delivered without a valid reviewer signoff",
     "Every claim in a delivered artifact cites at least one source item"
    ],
    "ai_agents": [
     "Drafter Agent"
    ],
    "human_roles": [
     "Owner-operator / GM",
     "hospitality-ops reviewer"
    ],
    "data_owned": [
     "ApplicationCase",
     "Draft",
     "CompletenessPack",
     "Delivery"
    ],
    "inputs": [
     "Intake payload",
     "Uploaded evidence",
     "Retrieval hits"
    ],
    "outputs": [
     "Signed artifact packet",
     "Delivery confirmation"
    ],
    "external_integrations": [
     "Restaurant email/upload channel",
     "Vault storage"
    ],
    "interfaces": [
     "→ Pack Assembly (RequestSignoff)",
     "→ Correction Response (ArtifactDelivered)",
     "← Setup Guide Rule Library (RuleLibraryUpdated)"
    ],
    "risks": [
     "Un-cited field slips into a delivered pack",
     "Delivery channel fails silently"
    ]
   },
   {
    "name": "Setup Guide Rule Library",
    "purpose": "Maintain versioned, current DOT Setup Guide and SLA requirement rules by application type.",
    "subdomain": "Setup Guide Rule Library (supporting)",
    "type": "supporting",
    "owned_language": [
     "Setup Guide",
     "clearance geometry",
     "requirement rule",
     "rule version"
    ],
    "owns": [
     "rule versioning",
     "requirement definitions"
    ],
    "does_not_own": [
     "Pack assembly",
     "Delivery"
    ],
    "primary_actors": [
     "Ops team",
     "AI Orchestrator"
    ],
    "entities": [
     "RequirementRuleSet"
    ],
    "value_objects": [
     "RuleVersion",
     "SeasonCalendar"
    ],
    "aggregates": [
     "RequirementRuleSetAggregate"
    ],
    "domain_services": [
     "Rule-change monitor"
    ],
    "application_services": [
     "UpdateRuleLibrary"
    ],
    "commands": [
     "UpdateRuleLibrary"
    ],
    "domain_events": [
     "RuleLibraryUpdated"
    ],
    "policies": [
     "Any Setup Guide change triggers a rule-library review within 5 business days"
    ],
    "specifications": [
     "RuleFreshnessSpec"
    ],
    "invariants": [
     "Every Completeness Pack records which rule version it was assembled against"
    ],
    "ai_agents": [
     "Rule-diff Agent"
    ],
    "human_roles": [
     "Ops team"
    ],
    "data_owned": [
     "RequirementRuleSet"
    ],
    "inputs": [
     "DOT Setup Guide releases",
     "Admin Code updates"
    ],
    "outputs": [
     "Versioned rule set"
    ],
    "external_integrations": [
     "DOT public Setup Guide pages"
    ],
    "interfaces": [
     "→ Completeness Fulfillment (RuleLibraryUpdated)",
     "→ Correction Response (RuleLibraryUpdated)"
    ],
    "risks": [
     "Stale rule version used in an assembled pack",
     "DOT format change missed"
    ]
   },
   {
    "name": "Correction Response",
    "purpose": "Turn a received Correction Action Request into a cure packet inside its 30-day window.",
    "subdomain": "Correction Response (core)",
    "type": "core",
    "owned_language": [
     "CAR",
     "cure window",
     "cure packet"
    ],
    "owns": [
     "CAR lifecycle",
     "cure-deadline tracking"
    ],
    "does_not_own": [
     "Original pack assembly rules"
    ],
    "primary_actors": [
     "Owner-operator / GM",
     "hospitality-ops reviewer"
    ],
    "entities": [
     "CorrectionActionRequest",
     "CureResponsePacket"
    ],
    "value_objects": [
     "CureDeadline"
    ],
    "aggregates": [
     "CorrectionActionRequestAggregate"
    ],
    "domain_services": [
     "Cure-clock tracker"
    ],
    "application_services": [
     "LogCorrectionRequest",
     "AssembleCureResponse"
    ],
    "commands": [
     "LogCorrectionRequest",
     "AssembleCureResponse"
    ],
    "domain_events": [
     "CorrectionRequestReceived",
     "CureResponseDelivered"
    ],
    "policies": [
     "Auto-flag any CAR within 5 days of its cure deadline as urgent"
    ],
    "specifications": [
     "CureWindowSpec"
    ],
    "invariants": [
     "A CorrectionActionRequest cannot close Resolved without a delivered CureResponsePacket before its deadline"
    ],
    "ai_agents": [
     "Cure-drafting Agent"
    ],
    "human_roles": [
     "hospitality-ops reviewer"
    ],
    "data_owned": [
     "CorrectionActionRequest",
     "CureResponsePacket"
    ],
    "inputs": [
     "CAR notice",
     "prior pack data"
    ],
    "outputs": [
     "Cure response packet"
    ],
    "external_integrations": [
     "Restaurant upload channel"
    ],
    "interfaces": [
     "← Completeness Fulfillment (prior ApplicationCase)",
     "→ Licensing Boundary & Escalation (RouteEscalation)"
    ],
    "risks": [
     "Cure response misses the 30-day deadline",
     "Clinical/legal language drafted without escalation"
    ]
   },
   {
    "name": "Season Desk Monitoring",
    "purpose": "Watch the renewal calendar, insurance expiry, and CAR risk for subscribed locations.",
    "subdomain": "Season Desk Monitoring (supporting)",
    "type": "supporting",
    "owned_language": [
     "Season Desk",
     "renewal window",
     "monitoring alert"
    ],
    "owns": [
     "subscription lifecycle",
     "alert generation"
    ],
    "does_not_own": [
     "Pack assembly"
    ],
    "primary_actors": [
     "Owner-operator / GM",
     "AI Orchestrator"
    ],
    "entities": [
     "SeasonDeskSubscription",
     "MonitoringAlert"
    ],
    "value_objects": [
     "RenewalWindow"
    ],
    "aggregates": [
     "SeasonDeskSubscriptionAggregate"
    ],
    "domain_services": [
     "Renewal-calendar scanner"
    ],
    "application_services": [
     "ActivateSeasonDesk",
     "GenerateMonitoringAlert"
    ],
    "commands": [
     "ActivateSeasonDesk",
     "GenerateMonitoringAlert"
    ],
    "domain_events": [
     "SeasonDeskActivated",
     "MonitoringAlertRaised"
    ],
    "policies": [
     "Auto-generate an alert 30 days before any tracked insurance or license expiry"
    ],
    "specifications": [
     "ActiveSubscriptionSpec"
    ],
    "invariants": [
     "Exactly one active subscription per location"
    ],
    "ai_agents": [
     "Calendar-watch Agent"
    ],
    "human_roles": [
     "Ops team"
    ],
    "data_owned": [
     "SeasonDeskSubscription",
     "MonitoringAlert"
    ],
    "inputs": [
     "Renewal dates",
     "insurance expiry dates"
    ],
    "outputs": [
     "Weekly monitoring digest"
    ],
    "external_integrations": [
     "Restaurant email channel"
    ],
    "interfaces": [
     "← Completeness Fulfillment (case history)",
     "→ Correction Response (CAR watch)"
    ],
    "risks": [
     "Missed renewal date not tracked",
     "Duplicate subscription billed"
    ]
   },
   {
    "name": "Licensing Boundary & Escalation",
    "purpose": "Route UPL-risk, architecture-stamp, contested-hearing, or SLA-legal questions to licensed partners.",
    "subdomain": "Licensing Boundary & Escalation (generic)",
    "type": "generic",
    "owned_language": [
     "escalation",
     "referral",
     "UPL risk"
    ],
    "owns": [
     "escalation routing",
     "referral records"
    ],
    "does_not_own": [
     "The licensed partner's own case file"
    ],
    "primary_actors": [
     "hospitality-ops reviewer",
     "counsel / RA partner"
    ],
    "entities": [
     "EscalationReferral"
    ],
    "value_objects": [
     "EscalationReason"
    ],
    "aggregates": [
     "EscalationReferralAggregate"
    ],
    "domain_services": [
     "Partner router"
    ],
    "application_services": [
     "RouteEscalation"
    ],
    "commands": [
     "RouteEscalation"
    ],
    "domain_events": [
     "EscalationRouted",
     "EscalationResolved"
    ],
    "policies": [
     "Any content touching legal conclusions or architectural certification auto-routes to escalation, never drafted in-house"
    ],
    "specifications": [
     "EscalationRequiredSpec"
    ],
    "invariants": [
     "An EscalationReferral cannot close without a named receiving licensed professional or documented client decline"
    ],
    "ai_agents": [
     "Escalation-detection Agent"
    ],
    "human_roles": [
     "hospitality-ops reviewer",
     "licensed partner"
    ],
    "data_owned": [
     "EscalationReferral"
    ],
    "inputs": [
     "Pack content flagged by rules or reviewer"
    ],
    "outputs": [
     "Referral log entry"
    ],
    "external_integrations": [
     "Partner counsel / RA firms"
    ],
    "interfaces": [
     "← Pack Assembly (flagged content)",
     "← Correction Response (flagged content)"
    ],
    "risks": [
     "Reviewer under time pressure drafts a legal conclusion instead of escalating",
     "Referral partner channel conflict"
    ]
   }
  ],
  "context_map": [
   {
    "upstream": "Applications Intake",
    "downstream": "Extraction & Normalization",
    "pattern": "customer-supplier",
    "business_reason": "Extraction cannot start without a logged, hashed intake.",
    "data_exchanged": [
     "ApplicationIntake record"
    ],
    "events_exchanged": [
     "IntakeReceived"
    ],
    "contract_type": "Published language (ApplicationIntake record)",
    "failure_risks": [
     "Silent format mismatch"
    ],
    "acl_notes": "Extraction consumes only fields it needs; no direct DB coupling.",
    "ownership_boundary": "Intake owns the raw-document lifecycle."
   },
   {
    "upstream": "Extraction & Normalization",
    "downstream": "DOT Rule Library",
    "pattern": "conformist",
    "business_reason": "Extraction defers to the DOT's own completeness definition.",
    "data_exchanged": [
     "ExtractedApplicationData",
     "RequirementRuleSet"
    ],
    "events_exchanged": [
     "RuleLibraryUpdated"
    ],
    "contract_type": "Published language (RequirementRuleSet)",
    "failure_risks": [
     "Stale rule version used"
    ],
    "acl_notes": "Rule library is the upstream source of truth; extraction never overrides it.",
    "ownership_boundary": "DOT Rule Library owns completeness-checklist definitions."
   },
   {
    "upstream": "Packet Assembly",
    "downstream": "Applications Review",
    "pattern": "customer-supplier",
    "business_reason": "No packet reaches submission without reviewer sign-off.",
    "data_exchanged": [
     "CompletenessPack"
    ],
    "events_exchanged": [
     "PackAssembled",
     "PackApproved"
    ],
    "contract_type": "Published language (CompletenessPack)",
    "failure_risks": [
     "Packet submitted without review"
    ],
    "acl_notes": "Review context enforces the invariant structurally.",
    "ownership_boundary": "Applications Review owns the ReviewDecision lifecycle."
   },
   {
    "upstream": "Applications Review",
    "downstream": "Clinical Sign-off",
    "pattern": "customer-supplier",
    "business_reason": "Clinical CAR response language cannot file without ops reviewer/ops-reviewer approval.",
    "data_exchanged": [
     "CureResponseDraft"
    ],
    "events_exchanged": [
     "EscalationSignoffCompleted"
    ],
    "contract_type": "Published language (ClinicalSignoff)",
    "failure_risks": [
     "CAR response filed without sign-off"
    ],
    "acl_notes": "Clinical Sign-off is a hard gate, not advisory.",
    "ownership_boundary": "Clinical Sign-off owns clinical-language approval."
   },
   {
    "upstream": "Submission & Tracking",
    "downstream": "Reconciliation",
    "pattern": "customer-supplier",
    "business_reason": "Reconciliation needs a submitted, resolved application to match against.",
    "data_exchanged": [
     "DeliveredPack",
     "status update"
    ],
    "events_exchanged": [
     "CaseResolved",
     "EOBReconciled"
    ],
    "contract_type": "Published language (EOBReconciliation)",
    "failure_risks": [
     "Payment matched to wrong invoice"
    ],
    "acl_notes": "Reconciliation reads only resolved applications.",
    "ownership_boundary": "Reconciliation owns the AR-ledger match."
   },
   {
    "upstream": "Applications Review + Submission & Tracking",
    "downstream": "Exception Handling",
    "pattern": "customer-supplier",
    "business_reason": "Coverage disputes and pre-existing-condition questions must exit the automated pipeline.",
    "data_exchanged": [
     "ExceptionCase"
    ],
    "events_exchanged": [
     "ExceptionEscalated"
    ],
    "contract_type": "Published language (ExceptionCase)",
    "failure_risks": [
     "Exception silently auto-resolved"
    ],
    "acl_notes": "Only a hospitality-ops reviewer may re-route an ExceptionCase.",
    "ownership_boundary": "Exception Handling owns human-triage routing."
   },
   {
    "upstream": "Applications Review + Clinical Sign-off + Submission & Tracking",
    "downstream": "Learning Loop",
    "pattern": "customer-supplier",
    "business_reason": "Every correction and format change should improve the rule library.",
    "data_exchanged": [
     "ReviewerCorrection",
     "FormatChangeSignal"
    ],
    "events_exchanged": [
     "RuleLibraryUpdated"
    ],
    "contract_type": "Published language (RuleLibraryRevision)",
    "failure_risks": [
     "Correction pattern never fed back"
    ],
    "acl_notes": "Learning Loop writes only versioned revisions, never live rules directly.",
    "ownership_boundary": "Learning Loop owns revision proposals; DOT Rule Library owns publication."
   }
  ],
  "external_integrations": [
   {
    "system": "Vendor invoice inboxes",
    "risk": "Schema drift; silent field rename; rate limits",
    "internal_model": "field evidence record or chase notification",
    "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 tenant, request id, cost, and payload hash (no PII in logs)."
   },
   {
    "system": "HVAC work-order / CMMS platforms",
    "risk": "Schema drift; silent field rename; rate limits",
    "internal_model": "field evidence record or notification",
    "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 tenant, request id, cost, and payload hash (no PII in logs)."
   },
   {
    "system": "Customer AP / document portals",
    "risk": "Schema drift; silent field rename; rate limits",
    "internal_model": "field evidence record or notification",
    "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 tenant, request id, cost, and payload hash (no PII in logs)."
   },
   {
    "system": "OpenAI / Anthropic API",
    "risk": "Prompt-injection surface; token cost blowout; provider outage",
    "internal_model": "Draft payload with confidence score + validated schema",
    "acl_strategy": "OutputValidator + prompt-injection scrubber + per-tenant 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 tenant, request id, cost, and payload hash (no PII in logs)."
   }
  ],
  "event_storm": [
   {
    "seq": 1,
    "command": "SubmitIntake",
    "event": "IntakeReceived",
    "actor": "Owner-operator / GM",
    "context": "Completeness Fulfillment",
    "aggregate": "ApplicationCase",
    "policy": "Reject duplicate intake for the same location and application type",
    "downstream": "Gap analysis begins",
    "risk": "Duplicate or malformed intake"
   },
   {
    "seq": 2,
    "command": "BuildGapMatrix",
    "event": "GapMatrixBuilt",
    "actor": "AI Orchestrator",
    "context": "Setup Guide Rule Library",
    "aggregate": "ApplicationCase",
    "policy": "Route fields below confidence threshold to reviewer triage",
    "downstream": "Missing-artifact list sent to client",
    "risk": "Stale rule-set version"
   },
   {
    "seq": 3,
    "command": "RequestMissingArtifact",
    "event": "ArtifactRequested",
    "actor": "AI Orchestrator",
    "context": "Completeness Fulfillment",
    "aggregate": "ApplicationCase",
    "policy": "Escalate if artifact not received within 5 business days of a rush intake",
    "downstream": "Client uploads missing item",
    "risk": "Client ghosts the request"
   },
   {
    "seq": 4,
    "command": "AssemblePack",
    "event": "PackAssembled",
    "actor": "AI Orchestrator",
    "context": "Pack Assembly",
    "aggregate": "CompletenessPack",
    "policy": "Flag any missing required field rather than guess",
    "downstream": "Hospitality-ops reviewer review",
    "risk": "Assembly proceeds with an unresolved gap"
   },
   {
    "seq": 5,
    "command": "ReviewPack",
    "event": "PackApproved",
    "actor": "Hospitality-ops reviewer",
    "context": "Pack Assembly",
    "aggregate": "CompletenessPack",
    "policy": "Block approval on any open Critical checklist item",
    "downstream": "Delivery to client",
    "risk": "Reviewer approves with an unresolved exception"
   },
   {
    "seq": 6,
    "command": "DeliverArtifact",
    "event": "PackDelivered",
    "actor": "AI Orchestrator",
    "context": "Completeness Fulfillment",
    "aggregate": "ApplicationCase",
    "policy": "Deliver only after PackApproved is recorded",
    "downstream": "Client uploads to DOT portal",
    "risk": "Client uploads out of the runbook order"
   },
   {
    "seq": 7,
    "command": "n/a — day-7 check",
    "event": "PortalStatusChecked",
    "actor": "Ops team",
    "context": "Completeness Fulfillment",
    "aggregate": "ApplicationCase",
    "policy": "Open a proactive follow-up if status has not changed by day 7",
    "downstream": "Follow-up logged or case closed",
    "risk": "Status check missed"
   },
   {
    "seq": 8,
    "command": "LogCorrectionRequest",
    "event": "CorrectionRequestReceived",
    "actor": "Owner-operator / GM",
    "context": "Correction Response",
    "aggregate": "CorrectionActionRequest",
    "policy": "Auto-set CureDeadline to 30 days from receipt",
    "downstream": "Cure-response drafting begins",
    "risk": "Client reports the CAR late, shrinking the effective window"
   },
   {
    "seq": 9,
    "command": "AssembleCureResponse",
    "event": "CureResponseDelivered",
    "actor": "AI Orchestrator + hospitality-ops reviewer",
    "context": "Correction Response",
    "aggregate": "CorrectionActionRequest",
    "policy": "Block delivery if the cure deadline has already passed — escalate instead",
    "downstream": "Client uploads cure response",
    "risk": "Cure misses the 30-day window"
   },
   {
    "seq": 10,
    "command": "RouteEscalation",
    "event": "EscalationRouted",
    "actor": "Hospitality-ops reviewer",
    "context": "Licensing Boundary & Escalation",
    "aggregate": "EscalationReferral",
    "policy": "Any UPL-risk, architecture-stamp, or contested-hearing content routes here automatically",
    "downstream": "Licensed partner takes the matter",
    "risk": "Reviewer under time pressure drafts a legal-sounding conclusion instead of escalating"
   },
   {
    "seq": 11,
    "command": "ActivateSeasonDesk",
    "event": "SeasonDeskActivated",
    "actor": "Owner-operator / GM",
    "context": "Season Desk Monitoring",
    "aggregate": "SeasonDeskSubscription",
    "policy": "Only one active subscription per location",
    "downstream": "Monitoring alerts begin",
    "risk": "Duplicate subscription billed"
   },
   {
    "seq": 12,
    "command": "GenerateMonitoringAlert",
    "event": "MonitoringAlertRaised",
    "actor": "AI Orchestrator",
    "context": "Season Desk Monitoring",
    "aggregate": "SeasonDeskSubscription",
    "policy": "Alert fires 30 days before a tracked expiry",
    "downstream": "Weekly digest sent to client",
    "risk": "Missed renewal date not tracked"
   }
  ],
  "critical_path": [
   "IntakeReceived → GapMatrixBuilt → PackAssembled → PackApproved → PackDelivered → PortalStatusChecked"
  ],
  "exception_flows": [
   "GapMatrixBuilt with a field below confidence threshold → reviewer triage → manual field confirmation → PackAssembled",
   "AssemblePack blocked by an open Critical checklist item → ExceptionMemo logged → owner resolves or escalates → retry",
   "DeliverArtifact fails at the delivery channel → client alert within 1 business hour → retry with the client's preferred channel"
  ],
  "escalation_flows": [
   "AI Orchestrator escalates a low-confidence extraction to the hospitality-ops reviewer",
   "Hospitality-ops reviewer escalates a UPL-risk or architecture-stamp question to a licensed partner",
   "Ops team escalates a CAR within 5 days of its cure deadline to the assigned reviewer as urgent",
   "Ops team escalates a discretionary DOT/Comptroller inquiry beyond documentation scope to the client's own counsel"
  ],
  "retry_flows": [
   "ArtifactRequested with no client response after 5 business days → automated reminder → manual outreach at day 10",
   "DeliveryFailed at the intake/delivery channel → retry with backoff, client alerted within 1 hour if still failing",
   "GapAnalysisFailed on a malformed upload → client asked to resend in the specified format"
  ],
  "manual_override_flows": [
   "Reviewer manually overrides an AI-flagged Deficient item to Present, with a mandatory reason note",
   "Ops team manually extends a CureDeadline reminder cadence for a documented client hardship, without altering DOT's actual 30-day clock",
   "Founder manually reprioritizes a season-cliff intake ahead of the standard queue, logged as an explicit override"
  ],
  "commands": [
   {
    "name": "SubmitIntake",
    "issued_by": "Owner-operator / GM",
    "preconditions": [
     "Location onboarded",
     "No open duplicate case"
    ],
    "aggregate": "ApplicationCase",
    "success_event": "IntakeReceived",
    "failure_event": "IntakeRejected",
    "authorization": "Restaurant contact with Operator role",
    "validation": "Portal status export + FSEP + insurance certificate present; no duplicate open case for the location",
    "audit": "Command + payload hash logged with location + user"
   },
   {
    "name": "BuildGapMatrix",
    "issued_by": "AI Orchestrator",
    "preconditions": [
     "Intake received"
    ],
    "aggregate": "ApplicationCase",
    "success_event": "GapMatrixBuilt",
    "failure_event": "GapAnalysisFailed",
    "authorization": "System",
    "validation": "Every gap-matrix line carries a source citation and confidence score",
    "audit": "AgentRun logged with prompt version + confidence scores"
   },
   {
    "name": "AssemblePack",
    "issued_by": "AI Orchestrator",
    "preconditions": [
     "Gap matrix built",
     "Missing artifacts received or explicitly waived"
    ],
    "aggregate": "CompletenessPack",
    "success_event": "PackAssembled",
    "failure_event": "AssemblyBlocked",
    "authorization": "System",
    "validation": "No Critical checklist item left open without an ExceptionMemo",
    "audit": "Assembly log with rule-version reference"
   },
   {
    "name": "ReviewPack",
    "issued_by": "Hospitality-ops reviewer",
    "preconditions": [
     "Pack assembled"
    ],
    "aggregate": "CompletenessPack",
    "success_event": "PackApproved",
    "failure_event": "PackReturnedForCorrection",
    "authorization": "Registered hospitality-ops reviewer",
    "validation": "Reviewer checklist signed against gap matrix and source citations",
    "audit": "Versioned PDF hash + reviewer signature logged"
   },
   {
    "name": "DeliverArtifact",
    "issued_by": "AI Orchestrator",
    "preconditions": [
     "Pack approved"
    ],
    "aggregate": "ApplicationCase",
    "success_event": "PackDelivered",
    "failure_event": "DeliveryFailed",
    "authorization": "System",
    "validation": "Delivery channel confirmed reachable",
    "audit": "Delivery confirmation logged with timestamp"
   },
   {
    "name": "LogCorrectionRequest",
    "issued_by": "Owner-operator / GM",
    "preconditions": [
     "Prior ApplicationCase exists"
    ],
    "aggregate": "CorrectionActionRequest",
    "success_event": "CorrectionRequestReceived",
    "failure_event": "CorrectionLogRejected",
    "authorization": "Restaurant contact with Operator role",
    "validation": "CAR document present; CureDeadline calculated",
    "audit": "Command logged with CAR document hash"
   },
   {
    "name": "RouteEscalation",
    "issued_by": "Hospitality-ops reviewer",
    "preconditions": [
     "UPL, architecture-stamp, or contested-hearing flag raised"
    ],
    "aggregate": "EscalationReferral",
    "success_event": "EscalationRouted",
    "failure_event": "EscalationRoutingFailed",
    "authorization": "Registered hospitality-ops reviewer",
    "validation": "Named receiving licensed professional or documented client decline",
    "audit": "Referral log with reason + receiving partner"
   }
  ],
  "policies": [
   {
    "name": "Route low-confidence field to reviewer triage",
    "trigger": "GapMatrixBuilt",
    "condition": "Any field confidence < 0.70",
    "action": "Route to reviewer triage before assembly",
    "context": "Setup Guide Rule Library",
    "ai_involvement": "author",
    "human_approval": false
   },
   {
    "name": "Auto-flag CAR near its cure deadline",
    "trigger": "CorrectionRequestReceived",
    "condition": "Fewer than 5 days remain before CureDeadline",
    "action": "Mark urgent and notify the assigned reviewer immediately",
    "context": "Correction Response",
    "ai_involvement": "assist",
    "human_approval": false
   },
   {
    "name": "Escalate applications pending past DOT's typical review window",
    "trigger": "PortalStatusChecked",
    "condition": "Days pending exceeds the typical 6-month review window with no status change",
    "action": "Open a proactive follow-up inquiry",
    "context": "Completeness Fulfillment",
    "ai_involvement": "assist",
    "human_approval": false
   },
   {
    "name": "Block delivery on open completeness flag",
    "trigger": "PackAssembled",
    "condition": "Any checklist item is Missing or Deficient without an ExceptionMemo",
    "action": "Reject transition to ReadyForDelivery",
    "context": "Pack Assembly",
    "ai_involvement": "author",
    "human_approval": true
   },
   {
    "name": "Route legal/architecture content to escalation instead of drafting it",
    "trigger": "any drafted content",
    "condition": "Content contains a legal conclusion, coverage guarantee, or architectural certification",
    "action": "Block drafting; open an EscalationReferral",
    "context": "Licensing Boundary & Escalation",
    "ai_involvement": "assist",
    "human_approval": true
   }
  ],
  "aggregates": [
   {
    "name": "ApplicationCase",
    "root": "ApplicationCase",
    "context": "Completeness Fulfillment",
    "purpose": "Guard intake, gap-analysis, pack-assembly, reviewer sign-off, delivery, and follow-up state transitions for one location's Dining Out NYC application.",
    "entities": [
     "ApplicationCase",
     "GapMatrix",
     "FollowUpLog"
    ],
    "value_objects": [
     "PauseReason",
     "SeasonWindow",
     "ApplicationType"
    ],
    "invariants": [
     "Cannot transition to PackDelivered without an approved ReviewerAttestation and a GapMatrix with zero open Critical gaps",
     "Cannot close a case without a logged day-7 follow-up entry or an explicit client non-response note"
    ],
    "commands": [
     "SubmitIntake",
     "BuildGapMatrix",
     "RequestMissingArtifact"
    ],
    "events": [
     "IntakeReceived",
     "GapMatrixBuilt",
     "ArtifactRequested"
    ],
    "repository": "ApplicationCaseRepository",
    "transaction_boundary": "single ApplicationCase per transaction"
   },
   {
    "name": "CompletenessPack",
    "root": "CompletenessPack",
    "context": "Pack Assembly",
    "purpose": "The assembled, portal-ready evidence binder for one ApplicationCase.",
    "entities": [
     "CompletenessPack",
     "ChecklistItem"
    ],
    "value_objects": [
     "ArtifactStatus",
     "FieldValue",
     "SourceCitation"
    ],
    "invariants": [
     "Cannot mark ReadyForDelivery while any ChecklistItem is Missing or Deficient without a logged ExceptionMemo"
    ],
    "commands": [
     "AssemblePack",
     "ReviewPack"
    ],
    "events": [
     "PackAssembled",
     "PackApproved"
    ],
    "repository": "CompletenessPackRepository",
    "transaction_boundary": "single CompletenessPack per transaction"
   },
   {
    "name": "RequirementRuleSet",
    "root": "RequirementRuleSet",
    "context": "Setup Guide Rule Library",
    "purpose": "Versioned, per-application-type (sidewalk / roadway / both) DOT and SLA requirement rules.",
    "entities": [
     "RequirementRuleSet"
    ],
    "value_objects": [
     "RuleVersion",
     "SeasonCalendar"
    ],
    "invariants": [
     "Every CompletenessPack records which RequirementRuleSet version it was assembled against"
    ],
    "commands": [
     "UpdateRuleLibrary"
    ],
    "events": [
     "RuleLibraryUpdated"
    ],
    "repository": "RequirementRuleSetRepository",
    "transaction_boundary": "single RequirementRuleSet per transaction"
   },
   {
    "name": "CorrectionActionRequest",
    "root": "CorrectionActionRequest",
    "context": "Correction Response",
    "purpose": "DOT's Correction Action Request (CAR) notice and PatioClear's 30-day cure response.",
    "entities": [
     "CorrectionActionRequest",
     "CureResponsePacket"
    ],
    "value_objects": [
     "CureDeadline"
    ],
    "invariants": [
     "A CorrectionActionRequest cannot be marked Resolved without a delivered CureResponsePacket recorded before its CureDeadline"
    ],
    "commands": [
     "LogCorrectionRequest",
     "AssembleCureResponse"
    ],
    "events": [
     "CorrectionRequestReceived",
     "CureResponseDelivered"
    ],
    "repository": "CorrectionActionRequestRepository",
    "transaction_boundary": "single CorrectionActionRequest per transaction"
   },
   {
    "name": "SeasonDeskSubscription",
    "root": "SeasonDeskSubscription",
    "context": "Season Desk Monitoring",
    "purpose": "Recurring monitoring of the renewal calendar, insurance expiry, and CAR watch for one location.",
    "entities": [
     "SeasonDeskSubscription",
     "MonitoringAlert"
    ],
    "value_objects": [
     "RenewalWindow"
    ],
    "invariants": [
     "Exactly one active SeasonDeskSubscription per location; a lapsed subscription suspends new MonitoringAlert generation"
    ],
    "commands": [
     "ActivateSeasonDesk",
     "GenerateMonitoringAlert"
    ],
    "events": [
     "SeasonDeskActivated",
     "MonitoringAlertRaised"
    ],
    "repository": "SeasonDeskSubscriptionRepository",
    "transaction_boundary": "single SeasonDeskSubscription per transaction"
   },
   {
    "name": "EscalationReferral",
    "root": "EscalationReferral",
    "context": "Licensing Boundary & Escalation",
    "purpose": "Routes UPL-risk, architecture-stamp, contested-community-board, or SLA-legal matters to a licensed partner.",
    "entities": [
     "EscalationReferral"
    ],
    "value_objects": [
     "EscalationReason"
    ],
    "invariants": [
     "An EscalationReferral cannot close without a named receiving licensed professional or a documented client decline"
    ],
    "commands": [
     "RouteEscalation"
    ],
    "events": [
     "EscalationRouted",
     "EscalationResolved"
    ],
    "repository": "EscalationReferralRepository",
    "transaction_boundary": "single EscalationReferral per transaction"
   }
  ],
  "invariants": [
   {
    "invariant": "An ApplicationCase cannot transition to PackDelivered without an approved PackApproved event and zero open Critical gap-matrix items.",
    "context": "Completeness Fulfillment ↔ Pack Assembly",
    "aggregate": "ApplicationCase",
    "why": "No pack ever ships without both human release and a clean gap matrix on file.",
    "enforcement": "Aggregate command handler rejects DeliverArtifact without both references"
   },
   {
    "invariant": "A CompletenessPack cannot be marked ReadyForDelivery while any ChecklistItem is Missing or Deficient without a logged ExceptionMemo.",
    "context": "Pack Assembly",
    "aggregate": "CompletenessPack",
    "why": "Prevents packs from shipping incomplete and re-pausing the application.",
    "enforcement": "Deterministic completeness-check gate on the assembly command handler"
   },
   {
    "invariant": "A CorrectionActionRequest cannot reach Resolved status without a recorded CureResponseDelivered event before its CureDeadline.",
    "context": "Correction Response",
    "aggregate": "CorrectionActionRequest",
    "why": "Protects the client's 30-day cure window; a late cure is functionally a missed cure.",
    "enforcement": "Command handler blocks MarkResolved after CureDeadline without a delivered response"
   },
   {
    "invariant": "An EscalationReferral cannot close without a named receiving licensed professional or a documented client decline.",
    "context": "Licensing Boundary & Escalation",
    "aggregate": "EscalationReferral",
    "why": "Keeps PatioClear out of unauthorized practice of law or architecture.",
    "enforcement": "Command handler requires either field populated before CloseReferral"
   },
   {
    "invariant": "Every CompletenessPack records which RequirementRuleSet version it was assembled against.",
    "context": "Setup Guide Rule Library ↔ Pack Assembly",
    "aggregate": "CompletenessPack",
    "why": "Makes every pack's rule basis auditable if DOT's Setup Guide changes mid-cycle.",
    "enforcement": "Assembly command handler requires a rule-version reference"
   },
   {
    "invariant": "Exactly one active SeasonDeskSubscription exists per location at any time.",
    "context": "Season Desk Monitoring",
    "aggregate": "SeasonDeskSubscription",
    "why": "Prevents duplicate billing and conflicting monitoring alerts.",
    "enforcement": "Uniqueness constraint on active subscriptions per location"
   },
   {
    "invariant": "No AI-drafted content reaches a client without a source citation for every extracted field.",
    "context": "Completeness Fulfillment",
    "aggregate": "CompletenessPack",
    "why": "Missing fields must ship as explicit gaps, never invented data.",
    "enforcement": "Draft-composer output schema rejects any field without a citation"
   },
   {
    "invariant": "A hospitality-ops reviewer's signature is required on every CompletenessPack and every CureResponsePacket before delivery.",
    "context": "Pack Assembly ↔ Correction Response",
    "aggregate": "CompletenessPack / CorrectionActionRequest",
    "why": "Human accountability on every client-facing deliverable.",
    "enforcement": "Delivery command handler requires a signature reference"
   }
  ],
  "ai_agents": [
   {
    "name": "Extraction Agent",
    "context": "Extraction & Normalization",
    "responsibility": "Extract diagnosis, procedures, itemized charges, and dates from the portal status export and invoice into the canonical application schema.",
    "inputs": [
     "Medical-record export",
     "Itemized invoice"
    ],
    "outputs": [
     "Structured field values",
     "Source quotes",
     "Confidence scores"
    ],
    "tools": [
     "Retrieval API",
     "Structured-output validator"
    ],
    "forbidden_actions": [
     "Infer a field not explicitly present in the source text",
     "Access another practice's data",
     "Emit output without a source quote per field"
    ],
    "memory_scope": "Per-run only; no cross-run memory; prompt-injection scrubber on all practice inputs.",
    "retrieval_sources": [
     "Practice-scoped knowledge base",
     "DOT Rule Library (read-only per-DOT)"
    ],
    "validations": [
     "Structured-output schema",
     "Source-quote-per-field rule",
     "PII-scrub rule on prompt inputs"
    ],
    "confidence_scoring": "Model-reported logprobs + source-quote coverage combined into a bounded [0..1] score per field.",
    "escalation_triggers": [
     "Score < 0.70",
     "Ambiguous DOT match",
     "Missing source quote on any claimed field"
    ],
    "human_approval": true,
    "failure_modes": [
     "Prompt injection via invoice/chart content",
     "Hallucinated field without source",
     "Cross-practice retrieval leak"
    ],
    "audit_logs": [
     "Prompt version",
     "Retrieval hits (ids only)",
     "Cost + latency",
     "Validator verdict"
    ],
    "metrics": [
     "Extraction acceptance rate",
     "Escalation rate",
     "Cost per application",
     "p95 latency"
    ],
    "versioning": "Prompt versions immutable; published via PromptRegistryAggregate; rollout via feature flag."
   },
   {
    "name": "Assembly & Drafting Agent",
    "context": "Packet Assembly",
    "responsibility": "Assemble the application packet against the applicable RequirementRuleSet and draft CAR response language grounded in extracted chart data.",
    "inputs": [
     "ExtractedApplicationData",
     "RequirementRuleSet"
    ],
    "outputs": [
     "CompletenessPack draft",
     "Gap matrix pass/fail",
     "CureResponseDraft (conditional)"
    ],
    "tools": [
     "Retrieval API",
     "Structured-output validator",
     "PDF templating"
    ],
    "forbidden_actions": [
     "Mark a field present without a source_quote",
     "Characterize a diagnosis or treatment rationale beyond what's verbatim in the chart",
     "Compute days-pending or window-remaining figures (deterministic code only)"
    ],
    "memory_scope": "Per-run only; no cross-run memory; prompt-injection scrubber on all practice inputs.",
    "retrieval_sources": [
     "Practice-scoped knowledge base",
     "DOT Rule Library (read-only per-DOT)"
    ],
    "validations": [
     "Structured-output schema",
     "Source-quote-per-field rule",
     "PII-scrub rule on prompt inputs"
    ],
    "confidence_scoring": "Model-reported logprobs + source-quote coverage combined into a bounded [0..1] score per field.",
    "escalation_triggers": [
     "Score < 0.70",
     "Ambiguous DOT match",
     "Missing source quote on any claimed field"
    ],
    "human_approval": true,
    "failure_modes": [
     "Prompt injection via invoice/chart content",
     "Hallucinated field without source",
     "Cross-practice retrieval leak"
    ],
    "audit_logs": [
     "Prompt version",
     "Retrieval hits (ids only)",
     "Cost + latency",
     "Validator verdict"
    ],
    "metrics": [
     "Extraction acceptance rate",
     "Escalation rate",
     "Cost per application",
     "p95 latency"
    ],
    "versioning": "Prompt versions immutable; published via PromptRegistryAggregate; rollout via feature flag."
   },
   {
    "name": "Status Monitor Agent",
    "context": "Submission & Tracking",
    "responsibility": "Monitor application status and flag applications pending beyond the DOT's typical processing window.",
    "inputs": [
     "DeliveredPack records",
     "DOT typical-window benchmarks"
    ],
    "outputs": [
     "PortalStatusUpdated events",
     "Follow-up flags"
    ],
    "tools": [
     "Status tracker API"
    ],
    "forbidden_actions": [
     "Contact the DOT without a logged follow-up record",
     "Suppress a pending-past-window flag"
    ],
    "memory_scope": "Per-run only; no cross-run memory; prompt-injection scrubber on all practice inputs.",
    "retrieval_sources": [
     "Practice-scoped knowledge base",
     "DOT Rule Library (read-only per-DOT)"
    ],
    "validations": [
     "Structured-output schema",
     "Source-quote-per-field rule",
     "PII-scrub rule on prompt inputs"
    ],
    "confidence_scoring": "Model-reported logprobs + source-quote coverage combined into a bounded [0..1] score per field.",
    "escalation_triggers": [
     "Score < 0.70",
     "Ambiguous DOT match",
     "Missing source quote on any claimed field"
    ],
    "human_approval": true,
    "failure_modes": [
     "Prompt injection via invoice/chart content",
     "Hallucinated field without source",
     "Cross-practice retrieval leak"
    ],
    "audit_logs": [
     "Prompt version",
     "Retrieval hits (ids only)",
     "Cost + latency",
     "Validator verdict"
    ],
    "metrics": [
     "Extraction acceptance rate",
     "Escalation rate",
     "Cost per application",
     "p95 latency"
    ],
    "versioning": "Prompt versions immutable; published via PromptRegistryAggregate; rollout via feature flag."
   }
  ],
  "prompt_chain_map": [
   "Intake → Classifier (route + DOT category) → Drafter (cite + draft) → OutputValidator → Reviewer (approve or escalate)",
   "Retraction analysis → Evaluator (assist only) → Legal + Reviewer co-sign"
  ],
  "rag_map": [
   "Per-tenant knowledge base partition → retrieval router → tenant-scoped hits → Drafter",
   "Public regulator 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-application",
   "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": "Hospitality-ops reviewer",
    "responsibilities": [
     "Approve / return every Completeness Pack before delivery",
     "Sign every delivered pack and cure response"
    ],
    "contexts": [
     "Pack Assembly",
     "Correction Response"
    ],
    "decisions_owned": [
     "Approval",
     "Return-for-correction",
     "Exception routing"
    ],
    "ai_support": [
     "Cited extractions",
     "Confidence-ranked gap-matrix fields"
    ],
    "approval_authority": "Full pack release",
    "escalation_authority": "Escalate to licensed partner or founder",
    "quality_metrics": [
     "Cycle time to release",
     "Re-pause-after-delivery rate"
    ],
    "workload_risks": [
     "Single-reviewer bottleneck at volume"
    ]
   },
   {
    "role": "Licensed counsel / RA partner",
    "responsibilities": [
     "Take contested community-board matters, SLA representation, and any required architectural stamp"
    ],
    "contexts": [
     "Licensing Boundary & Escalation"
    ],
    "decisions_owned": [
     "Legal or architectural conclusions"
    ],
    "ai_support": [
     "Referral summary with documentation package"
    ],
    "approval_authority": "Full authority within their own licensed scope",
    "escalation_authority": "None upstream — they are the terminal escalation point",
    "quality_metrics": [
     "Referral acceptance rate",
     "Client satisfaction post-referral"
    ],
    "workload_risks": [
     "Partner channel conflict if referrals feel like competition"
    ]
   },
   {
    "role": "Founder / ops lead",
    "responsibilities": [
     "Reviewer capacity planning, pilot-cap enforcement, rework-rate monitoring"
    ],
    "contexts": [
     "Completeness Fulfillment",
     "Season Desk Monitoring"
    ],
    "decisions_owned": [
     "Pilot cap",
     "Sales pause on rework threshold breach"
    ],
    "ai_support": [
     "Weekly ops dashboard"
    ],
    "approval_authority": "Business-level go/no-go on scaling",
    "escalation_authority": "None upstream",
    "quality_metrics": [
     "Rework rate",
     "Reviewer bottleneck signal"
    ],
    "workload_risks": [
     "Key-person bottleneck before SOPs are captured"
    ]
   }
  ],
  "human_review_checkpoints": [
   "AI-built gap matrix → hospitality-ops reviewer confirmation of low-confidence fields",
   "Assembled pack → hospitality-ops reviewer sign-off before delivery",
   "Cure response packet → hospitality-ops reviewer sign-off before delivery",
   "Any legal/architecture-adjacent content → escalation, never in-house sign-off"
  ],
  "escalation_matrix": [
   "AI Orchestrator → hospitality-ops reviewer → licensed partner → founder",
   "Ops team → founder → external counsel (regulator or Comptroller inquiries)"
  ],
  "manual_override_rules": [
   "Any manual override captured as an explicit override event with actor + reason",
   "No override may bypass the reviewer-signoff invariant on pack or cure-response delivery"
  ],
  "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": "service event",
    "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": "3 years + 6 months (the gap matrix retention + buffer)",
    "privacy": "confidential",
    "audit": true
   },
   {
    "name": "field evidence",
    "meaning": "Cited fact backing a application",
    "owner_context": "Service Fulfillment",
    "writers": [
     "Service Fulfillment"
    ],
    "readers": [
     "QA",
     "Analytics"
    ],
    "source_of_truth": "Service Fulfillment DB + Knowledge Base pointers",
    "retention": "3 years + 6 months",
    "privacy": "confidential",
    "audit": true
   },
   {
    "name": "Completeness Pack",
    "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": "3 years + 6 months (mirrors the the gap matrix 3-year duty + buffer)",
    "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": "3 years + 6 months",
    "privacy": "confidential",
    "audit": true
   },
   {
    "name": "OwnerActionLedger",
    "meaning": "Blocker facts per tenant",
    "owner_context": "Compliance & Governance",
    "writers": [
     "Compliance & Governance"
    ],
    "readers": [
     "Service Fulfillment (release decision)",
     "Analytics"
    ],
    "source_of_truth": "Compliance DB",
    "retention": "3 years + 6 months",
    "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": "Tenant",
    "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 + 3.5 years",
    "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 tenant): 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: 3 years + 6 months (mirrors the the gap matrix 3-year duty + buffer)",
   "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 hospitality-ops-reviewer-signed Completeness Pack",
    "actor": "Owner-operator / GM + hospitality-ops reviewer",
    "context": "Completeness Fulfillment + Pack Assembly + Setup Guide Rule Library",
    "goal": "Produce and deliver a reviewer-signed Completeness Pack the client can upload to DOT",
    "preconditions": [
     "Location onboarded",
     "Reviewer registered",
     "Intake accepted"
    ],
    "main_flow": [
     "Client submits intake",
     "AI builds gap matrix",
     "Client sends missing artifacts",
     "AI assembles pack",
     "Reviewer approves",
     "Pack delivered",
     "Day-7 status check"
    ],
    "alternative_flows": [
     "Confidence below threshold → reviewer triage → manual field confirmation",
     "Open Critical gap → ExceptionMemo logged → escalation or client resolution",
     "Delivery failure → client alerted within 1 hour"
    ],
    "business_rules": [
     "Every gap-matrix line must cite a source",
     "Only a registered reviewer may sign"
    ],
    "ai_role": "Draft + validate + score confidence",
    "human_role": "Sign; escalate; confirm low-confidence fields",
    "commands": [
     "SubmitIntake",
     "BuildGapMatrix",
     "AssemblePack",
     "ReviewPack",
     "DeliverArtifact"
    ],
    "events": [
     "IntakeReceived",
     "GapMatrixBuilt",
     "PackAssembled",
     "PackApproved",
     "PackDelivered"
    ],
    "aggregates": [
     "ApplicationCaseAggregate",
     "CompletenessPackAggregate"
    ],
    "success": "Completeness Pack delivered within 7 business days (3 on rush) with a signed hospitality-ops-reviewer attestation",
    "failure_handling": "Confidence-below-threshold → reviewer triage queue; DeliveryFailed → client alert within 1 hour + retry",
    "audit": "Full command → event chain with actor + timestamp per step"
   },
   {
    "name": "Respond to a Correction Action Request within its cure window",
    "actor": "Owner-operator / GM + hospitality-ops reviewer",
    "context": "Correction Response",
    "goal": "Deliver a complete cure response before the CAR's 30-day deadline",
    "preconditions": [
     "A prior ApplicationCase exists",
     "CAR document received from the client"
    ],
    "main_flow": [
     "Client logs the CAR",
     "System calculates CureDeadline",
     "AI drafts the cure response against the CAR's specific items",
     "Reviewer approves",
     "Cure response delivered"
    ],
    "alternative_flows": [
     "CAR flagged urgent inside 5 days of deadline → reviewer prioritized",
     "Cure content touches a legal question → escalated to counsel instead of drafted"
    ],
    "business_rules": [
     "A cure response delivered after the deadline does not close the CAR as Resolved"
    ],
    "ai_role": "Draft grounded in the specific CAR items and prior pack data",
    "human_role": "Sign; escalate legal-adjacent content",
    "commands": [
     "LogCorrectionRequest",
     "AssembleCureResponse"
    ],
    "events": [
     "CorrectionRequestReceived",
     "CureResponseDelivered"
    ],
    "aggregates": [
     "CorrectionActionRequestAggregate"
    ],
    "success": "Cure response delivered with time to spare before CureDeadline",
    "failure_handling": "CureDeadline at risk (<5 days) → reviewer priority queue; legal-adjacent content → EscalationRouted instead of drafted",
    "audit": "Full command → event chain with actor + timestamp per step"
   },
   {
    "name": "Escalate a licensing-boundary question instead of answering it",
    "actor": "Hospitality-ops reviewer",
    "context": "Licensing Boundary & Escalation",
    "goal": "Route any UPL-risk, architecture-stamp, or contested-hearing question to a licensed partner without drafting a legal or architectural conclusion in-house",
    "preconditions": [
     "A pack or client question is flagged by rule or reviewer judgment"
    ],
    "main_flow": [
     "Reviewer flags the content",
     "System opens an EscalationReferral",
     "Referral routed to a named licensed partner",
     "Partner takes the matter or client declines"
    ],
    "alternative_flows": [
     "Client declines referral → documented decline closes the referral"
    ],
    "business_rules": [
     "No EscalationReferral closes without a named partner or a documented decline"
    ],
    "ai_role": "Detect flaggable content patterns; assist the referral summary",
    "human_role": "Confirm the escalation; select or introduce the partner",
    "commands": [
     "RouteEscalation"
    ],
    "events": [
     "EscalationRouted",
     "EscalationResolved"
    ],
    "aggregates": [
     "EscalationReferralAggregate"
    ],
    "success": "Every UPL/architecture/contested-hearing matter is referred, never resolved in-house",
    "failure_handling": "No licensed partner available → founder holds the referral open and notifies the client of the delay",
    "audit": "Referral log with reason + receiving partner + 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-tenant 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 + tenant-scoped retrieval; retries with backoff.",
   "rag_layer": "Per-tenant partitioned retrieval indices in a managed vector DB; ingestion pipeline in Knowledge Base context.",
   "file_storage": "Managed blob storage with per-tenant 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 tenants, 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 tenant + 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, Tenant, Actor\n    /events        # published-language event contracts\n    /auth          # session + role primitives\n    /observability # logging, metrics, tracing\n    /config",
   "modules": [
    {
     "name": "service-fulfillment",
     "purpose": "ServiceEvent → Completeness Pack lifecycle",
     "owned_domain": [
      "ServiceEvent",
      "Draft",
      "Completeness Pack",
      "Delivery"
     ],
     "application_services": [
      "OpenIntake",
      "AttachEvidence",
      "SubmitForSignoff",
      "DeliverCompletenessPack"
     ],
     "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": [
      "OpenAI/Anthropic client",
      "Retrieval router"
     ],
     "public_interfaces": [
      "internal"
     ],
     "forbidden_deps": [
      "cross-tenant 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, Tenant, 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 + tenant-scoped retrieval",
     "audit": "AgentRun trace"
    },
    {
     "risk": "Cross-tenant retrieval leak",
     "context": "Knowledge Base",
     "impact": "severe",
     "control": "Per-tenant index partitions + TenantIsolationSpec 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 application",
     "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-tenant blob storage prefixes + signed URLs"
   ],
   "access_control_matrix": [
    {
     "role": "Customer operator",
     "context": "Service Fulfillment",
     "capabilities": [
      "OpenIntake",
      "AttachEvidence",
      "View own artifacts"
     ]
    },
    {
     "role": "ops-reviewer reviewer",
     "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 + tenant + timestamp + command + before/after hash",
    "PII scrubbed",
    "Exportable per tenant on request (DSAR support)"
   ]
  },
  "observability": {
   "metrics": [
    {
     "metric": "Reviewer-signed artifacts / week / tenant",
     "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-tenant retrieval violation attempts",
     "type": "risk",
     "context": "Knowledge Base",
     "why": "Security invariant",
     "target": "0",
     "alert_threshold": "any > 0"
    },
    {
     "metric": "First-artifact time per tenant",
     "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-tenant 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": "CompletenessPackAggregate 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": "Tenant isolation + coverage",
     "context": "Knowledge Base",
     "example": "Cross-tenant 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 tenant 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": [
     "service event",
     "field evidence",
     "Completeness Pack"
    ],
    "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": [
     "OpenAI / Anthropic"
    ],
    "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 applications"
    ],
    "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 tenants",
    "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 tenants",
    "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 tenants",
    "trigger": "Multi-reviewer demand",
    "architecture_change": "Split AI Orchestration into its own service if throughput/isolation demands it; per-tenant retrieval sharding",
    "operational_change": "Dedicated success + prompt-ops roles",
    "risk": "Prompt version drift"
   },
   {
    "stage": "100+ tenants",
    "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": "A state's adjuster/TPA statute sweeps in ministerial applications-processing more broadly than New York guidance",
    "likelihood": "medium",
    "impact": "severe",
    "signal": "See ProductBlueprintDNA / risk register for tuned early-warning signals",
    "mitigation": "Counsel review before each new state activates",
    "owner": "legal",
    "context": "Compliance & Governance"
   },
   {
    "risk": "AI hallucination in a delivered application packet",
    "likelihood": "medium",
    "impact": "high",
    "signal": "See ProductBlueprintDNA / risk register for tuned early-warning signals",
    "mitigation": "Retrieval-first pipeline + structured output validation + hospitality-ops-reviewer gate",
    "owner": "engineering",
    "context": "AI Orchestration"
   },
   {
    "risk": "Cross-practice data leak",
    "likelihood": "low",
    "impact": "severe",
    "signal": "See ProductBlueprintDNA / risk register for tuned early-warning signals",
    "mitigation": "Row-level auth + per-practice retrieval indices + log-scrubbing",
    "owner": "engineering",
    "context": "Knowledge Base"
   },
   {
    "risk": "Applications-reviewer bottleneck as onboarding outpaces reviewer capacity",
    "likelihood": "high",
    "impact": "high",
    "signal": "See ProductBlueprintDNA / risk register for tuned early-warning signals",
    "mitigation": "Pilot cap + contractor reviewer added by month 7 per financial model",
    "owner": "ops",
    "context": "Applications Review"
   }
  ],
  "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 + regulator acceptance."
   },
   {
    "id": "ADR-006",
    "decision": "Integration strategy",
    "status": "accepted",
    "context": "External systems: Vendor invoice inboxes, HVAC work-order / CMMS platforms, Customer AP / document portals, ...",
    "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-tenant AI queue + multi-reviewer routing at Phase 2."
    },
    {
     "category": "Security and compliance",
     "score": 7,
     "weakness": "High-trust vertical needs Type II mapping and per-regime 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 tenant 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 pack 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": [
    "trained hospitality-ops reviewer to validate release-gate ergonomics",
    "Restaurant-permit-applications SME on invoice-field and chart-evidence taxonomy"
   ],
   "needs_legal": [
    "Retraction workflow language",
    "DSAR SLA + regulator-response runbook",
    "Public-application 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-tenant retrieval isolation test"
   ],
   "validate_before_prod": [
    "Named licensed reviewer + engagement letter on file",
    "Owner-action ledger populated per launch tenant",
    "OutputValidator false-negative rate acceptable",
    "Delivery failure alert path tested"
   ]
  },
  "final_recommendations": [
   "Ship a modular-monolith, evidence-linked, reviewer-gated vertical slice for PatioClear. Preserve the invariant that no Completeness Pack leaves the system without a signed human release — analyst on green/yellow, the DOT ops-reviewer reviewer on red. Do not launch commercially until owner-action facts close and at least one human-released Completeness Pack 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 application on the PatioClear 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": [
    {
     "evidence_type": "primary",
     "source": "Business Understanding + subdomain 'Service Fulfillment'",
     "strength": "strong",
     "gaps": "Confirm with 3 design-partner interviews",
     "claim": "PatioClear paid outcome is a reviewer-signed artifact"
    },
    {
     "evidence_type": "primary",
     "source": "Vertical shape + regulator archetype",
     "strength": "strong",
     "gaps": "Vertical-specific attestation standard citation",
     "claim": "Reviewer signoff is legally / commercially required for defensibility"
    },
    {
     "evidence_type": "assumed",
     "source": "Category benchmark",
     "strength": "medium",
     "gaps": "Measure on internal golden dataset",
     "claim": "AI drafting materially reduces cycle time vs. pure manual"
    },
    {
     "evidence_type": "assumed",
     "source": "Prospect conversations (unverified)",
     "strength": "weak",
     "gaps": "Run 5 intake dry-runs with design partners",
     "claim": "Customer will supply structured intake within SLA"
    },
    {
     "evidence_type": "primary",
     "source": "Architecture (Knowledge Base context)",
     "strength": "strong",
     "gaps": "Add automated cross-tenant lookup test",
     "claim": "Per-tenant retrieval isolation prevents cross-tenant leakage"
    },
    {
     "evidence_type": "primary",
     "source": "Compliance & Governance context invariants",
     "strength": "strong",
     "gaps": "None",
     "claim": "Owner-action ledger blocks premature public release"
    },
    {
     "evidence_type": "primary",
     "source": "AI Orchestration context",
     "strength": "strong",
     "gaps": "Evaluator regression thresholds not yet baselined",
     "claim": "Model + prompt versioning enables reproducible outputs"
    },
    {
     "evidence_type": "assumed",
     "source": "Pricing hypothesis",
     "strength": "medium",
     "gaps": "Test with 3 pricing conversations",
     "claim": "Cycle-time reduction supports premium pricing"
    }
   ],
   "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 pack 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-tenant 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 regulators 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 application 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": "the DOT finalizes a rule change touching the gap matrix scope",
     "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-application 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 application / 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": "TenantProvisioned, 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, Tenant, 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": "ServiceEventAggregate",
     "scenario": "Concurrent command on ServiceEventAggregate",
     "invariant_at_risk": "Every application in a delivered artifact cites evidence",
     "verdict": "holds"
    },
    {
     "aggregate": "CompletenessPackAggregate",
     "scenario": "Concurrent command on CompletenessPackAggregate",
     "invariant_at_risk": "A Completeness Pack 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": "the DOT restaurant permit applications ER&R (the DOT-specific gap matrix) with the ministerial-vs-discretionary applications-processing boundary",
     "applies_because": "Ministerial applications-processing records are reconstructable on demand; recurring-exception reports go to the DOT (always customer-submitted).",
     "controls": [
      "Cited rule provision per application",
      "ops-reviewer reviewer release on red packs"
     ],
     "evidence_required": [
      "rule-to-record map",
      "Pack release records + tracker rows"
     ]
    }
   ],
   "unit_economics": {
    "price_model": "Flat per-application fee ($12-$18) + per-location monthly Season Desk",
    "unit_of_value": "Released restaurant-permit-applications-case-acceptance-desk Completeness Pack",
    "gross_margin_pct": 61,
    "cost_drivers": [
     "Reviewer hours per artifact",
     "AI model + retrieval cost",
     "External API + delivery cost",
     "Support + success"
    ],
    "breakeven_note": "Breakeven depends on analyst throughput and extraction acceptance rate; target analyst minutes per green pack ≤12 by day 90 and ≥40% straight-through extraction by month 6."
   },
   "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-tenant retrieval scan cost",
     "cause": "Missing partitioning",
     "impact": "high",
     "mitigation": "Per-tenant 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-Native 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-DeliverCompletenessPack-DeliveryFailed",
     "severity": "info",
     "message": "Command DeliverCompletenessPack references event 'DeliveryFailed' not present in domain_events",
     "refs": [
      "DeliverCompletenessPack",
      "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": [
      "ServiceEventAggregate",
      "CompletenessPackAggregate",
      "SignoffAggregate",
      "RetractionAggregate",
      "AgentRunAggregate",
      "OwnerActionLedgerAggregate",
      "TenantAggregate",
      "DeliveryAggregate"
     ],
     "events": [
      "serviceEventAccepted",
      "EvidenceCollected",
      "DraftReady",
      "EscalationRaised",
      "ReviewerSigned",
      "ArtifactDelivered",
      "OwnerActionResolved",
      "RetractionFiled"
     ],
     "commands": [
      "OpenIntake",
      "AttachEvidence",
      "StartAgentRun",
      "ApproveArtifact",
      "DeliverCompletenessPack",
      "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 Completeness Pack cannot be delivered without a valid Reviewer signoff.",
      "Every application 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 tenant partition per call.",
      "Release cannot flip to 'ready' with open blocking owner actions.",
      "Every tenant has at least one named reviewer with valid credential.",
      "Roles are stored in a dedicated table and checked server-side."
     ],
     "integrations": [
      "Vendor invoice inboxes",
      "HVAC work-order / CMMS platforms",
      "Customer AP / document portals",
      "OpenAI / Anthropic API"
     ],
     "adrs": [
      "ADR-001",
      "ADR-002",
      "ADR-003",
      "ADR-004",
      "ADR-005",
      "ADR-006",
      "ADR-007",
      "ADR-008"
     ]
    }
   }
  }
 },
 "ddd_coverage": {
  "slug": "nyc-outdoor-dining-permit-completeness-pack-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 application (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": "restaurant-permit-applications-case-acceptance-desk",
  "archetypes": [
   "regulated system",
   "CRUD/workflow application",
   "internal operations platform"
  ],
  "archetype_impact": "DOT and practice identity are global query parameters — every read/write is scoped by application, DOT, and practice, not just tenant.",
  "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 March-reporting-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 (client-authorization records, reviewer attestations, 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 applications; client-side filter for audit trail. Dedicated index deferred.",
   "analytics": "Lightweight event log in Postgres; dashboard-grade analytics deferred until we have a paying tenant.",
   "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; service records, attestations, regulator 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-tenant 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 March-reporting-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 tenant if a single tenant 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 budget, 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 pack for Healthcare / revenue cycle 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 pack is small and structured, so section/keyword lookups suffice until a larger corpus justifies similarity search.",
   "embeddings": "Deferred with the vector store; rule-pack keys are structured (element, source, subsection), not semantic.",
   "eval": "A gold set of specialist-released packs 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 pack 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 budget."
    },
    {
     "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 budget 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 budget.",
   "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; service records, attestations, regulator 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 (client-authorization records, reviewer attestations, retention schedules)",
   "residency": "Single region at MVP; residency contract triggers per-tenant 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 tenant 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 restaurant-permit-applications-case-acceptance-desk]\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 tenant 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 (client-authorization records, reviewer attestations, 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 applications"
    ],
    "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 application without changing policies.",
    "revisit_when": "Enterprise SSO / SAML contract signed, or role count exceeds ~10."
   },
   {
    "id": "ADR-007",
    "decision": "Single-tenant 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-tenant",
     "DB-per-tenant"
    ],
    "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 tenant 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-tenant 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)",
     "Tenant-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 application → rollback the blueprint.",
    "fallback": "Auto-hide the article + surface owner action to regenerate with stricter prompt.",
    "category": "product"
   },
   {
    "risk": "Cross-tenant 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": "Regulator-visible gap → incident + disclosure per policy.",
    "fallback": "Freeze affected blueprint's release state; produce backfill evidence pack.",
    "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": "Regulator-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 tenant-scoped queries must enforce tenant 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 (client-authorization records, reviewer attestations, 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 tenants.",
    "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 application.",
     "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 budget 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 pack."
    ],
    "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 (Pack-register tabs with regime chip) and accent (clinical-teal) are network invariants — respect them."
    ]
   }
  }
 },
 "design": {
  "slug": "restaurant-permit-applications-case-acceptance-desk",
  "archetypes": [
   "healthcare-adjacent workflow tool",
   "applications-operations system",
   "financial-administration back office"
  ],
  "user_mindset": {
   "goals": "Get an applicant restaurant's application submitted complete and on time, without becoming an permit expert.",
   "session_length": "Bursty around insured-client visits; otherwise a weekly-digest review of open applications.",
   "confidence": "Practical, time-pressed users; will not tolerate a portal that takes longer to operate than doing the paperwork themselves.",
   "interface_needs": "Fast status scanning, plain-language application states, clear next-action per application."
  },
  "posture": [
   "warm",
   "trustworthy",
   "operational"
  ],
  "density": "comfortable",
  "trust_level": {
   "tier": "high",
   "sensitive_domains": [
    "client medical-record excerpts",
    "site-plan packet data",
    "client-authorization records"
   ],
   "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 hospitality-ops reviewer on every submitted application.",
    "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é: paw-print clip-art and alarm-red penalty banners"
   ],
   "strategy": "Anchor on the application-status chip (submitted / pending / past-window / needs-input) as the recurring signature element; every page must include it at least once. Reserve the warm amber accent for action/CTA and status signals only."
  },
  "territories": [
   {
    "name": "Application Desk",
    "color_mood": "clinical teal + warm parchment",
    "typography": "Charter/Iowan Old Style serif + system sans",
    "density": "comfortable card grid",
    "component_feel": "GM application tracker",
    "motion": "none (static, print-parity)",
    "fits": "practice-manager daily use",
    "risks": "could read as generic healthcare SaaS without the warm accent"
   },
   {
    "name": "Portfolio Atlas",
    "color_mood": "map ink + civic navy",
    "typography": "Neue Haas Grotesk",
    "density": "map-driven",
    "component_feel": "multi-location DSO atlas",
    "motion": "map pan",
    "fits": "multi-location portfolios",
    "risks": "requires multi-location data not present at launch"
   },
   {
    "name": "Application-Window Timeline",
    "color_mood": "slate + amber",
    "typography": "Inter",
    "density": "timeline",
    "component_feel": "gantt of open applications",
    "motion": "scroll-sync",
    "fits": "recurring visit/application cadence",
    "risks": "gantt fatigue for small practices"
   }
  ],
  "chosen_territory": "Application Desk",
  "chosen_rationale": "The application is the deliverable; the desk metaphor keeps every screen artifact-shaped, the way a owner-operator would check it between appointments.",
  "prioritized_components": [
   {
    "name": "Application-status chip",
    "why": "every application is scoped by one of four domain-state statuses"
   },
   {
    "name": "Application-window card w/ next-action",
    "why": "primary time-critical work unit"
   },
   {
    "name": "Completeness Pack assembler",
    "why": "output is a bundle with a hard-fail gap matrix"
   }
  ],
  "patterns": [
   {
    "name": "DOT switcher",
    "description": "Global DOT selector; every completeness check respects the selected DOT's rule set."
   },
   {
    "name": "Application release sign-off",
    "description": "Named hospitality-ops reviewer with attestation copy; clinical appeals cannot release without ops reviewer/ops-reviewer sign-off."
   }
  ],
  "states": [
   "default",
   "hover",
   "active",
   "focus",
   "disabled",
   "loading",
   "skeleton",
   "empty",
   "error",
   "warning",
   "success",
   "offline",
   "permission-paused",
   "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": [
    "Application-status chip motif",
    "Gap-register-not-invented-data copy discipline"
   ],
   "cliches_avoided": [
    "Paw-print clip-art",
    "Green-check compliance theatre",
    "Permit-scare banners"
   ],
   "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": "168 58% 22%",
   "brand-fg": "40 30% 97%",
   "surface": "40 22% 97%",
   "ink": "200 22% 14%",
   "muted": "200 10% 40%",
   "accent": "20 63% 37%"
  },
  "type": {
   "display": "Charter, 'Iowan Old Style', Georgia, ui-serif, serif",
   "body": "-apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif",
   "fonts_url": ""
  },
  "signature": {
   "motif": "Application-status chip · warm clinical palette",
   "render": "status-chip-grid"
  }
 },
 "seo": {
  "slug": "nyc-outdoor-dining-permit-completeness-pack-engine",
  "archetype": "DOT-fluent authority site",
  "archetype_impact": "Search fit is a DOT-fluent authority site aimed at owner-operators and GMs, not diners. That means depth over breadth: each page names the specific Setup Guide requirement, application type, or pause reason it addresses, and thin variants are refused.",
  "authority_dna": {
   "site_archetype": "DOT-fluent authority site",
   "monetization_model": "B2B lead → free Application Gap Scan → paid Completeness Pack engagement (not ad revenue; not affiliate).",
   "main_search_intents": [
    "informational",
    "commercial"
   ],
   "topical_authority_opportunity": "Own the 'Dining Out NYC application completeness' topic cluster for the owner-operator audience by covering the entire workflow — sidewalk vs roadway requirements, CAR response mechanics, SLA alteration sequencing, insurance endorsement mistakes — better than any consumer-facing outdoor-dining explainer.",
   "local_seo_opportunity": "Justified but narrow: this is inherently a single-city (NYC) service; no /city/ expansion pages until PatioClear actually operates in a second city's program.",
   "global_national_opportunity": "Not applicable at launch — NYC-only until Philly or Portland expansion is decided.",
   "easiest_ranking_path": "Long-tail, operator-specific queries ('dining out nyc application paused what to do', 'dining out nyc CAR correction action request') where the SERP is dominated by DOT's own thin FAQ pages, not practice-side operational content.",
   "hardest_ranking_path": "Head terms like 'outdoor dining nyc' or 'sidewalk cafe permit' — dominated by DOT's own domain and aged hospitality-law-firm pages. Defer until authority is established.",
   "trust_credibility_requirements": [
    "Named human authors with role + credentials",
    "DOT Setup Guide / Admin Code citations on every completeness-checklist claim",
    "Last-reviewed date + change log on Setup Guide-dependent pages",
    "Direct links to DOT's own Dining Out NYC guidance (not aggregators)",
    "Hospitality-ops reviewer attribution on any page describing the review process"
   ],
   "ymyl": false,
   "expert_review_needed": true,
   "site_structure": "Authority hub + narrow high-intent service page + linkable evidence assets (Gap Scan, Setup Guide cheat sheets). Not a directory. Not a marketplace.",
   "seo_moat": "always-current, sidewalk-vs-roadway completeness-checklist pages with change-log timestamps, covering both application types rather than one"
  },
  "search_market": {
   "primary_markets": [
    "Dining Out NYC application completeness workflow",
    "paused outdoor dining application unblock"
   ],
   "secondary_markets": [
    "CAR (Correction Action Request) response support",
    "SLA alteration document prep for outdoor dining",
    "roadway season readiness"
   ],
   "low_competition_subtopics": [
    "sidewalk vs roadway completeness checklist differences",
    "portal-status-to-pack workflow",
    "Dining Out NYC insurance endorsement mistakes"
   ],
   "high_commercial_intent": [
    "done-for-you dining out nyc completeness pack",
    "outsource outdoor dining application paperwork",
    "hospitality-ops reviewer service nyc"
   ],
   "informational": [
    "why is my dining out nyc application paused",
    "how long does a dining out nyc application take",
    "what does a complete dining out nyc application need"
   ],
   "local_intent": [
    "nyc outdoor dining permit help",
    "sidewalk cafe application assistance nyc"
   ],
   "transactional": [
    "PatioClear pricing",
    "book a free Application Gap Scan",
    "dining out nyc completeness pack demo"
   ],
   "comparison": [
    "done-for-you completeness pack vs hospitality attorney",
    "completeness pack vs in-house GM filing"
   ],
   "problem_solution": [
    "dining out nyc application stuck paused",
    "dining out nyc missing insurance certificate",
    "no time to file outdoor dining paperwork"
   ],
   "near_me": [],
   "long_tail": [
    "how to fix a paused dining out nyc application",
    "what happens when a dining out nyc CAR arrives",
    "dining out nyc site plan form help"
   ],
   "questions": [
    "what does a complete dining out nyc application packet need?",
    "who is responsible for filing a dining out nyc application?",
    "how fast should a paused dining out nyc application clear?"
   ],
   "emerging": [
    "AI-assisted dining out nyc gap analysis",
    "automated setup guide rule tracking for restaurants"
   ],
   "seasonal": [
    "roadway season prep checklist february-april"
   ],
   "underserved_serps": [
    "sidewalk vs roadway completeness checklist comparisons",
    "CAR response mechanics explained"
   ],
   "weak_serps": [
    "dining out nyc pause reasons list",
    "outdoor dining application checklist nyc"
   ],
   "forum_dominated_serps": [
    "what happens if a dining out nyc application is never resolved",
    "outdoor dining permit horror stories nyc"
   ],
   "winnable_authoritative_serps": [
    "dining out nyc completeness definitive guide",
    "setup guide requirements by application type"
   ],
   "avoid_initially": [
    "best outdoor dining nyc restaurants",
    "outdoor dining nyc reviews",
    "nyc restaurant patio design ideas"
   ],
   "easy_wins": [
    "sidewalk vs roadway completeness checklist differences",
    "CAR response mechanics",
    "why dining out nyc applications get paused"
   ],
   "moderate": [
    "dining out nyc completeness definitive guide",
    "SLA alteration sequencing after DOT approval"
   ],
   "long_term_plays": [
    "multi-city outdoor dining completeness comparison (philly, portland, la)",
    "portfolio-wide season desk dashboards for restaurant groups"
   ],
   "do_not_pursue": [
    "generic 'how to start a restaurant' content",
    "celebrity or trend-jacking posts",
    "AI-generated listicles"
   ]
  },
  "keyword_clusters": [
   {
    "primary": "why is my dining out nyc application paused for missing information",
    "related": [
     "dining out nyc pause reasons",
     "missing documentation dining out nyc"
    ],
    "intent": "informational",
    "user_problem": "An operator's application is paused and DOT's notice doesn't say exactly which item is missing",
    "funnel": "MOFU",
    "business_value": "high",
    "ranking_difficulty": "low",
    "conversion_potential": "high",
    "content_effort": "medium",
    "serp_weakness": "SERP dominated by DOT's own thin FAQ pages, not practice-side operational content",
    "local_relevance": "high",
    "global_relevance": "low",
    "suggested_page_type": "Pillar / evidence guide",
    "reason": "High buyer intent + weak SERP + our unique operator-side proof",
    "priority_score": 17,
    "priority": "P0",
    "bucket": "easy-win"
   },
   {
    "primary": "done-for-you dining out nyc completeness pack vs hospitality attorney",
    "related": [
     "dining out nyc paperwork help alternatives",
     "attorney vs completeness desk"
    ],
    "intent": "commercial",
    "user_problem": "Evaluating a $3k-6k attorney engagement vs a lower-cost done-for-you completeness pack",
    "funnel": "BOFU",
    "business_value": "high",
    "ranking_difficulty": "medium",
    "conversion_potential": "high",
    "content_effort": "medium",
    "serp_weakness": "Weak — mostly hospitality law firms' own service pages",
    "local_relevance": "high",
    "global_relevance": "low",
    "suggested_page_type": "Comparison page (honest, evidence-based)",
    "reason": "Late-funnel intent with weak competition",
    "priority_score": 17,
    "priority": "P0",
    "bucket": "easy-win"
   },
   {
    "primary": "dining out nyc CAR correction action request explained",
    "related": [
     "dining out nyc 30-day cure window",
     "correction action request response"
    ],
    "intent": "informational",
    "user_problem": "Operator wants a concrete, plain-language explanation of what a CAR is and the cure clock",
    "funnel": "MOFU",
    "business_value": "medium",
    "ranking_difficulty": "low",
    "conversion_potential": "medium",
    "content_effort": "low",
    "serp_weakness": "Weak — thin DOT glossary entries",
    "local_relevance": "high",
    "global_relevance": "low",
    "suggested_page_type": "Resource / explainer page",
    "reason": "Easy win + strong trust-building fit",
    "priority_score": 14,
    "priority": "P0",
    "bucket": "easy-win"
   },
   {
    "primary": "sidewalk vs roadway completeness checklist comparison",
    "related": [
     "what does a complete dining out nyc application need",
     "application requirements by type"
    ],
    "intent": "informational",
    "user_problem": "Needs authoritative, application-type-specific completeness requirements in one place",
    "funnel": "TOFU",
    "business_value": "medium",
    "ranking_difficulty": "low",
    "conversion_potential": "medium",
    "content_effort": "medium",
    "serp_weakness": "Weak — no aggregator covers this from the operator side",
    "local_relevance": "high",
    "global_relevance": "low",
    "suggested_page_type": "Data table page (updated quarterly)",
    "reason": "Recurring reference traffic + easy freshness moat",
    "priority_score": 14,
    "priority": "P0",
    "bucket": "easy-win"
   }
  ],
  "topical_authority_map": {
   "core_topics": [
    "Dining Out NYC application completeness — definitive guide",
    "CAR response & 30-day cure mechanics",
    "Setup Guide requirement library by application type"
   ],
   "pillars": [
    {
     "name": "Dining Out NYC application completeness — definitive guide",
     "core_intent": "informational",
     "audience": "owner-operators, GMs, and restaurant-group compliance coordinators",
     "conversion_goal": "Application Gap Scan signup → pilot conversation",
     "supporting_pages": [
      "Why applications get paused for missing information",
      "CAR response mechanics explained",
      "Sidewalk vs roadway completeness checklist comparison",
      "FAQ: dining out nyc applications"
     ],
     "internal_links": [
      "/product",
      "/setup-guide/",
      "/resources/checklist"
     ],
     "schema": [
      "Article",
      "BreadcrumbList",
      "FAQPage (where genuine)"
     ],
     "evidence_needed": [
      "Named hospitality-ops reviewer",
      "Primary-source DOT citations",
      "Worked example"
     ],
     "local_variants": [
      "NYC (default)"
     ],
     "national_variants": [
      "Not applicable — single-city launch"
     ]
    },
    {
     "name": "CAR response & 30-day cure mechanics",
     "core_intent": "commercial",
     "audience": "owner-operators, GMs, and restaurant-group compliance coordinators",
     "conversion_goal": "Book a pilot conversation",
     "supporting_pages": [
      "CAR causes, ranked",
      "What a complete CAR response needs",
      "Common completeness gaps"
     ],
     "internal_links": [
      "/product",
      "/guides/car-response/",
      "/resources/gap-scan"
     ],
     "schema": [
      "Article",
      "FAQPage",
      "BreadcrumbList"
     ],
     "evidence_needed": [
      "Worked evidence artifact",
      "DOT citation",
      "Reviewer credential"
     ],
     "local_variants": [
      "NYC (default)"
     ],
     "national_variants": [
      "Not applicable — single-city launch"
     ]
    }
   ],
   "supporting_page_types": [
    "definition / glossary",
    "how-to workflow",
    "edge-case handling",
    "setup-guide-change explainer",
    "worked example",
    "FAQ",
    "comparison (only when honest)",
    "evidence artifact / template"
   ]
  },
  "site_architecture": {
   "homepage_strategy": "Above-the-fold: one-sentence purpose + primary CTA (free Application Gap Scan). Below: pain cards linking to pillars, one evidence-asset teaser, one authority statement with named hospitality-ops reviewer.",
   "main_nav": [
    "Product",
    "How it works",
    "Pricing",
    "Resources",
    "About",
    "Contact"
   ],
   "footer_nav": [
    "Editorial policy",
    "Contact",
    "Privacy",
    "Terms",
    "Sitemap"
   ],
   "hubs": [
    {
     "name": "Product / service",
     "url": "/product",
     "purpose": "High-intent commercial page"
    },
    {
     "name": "Guides pillar",
     "url": "/guides",
     "purpose": "Topical authority hub"
    },
    {
     "name": "Setup Guide library",
     "url": "/setup-guide",
     "purpose": "Application-type reference"
    },
    {
     "name": "Resources",
     "url": "/resources",
     "purpose": "Linkable assets (Gap Scan, checklists)"
    }
   ],
   "url_patterns": [
    "/product",
    "/guides/[topic]/",
    "/setup-guide/[type]/",
    "/resources/[asset]/",
    "/compare/[a]-vs-[b]/",
    "/glossary/[term]/"
   ],
   "avoid_url_patterns": [
    "/[borough]/[service]/ (buyers search by application type, not borough)",
    "/blog/[year]/[month]/[slug]/ (dated slugs decay CTR)",
    "/tag/[tag]/ (thin archive pages)"
   ]
  },
  "global_national": {
   "national_clusters": [
    "Not applicable — single-city NYC launch; revisit if a second city's program is added"
   ],
   "linkable_assets": [
    "Free Application Gap Scan (email-gated report)",
    "Setup Guide completeness-checklist cheat sheet (downloadable)",
    "CAR response template"
   ],
   "original_research_ideas": [
    "Annual paused-application benchmark across a small operator sample",
    "Completeness index: share of intake documents missing DOT-required fields (anonymized)"
   ],
   "international_needed": false,
   "international_notes": "Not needed. NYC-only at launch; multi-city expansion (Philly/Portland/LA) is a later roadmap decision, not international."
  },
  "local_seo": {
   "justified": true,
   "reason": "The buyer is inherently NYC-local (Dining Out NYC is a single-city program); no separate city pages needed until PatioClear operates in a second city.",
   "gbp_categories_primary": [
    "Business management consultant"
   ],
   "gbp_categories_secondary": [
    "Permit service"
   ],
   "location_page_rules": [
    "No /borough/ subpages at launch — the program is citywide, not borough-differentiated in requirements."
   ],
   "citations": [],
   "review_strategy": "Reviews are not built or requested until real pilot outcomes exist; use direct, permissioned case studies instead once available.",
   "local_schema": []
  },
  "programmatic": {
   "recommended": false,
   "reason": "Programmatic pages almost always become doorway pages. Prefer a small number of deeply-researched, application-type-specific pages.",
   "rules": [
    "Only for genuinely differentiated data (e.g., a true sidewalk-vs-roadway completeness table)",
    "Every page must include a unique data field + unique human-written analysis + human review before publish",
    "noindex until minimum quality threshold met"
   ],
   "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": [
    "Reviewer sign-off before publish",
    "No auto-generated variants without a human pass"
   ]
  },
  "page_templates": [
   {
    "page_type": "Homepage",
    "purpose": "State the offer + route to the free Application Gap Scan.",
    "target_intent": "commercial",
    "url_pattern": "/",
    "h1_pattern": "[One-sentence purpose]",
    "title_pattern": "PatioClear — [One-sentence purpose]",
    "meta_description_pattern": "One sentence outcome + CTA verb. ≤ 155 chars.",
    "above_the_fold": [
     "H1",
     "Sub-headline (audience + outcome)",
     "Primary CTA (Application Gap Scan)",
     "1 trust chip (reviewer / cite)"
    ],
    "outline": [
     "Problem framing",
     "deliverable cards",
     "how-it-works",
     "pricing",
     "proof",
     "FAQ",
     "compliance"
    ],
    "internal_links": [
     "/product",
     "/guides",
     "/pricing"
    ],
    "schema": [
     "WebPage",
     "FAQPage (where genuine)"
    ],
    "conversion_elements": [
     "Application Gap Scan form",
     "Primary CTA button"
    ],
    "trust_elements": [
     "Named hospitality-ops reviewer",
     "Pause-Free Pack Guarantee"
    ],
    "media": [
     "No stock photography; illustrative status chips only"
    ],
    "faq_opportunities": [
     "Do you act as our attorney?",
     "How is pricing structured?"
    ],
    "cta_strategy": "One primary CTA (Application Gap Scan); secondary CTA deep-links to how-it-works.",
    "anti_thin_rules": [
     "Minimum 600 words of unique copy",
     "No auto-generated filler sections"
    ],
    "quality_requirements": [
     "Hospitality-ops reviewer sign-off before publish",
     "Every stat sourced and dated"
    ]
   },
   {
    "page_type": "Pillar guide",
    "purpose": "Own the core topic for search + AI answer engines.",
    "target_intent": "informational",
    "url_pattern": "/guides/[topic]/",
    "h1_pattern": "[Topic], explained for owner-operators",
    "title_pattern": "[Topic] | PatioClear",
    "meta_description_pattern": "Plain-language answer + named reviewer credibility signal.",
    "above_the_fold": [
     "H1",
     "40-60 word extractable definition",
     "Last-reviewed date"
    ],
    "outline": [
     "Definition",
     "Workflow steps",
     "Edge cases",
     "FAQ"
    ],
    "internal_links": [
     "/product",
     "/resources/checklist"
    ],
    "schema": [
     "Article",
     "BreadcrumbList",
     "FAQPage (where genuine)"
    ],
    "conversion_elements": [
     "Inline link to Application Gap Scan"
    ],
    "trust_elements": [
     "Named reviewer",
     "Primary-source citations"
    ],
    "media": [
     "Diagrams of the completeness workflow only"
    ],
    "faq_opportunities": [
     "What does a complete application packet need?"
    ],
    "cta_strategy": "Soft CTA mid-page + stronger CTA at the end.",
    "anti_thin_rules": [
     "Minimum 900 words",
     "At least one worked example"
    ],
    "quality_requirements": [
     "Hospitality-ops reviewer sign-off before publish",
     "Visited-on date for every DOT citation"
    ]
   }
  ],
  "on_page_rules": {
   "title_tag": "Pattern: [Primary keyword] — [Angle] | PatioClear. ≤ 60 chars. Front-load the keyword. No clickbait.",
   "meta_description": "≤ 155 chars. State the specific outcome. Include a verb + a DOT citation when applicable. No stuffing.",
   "headings": "One H1. H2s follow the workflow steps or the searcher's questions. No decorative headings.",
   "intro": "First 100 words: define the topic in the searcher's language, name the specific application type or pause reason, and preview the answer.",
   "internal_links": "3-6 contextual internal links per page, no mid-answer commercial links in FAQ content.",
   "external_citations": "Every requirement or statistic claim links to its primary source with a visited-on date.",
   "images": "Illustrative diagrams only; no stock photography; descriptive alt text on every image.",
   "tables_lists": "Use tables for sidewalk-vs-roadway comparisons; use lists for sequential workflow steps.",
   "freshness": "Setup Guide-dependent pages carry a last-reviewed date and a visible change log.",
   "author_attribution": "Every content page names its author with role and a linked author page.",
   "cta_placement": "One CTA above the fold, one at the natural end of the content; never mid-paragraph.",
   "mobile": "Single-column layout below 640px; tap targets ≥44px; no horizontal scroll.",
   "snippet_targeting": "40-60 word extractable definition directly under the H1 for featured-snippet eligibility.",
   "avoid": [
    "Keyword stuffing",
    "AI-generated filler paragraphs",
    "Duplicate content across application-type variants"
   ]
  },
  "entity_seo": {
   "main_entities": [
    "Dining Out NYC application",
    "Completeness Pack",
    "hospitality-ops reviewer",
    "Gap Matrix",
    "CAR (Correction Action Request)",
    "Setup Guide",
    "SLA alteration"
   ],
   "related_entities": [
    "NYC DOT",
    "revocable consent",
    "roadway café season",
    "FSEP"
   ],
   "people": [
    "Named hospitality-ops reviewer (role-title until owner facts close)"
   ],
   "orgs": [
    "PatioClear",
    "NYC DOT",
    "NYC DOHMH",
    "NYS SLA"
   ],
   "synonyms": [
    "dining out nyc application submission",
    "outdoor dining completeness packet",
    "paused application filing",
    "portal-ready evidence binder"
   ],
   "problems": [
    "Application paused for missing legally required information",
    "CAR received with a 30-day clock",
    "No time to file outdoor dining paperwork"
   ],
   "solutions": [
    "Done-for-you Completeness Pack",
    "CAR Response Pack",
    "Season Desk monitoring"
   ],
   "processes": [
    "Intake",
    "Gap analysis",
    "Completeness check",
    "Hospitality-ops reviewer release",
    "Upload coaching",
    "Portal status follow-up"
   ],
   "tools": [
    "Dining Out NYC portal",
    "DOT Setup Guide",
    "DOT Marketplace"
   ],
   "regulations": [
    "NYC Admin. Code §19-160.1",
    "NYC Admin. Code §19-160.4",
    "NYC Admin. Code §19-160.5",
    "NYC Admin. Code §19-160.6",
    "Title 34 RCNY"
   ],
   "alternatives": [
    "Hospitality/liquor law firm full representation",
    "In-house GM filing",
    "Generic AI chat advice"
   ]
  },
  "schema_strategy": [
   {
    "type": "Organization",
    "where": "Site-wide in head",
    "required_fields": [
     "name",
     "url",
     "logo"
    ],
    "caution": "Keep in sync with visible About/contact; hold until entity facts close."
   },
   {
    "type": "WebPage",
    "where": "Every page",
    "required_fields": [
     "name",
     "description"
    ],
    "caution": "None."
   },
   {
    "type": "FAQPage",
    "where": "FAQ sections with genuine questions",
    "required_fields": [
     "mainEntity"
    ],
    "caution": "Only real, answered questions — never padded."
   }
  ],
  "internal_linking": {
   "pillar_to_cluster": "Pillar links to every direct cluster page in a curated section.",
   "cluster_to_pillar": "Every cluster page links back to its pillar in the intro.",
   "cluster_to_cluster": "Link between sibling clusters only where the reader's next question naturally leads there.",
   "faq_to_commercial": "Answer the question first, then link to the product page in a 'related' block — never inline mid-answer.",
   "anchor_text_rules": [
    "[PLACEHOLDER] owner to complete"
   ],
   "breadcrumbs": "Every guide/setup-guide page carries a breadcrumb trail: Home > Guides > [Pillar] > [Page].",
   "service_to_location": "Not applicable — single-city launch."
  },
  "technical_seo": {
   "crawlability": "Flat depth (≤3 clicks from homepage). No orphan pages.",
   "indexability": "Index all real content. noindex utility pages and thank-you pages.",
   "sitemaps": "XML sitemap generated at build time.",
   "robots": "robots.txt allows all; disallow /admin/. Reference sitemap.",
   "canonicals": "Self-referencing canonical on every page.",
   "core_web_vitals": "LCP ≤2.5s, INP ≤200ms, CLS ≤0.1 on the landing page per DESIGN-STANDARD §7.",
   "mobile": "Mobile-first responsive layout; no horizontal scroll; tap targets ≥44px.",
   "js_seo": "Landing page is server-rendered static HTML; no client-side-only content requiring JS for indexing.",
   "rendering": "Static HTML, no hydration dependency for primary content.",
   "pagination": "Not applicable at launch (no paginated archive content).",
   "faceted_nav": "Not applicable — no faceted product catalog.",
   "duplicate_control": "One URL per application-type/topic; no auto-generated near-duplicate variants.",
   "redirects": "301 redirects only; no redirect chains; audited quarterly.",
   "analytics_setup": "GA4 + server-side event logging for domain.* and ui.* data-events.",
   "gsc_setup": "Google Search Console verified via DNS; sitemap submitted.",
   "rank_tracking": "Weekly rank tracking on the P0 keyword cluster once indexed.",
   "accessibility": "WCAG 2.2 AA. Semantic HTML. Landmarks. Focus states. Alt text."
  },
  "eeat": {
   "author_bios": "Every content page has a named author with role, credentials, and a linked author page.",
   "expert_reviewers": "Every completeness-claim page reviewed by a named hospitality-ops reviewer with disclosed credentials.",
   "editorial_policy": "Public /editorial-policy page: sourcing rules, review cadence, correction policy.",
   "fact_checking": "Every DOT-requirement reference has a link + visited-on date; corrections dated and disclosed.",
   "credentials": [
    "Named hospitality-ops reviewer (role-title until owner facts close)"
   ],
   "citations": "Every completeness-checklist claim cites DOT's own published Setup Guide or Admin Code section.",
   "first_hand_proof": [
    "[PLACEHOLDER] owner to complete"
   ],
   "update_cadence": "Setup Guide-dependent pages reviewed quarterly at minimum; immediate update on any known DOT format change.",
   "monetization_disclosure": "Pricing and guarantee terms disclosed on the same page as any claim about outcomes — no hidden fees.",
   "ymyl_notes": "Not classic YMYL, but treated with equivalent caution because it touches licensing/compliance outcomes; language stays cautious and cites primary sources."
  },
  "ai_search": {
   "principles": [
    "Answer the exact question in the first paragraph",
    "Provide a 40-60 word extractable definition near the top",
    "Cite named primary sources (DOT, DOHMH, Comptroller, Streetsblog)"
   ],
   "tactics": [
    "FAQPage schema for genuine FAQs",
    "Consistent entity naming across the site",
    "Concise summaries at the top of long guides"
   ],
   "do_not": [
    "Write pages targeting AI systems instead of humans",
    "Fabricate statistics or citations"
   ]
  },
  "conversion": {
   "primary_cta": "Get your free Application Gap Scan on your Dining Out NYC portal status.",
   "secondary_cta": "See how a Completeness Pack is built / download the Setup Guide completeness-checklist cheat sheet (email capture).",
   "lead_magnets": [
    "Free Application Gap Scan (human-reviewed report in 24h)",
    "Setup Guide completeness-checklist cheat sheet (PDF)"
   ],
   "trust_elements": [
    "Named hospitality-ops reviewer + credentials",
    "DOT citations with visited-on dates",
    "Pause-Free Pack Guarantee"
   ],
   "per_page_paths": [
    {
     "page_type": "Homepage",
     "path": "Hero CTA → Application Gap Scan form → confirmation"
    },
    {
     "page_type": "Pillar guide",
     "path": "Inline CTA → product page → Application Gap Scan form"
    }
   ],
   "tracking": "domain.diagnostic_requested fires on Application Gap Scan submit; ui.cta_primary fires on any primary CTA click."
  },
  "link_earning": {
   "digital_pr_ideas": [
    "Annual paused-application benchmark report",
    "Completeness index with a shareable result page"
   ],
   "original_research": [
    "Small-operator survey (n≥30) once per year"
   ],
   "directories": [
    "Hospitality trade-association member resource pages",
    "BID resource listings"
   ],
   "avoid": [
    "Paid link schemes",
    "Guest-post link farms",
    "Reciprocal link exchanges with unrelated sites"
   ],
   "expert_contributions": [
    "Named hospitality-ops reviewer contributes to trade press",
    "HARO/Qwoted responses on outdoor-dining permitting topics"
   ],
   "partnerships": [
    "Hospitality-counsel partner directory listings",
    "BID resource-page inclusion"
   ]
  },
  "roadmap_90d": [
   {
    "phase": "Days 0-30: Foundation",
    "goal": "Establish trust + ship product page + first pillar.",
    "pages": [
     "Homepage",
     "Product page",
     "Pillar: dining out nyc application completeness definitive guide",
     "About + reviewer bio (role-titles)",
     "Editorial policy",
     "Contact"
    ],
    "keywords_targeted": [
     "dining out nyc application completeness",
     "why is my dining out nyc application paused"
    ],
    "why_first": "Without a trust surface and a real product page, everything else has nowhere to convert.",
    "business_value": "high",
    "conversion_goal": "Application Gap Scan signups",
    "difficulty": "low-medium",
    "internal_links": [
     "/product",
     "/guides"
    ],
    "required_assets": [
     "Named reviewer bio",
     "Editorial policy"
    ]
   },
   {
    "phase": "Days 31-60: Setup Guide library",
    "goal": "Ship the sidewalk-vs-roadway completeness checklist library.",
    "pages": [
     "Sidewalk completeness checklist",
     "Roadway completeness checklist",
     "CAR response guide"
    ],
    "keywords_targeted": [
     "setup guide completeness checklist comparison"
    ],
    "why_first": "Anchors the topical-authority moat.",
    "business_value": "high",
    "conversion_goal": "Application Gap Scan signups",
    "difficulty": "low-medium",
    "internal_links": [
     "/product",
     "/guides"
    ],
    "required_assets": [
     "Named reviewer bio",
     "Editorial policy"
    ]
   },
   {
    "phase": "Days 61-90: Conversion assets",
    "goal": "Ship the Application Gap Scan landing page and FAQ hub.",
    "pages": [
     "Application Gap Scan",
     "FAQ hub"
    ],
    "keywords_targeted": [
     "free dining out nyc application audit"
    ],
    "why_first": "Converts organic traffic into pilot leads.",
    "business_value": "high",
    "conversion_goal": "Application Gap Scan signups",
    "difficulty": "low-medium",
    "internal_links": [
     "/product",
     "/guides"
    ],
    "required_assets": [
     "Named reviewer bio",
     "Editorial policy"
    ]
   }
  ],
  "roadmap_12m": [
   {
    "phase": "Months 4-6: Linkable assets",
    "goal": "Ship the annual benchmark and the completeness index.",
    "pages": [
     "Annual paused-application benchmark",
     "Completeness index"
    ],
    "keywords_targeted": [
     "dining out nyc completeness benchmark"
    ],
    "why_first": "Linkable assets drive referring domains and topical authority.",
    "business_value": "medium-high",
    "conversion_goal": "Assisted conversion via internal linking",
    "difficulty": "medium",
    "internal_links": [
     "/guides",
     "/product"
    ],
    "required_assets": [
     "Benchmark survey data",
     "Anonymized intake sample"
    ]
   },
   {
    "phase": "Months 7-12: Expansion",
    "goal": "Add multi-location Season Desk content and multi-city expansion guides.",
    "pages": [
     "Multi-location rollout guide",
     "Philly/Portland expansion explainer"
    ],
    "keywords_targeted": [
     "multi-city outdoor dining completeness"
    ],
    "why_first": "Follows the product roadmap's multi-city expansion.",
    "business_value": "medium-high",
    "conversion_goal": "Assisted conversion via internal linking",
    "difficulty": "medium",
    "internal_links": [
     "/guides",
     "/product"
    ],
    "required_assets": [
     "Benchmark survey data",
     "Anonymized intake sample"
    ]
   }
  ],
  "priority_pages": [
   {
    "rank": 1,
    "page_title": "Why is my dining out nyc application paused for missing information",
    "slug": "/guides/application-paused-missing-information/",
    "page_type": "Pillar / evidence guide",
    "primary_keyword": "dining out nyc application paused missing information",
    "secondary_keywords": [
     "dining out nyc pause reasons"
    ],
    "intent": "informational",
    "scope": "citywide",
    "funnel": "MOFU",
    "difficulty": "low",
    "business_value": "high",
    "conversion_potential": "high",
    "cta": "Get my free Application Gap Scan",
    "internal_links": [
     "/product",
     "/guides"
    ],
    "production_priority": "P0",
    "required_proof": [
     "Named hospitality-ops reviewer",
     "Primary-source DOT citation"
    ],
    "schema": [
     "Article",
     "FAQPage"
    ],
    "why_opportunity": "High buyer intent with a weak or DOT-only SERP"
   },
   {
    "rank": 2,
    "page_title": "Done-for-you dining out nyc completeness pack vs hospitality attorney",
    "slug": "/compare/patioclear-vs-hospitality-attorney/",
    "page_type": "Comparison page",
    "primary_keyword": "completeness pack service vs hospitality attorney",
    "secondary_keywords": [
     "dining out nyc legal help alternative"
    ],
    "intent": "commercial",
    "scope": "citywide",
    "funnel": "BOFU",
    "difficulty": "medium",
    "business_value": "high",
    "conversion_potential": "high",
    "cta": "Get my free Application Gap Scan",
    "internal_links": [
     "/product",
     "/guides"
    ],
    "production_priority": "P0",
    "required_proof": [
     "Named hospitality-ops reviewer",
     "Primary-source DOT citation"
    ],
    "schema": [
     "Article",
     "FAQPage"
    ],
    "why_opportunity": "High buyer intent with a weak or vendor-only SERP"
   }
  ],
  "competitor_gaps": {
   "typical_competitor_types": [
    "hospitality/liquor law firms",
    "expeditors/architects",
    "DOT Marketplace fabricators"
   ],
   "common_weaknesses": [
    "No operator-side operational content",
    "No named hospitality-ops reviewer or credentials",
    "No worked examples of a gap matrix",
    "Thin FAQ padded with generic questions"
   ],
   "how_to_beat_them": [
    "Fresh DOT citations with visited-on dates",
    "Named hospitality-ops reviewer + credentials visible",
    "Real, redacted worked gap-matrix examples"
   ]
  },
  "metrics": {
   "weekly": [
    "GSC impressions/clicks by pillar",
    "New indexed pages"
   ],
   "monthly": [
    "Organic sessions by hub",
    "Assisted conversions (Application Gap Scan signups)"
   ],
   "quarterly": [
    "Pillar coverage audit",
    "Setup Guide freshness audit"
   ],
   "annual": [
    "Full topical authority audit",
    "Benchmark report refresh"
   ]
  },
  "risks": [
   {
    "risk": "Thin content",
    "applies": true,
    "mitigation": "Minimum-word + hospitality-ops reviewer sign-off gate before publish."
   },
   {
    "risk": "Duplicate content across application-type variants",
    "applies": true,
    "mitigation": "One URL per application type; no auto-generated variants; canonical to pillar."
   },
   {
    "risk": "Doorway multi-city pages",
    "applies": true,
    "mitigation": "No second-city pages until PatioClear actually operates there."
   }
  ],
  "first_20_pages": [
   "Homepage",
   "Product / service page",
   "About + reviewer bio (role-titles)",
   "Editorial policy",
   "Contact",
   "Privacy",
   "Pillar: dining out nyc application completeness definitive guide",
   "Why is my dining out nyc application paused for missing information",
   "CAR response mechanics explained",
   "Sidewalk vs roadway completeness checklist comparison",
   "FAQ: dining out nyc applications",
   "PatioClear vs hospitality attorney comparison",
   "Sidewalk completeness requirements",
   "Roadway completeness requirements",
   "Pricing page",
   "Free Application Gap Scan landing page",
   "How a Completeness Pack is built",
   "CAR Response Pack explainer",
   "Season Desk explainer"
  ],
  "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 hospitality-ops-reviewer bio(s)",
   "Public editorial policy + correction policy",
   "Cite primary DOT sources with visited-on dates",
   "Launch the completeness-checklist cheat-sheet lead magnet",
   "Pitch hospitality-trade-press responses per week",
   "Publish 1 original data point / benchmark",
   "Reach out to hospitality trade-association resource pages",
   "Guest post on 1 industry association blog",
   "Podcast interview outreach (restaurant-operations shows)",
   "Set up quarterly Setup Guide change-post cadence"
  ],
  "final_recommendation": "Build a DOT-fluent authority site around 'dining out nyc application completeness'. Ship the first 20 pages in 90 days (product + pillar + setup-guide library + Application Gap Scan), then compound with quarterly Setup Guide change-post cadence and one annual benchmark. Refuse doorway pages, refuse mass AI content, treat named-reviewer (role-titled until owner facts close) + primary-source citations as non-negotiable, and never publish approval-outcome claims without the DOT-discretionary caveat.",
  "disclaimers": [
   "All volume/difficulty 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.",
   "This is documentation and completeness-review support, not legal, architectural, or engineering advice, and not a guarantee of DOT, Comptroller, or SLA approval."
  ]
 },
 "microsite": {
  "category": "Foodservice compliance / municipal permitting",
  "shortTitle": "PatioClear",
  "audience": "owner-operators and GMs at independent and small multi-unit (1–5 location) NYC ground-floor FSEP restaurants and bars with a Dining Out NYC application",
  "problem": "Every ground-floor NYC restaurant chasing sidewalk or roadway seats has to assemble a Dining Out NYC application that satisfies DOT's Setup Guide, a site-plan form, insurance certificates, ownership and FSEP documentation, and dated photo evidence — then keep it current through community-board review, a public hearing, and, for alcohol, a separate SLA alteration filing. DOT itself attributes roughly 670 of about 919 in-process applications to missing legally required information. The paperwork falls to whoever on staff has an afternoon free, at restaurants that are already short-staffed and losing curb revenue every week the application sits paused.",
  "offer": "On PatioClear, owner-operators stop re-reading Setup Guide PDFs and start shipping a portal-ready pack. Send your portal status, FSEP record, insurance certificate, lease, and site photos; AI builds a gap matrix against DOT's current rules for your application type, and a trained hospitality-ops reviewer signs off before you get a Completeness Pack — assembled evidence binder plus upload runbook — in 7 business days.",
  "faq": [
   {
    "q": "Is PatioClear a law firm or a permit expediter?",
    "a": "Neither, on purpose. We do not file as your attorney, and we do not stamp drawings. We assemble and complete the documentation your Dining Out NYC application needs, a trained hospitality-ops reviewer signs off on every pack, and we refer contested community-board fights, SLA representation, and DOB/LPC stamps to licensed partners."
   },
   {
    "q": "What exactly is in a Completeness Pack?",
    "a": "A gap matrix mapping every DOT-required artifact to Present, Missing, or Deficient; corrected drafts and a reviewed photo set; a DOT site-plan form filled from measurements you provide; and a step-by-step upload runbook so you or your counsel can clear the pause."
   },
   {
    "q": "Do you submit the application to DOT for us?",
    "a": "No — you stay the applicant of record and upload through your own portal login. We build the pack and, if you want it, run a live upload coaching session, but PatioClear never auto-submits anything on your behalf."
   },
   {
    "q": "How does PatioClear pricing work?",
    "a": "Outcome-based, per location, never hourly. A single-location Completeness Pack is $1,495 (sidewalk), $1,995 (roadway), or $2,495 (both), with rush turnaround available. A CAR Response Pack is $495–$995. Season Desk monitoring is $199–$399 per month per location. We never take a cut of city fees or take payment contingent on DOT approval."
   },
   {
    "q": "How do I get started?",
    "a": "Run the free Application Gap Scan — send a portal screenshot or status email and we return a scored gap memo within 24 hours, no cost. If you're ready to move, we open a Completeness Pack intake the same day."
   },
   {
    "q": "What if DOT sends a Correction Action Request (CAR) after I submit?",
    "a": "A CAR starts a 30-day cure clock. Our CAR Response Pack builds the correction packet against that specific notice, so you're not starting the gap analysis over from scratch."
   },
   {
    "q": "What if my roadway season deadline is close?",
    "a": "Rush turnaround (≤3 business days) is available for $400–$700 on top of the standard pack price. Roadway season runs April 1 through November 29, and the DOT review clock does not pause for a restaurant's calendar, so we prioritize season-cliff intakes."
   },
   {
    "q": "Does PatioClear guarantee my application gets approved?",
    "a": "No, and we say that plainly. DOT approval is a discretionary, multi-agency decision we don't control. We sell completeness — a pack that closes every gap we can identify — not a guaranteed license."
   },
   {
    "q": "How long do you keep our records?",
    "a": "Three years by default, hash-stamped on intake and mirrored to your own storage, with a full export handoff if you stop working with us."
   }
  ],
  "process": [
   {
    "title": "Intake: send your portal status",
    "body": "Forward your Dining Out NYC portal screenshot or status email, FSEP record, insurance certificate, lease, and site photos through the secure intake channel. It's logged and hash-stamped against your case."
   },
   {
    "title": "AI builds the gap matrix",
    "body": "AI reads your application type (sidewalk, roadway, or both) against the current Setup Guide and clearance rules, mapping every required artifact to Present, Missing, or Deficient with a source citation."
   },
   {
    "title": "You send what's missing",
    "body": "You get a plain-language missing-artifact list the same day the gap matrix is built — no waiting until the pack is \"done\" to find out what's still needed."
   },
   {
    "title": "Hospitality-ops reviewer sign-off",
    "body": "A trained reviewer checks the completed pack against the gap matrix and DOT's rules before it ships. Anything touching UPL, a required architecture stamp, or a contested community-board matter is escalated, never guessed at."
   },
   {
    "title": "Deliver pack + upload runbook",
    "body": "You receive the assembled binder and a step-by-step runbook for your own portal upload, plus an optional live coaching session."
   },
   {
    "title": "Watch, follow up, escalate",
    "body": "We check your portal status at day 7. If review hasn't restarted, we open a proactive follow-up; if a CAR arrives, it becomes a CAR Response Pack; if it's a season-cliff case, Season Desk keeps watching after delivery."
   }
  ],
  "northStarCta": {
   "label": "Get my free Gap Scan",
   "href": "#gap-scan",
   "secondary_label": "See how a Completeness Pack is built",
   "secondary_href": "#how-it-works"
  },
  "ubiquitousLanguage": {
   "audience": "owner-operators and GMs at independent and small multi-unit NYC ground-floor restaurants",
   "domain": "NYC Dining Out permit completeness and case-acceptance support",
   "deliverable": "Completeness Pack + hospitality-ops reviewer sign-off (escalation on any legal or architecture question)",
   "reviewer": "trained hospitality-ops reviewer",
   "record": "upload runbook + versioned gap-matrix audit trail",
   "unit_of_work": "pack run",
   "cta_primary": "Get my free Gap Scan",
   "cta_secondary": "See how a Completeness Pack is built",
   "regulator": "NYC Department of Transportation (DOT)",
   "regulator_full": "NYC DOT Dining Out NYC program, with DOHMH FSEP eligibility and NYS SLA for alcohol service",
   "statute": "NYC Admin. Code §§19-160.1, 19-160.4–19-160.6; Title 34 RCNY",
   "trigger_moment": "a Dining Out NYC application paused for missing information, a CAR, or a roadway season deadline",
   "event_intake_started": "nyc_outdoor_dining_permit_completeness_pack_engine_intake_started",
   "event_conversation_requested": "nyc_outdoor_dining_permit_completeness_pack_engine_conversation_requested"
  },
  "trust": {
   "standards": [
    "Every gap-matrix line traces to the current DOT Setup Guide or clearance rule — missing items ship as explicit gaps, never invented data",
    "A trained hospitality-ops reviewer signs every Completeness Pack; anything touching UPL, a required architecture stamp, or a contested hearing is escalated to a licensed partner before it ships",
    "Records are hash-stamped on intake, mirrored to your own storage, with a full export handoff on termination"
   ],
   "response_time": "We reply within one business day — a season-cliff application doesn't wait for a sales callback.",
   "data_handling": "Your restaurant's documents stay in per-location isolated folders and are never used to train models. PatioClear provides documentation and completeness-review support only; it is not a law firm, is not an architecture or engineering firm, and does not guarantee any DOT, Comptroller, or SLA approval."
  },
  "hook": "The next Dining Out application your GM almost let sit paused lands on a scored gap matrix, not a drawer — PatioClear turns Setup Guide rules into a checklist your team can actually close.",
  "sub_headline": "PatioClear maps every required Dining Out NYC artifact — site plan, insurance certificate, FSEP record, photo set — to Present, Missing, or Deficient, then a hospitality-ops reviewer signs the pack before it ships. You get a portal-ready binder and an upload runbook, not another PDF to interpret.",
  "dream_outcome": "You answer the week: every paused location has a scored gap matrix, every CAR gets a cure packet inside its 30-day window, and roadway season opens with your seats already cleared — not stuck behind a missing insurance endorsement nobody caught in March.",
  "specific_pains": [
   "DOT's portal says your application is paused for “missing legally required information” and the notice doesn't say which field — so someone has to re-read the whole Setup Guide to find it.",
   "A certificate of insurance lists the wrong named insured, and nobody catches the mismatch until the reviewer at DOT does, weeks into the six-month review clock.",
   "Roadway season opens April 1, and a restaurant that started its application in February is still assembling a site-plan form in March with no seats cleared for the season.",
   "A general chatbot can produce a plausible-looking site-plan narrative; it can't tell you whether your clearance dimensions actually satisfy the current Setup Guide geometry, and a wrong answer costs a resubmission cycle.",
   "A Correction Action Request arrives with a 30-day cure window, and the restaurant that doesn't have a completeness process spends two of those weeks figuring out what DOT actually wants before starting the fix."
  ],
  "cost_of_inaction": "A paused application isn't a paperwork inconvenience — it's empty curb seats during the roughly eight-month roadway season, on top of the $1,050 license fee, $1,500–$2,500 security deposit, and per-square-foot revocable-consent rent already paid or committed. Attorneys charge $3,000–$6,000 for full representation on work that's mostly document assembly; drawings run $2,000–$10,000 when they're not legally required for most setups. A pack that closes the exact gaps DOT is asking about costs a fraction of either and doesn't wait for a law firm's calendar.",
  "mechanism": {
   "name": "The PatioClear Completeness Desk",
   "steps": [
    {
     "title": "Intake: send your portal status",
     "body": "Forward your Dining Out NYC portal screenshot or status email, FSEP record, insurance certificate, lease, and site photos through the secure intake channel."
    },
    {
     "title": "AI builds the gap matrix",
     "body": "AI reads your application type against the current Setup Guide and clearance rules, mapping every required artifact to Present, Missing, or Deficient with a source citation and a confidence score."
    },
    {
     "title": "Deterministic completeness check",
     "body": "The matrix runs against hard-coded rules — required-artifact presence, date validity, named-insured match, season calendar — not a language model's best guess."
    },
    {
     "title": "Hospitality-ops reviewer sign-off",
     "body": "A trained reviewer checks the pack against the gap matrix before it ships. Any UPL, architecture-stamp, or contested-hearing question routes to a licensed partner instead of getting drafted in-house."
    },
    {
     "title": "Deliver, track, escalate",
     "body": "You get the pack and an upload runbook within 7 business days (3 on rush); we check portal status at day 7 and escalate a CAR or re-pause the moment it appears."
    }
   ]
  },
  "offer_stack": [
   {
    "item": "Completeness Pack per location",
    "note": "gap matrix, assembled evidence binder, corrected drafts, reviewed photo set, DOT site-plan form assist, upload runbook"
   },
   {
    "item": "CAR Response Pack",
    "note": "correction packet built against your specific Correction Action Request, inside its 30-day cure window"
   },
   {
    "item": "Hospitality-ops reviewer sign-off on every pack",
    "note": "trained reviewer attestation on every submission; escalation tags for UPL, architecture-stamp, or contested-hearing risk"
   },
   {
    "item": "SLA alteration document prep",
    "note": "non-legal evidence bundle for your SLA counsel's alteration filing when alcohol service is involved"
   },
   {
    "item": "Season Desk monitoring",
    "note": "renewal calendar, insurance-expiry, and CAR watch per location, with a weekly digest"
   },
   {
    "item": "Free Application Gap Scan",
    "note": "a scored, one-page gap memo before you pay anything, from a portal screenshot or status email"
   }
  ],
  "guarantee": "The Pause-Free Pack Guarantee: if DOT re-pauses your application within 30 days of upload citing an item our Completeness Pack should have caught, we rebuild and redeliver the pack free. If the re-pause traces to something you didn't upload as instructed, the redo is billed at half price. Not guaranteed, ever: DOT, Comptroller, or SLA approval, a specific review timeline, or any outcome dependent on information you or your landlord supply being accurate.",
  "urgency": "Release capacity is gated by the human chokepoint — every pack is signed by a hospitality-ops reviewer — so we cap the pilot cohort at 8 Completeness Packs rather than filling a pipeline we can't review properly before roadway season opens.",
  "objections": [
   {
    "q": "“Can't I just follow DOT's free Setup Guide myself?”",
    "a": "You can, and some operators do — but DOT's own numbers show roughly 670 of 919 in-process applications paused for missing information anyway. The Setup Guide tells you the rules; it doesn't check your specific documents against them."
   },
   {
    "q": "“Isn't this what our Marketplace fabricator already does?”",
    "a": "Marketplace vendors build, store, or rent the physical structure — they don't touch your paperwork, and a shed doesn't unblock a paused application."
   },
   {
    "q": "“Are we going to get an AI-drafted application with no human checking it?”",
    "a": "No line in a Completeness Pack ships without a source citation, and no pack ships without a hospitality-ops reviewer's sign-off. Clinical calls — UPL risk, an architecture stamp, a contested hearing — are escalated to a licensed partner, not guessed at."
   },
   {
    "q": "“Where does our lease and insurance data live?”",
    "a": "In per-location isolated folders with least-privilege access and hash-stamped originals. Your documents are never used to train models, and you get a full export handoff if you stop working with us."
   },
   {
    "q": "“Are you our attorney or our architect?”",
    "a": "No, and that boundary is the design. We don't file as your attorney, negotiate at a community-board hearing, or stamp drawings. We refer those to licensed partners and stay focused on documentation completeness."
   }
  ],
  "who_this_is_not_for": [
   "Restaurants that need full legal representation at a contested community-board hearing — that's a licensed attorney's engagement, and we'll tell you so and refer out.",
   "Buyers looking for a guarantee that DOT will approve their application — we decline that framing; approval is a discretionary, multi-agency decision no vendor controls.",
   "Setups that require a stamped architectural or engineering drawing under DOT rules — we assist with the DOT form but do not practice architecture; a PE or RA handles the stamp."
  ],
  "proof_pillars": [
   {
    "title": "Source-cited gap matrix, every field",
    "body": "Every gap-matrix line traces to the current DOT Setup Guide or clearance rule — missing items ship as explicit gaps, never invented data."
   },
   {
    "title": "Hospitality-ops reviewer released, every time",
    "body": "No pack auto-ships. A trained reviewer signs every Completeness Pack, and UPL, architecture-stamp, or contested-hearing risk is escalated before it reaches you."
   },
   {
    "title": "Tracked to portal status, not to a promise",
    "body": "We check your portal status at day 7 and log every re-pause reason as a rule update — the audit trail is what you'd show DOT, not a sales claim."
   }
  ],
  "stakes_line": "The portal status is the truth. Everything else — the GM's memory, the email thread with the insurance broker, the Setup Guide PDF nobody finished reading — is the story you tell yourself while the season clock runs.",
  "deliverable": "Completeness Pack + hospitality-ops reviewer sign-off (escalation on any legal or architecture question)",
  "unit_of_work": "pack run",
  "lexicon": {
   "regulator": "NYC Department of Transportation (DOT)",
   "regulator_full": "NYC DOT Dining Out NYC program, with DOHMH FSEP eligibility and NYS SLA for alcohol service",
   "statute": "NYC Admin. Code §§19-160.1, 19-160.4–19-160.6; Title 34 RCNY",
   "statute_frame": "the intake-to-upload workflow where a paused application is a self-inflicted seasonal-revenue risk.",
   "persona": "Owner-Operator",
   "persona_moment": "You're the owner-operator. Roadway season opens in six weeks and your Dining Out NYC portal still says ‘paused — missing information.’ Someone needs to know today exactly which artifact is missing and how to fix it — with a source you can point to.",
   "trigger_moment": "a Dining Out NYC application paused for missing information, a CAR, or a roadway season deadline",
   "enforcement_stakes": "lost curb-seat revenue and a stalled six-month review clock, not a courtroom penalty — PatioClear's own exposure is limited to the UPL/architecture-practice boundary it stays inside of",
   "retention": "per restaurant preference, default 3 years",
   "cta_verb": "Get my free Gap Scan",
   "intake_checklist": [
    "Your Dining Out NYC portal screenshot or most recent status email",
    "Current FSEP record and certificate of insurance naming the correct insured",
    "Lease or ownership documentation for the location",
    "Dated site photos covering each Setup Guide required angle",
    "The internal owner name and inbox to copy on status updates and the day-7 follow-up"
   ],
   "regulator_faqs": [
    {
     "q": "Does DOT guarantee a decision timeline?",
     "a": "No — DOT states a complete application typically takes about six months to review, but that is not a contractual deadline. PatioClear's guarantee covers pack completeness and turnaround, never DOT's own review clock."
    },
    {
     "q": "Who actually decides whether the application is approved?",
     "a": "DOT, the community board process, and — for alcohol — the SLA. PatioClear assembles and completes your documentation; the approval decision is theirs alone."
    },
    {
     "q": "What happens if the Setup Guide changes mid-application?",
     "a": "Our Setup Guide rule library is versioned and reviewed within 5 business days of any DOT change; every pack records which rule version it was built against."
    }
   ],
   "trust_standards_specific": [
    "Every gap-matrix line traces to a verbatim citation from the current DOT Setup Guide or Admin Code section — gaps ship explicit, never invented",
    "A trained hospitality-ops reviewer signs every Completeness Pack; any UPL, architecture-stamp, or contested-hearing question is escalated to a licensed partner before it ships",
    "Records — intake originals, drafts, delivered packs — are hash-stamped and retained per your restaurant's preference, keyed to the triggering application",
    "DOT's own Setup Guide requirements are mapped and cited, never guessed at by a general-purpose model"
   ]
  },
  "proof_angle": {
   "id": "gap-matrix-trust",
   "headline": "The next ‘paused for missing information’ notice lands on a scored gap matrix, not a guessing game — PatioClear holds the completeness trail at rest.",
   "lever": "PatioClear stores every gap decision — source citation, completeness check, reviewer signature — in a record you can check without re-reading the Setup Guide.",
   "outcome_verb": "close",
   "outcome_frame": "close every open gap in one 7-business-day pack instead of a multi-week resubmission cycle",
   "proof_promise": "The gap matrix is the client-question answer — reviewer-released, source-cited, and reproducible any day DOT asks."
  },
  "indexable": true
 },
 "evidence": [
  {
   "id": "nyc-outdoor-dining-permit-completeness-pack-engine-e1",
   "business_slug": "nyc-outdoor-dining-permit-completeness-pack-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 pack.",
   "fix_owner": "owner",
   "remediation": "Provide entity name, registration number, and jurisdiction of formation.",
   "severity": "blocker"
  },
  {
   "id": "nyc-outdoor-dining-permit-completeness-pack-engine-e2",
   "business_slug": "nyc-outdoor-dining-permit-completeness-pack-engine",
   "area": "Trust boundary",
   "claim_or_finding": "Public page is a documentation-and-completeness-review service; not a law firm, not an architecture/engineering firm, and does not guarantee DOT, Comptroller, or SLA approval.",
   "status": "verified",
   "evidence": "Microsite and compliance-checklist.md carry an explicit trust-boundary and non-legal, non-architectural disclaimer block.",
   "verification_command": "Inspect /nyc-outdoor-dining-permit-completeness-pack-engine for trust boundary language.",
   "fix_owner": "engineering",
   "remediation": "None — enforced by template.",
   "severity": "low"
  },
  {
   "id": "nyc-outdoor-dining-permit-completeness-pack-engine-e3",
   "business_slug": "nyc-outdoor-dining-permit-completeness-pack-engine",
   "area": "SEO integrity",
   "claim_or_finding": "No fake review, rating, LocalBusiness, or Organization identity schema is emitted; no approval-guarantee claims anywhere in marketing copy.",
   "status": "verified",
   "evidence": "Only WebPage + FAQPage schema is generated; marketing compliance gate applied.",
   "verification_command": "View the landing page source for nyc-outdoor-dining-permit-completeness-pack-engine and grep for schema.org LocalBusiness/Review markup (none present).",
   "fix_owner": "engineering",
   "remediation": "None — enforced by template.",
   "severity": "low"
  },
  {
   "id": "nyc-outdoor-dining-permit-completeness-pack-engine-e4",
   "business_slug": "nyc-outdoor-dining-permit-completeness-pack-engine",
   "area": "Regulated claims",
   "claim_or_finding": "Elevated trust burden — completeness-pack claims gated on owner facts: named hospitality-ops-reviewer identity, licensed-partner (counsel/RA) engagement, entity identity, and confirmation that no UPL/unauthorized-architecture-practice boundary is crossed.",
   "status": "release-blocker",
   "evidence": "Blueprint Rubric Gate 1 (Low Trust Burden) scored 5/5, but licensing-boundary disclosures (§licensing) remain role-titled pending owner facts.",
   "verification_command": "Complete owner-action pack for named reviewer + licensed-partner list.",
   "fix_owner": "owner",
   "remediation": "Provide hospitality-ops-reviewer identity, licensed counsel/RA partner contacts, and entity disclosure facts.",
   "severity": "high"
  },
  {
   "id": "nyc-outdoor-dining-permit-completeness-pack-engine-e5",
   "business_slug": "nyc-outdoor-dining-permit-completeness-pack-engine",
   "area": "Manifest coverage",
   "claim_or_finding": "Manifest-backed blueprint present in source repository (2026-07-13 build, incl. fresh-verified DOT fee-schedule and Streetsblog backlog figures).",
   "status": "assumed",
   "evidence": "manifest.json entry (run_id 2026-07-13-1603) plus this run's builds/manifest.json entry.",
   "verification_command": "Cross-check manifest entry for nyc-outdoor-dining-permit-completeness-pack-engine in the builds repository.",
   "fix_owner": "engineering",
   "remediation": "Attach the manifest run to the evidence register.",
   "severity": "medium"
  },
  {
   "id": "nyc-outdoor-dining-permit-completeness-pack-engine-e6",
   "business_slug": "nyc-outdoor-dining-permit-completeness-pack-engine",
   "area": "Fact verification",
   "claim_or_finding": "Dining Out NYC fee schedule re-verified live 2026-07-13: flat $1,050 license fee, $100–$800 roadway hearing fee, $1,500 (sidewalk) / $2,500 (roadway) security deposit, $5–$31/sf tiered annual revocable-consent fee — refining the blueprint's original combined '$1,050–$2,100' framing.",
   "status": "verified",
   "evidence": "Live fetch of diningoutnyc.info/apply/fees on 2026-07-13; corroborating backlog figures from Streetsblog (2026-05-14, 2026-05-26) and amNY Comptroller-probe coverage.",
   "verification_command": "Fetch https://www.diningoutnyc.info/apply/fees and compare to compliance-checklist.md fee table.",
   "fix_owner": "engineering",
   "remediation": "None — evidence-dossier note recorded in this build's deviations log.",
   "severity": "low"
  }
 ],
 "seo_pages": {
  "id": "seo-restaurant-permit-applications-case-acceptance-desk",
  "business_slug": "restaurant-permit-applications-case-acceptance-desk",
  "route": "/microsites/restaurant-permit-applications-case-acceptance-desk",
  "title": "Restaurant Permit Applications & Case-Accepta… · PatioClear",
  "description": "PatioClear for owner-operators and GMs at restaurants. Submitted, tracked outdoor-dining permits within 24 hours, reconciled to your own AR ledger.",
  "canonical": "/microsites/restaurant-permit-applications-case-acceptance-desk",
  "og_title": "PatioClear — The Restaurant Permit Applications & Case-Acceptance Acceleration Desk",
  "og_description": "PatioClear for owner-operators and GMs at restaurants. Submitted, tracked outdoor-dining permits within 24 hours, reconciled to your own AR ledger.",
  "schema_type": "FAQPage",
  "schema_status": "pending-owner-facts",
  "sitemap_include": false,
  "noindex": true
 },
 "vertical_style": {
  "accent": "awning-terracotta",
  "signature": "Gap-matrix status chips with charcoal-and-terracotta stripe accent",
  "layout": "Completeness desk index",
  "anti": "Stock sidewalk-cafe stock photography and generic 'sunny patio' clip-art"
 },
 "canva": {
  "slug": "nyc-outdoor-dining-permit-completeness-pack-engine",
  "territory": "Completeness Desk",
  "family": {
   "id": "foodservice-municipal-permitting",
   "name": "Foodservice / Municipal Permitting",
   "motion": "brisk"
  },
  "tokens": {
   "brand": "18 55% 32%",
   "brand-fg": "40 40% 98%",
   "surface": "36 28% 97%",
   "ink": "20 25% 14%",
   "muted": "20 10% 42%",
   "accent": "195 45% 28%"
  },
  "type": {
   "display": "Georgia",
   "body": "Segoe UI",
   "fonts_url": ""
  },
  "scale": {
   "h1": "clamp(2.4rem, 5.2vw, 4rem)",
   "h2": "clamp(1.7rem, 3vw, 2.4rem)",
   "h3": "clamp(1.2rem, 2vw, 1.5rem)",
   "body": "clamp(1rem, 1.1vw, 1.125rem)",
   "small": "0.8125rem",
   "tracking_display": "-0.01em",
   "tracking_body": "-0.005em",
   "weight_display": 700,
   "weight_body": 450
  },
  "spacing": {
   "card_padding": "1.5rem",
   "card_radius": "0.6rem",
   "card_shadow": "0 0 0 1px hsl(var(--ink) / 0.08)",
   "section_gap": "clamp(3rem, 7vw, 5.5rem)",
   "hero_gap": "clamp(1.25rem, 2vw, 2rem)"
  },
  "layout": {
   "hero": "split-primary",
   "card": "elevated-soft",
   "cta": "solid-brand",
   "archetype": "operations-desk",
   "card_silhouette": "rounded-outline",
   "button_geometry": "rounded"
  },
  "background": {
   "hero_gradient": "radial-gradient(900px 500px at 85% -10%, hsl(195 45% 28% / 0.13), transparent 60%), radial-gradient(700px 420px at 5% 0%, hsl(18 55% 32% / 0.10), transparent 55%)",
   "cta_gradient": "linear-gradient(135deg, hsl(18 55% 32%), hsl(195 45% 28%))",
   "section_wash": "linear-gradient(180deg, hsl(36 28% 97%) 0%, hsl(18 55% 32% / 0.04) 100%)"
  },
  "motif": "Gap-matrix status chip + striped awning edge"
 },
 "capabilities": {
  "marketing": true,
  "portal": true,
  "ops": true,
  "chatbot": true,
  "payments": false
 },
 "generated_at": "2026-07-13T16:39:00Z",
 "checksum": "076bec212cf5b42a"
}