Repository navigation
Description
Summary
A read-only check that collects, in one command, what an architect reads before asking the owner to merge a builder's pull request. Plus two companions: whether a merged PR has reached the deploy branch, and whether a finished builder's worktree can be removed without forcing.
Suggested by an adopter workspace's architect at its owner's request. They built these as local helpers after studying a week of their own shell history (16,117 commands): each replaces a sequence architects typed by hand hundreds of times, often with silent failures. This issue asks for a spec (SPIR).
What the helpers do
check <pr> reports:
- the exact head commit, the PR's state, and whether it can merge;
- forbidden attribution lines in the description and in each commit;
- the size of the diff;
- files the base branch has also changed since the branch point;
- a trial merge into the base branch, reporting the number of conflicts, with no ref moved;
- the checks on the head commit. When the top commits touch only porch status files, also the runs of the push that carried the last code commit;
- which watched files moved, with named ones flagged (theirs watches prompts through a hash file);
- the product files a person still has to read.
merged <pr> says whether each merge commit is on the deploy branch, and whether it is inside the latest green run of a named deploy workflow.
lane <worktree> says whether a finished builder's worktree can be removed without forcing: uncommitted files, commits not on the base branch, whether the local branch matches the remote, and ignored files that may be evidence to copy out first.
It never merges, approves, cleans up or deletes. Its tests stub gh and git and fail on any command that is not on a read-only list.
Why this belongs in Codev
Every architect does this at every pr gate, by hand, and the misses are quiet: a trial merge nobody ran, a check that was green on the wrong commit, an attribution line that reaches main, a worktree removed with evidence still in it. On this repository alone, 361 commits since June carry a Co-Authored-By trailer against the owner's rule, and a recent cleanup question turned on an untracked review file that nobody could see without cd-ing into the worktree.
What the spec must decide
- Where it lives and what it is called. New
afxsubcommands, acodevsubcommand, or something else. One noun, learnable. List every command with a sample invocation and its output. - Read-only, enforced. The implementation may run only commands on an explicit read-only allow-list, and the tests fail on anything else. The trial merge must move no ref and leave the working tree and index untouched; say how.
- Forge. Codev supports forges other than GitHub through its forge concept. Say what each check needs from the forge and what happens on one that cannot provide it. Fail loudly; do not guess.
- What is configurable, and where: the forbidden attribution patterns, the watched paths and which are flagged, the deploy branch and deploy workflow for
merged, the keep list forlane. A project with no deploy workflow must still get a usefulmerged. - "Files a person still has to read." Define it. Theirs excludes porch state, thread files and generated files; say what the rule is here and how a project changes it.
- The porch-status-only case. A builder's last commits are often porch status commits, so the checks on the head say nothing about the code. Specify how the last code commit is found and how its runs are shown beside the head's.
- Output. A summary a person reads in ten seconds, a
--jsonform for agents, and an exit code that separates "something needs attention" from "the command failed". - Relation to existing tools.
consult --type integrationreviews content; this checks merge mechanics. Say how they sit together, and whether the architect role and theprgate guidance should tell architects to run it. laneand cleanup. Issue afx/porch: four small CLI additions (afx send --message-file/--exit-code/--retry, afx cleanup --keep-ignored, afx spawn --max-load, porch -C) #1950 addsafx cleanup --keep-ignored. Say whetherlaneis a separate command or cleanup's dry run.
Constraints
- It never merges, approves, cleans up, deletes, pushes or comments.
- End-to-end usable: the headline path is "an architect runs one command on a builder's PR and sees everything needed to recommend a merge, or the specific thing that blocks it".
- Server/client isolation (issue Introduce packages/codev-sdk: client SDK for Tower (server/client dependency isolation) #1189) if any of it is exposed to the VS Code extension or the dashboard.
- Framework docs change in both
codev/andcodev-skeleton/. - Fail fast, no fallbacks: a check that cannot run says so by name. It is never reported as passing.
Activity