refactor: decompose seven more WS-D god-files by role (database, alerts, registry, netif, iperf installer)#1710
Merged
Conversation
added 7 commits
June 17, 2026 09:23
…ity (WS-D) Split internal/database/repository_topology.go (720 LOC) into role-based files in the same package (repository_topology_*.go convention) — pure move: node operations stay in repository_topology.go; link/target ops and interface ops move to their own files. All files under the 600-line size-gate threshold. Declaration sets and code-line multisets verified identical to the original. Related to #187
Split internal/database/database.go (684 LOC) into role-based files in the same package — pure move: DB type, config, open/corruption-recovery, and connection lifecycle stay in database.go; the per-repository accessor methods move to repositories.go. All files under the 600-line size-gate threshold. Declaration sets and code-line multisets verified identical to the original. Related to #187
…le (WS-D) Split internal/alerts/pipeline/observation_pipeline.go (669 LOC) into role-based files in the same package — pure move: pipeline lifecycle stays in observation_pipeline.go; history priming moves to observation_prime.go; per-kind scan/evaluation moves to observation_eval.go. All files under the 600-line size-gate threshold. Declaration sets and code-line multisets verified identical to the original. Related to #187
…(WS-D) Split internal/alerts/pipeline/listener_pipeline.go (654 LOC) into role-based files in the same package — pure move: pipeline lifecycle stays in listener_pipeline.go; rule loading/snapshotting moves to listener_rules.go; event evaluation moves to listener_eval.go. All files under the 600-line size-gate threshold. Declaration sets and code-line multisets verified identical to the original. Related to #187
…WS-D) Split internal/discovery/registry.go (616 LOC) into role-based files in the same package — pure move: registry type, lifecycle, add/update, and query accessors stay in registry.go; the granular field-merge helpers move out. All files under the 600-line size-gate threshold. Declaration sets and code-line multisets verified identical to the original. Related to #187
Split internal/netif/interfaces.go (604 LOC) into role-based files in the same package — pure move: interface inventory/management stays in interfaces.go; auto-detection, candidate selection, and link-status probing move out. Both files under the 600-line size-gate threshold. Declaration sets and code-line multisets verified identical to the original. Related to #187
Split internal/diagnostics/iperf/installer.go (698 LOC) into role-based files in the same package — pure move: package-manager detection and build-dependency reporting stay in installer.go; install/build execution (package-manager, GitHub source, download) moves out. All files under the 600-line size-gate threshold. Declaration sets and code-line multisets verified identical to the original. Related to #187
📋 License Compliance Report✅ All dependencies pass license compliance checksGo Dependencies
npm DependenciesSee full report in workflow artifacts Allowed Licenses: MIT, Apache-2.0, BSD-*, ISC, CC0-1.0, MPL-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second bundled WS-D god-file decomposition — seven independent pure-move
splits, one commit each, every file relocated by role with no behavior
change:
internal/database/repository_topology.go(720)repository_topology.go(nodes + ARP bindings) ·repository_topology_links.go(links/targets) ·repository_topology_interfaces.go(interfaces)internal/database/database.go(684)database.go(DB type, config, open/recovery, lifecycle) ·repositories.go(per-repository accessor methods)internal/alerts/pipeline/observation_pipeline.go(669)observation_pipeline.go(lifecycle) ·observation_prime.go(history priming) ·observation_eval.go(per-kind eval)internal/alerts/pipeline/listener_pipeline.go(654)listener_pipeline.go(lifecycle + package doc) ·listener_rules.go(rule load/snapshot) ·listener_eval.go(event eval)internal/discovery/registry.go(616)registry.go(type, lifecycle, queries) ·registrymerge.go(field-merge helpers)internal/netif/interfaces.go(604)interfaces.go(inventory/management + package doc) ·select.go(auto-detect, candidate selection, link status)internal/diagnostics/iperf/installer.go(698)installer.go(package-manager detection) ·install.go(install/build/download execution)Bundled into one PR to avoid the required-up-to-date branch-protection merge
cascade. Every split file is now under the 600-line size gate. Package doc
comments retained in the kept core file; no underscores introduced beyond the
package's existing
repository_*/*_pipelineconventions.Linked Issue
Related to #187
Type of Change
Risk
Testing Evidence
Each split independently verified pure-move (declaration sets + code-line
multisets identical to the original), then the combined bundle gated from
a clean worktree off
origin/main:The slow
discoveryanddatabase-racesuites are left to CI (full-racewith the 20m timeout); both are pure relocations with no logic orgoroutine changes.
Security and Release Checklist