[ai] Mirror source lineage rules in Claude

This commit is contained in:
John Preston
2026-08-12 10:35:08 +04:00
parent a8def18edc
commit 70e7467ba4
4 changed files with 54 additions and 0 deletions

View File

@@ -70,6 +70,39 @@ Let normal Claude editing preserve the checkout's existing text convention.
This exception removes only explicit line-ending work; it does not relax any
content validation, owned-path rule, build, review, test, or publication gate.
## Source lineage and branch routing
The shared skills' source-lineage policy applies unchanged. Keep its timing
boundaries in the Claude orchestrator rather than delegating the decision to a
leaf:
- The parent `continue` command runs the startup `source-lineage` scan before
freezing the batch. On a mismatch, report the lineage JSON and use
`AskUserQuestion` to pause for human direction. Do not start an Agent, switch
branches, or perform or route a cherry-pick, rebase, merge, backport,
forward-port, or branch-sync task at this boundary.
- Once the batch is frozen, the parent scheduler owns the shared skill's safe
pre-Phase-1 branch switch. Use Bash only for the required cleanliness,
recovery-ref, process, and `git worktree list --porcelain` checks and for
`git switch` to an existing compatible local branch. Never ask a performer or
leaf Agent to integrate history.
- When a synchronous performer returns the shared pre-Phase-1 lineage stop,
switch safely in the parent and resume that Agent id when Claude exposes one.
If it exposes no resumable id, start one replacement performer only after the
returned worker and repository checks prove there are no phase artifacts,
source refs, overlay, or writes. This is a clean setup retry, not a second
concurrent performer.
- A lineage mismatch first established after Phase 1 stays inside the
performer: it restores owned/disposable state and publishes the shared
task-local `Block`. Once the foreground call returns, `continue` records the
attempt and proceeds with non-dependent batch work; it does not ask the human
merely because that one task blocked.
`process-inbox` and discovered-routing Agents must use the shared receipt-only
disposition for requests whose sole work is moving an existing commit between
branches. Their initial prompts already require this adapter and the applicable
shared skill, so do not restate or weaken that routing rule in a leaf prompt.
## UI-driver capability
The shared Computer Use reference describes Codex's driver. In Claude Code,

View File

@@ -19,6 +19,14 @@ follow-up requires its affirmative independence test. Continue until that
frozen-and-derived batch reaches the scheduler's normal stop condition or a
global hard stop.
Apply the shared source-lineage gate in this parent scheduler. Before batch
freeze, a missing approved prerequisite pauses through `AskUserQuestion` after
the exact branch and compatible-branch report. After freeze but before Phase 1,
the parent may make only the shared safe switch to an existing compatible local
branch and then resume the returned performer. After Phase 1, let the performer
publish a task-local Block and continue non-dependent batch work. Never create,
route, or execute branch-integration work as a queue task.
Apply the shared skill's pending-task consolidation phase too. At each eligible
clean AI-slot boundary, recover an older `pending_consolidations` marker or
consolidate newly routed tasks in one fresh foreground Agent. Give it the

View File

@@ -16,6 +16,13 @@ Apply the shared pipeline's conditional `[ai] ` commit-subject rule exactly;
the prefix is required for permanent test-helper or agent harness/documentation
changes and forbidden for every other task.
Apply the shared source-lineage gate before Phase 1 and pass explicit source
task requirements to `start` or `retry`. A pre-Phase-1 mismatch returns the
clean routing stop to the caller without integrating history or publishing a
Block. A mismatch first established after Phase 1 publishes the shared clean
task-local Block; it never becomes a cherry-pick, rebase, merge, backport, or
branch-sync operation inside this command.
Delegate phases with synchronous foreground Agent calls per the adapter; leaf
phase agents receive self-contained prompts and are not told to read the
adapter. Use the Agent tool for delegation; do not start Claude subprocesses

View File

@@ -16,6 +16,12 @@ existing project work stays in that project unless it passes the skill's
affirmative independence test; shared or cross-surface files alone do not make
it standalone.
Apply the shared receipt-only disposition to requests whose sole purpose is
moving an existing commit between branches. Never create backport,
forward-port, cherry-pick, rebase, merge, or branch-sync tasks. A real product
task may depend on the approved source task; that dependency is the lineage
record and does not need an integration companion task.
Parallel task work is expected. Use the shared skill's `inbox_worktree`,
`inbox_branch`, and `inbox-*` helper commands exactly as documented. Never
substitute the task `slot_worktree`, stop merely because that slot is dirty, or