Implement fin-hub T24-T26: ingest, runway, coupling, RaaS packaging
Add CSV importers, runway calculator, budget alerts, cross-hub coupling emitters, finhub CLI, and raas-mvp-packaging docs with full test coverage.
This commit is contained in:
parent
b6993d4a05
commit
1abbbe85e4
27 changed files with 835 additions and 3 deletions
37
src/fin_hub/coupling/dev_hub.py
Normal file
37
src/fin_hub/coupling/dev_hub.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
"""fin→dev: resource pressure signals to dev-hub (State Hub progress)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from hub_core.events import ALERT_RAISED
|
||||
|
||||
from fin_hub.coupling.common import default_dev_hub_api_base, post_progress_event
|
||||
from fin_hub.services.alerts import BudgetAlert
|
||||
|
||||
|
||||
def emit_resource_pressure(
|
||||
alerts: list[BudgetAlert],
|
||||
*,
|
||||
api_base: str | None = None,
|
||||
domain_slug: str = "infotech",
|
||||
) -> list[dict[str, Any]]:
|
||||
base = api_base or default_dev_hub_api_base()
|
||||
emitted: list[dict[str, Any]] = []
|
||||
for alert in alerts:
|
||||
if alert.code not in {"budget_pressure", "runway_below_threshold"}:
|
||||
continue
|
||||
result = post_progress_event(
|
||||
api_base=base,
|
||||
event_type=ALERT_RAISED,
|
||||
summary=f"[fin→dev:{domain_slug}] {alert.summary}",
|
||||
detail={
|
||||
"source_hub": "fin-hub",
|
||||
"target_hub": "dev-hub",
|
||||
"signal": "resource_pressure",
|
||||
"alert": alert.as_dict(),
|
||||
},
|
||||
author="fin-hub",
|
||||
)
|
||||
emitted.append(result)
|
||||
return emitted
|
||||
Loading…
Add table
Add a link
Reference in a new issue