2026-08-22 18:39:21 +02:00
|
|
|
from typing import Literal
|
|
|
|
|
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
|
|
|
model_config = SettingsConfigDict(
|
|
|
|
|
env_file=".env",
|
|
|
|
|
env_file_encoding="utf-8",
|
|
|
|
|
extra="ignore",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
database_url: str = "postgresql+asyncpg://custodian:changeme@127.0.0.1:5432/custodian"
|
|
|
|
|
api_base: str = "http://127.0.0.1:8000"
|
2026-08-25 10:36:37 +02:00
|
|
|
# What this instance claims to be. Deliberately defaults to "unknown":
|
|
|
|
|
# an instance that has not declared itself is not the primary, and callers
|
|
|
|
|
# that need the authoritative hub must be able to tell the difference.
|
|
|
|
|
# Answering on a port is not evidence of authority — that assumption cost
|
|
|
|
|
# seven weeks of onboarding (CUST-WP-0067-T03, ADR-010).
|
2026-08-25 12:55:11 +02:00
|
|
|
state_hub_instance_role: Literal["primary", "cache", "unknown"] = "unknown"
|
|
|
|
|
# Env vars are STATE_HUB_INSTANCE_ROLE / STATE_HUB_INSTANCE_LABEL — the
|
|
|
|
|
# field name *is* the binding, so renaming either breaks the deployment
|
|
|
|
|
# silently. Covered by tests/test_instance_identity.py.
|
2026-08-25 10:36:37 +02:00
|
|
|
# Free-form label to name *which* instance answered, e.g. "railiance01".
|
2026-08-25 12:55:11 +02:00
|
|
|
state_hub_instance_label: str | None = None
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
debug: bool = False
|
2026-05-22 13:45:53 +02:00
|
|
|
state_hub_report_dir: str = "reports/recently-on-scope"
|
|
|
|
|
state_hub_markitect_cli_path: str | None = None
|
2026-08-09 16:19:53 +02:00
|
|
|
activity_core_url: str | None = None
|
|
|
|
|
activity_core_worker_token: str | None = None
|
|
|
|
|
ops_run_projection_ttl_seconds: float = 15.0
|
|
|
|
|
ops_run_sla_hours: float = 1.0
|
2026-08-22 18:39:21 +02:00
|
|
|
sbom_nexus_url: str | None = None
|
|
|
|
|
sbom_nexus_read_mode: Literal["legacy", "nexus"] = "legacy"
|
2026-08-22 19:55:08 +02:00
|
|
|
sbom_nexus_write_mode: Literal["legacy", "nexus"] = "legacy"
|
2026-08-22 18:39:21 +02:00
|
|
|
sbom_nexus_timeout_seconds: float = 5.0
|
2026-08-29 03:17:37 +02:00
|
|
|
# Repository renames are central-only, compare-and-set operations. The
|
|
|
|
|
# secret signs short-lived, non-persistent preflight evidence; it must be
|
|
|
|
|
# supplied by the deployment (normally through OpenBao), never recorded in
|
|
|
|
|
# State Hub. With no secret the read-only report remains available but no
|
|
|
|
|
# mutation token can be issued.
|
|
|
|
|
repository_rename_preflight_secret: str | None = None
|
|
|
|
|
repository_rename_preflight_ttl_seconds: int = 900
|
|
|
|
|
repository_rename_forge_timeout_seconds: float = 10.0
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
settings = Settings()
|