feat(silo): DAG extraction engine — extract_dag, classify_type, properties_hash #220

Merged
forbes merged 1 commits from feat/silo-dag-extraction into main 2026-02-14 20:48:11 +00:00
Owner

Implements the DAG extraction engine for FreeCAD documents (issue #214).

New file: mods/silo/freecad/dag.py

Public API

  • classify_type(type_id) — maps ~50 FreeCAD TypeIds to 8 DAG node types (sketch, pad, pocket, fillet, chamfer, body, part, datum)
  • compute_properties_hash(obj) — SHA-256 hex digest of per-feature parametric inputs for memoization
  • extract_dag(doc) — two-pass walk of doc.Objects producing (nodes, edges) matching the Silo PUT /dag payload schema

Design decisions

  • No GUI dependencies — works in both desktop and headless (--console) mode
  • _safe_float() duplicated from silo_commands.py rather than imported (that module imports FreeCADGui)
  • Uses OutList for edge direction (not InList as in contract sample code — follows the contract field definitions where source=depended-upon, target=dependent)
  • Two-pass algorithm — first pass identifies included objects, second pass builds nodes/edges with deduplication
  • Defensive property access — all obj.Property.Value reads wrapped in try/except

Closes #214

Implements the DAG extraction engine for FreeCAD documents (issue #214). New file: `mods/silo/freecad/dag.py` ### Public API - **`classify_type(type_id)`** — maps ~50 FreeCAD TypeIds to 8 DAG node types (`sketch`, `pad`, `pocket`, `fillet`, `chamfer`, `body`, `part`, `datum`) - **`compute_properties_hash(obj)`** — SHA-256 hex digest of per-feature parametric inputs for memoization - **`extract_dag(doc)`** — two-pass walk of `doc.Objects` producing `(nodes, edges)` matching the Silo `PUT /dag` payload schema ### Design decisions - **No GUI dependencies** — works in both desktop and headless (`--console`) mode - **`_safe_float()` duplicated** from `silo_commands.py` rather than imported (that module imports `FreeCADGui`) - **Uses `OutList`** for edge direction (not `InList` as in contract sample code — follows the contract field definitions where source=depended-upon, target=dependent) - **Two-pass algorithm** — first pass identifies included objects, second pass builds nodes/edges with deduplication - **Defensive property access** — all `obj.Property.Value` reads wrapped in try/except Closes #214
forbes added 1 commit 2026-02-14 20:42:16 +00:00
feat(silo): update silo submodule — DAG extraction engine (#214)
Some checks failed
Build and Test / build (pull_request) Has been cancelled
99a53d0ab2
Points silo-mod to feat/silo-dag-extraction branch which adds:
- extract_dag(): two-pass document walk producing nodes + edges
- classify_type(): maps ~50 FreeCAD TypeIds to DAG node types
- compute_properties_hash(): SHA-256 of parametric inputs

Closes #214
forbes merged commit f6d588a7fa into main 2026-02-14 20:48:11 +00:00
forbes deleted branch feat/silo-dag-extraction 2026-02-14 20:48:11 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#220