mirror of
https://github.com/razzant/ouroboros.git
synced 2026-10-02 19:58:46 +00:00
State only what a pending promote row proves
The delta review caught the new pending sentence asserting a cause: 'if the row is still pending minutes later, the event did not land'. A promote that prepares a source stays pending, untouched, for as long as the clone runs (up to CLONE_TIMEOUT_SEC = 900 s), so a model following that sentence would mint a second id while the first was alive, which is the duplicate-root class this package cures. The sentence now gives the two times, the longest honest wait and the fact that a new promote is a new id, and leaves the judgement to the model.
This commit is contained in:
parent
86a920aa6c
commit
cb24383afd
2 changed files with 12 additions and 6 deletions
|
|
@ -197,6 +197,7 @@ def _get_task_result(
|
|||
status="unavailable", code="LEGACY_UNAVAILABLE",
|
||||
text=f"Task {task_id}: unknown or not yet registered",
|
||||
))
|
||||
from ouroboros.project_sources import CLONE_TIMEOUT_SEC
|
||||
from ouroboros.routing_wait import is_emitted_admission_stub
|
||||
|
||||
if is_emitted_admission_stub(data):
|
||||
|
|
@ -210,9 +211,10 @@ def _get_task_result(
|
|||
text=(
|
||||
f"Task {task_id}: admission pending since {since} (now {utc_now_iso()}) - the promote "
|
||||
"was emitted and this row carries no supervisor receipt yet, neither scheduled nor "
|
||||
f"refused. Read get_task_result({task_id}) again before promoting the same work: the "
|
||||
"supervisor answers within seconds of draining its queue. If the row is still "
|
||||
"pending minutes later, the event did not land and a new promote is the way forward."
|
||||
f"refused. Read get_task_result({task_id}) again before promoting the same work: a "
|
||||
f"promote that prepares a source can stay pending for up to {CLONE_TIMEOUT_SEC // 60} "
|
||||
"minutes. A new promote is a NEW task id; this row does not forbid one, and whether "
|
||||
"this one is lost is yours to judge from the two times above."
|
||||
),
|
||||
))
|
||||
if bool(include_authority) or bool(include_work_order_source) or bool(include_completion_source):
|
||||
|
|
|
|||
|
|
@ -309,8 +309,9 @@ def test_the_attachment_refusal_without_a_stub_still_writes_no_result(swarm_host
|
|||
|
||||
def test_the_pending_sentence_never_forbids_a_new_promote_for_ever(tmp_path, _short_confirmation_window):
|
||||
"""The row proves one thing: emitted, no receipt yet. An event can be lost (a
|
||||
supervisor restart drops its in-memory queue), so the sentence hands the
|
||||
decision back with the facts instead of a standing ban."""
|
||||
supervisor restart drops its in-memory queue) and a source can take minutes to
|
||||
prepare, and the row cannot tell the two apart; so the sentence gives the facts
|
||||
and hands the decision back, with neither a standing ban nor an invented cause."""
|
||||
from ouroboros.tools.control_routing import _promote_chat_to_task
|
||||
from ouroboros.tools.control_task_results import _get_task_result
|
||||
|
||||
|
|
@ -321,4 +322,7 @@ def test_the_pending_sentence_never_forbids_a_new_promote_for_ever(tmp_path, _sh
|
|||
read = _get_task_result(ctx, task_id)
|
||||
assert "admission pending since" in read and f"get_task_result({task_id})" in read
|
||||
assert "do not promote the same work a second time" not in read
|
||||
assert "did not land" in read and "new promote" in read
|
||||
# Facts only: the row cannot tell a lost event from a source still being prepared,
|
||||
# so the sentence names the longest honest wait and leaves the judgement to the model.
|
||||
assert "did not land" not in read and "within seconds" not in read
|
||||
assert "can stay pending for up to 15 minutes" in read and "NEW task id" in read
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue