Skip to content

test: add categorized help output tests for PR #337#349

Closed
whitmo wants to merge 22 commits intodlorenc:mainfrom
whitmo:work/silly-otter-tests
Closed

test: add categorized help output tests for PR #337#349
whitmo wants to merge 22 commits intodlorenc:mainfrom
whitmo:work/silly-otter-tests

Conversation

@whitmo
Copy link
Copy Markdown

@whitmo whitmo commented Mar 1, 2026

Summary

  • Adds 14 tests in internal/cli/help_categories_test.go covering the categorized help output from PR feat(cli): improve help output with categorized commands #337
  • Based on pr-triage-b2 branch which contains the categorized help feature
  • Tests category assignment for all commands, hidden command exclusion, categorized output format, sorting, QUICK START section, LongDescription display, and subcommand help behavior

Tests Added

Test What it verifies
TestAllCommandsHaveCategory Every visible command has a valid category
TestHiddenCommandsExcludedFromHelp Hidden aliases don't appear in categorized sections
TestExpectedHiddenCommands 6 specific backward-compat aliases are hidden
TestHiddenCommandsStillExecutable Hidden commands remain routable
TestCategorizedHelpFormat Category headers present in correct order
TestCategoryCommandAssignment Specific commands in expected categories
TestVisibleCommandsAppearInHelpOutput All non-hidden commands shown
TestHelpOutputContainsDescriptions Descriptions present for all visible commands
TestSubcommandHelpHidesHiddenSubcommands _run hidden from daemon --help
TestRootCommandHelpRedirects showCommandHelp(root) delegates to showHelp()
TestNoEmptyCategories Every category header has entries
TestCommandsWithinCategorySorted Alphabetical sort within each category
TestQuickStartSection QUICK START present with 4 key commands
TestInternalCommandsExcluded _-prefixed commands never in output
TestLongDescriptionInSubcommandHelp repo hibernate shows LongDescription

Findings

  • All 14 tests pass, full CLI suite has no regressions
  • QUICK START section intentionally shows start (hidden alias) for UX - categorized sections correctly hide it
  • LongDescription field works for repo hibernate
  • Detailed findings at /tmp/swarm-tests-337.md

Test plan

  • All 14 new tests pass
  • Full CLI test suite passes (no regressions)
  • No credentials in diff

References PR #337 (categorized help output), branch pr-triage-b2.

🤖 Generated with Claude Code

aronchick and others added 22 commits January 24, 2026 01:12
Fixes branch naming inconsistency by standardizing on 'multiclaude/' prefix. Maintains backward compatibility for cleanup of legacy 'work/' branches.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The comment at internal/cli/cli.go:5128 referenced docs/EXTENSION_DOCUMENTATION_SUMMARY.md which doesn't exist. Updated the comment to reference the actual existing extension docs (docs/extending/SOCKET_API.md and docs/extending/STATE_FILE_INTEGRATION.md) that need to be kept in sync when CLI commands affecting extension surfaces change.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…space

Improve the repair command to be more comprehensive by ensuring core
agents and a default workspace exist after cleanup. This enhancement
aligns with ROADMAP.md P1 "Agent restart" by making repair more robust
and reducing the need for manual intervention.

Changes:
- CLI: Add ensureCoreAgents() and ensureDefaultWorkspace() helpers
- CLI: Update localRepair() to recreate missing core agents
- CLI: Create default workspace "my-default-2" if none exist
- Daemon: Add ensureCoreAgents() and ensureDefaultWorkspace() methods
- Daemon: Update handleRepairState() to recreate missing agents
- Both: Improve output to show what was removed and what was created
- Tests: Add comprehensive tests for all scenarios

Key Features:
1. Recreates missing supervisor agent if absent
2. Recreates missing merge-queue (non-fork) or pr-shepherd (fork)
3. Creates default workspace if no workspaces exist
4. Does not duplicate existing agents/workspaces
5. Provides detailed output showing:
   - Removed: dead agents
   - Cleaned: orphaned resources
   - Created: core agents and workspaces

Test Coverage:
- TestRepairEnsuringCoreAgents: Verifies core agents are created
- TestRepairEnsuringPRShepherdInForkMode: Fork mode verification
- TestRepairDoesNotDuplicateAgents: Prevents duplicates

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Restructures the CLI help output to be more user-friendly:

- Add QUICK START section showing the 4 most common commands
- Group commands into 6 categories: DAEMON, REPOSITORIES, AGENTS,
  COMMUNICATION, MAINTENANCE, META
- Hide 7 redundant aliases from help (still functional, just not displayed)
- Add Hidden and Category fields to Command struct for flexibility

The help output now shows 21 focused commands instead of 28 scattered
entries, making it much easier for new users to understand what to do.

Also adds CLI_RESTRUCTURE_PROPOSAL.md documenting the analysis and
future restructuring options for v2.0.

Aligns with ROADMAP P2 "Better onboarding".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add LongDescription field to Command struct for detailed help text
- Add comprehensive help for 'repo hibernate' explaining token consumption
- Show specific active agents in 'multiclaude status' (supervisor, merge-queue, etc.)
  instead of just 'X core, Y workers'
- Add token consumption warning when agents are active
- Point users to 'hibernate --all' to stop token usage

This makes hibernate more discoverable and helps users understand that
running agents continuously consume API tokens.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When run inside an agent worktree, `multiclaude refresh` now syncs just
that worktree directly instead of triggering a global refresh via daemon.
This gives agents immediate feedback and control over their sync process.

Changes:
- Add context detection: automatically identifies agent worktree from cwd
- Add direct refresh: syncs single worktree using worktree.RefreshWorktree()
- Add --all flag: explicitly triggers global refresh (previous behavior)
- Update /refresh slash command to recommend CLI method
- Provide detailed output: fetch status, rebase info, conflict handling

Behavior:
- Inside agent worktree: refreshes that worktree directly with feedback
- Outside agent context: triggers daemon-based global refresh
- With --all flag: always triggers daemon-based global refresh

P0 Roadmap item: Worktree sync

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Workers now receive guidance to use /sc:index-repo for large codebase
exploration, achieving 94% token reduction (58K → 3K tokens). This
improves memory usage and search efficiency for complex tasks.

The guidance is embedded in the worker template and will be included
in system prompts for all new worker agents.

Task: If a skill is provided such as QMD that enables better memory
and tokens and searching, make sure that Multiclaude uses it.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…#337)

14 tests covering: category assignment for all commands, hidden command
exclusion from help, categorized output format with sorted sections,
QUICK START section, LongDescription display, and subcommand help.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@whitmo whitmo closed this Mar 1, 2026
@whitmo whitmo deleted the work/silly-otter-tests branch March 1, 2026 22:52
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.

2 participants