-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Labels
area:devicesfeaturefeature/networkNetwork interface and connection featuresNetwork interface and connection featurespriority:highreadysize:medium
Milestone
Description
Parent Epic
Part of #362 (Connection Graph Model - Port-Based Architecture)
Supersedes: #261 (Cable data model) / PR #355
Summary
Implement a minimal Connection model using port IDs. Start simple, add complexity when needed.
Background
The original Cable model (#261) used string references like a_device_id + a_interface. This is fragile. The new model references PlacedPort.id directly.
MVP Type Definition
interface Connection {
id: string; // UUID
a_port_id: string; // PlacedPort.id
b_port_id: string; // PlacedPort.id
label?: string; // Optional user label
color?: string; // Hex color for visualization
}That's it. No connection_class, no status, no role, no redundancy_group, no CableProperties nesting. Add those when users actually need them.
Acceptance Criteria
- Create
Connectioninterface insrc/lib/types/index.ts - Create
ConnectionSchemainsrc/lib/schemas/index.ts - Add
connections: Connection[]to Layout (default: []) - YAML serialization for connections
- Basic validation (a_port_id ≠ b_port_id)
Test Requirements
- Connection schema validates correctly
- Self-connection rejected (a_port_id === b_port_id)
- YAML round-trip preserves connections
- Empty label/color handled correctly
Design Decisions
- No connection class/type: Users can use label + color to distinguish network vs power vs console
- No status field: Everything is "connected" - if it's in the data, it exists
- No nested CableProperties: Color and label are flat fields
- No role/redundancy_group: YAGNI - add when users request
Future Enhancements (NOT in MVP)
These can be added later if users need them:
- Connection classes (network, power, console)
- Connection status (planned, decommissioning)
- Cable properties (type, length, length_unit)
- Redundancy groups
- Bidirectional relationship tracking
Related
- Parent Epic: feat: Connection Graph Model - Phase 1: Port-Based Architecture #362
- Depends on: feat: PlacedPort schema and port instantiation #363 (PlacedPort) ✅ Merged in PR feat: add PlacedPort schema and port instantiation (#363) #389
- Enables: spike: cable path rendering algorithm #262 (Cable visualization)
Metadata
Metadata
Assignees
Labels
area:devicesfeaturefeature/networkNetwork interface and connection featuresNetwork interface and connection featurespriority:highreadysize:medium