nisse-review: a review refused for an open point posts once the point is answered
On #166 the reviewer called post_review with two points unanswered, was refused, answered them, then only skipped already-answered points until the 40-turn cap: the review went out as partial, its summary lost. A refused ending call is now held, and the driver ends the run with it as soon as the last point is settled (a new due hook in nisse-core's driver; nisse-dev doesn't use it). A held call that is wrong for another reason by then (sign_off over drafted comments) is left to the model. With nothing open, reply and skip say which tool ends the run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
This commit is contained in:
1 parent
be81adc185
commit
26ef125d1e
5 files changed
+221
-22
No files matched your search
@@ -409,3 +409,69 @@ def test_review_with_a_comment_beside_it_is_one_fresh_review(tmp_path: Path) ->
|
||||
known = pr_of(item(w))
|
||||
assert (known.full, known.fresh, item(w).position) == (False, (), REVIEWED)
|
||||
assert w["scheduler"].round() is False # nothing more due
|
||||
|
||||
|
||||
# --- a held ending call (the run on #166 at bf98445) --------------------------------
|
||||
|
||||
|
||||
def later_with_a_point(tmp_path: Path, *turns: list[Any]) -> dict[str, Any]:
|
||||
"""A push and an answer on its line since its first review: a later run
|
||||
with P1 to answer."""
|
||||
w = reviewed(tmp_path, *turns)
|
||||
push(w)
|
||||
w["gitea"].note("nisse-dev", "split() is fine: no tabs here.", "count.py:2")
|
||||
return w
|
||||
|
||||
|
||||
def test_a_review_refused_for_an_open_point_posts_once_it_is_answered(
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
# The model posted with P1 open, answered it, then only skipped answered
|
||||
# points until the turn cap: the review went out partial, its summary lost.
|
||||
loop = [[call("skip", point="P1", reason="already answered")]] * 5
|
||||
w = later_with_a_point(
|
||||
tmp_path,
|
||||
[call("post_review", summary="Both commits do what they say.")],
|
||||
[call("reply", point="P1", text="Fair: conceded.")],
|
||||
*loop,
|
||||
)
|
||||
assert w["scheduler"].round() is True
|
||||
review = w["gitea"].posted[-1]
|
||||
assert "Both commits do what they say." in review["body"]
|
||||
assert "partial" not in review["body"].lower()
|
||||
assert item(w).position == REVIEWED
|
||||
model = w["scheduler"]._reviewer._driver._client
|
||||
assert len(model._turns) == 5 # none of the skips ran
|
||||
told = str(model.seen[-1])
|
||||
assert "Your post_review is held" in told
|
||||
|
||||
|
||||
def test_a_held_sign_off_waits_if_comments_were_drafted_since(tmp_path: Path) -> None:
|
||||
# Held while P1 was open, but a drafted comment needs post_review now:
|
||||
# the harness doesn't sign off over it; the model posts instead.
|
||||
w = later_with_a_point(
|
||||
tmp_path,
|
||||
[call("sign_off", summary="All good.")],
|
||||
[call("comment", path="count.py", line="2", text="One more thing.")],
|
||||
[call("reply", point="P1", text="Agreed.")],
|
||||
[call("post_review", summary="One more point.")],
|
||||
)
|
||||
assert w["scheduler"].round() is True
|
||||
review = w["gitea"].posted[-1]
|
||||
assert "One more point." in review["body"]
|
||||
assert ["One more thing." in c.body for c in review["comments"]] == [True]
|
||||
|
||||
|
||||
def test_with_nothing_open_a_skip_says_how_to_end(tmp_path: Path) -> None:
|
||||
w = later_with_a_point(
|
||||
tmp_path,
|
||||
[call("reply", point="P1", text="Agreed.")],
|
||||
[call("skip", point="P1", reason="again")],
|
||||
[call("post_review", summary="Done.")],
|
||||
)
|
||||
w["scheduler"].round()
|
||||
model = w["scheduler"]._reviewer._driver._client
|
||||
assert "every point said to you is answered or skipped. End your run with" in str(
|
||||
model.seen[-1]
|
||||
)
|
||||
assert "post_review" in str(model.seen[-1]).split("End your run with")[1]
|
||||
Reference in new issue
Block a user