Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/AI_Brain / services/seeder_api/app.py |
| Date | Not specified in source |
| Repository | Janady13/AI_Brain |
| Revision | cdb497ece2d1a770ca8c83eb1de8923cfaa9eceb |
| Branch | feature/seeder-engine-tests |
| Path or archive member | services/seeder_api/app.py |
| Original SHA-256 | 9ba0b79c845fb3a5b5e334d70c41e6233ec178d662365d7e3159b3f7973d6d45 |
| Git blob SHA | cab95180041108c4663c2cac8bd3a8613e43f28f |
| Reading-copy SHA-256 | 9ba0b79c845fb3a5b5e334d70c41e6233ec178d662365d7e3159b3f7973d6d45 |
Recovered source transcript
Download complete source text ↓44 lines · 1.2 KB
#!/usr/bin/env python3
import os
import time
from fastapi import FastAPI
from pydantic import BaseModel
APP_NAME = os.getenv("APP_NAME", "HiveSeedAPI")
START_TS = time.time()
app = FastAPI(title=APP_NAME)
class Health(BaseModel):
status: str
uptime_seconds: float
class Ready(BaseModel):
ready: bool
reason: str | None = None
@app.get("/healthz", response_model=Health)
def healthz() -> Health:
return Health(status="ok", uptime_seconds=time.time() - START_TS)
@app.get("/readyz", response_model=Ready)
def readyz() -> Ready:
# Minimal readiness: enumerations exist or DRY_RUN enabled
base = os.path.join(os.path.dirname(__file__), "..", "..", "daemon", "enumerations")
files = [
os.path.join(base, "math_model_500.txt"),
os.path.join(base, "agent_500.txt"),
os.path.join(base, "language_500.txt"),
os.path.join(base, "prophecy_500.txt"),
]
if all(os.path.isfile(p) for p in files):
return Ready(ready=True)
if os.getenv("DRY_RUN", "0").lower() in {"1", "true", "yes", "on"}:
return Ready(ready=True, reason="DRY_RUN enabled")
return Ready(ready=False, reason="Enumerations missing; run make enumerations")