Repository navigation
spec(t27os): ladder_task.t27, the state of one task while the ladder walks its rungs (Refs #13036) - #13116
Merged
Conversation
…walks its rungs (Refs #13036) A step down the provider ladder is SWITCHING_PROVIDER, not a failed task. The record keeps the first and the last refusal (rung, status, class) as they came, so no refusal is renamed. - Six states: RUNNING, SWITCHING_PROVIDER, WAITING_CAPACITY, WAITING_CREDENTIALS, FAILED, CANCELLED. - No refusal status makes a task FAILED. Only a tool action that ran EFFECT_RUN_LIMIT times with no result does (control.t27 DO_GIVE_UP). - One owner line per state. It names the cause, the rung and the next step, and shows a reset time only when the provider gave one. No line promises a fix for a cause that is not established. - An event (capacity back, key added) asks for one check through the same path. Only the Doctor's control_outcome RESOLVE resumes the saved request. Without events, checks follow waits.t27 (30, 60, 120, then every 240 s) and stop at WAIT_MAX_SECONDS. - A partial answer is kept for diagnostics and never glued to another rung's answer. A break during a tool call resumes through the effect journal of control.t27: a done action is skipped, a journaled one is looked up first, and an external one that may have run is held for the owner. - The owner's Stop is final. Only rungs in the allowed mask are sent, checked or woken. The Doctor's classes, walk and control check are imported, not copied. Choices C1-C8 are listed in the header, each open to the owner. Not in this commit: an event source (keys.t27 has no key-added event, and the PTY journal waits on #13088), the glue that acts on TA_* actions, and the window. This spec is a contract; nothing runs it yet. Tests: t27c test-report on this tree gives 12 tests, 12 pass, FAIL 0, vacuous 0 of 12, rc 0 (t27c built 2026-11-01 17:40, typed by the owner into T27 OS shell pane 15 on the Mac, 2026-11-02 18:35 local). Negative control: a scratch copy with task_wake's CAPACITY_BACK branch returning TA_NONE instead of TA_CHECK gives 11 pass, FAIL 1 (a_capacity_wait_is_checked_on_a_bounded_schedule_and_ends_at_the_wait_limit), rc 1. Only that test reaches the branch; the plain WAITING_CAPACITY event path has no assertion in this commit. dupe_scan: no new duplicate body. Refs #13036 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#13036) The negative control on 8524910 showed that only test 11 reached task_wake's CAPACITY_BACK branch, and only for a wait that had expired. Test 4 now sends LE_CAPACITY_BACK for rung 1 while the task is WAITING_CAPACITY and asserts that the event asks for one check (TA_CHECK). Tests: t27c test-report gives 12 tests, 12 pass, FAIL 0, vacuous 0 of 12, rc 0 (t27c built 2026-11-01 17:40, typed by the owner into T27 OS shell pane 15 on the Mac, 2026-11-02 18:40 local). Negative control: the same branch returning TA_NONE gives 10 pass, FAIL 2 (tests 4 and 11), rc 1. Refs #13036 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This was referenced Nov 2, 2026
Merged
Merged
Merged
This was referenced Nov 15, 2026
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
specs/t27os/ladder_task.t27is the state of one task while the provider ladder walks its rungs.The owner's order of 2026-11-02, translated:
Contents
control_outcomeRESOLVE resumes the saved request.There are 12 tests:
Receipts
Test run.
t27c test-report specs/t27os/ladder_task.t27on head afa6123.Negative control.
an_exhausted_ladder_waits_for_capacity_and_resumes_on_the_rung_that_passes_a_checka_capacity_wait_is_checked_on_a_bounded_schedule_and_ends_at_the_wait_limitOther checks.
Not in this PR
Refs #13036
🤖 Generated with Claude Code
Note
Low Risk
New specification and tests only; no production runtime or wiring is changed, and behavior is validated by the included t27c tests.
Overview
Adds
specs/t27os/ladder_task.t27, a new T27 contract for one task’s state while the provider ladder runs—complementingladder_doctor(classification/checks) with persistence, transitions, owner messaging, and glue actions (TA_*).A 24-cell record drives six states (
RUNNINGthroughCANCELLED). Ladder steps become switch or wait, not failure;FAILEDonly whencontrol.t27hitsDO_GIVE_UP. Refusals are stored as-is;status_line/diag_linegive JSON-safe owner text (no “out of tokens”). Waits split capacity (time-clearing classes +waits.t27rechecks up toWAIT_MAX_SECONDS) vs credentials (owner-needed classes). Events trigger Doctor checks; only RESOLVE resumes the saved request. Partial answers stay diagnostic-only; tool breaks resume via the effect journal (including HOLD for ambiguous external actions). Stop is terminal; traffic stays inside the allowed rung mask.The spec imports Doctor,
waits, andcontrol(no copies) and ships 12 tests covering the owner order, mask, schedules, and buffer bounds. It is a contract only—no runtime glue in this PR (refs #13036).Reviewed by Cursor Bugbot for commit bb7c1b0. Bugbot is set up for automated code reviews on this repo. Configure here.