Skip to content

Advisors beside the commander at a seat: process advisors, a Claude advisor, accept in the app - #135

Merged
ptescher merged 1 commit into
masterfrom
actors-advice-seat
Nov 15, 2026
Merged

ptescher merged 1 commit into
masterfrom
actors-advice-seat

Conversation

@ptescher

Copy link
Copy Markdown
Owner

Step 4, second half of plans/actors.md: advisors on the seat side.

What changed

  • Advisors run beside the commander (recreation_towers_ground::advisors). Runner puts an advisor on a thread with a mailbox: the newest map and hand go in, an older one not yet looked at is dropped (never queued), proposals come out when ready. Advisors::take(now) drops proposals that are stale on arrival. A computer commander on a seat (commander::run_with) has its built-in lookahead off; before each decision it calls Commander::advise with what has arrived, after it shows the advisors the map and Commander::hand() (new). It never waits. Advise is now Send; Proposal and Hand are serde types.
  • An advisor in another process. ProcessAdvisor (command run with sh -c; towers_advisor is found beside the other binaries), serve for the other end, binary towers_advisor (lookahead). Lines: {"Start":{"team","rules"}} once, answered "ok"; then {"Look":{"view":TeamView,"hand":Hand}}, answered by a JSON list of proposals. A process that dies, hangs (90 s), writes what is not a list, or proposes for a drone or tower not in the game is dropped with a line on stderr; the game goes on. Flags: towers_commander --advisor lookahead|none|CMD, towers_server --blue-advisor/--red-advisor, the app's --advisor (none by default under --expect). Documented in the header comments and domains/recreation/README.md.
  • A Claude advisor: towers_advisor --claude [--model N] [--every S]. Every 8 s of game time it gives claude -p (--output-format json, --max-budget-usd 0.25, --tools "", no session persistence, the session's CLAUDE*/ANTHROPIC_BASE_URL variables stripped as the league does, command from SIM001_CLAUDE) a text picture of the map and hand and asks for at most two proposals as JSON. Replies are read strictly (unknown or non-free drone, unknown tower, missing or non-positive gain: dropped); made and until are stamped by the advisor.
  • Taking advice with a click. The app runs advisors too (advisors::attend, lookahead by default). The ADVISOR panel lists live proposals (why, seconds left), best first; a click or Y sends that order and queue for that drone (Seat::accept); a stale one leaves. The text warnings are unchanged. Spec: expectations/09-towers/05-advice.expect, vocabulary in section.expect, glossary, app driver taught the new steps.
  • The server prints advice Blue: proposal ... / taken ... lines and RESULT proposals / proposals_taken.

Not done / not run

  • The Claude advisor has not been run against the real claude. It is tested only with stand-in commands (good, malformed, error, not-JSON, slow, missing). The claude flags (--tools "", --max-budget-usd, ...) are from memory of the CLI, not checked against it.
  • No league contest of "commander with advisor against without" on paired seeds (the arena's advice table in the plan is unchanged and still says the lookahead is worth less than nothing there).
  • Docs under docs/ were not regenerated.
  • The empty-panel check inside the story "Your first tower" was not run in the app (needs the cameras); the four tests of 05-advice were.
  • "taken" in the log means the commander's decision had the proposal's drone and order, so a proposal that matched its own order is counted too.

Tests

  • cargo test --release -p recreation_towers -p cognition_towers -p recreation_towers_ground: pass (151, 37 + 12, 19 + 12 + 3). -p recreation_towers_server --bins: pass (30). cargo test --release -p teleoperation_command: pass (6).
  • New: an advisor that sleeps 3 s does not delay ten decisions; a late proposal is dropped when stale; the mailbox keeps only the newest map; a panicking advisor is dropped; process advisor good / nonsense / ghost drone / dies / hangs / does not start; through the commander on a fake server, a never-answering advisor does not slow its orders and a proposing one gets taken; the Claude advisor's picture, strict parsing, command line, env and timeout; Seat::accept and the panel's list.
  • cargo build --release -p recreation_towers_server -p teleoperation_command: compile. cargo clippy --workspace --all-targets: no warnings in repo code. cargo run -p expectation -- check expectations: 0 errors.
  • denial prints the same table as the plan's (persist +0.060, chain -0.000 against persist, timed -0.730 and -0.350, Hold -0.441, Home -0.807 and -0.272).
  • App, in the real window: sim001_command --expect --only proposal --no-cameras: 4 of 4 pass.
  • SITL: cargo test --release -p recreation_towers_server --test acceptance, two games, lookahead as station advisor on both sides: both play to the end, both teams take towers (Blue 1, Red 2; Blue 2, Red 1), 91 proposals and 61 taken, then 86 and 44. Fails "No drone crashes" (7, 3: the known failure); in the first game also "commands refused are 0" (1; 0 in the second game, not investigated).

🤖 Generated with Claude Code

… Claude advisor, accept in the app

Each advisor runs on a thread of its own at the station behind a mailbox (newest map and hand in,
older ones dropped, stale proposals dropped on arrival). A computer commander on a seat takes what
has arrived with Commander::advise and never waits; its built-in lookahead is off and the lookahead
runs as a station advisor. ProcessAdvisor/serve/towers_advisor put any Advise in another process
(JSON lines; a process that dies, hangs or writes nonsense is dropped with a line); towers_advisor
--claude asks claude -p (never run by a test). Flags: towers_commander --advisor, towers_server
--blue-advisor/--red-advisor, the app's --advisor. The app's ADVISOR panel lists live proposals and a
click or Y gives that order. Expectations in 09-towers/05-advice.expect, driver taught.

Co-Authored-By: Claude <noreply@anthropic.com>
@ptescher
ptescher changed the base branch from actors-advisors to master November 15, 2026 02:49
@ptescher
ptescher merged commit e804504 into master Nov 15, 2026
2 checks passed
@ptescher
ptescher deleted the actors-advice-seat branch November 15, 2026 05:36
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.

1 participant