ai-sdlc-runtime
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseai-sdlc-runtime: Resumable Delivery Runs
ai-sdlc-runtime:可恢复交付运行
Internal AI SDLC skill, not client-facing by default. Every rule below is important to follow. None of it can be skipped. The journal is authoritative; complete state is a recoverable TOON-first projection.
内部AI SDLC技能,默认不面向客户。 以下每条规则都必须遵守,不可跳过任何一条。 日志是权威来源;完整状态是可恢复的TOON优先投影。
0. Skill Card
0. 技能卡片
- Skill name:
ai-sdlc-runtime - Primary audience: Dev, Delivery
- Supporting audience: QA, Release, Architecture
- Audience tags: Dev, Delivery, QA, Release
- SDLC stage: Controlled execution
- Purpose: Persist task selection and outcomes so interrupted delivery can resume without duplicate work or unsupported completion claims.
- Output: , exact
_ai_sdlc/runs/<run-id>/journal.jsonl, and complete token-efficientstate.jsonstate.toon
- 技能名称:
ai-sdlc-runtime - 主要受众:开发人员(Dev)、交付人员(Delivery)
- 支持受众:质量保证(QA)、发布人员(Release)、架构师(Architecture)
- 受众标签:Dev、Delivery、QA、Release
- SDLC阶段:受控执行
- 用途:持久化任务选择和结果,使中断的交付无需重复工作或提出未获支持的完成声明即可恢复。
- 输出:、精确的
_ai_sdlc/runs/<run-id>/journal.jsonl以及完整的令牌高效型state.jsonstate.toon
0.1 Required Inputs
0.1 必填输入
- Versioned run plan, safe run ID, dependency graph, task input fingerprints, retry limits, budgets, and commit-boundary flags.
- Exact result fingerprint, token use, commit evidence, and reason when recording.
- 版本化运行计划、安全运行ID、依赖图、任务输入指纹、重试限制、预算和提交边界标志。
- 记录时需提供精确的结果指纹、令牌使用量、提交证据和原因。
0.2 Clarification Rules
0.2 澄清规则
- Ask when task outcome, result identity, commit evidence, or stop reason is missing.
- Reject unknown tasks, invalid transitions, dependency cycles, and journal gaps.
- Never mark an unrecorded task complete from conversational confidence.
- 当任务结果、结果标识、提交证据或停止原因缺失时,需主动询问。
- 拒绝未知任务、无效过渡、依赖循环和日志间隙。
- 绝不能仅凭对话信心标记未记录的任务为已完成。
0.2.1 Flow Mode Flags
0.2.1 流模式标志
- Support and
--quick-flow; full flow takes precedence.--full-flow - Both modes use the same journal, idempotency, dependency, budget, and commit rules.
- Full flow reviews every event, retry, stop reason, and commit boundary.
- 支持和
--quick-flow;全流程(full flow)优先级更高。--full-flow - 两种模式使用相同的日志、幂等性、依赖、预算和提交规则。
- 全流程会审核每个事件、重试、停止原因和提交边界。
0.3 Output Rules
0.3 输出规则
- Report run status, sequence, current task, ready tasks, budgets, stop reason, recovery status, and next command.
- Return validation and handoff summaries directly in the Codex response.
- Emit with
ai-sdlc-handoff/v1,result,blockers, andnext_required; actions includenext_optional,reason, andcommand.expected_artifact - Do not create ,
summary.txt, or another standalone summary file.*-summary.txt
- 报告运行状态、序列、当前任务、就绪任务、预算、停止原因、恢复状态和下一条命令。
- 在Codex响应中直接返回验证和交接摘要。
- 发送包含、
result、blockers和next_required的next_optional;操作包含ai-sdlc-handoff/v1、reason和command。expected_artifact - 请勿创建、
summary.txt或其他独立摘要文件。*-summary.txt
0.4 Artifact Routing
0.4 工件路由
- Route each run only to .
_ai_sdlc/runs/<run-id>/ - Keep journal append-only, JSON recovery state atomically replaceable, and TOON state as the complete agent-facing projection.
- Never store runtime records inside a feature spec folder.
- 每个运行仅路由至。
_ai_sdlc/runs/<run-id>/ - 保持日志为仅追加模式,JSON恢复状态可原子替换,TOON状态为面向Agent的完整投影。
- 切勿在功能规格文件夹内存储运行时记录。
0.5 Feature State Machine
0.5 功能状态机
- Read the owning feature before starting feature work.
_ai_sdlc/state.toon - Runtime task state does not replace feature ; the owning workflow performs feature transitions only after runtime and validation evidence agree.
state.toon
- 在开始功能工作前,读取所属功能的。
_ai_sdlc/state.toon - 运行时任务状态不会替换功能;只有当运行时和验证证据一致后,所属工作流才会执行功能过渡。
state.toon
0.6 Artifact Metadata And Metatags
0.6 工件元数据和元标签
- Runtime-related Markdown uses canonical and
artifact_metadata.metatags - Machine records use ,
ai-sdlc-run-plan/v1, andai-sdlc-run-event/v1with deterministic fingerprints.ai-sdlc-run-state/v1
- 运行时相关Markdown使用标准的和
artifact_metadata。metatags - 机器记录使用带有确定性指纹的、
ai-sdlc-run-plan/v1和ai-sdlc-run-event/v1。ai-sdlc-run-state/v1
0.7 Specs Index
0.7 规格索引
- Read first and use
_ai_sdlc/specs-index.toonfor human feature discovery before constructing a plan.specs-index.md - Runtime state does not refresh either specs index.
- 首先读取,并在构建计划前使用
_ai_sdlc/specs-index.toon进行人工功能发现。specs-index.md - 运行时状态不会刷新任何一个规格索引。
References
参考资料
- Read before starting, resuming, retrying, or recording a run.
references/runtime-contract.md - Validate plans with , events with
references/run-plan.schema.json, and state withreferences/run-event.schema.json.references/run-state.schema.json - Use for every state mutation and recovery operation.
scripts/runtime.py
- 在启动、恢复、重试或记录运行前,阅读。
references/runtime-contract.md - 使用验证计划,
references/run-plan.schema.json验证事件,references/run-event.schema.json验证状态。references/run-state.schema.json - 所有状态变更和恢复操作均使用。
scripts/runtime.py
Script Usage
脚本用法
bash
python3 skills/ai-sdlc-runtime/scripts/runtime.py . --start --run-id delivery-004 --plan run-plan.json --format toon
python3 skills/ai-sdlc-runtime/scripts/runtime.py . --next --run-id delivery-004 --format toon
python3 skills/ai-sdlc-runtime/scripts/runtime.py . --record --run-id delivery-004 --task T001 --outcome succeeded --result-fingerprint <sha256> --tokens 420 --commit <sha>
python3 skills/ai-sdlc-runtime/scripts/runtime.py . --resume --run-id delivery-004 --format toonbash
python3 skills/ai-sdlc-runtime/scripts/runtime.py . --start --run-id delivery-004 --plan run-plan.json --format toon
python3 skills/ai-sdlc-runtime/scripts/runtime.py . --next --run-id delivery-004 --format toon
python3 skills/ai-sdlc-runtime/scripts/runtime.py . --record --run-id delivery-004 --task T001 --outcome succeeded --result-fingerprint <sha256> --tokens 420 --commit <sha>
python3 skills/ai-sdlc-runtime/scripts/runtime.py . --resume --run-id delivery-004 --format toonPurpose
用途
Make long-running delivery resumable, bounded, and auditable without coupling
the durable task state to one agent host or chat session.
使长期运行的交付具备可恢复性、有界性和可审计性,同时无需将持久任务状态绑定到单个Agent主机或聊天会话。
Inputs
输入
- Immutable plan identity and ordered task IDs with dependencies.
- Per-task maximum attempts and commit-boundary requirement.
- Run-level maximum task starts, failures, and recorded tokens.
- Exact outcome evidence for each started task.
- 不可变的计划标识和带有依赖关系的有序任务ID。
- 每个任务的最大尝试次数和提交边界要求。
- 运行级别的最大任务启动次数、失败次数和记录令牌数。
- 每个已启动任务的精确结果证据。
Steps
步骤
- Validate plan identity, unique tasks, dependency existence, and acyclicity.
- Start one atomically created run workspace.
- Call ; repeated calls return the same running task without another event.
--next - Execute the task through the owning host and workflow.
- Record succeeded, failed, or blocked with exact evidence and resource use.
- Let retryable failures return to pending; inspect terminal retry or budget stops.
- Use only for an eligible blocked or failed task after its cause is resolved.
--retry - Use to replay and hash-check the journal and repair stale state.
--resume
- 验证计划标识、任务唯一性、依赖存在性和无环性。
- 启动一个原子创建的运行工作区。
- 调用;重复调用会返回相同的运行中任务,不会生成新事件。
--next - 通过所属主机和工作流执行任务。
- 记录成功、失败或阻塞状态,并附带精确证据和资源使用情况。
- 可重试的失败任务返回待处理状态;检查终端重试或预算停止情况。
- 仅在原因解决后,对符合条件的阻塞或失败任务使用。
--retry - 使用重放并哈希检查日志,修复过期状态。
--resume
Output Spec
输出规格
The hash-chained JSONL journal stores contiguous sequence numbers and transition
payloads. Exact JSON state supports deterministic replay comparison. Complete
TOON state exposes the plan identity, task states and attempts, running and ready
tasks, budgets, stop reason, sequence, and fingerprint to agents. Replay must
reproduce both projections.
Quality gate:
- Pass when journal chain and replay are valid, dependencies are satisfied, budgets remain, outcome evidence is complete, and commit-boundary tasks carry commit identity.
- Fail when a transition duplicates work, skips dependencies, exceeds a hard boundary, omits evidence, or conflicts with journal history.
哈希链式JSONL日志存储连续序列号和过渡负载。精确的JSON状态支持确定性重放比较。完整的TOON状态向Agent公开计划标识、任务状态和尝试次数、运行中和就绪任务、预算、停止原因、序列和指纹。重放必须能重现这两种投影。
质量门:
- 当日志链和重放有效、依赖已满足、预算剩余、结果证据完整,且提交边界任务带有提交标识时,视为通过。
- 当过渡存在重复工作、跳过依赖、超出硬边界、遗漏证据或与日志历史冲突时,视为失败。
Examples
示例
A repeated after T001 was claimed returns T001 with
and does not increase attempts or journal sequence. A repeated identical success
record also returns the existing outcome without another event.
--nextidempotent: true在T001被认领后重复调用,会返回带有的T001,且不会增加尝试次数或日志序列。重复提交相同的成功记录也会返回现有结果,不会生成新事件。
--nextidempotent: trueEdge Cases
边缘情况
- Corrupt or missing summarized state is repaired from a valid journal.
- A journal sequence gap, hash mismatch, or invalid transition fails recovery.
- Retry exhaustion and each budget type have distinct stop reasons.
- A commit-boundary task cannot succeed with a missing or malformed commit SHA.
- 损坏或缺失的汇总状态可通过有效日志修复。
- 日志序列间隙、哈希不匹配或无效过渡会导致恢复失败。
- 重试耗尽和每种预算类型都有不同的停止原因。
- 提交边界任务若缺少格式错误的提交SHA,则无法标记为成功。
Scope Boundary
范围边界
- Do not execute task commands, create commits, satisfy gates, or approve work.
- Do not edit journal lines, plan identity, attempts, budgets, or fingerprints manually.
- Do not run two mutating runtime commands concurrently for one run.
- Declarative workflow steps and host execution belong to later workflow and adapter layers.
- 请勿执行任务命令、创建提交、满足检查门或批准工作。
- 请勿手动编辑日志行、计划标识、尝试次数、预算或指纹。
- 请勿针对同一运行同时执行两个变更运行时的命令。
- 声明式工作流步骤和主机执行属于后续工作流和适配器层。