ticket-driven-development
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTicket-Driven Development
工单驱动开发
Act as the controller. Convert an approved directory of Markdown tickets into a tested integration branch without expanding worker context unnecessarily. Keep scheduling, integration, state, and final acceptance in the controller; give each implementation or review worker one bounded assignment.
扮演控制器角色。将已获批的Markdown工单目录转换为经过测试的集成分支,无需不必要地扩展worker上下文。将调度、集成、状态管理和最终验收交由控制器负责;为每个实现或评审worker分配一项有界的任务。
Non-negotiable invariants
不可违背的不变式
- Work from one isolated integration branch. Do not implement on the user’s primary branch or modify a dirty checkout.
- Treat tickets as a dependency graph, not a list. Dispatch only tickets whose blockers have passed the required checkpoint.
- Parallelize only confidently independent tickets. Never run concurrent writers in one checkout.
- Give each worker one ticket and file pointers, not the parent conversation or every ticket.
- Prohibit worker recursion. Only the controller may dispatch implementation, review, or conflict-resolution workers.
- Require durable report files and compact returns. Keep full diffs and detailed reports out of the controller conversation when file pointers suffice.
- Use deterministic Git commands for clean integration. Use a conflict agent only after Git demonstrates a conflict.
- Cap ticket repair at two rounds. Stop, split, escalate, or ask for a decision after the cap.
- Persist and append-only
state.json. Never use conversation memory as the run database.ledger.md - Mark a ticket complete only after its change is reachable from the integration branch and its applicable checkpoint passes. Terminal statuses are canonical, not stylistic: a ticket with a commit ends (record checkpoint outcomes in the ledger and review verdict, not by restamping the status); a ticket whose entire output is unversioned artifacts (docs, sign-off packages) ends
integratedwith its report as evidence — neververifiedwith no commit, and never by working in the user's checkout.integrated - A source status claiming completion is a claim, not evidence. Corroborate it against the repository before trusting it; never redispatch corroborated work, and never schedule dependents on an uncorroborated claim.
- Mutate the repository only when open work exists. When corroboration leaves no incomplete ticket, end the run with zero repository changes.
- 在独立的集成分支上开展工作。不得在用户的主分支上进行开发,也不得修改存在未提交更改的工作区。
- 将工单视为依赖图而非列表。仅调度那些阻塞项已通过所需检查点的工单。
- 仅对确认独立的工单进行并行处理。严禁在同一个工作区中运行并发写入操作。
- 仅为每个worker分配单个工单和文件指针,不得提供父会话或全部工单内容。
- 禁止worker递归调用。仅控制器可调度实现、评审或冲突解决worker。
- 要求生成持久化报告文件和精简返回结果。当文件指针足够说明问题时,不得将完整diff和详细报告放入控制器会话中。
- 使用确定性的Git命令实现干净集成。仅当Git确认存在冲突时,才调用冲突处理Agent。
- 工单修复最多进行两轮。达到上限后需停止、拆分、升级或请求用户决策。
- 持久化和仅追加的
state.json。严禁将会话记忆用作运行数据库。ledger.md - 仅当工单的变更可从集成分支访问且其适用的检查点通过后,才能将工单标记为完成。最终状态是规范的,而非随意设置的:有提交的工单状态为(将检查点结果记录在台账和评审结论中,而非重新标记状态);全部输出为非版本化制品(文档、签核包)的工单状态为
integrated,以其报告作为凭证——严禁在无提交的情况下标记为verified,也严禁通过在用户工作区中操作来标记。integrated - 源状态中声明的完成只是主张,而非证据。在信任之前需对照代码仓库进行核实;严禁重新调度已核实的工作,也不得基于未核实的主张安排依赖项的执行。
- 仅当存在待处理工作时才修改代码仓库。若核实后没有未完成的工单,结束运行且不对代码仓库做任何更改。
Read references only when needed
仅在需要时读取参考文件
| Situation | Read |
|---|---|
| Parse tickets, prepare context, or diagnose graph errors | |
| More than one ticket is ready or integration conflicts | |
| Classify risk, decide review depth, verify service availability, or repair failures | |
| Start, resume, reconcile, or clean a run | |
| Map orchestration to Oh My Pi or another environment | |
| 场景 | 读取文件 |
|---|---|
| 解析工单、准备上下文或诊断依赖图错误 | |
| 有多个工单就绪或出现集成冲突 | |
| 风险分类、确定评审深度、验证服务可用性或修复故障 | |
| 启动、恢复、协调或清理运行 | |
| 将编排流程映射到Oh My Pi或其他环境 | |
Workflow
工作流程
1. Confirm inputs and authority
1. 确认输入与权限
Require an approved specification or substantial request, a local directory containing one Markdown file per ticket, and a Git repository. Ask only when a missing decision changes behavior, ticket boundaries, acceptance criteria, dependencies, or an irreversible design choice.
Do not author a new ticket plan inside this skill. If tickets are absent or materially incomplete, stop and request ticket shaping. Minor metadata omissions may be inferred conservatively.
需要提供已获批的规范或实质性请求、包含每个工单对应一个Markdown文件的本地目录,以及一个Git仓库。仅当缺失的决策会改变行为、工单边界、验收标准、依赖关系或不可逆的设计选择时,才向用户询问。
不得在此skill内编写新的工单计划。如果工单缺失或严重不完整,停止运行并请求完善工单。轻微的元数据缺失可进行保守推断。
2. Inspect repository safety
2. 检查代码仓库安全性
Read applicable repository instruction files. Record the repository root, current branch, current , worktree list, and dirty status. Do not stash, discard, commit, or relocate pre-existing user changes.
HEADVerify the environment can actually run the configured checkpoints before the first dispatch. Discover the repository's own service tooling instead of assuming any particular stack: read its task-runner targets, package scripts, compose or container configuration, and CI workflow to determine (a) whether the test suite needs external services — database, broker, cache — at all, and (b) the repository's canonical command for starting or checking each one. Repositories whose tests are self-contained skip this check. When a service is required, run the discovered availability command and record the result in run state; a worker that cannot run its focused tests will either commit unverified work or grind — both violate the verification contract. Ask the user only when discovery is ambiguous, candidates conflict, or a check fails — never invent or hardcode commands on the user's behalf. When required infrastructure is unreachable, either restrict the run to tickets whose checks do not need it or stop and record a ruling before dispatching anything. See for the procedure.
references/verification-policy.mdChoose an ignored run directory such as , and verify with that it is actually ignored — repositories sometimes track , in which case pick another ignored path or keep run state outside the repository. Ensure the integration worktree path is outside the repository or ignored before creating it.
.scratch/<feature>/runs/<run-id>/git check-ignore.scratch/读取适用的代码仓库说明文件。记录仓库根目录、当前分支、当前、worktree列表和脏状态。不得暂存、丢弃、提交或移动用户预先存在的更改。
HEAD在首次调度前,验证环境确实能够运行配置的检查点。需主动发现仓库自身的服务工具,而非假设使用特定技术栈:读取其任务运行器目标、包脚本、compose或容器配置以及CI工作流,以确定(a)测试套件是否完全需要外部服务——数据库、消息代理、缓存——以及(b)仓库用于启动或检查每个服务的标准命令。测试自包含的仓库可跳过此检查。当需要某个服务时,运行发现的可用性检查命令,并将结果记录在运行状态中;无法运行其聚焦测试的worker要么会提交未验证的工作,要么会空转——这两种情况都违反验证契约。仅当发现过程不明确、候选命令冲突或检查失败时,才向用户询问——严禁替用户发明或硬编码命令。当所需的基础设施无法访问时,要么将运行限制为不需要该基础设施的工单,要么在调度任何内容前停止并记录裁定。相关流程参见。
references/verification-policy.md选择一个被忽略的运行目录,例如,并通过验证它确实被忽略——有些仓库会跟踪目录,这种情况下需选择另一个被忽略的路径,或将运行状态保存在仓库之外。在创建集成worktree之前,需确保其路径位于仓库之外或被忽略。
.scratch/<feature>/runs/<run-id>/git check-ignore.scratch/3. Normalize and validate tickets
3. 规范化并验证工单
Run:
bash
python3 <skill-dir>/scripts/index_tickets.py <ticket-dir> \
--output <run-dir>/ticket-index.jsonStop on duplicate IDs, missing required fields, unresolved blockers, or dependency cycles. Read when repairing input or preparing worker context. Do not begin setup while is false.
references/ticket-format.mdvalid运行:
bash
python3 <skill-dir>/scripts/index_tickets.py <ticket-dir> \
--output <run-dir>/ticket-index.json若遇到重复ID、缺失必填字段、未解决的阻塞项或依赖循环,则停止运行。修复输入或准备worker上下文时读取。当为false时,不得开始设置。
references/ticket-format.mdvalid4. Corroborate completion claims and compute open work
4. 核实完成声明并计算待处理工作
The index reports every ticket whose source status claims completion as a warning (the exact completed-status set is in ). Treat each claim as unverified until corroborated against the repository:
references/ticket-format.md- Corroborated — commits, merged branches, tags, or changelog entries reachable from the recorded base that plausibly implement the ticket's outcome. Record the evidence (commit SHA or file) with the ticket. A corroborated ticket is complete: never redispatch it, and treat it as satisfying its dependents.
- Uncorroborated — the repository shows no trace of the claimed work. This is the user's decision, not the controller's: record a ruling request asking whether to reopen the ticket, and schedule nothing that depends on it until the user rules.
If corroboration leaves no incomplete ticket, stop and report the directory as a historical record: do not create an integration branch, worktree, , or ledger, and leave the repository exactly as found. Continue to setup only when open work remains or the user reopens a claim.
state.json索引会将每个源状态声明已完成的工单作为警告报告(确切的完成状态集合见)。在对照仓库核实之前,所有声明都视为未验证:
references/ticket-format.md- 已核实 — 从记录的基准提交可访问的、看似实现了工单结果的提交、已合并分支、标签或变更日志条目。将证据(提交SHA或文件)与工单一起记录。已核实的工单视为完成:严禁重新调度,且视为其依赖项已满足。
- 未核实 — 仓库中没有所声明工作的痕迹。这属于用户决策范围,而非控制器的职责:记录一个裁定请求,询问是否重新打开该工单,在用户裁定之前,不得调度任何依赖它的工作。
若核实后没有未完成的工单,停止运行并将该目录报告为历史记录:不创建集成分支、worktree、或台账,保持仓库完全原样。仅当仍有待处理工作或用户重新打开某个声明时,才继续进行设置。
state.json5. Create the integration branch and worktree
5. 创建集成分支与worktree
With open work confirmed, create a branch such as at the recorded base SHA. Prefer a real integration worktree that isolates the run from the user checkout:
agent/<feature>/integrationbash
python3 <skill-dir>/scripts/make_worktree.py \
--repo <repo> \
--path <integration-worktree> \
--branch agent/<feature>/integration \
--start <base-sha> \
--metadata <run-dir>/workspaces/integration.jsonIf the active environment cannot move the controller into that worktree, keep the controller read-only in its original checkout and use absolute paths for all operations in the integration worktree. Use environment-native isolated children only when they are based on this integration worktree; otherwise use explicit child worktrees.
A second checkout is a different environment, not just a different path: tooling keyed to checkout identity — compose project names, fixed ports, per-repo caches — can be healthy in the user checkout yet broken from the integration worktree. After creating it, rerun the service availability command from inside the worktree and record the outcome. When a duplicate service would collide with the healthy one (two compose projects claiming one database port, for example), point the worktree at the already-healthy shared service instead of starting a duplicate, and record that decision.
Any baseline verification — a green base-suite run, a service check, a build probe — happens inside this worktree once it exists, never in the user checkout: even a read-only test run there writes build artifacts into the user's tree and violates the read-only controller.
确认存在待处理工作后,在记录的基准SHA处创建分支,例如。优先使用真实的集成worktree,将运行与用户工作区隔离开:
agent/<feature>/integrationbash
python3 <skill-dir>/scripts/make_worktree.py \
--repo <repo> \
--path <integration-worktree> \
--branch agent/<feature>/integration \
--start <base-sha> \
--metadata <run-dir>/workspaces/integration.json如果当前环境无法将控制器移入该worktree,则让控制器在其原始工作区中保持只读状态,所有集成worktree中的操作都使用绝对路径。仅当环境原生的隔离子实例基于此集成worktree时才使用它们;否则使用显式的子worktree。
第二个工作区是不同的环境,而不仅仅是不同的路径:依赖工作区身份的工具——compose项目名称、固定端口、仓库级缓存——在用户工作区中可能正常,但在集成worktree中可能失效。创建完成后,从worktree内部重新运行服务可用性命令并记录结果。当重复的服务会与正常运行的服务冲突时(例如两个compose项目占用同一个数据库端口),让worktree指向已正常运行的共享服务,而非启动重复实例,并记录该决策。
所有基线验证——基准测试套件成功运行、服务检查、构建探测——都必须在该worktree存在后在其内部进行,严禁在用户工作区中执行:即使是只读的测试运行,也会向用户的目录中写入构建制品,违反控制器的只读原则。
6. Initialize durable state
6. 初始化持久化状态
Run as shown in . Record inferred risk, conflict domains, test commands, review policy, environment adapter, corroboration outcomes, and any ruling before dispatch.
scripts/run_state.py initreferences/recovery.mdOn an existing run, do not initialize again. Follow the resume protocol in and reconcile Git before doing new work.
references/recovery.md按照中的说明运行。在调度前记录推断的风险、冲突域、测试命令、评审策略、环境适配器、核实结果以及任何裁定。
references/recovery.mdscripts/run_state.py init对于已存在的运行,不得再次初始化。遵循中的恢复协议,并在开展新工作前协调Git状态。
references/recovery.md7. Compute and classify the ready frontier
7. 计算并分类就绪边界
A ticket is ready only when every blocker is integrated and its required checkpoint passed. Infer missing conflict domains from a narrow repository inspection. Read and choose:
references/scheduling.md- Sequential: one fresh worker in the integration worktree when only one ticket is ready, domains overlap, or risk is high.
- Parallel: at most four fresh workers by default — or the concurrency cap the user declared at invocation — in isolated child workspaces when at least two dependency-independent tickets have confidently disjoint conflict domains. A user-declared cap is authoritative: apply it without demanding prior-run evidence, but still lower it when the repository or test environment is fragile, and never exceed the invariants (no concurrent writers in one checkout, disjoint domains only).
Record the chosen wave base. Start every parallel child from that exact integration commit.
仅当工单的所有阻塞项都已集成且所需检查点通过后,工单才处于就绪状态。通过有限的仓库检查推断缺失的冲突域。读取并选择执行模式:
references/scheduling.md- 串行: 当仅一个工单就绪、冲突域重叠或风险较高时,在集成worktree中使用一个全新的worker。
- 并行: 当至少两个无依赖的工单具有明确不相交的冲突域时,在隔离的子工作区中使用默认最多四个全新worker——或用户调用时声明的并发上限。用户声明的上限具有权威性:无需要求先前运行的证据即可执行,但当仓库或测试环境脆弱时仍需降低上限,且永远不得违反不变式(单个工作区中不得有并发写入,仅允许不相交的冲突域)。
记录所选波次的基准提交。所有并行子worker都必须从该确切的集成提交启动。
8. Dispatch bounded implementers
8. 调度有界的实现worker
Render for each ticket. Supply the full ticket, compact global constraints, precise specification/ADR pointers, relevant repository instructions, dependency commit/interface notes, workspace path, expected base SHA, and report path.
templates/implementer-prompt.mdDo not supply the full interview, all tickets, unrelated reports, or accumulated controller history. Target an initial context below approximately 20k tokens when observable; treat 40k as a warning. Prepare a narrower excerpt or split the ticket instead of silently filling a large context window.
Use the adapter in . Prefer structured return fields when supported. A worker may finish as , , , , or .
references/adapters.mdCOMPLETEBLOCKEDNEEDS_CONTEXTNEEDS_SPLITFAILEDIf a dispatched worker stalls — no progress and no result — cancel it after a bounded window: twice the median duration of completed workers this run, with a floor of ten minutes; a window the user declared at invocation overrides the default. Preserve any partial workspace for inspection, and either redispatch once from a fresh worker or complete that step yourself in the controller. Record the intervention, its window, and its reason in the ledger either way; a silently absorbed stall is a lost audit event.
为每个工单渲染。提供完整工单、精简的全局约束、精确的规范/ADR指针、相关的仓库说明、依赖提交/接口说明、工作区路径、预期基准SHA以及报告路径。
templates/implementer-prompt.md不得提供完整的对话历史、所有工单、无关报告或累积的控制器历史。在可观测的情况下,初始上下文目标约为20k tokens以下;40k视为警告阈值。需准备更精简的摘录或拆分工单,而非静默填满大上下文窗口。
使用中的适配器。支持时优先使用结构化返回字段。worker的完成状态可能为、、、或。
references/adapters.mdCOMPLETEBLOCKEDNEEDS_CONTEXTNEEDS_SPLITFAILED如果已调度的worker停滞——无进展也无结果——在有界的时间窗口后取消它:时间窗口为本次运行已完成worker的中位时长的两倍,最低为十分钟;用户调用时声明的窗口优先于默认值。保留所有部分完成的工作区以供检查,要么重新调度一个全新的worker,要么由控制器自行完成该步骤。无论哪种方式,都需在台账中记录干预行为、时间窗口及原因;静默处理的停滞会丢失审计事件。
9. Verify and integrate each result
9. 验证并集成每个结果
For a complete result, run the verification, packaging, and state transition as one shell invocation per result rather than separate steps — controller round-trips between collection actions measured roughly a fifth of a four-ticket run's wall time:
- Confirm the report exists and the claimed commit/patch belongs to the assigned base and workspace.
- Confirm focused tests, a relevant component check, and self-review are recorded.
- Package the complete change:
bash
python3 <skill-dir>/scripts/package_diff.py \
--repo <workspace> \
--base <ticket-base-sha> \
--head <ticket-head-sha> \
--ticket <ticket-id> \
--output <run-dir>/diffs/<ticket-id>.md- Apply the risk policy in . Render
references/verification-policy.mdwhen review is required.templates/reviewer-prompt.md - If approved, integrate with deterministic Git. Confirm the ticket head is an ancestor of the integration head, then run the required smoke checkpoint — unless the worker-verified and integration trees are byte-identical (equality), in which case record the equal tree hashes as checkpoint evidence per the elision rule in
git rev-parse <sha>^{tree}.references/verification-policy.md - Persist every transition with , recording measurements from the worker result at collection time — duration and context size are only reliably observable now, and backfilled numbers are guesses.
scripts/run_state.py transition --quietprints a one-line summary instead of the full state JSON, which at scale is tens of KiB per call;--quietand the ledger remain the authoritative record.state.json
A result with no repository change integrates nothing: confirm its artifacts landed at their assigned run-directory paths and transition the ticket to with the report as evidence. A result with a commit ends ; do not restamp it after its checkpoint — record the checkpoint pass in the ledger instead.
verifiedintegratedverifiedFor review failure, perform no more than two repair rounds. Resume the original worker only when its workspace survives; otherwise dispatch a fresh repair worker with the exact findings and current evidence.
For a real merge conflict, preserve both sides and render . Do not let a general merger agent reinterpret a clean integration.
templates/conflict-resolver-prompt.md对于已完成的结果,将验证、打包和状态转换作为单个shell调用执行,而非分步骤进行——据测算,收集操作之间的控制器往返约占四工单运行实际时长的五分之一:
- 确认报告存在,且声明的提交/补丁属于分配的基准和工作区。
- 确认聚焦测试、相关组件检查和自评审均已记录。
- 打包完整变更:
bash
python3 <skill-dir>/scripts/package_diff.py \
--repo <workspace> \
--base <ticket-base-sha> \
--head <ticket-head-sha> \
--ticket <ticket-id> \
--output <run-dir>/diffs/<ticket-id>.md- 应用中的风险策略。需要评审时渲染
references/verification-policy.md。templates/reviewer-prompt.md - 若获得批准,使用确定性Git进行集成。确认工单头是集成分支头的祖先,然后运行所需的冒烟检查点——除非worker验证的树与集成树是字节相同的(相等),这种情况下根据
git rev-parse <sha>^{tree}中的省略规则,将相等的树哈希记录为检查点证据。references/verification-policy.md - 使用持久化每个状态转换,在收集时记录worker结果的度量数据——时长和上下文大小只有此时是可可靠观测的,回填的数值只是猜测。
scripts/run_state.py transition --quiet会打印一行摘要而非完整的状态JSON,在大规模场景下每次调用会产生数十KiB的输出;--quiet和台账仍是权威记录。state.json
没有仓库变更的结果无需集成:确认其制品已放置到分配的运行目录路径中,并将工单状态转换为,以报告作为凭证。有提交的结果状态为;不得在检查点通过后将其重新标记为——而是将检查点通过记录在台账中。
verifiedintegratedverified对于评审失败的情况,最多进行两轮修复。仅当原始worker的工作区仍存在时才恢复它;否则调度一个全新的修复worker,提供确切的发现和当前证据。
对于真实的合并冲突,保留双方内容并渲染。不得让通用合并Agent重新解释干净的集成。
templates/conflict-resolver-prompt.md10. Advance by waves
10. 按波次推进
Advance per ticket, not per wave: as soon as one ticket's integration checkpoint passes, recompute the frontier from durable state and dispatch newly ready work — do not hold a dependent back for a sibling ticket that is still under review. Only high-risk runs keep a wave-wide barrier (smoke before any further dispatch). Reviews of independent tickets are read-only: batch them concurrently instead of serially. Newly unblocked work starts from the updated integration head. Repeat dispatch, verification, and integration until no incomplete ticket remains or the run becomes blocked.
When no ticket is ready but incomplete tickets remain, diagnose an invalid state, unresolved failure, or unrecorded ruling. Do not guess.
按工单而非按波次推进:一旦某个工单的集成检查点通过,就从持久化状态重新计算就绪边界,并调度新的就绪工作——不要为了仍在评审的兄弟工单而阻塞依赖它的工单。只有高风险运行才保留波次级屏障(在进一步调度前进行冒烟测试)。独立工单的评审是只读的:可并发批量执行,而非串行。新解除阻塞的工作从更新后的集成分支头启动。重复调度、验证和集成流程,直到没有未完成的工单或运行被阻塞。
当没有就绪工单但仍有未完成工单时,需诊断是否存在无效状态、未解决的故障或未记录的裁定。不得猜测。
11. Run the final gate
11. 执行最终门禁
Package the full original-base-to-integration-head diff. Run the configured full suite and the requirements-aware final branch review () concurrently: both are read-only against the same final head, so there is no reason to serialize them. The full suite must pass at the final head — after a fix wave, rerun it only when the fix changed code.
templates/final-review-prompt.mdIf changes are requested, perform one consolidated fix wave and one scoped re-review. Mark the run complete only when all intended tickets are integrated, required checks pass, and the final verdict is .
PASS打包从原始基准到集成分支头的完整diff。并发运行配置的完整测试套件和感知需求的最终分支评审():两者对同一个最终头都是只读的,因此没有理由串行执行。完整测试套件必须在最终头上通过——修复波次后,仅当修复修改了代码时才重新运行。
templates/final-review-prompt.md如果请求变更,执行一次合并的修复波次和一次范围受限的复评审。仅当所有预期工单都已集成、所需检查都通过且最终结论为时,才将运行标记为完成。
PASS12. Measure, report, and clean up safely
12. 度量、报告与安全清理
Measure critical-path wall time per accepted change rather than worker count. Record duration and worker context size at collection time — derives ticket duration from its recorded timestamps, and the dispatch result (on OMP, the task completion notification) is the only place token totals exist before they are gone. Summarize ticket duration, worker context size, agent seats, repair rounds, merge conflicts, worktree overhead, and human interventions. Treat routine worker context above 64k tokens, mandatory merger agents on clean integrations, or frequent parallel conflicts as policy failures to investigate rather than normal costs.
run_state.pyReport the integration branch and head, completed tickets, exact tests, review outcomes, rulings, corroboration outcomes, deferred observations, unresolved risks, measurements, and workspace disposition. Distinguish passed, failed, and skipped checks.
Offer cleanup. Remove only integrated child worktrees that hold no changes beyond regenerable build artifacts (, caches, , , build output) — artifacts are safe to destroy with once verified as the only residue; a workspace with real uncommitted changes is never force-removed. Never delete the run ledger or branches without explicit user instruction. Keep the run directory in the main checkout's ignored path (or outside the repository) — never inside a worktree that teardown removes — so the ledger, reports, and reviews survive cleanup as the run's audit record.
__pycache__node_modulesdistgit worktree remove --force度量每个已接受变更的关键路径实际时长,而非worker数量。在收集时记录时长和worker上下文大小——从记录的时间戳推导工单时长,而调度结果(在OMP上是任务完成通知)是token总数消失前唯一存在的地方。汇总工单时长、worker上下文大小、Agent席位、修复轮次、合并冲突、worktree开销和人工干预。将常规worker上下文超过64k tokens、干净集成时强制使用合并Agent,或频繁出现并行冲突视为需要调查的策略失败,而非正常成本。
run_state.py报告集成分支与头提交、已完成工单、确切测试内容、评审结果、裁定、核实结果、延迟观察项、未解决风险、度量数据和工作区处置情况。区分通过、失败和跳过的检查。
提供清理选项。仅移除那些除了可再生构建制品(、缓存、、、构建输出)之外没有其他变更的已集成子worktree——一旦确认这些制品是唯一的残留物,就可以用安全删除;具有真实未提交变更的工作区严禁强制移除。未经用户明确指示,不得删除运行台账或分支。将运行目录保存在主工作区的被忽略路径中(或仓库之外)——绝不能放在会被拆除操作删除的worktree内部——这样台账、报告和评审记录会在清理后保留,作为运行的审计记录。
__pycache__node_modulesdistgit worktree remove --forceSuccess contract
成功契约
A successful run produces:
| Artifact | Requirement |
|---|---|
| Integration branch | Contains every accepted ticket commit and no unreviewed conflict resolution. |
| Reconcile with Git and support restart without redispatching integrated work. |
| Ticket reports and reviews | Provide acceptance evidence through file pointers. |
| Final diff package | Covers the complete base-to-head change. |
| Verification record | Lists exact commands and truthful outcomes. |
| Final response | States what changed, where it lives, what passed, and what remains. |
| 制品 | 要求 |
|---|---|
| 集成分支 | 包含所有已接受的工单提交,且无未评审的冲突解决方案。 |
| 与Git状态一致,支持重启且无需重新调度已集成的工作。 |
| 工单报告与评审 | 通过文件指针提供验收证据。 |
| 最终diff包 | 覆盖从基准到头提交的完整变更。 |
| 验证记录 | 列出确切的命令和真实的结果。 |
| 最终响应 | 说明变更内容、所在位置、通过的检查以及剩余问题。 |