How lerugray/generalstaff works
GeneralStaff is a local dispatcher and verification gate for AI coding work. The main workflow queues bounded project tasks, runs an engineer, verifies the resulting change, obtains an independent scope-match review, and records an auditable outcome; failed checks are rolled back. A separate verify-only workflow checks externally created changes in an isolated worktree. The repository also documents autonomous dispatch, persistent aides, phase management, and a local dashboard. Some relationships below are based on README descriptions because the relevant implementation excerpts were not shown.
Main entry points: cycle.ts Cycle dispatcher · cli.ts CLI · run.ts Isolated verify run · engineer.ts Engineer runner
Components 22
Work dispatch
- CLI
src/cli.ts - Project config
src/projects.ts - Task queue
src/tasks.ts - Cycle dispatcher
src/cycle.ts - Engineer runner
src/engineer.ts - Engineer providers
src/engineer_providers/aider.ts
Verification gate
- Change verification
src/verification.ts - Scope reviewer
src/reviewer.ts - Verify-only CLI
src/verify_only/cli.ts - Isolated verify run
src/verify_only/run.ts - Verify Git operations
src/verify_only/git.ts - Command runner
src/verify_only/runner.ts - Change digest
src/verify_only/digest.ts
State and audit
- Project state
src/state.ts - Cycle audit log
src/audit.ts
Optional capabilities
- Autonomous sessions
src/autonomous_session.ts - Persistent aides
src/aides.ts
Local dashboard
- Dashboard server
src/server.ts - Fleet overview
src/views/fleet_overview.ts - Phase management
src/server/routes/phase.ts - Page layout
src/server/templates/layout.ts
Other components
- Project owner
Connections 23
- Project owner → CLI: queues work
README.md - CLI → Task queue: adds tasks
README.md - CLI → Cycle dispatcher: starts cycle
README.md - Cycle dispatcher → Engineer runner: runs engineer
- Engineer runner → Engineer providers: selects provider
src/engineer.ts - Cycle dispatcher → Change verification: checks changes
README.md - Cycle dispatcher → Scope reviewer: requests review
README.md - Cycle dispatcher → Project state: records state
- Engineer runner → Cycle audit log: appends events
src/engineer.ts - CLI → Verify-only CLI: starts verify-only
README.md - Verify-only CLI → Isolated verify run: runs check
src/verify_only/cli.ts - Isolated verify run → Verify Git operations: manages worktree
src/verify_only/run.ts - Isolated verify run → Command runner: runs verification
src/verify_only/run.ts - Isolated verify run → Scope reviewer: requests review
src/verify_only/run.ts - Verify-only CLI → Change digest: checks digest
src/verify_only/cli.ts - Cycle dispatcher → Cycle audit log: records cycle
- Project owner → Autonomous sessions: enables mode
README.md - Autonomous sessions → Cycle dispatcher: routes work
README.md - Project owner → Persistent aides: registers aides
README.md - Project owner → Dashboard server: opens dashboard
README.md - Dashboard server → Fleet overview: renders overview
src/server.ts - Dashboard server → Phase management: routes requests
src/server.ts - Phase management → Page layout: wraps page
src/server/routes/phase.ts