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

@ -7,6 +7,8 @@ CONTRACT_ID = "helixforge.hub-extension"
CONTRACT_VERSION = "0.1.0"
REPOSITORY_NAVIGATION_CONTRACT_ID = "helixforge.repository-navigation"
REPOSITORY_NAVIGATION_CONTRACT_VERSION = "1.0.0"
WORKLOAD_PROJECTION_CONTRACT_ID = "helixforge.workload-projection"
WORKLOAD_PROJECTION_CONTRACT_VERSION = "1.0.0"
def extension_contract_root() -> Traversable:
@ -21,11 +23,20 @@ def repository_navigation_contract_root() -> Traversable:
return files("hub_core.contracts.repository_navigation.v1_0_0")
def workload_projection_contract_root() -> Traversable:
"""Return the packaged root for the workload-projection contract."""
return files("hub_core.contracts.workload_projection.v1_0_0")
__all__ = [
"CONTRACT_ID",
"CONTRACT_VERSION",
"REPOSITORY_NAVIGATION_CONTRACT_ID",
"REPOSITORY_NAVIGATION_CONTRACT_VERSION",
"WORKLOAD_PROJECTION_CONTRACT_ID",
"WORKLOAD_PROJECTION_CONTRACT_VERSION",
"extension_contract_root",
"repository_navigation_contract_root",
"workload_projection_contract_root",
]

View file

@ -0,0 +1 @@
"""Versioned authoritative workload projection contracts."""

View file

@ -0,0 +1,13 @@
# helixforge.workload-projection 1.0.0
This package freezes hub-core's transport boundary for Repo Manager's
`helixforge.workload-reference/v1` index. It includes strict input/output JSON
schemas, a nine-declaration fixture, the read-only query OpenAPI fragment, and
the compatibility/authority matrix.
The exact identity key is `rapp_id` plus `workload_identity.name`; optional
deployable resolution checks declared membership. Hub-core transports and
queries normalized records with source repository, declaration path, source
Git revision, and canonical UTC observation metadata. It never infers identity
from repository names, owners, paths, or aliases and never imports Repo Manager
private persistence.

View file

@ -0,0 +1 @@
"""Packaged workload projection contract 1.0.0."""

View file

@ -0,0 +1,25 @@
{
"contract_id": "helixforge.workload-projection",
"current_version": "1.0.0",
"accepted_inputs": [
{
"contract_id": "helixforge.workload-projection-source",
"version": "1.0.0",
"source_contract": "helixforge.workload-reference/v1",
"status": "current",
"coercion": false
}
],
"authority": {
"declarations": "rapp-*/declarations/rapp.yaml",
"semantic_schema": "railiance-master/schemas/rapp.schema.json",
"index_and_resolution": "repo-manager",
"transport_and_cross_repository_query": "hub-core"
},
"forbidden_fallbacks": ["repository_name", "owner_repo", "path_segment", "alias"],
"change_policy": {
"patch": "Clarifications and compatible constraint corrections only.",
"minor": "Additive optional transport metadata and diagnostics.",
"major": "Changed identity, authority, resolution, rebuild, cursor, or deletion semantics; removed or renamed fields; or narrowed constraints."
}
}

View file

@ -0,0 +1,139 @@
{
"contract_id": "helixforge.workload-projection-source",
"contract_version": "1.0.0",
"source": {
"system": "repo-manager",
"workload_contract": "helixforge.workload-reference/v1",
"workload_contract_id": "RMGR-CONTRACT-WORKLOAD-REFERENCE-0001",
"producer_revision": "b36b68bc5747aaeea412079c737f9f7e9d4b7dfb"
},
"snapshot": {
"snapshot_id": "9999999999999999999999999999999999999999999999999999999999999999",
"generated_at": "2026-08-22T12:00:00Z",
"source_revision": "b36b68bc5747aaeea412079c737f9f7e9d4b7dfb",
"page_cursor": null,
"next_cursor": null,
"final_page": true,
"total_workload_count": 9
},
"workloads": [
{
"rapp_id": "rapp-issue-core",
"name": "issue-core",
"declaration_repo": "rapp-issue-core",
"declaration_path": "rapp-issue-core/declarations/rapp.yaml",
"source_git_revision": "a78f38cfd8afb29ed23d150a4ea3e3dcd1f35381",
"observed_at": "2026-08-22T12:00:00Z",
"ownership_repo": "issue-core",
"readiness_state": "verified",
"data_classification": "confidential",
"criticality": "high",
"deployables": ["issue-core"]
},
{
"rapp_id": "rapp-openbao",
"name": "openbao",
"declaration_repo": "rapp-openbao",
"declaration_path": "rapp-openbao/declarations/rapp.yaml",
"source_git_revision": "6c3012f6bd12d12c88df03de69b07895e8325347",
"observed_at": "2026-08-22T12:00:00Z",
"ownership_repo": "railiance-platform",
"readiness_state": "verified",
"data_classification": "restricted",
"criticality": "critical",
"deployables": ["openbao", "openbao-ui-gateway"]
},
{
"rapp_id": "rapp-policy-nexus",
"name": "policy-nexus",
"declaration_repo": "rapp-policy-nexus",
"declaration_path": "rapp-policy-nexus/declarations/rapp.yaml",
"source_git_revision": "41c42e8d1a653af666da2e5e7e008a27464d9b87",
"observed_at": "2026-08-22T12:00:00Z",
"ownership_repo": "policy-nexus",
"readiness_state": "verified",
"data_classification": "public",
"criticality": "high",
"deployables": ["policy-nexus-static"]
},
{
"rapp_id": "rapp-postgres",
"name": "postgres",
"declaration_repo": "rapp-postgres",
"declaration_path": "rapp-postgres/declarations/rapp.yaml",
"source_git_revision": "cfc252630c53e87d01eb38b91e1d5b692e72a4b2",
"observed_at": "2026-08-22T12:00:00Z",
"ownership_repo": "railiance-platform",
"readiness_state": "verified",
"data_classification": "restricted",
"criticality": "critical",
"deployables": ["platform-pg"]
},
{
"rapp_id": "rapp-qonto",
"name": "qonto",
"declaration_repo": "rapp-qonto",
"declaration_path": "rapp-qonto/declarations/rapp.yaml",
"source_git_revision": "f57e60ad2a41c18f55dd9ee4ec24a56a4e0d9ff2",
"observed_at": "2026-08-22T12:00:00Z",
"ownership_repo": "qonto-assistant",
"readiness_state": "verified",
"data_classification": "restricted",
"criticality": "critical",
"deployables": ["rapp-qonto"]
},
{
"rapp_id": "rapp-sbom-nexus",
"name": "sbom-nexus",
"declaration_repo": "rapp-sbom-nexus",
"declaration_path": "rapp-sbom-nexus/declarations/rapp.yaml",
"source_git_revision": "1566bcf69fc0757db5efc67f78b14af10d944c1b",
"observed_at": "2026-08-22T12:00:00Z",
"ownership_repo": "sbom-nexus",
"readiness_state": "draft",
"data_classification": "confidential",
"criticality": "high",
"deployables": ["sbom-nexus"]
},
{
"rapp_id": "rapp-secrets-engine",
"name": "secrets-engine",
"declaration_repo": "rapp-secrets-engine",
"declaration_path": "rapp-secrets-engine/declarations/rapp.yaml",
"source_git_revision": "f71131e76b70aad02d32ab46f2d0983f030304a9",
"observed_at": "2026-08-22T12:00:00Z",
"ownership_repo": "secrets-engine",
"readiness_state": "retired",
"data_classification": "restricted",
"criticality": "high",
"deployables": ["secrets-engine-cli"]
},
{
"rapp_id": "rapp-tenant-engine",
"name": "tenant-engine",
"declaration_repo": "rapp-tenant-engine",
"declaration_path": "rapp-tenant-engine/declarations/rapp.yaml",
"source_git_revision": "82bbbf78c4159aa5267af683efca75cce7a57c00",
"observed_at": "2026-08-22T12:00:00Z",
"ownership_repo": "tenant-engine",
"readiness_state": "draft",
"data_classification": "confidential",
"criticality": "high",
"deployables": ["tenant-engine"]
},
{
"rapp_id": "rapp-user-engine",
"name": "user-engine",
"declaration_repo": "rapp-user-engine",
"declaration_path": "rapp-user-engine/declarations/rapp.yaml",
"source_git_revision": "e599b4f345cdd4725a6d0ee16efd475cf98ea616",
"observed_at": "2026-08-22T12:00:00Z",
"ownership_repo": "user-engine",
"readiness_state": "verified",
"data_classification": "confidential",
"criticality": "high",
"deployables": ["user-engine", "user-engine-pg"]
}
],
"diagnostics": []
}

View file

@ -0,0 +1,43 @@
{
"openapi": "3.1.0",
"info": {"title": "HelixForge workload projection", "version": "1.0.0"},
"paths": {
"/ports/projections/workloads": {
"get": {
"operationId": "queryWorkloads",
"x-port-id": "port.projection.query",
"x-direction": "out",
"parameters": [
{"name": "rapp_id", "in": "query", "schema": {"type": "string"}},
{"name": "name", "in": "query", "schema": {"type": "string"}},
{"name": "deployable", "in": "query", "schema": {"type": "string"}},
{"name": "cursor", "in": "query", "schema": {"type": "string"}},
{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 500, "default": 100}}
],
"responses": {
"200": {"description": "Stable page of normalized workload records", "content": {"application/json": {"schema": {"$ref": "../schemas/workload-projection.schema.json"}}}},
"400": {"description": "Invalid explicit filter"},
"409": {"description": "Cursor belongs to another generation or filter"},
"503": {"description": "No accepted workload projection is available"}
}
}
},
"/ports/projections/workloads/resolve": {
"get": {
"operationId": "resolveWorkloadReference",
"x-port-id": "port.projection.query",
"x-direction": "out",
"parameters": [
{"name": "rapp_id", "in": "query", "required": true, "schema": {"type": "string"}},
{"name": "name", "in": "query", "required": true, "schema": {"type": "string"}},
{"name": "deployable", "in": "query", "schema": {"type": "string"}}
],
"responses": {
"200": {"description": "Resolved or explicitly unknown reference", "content": {"application/json": {"schema": {"$ref": "../schemas/workload-resolution.schema.json"}}}},
"400": {"description": "Invalid explicit reference"},
"503": {"description": "No accepted workload projection is available"}
}
}
}
}
}

View file

@ -0,0 +1,82 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.helixforge.local/workload-projection/1.0.0/workload-projection-page.schema.json",
"title": "Repo Manager workload projection page",
"type": "object",
"additionalProperties": false,
"required": ["contract_id", "contract_version", "source", "snapshot", "workloads", "diagnostics"],
"properties": {
"contract_id": {"const": "helixforge.workload-projection-source"},
"contract_version": {"const": "1.0.0"},
"source": {"$ref": "#/$defs/source"},
"snapshot": {"$ref": "#/$defs/snapshot"},
"workloads": {"type": "array", "items": {"$ref": "#/$defs/workload"}},
"diagnostics": {"type": "array", "items": {"$ref": "#/$defs/diagnostic"}}
},
"$defs": {
"source": {
"type": "object",
"additionalProperties": false,
"required": ["system", "workload_contract", "workload_contract_id", "producer_revision"],
"properties": {
"system": {"const": "repo-manager"},
"workload_contract": {"const": "helixforge.workload-reference/v1"},
"workload_contract_id": {"const": "RMGR-CONTRACT-WORKLOAD-REFERENCE-0001"},
"producer_revision": {"type": "string", "pattern": "^[a-f0-9]{40,64}$"}
}
},
"snapshot": {
"type": "object",
"additionalProperties": false,
"required": ["snapshot_id", "generated_at", "source_revision", "page_cursor", "next_cursor", "final_page", "total_workload_count"],
"properties": {
"snapshot_id": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
"generated_at": {"$ref": "#/$defs/utcTimestamp"},
"source_revision": {"type": "string", "pattern": "^[a-f0-9]{40,64}$"},
"page_cursor": {"type": ["string", "null"], "maxLength": 1000},
"next_cursor": {"type": ["string", "null"], "maxLength": 1000},
"final_page": {"type": "boolean"},
"total_workload_count": {"type": "integer", "minimum": 0}
}
},
"workload": {
"type": "object",
"additionalProperties": false,
"required": ["rapp_id", "name", "declaration_repo", "declaration_path", "source_git_revision", "observed_at", "ownership_repo", "readiness_state", "data_classification", "criticality", "deployables"],
"properties": {
"rapp_id": {"type": "string", "pattern": "^rapp-[a-z0-9]+(?:-[a-z0-9]+)*$", "maxLength": 120},
"name": {"type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", "maxLength": 120},
"declaration_repo": {"type": "string", "pattern": "^rapp-[a-z0-9]+(?:-[a-z0-9]+)*$", "maxLength": 120},
"declaration_path": {"type": "string", "pattern": "^rapp-[a-z0-9]+(?:-[a-z0-9]+)*/declarations/rapp\\.yaml$", "maxLength": 260},
"source_git_revision": {"type": "string", "pattern": "^[a-f0-9]{40,64}$"},
"observed_at": {"$ref": "#/$defs/utcTimestamp"},
"ownership_repo": {"type": ["string", "null"], "minLength": 1, "maxLength": 120},
"readiness_state": {"type": ["string", "null"], "minLength": 1, "maxLength": 80},
"data_classification": {"type": ["string", "null"], "minLength": 1, "maxLength": 80},
"criticality": {"type": ["string", "null"], "minLength": 1, "maxLength": 80},
"deployables": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {"type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", "maxLength": 120}
}
}
},
"diagnostic": {
"type": "object",
"additionalProperties": false,
"required": ["severity", "code", "message"],
"properties": {
"severity": {"enum": ["info", "warning", "error"]},
"code": {"type": "string", "pattern": "^[a-z][a-z0-9_.-]*$", "maxLength": 120},
"message": {"type": "string", "minLength": 1, "maxLength": 1000},
"declaration_path": {"type": "string", "maxLength": 260}
}
},
"utcTimestamp": {
"type": "string",
"format": "date-time",
"pattern": "Z$"
}
}
}

View file

@ -0,0 +1,66 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.helixforge.local/workload-projection/1.0.0/workload-projection.schema.json",
"title": "Hub workload projection",
"type": "object",
"additionalProperties": false,
"required": ["contract_id", "contract_version", "projection_id", "projection_status", "source_snapshot", "source_checked_at", "rebuilt_at", "content_hash", "workloads", "diagnostics", "next_cursor", "total_workload_count"],
"properties": {
"contract_id": {"const": "helixforge.workload-projection"},
"contract_version": {"const": "1.0.0"},
"projection_id": {"const": "workloads"},
"projection_status": {"enum": ["current", "stale"]},
"source_snapshot": {"$ref": "#/$defs/sourceSnapshot"},
"source_checked_at": {"$ref": "#/$defs/utcTimestamp"},
"rebuilt_at": {"$ref": "#/$defs/utcTimestamp"},
"content_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
"workloads": {"type": "array", "items": {"$ref": "#/$defs/workload"}},
"diagnostics": {"type": "array", "items": {"$ref": "#/$defs/diagnostic"}},
"next_cursor": {"type": ["string", "null"], "maxLength": 1000},
"total_workload_count": {"type": "integer", "minimum": 0}
},
"$defs": {
"sourceSnapshot": {
"type": "object",
"additionalProperties": false,
"required": ["snapshot_id", "source_system", "source_contract", "source_revision", "generated_at"],
"properties": {
"snapshot_id": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
"source_system": {"const": "repo-manager"},
"source_contract": {"const": "helixforge.workload-reference/v1"},
"source_revision": {"type": "string", "pattern": "^[a-f0-9]{40,64}$"},
"generated_at": {"$ref": "#/$defs/utcTimestamp"}
}
},
"workload": {
"type": "object",
"additionalProperties": false,
"required": ["rapp_id", "name", "declaration_repo", "declaration_path", "source_git_revision", "observed_at", "ownership_repo", "readiness_state", "data_classification", "criticality", "deployables"],
"properties": {
"rapp_id": {"type": "string", "pattern": "^rapp-[a-z0-9]+(?:-[a-z0-9]+)*$", "maxLength": 120},
"name": {"type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", "maxLength": 120},
"declaration_repo": {"type": "string", "pattern": "^rapp-[a-z0-9]+(?:-[a-z0-9]+)*$", "maxLength": 120},
"declaration_path": {"type": "string", "pattern": "^rapp-[a-z0-9]+(?:-[a-z0-9]+)*/declarations/rapp\\.yaml$", "maxLength": 260},
"source_git_revision": {"type": "string", "pattern": "^[a-f0-9]{40,64}$"},
"observed_at": {"$ref": "#/$defs/utcTimestamp"},
"ownership_repo": {"type": ["string", "null"], "minLength": 1, "maxLength": 120},
"readiness_state": {"type": ["string", "null"], "minLength": 1, "maxLength": 80},
"data_classification": {"type": ["string", "null"], "minLength": 1, "maxLength": 80},
"criticality": {"type": ["string", "null"], "minLength": 1, "maxLength": 80},
"deployables": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", "maxLength": 120}}
}
},
"diagnostic": {
"type": "object",
"additionalProperties": false,
"required": ["severity", "code", "message"],
"properties": {
"severity": {"enum": ["info", "warning", "error"]},
"code": {"type": "string", "pattern": "^[a-z][a-z0-9_.-]*$", "maxLength": 120},
"message": {"type": "string", "minLength": 1, "maxLength": 1000},
"declaration_path": {"type": "string", "maxLength": 260}
}
},
"utcTimestamp": {"type": "string", "format": "date-time", "pattern": "Z$"}
}
}

View file

@ -0,0 +1,65 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.helixforge.local/workload-projection/1.0.0/workload-resolution.schema.json",
"title": "Exact workload reference resolution",
"type": "object",
"additionalProperties": false,
"required": ["contract_id", "contract_version", "status", "reference", "source_snapshot", "content_hash", "projection_status"],
"properties": {
"contract_id": {"const": "helixforge.workload-projection"},
"contract_version": {"const": "1.0.0"},
"status": {"enum": ["resolved", "unknown"]},
"reference": {"$ref": "#/$defs/reference"},
"source_snapshot": {"$ref": "#/$defs/sourceSnapshot"},
"content_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
"projection_status": {"enum": ["current", "stale"]},
"reason": {"enum": ["not_found", "deployable_not_declared"]},
"workload": {"$ref": "#/$defs/workload"}
},
"oneOf": [
{"properties": {"status": {"const": "resolved"}}, "required": ["workload"], "not": {"required": ["reason"]}},
{"properties": {"status": {"const": "unknown"}}, "required": ["reason"], "not": {"required": ["workload"]}}
],
"$defs": {
"reference": {
"type": "object",
"additionalProperties": false,
"required": ["rapp_id", "name"],
"properties": {
"rapp_id": {"type": "string", "pattern": "^rapp-[a-z0-9]+(?:-[a-z0-9]+)*$"},
"name": {"type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
"deployable": {"type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"}
}
},
"sourceSnapshot": {
"type": "object",
"additionalProperties": false,
"required": ["snapshot_id", "source_system", "source_contract", "source_revision", "generated_at"],
"properties": {
"snapshot_id": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
"source_system": {"const": "repo-manager"},
"source_contract": {"const": "helixforge.workload-reference/v1"},
"source_revision": {"type": "string", "pattern": "^[a-f0-9]{40,64}$"},
"generated_at": {"type": "string", "format": "date-time", "pattern": "Z$"}
}
},
"workload": {
"type": "object",
"additionalProperties": false,
"required": ["rapp_id", "name", "declaration_repo", "declaration_path", "source_git_revision", "observed_at", "ownership_repo", "readiness_state", "data_classification", "criticality", "deployables"],
"properties": {
"rapp_id": {"type": "string"},
"name": {"type": "string"},
"declaration_repo": {"type": "string"},
"declaration_path": {"type": "string"},
"source_git_revision": {"type": "string", "pattern": "^[a-f0-9]{40,64}$"},
"observed_at": {"type": "string", "format": "date-time", "pattern": "Z$"},
"ownership_repo": {"type": ["string", "null"]},
"readiness_state": {"type": ["string", "null"]},
"data_classification": {"type": ["string", "null"]},
"criticality": {"type": ["string", "null"]},
"deployables": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string"}}
}
}
}
}