refactor: decompose four WS-D god-files by role (arp, users, snmp, engine)#1709
Merged
Conversation
added 4 commits
June 17, 2026 08:41
Split internal/discovery/enumerate/arp.go (750 LOC) into role-based files in the same package — pure move: scanner type + config/accessors stay in arp.go; subnet scanning + ARP-table reading/enrichment 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/database/users.go (731 LOC) into role-based files in the same package (following the existing users_*.go convention) — pure move: core user CRUD stays in users.go; login/lockout/token-version moves to users_auth.go; SSO upsert/lookup moves to users_sso.go. All files under the 600-line size-gate threshold. Declaration sets and code-line multisets verified identical to the original. Related to #187
…S-D) Split internal/discovery/snmp_collector.go (688 LOC) into role-based files in the same package — pure move: types + collector orchestration/dispatch stay in snmp_collector.go; the per-area low-level collect* implementations 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/discovery/engine.go (678 LOC) into role-based files in the same package — pure move: engine types, config, constructors, collector setters, and lifecycle stay in engine.go; the scan orchestration/phases 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
📋 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
Bundled WS-D god-file decomposition — four independent pure-move splits, one
commit each, each file relocated by role with no behavior change:
internal/discovery/enumerate/arp.go(750)arp.go(scanner type + config/result accessors) ·arpscan.go(subnet scan / ping sweep) ·arpenrich.go(ARP-table read + enrichment)internal/database/users.go(731)users.go(user CRUD) ·users_auth.go(login/lockout/token-version) ·users_sso.go(SSO upsert/lookup) — follows the existingusers_*.goconventioninternal/discovery/snmp_collector.go(688)snmp_collector.go(types + collect orchestration/dispatch) ·snmpcollectors.go(per-area low-level collectors)internal/discovery/engine.go(678)engine.go(types, config, setters, lifecycle) ·scan.go(scan orchestration/phases)Bundled into one PR (rather than four) to avoid the required-up-to-date
branch-protection merge cascade. Every split file is now under the 600-line
size gate.
Linked Issue
Related to #187
Type of Change
Risk
Testing Evidence
Each of the four splits 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:Security and Release Checklist