Files
the-other-dude/.planning/phases/13-link-discovery-registration-ingestion/13-01-SUMMARY.md
Jason Staack f0e7c5c00e docs(13-01): complete interface info collector plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 06:07:51 -05:00

4.8 KiB

phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, requirements-completed, duration, completed
phase plan subsystem tags requires provides affects tech-stack key-files key-decisions patterns-established requirements-completed duration completed
13-link-discovery-registration-ingestion 01 poller
routeros
nats
interfaces
mac-address
link-discovery
go
phase provides
12-wireless-registration-collection NATS publisher pattern, WIRELESS_REGISTRATIONS stream, withTimeout wrapper
InterfaceInfo struct with name, MAC, type, running fields
CollectInterfaceInfo function for RouterOS /interface/print
DeviceInterfaceEvent NATS publisher on device.interfaces.{device_id}
DEVICE_EVENTS stream includes device.interfaces.> subject
13-link-discovery-registration-ingestion
link-state-machine
topology-map
added patterns
interface-identity-collector
mac-normalization
created modified
poller/internal/device/interfaces.go
poller/internal/device/interfaces_test.go
poller/internal/bus/publisher.go
poller/internal/poller/worker.go
MAC addresses lowercased at collection time for consistent downstream matching
Entries without mac-address skipped (loopback, bridge without MAC)
Interface info collected separately from traffic counters (InterfaceInfo vs InterfaceStats)
MAC normalization: all MAC addresses lowercased at the collection layer before publishing
InterfaceInfo vs InterfaceStats: identity data (link discovery) separate from traffic counters (metrics)
LINK-01
5min 2026-03-19

Phase 13 Plan 01: Interface Info Collector Summary

Go poller InterfaceInfo collector publishing MAC addresses to DEVICE_EVENTS NATS stream for link discovery

Performance

  • Duration: 5 min
  • Started: 2026-03-19T11:00:38Z
  • Completed: 2026-03-19T11:06:20Z
  • Tasks: 2
  • Files modified: 4

Accomplishments

  • InterfaceInfo struct and CollectInterfaceInfo function collect name, MAC, type, running from /interface/print
  • MAC addresses lowercased at collection time for consistent downstream link resolution
  • DeviceInterfaceEvent publisher sends to device.interfaces.{device_id} on DEVICE_EVENTS stream
  • Wired into PollDevice cycle after traffic counters, before health metrics

Task Commits

Each task was committed atomically:

  1. Task 1: Create interface info collector with v6/v7 routing - 4b5bb94 (test) + 6939584 (feat)
  2. Task 2: Add DeviceInterfaceEvent publisher, update DEVICE_EVENTS stream, wire into PollDevice - 397a33a (feat)

Note: Task 1 used TDD with separate test and implementation commits

Files Created/Modified

  • poller/internal/device/interfaces.go - InterfaceInfo struct, CollectInterfaceInfo function, MAC normalization (added alongside existing InterfaceStats)
  • poller/internal/device/interfaces_test.go - Unit tests for struct fields, MAC lowercasing, running bool parsing
  • poller/internal/bus/publisher.go - DeviceInterfaceEvent type, PublishDeviceInterfaces method, device.interfaces.> added to DEVICE_EVENTS stream
  • poller/internal/poller/worker.go - Interface info collection wired into PollDevice after traffic counters

Decisions Made

  • MAC addresses lowercased at collection time (strings.ToLower) so downstream consumers never need to normalize
  • Entries without mac-address are silently skipped (loopback, bridge without MAC are not useful for link discovery)
  • InterfaceInfo is a separate type from InterfaceStats -- identity data for link discovery vs traffic counters for metrics
  • Collection placed after traffic counters, before health metrics in PollDevice to group interface-related work

Deviations from Plan

Auto-fixed Issues

1. [Rule 3 - Blocking] Restored InterfaceStats collector overwritten during file creation

  • Found during: Task 1
  • Issue: Creating interfaces.go overwrote the pre-existing InterfaceStats type and CollectInterfaces function that publisher.go and worker.go depend on
  • Fix: Restored InterfaceStats and CollectInterfaces, appended new InterfaceInfo types below
  • Files modified: poller/internal/device/interfaces.go
  • Verification: go build ./... succeeds
  • Committed in: 6939584 (Task 1 commit)

Total deviations: 1 auto-fixed (1 blocking) Impact on plan: File creation overwrote existing code; restored immediately. No scope creep.

Issues Encountered

None beyond the deviation noted above.

User Setup Required

None - no external service configuration required.

Next Phase Readiness

  • Interface MAC data now published to NATS on every poll cycle
  • Backend subscriber (Plan 03) can consume device.interfaces.> to populate device_interfaces table
  • Link discovery (Plan 02) can match registration MACs against interface MACs for topology resolution

Self-Check: PASSED

All 4 files verified present. All 3 commits verified in git log.


Phase: 13-link-discovery-registration-ingestion Completed: 2026-03-19