Skip to content

feat: label run sessions and give a refused campaign item one fix round - #85

Merged
Vzlentin merged 2 commits into
mainfrom
feat/label-run-sessions-and-give-a-refused-campaign
Nov 1, 2026
Merged

Vzlentin merged 2 commits into
mainfrom
feat/label-run-sessions-and-give-a-refused-campaign

Conversation

@Vzlentin

@Vzlentin Vzlentin commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Two follow-ups of the harness-next work.

  • Each session record of workflows.sessions gets an optional label, the agent profile it opened (planner, reviewer, ...). The harness catch-up shows planner #12 with it. The document stays at version 1: harness reads its own version-1 copy, and an optional field needs no bump.
  • A campaign item that ships with judge score 0 and has findings gets one fix round before its reset:
item ships, judge 0 + findings
  run("fix")  ->  implement on item + findings, judge start..HEAD again
     score > 0           -> squash into the item commit, keep its message, go on
     0 / blocked / failed -> reset to the item start, rundown + question with a "Fix round: ..." block
  • workflows/scripts/fix.js is its own child run, so a failed implement or judge inside it becomes a saved failed result. A resume replays it and runs no Git step again. A try/catch around run() in the campaign would save nothing and rerun the child after the reset.
  • Blocked, stopped, judgeError and no-findings items get no fix round. The squash is a lib helper, squash, shared with ship.

The workflows.sessions document did not say which agent profile
opened each session. The catch-up in harness needs that name to
label the sessions that it lists.

- `OpenedSession` gets an optional `label`. `sessionOf` writes the
  profile name (`planner`, `reviewer`, `default` and so on) as
  `label` when it adds the session record.
- The field is optional, so `SessionsDoc` stays at version 1 and
  `TASK.version` does not change. `endSessions` still reads the
  records that an earlier version saved, which have no `label`.
- docs/spec.md describes the records of workflows.sessions and their
  `label`, and says that an earlier record can have no `label`.
- New tests read the labels of a planner and a reviewer session from
  the store. They also remove the labels of a failed run, resume it,
  and show that its sessions are still closed.
An item that shipped with judge score 0 failed at once, even when
the judge gave findings that one more implement turn could fix.

- The new workflow script fix.js is the fix round. It runs the child
  run `implement` with the work item and the judge findings as the
  plan, from the item head, in the campaign run memory. Then it runs
  `judge` again on the change of the item. It catches a failed child
  run and returns `failed`, so the caller saves the result and a
  resume does not run the fix round again.
- campaign.js runs `fix` before it resets an item that shipped with
  score 0 and findings. A new score above 0 squashes the fix into the
  item commit with the item message, and the item ships with the new
  score. A score of 0, a blocked fix, no score or a failed fix resets
  and asks. The status names the outcome of the fix round, and the
  question summary has a `Fix round:` block with the new findings.
  Blocked, stopped, `judgeError` and no-findings items get no fix
  round.
- The new lib helper `squash(start, message, subject)` is one
  repeatable command. ship.js and campaign.js use it.
- The rundown prompt says that the reply and findings come from the
  fix round after one.
- docs/spec.md describes `workflows fix` and the fix round of a
  campaign. script.d.ts and pi/index.ts declare `squash`.
- The save tests use the name `tweak`, because `fix` is now a
  workflow of the package.
- New campaign tests cover a fix that ships, still 0, a blocked
  item, a failed judge, a resume in the second judge, and a fix
  child run that fails, also with a resume before the question.
@Vzlentin
Vzlentin merged commit 9fa3eb2 into main Nov 1, 2026
3 checks passed
@Vzlentin
Vzlentin deleted the feat/label-run-sessions-and-give-a-refused-campaign branch November 1, 2026 01:22
@vzlentin-release vzlentin-release Bot mentioned this pull request Nov 1, 2026
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