Milestones and review in the new loop (M2.1, PR C)
CI / checks (push) Skipped
CI / checks (pull_request) Successful in 1m48s
CI / checks (push) Skipped
CI / checks (pull_request) Successful in 1m48s
A work item starts from a fresh workspace: fetch, set aside (never discard) leftover changes, branches and unpushed commits, a clean default branch, and a branch of its own (D3, #62). start_milestone cuts the milestone's branch; finish_milestone commits only the work, pushes and opens a PR that closes the issue, under an intent, adopting an open PR and treating a closed one as the operator's answer (D4). Between runs the loop watches each item's PR: operator comments and inline review notes (#69) reach the item, a merge or close hands back to the driver. A review fix is checked after it's pushed and goes out as a new PR if the PR merged first (D5). At boot an interrupted publish is settled against Gitea (L8). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPQ14L3LikyefCMFBqEbKE
This commit is contained in:
1 parent
f84bb70839
commit
21744efac1
9 files changed
+1004
-10
No files matched your search
@@ -7,6 +7,7 @@ go to the build VM (L13); control tools are answered here, and a waiting one
|
||||
ends the run, so the scheduler can put it to the operator.
|
||||
"""
|
||||
|
||||
from collections.abc import Callable, Mapping
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Literal
|
||||
|
||||
@@ -55,7 +56,12 @@ class Driver:
|
||||
system: str,
|
||||
tools: list[dict[str, Any]],
|
||||
workspace: Workspace | None,
|
||||
handlers: Mapping[str, Callable[[dict[str, Any]], tuple[str, bool]]]
|
||||
| None = None,
|
||||
) -> RunOutcome:
|
||||
"""``handlers`` answer control tools that don't end the run (e.g.
|
||||
start_milestone): each returns a result and whether it succeeded."""
|
||||
handlers = handlers or {}
|
||||
offered = names(tools)
|
||||
nudged = False
|
||||
for turn in range(self._max_turns):
|
||||
@@ -95,7 +101,9 @@ class Driver:
|
||||
transcript, calls[index + 1 :], "not run: the turn had ended"
|
||||
)
|
||||
return RunOutcome("wait", call.tool, dict(call.arguments))
|
||||
if call.tool not in offered or workspace is None:
|
||||
if call.tool in handlers and call.tool in offered:
|
||||
result, ok = handlers[call.tool](dict(call.arguments))
|
||||
elif call.tool not in offered or workspace is None:
|
||||
result, ok = (
|
||||
f"no such tool: {call.tool}; the tools are "
|
||||
+ ", ".join(sorted(offered)),
|
||||
|
||||
Reference in new issue
Block a user