Decompose cmd/archie-agent main.go by concern #1589

Closed
opened 2026-10-27 13:41:00 +00:00 by sam · 0 comments
Owner

Problem\ncmd/archie-agent/main.go is 430 lines and mixes process startup, task subscription selection, stage-loop execution, MCP provider lifecycle, and request handling. This makes unrelated changes collide and obscures the composition boundary.\n\n## Scope\nTrack small behavior-preserving extractions into concern-named files within cmd/archie-agent. Keep main.go focused on flags, startup ordering, construction, shutdown, and invoking the worker loop. No new packages or architecture changes.\n\n## Acceptance\n- child tasks move one concern at a time with tests unchanged or improved\n- main.go retains process-level input and composition only\n- each child passes task check and fresh adversarial review

Acceptance criteria

All child extractions complete; main.go contains process input and composition only; task check passes

Notes

Implementation and validation are complete in /tmp/archie-core-agent-cleanup on branch refactor/archie-agent-main-cleanup, but delivery is pending: changes are uncommitted, not integrated into the target branch, and not pushed. Do not close until those delivery steps are complete.
Validation already completed: main.go reduced 430→136 lines; package tests/race/vet/build/lint pass; full task check passes; final fresh adversarial review reported zero findings.
Corrected architecture migration pushed for review at commit de242f81c1b6309cdc984ded8e2f01fad89097b9 on branch refactor/archie-agent-main-cleanup. Rebased onto origin/main 58eae75. Focused tests, race, changed-line lint, full task check, and final independent review all pass. Keep in_progress until PR merge.

Close reason

Merged to main in PR #480 at 52738f5; implementation commit de242f8 passed task check, race tests, lint, and independent review


Imported from beads archie-core-tje · GitHub #475 · type epic · priority P2 · created 2026-08-13 · closed 2026-08-14

## Problem\ncmd/archie-agent/main.go is 430 lines and mixes process startup, task subscription selection, stage-loop execution, MCP provider lifecycle, and request handling. This makes unrelated changes collide and obscures the composition boundary.\n\n## Scope\nTrack small behavior-preserving extractions into concern-named files within cmd/archie-agent. Keep main.go focused on flags, startup ordering, construction, shutdown, and invoking the worker loop. No new packages or architecture changes.\n\n## Acceptance\n- child tasks move one concern at a time with tests unchanged or improved\n- main.go retains process-level input and composition only\n- each child passes task check and fresh adversarial review ### Acceptance criteria All child extractions complete; main.go contains process input and composition only; task check passes ### Notes Implementation and validation are complete in /tmp/archie-core-agent-cleanup on branch refactor/archie-agent-main-cleanup, but delivery is pending: changes are uncommitted, not integrated into the target branch, and not pushed. Do not close until those delivery steps are complete. Validation already completed: main.go reduced 430→136 lines; package tests/race/vet/build/lint pass; full task check passes; final fresh adversarial review reported zero findings. Corrected architecture migration pushed for review at commit de242f81c1b6309cdc984ded8e2f01fad89097b9 on branch refactor/archie-agent-main-cleanup. Rebased onto origin/main 58eae75. Focused tests, race, changed-line lint, full task check, and final independent review all pass. Keep in_progress until PR merge. ### Close reason Merged to main in PR #480 at 52738f5; implementation commit de242f8 passed task check, race tests, lint, and independent review --- _Imported from beads `archie-core-tje` · GitHub #475 · type epic · priority P2 · created 2026-08-13 · closed 2026-08-14_
sam added the mediumepic labels 2026-10-27 13:41:00 +00:00
sam self-assigned this 2026-10-27 13:41:00 +00:00
sam closed this issue 2026-10-27 13:41:00 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1589