Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions src/agent_comms/commander/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
CommsChangeProblemTool,
CommsFireTool,
CommsOrderCheckTool,
CommsOrderDeliverTool,
CommsOrderDoneTool,
CommsOrderServeTool,
CommsOrderTool,
Expand Down Expand Up @@ -931,27 +930,6 @@ def run(self, ctx: Commander) -> None:
ctx.withdraw(self.pid, self.why, self.superseded_by)


@dataclass(frozen=True, kw_only=True)
class DeliverVerb(OrderVerb):
help = "record your delivery claim and answer the commander"
problem: Annotated[str, Argument(flags=("problem",), options={"metavar": "PROBLEM"})]
pull_request: Annotated[int, Argument(flags=("--pr",))]
head: Annotated[str, Argument(flags=("--sha",))]
report_file: Annotated[str, Argument(flags=("--report-file",))]

def gate(self, ctx: Commander) -> None:
ctx.comms.registry.require(self.who(ctx)).role.require_executable(
ValueError("A delivery claim requires a registered unit.")
)

def run(self, ctx: Commander) -> None:
ctx.call(CommsOrderDeliverTool(
problem=self.problem, pull_request=self.pull_request,
head=self.head, report=Path(self.report_file).read_text(),
))
print(f'{self.problem}: delivery claim recorded')


@dataclass(frozen=True, kw_only=True)
class DoneVerb(OrderVerb):
help = "Core checks the delivered commit; late delivery is a strike"
Expand Down
2 changes: 1 addition & 1 deletion src/agent_comms/skills/comms-commander/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Pick the next unit. Read its actual state, not its message: worktree, `git log -
One line per unit touched, then the next unit.

- **Handling an event is never where the turn ends; the next unit's state is.** Every wait is prep: pre-read the files the next order touches.
- **A unit records its delivery, not just a chat report:** `order deliver PROBLEM --fork UNIT --pr N --sha HEAD_COMMIT --report-file REPORT.txt` (or the native `comms_order_deliver` tool). Core stores Claimed and answers the commander. Only the holder may claim; the commander uses `order done UNIT PROBLEM --sha SHA` to accept it, or sends it back with corrected instructions. Claimed orders are not reissued on restart.
- **A unit records its delivery, not just a chat report:** the unit calls the native `comms_order_deliver` tool as itself. Core stores Claimed and answers the commander. Only the holder may claim; the commander uses `order done UNIT PROBLEM --sha SHA` to accept it, or sends it back with corrected instructions. Claimed orders are not reissued on restart.
- **A hunt is `order hunt FILE:LINE --why ... --sent PROBLEM`** (rules/send-backs-and-strikes.md says when).

## Slop is a defined term
Expand Down
11 changes: 6 additions & 5 deletions tests/test_order_claims.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""A holder claims through the real command/tool boundary on a copied bus."""
"""A holder claims through the real tool boundary on a copied bus."""
from contextlib import chdir
from dataclasses import replace
import json
Expand Down Expand Up @@ -32,6 +32,7 @@
held_commander,
pr_commander,
)
from test_proof_build import proof_build_checkouts # noqa: F401 - shared copied-bus fixture
from test_todos import order, thread


Expand All @@ -53,8 +54,7 @@ def test_claim_verdict_family_on_retained_copy(held_commander):
ThreadCaller(ctx.commander).invoke(request, comms)
assert comms.goals.todos.get("P1") == original

main(["deliver", "P1", "--fork", "worker", "--pr", "1", "--sha", sha,
"--report-file", str(report)], ctx)
ThreadCaller("worker").invoke(request, comms)
claimed = comms.goals.todos.get("P1")
assert isinstance(claimed.order, ClaimedProblemOrder)
assert not claimed.pending
Expand Down Expand Up @@ -104,8 +104,9 @@ def claimed_by_worker(ctx) -> Todo:
sha = ctx.repos[0].git(ctx.repos[0].checkout, "rev-parse", "HEAD").strip()
report = ctx.root / "report.txt"
report.write_text("The source change is published; inspect its actual diff before accepting it.")
main(["deliver", "P1", "--fork", "worker", "--pr", "1", "--sha", sha,
"--report-file", str(report)], ctx)
ThreadCaller("worker").invoke(CommsOrderDeliverTool(
problem="P1", pull_request=1, head=sha, report=report.read_text(),
), ctx.comms)
claimed = ctx.comms.goals.todos.get("P1")
assert isinstance(claimed.order, ClaimedProblemOrder)
return claimed
Expand Down
Loading