feat: transport authoritative workload projections
Some checks failed
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / pytest-smoke (push) Failing after 2s

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a0230c-b06c-7641-808a-e191b6d1da49
This commit is contained in:
tegwick 2026-08-23 10:54:40 +02:00
parent a090903cfc
commit ab936a1e98
27 changed files with 1671 additions and 15 deletions

View file

@ -0,0 +1,55 @@
"""durable authoritative workload projection
Revision ID: 0004_workload_projection
Revises: 0003_repository_navigation
Create Date: 2026-08-23
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
revision: str = "0004_workload_projection"
down_revision: Union[str, None] = "0003_repository_navigation"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
op.create_table(
"runtime_workload_projection_state",
sa.Column("projection_id", sa.String(80), primary_key=True),
sa.Column("projection_status", sa.String(20), nullable=False),
sa.Column("snapshot_id", sa.String(64), nullable=False, unique=True),
sa.Column("source_snapshot", postgresql.JSONB(astext_type=sa.Text()), nullable=False),
sa.Column("source_checked_at", sa.DateTime(timezone=True), nullable=False),
sa.Column("rebuilt_at", sa.DateTime(timezone=True), nullable=False),
sa.Column("content_hash", sa.String(64), nullable=False),
sa.Column("workload_count", sa.Integer(), nullable=False),
sa.Column("diagnostics", postgresql.JSONB(astext_type=sa.Text()), nullable=False),
)
op.create_table(
"runtime_workload_projection_records",
sa.Column("rapp_id", sa.String(120), primary_key=True),
sa.Column("name", sa.String(120), primary_key=True),
sa.Column("declaration_repo", sa.String(120), nullable=False),
sa.Column("declaration_path", sa.String(260), nullable=False),
sa.Column("source_git_revision", sa.String(64), nullable=False),
sa.Column("observed_at", sa.String(40), nullable=False),
sa.Column("ownership_repo", sa.String(120), nullable=True),
sa.Column("readiness_state", sa.String(80), nullable=True),
sa.Column("data_classification", sa.String(80), nullable=True),
sa.Column("criticality", sa.String(80), nullable=True),
sa.Column("deployables", postgresql.JSONB(astext_type=sa.Text()), nullable=False),
)
op.create_index(
"ix_runtime_workload_projection_records_declaration_repo",
"runtime_workload_projection_records",
["declaration_repo"],
)
def downgrade() -> None:
op.drop_table("runtime_workload_projection_records")
op.drop_table("runtime_workload_projection_state")