Skip to content

chore(cli): remove dead ArgusTop and clarify TopCommand wiring#172

Merged
rlaope merged 1 commit into
masterfrom
chore/remove-dead-argustop
May 9, 2026
Merged

chore(cli): remove dead ArgusTop and clarify TopCommand wiring#172
rlaope merged 1 commit into
masterfrom
chore/remove-dead-argustop

Conversation

@rlaope
Copy link
Copy Markdown
Owner

@rlaope rlaope commented May 9, 2026

Summary

ArgusTop.java carried its own main loop that mirrored TopCommand byte-for-byte (cursor hide β†’ connect β†’ fetch β†’ render β†’ stdin q-check β†’ sleep β†’ unhide). Nothing reached it:

  • The fatJar's Main-Class is ArgusCli, not ArgusTop
  • No test referenced it
  • TopCommand re-implements the same flow inline rather than delegating
  • Its only mentions outside the file itself were a stale TopCommand docstring and a docs/architecture.md line

This PR drops ArgusTop.java (108 lines), updates TopCommand's docstring to describe what it actually does, and tightens docs/architecture.md to drop the "Legacy" framing β€” ArgusClient / TerminalRenderer / MetricsSnapshot are still load-bearing for TopCommand.

Why this and not a "Ticker" abstraction

This change was originally surveyed as part of a "tick-loop deepening" candidate. On closer inspection the three remaining tickers β€” HarnessEngine (session-bounded ScheduledExecutorService + CountDownLatch), the server's long-running EventBroadcaster (scheduleAtFixedRate with start/stop), and ZgcCommand.runWatch (fixed-iteration for-loop with shutdown hook) β€” serve genuinely different lifecycles. A shared Ticker abstraction would force a single-adapter seam at every site, which is the shallow-module trap to avoid (one adapter = hypothetical seam, not a real one). The honest payoff in this area was the dead-duplicate removal here.

Test plan

  • ./gradlew build -x integrationTest passes after deletion
  • argus top still routes through TopCommand (unchanged path)
  • Smoke argus top --host=… --port=… against a running argus-server on the user side

ArgusTop.java carried its own main loop that mirrored TopCommand
byte-for-byte (cursor hide β†’ connect β†’ fetch β†’ render β†’ stdin q-check
β†’ sleep β†’ unhide). Nothing reached it: the JAR's Main-Class is
ArgusCli, no test referenced it, and TopCommand re-implements the same
flow inline rather than delegating. Its only mention outside the file
was a stale doc comment in TopCommand and the architecture doc.

Drop ArgusTop.java (108 lines). Update TopCommand's docstring to
describe what it actually does. Update docs/architecture.md to drop
the "Legacy" framing β€” those classes (ArgusClient, TerminalRenderer,
MetricsSnapshot) are still load-bearing for TopCommand.

This was originally surveyed as part of a "tick-loop deepening"
candidate. On closer inspection the three remaining tickers
(HarnessEngine's session-bounded ScheduledExecutorService, the
server's long-running EventBroadcaster, ZgcCommand.runWatch's
fixed-iteration for-loop) serve genuinely different lifecycles, and a
shared Ticker abstraction would force a single-adapter seam β€” exactly
the shallow-module trap to avoid. The honest payoff in this area was
just removing the dead duplicate.

Signed-off-by: rlaope <piyrw9754@gmail.com>
@rlaope rlaope merged commit 4a449a3 into master May 9, 2026
11 checks passed
@rlaope rlaope deleted the chore/remove-dead-argustop branch May 9, 2026 03:39
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