Skip to content

Local Backend

The local backend entrypoint is scripts/serve_client_portal.py. It serves report APIs, protected internal APIs, module copilot APIs, ITR workbench APIs, and agent workbench APIs from one development process.

Start Command

python scripts\serve_client_portal.py --port 8787 --start-worker

The startup log advertises the main route families, including report, export, optimization, queue, contract intelligence, ITR, module copilot, and agent endpoints.

Expected Runtime Shape

Runtime area Local behavior
Report APIs Use configured SQL/runtime sources, with deterministic fallback only where the backend explicitly marks it.
Queue worker Can run in-process with --start-worker for development.
AI provider Uses Azure OpenAI when configured; otherwise deterministic fallback remains visible.
Agent SDK Missing SDK blocks task execution explicitly instead of faking success.
Protected routes Local proxy secret/auth checks can be relaxed for development where configured, but production routes remain protected.

Done Criteria For Backend Work

  • The route returns a truthful status when dependencies are absent.
  • Evidence and lineage fields explain blocked states.
  • Browser-safe payloads do not include secrets, raw download URLs, or local filesystem paths.
  • The relevant smoke or pytest command passes.