Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / function

system_status

modules.code.router.system_status

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Calls (4)
SymbolFileResolved by
get_embedderembeddings.pythrough an import
get_notifiernotify.pythrough an import
grammar_statustreesitter_parser.pyunique name
token_problemsauth.pythrough an import
Inside (1)
SymbolFileResolved by
routerrouter.pysame file
modules.code.router.system_statusbackend/app/modules/code/router.py, lines 293–327Open source
@router.get("/system/status")def system_status(db: Session = Depends(get_sync_db)):    """Which backends are configured and working. Contains no secrets."""    settings = get_settings()    try:        db.execute(text("SELECT 1"))        database = {"status": "ok", "dialect": db.get_bind().dialect.name}    except Exception as exc:        database = {"status": "error", "error": type(exc).__name__}    try:        embedder = get_embedder(settings)        embedding = embedder.describe() if embedder else {"backend": "none"}    except Exception as exc:        embedding = {"backend": settings.EMBEDDING_BACKEND, "error": str(exc)}    counts = {        "repositories": db.execute(select(func.count(Repository.id))).scalar_one(),        "chunks": db.execute(select(func.count(DocumentChunk.id)).where(DocumentChunk.repository_id.isnot(None))).scalar_one(),        "jobs_queued": db.execute(select(func.count(IngestionJob.id)).where(IngestionJob.status == "queued")).scalar_one(),        "jobs_running": db.execute(select(func.count(IngestionJob.id)).where(IngestionJob.status == "running")).scalar_one(),        "memory_items_active": db.execute(            select(func.count(MemoryItem.id)).where(MemoryItem.status == "active")).scalar_one(),        "memory_items_proposed": db.execute(            select(func.count(MemoryItem.id)).where(MemoryItem.status == "proposed")).scalar_one(),        "learning_jobs_queued": db.execute(            select(func.count(LearningJob.id)).where(LearningJob.status == "queued")).scalar_one(),    }    return {        "mode": settings.MODE,        "database": database,        "embedding": embedding,        "notifier": get_notifier(settings).name,        "grammars": grammar_status(),        "index": counts,        "config_warnings": token_problems(),    }

What the index recorded

Signature
def system_status(db: Session):
File
backend/app/modules/code/router.py
Lines
293–327
Parser
python-ast
Git blob
d914024790aaafe7234adda557677b76e4ad73d5
Call sites
17 named, 7 resolved, 10 left unlinked
Outside this subset
3 more edges reach code outside the graph shown here

Read it on GitHub at this commit