# Infra2 SSOT manifest
#
# Machine-readable registry for topic ownership and proof anchors. This is the SINGLE source
# for the human SSOT index too: docs/ssot/README.md's topic tables are GENERATED from the
# `summary` fields below (tools/gen_ssot_index.py; test_ssot_index_generated_matches_committed
# locks generated == committed). Edit a topic's index text here, not in README.
#
# `summary` is the short human index line (the README "关键内容" column). `description` is the
# longer machine/contract description. Category/grouping is derived from the key prefix.

version: 1
entries:
  core:
    owner: docs/ssot/core.md
    summary: 架构 + 目录 + 环境 + 变量 + 网络
    description: Repository architecture, layers, environments, variables, and networks.
  core.environments:
    owner: docs/ssot/core.environments.md
    summary: 环境分类、隔离与命名
    description: >-
      Environment DEFINITIONS — taxonomy, isolation, naming, preview-alias model,
      telemetry identity, and the deploy_v2 four-axis coordinate contract (§4.7).
      Deploy TRIGGERS / what-is-live / release model are owned by ops.pipeline.
    proofs:
      - libs/tests/test_deploy_contract.py
      - libs/tests/test_reconcile_iac_inputs.py
  core.harness:
    owner: docs/ssot/core.harness.md
    summary: Workspace harness scope, repository autonomy, and coordination boundary
    description: >-
      Workspace control-plane contract: infra2 and infra2-sdk are the harness focus;
      application repositories remain autonomous checkouts; common GitHub, coordination,
      and software-design guidance is preference-level rather than cross-repository policy.
    proofs:
      - libs/tests/test_harness_manifest.py
  core.truealpha_runtime:
    owner: docs/ssot/core.truealpha_runtime.md
    summary: TrueAlpha Dagster artifact binding, environment isolation, and host-only OpenD boundary
    description: >-
      TrueAlpha data-engine deployment contract: digest-pinned Dagster roles,
      per-environment state and credentials, loopback-only OpenD/Postgres/UI access,
      persistent metadata, resource limits, and runtime-applied verification.
    proofs:
      - libs/tests/test_truealpha_data_engine.py
      - truealpha/truealpha/20.data_engine/compose.yaml
      - truealpha/truealpha/20.data_engine/deploy.py

  bootstrap.nodep:
    owner: docs/ssot/bootstrap.nodep.md
    summary: Bootstrap 组件（Dokploy、1Password、Vault）
    description: Bootstrap components including Dokploy, 1Password, and Vault.
    proofs:
      - libs/tests/test_bootstrap_health.py
  bootstrap.vars_and_secrets:
    owner: docs/ssot/bootstrap.vars_and_secrets.md
    summary: 变量与密钥管理、.env 结构
    description: Variable and secret source-of-truth contract.
    proofs:
      - libs/tests/test_env.py
  bootstrap.dns_and_cert:
    owner: docs/ssot/bootstrap.dns_and_cert.md
    summary: DNS 与证书自动化
    description: DNS and certificate automation.
  bootstrap.iac_runner:
    owner: docs/ssot/bootstrap.iac_runner.md
    summary: IaC Runner GitOps 自动化、Vault-Agent 模式
    description: IaC Runner GitOps automation and Vault-Agent pattern.
    proofs:
      - libs/tests/test_iac_runner_deploy_result.py

  platform.domain:
    owner: docs/ssot/platform.domain.md
    summary: 域名架构、Traefik 路由、Dokploy 配置规范
    description: Domain architecture, Traefik routing, and Dokploy routing rules.
    proofs:
      - libs/tests/test_domain_routing_policy.py
  platform.sso:
    owner: docs/ssot/platform.sso.md
    summary: Authentik SSO
    description: Authentik SSO ownership and integration contract.
  platform.automation:
    owner: docs/ssot/platform.automation.md
    summary: Deployer 自动化
    description: Deployer automation and CLI conventions.
    proofs:
      - libs/tests/test_deployer.py
      - libs/tests/test_dokploy.py
  platform.ai:
    owner: docs/ssot/platform.ai.md
    summary: AI 接入、OpenRouter
    description: AI provider and OpenRouter integration.
  platform.openpanel:
    owner: docs/ssot/platform.openpanel.md
    summary: OpenPanel 产品分析部署
    description: OpenPanel analytics deployment and integration contract.
    proofs:
      - platform/24.openpanel/compose.yaml
      - platform/24.openpanel/deploy.py

  db.overview:
    owner: docs/ssot/db.overview.md
    summary: 数据库总览、Vault 机制
    description: Database overview and Vault integration.
  db.vault:
    owner: docs/ssot/db.vault-integration.md
    summary: Per-App Token、故障排查
    description: Per-app Vault token database integration.
    proofs:
      - libs/tests/test_vault_self_refresh_audit.py
      - libs/tests/test_vault_approle_invariants.py
  db.platform_pg:
    owner: docs/ssot/db.platform_pg.md
    summary: Platform PG (L1)
    description: Platform PostgreSQL.
  db.redis:
    owner: docs/ssot/db.redis.md
    summary: Redis 缓存
    description: Redis cache layer.
  db.clickhouse:
    owner: docs/ssot/db.clickhouse.md
    summary: ClickHouse (SigNoz Storage)
    description: ClickHouse storage for observability and analytics.
  # vault.self_refresh_inventory retired (#542): the audit inventory is DERIVED
  # from each service Deployer's SecretsFacet declarations (libs/service_facets.py
  # -> libs/vault_self_refresh_audit.load_inventory); the former handwritten
  # docs/ssot/vault-self-refresh-inventory.yaml is deleted, its final content
  # frozen as libs/tests/fixtures/vault_self_refresh_inventory_frozen.yaml
  # (equivalence proof: libs/tests/test_vault_inventory_equivalence.py).

  ops.standards:
    owner: docs/ssot/ops.standards.md
    summary: 命名/标签规范、资源评估、防御性运维守则
    description: >-
      Infrastructure naming and labeling conventions, resource-assessment priority,
      and defensive operations standards (including the no-bare-:latest image-pin
      rule enforced by tools/lint_platform_image_pins.py in infra-ci).
    proofs:
      - libs/tests/test_image_pins.py
  ops.pipeline:
    owner: docs/ssot/ops.pipeline.md
    summary: CI/CD 流程、GitOps
    description: >-
      Delivery contract (single owner) — CI/CD, environment TRIGGER model,
      tag-driven reconcile, deploy_v2 front door, the RELEASE model
      (infra2 = independently-released artifact; tag = the live platform version),
      and the T3 config-drift reconcile (§12: prod IAC_CONFIG_HASH vs release tag,
      daily report-only via ops-checks.yml's facet-reconcile job, #542).
    proofs:
      - libs/tests/test_iac_runner_deploy_result.py
      - libs/tests/test_pipeline_stage_contract.py
      - libs/tests/test_reconcile_iac_inputs.py
      - libs/tests/test_dokploy_config_drift.py
  ops.e2e:
    owner: docs/ssot/ops.e2e-regressions.md
    summary: 部署验证、E2E 测试
    description: Deployment verification and E2E regression strategy.
    proofs:
      - e2e_regressions/tests/bootstrap/network_layer/test_network.py
  ops.test_coverage:
    owner: docs/ssot/ops.test_coverage.md
    summary: libs/tools 单测覆盖率 no-regression 门禁
    description: >-
      Line-coverage no-regression gate for libs/tools, committed baseline in
      coverage-baseline.json. Independent of Coveralls, which stays main-only
      and non-blocking (badge/trend reporting only).
    proofs:
      - libs/tests/test_coverage_regression.py
      - libs/tests/test_coverage_regression_audit_cli.py
  ops.recovery:
    owner: docs/ssot/ops.recovery.md
    summary: 故障恢复、Vault Unseal
    description: Recovery, Vault unseal, and incident operations.
    proofs:
      - libs/tests/test_vault_unsealer.py
      - libs/tests/test_backup_verification.py
  ops.storage:
    owner: docs/ssot/ops.storage.md
    summary: 备份策略、R2 同步
    description: Storage and R2 backup policy.
  ops.deploy_dependencies:
    owner: docs/ssot/deploy-dependencies.yaml
    summary: 部署扇出 + content-hash 依赖清单
    description: >-
      Deploy dependency manifest — SSOT for fan-out and content-hash: the extra
      build/config artifacts a service bakes in (shared code, contracts, pinned files).
    proofs:
      - libs/tests/test_deploy_dependencies.py
  ops.delivery_stages:
    owner: docs/ssot/delivery-stages.yaml
    summary: SDK 版本化交付管线 stage 词汇（app+infra CI 共享）
    description: >-
      Compatibility mirror of the versioned infra2-sdk delivery-pipeline stage vocabulary
      shared by App and infra CI gate inventories. The SDK release owns the machine contract;
      the local SSOT mirror records the adopted version and is equality-guarded.
    proofs:
      - libs/tests/test_delivery_stages.py
      - libs/tests/test_ci_gate_schema.py
      - libs/tests/test_sdk_contract_adoption.py
  ops.ci_gate_inventory:
    owner: docs/ssot/ci-gate-inventory.yaml
    summary: infra CI gate 坐标清单（(stage,task_category)→workflow:job）
    description: >-
      Coordinate-ized inventory of infra CI gates, validated fail-closed against the shared
      schema and the actual workflows by tools/ci_gate_audit.py. Gate ids carry the infra_ci.
      prefix so the app and infra inventories cannot overlap.
    proofs:
      - libs/tests/test_ci_gate_audit.py
  ops.obs:
    owner: docs/ssot/ops.observability.md
    summary: 可观测性单一 owner：采集(SigNoz/日志/链路)+ 告警(规则/分级/watchdog)+ 报告(可用率账本)+ 时间尺度分层
    description: >-
      Observability (single owner) — telemetry collection (SigNoz/logs/traces),
      alerting (rules, severity, watchdog routing, on-call), reporting (availability
      ledger / positive proof), and the cadence-tier model (minute/hour/day/month;
      alert vs report). Absorbs the former ops.alerting and ops.availability_ledger.
    proofs:
      - libs/tests/test_alerting.py
      - libs/tests/test_cloudflare_watchdog.py
      - libs/tests/test_out_of_band_watchdog.py
      - libs/tests/test_watchdog_consistency_audit.py
      - libs/tests/test_availability_ledger.py
      - libs/tests/test_observability_dashboards.py
      - libs/tests/test_deploy_queue.py
      - libs/tests/test_deploy_queue_guard.py
  watchdog.signals:
    owner: docs/ssot/watchdog-signals.yaml
    summary: Active watchdog signal inventory and ownership
    description: Active watchdog signal inventory and ownership.
    proofs:
      - libs/tests/test_watchdog_consistency_audit.py
