Repository navigation
Conversation
…me its target Two changes take the owner out of every step of an officer's hand-off but the decision itself. Phone buttons, officer tasks only. The approval card of an agent start on a task a built-in officer filed is pushed to the paired phone with exactly two signed buttons, Approve and start and Don't start (ask_answer per option; no inline answer, no Dismiss: push.Payload.AskOptionsOnly), and an expanded body naming the task, where it runs, the repository and the brief's first line. The answer path takes exactly those two answers from the device door (approvalSurfaceRefusal, phoneAnswerable) and completeHeld takes them as a tap (phoneApprovable); every other approval card keeps refusing the phone. The start stays bound to the hold's hash. The officer names the target. officer_task_handoff takes optional target (pod/claude-code, or host/<host>/claude with repo) and repo, checked against the owner's targets now (unknown or unavailable host, a blank, a runtime that needs a model: refused, nothing picked in its place, nothing recorded). With a target, muster files the held dispatch and the owner's card itself (agent_dispatch as the chief, a brief built from the task, no chief turn), and completes the owner's answer from its delivery (completeHandoffCard): agent_dispatch again with the arguments rebuilt from the hold, so every guard of a start runs. An approval of a hand-off card whose task changed since is refused on every door before it is recorded. A card muster cannot file undoes the hand-off. Without a target the chief's turn is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… task The task-text seam ledger (task_kickoff_ledger_test.go) caught handoffBrief copying the task's title and body into the agent's brief, outside the kickoff rule that every start on a task goes through. The brief is now muster's words and the officer's one line only; the task's title and text reach the agent after it through taskKickoffText, as on every start. The hand-off card shows the task's title and text instead (the first 1,500 characters; the whole task is on the board) and binds them with a hash of the task (handoffCard.TaskHash): an approval of a card whose task changed since is refused on every door before it is recorded, and the completion refuses a change that lands between the answer and the start. Both readers are ledgered as never reaching an agent. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
What this changes
An officer's capture task can wait hours on an approval card that its owner only hears about through a notification with no buttons, and only after a chief turn that repeats what the officer already decided. This PR implements two owner decisions that cut the owner's part down to the decision itself.
1. Phone buttons, for officer tasks only
heldDetail.OfficerTask) now reaches the paired phone with exactly two signed buttons: Approve and start and Don't start. Each is anask_answerper option, confirmed with the phone's step-up key. There is no inline Answer, no Dismiss and no suggestion (newpush.Payload.AskOptionsOnly,internal/push/service.go). This uses the existing action ids, so no app change is needed: the app already draws the buttonsactionsnames.Task #<id>: <title>,On: <where>,Repo: <repo>, and the brief's first line (or the officer's reason for a hand-off). The title isStart an agent? · <officer>. The challenge'sconfirmscarries the same text, so the step-up prompt shows what the tap decides. Tapping the body still opens the whole card.approvalSurfaceRefusal→phoneAnswerable,internal/api/dispatch_approval.go).completeHeldtreats them as a tap (phoneApprovable,internal/api/host_dispatch.go).2. The officer names the target
officer_task_handofftakes optionaltarget(pod/claude-code, orhost/<host>/claudewithrepo) andrepo(internal/api/officer_task_handoff.go).The target is checked against what the owner has now (
handoffTargetRefusal). The call is refused in plain words, with the owner's current targets listed, for:host/?/claude.../opencode,pod/gateway)repogiven without a targetNothing is picked in the target's place. A refused target records nothing, so neither the task's single hand-off nor the day's 3 is spent.
With a target, muster files the held dispatch and the owner's approval card itself, with no chief turn. It does this by calling
agent_dispatchas the chief (fileHandoffCard). That runs the same guards: the owner's opt-in, the chief caps, and the 6-cards-an-hour cap.muster writes the brief itself (
handoffBrief): which officer handed the task off, and the officer's reason. The brief carries no task text. The task's title and body reach the agent after the brief through the kickoff rule (taskKickoffText), as on every start on a task. The task-text seam ledger enforces this.The card says the officer handed the task off, shows the brief in full, and shows the task's title and body (the body cut at 1,500 characters; the whole task is on the board). The hand-off row is stamped delivered before the card is filed, so the sweep never passes it to the chief. If the card can't be filed (hourly cap, repository not connected, task too long), the hand-off is undone (
builtin.DeleteHandoff).muster completes the owner's answer itself, with no chief turn and whether or not the chief is running (
completeHandoffCard, called fromdeliverAnswerininternal/api/attention_delivery.go). It callsagent_dispatchagain as the chief, with the arguments rebuilt from the hold and the task. That meanscompleteHeldjudges the stored rows exactly as it would for the chief's own call: single use, hash-bound, every guard of a start. "Change repo" and the clone card work the same way. "Don't start" starts nothing and leaves the task on the board.Approving a changed task is refused. The card binds the task's title and body with a hash (
handoffCard.TaskHash). If either changed after the card was filed, Approve and start is refused on every door before anything is recorded, and the card stays open (handoffCardRefusal). A change that lands between the answer and the start is refused when muster completes the answer (completeHandoffCard).With no target, the hand-off behaves as before (a chief turn).
officerPushDispatchCardis a new decision row inofficerPushes. The push ledger records the new call sites (officerCardFiledanddispatchCardFiled).Docs
docs/officers-builtin.md: new sections "Naming the target: a card with no chief turn" and "Approving an officer's task from the phone".docs/push.md: payload v2, and the officer table.docs/chief.md: the approval card's one exception.docs/officers.md: the tool row.docs/schema.md: whatchief_turn_atmeans for a target hand-off.How it was tested
Local runs, each once and at low priority, against a throwaway Postgres (
MUSTER_TEST_REQUIRE_DB=1):internal/api/officer_card_pg_test.goandTestAnOptionsOnlyAskOffersItsOptionsAloneininternal/push;dispatch_approval*,officer_task_handoff_pg_test.go,team_dispatch*,device_actions*,stepup_gate_test.go,officer_push*,host_dispatch*,attention_delivery*,hold_lapse*,clone_choice*and the succession ledger;go test ./internal/push/ ./internal/officers/;tests/leakscan.py(clean) andtests/features_config_test.py(OK).The whole suite, e2e and the other gates are CI's.
Red/green matrix
On
origin/main(d6bc8b1) the new test files do not compile: the tool'starget/repo,heldDetail.Handoff,AskOptionsOnlyand the new helpers don't exist there. That makes a compile failure the only red main can show. To show behavioural red, each new test was also run against a mutant that puts back main's behaviour for exactly one piece. M0 is the unmutated tree, and every test in it was green. Each mutant was applied in place, run once and reverted, and a checksum of the tree was compared before and after.TestAnOfficersTaskCardsPushHasItsTwoButtons(two buttons on an officer card; control: no buttons on an ordinary card)TestAPhoneApprovesOnlyAnOfficersTaskCard(device approve of an officer card starts it; device approve of a non-officer card refused; device Change repo refused)completeHeldrefuses a device answer (main)TestAPhoneApprovalOfAChangedBriefIsRefused(changed brief refused after a phone approve; a changed hand-off task's phone approve refused with the card left open; control: an unchanged one starts)TestAPhonesDontStartLeavesTheOfficersTaskOnTheBoard(device Don't start, on the chief's card and on a hand-off card; task stays open; no chief turn)TestAHandOffWithATargetFilesTheCardWithNoChiefTurn(pod and host: card filed directly, no chief turn, an in-app tap starts it with no chief turn; the spawned agent gets the brief and then the task)TestAHandOffTaskChangedAfterTheAnswerIsNotStarted(task edited between the recorded answer and muster's completion: not started; control: unchanged, started)TestAHandOffToATargetTheOwnerLacksIsRefused(unknown, offline, needs-model, blank, no-repo and unknown-pod targets refused; nothing recorded; control: a real target then works)TestNoPathStartsAHandedOffTaskWithoutTheOwnersApproval(always-card rule: the chief completing the request, a typedowner_asked, completing the open card: nothing starts; the approval starts exactly one; a capped card undoes the hand-off)TestAHandOffWithoutATargetStillStartsAChiefTurnTestAnOptionsOnlyAskOffersItsOptionsAlone(push package: two buttons only, also after the 4 KiB refit; control: an ordinary ask keeps Answer and Dismiss)AskOptionsOnlyignored), P2 (refit puts the buttons back)What I could not do, and decisions to check
AskPush.buttons()draws exactly whatactionslists), not exercised on a device.Checklist
make leakscanpasses (rantests/leakscan.py).main(main merged in at 217a792).CI round 1 failed one test,
TestEveryTaskTextReaderIsClassifiedAndEveryKickoffIsFenced: the first version copied the task text into the brief. That is fixed in 2469922 as described above, and the mutation battery was re-run after the fix.🤖 Generated with Claude Code