Add dynamic expert add design and task specs#70
Open
Cassin01 wants to merge 6 commits into
Open
Conversation
Specifies CLI (`macot expert add`) and tower TUI flow to append an expert to a running session without restarting, plus the implementation task breakdown.
Add experts to a running session without restarting it, per the design at
.macot/specs/dynamic-expert-add-design.md.
Core
- ExpertAddService coordinates ID allocation, role resolution, manifest
commit (temp + atomic rename), and tmux window spawn under a 5s
advisory file lock at .macot/.lock.
- Monotonic ID allocation reconciled against on-disk manifest on every
add to survive concurrent writers.
- Roles: built-in (architect / planner / general) plus custom templates
resolved against .macot/templates/roles/{name}.md and
~/.config/macot/roles/{name}.md.
- NamePool with 12 literary names and Expert{NN} fallback once exhausted.
- Rollback unwinds manifest, role assignment, and per-expert files when
tmux launch fails so state remains all-or-nothing.
CLI
- `macot expert add` with --session/--role/--name/--prompt-file/
--worktree/--worktree-branch/--dry-run/--json.
- `macot expert list` reads experts_manifest.json read-only.
Tower TUI
- F2 opens the Add Expert modal.
- notify-rs watcher reloads the Expert Panel on manifest changes.
Dependencies
- fs2 0.4 (advisory file lock), notify 6 (manifest change events).
Tests
- Unit + property tests for NamePool, RoleResolver determinism,
ManifestPersistor atomicity, ID monotonicity.
- E2E suite in tests/e2e_dynamic_expert_add.rs (gated behind
`make test-e2e` / `--ignored`, requires tmux on PATH).
Docs
- doc/cli.md: full reference for the new subcommands and F2 binding.
- CHANGELOG.md: Unreleased entry.
Resolves clippy::collapsible-match errors on KeyCode::Up/Down arms in the add expert modal handler.
Linux inotify can emit setup-related events when attaching to a freshly created directory, causing the quiescent-disk test to fail in CI. Drain initial events within a short settling window before asserting no further changes.
Surface the F2 (Open Add Expert modal) keybinding in the F1 help modal's Global section so users can discover it from inside the app.
…xperts Resolves Property 8' (Tower Liveness Under Add, ≤1s): experts added via `macot expert add` or the F2 modal now appear in the tower Experts panel within ≤1s of the manifest commit. Root cause: `refresh_status` and `poll_messages` iterated `self.config.experts` (a startup snapshot), so new experts surfaced in `ExpertRegistry` were never projected onto `status_display`. Migrate both call sites and `reload_from_manifest` to the registry via a shared `push_registry_to_status_display` helper. Document `Config::experts` as startup-only and add `make check-no-stale-mirror` to prevent regression. Tests: T1 reload-then-display, T2 Property 8' ≤1s timing, T3 proptest registry/display sync, T4 poll_messages iterates registry. See `.macot/specs/expert-panel-manifest-sync-design.md` §2.3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.macot/specs/dynamic-expert-add-design.md) covering CLI (macot expert add) and tower TUI flow to append an expert to a running session without restarting..macot/specs/dynamic-expert-add-tasks.md).Scope
expert removeis out of scope..macot/templates/roles/{role}.md.Test plan
experts_manifest.json,status/expertN, queue/messages paths).