Skip to content

feat: InfrastructureNode with ports #366

@ggfevans

Description

@ggfevans

Parent Epic

Part of #362 (Connection Graph Model - Port-Based Architecture)


Summary

Implement InfrastructureNode to represent off-rack infrastructure endpoints (ISP handoffs, building power, remote equipment) with the same port model as devices.

Background

Connections often terminate at points outside the rack - ISP handoff, building power feeds, or remote equipment. InfrastructureNode represents these with the same PlacedPort structure as devices, enabling uniform connection handling.

Type Definition

type InfraNodeType = 
  | 'ups'
  | 'breaker-panel'
  | 'wall-outlet'
  | 'floor-pdu'
  | 'patch-panel-wall'
  | 'network-jack'
  | 'isp-demarcation'
  | 'external-switch'
  | 'other';

type InfraScope = 'facility' | 'room' | 'rack-local';

interface InfrastructureNode {
  id: string;
  node_type: InfraNodeType;
  name: string;
  description?: string;
  scope: InfraScope;
  location?: string;              // Freeform: "North wall", "Under desk"
  associated_rack_ids?: string[]; // For rack-local scope
  ports: PlacedPort[];            // Same as device ports!
  
  // Power infrastructure fields
  power_capacity_watts?: number;
  power_capacity_amps?: number;
  voltage?: number;
  circuits?: BreakerCircuit[];
}

interface BreakerCircuit {
  id: string;
  name: string;
  breaker_amps: number;
  is_gfci?: boolean;
}

Acceptance Criteria

  • Create InfrastructureNode interface in src/lib/types/index.ts
  • Create InfrastructureNodeSchema in src/lib/schemas/index.ts
  • Create InfraNodeType and InfraScope enums
  • InfrastructureNode has ports: PlacedPort[]
  • Add infrastructure: InfrastructureNode[] to Layout
  • YAML serialization for infrastructure nodes
  • Connections can reference infrastructure node ports

Test Requirements

  • InfrastructureNode schema validates correctly
  • Ports on infrastructure nodes have valid IDs
  • Connections can reference infrastructure node ports
  • YAML round-trip preserves infrastructure nodes
  • BreakerCircuit schema validates correctly

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions