Spaces:
Build error
Build error
Commit History
-
fix: chdir into app-data dir at desktop startup, fixing 30+ writes at once (P-1)
Root cause: grepped every bare (non-__file__-anchored) CWD-relative path in the codebase. Found DATA_RAW_PATH/DATA_PROCESSED_PATH/ DATA_SAMPLES_PATH in config/settings.py were dead code exactly like LOGS_PATH was before its own fix -- zero real consumers reference them. Instead, 30+ real call sites hardcode their own copy of the same path directly: all 19 scrapers' data/samples/*.json sample- fallback output, processing/pipeline.py (data/processed + data/samples), ai/multi_investigator.py, ai/risk_scorer.py, ai/self_learning/schema_learner.py, processing/alias_graph.py, and graph/loader.py's own glob() read of pipeline output. Trigger condition: on a real Windows install, a double-clicked app's CWD is unpredictable, and the install directory itself is typically read-only for a non-admin user. Every one of these 30+ writes would fail outright under that condition -- not just lose regeneratable cache data, but error out entirely (scrapers couldn't run at all). Why this fix looks differ…45cee30
-
feat(D2): PyInstaller entry point and spec for the desktop backend
Freezes the FastAPI app into a standalone executable. A separate entry point (packaging/desktop_entry.py) was necessary, not optional -- the Docker deployment starts via 'uvicorn app:app', a CLI string-import that has no module/file to resolve against once frozen into a single binary. This entry point imports the app object directly and calls uvicorn.run() programmatically instead, sets BHARATGRAPH_DESKTOP_MODE before any other import (so Phase D1's admin-auth hardening and local config-file loading both apply), and binds to 127.0.0.1 only. Verified for real, not just written: installed PyInstaller, ran an actual build against this codebase, and ran the resulting binary -- /health, /runtime, /docs, and /forensics/ghost-companies all responded correctly over real HTTP; /runtime specifically confirmed the D1/F-10 scraper_workers value is correctly bundled and functional. Cold start is ~4s. The 503s on Neo4j-dependent routes are the correct behavior with no database connected, not failur…cd7f5fc