Commit graph

3 commits

Author SHA1 Message Date
Rasmus Widing
73cb4784a1
refactor(core): break up god function in command-handler (#742)
* refactor(core): break up god function in command-handler

Extract handleWorktreeCommand, handleWorkflowCommand, handleRepoCommand,
and handleRepoRemoveCommand from the 1300-line handleCommand switch
statement. Add resolveRepoArg helper to eliminate duplication between
repo and repo-remove cases. handleCommand now contains ~200 lines of
routing logic only.

* fix: address review findings from PR #742

command-handler.ts:
- Replace fragile 'success' in discriminator with proper ResolveRepoArgResult
  discriminated union (ok: true/false) and fix misleading JSDoc
- Add missing error handling to worktree orphans, workflow cancel, workflow reload
- Fix isolation_env_id UUID used as filesystem path in worktree create/list/orphans
  (look up working_path from DB instead)
- Add cmd. domain prefix to all log events per CLAUDE.md convention
- Add identifier/isolationEnvId context to repo_switch_failed and worktree_remove_failed logs
- Capture isCurrentCodebase before mutation in handleRepoRemoveCommand
- Hoist duplicated workflowCwd computation in handleWorkflowCommand
- Remove stale (Phase 3D) comment marker

docs:
- Remove all /command-invoke references from CLAUDE.md, README.md,
  docs/architecture.md, and .claude/rules/orchestrator.md
- Update command list to match actual handleCommand cases
- Replace outdated routing examples with current AI router pattern

* refactor: remove MAX_WORKTREES_PER_CODEBASE limit

Worktree count is no longer restricted. Remove the constant, the
limit field from WorktreeStatusBreakdown, the limit_reached block
reason, formatWorktreeLimitMessage, and all associated tests.

* fix: address review findings — error handling, log prefixes, tests, docs

- Wrap workflow list discoverWorkflowsWithConfig in try/catch (was the
  only unprotected async call among workflow subcommands)
- Cast error to Error before logging in workflow cancel/status catch blocks
- Add cmd. domain prefix to all command-handler log events (12 events)
- Update worktree create test to use UUID isolation_env_id with DB lookup
- Add resolveRepoArg boundary tests (/repo 0, /repo N > count)
- Add worktree cleanup subcommand tests (merged, stale, invalid type)
- Add updateConversation assertion to repo-remove session test
- Fix stale docs: architecture.md command handler section, .claude → .archon
  paths, remove /command-invoke from commands-reference, fix github.md example
2026-03-25 11:01:03 +02:00
Rasmus Widing
392a13ab90 fix(docs): address review findings from PR #734
- Fix stale port 3000 → 3090 in ngrok/Cloudflare tunnel commands
- Fix workflow names to use actual archon- prefixed names throughout README
- Split ralph into ralph-fresh and ralph-stateful variants
- Fix "Future: workflow definitions" → actual shipped feature label
- Fix directory structure to show project-centric layout (not legacy)
- Add missing TELEGRAM_ALLOWED_USER_IDS documentation
- Add docs/adapters/slack.md for consistent adapter doc pattern
- Update README platform table to link to new slack adapter doc
2026-03-19 09:02:42 +01:00
Rasmus Widing
f8661677e8 refactor(docs): restructure README and extract content to /docs
Slim README from 1576 to 200 lines. Focus on value prop (deterministic
AI coding workflows), quickstart paths (AI-assisted, CLI, Web UI), and
bundled workflow showcase.

All reference content moved to dedicated docs:
- docs/adapters/ — per-platform setup guides
- docs/ai-assistants.md — Claude/Codex auth details
- docs/database.md — SQLite/PostgreSQL guide + schema
- docs/deployment.md — Docker + local dev setup
- docs/commands-reference.md — all slash commands
- docs/troubleshooting.md — common issues and fixes
- docs/windows.md — Windows/WSL2 guide
- docs/configuration.md — added streaming, concurrency, health endpoints
2026-03-19 09:02:42 +01:00