Skip to content

refactor: split monitor.go (2051 lines) into 8 focused files#70

Merged
tzone85 merged 1 commit into
mainfrom
refactor/monitor-split
Jun 11, 2026
Merged

refactor: split monitor.go (2051 lines) into 8 focused files#70
tzone85 merged 1 commit into
mainfrom
refactor/monitor-split

Conversation

@tzone85

@tzone85 tzone85 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Pure file split of internal/engine/monitor.go (2051 lines) into 8 sibling files under the same package engine.
  • No behavioural change: same Monitor struct, same method receivers, same package-level helpers (autoCommit, gitDiff, FindDependents, IsStoryComplete, vxdArtifactPatterns).
  • Largest sibling is now 538 lines (monitor_post_execution.go), well under the 800-line house guideline.

Layout

File Lines Contents
monitor.go 221 struct + 14 setters + RunContext
monitor_polling.go 133 Run, RunWithContext, pollOnce
monitor_sla.go 167 checkSLA, clearSLATracking, escalateOnSLABreach
monitor_post_execution.go 538 postExecutionPipeline, rebaseAndMerge, rebaseAndCreatePR, pauseRequirement, resetStoryToDraft
monitor_dispatch.go 260 dispatchNextWave, FindDependents, IsStoryComplete
monitor_escalation.go 322 tier-2 manager + tier-3 tech-lead handlers
monitor_git_hygiene.go 363 autoCommit, stripVXDArtifactsFromBranch, pullMainAfterMerge, ensureGitignorePatterns
monitor_gitdiff.go 123 gitDiff*, captureFileTree, artifact patterns

Diff stat: 1907 insertions, 1832 deletions — the 75-line delta is the package engine header + scoped import block repeated across the 8 files (trimmed to only the imports each file actually uses via goimports).

Test plan

  • go build ./... clean
  • go vet ./internal/engine/ clean
  • go test ./... -count=1 — all 30 packages pass
  • ~/.local/bin/vxd --version smoke check
  • Closes follow-up feat: add cost estimation and pre-flight validation #26 in CLAUDE.md
  • Obsidian launch playbook updated to reflect closed item

Pure file split — same package, same Monitor receivers, no behavioural
change. Largest sibling is now 538 lines (monitor_post_execution.go),
well under the 800-line house guideline.

Layout:
- monitor.go              (221) struct + 14 setters + RunContext
- monitor_polling.go      (133) Run, RunWithContext, pollOnce
- monitor_sla.go          (167) checkSLA, clearSLATracking, escalateOnSLABreach
- monitor_post_execution.go (538) postExecutionPipeline + rebase/PR/pause/reset
- monitor_dispatch.go     (260) dispatchNextWave + FindDependents + IsStoryComplete
- monitor_escalation.go   (322) tier-2 manager + tier-3 tech-lead handlers
- monitor_git_hygiene.go  (363) autoCommit + artifact-strip + pullMain + gitignore
- monitor_gitdiff.go      (123) gitDiff* + captureFileTree + artifact patterns

Verified: go build, go vet, full test suite (30 packages) pass.
@tzone85 tzone85 merged commit e205db4 into main Jun 11, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant