✨ feat: P-07 work rules at pre-push and on the pull request

Merged
AL
1mo ago
+834-10

Roadmap P-07, work rules check.

An agent pull request names exactly one slice, as a line Slice: #N, and that slice may be built:

  • it is a Slice issue under a Work item the owner labeled approved (the latest approved label event must be the owner's);
  • a slice added to the work item after the approval carries the owner's Decision: comment naming it (on the work item), or a Decision: comment on the slice;
  • each State sub-issue closed as not planned after the approval carries the owner's Decision: comment;
  • no other open pull request names the slice.

Where it runs:

  • On the pull request: the shared workflow's new "Work rules" job (process-rules pr-work-rules). It reads the settings from the base commit, so a pull request cannot change them. The owner's pull requests pass.
  • Before a push: onboard now writes a pre-push git hook running process-rules pre-push (or names the line to add to the client's own hook). In agent sessions, the commits pushed must name one slice between them, as a Slice: #N trailer, and it must pass the same rules.

The client workflow gains issues: read.

Sandbox proof after merge: planted cases refused. These are an unapproved start, a slice added after approval, a dropped state and a second pull request.

pnpm check passes. The roadmap marks P-07 shipped.

šŸ¤– Generated with Claude Code


Summary by cubic

Implements the P-07 work rules check: an agent pull request must name exactly one slice the owner has approved, and the same rules run before an agent session pushes. P-07 stays building until its sandbox proof. CI stops caching pnpm and limits setup-node to 3 minutes after cache restores repeatedly hung the required job.

Work rules

  • An agent pull request names exactly one slice as a Slice: #N line, and it must be a Slice under a Work item the owner labeled approved; no other open pull request may name it.
  • A slice added after approval, or an approved State closed as not planned, needs the owner's Decision: comment.
  • A push is checked whole: its commits across every ref name one slice, on one branch.

Where it runs

  • The shared workflow's Work rules job checks pull requests — including re-running when the description is edited — reading settings from the base branch so a pull request cannot change them. The client workflow now needs issues: read.
  • onboard writes a pre-push hook running process-rules pre-push, or names the line to add to a client's own hook or a global hooks folder. Agent pushes must carry a Slice: #N trailer; the hook refuses them when the CLI is missing or the session has no token.