Skip to content

T27 Ladder: t27-native serve loop so a merged ladder spec reaches the running service #13039

Closed

Description

@gHashTag

The T27 Ladder (loopback 3131, launchd job ai.t27.ladder) is served by a hand-written Node file kept outside the repository. specs/t27os/ladder.t27 holds only decision functions and constants (its header law 4 calls the endpoint "node plumbing"), and t27c gen-js specs/t27os/ladder.t27 prints 45 lines with no listener, no upstream call and no request handling. So a merged ladder spec (t27#13034, PR 13035, merged 2026-11-01) changes nothing in the running service: /health still lists the old rungs, and the old file imports no generated module. The PR text that said the glue is "regenerated with t27c gen-js after merge" names a step that does not exist.

The t27-native stage-2 router has the pieces up to the socket (router_sock.t27 bind bytes, router_serve.t27 request line and heads, t27#10782) and says the accept loop "rides later". This issue is that loop for the Ladder, so the running service can be built from specs and the hand-written file can be deleted.

Boundary

  • specs/t27os/ladder.t27
  • specs/t27os/ladder_serve.t27
  • specs/t27os/router_serve.t27

User Scenarios

  • Given a merged change to the rung table in ladder.t27, when the maintainer regenerates and restarts ai.t27.ladder, then /health lists exactly the rungs the spec names and no hand edit of any JS file was needed.
  • Given a request to POST /v1/chat/completions on 127.0.0.1:3131, when every rung refuses, then the 503 body names every tried rung and its class, as law 3 of the spec says.
  • Given a rung with no key wired, when the walk reaches it, then no network call is made and the rung is recorded as unwired (law 8).

Requirements

  • FR-001: ladder_serve.t27 MUST own the accept loop, the request parse, the per-call 90000 ms timeout and the walk over the rung table of ladder.t27, and MUST compile with t27c and test with t27b.
  • FR-002: The serve loop MUST bind 127.0.0.1:3131 only and MUST answer GET /health with the rung names read from the spec's table, not from a copy.
  • FR-003: The serve loop MUST keep the sticky start and the hedged first two rungs that the running service has today, and MUST add no new foreign-language file.
  • FR-004: Keys MUST be read from the Keychain account names of the key master, and no key value MUST appear in a log line, a test or a report.
  • FR-005: The change MUST land spec-only plus generated output; the hand-written file MUST be retired by deletion once /health and one 200 control request pass on the new service.

Success Criteria

  • t27b test specs/t27os/ladder_serve.t27 exits 0 with 0 vacuous passes.
  • /health of the new service lists 0 rungs named deepseek.
  • One control request through 127.0.0.1:3131 returns 200 within 120000 ms.
  • git diff --stat of the landing PR shows 0 added lines in any .js, .mjs, .py or .sh file.

Activity

  1. gHashTag commented on Nov 1, 2026

    @gHashTag
    CollaboratorAuthor

    Stage-1 snapshot of the candidate (reviewer note; the lane owns the file, nothing is switched).

    • File: specs/t27os/ladder_serve.t27 in the lane worktree, sha1 prefix 803af45e918a, 18 tests, not pushed yet (no branch on origin, no PR at 07:07Z).
    • Host: T27 OS shell-cell pane (agent 9), cwd = the lane worktree; no build or test on the Mac shell.
    • ~/t27/target/release/t27c test-report specs/t27os/ladder_serve.t27: tests 18, pass 16, FAIL 2, rate 88.9%, vacuous passes 0 of 16, exit 1.
    • ~/t27/target/release/t27b test specs/t27os/ladder_serve.t27 --check --quiet: runtime asserts 139, 16 passed, 2 failed, exit 1.
    • FAIL the_head_end_and_the_content_length_are_read_in_any_case: assert at line 622 (he + 15 == req.len).
    • FAIL thinking_goes_off_on_the_zai_head_unless_the_client_asked: index out of bounds at line 363 (body[cut_b .. inner_b], end of a slice of str).
    • The file was still being edited during the run (36,680 to 36,778 bytes), so this is a snapshot, not a verdict on the final candidate.

    What this means for the running Ladder: nothing changed. /health on loopback 3131 at 07:05Z still lists the rungs zai, ollama, deepseek with lastGood 0; the log shows rung=0 status=200 from 06:36 to 06:38Z and no request since, so the 200s are upstream recovery and the silence is idleness, not a fix. The serve loop becomes a candidate for the owner's switch decision only when both tools exit 0 with 0 vacuous passes on the pushed head; the switch itself and any edit of the running ladder.mjs or its launchd plist need the owner's separate word. Rollback for that step is the committed launchd plist plus the untracked current ladder.mjs copied aside before the switch; the .bak-20261027 file is older than the running version and is not a rollback.

  2. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec created: specs/tri/ladder.t27 (typecheck OK, 1 test passes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions