Repository navigation
Advisors beside the commander at a seat: process advisors, a Claude advisor, accept in the app - #135
Merged
Merged
Conversation
… 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>
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.
Step 4, second half of
plans/actors.md: advisors on the seat side.What changed
recreation_towers_ground::advisors).Runnerputs 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 callsCommander::advisewith what has arrived, after it shows the advisors the map andCommander::hand()(new). It never waits.Adviseis nowSend;ProposalandHandare serde types.ProcessAdvisor(command run withsh -c;towers_advisoris found beside the other binaries),servefor the other end, binarytowers_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(noneby default under--expect). Documented in the header comments anddomains/recreation/README.md.towers_advisor --claude [--model N] [--every S]. Every 8 s of game time it givesclaude -p(--output-format json,--max-budget-usd 0.25,--tools "", no session persistence, the session'sCLAUDE*/ANTHROPIC_BASE_URLvariables stripped as the league does, command fromSIM001_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);madeanduntilare stamped by the advisor.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 insection.expect, glossary, app driver taught the new steps.advice Blue: proposal .../taken ...lines andRESULT proposals/proposals_taken.Not done / not run
claude. It is tested only with stand-in commands (good, malformed, error, not-JSON, slow, missing). Theclaudeflags (--tools "",--max-budget-usd, ...) are from memory of the CLI, not checked against it.docs/were not regenerated.05-advicewere.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).Seat::acceptand 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.denialprints 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).sim001_command --expect --only proposal --no-cameras: 4 of 4 pass.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