Files
step-parse/backend/app/skill_bridge.py
T
Jason Stedwell b3c3e2a3b2 Phase 1: FastAPI backend with async job model
- backend/app: FastAPI API wrapping the CAD skill modules
  - upload -> job -> poll -> model / BOM / artifacts -> geometry query
  - SQLite via SQLModel (Model, Job, BomRow, QueryLog)
  - ThreadPoolExecutor worker, serialized, with live stage updates
- docker-compose.yml: dev server (mounts source, --reload) on :8000
- api-test.sh: end-to-end live validation script
- requirements.txt: add fastapi, uvicorn, python-multipart, sqlmodel
- external_diagram.py: port active-area detection OCC.Core -> OCP
- .gitignore, PHASE1.md

Validated live: MR16 round-trip passes (28 BOM rows, 12 artifacts,
bounding-box query, xlsx download; active-area detection working).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 16:38:26 -05:00

17 lines
570 B
Python

"""Make the CAD skill (skill.src/modules/*) importable.
skill.src uses package-relative imports under a top-level `modules` package, the
same way step_processor.py runs it (script dir on sys.path[0]). We replicate that
by putting SKILL_SRC on sys.path, then `import modules.loader` etc. resolves.
Heavy deps (build123d/OCP) are imported lazily inside the skill functions, so
importing the modules here is cheap; the kernel only loads when a job runs.
"""
import sys
from .config import SKILL_SRC
_p = str(SKILL_SRC)
if _p not in sys.path:
sys.path.insert(0, _p)