STATE-WP-0070: identity headers, archive 0069, phase-2 workplan
Some checks failed
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Has been cancelled

Add X-StateHub-Component to fix-consistency and other State Hub REST callers for
legacy-meter attribution. Archive STATE-WP-0069; open STATE-WP-0070 for
meter-gated phase-2 retirement. Task POST bodies use workplan_id only.
This commit is contained in:
tegwick 2026-07-09 00:39:09 +02:00
parent 2f06751d4f
commit bb6bec9f10
10 changed files with 198 additions and 17 deletions

View file

@ -301,13 +301,22 @@ def check_files(workplans_dir: Path, report: Report) -> list[dict]:
# State-hub API checks
# ---------------------------------------------------------------------------
def _legacy_meter_headers() -> dict[str, str]:
return {"X-StateHub-Component": "state-hub.validate-repo-adr"}
def _api_get(api_base: str, path: str, params: dict | None = None) -> Any:
if not _HAS_HTTPX:
return None
if not path.endswith("/"):
path += "/"
try:
with _httpx.Client(base_url=api_base, timeout=10.0, follow_redirects=True) as c:
with _httpx.Client(
base_url=api_base,
timeout=10.0,
follow_redirects=True,
headers=_legacy_meter_headers(),
) as c:
r = c.get(path, params={k: v for k, v in (params or {}).items() if v is not None})
r.raise_for_status()
return r.json()