{
  "schema_version": "bitan_pharmacy_dev_baseline_owner_decision_v1",
  "generated_at": "2026-06-24T14:05:45+08:00",
  "product_id": "bitan-pharmacy",
  "local_path": "/Users/ogt/bitan-pharmacy",
  "gitea_repo": "internal:bitan-pharmacy",
  "remote_refs": {
    "main": "",
    "dev": "",
    "status": "internal_inventory_or_owner_export_required"
  },
  "local_readback": {
    "branch": "main",
    "head": "e122c8cbd9522999fd9844c2b63790fadcc89c20",
    "tracked_modified_count": 64,
    "tracked_deleted_count": 0,
    "untracked_count": 252,
    "diff_shortstat": "64 files changed, 4069 insertions(+), 665 deletions(-)",
    "diff_check": "failed_trailing_whitespace_in_two_files",
    "status": "high_risk_internal_repo_owner_export_required"
  },
  "untracked_classification": {
    "src_app_count": 75,
    "components_count": 19,
    "lib_count": 17,
    "scripts_count": 104,
    "supabase_migration_count": 27,
    "docs_count": 5,
    "public_asset_count": 2,
    "log_evidence_count": 1,
    "root_count": 2
  },
  "tracked_modified_groups": {
    "docs": [
      "docs/12-agent-full-audit-progress.md",
      "docs/TechStack.md",
      "docs/UserFlow.md",
      "docs/data-recovery-guide.md",
      "docs/ops/deploy-checklist.md"
    ],
    "i18n_and_runtime_config": [
      "messages/en.json",
      "messages/zh-TW.json",
      "middleware.ts",
      "next.config.ts",
      "package-lock.json",
      "package.json",
      "public/manifest.json"
    ],
    "ops_scripts": [
      "scripts/check-production-readiness.sh",
      "scripts/fix-production-full.sh",
      "scripts/health-check.sh",
      "scripts/recover-production-stack.sh",
      "scripts/recovery-drill.sh",
      "scripts/verify-production-only.sh",
      "scripts/verify-production-stack.sh"
    ],
    "public_pages_and_api": [
      "src/app/(auth)/login/page.tsx",
      "src/app/[locale]/(auth)/login/page.tsx",
      "src/app/[locale]/(public)/products/[id]/page.tsx",
      "src/app/[locale]/(public)/products/page.tsx",
      "src/app/[locale]/prescription/page.tsx",
      "src/app/admin/layout.tsx",
      "src/app/admin/page.tsx",
      "src/app/api/admin/announcements/[id]/route.ts",
      "src/app/api/admin/announcements/route.ts",
      "src/app/api/admin/articles/[id]/route.ts",
      "src/app/api/admin/articles/route.ts",
      "src/app/api/admin/pages/[slug]/route.ts",
      "src/app/api/admin/products/[id]/route.ts",
      "src/app/api/admin/products/route.ts",
      "src/app/api/admin/services/[slug]/route.ts",
      "src/app/api/admin/services/route.ts",
      "src/app/api/admin/settings/menu/route.ts",
      "src/app/api/admin/translate/route.ts",
      "src/app/api/admin/users/[id]/route.ts",
      "src/app/api/announcements/route.ts",
      "src/app/api/cron/cleanup/route.ts",
      "src/app/api/customer-support/chat/route.ts",
      "src/app/api/products/[id]/route.ts",
      "src/app/api/products/inquiry/route.ts",
      "src/app/api/products/route.ts",
      "src/app/api/services/route.ts",
      "src/app/api/settings/menu/route.ts",
      "src/app/api/settings/pharmacy/route.ts",
      "src/app/api/track/route.ts",
      "src/app/layout.tsx",
      "src/app/sitemap.ts"
    ],
    "components_libraries_and_types": [
      "src/components/admin/settings/menu-settings-manager.tsx",
      "src/components/admin/users/users-manager.tsx",
      "src/components/ai/customer-support-widget.tsx",
      "src/components/business/product/InquiryButton.tsx",
      "src/components/layout/footer.tsx",
      "src/components/layout/header.tsx",
      "src/lib/auth/config.ts",
      "src/lib/auth/permissions.ts",
      "src/lib/notifications/index.ts",
      "src/lib/security/rate-limiter.ts",
      "src/lib/supabase/server.ts",
      "src/types/auth.ts",
      "src/types/product.ts",
      "supabase/migrations/002_storage_buckets.sql"
    ]
  },
  "untracked_source_candidate_groups": {
    "ai_and_ops_docs": [
      "docs/ai/mcp-rag-integration-blueprint.md",
      "docs/ops/ai-support-conversation-governance.md",
      "docs/ops/ai-support-health-check.md",
      "docs/runbooks/AI_OPERATIONS_AUTOMATION.md",
      "docs/runbooks/external-mcp-onboarding.md"
    ],
    "scripts": [
      "scripts/deploy-production-safe.sh",
      "scripts/deploy-production-release.sh",
      "scripts/deploy-production-blue-green.sh",
      "scripts/sync-production-release.sh",
      "scripts/install-*.sh",
      "scripts/run-*.sh",
      "scripts/verify-*.sh",
      "scripts/bitan-blue-green-monitor.js",
      "scripts/bitan-blue-green-proxy.js",
      "scripts/manage-external-mcp-env.sh",
      "scripts/onboard-external-mcp-provider.sh",
      "scripts/probe-external-mcp-endpoint.sh"
    ],
    "admin_and_public_pages": [
      "src/app/admin/ai-information-content-suggestions/page.tsx",
      "src/app/admin/ai-knowledge-sources/page.tsx",
      "src/app/admin/ai-operations-reports/page.tsx",
      "src/app/admin/ai-operations-tasks/page.tsx",
      "src/app/admin/ai-operations-workbench/page.tsx",
      "src/app/admin/ai-support-conversations/page.tsx",
      "src/app/admin/blue-green-events/page.tsx",
      "src/app/admin/data-retention/page.tsx",
      "src/app/admin/privacy-incidents/page.tsx",
      "src/app/admin/privacy-processing-records/page.tsx",
      "src/app/admin/privacy-requests/page.tsx",
      "src/app/admin/product-inquiries/page.tsx",
      "src/app/admin/production-health/page.tsx",
      "src/app/[locale]/(public)/faq/page.tsx",
      "src/app/[locale]/(public)/information/page.tsx",
      "src/app/[locale]/(public)/news/page.tsx",
      "src/app/[locale]/(public)/policies/page.tsx",
      "src/app/[locale]/(public)/privacy/page.tsx"
    ],
    "api_and_cron_routes": [
      "src/app/api/admin/action-approval/route.ts",
      "src/app/api/admin/ai-information-content-suggestions/route.ts",
      "src/app/api/admin/ai-knowledge-sources/route.ts",
      "src/app/api/admin/ai-operations-reports/route.ts",
      "src/app/api/admin/ai-operations-tasks/route.ts",
      "src/app/api/admin/ai-support-conversations/route.ts",
      "src/app/api/admin/ai-support-faq-drafts/route.ts",
      "src/app/api/admin/blue-green-events/route.ts",
      "src/app/api/admin/data-retention/route.ts",
      "src/app/api/admin/privacy-incidents/route.ts",
      "src/app/api/admin/privacy-processing-records/route.ts",
      "src/app/api/admin/privacy-requests/route.ts",
      "src/app/api/admin/product-inquiries/route.ts",
      "src/app/api/admin/production-health/route.ts",
      "src/app/api/cron/ai-information-content-refresh/route.ts",
      "src/app/api/cron/ai-low-risk-maintenance/route.ts",
      "src/app/api/cron/ai-operations-daily-brief/route.ts",
      "src/app/api/cron/ai-operations-reports-retention/route.ts",
      "src/app/api/cron/ai-operations-tasks-refresh/route.ts",
      "src/app/api/cron/ai-operations-weekly-report/route.ts",
      "src/app/api/customer-support/telegram-webhook/route.ts",
      "src/app/api/health/route.ts",
      "src/app/api/internal-mcp/route.ts",
      "src/app/api/privacy/requests/route.ts"
    ],
    "libraries_and_migrations": [
      "src/lib/ai/config.ts",
      "src/lib/ai/customer-support/conversation-governance.ts",
      "src/lib/ai/customer-support/knowledge.ts",
      "src/lib/ai/customer-support/ops-summary.ts",
      "src/lib/ai/governance/source-policy.ts",
      "src/lib/ai/mcp/clients/http-mcp-client.ts",
      "src/lib/ai/mcp/registry.ts",
      "src/lib/ai/operations/report-task-sync.ts",
      "src/lib/ai/provider/gemini.ts",
      "src/lib/ai/rag/site-knowledge-provider.ts",
      "src/lib/api/response.ts",
      "src/lib/auth/admin-action-approval.ts",
      "src/lib/content/public-content-safety.ts",
      "src/lib/privacy/compliance.ts",
      "src/lib/privacy/governance.ts",
      "src/lib/privacy/rights-requests.ts",
      "supabase/migrations/20260523_create_ai_support_conversation_audit.sql",
      "supabase/migrations/20260524_add_ai_operations_reports_task_sync.sql",
      "supabase/migrations/20260524_add_ai_support_conversation_governance.sql",
      "supabase/migrations/20260524_add_privacy_compliance_consent_fields.sql"
    ]
  },
  "excluded_or_quarantined_by_default": [
    ".npmrc",
    "logs/public-content-cleanliness.latest.json"
  ],
  "secret_or_env_paths_seen_but_not_read": [
    ".env.example",
    ".env.local"
  ],
  "risk_assessment": {
    "secret_value_collected": false,
    "env_file_read": false,
    "runtime_write_performed": false,
    "product_repo_write_performed": false,
    "remote_write_performed": false,
    "risk_level": "high_internal_inventory_and_public_content_evidence_required",
    "reason": "Bitan is an internal repo with no current Gitea refs readback in this package, 64 tracked changes, 252 untracked candidates, public-content cleanliness evidence, production scripts, Supabase migrations, AI support, privacy, MCP, blue-green, and cron surfaces."
  },
  "owner_decision_required": [
    "Provide authenticated Gitea inventory or owner export before any remote dev branch action.",
    "Approve or reject 64 tracked modified files by group.",
    "Approve or reject 252 untracked candidates by source group.",
    "Keep .npmrc quarantined until owner confirms it contains no credential material or provides a sanitized replacement.",
    "Keep logs/public-content-cleanliness.latest.json as evidence metadata unless owner explicitly marks it as source-controlled evidence artifact.",
    "Confirm .env.example and .env.local remain excluded from content reads and secret collection.",
    "Resolve public content cleanliness alert evidence before declaring Bitan production source current.",
    "Fix or explicitly defer trailing whitespace in scripts/verify-production-stack.sh and src/app/api/customer-support/chat/route.ts.",
    "Approve remote dev branch only after internal inventory, source include / exclude, evidence policy, and public-content cleanliness decision are accepted."
  ],
  "recommended_next_step": "Request owner export / authenticated inventory and create a source-only include-exclude response before any Bitan Gitea dev branch or MacBook workspace bootstrap."
}
