phase-contract
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePhase Contract (internal)
阶段合约(内部)
The one authoritative owner of phase shape for this workflow. Planners lint
every phase they emit against the eight rules below; re-checks
the same rules before any edit. Nothing else may define what a valid phase is.
execute-phase本工作流中阶段形态的唯一权威定义方。规划器会针对其生成的每个阶段,按照以下八项规则进行校验; 在执行任何编辑前会重新检查相同规则。任何其他组件均不得定义有效阶段的标准。
execute-phaseWhen to use
使用场景
- — lint every phase of a feature plan before emission.
plan-feature-scaffold - — lint every phase of a fix SPEC before commit.
plan-fix - — phase-lint pre-flight guard before editing a phase.
execute-phase - Templates store the contract version + fingerprint + lint result, never the eight rules (they point here).
- —— 在生成功能计划的每个阶段前,对其进行 lint 校验。
plan-feature-scaffold - —— 在提交修复 SPEC 前,对其每个阶段进行 lint 校验。
plan-fix - —— 在编辑阶段前,执行阶段 lint 预检防护。
execute-phase - 模板存储合约版本、指纹以及 lint 结果,不会存储八项规则(而是指向本合约)。
The eight phase-lint rules
八项阶段 lint 规则
Every implementation phase must pass all 8 boxes before it is emitted (planner
skills) or executed ( pre-flight). Fail-closed: any unticked box
blocks emission/execution until the phase is re-cut or split.
execute-phase- Title names ONE deliverable — FAIL if it joins nouns with ,
+,,,&/and, ory./ - One declared layer — each phase declares exactly one of the fixed enum
; FAIL if any task's target file belongs to another. Tests for the phase's own layer belong to the phase; a test-only phase declares
schema/db | domain | api | ui | config/infra | docs | hardening | close-out.hardening - ≤ 8 tasks (close-out phase: ≤ 10, only the literal close-out chain).
- One checkbox = one deliverable — FAIL if a task contains a chain of implementation steps, enumerates > 3 cases/scenarios, or creates > 1 file of distinct concerns.
→ - Zero decision words — FAIL on ,
Decide,choosebetween alternatives,OR.If … then <change scope> - No conditional scope mutation — a task may not move work between phases at runtime.
- No external/manual gates inside implementation phases —
human/out-of-repo verifications live in the hardening/close-out phase,
marked .
manual - Machine-checkable done-when — every phase ends with one verifiable invariant (a command + expected outcome).
每个实施阶段在生成(规划器技能)或执行( 预检)前,必须满足全部8项要求。采用关闭失败机制:任何未满足的项都会阻止发布/执行,直到阶段被重新划分或拆分。
execute-phase- 标题仅命名一个交付物 —— 若标题使用 、
+、、、&/and或y连接多个名词,则校验失败。/ - 仅声明一个层级 —— 每个阶段需明确声明固定枚举值中的一个:;若任何任务的目标文件属于其他层级,则校验失败。阶段自身层级的测试属于该阶段;仅包含测试的阶段需声明为
schema/db | domain | api | ui | config/infra | docs | hardening | close-out。hardening - 任务数 ≤ 8(收尾阶段:任务数 ≤ 10,仅包含字面意义上的收尾流程)。
- 一个复选框对应一个交付物 —— 若任务包含由 连接的实施步骤链、列举超过3种情况/场景,或创建多个涉及不同关注点的文件,则校验失败。
→ - 无决策类词汇 —— 若出现 、
Decide、备选方案间的choose、OR(如果…则<变更范围>),则校验失败。If … then <change scope> - 无条件性范围变更 —— 任务不得在运行时将工作在不同阶段间转移。
- 实施阶段内无外部/人工闸门 —— 人工或仓库外的验证需放在 hardening/收尾阶段,并标记为 。
manual - 可机器校验的完成条件 —— 每个阶段需以一个可验证的不变式(命令+预期结果)结尾。
Result — fixed PASS/BLOCKED output
结果——固定的 PASS/BLOCKED 输出
text
Phase-lint: PASS (8/8)or, on the first failing box:
text
Phase-lint: BLOCKED — box <n>: <one-line reason>A BLOCKED phase is re-cut or split; it is never emitted, committed, or executed
as-is (no bypass exists for a non-atomic phase — that decision belongs
to the user).
--forcetext
Phase-lint: PASS (8/8)或在首次校验失败时输出:
text
Phase-lint: BLOCKED — box <n>: <one-line reason>BLOCKED 状态的阶段需重新划分或拆分;不得直接发布、提交或执行(针对非原子阶段,不存在 绕过选项——该决策由用户做出)。
--forceNormalized phase fingerprint
标准化阶段指纹
Each phase's fingerprint is a deterministic string over the phase's shape:
. It binds the lint result to the
exact phase version a plan committed to — templates and plans record
so later re-lints and
can confirm nothing in the phase shape drifted since planning.
P<n>:<layer>:<n-tasks>:<title-deliverable>Phase-lint: PASS (8/8) · fingerprint <fingerprint>execute-phase每个阶段的指纹是基于阶段形态生成的确定性字符串:。它将 lint 结果与计划所提交的具体阶段版本绑定——模板和计划会记录 ,以便后续重新校验和 确认阶段形态自规划以来未发生偏离。
P<n>:<layer>:<n-tasks>:<title-deliverable>Phase-lint: PASS (8/8) · fingerprint <fingerprint>execute-phaseGuardrails
防护准则
- Sole owner of the eight rules — planners and executor point here, never carry their own copy.
- Never relax a rule to let a phase pass; re-cut the phase instead.
- Docs only — no code, no branch.
- 八项规则的唯一所有者——规划器和执行器均指向本合约,不得自行存储规则副本。
- 不得放宽规则使阶段通过校验;应重新划分阶段。
- 仅为文档——无代码、无分支。