feat(boss): Chief of Staff Boss + spun-crow registry with cap (#42) #51

Merged
jacisjake merged 2 commits from task/42-boss-crow-registry into main 2026-10-28 15:01:55 +00:00
jacisjake commented 2026-10-28 14:56:42 +00:00 (Migrated from github.com)

What was addressed

  • Boss persona (The Whip) in personas.go; PERSONAS.md regenerated; Boss added to rosterOrder.
  • crowreg.go: SpunCrow + CrowStore (.crows/crows.json, atomic save like NestStore); Server.WithCrows wiring.
  • guardrails.go: MaxSpunCrows (default 8).
  • GET /api/crows now returns the spun-crow registry: {"crows":[{"name","persona","trust"}]}; no registry reads as {"crows": []}.
  • The old persona list moved to GET /api/personas (same payload); ui/src/api.ts fetch updated. This was forced: the decided contract puts the registry on /api/crows, which the persona list had occupied.
  • boss.go: respondBoss — one Flock.ask (boss-command budget); SPIN {...} order validated (persona exists, name not taken, cap, trusted→regular clamp); success writes registry + ledger start level; Boss posts a say naming the outcome or the refusal; a saturated flock posts and writes nothing.
  • serviceRoles += Boss; request trigger routes to: "Boss".
  • EVENTS.md updated first (red commit): registry contract, Boss behavior, spin-up guardrails.

How to test / validate

  • go test -race -count=1 -timeout 180s -run 'TestBoss|TestSpinUp|TestCrows|TestPersonas' . → ok (7 tests: spin-up, cap, duplicate, trust gate, flock saturation, plain reply, garbled order, empty-without-store, personas endpoint)
  • go test -race -count=1 -timeout 180s . → ok somanycrows 6.416s
  • gofmt -l . prints nothing; go vet ./... clean
  • Saved RED excerpt (before implementation):
vet: ./boss_test.go:63:16: undefined: LoadCrowStore
./boss_test.go:63:16: undefined: LoadCrowStore
./boss_test.go:73:57: NewServer(ctx, p, appr, nests).WithMessages(msgs).WithCrows undefined (type *Server has no field or method WithCrows)
./boss_test.go:167:8: s.p.G.MaxSpunCrows undefined (type Guardrails has no field or method MaxSpunCrows)
FAIL	somanycrows [build failed]
  • ./crows personas | grep -A2 "## Boss" shows the Boss section

Configurations or dependencies

  • None. No new env keys; the registry file is created on first spin-up under the existing data dir (.crows/crows.json).
  • UI: any cached front end must be rebuilt to pick up the /api/personas URL change (no node_modules in the worktree, so the Vite build was not run here).

Closes #42
Epic: #37

## What was addressed - Boss persona (The Whip) in `personas.go`; PERSONAS.md regenerated; `Boss` added to `rosterOrder`. - `crowreg.go`: `SpunCrow` + `CrowStore` (`.crows/crows.json`, atomic save like NestStore); `Server.WithCrows` wiring. - `guardrails.go`: `MaxSpunCrows` (default 8). - `GET /api/crows` now returns the spun-crow registry: `{"crows":[{"name","persona","trust"}]}`; no registry reads as `{"crows": []}`. - The old persona list moved to `GET /api/personas` (same payload); `ui/src/api.ts` fetch updated. This was forced: the decided contract puts the registry on `/api/crows`, which the persona list had occupied. - `boss.go`: `respondBoss` — one `Flock.ask` (`boss-command` budget); `SPIN {...}` order validated (persona exists, name not taken, cap, trusted→regular clamp); success writes registry + ledger start level; Boss posts a `say` naming the outcome or the refusal; a saturated flock posts and writes nothing. - `serviceRoles` += Boss; request trigger routes `to: "Boss"`. - EVENTS.md updated first (red commit): registry contract, Boss behavior, spin-up guardrails. ## How to test / validate - [ ] `go test -race -count=1 -timeout 180s -run 'TestBoss|TestSpinUp|TestCrows|TestPersonas' .` → ok (7 tests: spin-up, cap, duplicate, trust gate, flock saturation, plain reply, garbled order, empty-without-store, personas endpoint) - [ ] `go test -race -count=1 -timeout 180s .` → `ok somanycrows 6.416s` - [ ] `gofmt -l .` prints nothing; `go vet ./...` clean - [ ] Saved RED excerpt (before implementation): ``` vet: ./boss_test.go:63:16: undefined: LoadCrowStore ./boss_test.go:63:16: undefined: LoadCrowStore ./boss_test.go:73:57: NewServer(ctx, p, appr, nests).WithMessages(msgs).WithCrows undefined (type *Server has no field or method WithCrows) ./boss_test.go:167:8: s.p.G.MaxSpunCrows undefined (type Guardrails has no field or method MaxSpunCrows) FAIL somanycrows [build failed] ``` - [ ] `./crows personas | grep -A2 "## Boss"` shows the Boss section ## Configurations or dependencies - [ ] None. No new env keys; the registry file is created on first spin-up under the existing data dir (`.crows/crows.json`). - [ ] UI: any cached front end must be rebuilt to pick up the `/api/personas` URL change (no `node_modules` in the worktree, so the Vite build was not run here). Closes #42 Epic: #37
Sign in to join this conversation.