Files
state-hub/scripts/seed_wp0012_suggestions.py
tegwick f2e042a278 Finish CUST-WP-0011 and implement STATE-WP-0061 suggestion backlog.
Add persisted Suggestion entities with WSJF ranking, relevance bumps,
REST/MCP write surfaces, /suggestions dashboard page, and daily triage
digest integration. Document the cluster operating model, archive the
completed migration workplan, and seed WARDEN-WP-0012 routing scenarios.
2026-07-06 10:52:49 +02:00

55 lines
2.0 KiB
Python

#!/usr/bin/env python3
"""Backfill WARDEN-WP-0012 gated routing scenarios as demand-weighted suggestions."""
from __future__ import annotations
import os
import sys
import httpx
API_BASE = os.getenv("STATE_HUB_URL", "http://127.0.0.1:8000")
SCENARIOS = [
("issue-core-ingestion-api-key", "Issue-core ingestion API key OpenBao path"),
("activity-core-issue-sink", "Activity-core issue sink consumer key custody"),
("openrouter-llm-connect", "OpenRouter llm-connect OpenBao → K8s Secret path"),
("object-storage-sts", "Object storage STS vending path (NK-WP-0007)"),
("human-oidc-login", "Human OIDC login via key-cape / Keycloak"),
("flex-auth-resource-check", "flex-auth policy decision before sensitive action"),
("host-principal-deploy", "auth_principals sync for host principal deploy"),
]
def main() -> int:
created = 0
with httpx.Client(base_url=API_BASE, timeout=30.0) as client:
health = client.get("/state/health")
health.raise_for_status()
existing = {
item.get("origin_ref")
for item in client.get("/suggestions/", params={"include_terminal": True}).json()
}
for origin_ref, title in SCENARIOS:
if origin_ref in existing:
continue
resp = client.post("/suggestions/", json={
"domain": os.getenv("SUGGESTION_DOMAIN", "infotech"),
"title": title,
"description": (
"Gated routing scenario from WARDEN-WP-0012. Owner path not yet "
"shipped; accrues relevance when agents hit this unmet need."
),
"origin": "WARDEN-WP-0012",
"origin_ref": origin_ref,
"base_value": 4.0,
"job_size": 3.0,
})
resp.raise_for_status()
created += 1
print(f"created {origin_ref}")
print(f"done: {created} new suggestions")
return 0
if __name__ == "__main__":
sys.exit(main())