Skip to content

Programs: a programs table, the program column, program propose and the implicit waits (T337) - #282

Merged
erickb336 merged 14 commits into
mainfrom
sage/t337-programs
Oct 20, 2026
Merged

erickb336 merged 14 commits into
mainfrom
sage/t337-programs

Conversation

@erickb336

Copy link
Copy Markdown
Owner

What this is

PR 2 of 3 of programs (T337). A program groups the tasks of one goal, with one pilot task, and the state tool holds its rules in code. PR 1 (T336, waits) is merged; PR 3 (T233, the board views) comes next and is not in this PR.

What you can do now

  • Ask the sage for a program. It runs sage program propose --name <name> --goal <goal> --pilot <T>, which opens one gate on the pilot task: approve, change or drop the breakdown. Today's board already shows that gate under "Needs you".
  • Tasks join with task add --program PG1 or task <T> set program=PG1 (program=none takes one out).
  • Until you approve, no task of the program builds or merges. After you approve, the pilot builds first, and each other task waits for the pilot. Design and PE runs go on.
  • status shows each program with its progress:
$ sage status          (sample data: PG1 approved, its pilot T1 building; PG2 just proposed)
gates   1 open · G2 Approve the breakdown of PG2 Lead build (pilot T4)? Goal: One lead runs each pull request. (default: none)
waits   3 waiting · T2 for T1 (building, the pilot of PG1) · T3 for T2 (framed), T1 (building, the pilot of PG1) · T4 for the breakdown of PG2 (open, gate G2)
programs 2 · PG1 Codex support 0 of 3 · PG2 Lead build 0 of 1, breakdown waits for you (G2)

$ sage run add T2 --role lead
sage: T2 waits for T1 (building, the pilot of PG1), so it takes no lead run: it starts after each of them is merged or concluded. Its design and PE may run.

The rules, and where they are

Rule Code Test (T337 in the name)
programs.tsv (id PG, name, goal, pilot, gate, at). A missing file reads as no rows while no task names a program, and is a loss when one does; logbook repair --accept-loss programs starts it again sheet, namesProgram "a logbook made before programs…", "a task that names a program without programs.tsv is a loss…"
The program task column through the ADDED rule; an older sage refuses to write a logbook with it ADDED, TABLES "an older logbook gets the program column…"
The state comes from the breakdown gate's answer, never a cell: proposed, active, done, changing, dropped (drop or the owner's own words), lost (no gate row) programState, programsLine "a program's state comes from its breakdown gate's answer…"
program propose and propose again: name, goal and pilot rules; an open or dropped breakdown refuses act case program "program propose refuses…"
The pilot stays in its program until a new pilot is proposed; program= refuses an unknown or dropped program and an ended task programValue "the pilot stays in its program…"
Implicit waits: the breakdown's approval, then the pilot. They go through T336's waitsMet and unmetWaits, so run add (also native run creation), the move to building, merged or concluded (also the native task update) and the merge check refuse with one function and name the fix waitsWithState, waitFix, until "each task of a program waits…", plus two Codex native tests in codex-server.test.mjs
The loop check counts each task's wait for its pilot noLoop, edgesOf "the loop check counts…"
A task that joins after the approval needs no new gate; the line tells the chief to tell the owner programDecision "a task that joins a program after…"
A lead run prints the reports of the tasks that its task waits for, for the brief run add "a lead run of a task that waits prints…"
The hook refuses an agent's shell write that names programs.tsv (the list comes from LOGBOOK_FILES) logbook-fields.mjs sage-hook-tests.mjs "T337: an agent's shell write…"
IDS reads program ids, so a lost program's id never comes back IDS, nextId "program ids are PG…"

Docs: the README usage guide (the rules table, What to say, what's new, with the update warning first), the chief's role and the Claude dispatch text, the Claude sage skill and the Codex command reference, sage help and the dictionary.

Checked

  • npm run build leaves git status clean; npm run check passes.
  • scripts/sage.test.mjs (whole file), the T337, program, K2 and S2 tests of scripts/sage-hook-tests.mjs, the T336 and T337 tests of scripts/codex-server.test.mjs, scripts/dictionary.test.mjs, scripts/lead-agent.test.mjs and scripts/providers.test.mjs. CI runs the full suite.
  • The 14 T337 tests fail on main (81191c0) and pass on this head.
  • main's sage refuses to write a logbook that this head wrote ("has columns that this version of sage does not know (program)"), and main's board reads it and shows the breakdown gate under Needs you.

Not in this PR

The board's program tag, Program filter, program page and chat section (PR 3, T233). Waits across logbooks or repositories (owner, 2026-10-19: not in v1).

🤖 Generated with Claude Code

erickb336 and others added 8 commits October 19, 2026 06:47
…e implicit waits (T337)

A program groups the tasks of one goal, with one pilot task. program propose
writes PG<n> to programs.tsv, sets the pilot's program, and opens a breakdown
gate on the pilot (approve, change, drop). The program's state comes from the
gate's answer, never from a cell: proposed, active (done when its tasks ended),
changing, dropped (drop or the owner's own words), or lost without the gate row.
program propose <PG> proposes again after change, or for a new pilot.

task add --program and task set program= (none takes a task out) refuse an
unknown or dropped program, an ended task, and the pilot leaving its program.
A task that joins after the approval joins with no new gate; the line tells the
chief to tell the owner, and the decision row says so.

Two waits that no cell holds: each task of a program waits for the breakdown's
approval, and after it each task but the pilot waits for the pilot. They go
through the T336 waits rules, so run add (also native run creation), the move to
building, merged or concluded (also the native task update) and the merge check
refuse with one function and name the fix. The loop check counts the pilot links.

The programs table came later: a missing programs.tsv reads as no rows while no
task names a program, and is a loss when one does; logbook repair
--accept-loss programs starts it again. The hook's file list gets it through
LOGBOOK_FILES. IDS reads program ids, so a lost program's id never comes back.
status gets a programs line, and a lead run prints the report paths of the
tasks that its task waits for, for the brief.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ge skills and the dictionary (T337)

The rules table, the What to say table and the what's-new list describe
programs, with the update-and-restart warning first. The chief's role says when
to make a program and how to ask its breakdown gate, and that a task that waits
gets the final reports of its upstream tasks in full in CONTEXT; the Claude
dispatch text says to read the reports that run add --role lead prints. The
Claude skill's command table and the Codex command reference give program
propose, task add --program and task set program=. The dictionary no longer
marks the program words as coming.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…names a program's waits (T337)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep both sides: the findings run and class columns, finding classes,
tokens on done review runs, the run-ends-once rule and sage stats from
T346; the programs table, the task program column, program propose and
the programs status line from T337. ADDED, COMMANDS and IDS list both;
the README and the sage skill keep both rows and both what's-new entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e before the answer (T337)

- program propose takes --tasks: the gate's question names each task with its
  title and what it waits for, ends the goal with a full stop, and a
  re-proposal says its round (R1205-1, R1209-3).
- A breakdown gate answers once; other gates keep a new answer (R1208-1). The
  owner's own words read as changing, not dropped.
- No task leaves a program before the owner approves or drops it (R1204-1); a
  started task does not join one (R1208-2).
- A pilot wait is met only when the pilot is merged or concluded (R1204-3).
- The state reads only from a breakdown gate on the pilot; duplicate PG ids
  fail the integrity check (R1208-3). A name of the form PG<n> is refused
  (R1210-2).
- The loop refusal names the wait to clear, and status says when a pilot was
  abandoned (R1209-4). The status line keeps done and dropped programs, with
  the unit and the pilot, and groups tasks once (R1208-5, R1209-3).
- waits joins IDS.tasks; nextId loses its dead guard (R1203-1, R1203-2,
  R1207-2). Copy: R1205-2, R1206-2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…or the pilot, quoted text, what changed, ended tasks stay (T337)

- R1215-1: task set program= and task add --program refuse a join while the breakdown gate is open.
- R1217-1: a started task joins an approved program only after its pilot is merged or concluded.
- R1217-4: the name, goal and titles go in quotes with no character that can end them.
- R1218-2: a re-proposal's gate says what changed since the last round.
- R1219-1: ended tasks stay in the program on a re-proposal with --tasks.
- R1212-2: answer-once finds a breakdown gate by a program's gate cell.
- R1216-1: tests for the offPr pilot guard, the programsLine count guard and the latest upstream run;
  the dead noLoop call in task add is gone; R1208-5 measures CPU time in-process.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…answers once, one quote rule, leave note (T337)

- R1222-2: remove the changed-since line from the question and the decision row, and its code.
- R1224-1: a breakdown gate answers once also after a newer round replaced it. Breakdown gates
  are the gates named by decision rows with why "program propose"; sage log refuses that why.
- R1222-1: every quote-like mark becomes an apostrophe and every line or paragraph break a space.
- R1226-2: the status programs line and the first decision row quote the program name.
- R1226 (b): a task that leaves an approved program gets the tell-the-owner note.
- R1228 (B): an ended pilot's refusal asks for a new pilot with --pilot.
- R1225-2: tests for concluded and abandoned pilots, programs.id in IDS, and the nextId lookbehind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
erickb336 and others added 6 commits October 19, 2026 18:56
…answer once after a decisions loss (T337)

- R1222-1: quote() keeps only letters, digits, a combining mark after a letter or
  digit, the space, the apostrophe and . , : ; ! ? ( ) / - & + #. Each other
  character becomes a space; a run of apostrophes becomes one. The deny list is gone.
- R1235-1: program propose writes programs, tasks, gates, then decisions, so a stop
  between two writes leaves no open gate whose tasks can build, also on a new
  proposal of an approved program.
- R1233-1: a gate that a program's row names answers once, also after an accepted
  loss of decisions.tsv.
- R1231-2: task add refuses the why "program propose", with the same check as sage log.
- R1234-1: tests for the why check, a gate G10, and the ended-pilot hint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…aces in a quote (T337)

quote() turns each character of U+02B0 to U+02FF into a space, as one range
in the same regex, so the look-alikes of a double quote (U+02BA, U+02EE) no
longer pass as letters. A combining mark after one of them is a space too.
Japanese long-vowel and repeat marks (U+30FC, U+3005) still print.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lines, with no quotes (T337)

- R1222-1, R1240-1, R1241-1, R1245-1: the question has one part on each line: the fixed first line
  "Approve program PG<n>? No task builds before you approve.", then Name:, Goal:, the pilot and each other
  task after its id, with its waits other than the pilot or its ended state in brackets at the end. Each
  title, name and goal prints as written; a line break prints as a space. quote() and its allow-list are gone.
  The table cell holds the lines with U+2028 (LINE), which no title can hold; the chat board, the text board
  and the HTML card show each line. The status shows one line per program, with the name last after "name:".
- R1240-2: a breakdown gate is one whose question starts with that first line, which only program propose
  writes (gate add refuses it). So every breakdown gate answers once, also after a stop between writes and
  after a loss of decisions.tsv, and the round counts the program's earlier breakdown gates. ownWhy is gone.
- R1242-3: an ended task neither joins nor leaves a program.
- R1246-2: a propose that stopped before it wrote its gate is finished by the same command.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tags before a colon; a drop survives a lost gates table (T337)

- gate add makes the question one line (every line break a space), and status and every board surface split only a
  question that proposalOf marks as a breakdown gate (gateLines in logbook-fields) (R1249-1).
- gate add refuses "Approve program" also after blank, mark or symbol characters and with Cyrillic or Greek look-alikes (R1249-2).
- A task line of the breakdown question is "  T3 [merged]: title", so a title cannot pass for a tag; status shows a
  breakdown gate's first line and "(breakdown, N tasks)" (R1249-3).
- program propose reads the owner's drop answer from the decisions after a lost gates table (R1249-4).
- A lost breakdown gate names program propose as the pilot's fix (R1255-1); a propose after a stop writes the move row
  of each member that has none (R1255-2); an ended task of another program gets the ended-task refusal (R1248-1).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…et (R1258-1, R1259-1)

gate add flattens --options, --recommend and --default with the question's rule,
so a plain gate's option shows on one line on the card, the text board, the chat
board and status. In the breakdown question, a wait on an abandoned or lost task
shows its state and "never met", as status does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he pilot's PR (R1269-3, R1266-1, R1266-2, R1273-1, R1270-1)

- program propose writes a move row only for a real change of a task's program
  cell; after a stopped proposal, from what the decision rows say (both ways).
- programState reads a drop row when the gate is lost, so every caller sees dropped.
- setPr refuses the pilot's PR for another task of an approved program before
  the pilot merges or concludes (task set pr= and verdict --pr).
- Tests for each, and for the proposalOf anchor and the readsAsBreakdown strip.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@erickb336
erickb336 merged commit bbde196 into main Oct 20, 2026
1 check passed
@erickb336
erickb336 deleted the sage/t337-programs branch October 20, 2026 07:30
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.

1 participant