Skip to content

spec(t27os): ladder_task.t27, the state of one task while the ladder walks its rungs (Refs #13036) - #13116

Merged
gHashTag merged 3 commits into
masterfrom
lane/ladder-task-states
Nov 17, 2026
Merged

gHashTag merged 3 commits into
masterfrom
lane/ladder-task-states

Conversation

@gHashTag

@gHashTag gHashTag commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

What

specs/t27os/ladder_task.t27 is the state of one task while the provider ladder walks its rungs.

The owner's order of 2026-11-02, translated:

  • A step down the ladder is a switch or a wait, not a failure.
  • FAILED appears only when the task truly cannot continue.
  • The first refusal's cause stays in diagnostics and is never renamed "out of tokens".
  • Owner lines follow the state.
  • Resume runs on events, with bounded retry.
  • Six cases never lose the result.

Contents

  • States. There are six: RUNNING, SWITCHING_PROVIDER, WAITING_CAPACITY, WAITING_CREDENTIALS, FAILED and CANCELLED.
  • FAILED. 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).
  • Refusals. The record keeps the first and the last refusal (rung, status, class) as they came.
  • Owner lines. There is one owner line per state. It names the cause, the rung and the next step. It shows a reset time only when the provider gave one, and it never promises a fix for a cause that is not established.
  • Events. 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.
  • Checks without events. Checks follow waits.t27 (30, 60, 120, then every 240 s) and stop at WAIT_MAX_SECONDS.
  • Partial answers. A partial answer is kept for diagnostics and is never glued to another rung's answer.
  • Break during a tool call. The task resumes through the control.t27 effect journal: 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.
  • Stop. The owner's Stop is final.
  • Allowed mask. Only rungs in the mask are sent, checked or woken.
  • Imports. The Doctor's classes, walk and control check are imported, not copied. waits.t27 and control.t27 are imported too.
  • Owner choices. C1-C8 are listed in the header, each open to the owner.

There are 12 tests:

  • the six cases of the order (refusal before the answer, break after a partial answer, break during a tool call, exhausted ladder, key added while waiting, manual Stop);
  • the allowed mask;
  • no allowed rung, and the rung-count clamp;
  • no refusal ever ends as FAILED;
  • an unknown or unwired refusal;
  • the bounded check schedule;
  • fixed record and line sizes.

Receipts

Test run.

  • Command: t27c test-report specs/t27os/ladder_task.t27 on head afa6123.
  • Result: tests 12, pass 12, FAIL 0, vacuous 0 of 12, rc 0.
  • t27c was built 2026-11-01 17:40. The owner typed the command into T27 OS shell pane 15 on the Mac, 2026-11-02 18:40 local.

Negative control.

  • A scratch copy (removed afterwards) returns TA_NONE instead of TA_CHECK from task_wake's CAPACITY_BACK branch.
  • Result: pass 10, FAIL 2, rc 1. The two failing tests:
    • an_exhausted_ladder_waits_for_capacity_and_resumes_on_the_rung_that_passes_a_check
    • a_capacity_wait_is_checked_on_a_bounded_schedule_and_ends_at_the_wait_limit
  • On the first commit, 8524910, the same control was caught only by the second of those tests. The plain WAITING_CAPACITY event path had no assertion there; afa6123 adds one to test 4.

Other checks.

  • No home paths and no non-ASCII lines in the spec.
  • No seal is saved. A seal needs a master-built t27c.
  • Lefthook pre-push printed "skip, no matching push files" for foreign-budget, own-language and secret-gate. That is not a pass, so the CI secret-scan is the check for secrets.

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—complementing ladder_doctor (classification/checks) with persistence, transitions, owner messaging, and glue actions (TA_*).

A 24-cell record drives six states (RUNNING through CANCELLED). Ladder steps become switch or wait, not failure; FAILED only when control.t27 hits DO_GIVE_UP. Refusals are stored as-is; status_line / diag_line give JSON-safe owner text (no “out of tokens”). Waits split capacity (time-clearing classes + waits.t27 rechecks up to WAIT_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, and control (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.

gHashTag and others added 2 commits November 2, 2026 18:37
…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>
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-11-02 11:51:56 UTC

Summary

Status Count
Total Open PRs 46
PRs with Failing Checks 42
PRs with All Checks Green 4
READY 2
FAILING 42
PENDING 0
NO CHECKS YET 0

These columns do not partition: 2 + 42 + 0 + 0 = 44, and there are 46 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=e75b498e5e79 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

This was referenced Nov 2, 2026
This was referenced Nov 15, 2026
@gHashTag
gHashTag merged commit 85d36d1 into master Nov 17, 2026
4 of 5 checks passed
@gHashTag
gHashTag deleted the lane/ladder-task-states branch November 17, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants