Skip to content

Team boards hold their own rules: review, dependencies, Needs you, proven rules, lanes - #622

Merged
FMXExpress merged 7 commits into
mainfrom
claude/pasclaw-desktop-plan-uapzcp
Oct 29, 2026
Merged

FMXExpress merged 7 commits into
mainfrom
claude/pasclaw-desktop-plan-uapzcp

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

Implements docs/team-board-plan.md (ideas from Pullboard), all five phases. Before this, rules like "claiming done without evidence is the one prohibited move" and "have the test engineer verify before you close it" lived only in role prompts, and nothing enforced them. Now the board enforces them in the task store and the tools. Agents can't get around that, and team projects don't need to be git repos.

One commit per phase, so the branch can be reviewed phase by phase.

Phase 1 — a second agent's verdict, frozen criteria, receipts (73d59c6)

  • New review task status (appended to the status list, so existing stored values don't change meaning). A task gets there only through task action=submit, which requires evidence. It leaves only through task action=verdict: accept closes it; reject needs a reason and sends it back to the same owner with the reason in its notes.
  • Who can't give the verdict: the submitter, the task's owner, anyone not on the reviewer list, and any call that isn't from a standing agent's turn. That last group is never treated as the operator.
  • team up turns review on for its board. Reviewers come from the template's review.by (software-team: qa), or else the submitter's parent.
  • On a reviewed board, an agent's done is refused, and a finished job submits the task instead of closing it. The operator can still close anything, and that is recorded as theirs.
  • criteria is a field of its own. It freezes once work starts, and a builder never writes the criteria for its own task.
  • projects/<p>/activity.jsonl records every change to a task and who made it; it's written by the store and served at GET /v1/projects/<p>/activity.
  • Held-out checks in $PASCLAW_HOME/scenarios/<workspace>/<project>/ must pass before a submit is accepted.
  • The file tools can't write the board's own files (task.json, job.json, project.json, the activity log).
  • Desktop: review badge and colour, Accept/Reject, task detail with history. The checklist mirror no longer changes the status of reviewed tasks.

Phase 2 — waits_on, next, leases (e73a7bb)

  • A task can list the tasks it waits on. Readiness is computed, not stored; a cycle or an unknown task is refused when set.
  • task action=next claims the oldest ready task, all under one lock so two agents never get the same one. An agent marked takes: "any" can also take unassigned work.
  • Leases (teams.claim_lease_minutes, default 120). The team tick hands back a task whose holder's run died, and tells the lead.
  • An owner is only woken for ready work. When a task closes, the owners of tasks waiting on it are messaged.

Phase 3 — Needs you (35fc1a8)

  • agent action=ask_operator: an agent with a parent escalates to that parent's mailbox; only the top of the chain creates a decision (workspace/decisions/).
  • A question about a task blocks the task. The answer goes to the asker's mailbox and the task resumes.
  • A Needs-you taskbar button and window for decisions, the gateway's pending permission requests (which had no window before), and reviews only the operator can give.
  • decisions.channel announces new decisions in a chat. A D12 yes reply in any of the 7 chat bots answers one, but only from senders listed in decisions.answer_from.
  • /v1/decisions and /v1/needs-you.

Phase 4 — a repeated cause becomes a proven rule (ce5e0f8)

  • The plan's open question was how to prove a check on a project that isn't a git repo. Settled with snapshots: PasClaw copies the project at every submit, outside the workspace.
  • A reject carries a cause. The second reject for the same cause on a board alerts the lead.
  • rule action=draft only goes ahead if the check fails on the rejected snapshot and passes on the accepted one. The proven draft becomes a decision; approved, it's installed into the project's held-out checks; declined, the cause stops triggering alerts.
  • The operator can add a check directly with POST /v1/projects/<p>/rules; it's proven the same way.

Phase 5 — lanes (0217cf2)

  • A template agent can be given lane path globs (projects/{{project}}/app/**). Its file writes elsewhere are refused, with a message naming whose lane the path is in.
  • The check sits in the sandbox's file-write check (CanWritePath), which every file tool already goes through with the full path.
  • shell_exec writes aren't covered; the docs say so.
  • Not built: a git worktree per lane. Every review step would have to follow each agent into its own checkout, and someone has to decide when each lane's branch merges back. The plan doc explains.

Where the build differs from the plan

Each phase's section of the plan has an As built note. The main points:

  • Scenarios live outside the workspace, so agents can't see or edit them.
  • Reopening a task keeps its owner.
  • Decisions, snapshots, rule drafts and held-out checks are protected from the file tools too.
  • The lane check lives in the sandbox's file-write check, not the permission rules.

Testing

  • make test passes under FPC 3.2.2 (all 139 test programs).
  • New team_review_tests and team_board_tests, plus additions to desktop_routes_tests. They cover each phase end to end, including the caller identity going through the real tool loop.
  • For each rule, I disabled it in the code and confirmed its test failed.
  • Not compiled with Delphi (dcc64). Only FPC is available here. I avoided FPC-only calls, but a dcc64 build is still worth running.
  • Docs: team-board-plan.md (per-phase status), teams.md, desktop.md, agents.md, channels.md, configuration.md.

Generated by Claude Code

docs/team-board-plan.md. Teams have roles, owners, a mailbox and a wake
loop, but every rule that makes them a system lives in a prompt: any
agent can close its own task (task action=job status=done does it by
default), acceptance checks are editable notes, a dependency is a
blocked task someone must remember to unblock, and "report to the
operator" is prose in a transcript.

The plan takes Pullboard's mechanisms that fit and holds them at tool
dispatch, which PasClaw owns, rather than in git hooks:

  1. a review state with a second agent's verdict (the submitter is
     refused), criteria frozen once work starts, an activity log of
     receipts, and the #618 scenarios as a gate on submit;
  2. waits_on dependencies, an atomic `next` claim, and leases;
  3. one "Needs you" queue for the human, with questions escalating
     up the parent chain, reachable through the channels;
  4. a cause that rejects work twice becomes a drafted scenario,
     proven red-then-green, approved by the operator;
  5. per-agent lanes in the permission check.

What it does not take, and why: commit-message citations and hooks,
the relay, model routing, blueprints (later).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
…eceipts

Phase 1 of docs/team-board-plan.md. The role prompts said "claiming
done without evidence is the one prohibited move" and "have the test
engineer verify before you close it", and nothing stopped either: any
agent could set its own task done, and a finished job closed its task.
The store holds the rule now, so the task tool, the HTTP routes and the
desktop all go through it.

- Tasks gain a `review` status (appended to TTaskStatus) entered only by
  `task action=submit` with evidence, and left only by `task
  action=verdict` (accept -> done; reject needs a reason -> active, same
  owner, reason in the notes). The verdict is refused from the
  submitter, the owner, anyone off the reviewer list, and a caller that
  cannot be identified -- a turn that is not a standing agent's is never
  read as the operator.
- Projects gain `review` and `reviewers`. `team up` turns review on for
  its board with the template's `review.by` (software-team: qa); without
  a list the submitter's parent reviews. On such a board an agent's
  status=done is refused with the submit it should have been, and a job
  reported done submits instead of closing.
- `criteria`: acceptance checks apart from the notes, frozen for agents
  once work starts (keyed on a `started` stamp), never written by the
  task's own builder; a reopen unfreezes them. The operator can always
  edit.
- projects/<p>/activity.jsonl: every create, assign, start, submit,
  accept, reject, reopen, criteria and status change, attributed,
  written by the store. GET /v1/projects/<p>/activity serves it.
- Held-out checks in $PASCLAW_HOME/scenarios/<workspace>/<project>/ run
  before a submit is accepted (outside the workspace, so the builder
  cannot edit them); a red set refuses it with the output.
- The file tools refuse task.json, job.json, project.json and
  activity.jsonl whatever the sandbox policy, so fs_write cannot walk
  around the rules. shell_exec is still outside this.
- Operator routes: POST .../tasks/<t>/verdict and POST
  /v1/projects/<p>/review. The desktop shows review in its own colour
  with Accept / Reject, a review count on the project row, and a task's
  criteria, evidence, verdict and history when expanded; the checklist
  mirror (which writes as the operator) only adds tasks on a reviewed
  board and never touches a task in review.
- The wake loop wakes a task's reviewer while it is in review, not its
  owner; a board with work in review is not done. Submit and reject
  message the other side so the handoff does not wait for the cadence.
- Role prompts: everyone submits instead of closing; the PM writes the
  criteria field; the Test Engineer gives verdicts; the Foreman no
  longer closes tasks.
- Caller identity: `task` is mutating, so it dispatches inline on the
  loop thread the agent runner set the caller on. team_review_tests
  drives that through the real tool loop beside a parallel read-only
  batch, and shows a thread with no identity is refused even while
  another thread holds one.

Tests: new team_review_tests (store rules, receipts, job submits, the
scenario gate, the board-records guard, the tool as agents, teams, the
tool loop), desktop_routes_tests for the new routes and team up. Each
rule was revert-checked: disabling it fails its test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
Phase 2 of docs/team-board-plan.md. A dependency used to be a `blocked`
task with a sentence saying what it waited on, and someone had to
remember to unblock it; a task held by a dead run waited two cadences
for a stall report and then for the lead.

- waits_on: a task lists the tasks it needs. Ready is computed (every
  prerequisite done), never stored. An unknown task, a self-edge and a
  cycle -- direct or through other tasks -- are refused when set.
  `blocked` stays for waits outside the board.
- task action=next claims the oldest ready todo task routed to the
  caller, else, for a template agent with `takes: "any"`, the oldest
  ready unassigned one. Scan and claim are under the store's task lock,
  so concurrent claims never hand out one task twice; "nothing ready"
  says what the caller's own tasks wait on.
- Leases: an agent starting or claiming a task holds it for
  teams.claim_lease_minutes (default 120), renewed whenever the owner
  touches the task, dropped when it leaves active, re-taken by the owner
  on a reject. The team tick hands back a task whose lease ran out while
  its holder runs no turn (the supervisor's turn-lock test) -- to the
  pool if it came from there -- and tells the lead.
- The wake loop wakes an owner only for ready work, and wakes takers
  for ready unassigned work. Closing a task messages the owners of
  tasks that were waiting on it, which makes their team due now.
- HTTP: waits_on on create and PATCH (a cycle is a 400); task JSON
  carries waits_on, waiting_on, ready and the lease; projects carry
  takers. The desktop says what a waiting task waits on.
- Role prompts: the Foreman and Chief of Staff set waits_on instead of
  blocking and unblocking; builders take work with next.

Tests: new team_board_tests (edges and cycles, readiness, next, eight
concurrent claimers on three tasks, lease renew/expire/pool, dependents
told, ready-only wakes, takers, the tick telling the lead, the tool),
desktop_routes_tests for the HTTP side. Each rule revert-checked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
Phase 3 of docs/team-board-plan.md. "Report it to the operator" was
prose in a lead's transcript, and nothing collected the questions only
a person can answer.

- agent action=ask_operator (question, choices, project, task). An agent
  with a parent has its question delivered to the parent's mailbox as an
  [escalation] -- held by the tool, not asked of the role -- so only the
  top of a chain creates a decision.
- PasClaw.Decisions: workspace/decisions/D0012.json (who asked, the
  question, choices, the task it blocks and that task's prior status,
  the answer and who gave it). Ids allocated under a lock. With choices
  the answer must be one of them; a decision is answered once.
- A question about a task blocks the task with a note; the answer goes
  to the asker's mailbox (which wakes it) and puts the task back to
  what it was doing.
- Off the desk: decisions.channel posts a new decision to a configured
  channel (PostToChannel, factored out of send_message). A "D12 yes"
  reply to any of the seven chat bots answers it -- only from a sender
  in decisions.answer_from; everyone else is refused with the reason
  (an empty allow_senders admits anyone, so it is not used for this).
  Email reads the first body line only.
- Desktop: a Needs-you taskbar button, shown only when something waits,
  counting open decisions, the gateway's pending permission asks (which
  had no window before) and reviews no agent can give; its window
  answers all three. GET/POST /v1/decisions, GET /v1/needs-you.
- The decisions directory is refused to the file tools like the board's
  records, so an agent cannot answer its own question.
- Role prompts: leads ask the operator through ask_operator and decide
  their reports' questions when they can.

Tests: team_board_tests (ids, choices, answer-once, reply parsing, the
answer_from gate, escalation, blocking and unblocking, the guard) and
desktop_routes_tests (decision routes, needs-you). Each rule
revert-checked. The route test caught a real bug, fixed here: the
answer route re-read the decision through its own out parameter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
Phase 4 of docs/team-board-plan.md, with its open question settled: a
rule is proven against PasClaw's own snapshots of the project, not git
worktrees or checkpoints, so it works the same for a repository and for
a plain projects/<p>/app/ folder.

- PasClaw.Projects.Snapshots: every submit copies the project (after the
  held-out gate, minus the board's records and dependency folders, 50 MB
  cap, newest ten per task) to $PASCLAW_HOME/snapshots/<ws>/<p>/<task>/
  S0003/, outside the workspace. The task and its submit/accept/reject
  receipts name the snapshot.
- A reject carries a cause (slugged), on the task and on its receipt.
  The second reject for one cause on a board messages the team's lead
  with the cause, the tasks and the call that drafts a rule -- not once
  a rule exists, the operator declined one, or a draft is waiting.
- `rule action=draft` (project, cause, script, name) proves the check:
  it must fail on the snapshot of a submission rejected for the cause and
  pass on the same task's accepted fix; "does not catch it" and "would
  reject good work" are refused with both results. A proven draft is a
  `rule` decision in Needs you, showing the script; approved, it is
  installed into the project's held-out scenarios and every submit is
  held to it; declined, the cause is recorded and stops nagging.
  `rule action=list` shows rules, ruled/declined causes and counts.
- The operator's own rule: POST /v1/projects/<p>/rules -- proven, then
  installed with no approval step (422 when it cannot be proven).
  GET lists. The operator's verdict route takes a cause too.
- The scenarios, drafts and snapshots are refused to the file tools:
  outside the workspace is not enough with the sandbox off.
- Role prompts: the Test Engineer gives every reject a reusable cause;
  the Foreman drafts a rule when a cause repeats.

Tests: team_board_tests drives the whole loop -- snapshots, a cause on
two tasks, the notice, both unproven shapes, a proven draft, approval
installing it, a later submit refused by it and the fix accepted, a
decline that stops the nagging, the operator's direct rule -- and
desktop_routes_tests the rules routes. Each rule revert-checked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
Phase 5 of docs/team-board-plan.md.

- A template agent may name a lane: path globs relative to the
  workspace ("projects/{{project}}/app/**", a string or a list). `team
  up` fills in the board and records the lanes on the project (re-binding
  to a template without lanes lifts them). Validation refuses absolute
  lanes and lanes through "..".
- The check sits in the sandbox's write check (CanWritePath, via an
  OnLaneCheck hook installed by PasClaw.Projects.Tools) -- every
  file-writing tool already calls it with the resolved path. A laned
  agent's write outside its lane, or outside the workspace, is refused
  with whose lane the path is in ("projects/shop/docs/plan.md is pm's;
  message pm instead"), or with its own lane when no one owns the path.
  Agents without a lane and turns that are not a standing agent's are
  not bound. shell_exec is not covered, and the docs say so.
- `**` whole segments (at segment boundaries), `*` within one, `?` one
  character. Projects report their lanes over HTTP.
- Not built: a worktree per lane for git projects. It moves where a
  lane's writes land, and the gate, snapshots and reviewer would have to
  follow, with a merge point nobody has decided; the plan says why.
- The shared role prompt: write inside your lane, message the owner of
  anyone else's.

Tests: team_board_tests (the glob matcher, template lanes and their
validation, refusals through CanWritePath and through a real
write_file call, unlaned agents and non-agent turns unbound, re-binding
lifting lanes). Each rule revert-checked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-28T23:21:12.113704Z b3a0013 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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