feat(api): .kc item dependencies + resolve API (Phase 3) #143
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implement CAD-extracted dependency indexing and resolution endpoints as specified in KC_SERVER.md Sections 3.2 and 4.2.
Depends on: #141 (Phase 1 -- commit extraction populates item_dependencies)
Supports: SILO_VIEWPORT Phase 5 (Dependency Table widget)
Commit-time Extraction
Extend the Phase 1 extraction pipeline to also parse
silo/dependencies.jsonand upsert rows intoitem_dependencies. Each commit replaces all dependency rows for that revision.API Endpoints (Section 4.2)
GET/api/items/{pn}/dependenciesGET/api/items/{pn}/dependencies/resolveThe
/resolveendpoint joins item_dependencies against items to map child_uuid -> part_number, checks file existence on disk, and returns aresolved: bool+file_available: boolfor each link. This is the data source for the Dependency Table widget's status column.Relationship to existing BOM
The
item_dependenciestable is the CAD-authoritative record. The existingrelationshipstable is the server-authoritative BOM (editable via web UI/API). BOM merge (per BOM_MERGE.md) reconciles the two. This issue does NOT implement BOM merge -- just the indexing and query endpoints.Implementation scope
internal/kc/extract.goto parse dependencies.jsoninternal/db/item_dependencies.go-- repository (replace-on-commit, list, resolve with JOIN)internal/api/dependency_handlers.go-- HTTP handlersAcceptance criteria