/acf-whip:integrate-lpcasfrom acf-whip
LP-CAS integrator. Lands one accepted task's single-parent candidate on the live trunk by cherry-picking it, co-committing an in-tree ledger marker, gating the union tree, and CAS-updating trunk. A task counts as integrated when its marker is in the live-trunk tree, never because of a markdown field. Only /go's orchestrator invokes it; the agents that implement tasks never do.
Ships in acf-whip. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Replaces integrate-worktree, which rebased each task onto a cached trunk snapshot. This skill folds
one accepted task onto the live trunk. The #N references below are failure classes of that old
engine; each step names the ones it rules out.
A task
Kis integrated iffgit cat-file -e <live-trunk-tip>:.acfwhip/integrated/<shard>/<K>.jsonsucceeds. Only the integrator writes that marker, and only co-committed in the same single-parent commit as the change, after the union gate passes, landed by compare-and-swap.
Nothing else counts as integration: not Integrated-At, not the folder a task sits in, not a commit
trailer. The integrator adds an ACFW-Task: trailer for people to read, and nothing queries it.
integrate-lpcas.sh <TASK_FILE> # initial attempt
integrate-lpcas.sh --post-resolver <TASK_FILE> # resume after the caller dispatched a resolver
Env (set by /go): ACFW_TRUNK_ROOT, ACFW_TRUNK_BRANCH, optional ACFW_GATE_CMD (union gate, CWD
= candidate worktree), optional ACFW_PARSE_SANITY_CMD (cheap parse/lint, run before the heavy gate).
Input: a single-parent candidate commit at refs/acfw/patch/<key> (key = task id = TASK_FILE
basename). The integrator builds it from the task's worktree branch: the tip's tree, with the fork
base (refs/acfw/forkbase/<slug>, else the merge-base with trunk) as its only parent. With no branch,
it uses whatever candidate the ref already holds. The integrator changes only git (the trunk ref and a
disposable integration worktree under <worktree-dir>/_integrate/<key>), never the .backlog
markdown.
cherry-pick --no-commit the candidate onto a fresh worktree at the observed tip. The 3-way base
is the candidate's own parent, never a merge-base against trunk, and nothing is rebased or
replayed (#3). A conflict surfaces as resolver-needed and is never dropped silently (#17).
Before the fold the integrator drops the candidate's .backlog/ and docs/cycles/ changes, since
task state and plan cycles are never a task's deliverable. Dropping docs/cycles/ changes prints a
WARN: on stderr naming each path and the diff that recovers it from refs/acfw/patch/<key>, and
a second WARN: when nothing but the marker is left to land. A conflict confined to docs/cycles/
is not sent to a resolver, because that content is dropped anyway.pipefail, so a pipeline cannot hide its exit code (#12). A gate
failure is quality-fault.update-ref refs/heads/<trunk> <new> <observed>, then resync ROOT. If trunk moved or
was rewound in the meantime, the update is rejected as cas-lost: a transient mechanism fault
that loses no data. The resync checks out only the paths this landing changed, so a
Worktree: none task editing the root keeps its other files. If the landing overwrites
uncommitted work on one of those paths, a WARN: on stderr gives a snapshot commit and a
Recover: command that re-applies those edits 3-way.ACFW-INTEGRATE: <verdict>) / exit codes| exit | verdict | meaning |
|---|---|---|
| 0 | integrated / already-integrated | landed, or idempotent skip |
| 3 | quarantine malformed-candidate / quarantine poison-ledger-write / quarantine state-only-branch | isolate this id only |
| 4 | no-candidate | no refs/acfw/patch/<key> → nothing to integrate (terminal skip) |
| 6 | quality-fault | union gate failed on the candidate tree (not a mechanism fault) |
| 7 | resolver-needed | cherry-pick conflict; worktree left mid-pick; caller dispatches resolver, re-invokes --post-resolver |
| 9 | mechanism … | resolution-syntax-broken / conflict-unresolved / worktree error (not a quality reject) |
| 11 | cas-lost | trunk moved/rewound under us → transient; caller re-observes (epoch check at loop) |
| 12 | stall trunk-unobservable · stall backlog-strip-failed · stall cycles-strip-failed · stall root-index-desync | trunk missing or detached; a candidate whose .backlog/ or docs/cycles/ edits could not be stripped (refused, never folded in); the root index could not be resynced after landing (the line carries the git reset --mixed to run) |
Mechanism faults (7/9/11) and quality faults (6) go to separate counters, so a conflict never spends the quality reject budget (#13).
On exit 7 the integration worktree is left mid-cherry-pick, and stdout also carries worktree:,
assigned_agent: and conflicted_files: lines. assigned_agent: carries the task's role. The caller
resolves it the way /go dispatches any task (the installed agent of that name, otherwise whippet
told to load the role skill) and sends that resolver into the worktree to resolve the conflict
markers and git add the files. The agent does not run
cherry-pick --continue; the integrator owns the commit. The caller then re-invokes with
--post-resolver. Any path still unmerged ends as mechanism conflict-unresolved. Otherwise the
resolved tree goes through the same sanity → gate → CAS-land path.
Tested by acf-whip/tests/phase8-lpcas-integrate.test.sh.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fib7/acf-tools --plugin acf-whip13 skills in this plugin
/clean-checkout-before-taskMandatory first step for any agent that mutates code. Resolves the task's Worktree slug, lazy-creates an isolated git worktree on a derived branch, validates the branch, hydrates the dev env from .worktreeinclude, stashes unrelated changes, and logs the clean-checkout token. Gives each task its own index and branch, so tasks do not bundle each other's commits and rarely contend on index.lock./goContinuous backlog execution until 100% of tasks reach a terminal state (accepted/blocked)/researchResearch a topic with MCP tools (Perplexity, Context7, Figma), write a temporal (YYYYMMDD-dated) research document, and generate a backlog task from the findings/retroClose a planned acf-whip cycle, and learn from it when something went wrong. A clean cycle closes in one script call with zero agents. When a trigger fired (a task reworked, a task stuck, a deliverable not met), a retro agent writes the frozen analysis, at most 3 one-rule lessons, and a retro-actions cycle you approve like any plan. Works on every task store. It never creates tasks or edits agent files or role skills, and it leaves deleting a lesson to you./taskDecompose a scope into atomic tasks using task-engineer agents. It only orchestrates and never implements anything./whipThe front door of the acf-whip cycle (PLAN, DECOMPOSE, BUILD, VERIFY, RETRO). Bare /whip says where you are and prints the one command to run next. /whip "<goal>" sends small work straight to /task and risky work to a plan you approve with one yes, which then starts /task --plan itself. /whip <file.md> adopts a plan written anywhere else. Spec tools (plan reviewers and workbenches) run through it too: --review, --push, --pull, --from, --tools. /whip --auto "<goal>" runs the whole loop hands-off until a judge finds the condition met. Use it to start work, to find out what to run next, to approve, amend or abandon a plan, or to start or stop an autopilot run.