@buildr-ai/buildr 0.1.0-rc.21 → 0.1.0-rc.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/application-payload.json +167 -155
  2. package/installation-origin.json +5 -5
  3. package/package/targets/test-context/definition.d.ts +7 -0
  4. package/package/targets/test-context/definition.js +114 -0
  5. package/package/targets/test-context/index.d.ts +5 -0
  6. package/package/targets/test-context/index.js +4 -0
  7. package/package/targets/test-context/node-runner-cli.d.ts +2 -0
  8. package/package/targets/test-context/node-runner-cli.js +60 -0
  9. package/package/targets/test-context/node-runner.d.ts +2 -0
  10. package/package/targets/test-context/node-runner.js +86 -0
  11. package/package/targets/test-context/node-test.d.ts +14 -0
  12. package/package/targets/test-context/node-test.js +93 -0
  13. package/package/targets/test-context/runtime.d.ts +2 -0
  14. package/package/targets/test-context/runtime.js +342 -0
  15. package/package/targets/test-context/types.d.ts +216 -0
  16. package/package/targets/test-context/types.js +1 -0
  17. package/package.json +11 -1
  18. package/payload/licenses/dependencies/ajv-LICENSE +22 -0
  19. package/payload/product/package/targets/runtime/skills/buildr/SKILL.md +7 -7
  20. package/payload/product/package.json +2 -1
  21. package/payload/product/{package/bootstrap/contract.yml → resources/contracts/bootstrap.yml} +1 -1
  22. package/payload/product/{package → resources}/manifest.yml +95 -91
  23. package/payload/product/resources/workspace/AGENTS.md +9 -0
  24. package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/component.yml +3 -3
  25. package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-apply-sidebar.md +1 -1
  26. package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-propose-sidebar.md +1 -1
  27. package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-update-sidebar.md +1 -1
  28. package/payload/product/resources/workspace/rules/buildr/core.md +40 -0
  29. package/payload/product/{package/targets → resources}/workspace/skills/buildr/current-knowledge-maintenance/SKILL.md +4 -4
  30. package/payload/product/{package/targets → resources}/workspace/skills/buildr/declaration-intake/SKILL.md +14 -8
  31. package/payload/product/{package/targets → resources}/workspace/skills/buildr/git-operations/SKILL.md +5 -5
  32. package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-development/SKILL.md +34 -16
  33. package/payload/product/resources/workspace/skills/buildr/task-environment/SKILL.md +55 -0
  34. package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-environment/references/project-environment-preparation-v1.md +1 -1
  35. package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-environment/templates/task-environment-plan-request.json +2 -1
  36. package/payload/product/resources/workspace/skills/buildr/task-finish/SKILL.md +79 -0
  37. package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-manager/SKILL.md +9 -1
  38. package/payload/product/resources/workspace/skills/buildr/task-manager/agents/openai.yaml +4 -0
  39. package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-triage/SKILL.md +17 -9
  40. package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-verification/SKILL.md +23 -15
  41. package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-verification/references/project-verification-v2.md +3 -1
  42. package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-verification/templates/project-verification.yml +6 -0
  43. package/payload/product/{package/targets/workspace/skills/buildr/ui-preview → resources/workspace/skills/buildr/ui-prototype}/SKILL.md +14 -12
  44. package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/current-knowledge-maintenance/v2.md +3 -3
  45. package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/git-operations/v1.md +1 -1
  46. package/payload/product/resources/workspace/skills/contracts/buildr/task-development/v2.md +67 -0
  47. package/payload/product/resources/workspace/skills/contracts/buildr/task-environment/v1.md +37 -0
  48. package/payload/product/resources/workspace/skills/contracts/buildr/task-finish/v1.md +43 -0
  49. package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/task-record/v2.md +1 -1
  50. package/payload/product/resources/workspace/skills/contracts/buildr/task-verification/v3.md +67 -0
  51. package/payload/product/src/infrastructure/sqlite/migrations/0018_create_terminal_contribution_reconciliations.sql +19 -0
  52. package/payload/product/web-dist/assets/index-BnXBiObM.css +1 -0
  53. package/payload/product/web-dist/assets/index-CbM3dspL.js +39 -0
  54. package/payload/product/{src/interfaces/local-app/web-dist → web-dist}/index.html +2 -2
  55. package/payload/runtime/read-worker.cjs +53751 -34167
  56. package/runtime/buildr.cjs +53599 -39369
  57. package/test-context.mjs +12 -0
  58. package/payload/product/package/README.md +0 -42
  59. package/payload/product/package/targets/workspace/AGENTS.md +0 -5
  60. package/payload/product/package/targets/workspace/rules/buildr/core.md +0 -62
  61. package/payload/product/package/targets/workspace/skills/buildr/task-environment/SKILL.md +0 -42
  62. package/payload/product/package/targets/workspace/skills/buildr/task-finish/SKILL.md +0 -80
  63. package/payload/product/package/targets/workspace/skills/buildr/task-manager/agents/openai.yaml +0 -4
  64. package/payload/product/package/targets/workspace/skills/contracts/buildr/task-development/v2.md +0 -61
  65. package/payload/product/package/targets/workspace/skills/contracts/buildr/task-environment/v1.md +0 -37
  66. package/payload/product/package/targets/workspace/skills/contracts/buildr/task-finish/v1.md +0 -59
  67. package/payload/product/package/targets/workspace/skills/contracts/buildr/task-verification/v3.md +0 -63
  68. package/payload/product/src/interfaces/local-app/web-dist/assets/index-BqoyfMSY.css +0 -1
  69. package/payload/product/src/interfaces/local-app/web-dist/assets/index-DTqvE0TF.js +0 -39
  70. /package/payload/product/{package/bootstrap/guide.md → docs/bootstrap-guide.md} +0 -0
  71. /package/payload/product/{package/launchers/assets → resources/installation/launcher}/Buildr.icns +0 -0
  72. /package/payload/product/{package/launchers/assets → resources/installation/launcher}/Buildr.ico +0 -0
  73. /package/payload/product/{package/targets → resources}/workspace/commands/buildr/openspec/manifest.yml +0 -0
  74. /package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-archive-converge.md +0 -0
  75. /package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-explore-terminology.md +0 -0
  76. /package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-sync-converge.md +0 -0
  77. /package/payload/product/{package/targets → resources}/workspace/gitattributes +0 -0
  78. /package/payload/product/{package/targets → resources}/workspace/gitignore +0 -0
  79. /package/payload/product/{package/targets → resources}/workspace/projects/AGENTS.project.md +0 -0
  80. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/capability-adaptation/SKILL.md +0 -0
  81. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/capability-adaptation/agents/openai.yaml +0 -0
  82. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/openspec-contract-guard/SKILL.md +0 -0
  83. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/project-daily-progress/SKILL.md +0 -0
  84. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/project-testing/SKILL.md +0 -0
  85. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/project-testing/references/testing-model-v1.md +0 -0
  86. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-environment/agents/openai.yaml +0 -0
  87. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-environment/templates/project-preparation.yml +0 -0
  88. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-retrospective/SKILL.md +0 -0
  89. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-retrospective/agents/openai.yaml +0 -0
  90. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-review/SKILL.md +0 -0
  91. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-review/agents/openai.yaml +0 -0
  92. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-worktree/SKILL.md +0 -0
  93. /package/payload/product/{package/targets → resources}/workspace/skills/buildr/terminology-governance/SKILL.md +0 -0
  94. /package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/current-knowledge-maintenance/v1.md +0 -0
  95. /package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/git-worktree-provider/v1.md +0 -0
  96. /package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/task-retrospective/v2.md +0 -0
  97. /package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/task-review/v1.md +0 -0
  98. /package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/terminology-governance/v1.md +0 -0
  99. /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-apply-change/SKILL.md +0 -0
  100. /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-archive-change/SKILL.md +0 -0
  101. /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-explore/SKILL.md +0 -0
  102. /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-propose/SKILL.md +0 -0
  103. /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-sync-specs/SKILL.md +0 -0
  104. /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-update-change/SKILL.md +0 -0
  105. /package/payload/product/{src/interfaces/local-app/web-dist → web-dist}/assets/antd-NAtxFWmu.js +0 -0
  106. /package/payload/product/{src/interfaces/local-app/web-dist → web-dist}/assets/react-9kRp7SbA.js +0 -0
@@ -0,0 +1,12 @@
1
+ export {
2
+ canonicalContextConfiguration,
3
+ closeDefaultNodeTestContextRuntime,
4
+ contextConfigurationIdentity,
5
+ contextTest,
6
+ createNodeTestContextAdapter,
7
+ createTestContextRuntime,
8
+ defaultNodeTestContextRuntime,
9
+ defineTestContext,
10
+ isTestContextDefinition,
11
+ runNodeTestContextHosts,
12
+ } from './package/targets/test-context/index.js';
@@ -1,42 +0,0 @@
1
- # Buildr
2
-
3
- 中文 | [English](https://github.com/BuildrAI/Buildr/blob/main/README.en.md)
4
-
5
- Buildr helps Agents keep building on organized work facts and work methods instead of repeatedly reconstructing project context from chats, personal experience, and disconnected repositories. It is useful for organizing an existing business and its repositories, continuing long-running work through an Agent, preserving reusable methods, and switching Agents without abandoning accumulated assets.
6
-
7
- ## Start with one real task
8
-
9
- Give your Agent this instruction:
10
-
11
- ```text
12
- Help me start using Buildr: check and install what is needed, confirm or create the current Workspace, guide me to create a Project in plain language, attach a Service only when I have a repository, application, module, or executable asset, verify the necessary setup, then ask what real work I want to do first.
13
- ```
14
-
15
- The first success is not merely running `init`. It is confirming a Workspace, a Project, an optional Service, and then giving the Agent a real goal.
16
-
17
- Buildr Web offers the same path visually in the default browser: add an existing Workspace, understand the Project and optional Service scope, and choose **Start with Agent**. It only explains scope, maintains low-risk metadata, and creates a constrained handoff prompt. It does not create repositories, migrate assets, or execute professional work. Buildr App is reserved for a future desktop product and is not implemented today.
18
-
19
- ```text
20
- Workspace → Project → Service (optional)
21
- ```
22
-
23
- - **Workspace**: the top-level directory shared by you and an Agent.
24
- - **Project**: a business, product, system, or long-lived work unit.
25
- - **Service**: an optional repository, application, module, or executable asset in a Project.
26
-
27
- ## Manual fallback
28
-
29
- When an Agent cannot perform setup, Buildr supports Node.js `>=24.15.0 <25`; each Workspace still uses the exact managed runtime version declared in its metadata:
30
-
31
- ```bash
32
- npm install --global @buildr-ai/buildr@next
33
- buildr runtime list --json
34
- buildr init --agent <agent> --target . --name <name> --profile <personal|team|company>
35
- buildr web --target .
36
- ```
37
-
38
- The current package candidate is `0.1.0-rc.11`; available versions and the `next` dist-tag are always determined by the official npm Registry.
39
-
40
- `init --agent` uses the final doctor result as technical onboarding evidence; the Agent should then complete a brief first-use handoff from the real Project and Service state.
41
-
42
- Buildr does not replace an Agent's reasoning, planning, or professional execution. It organizes durable work assets and provides deterministic tools and diagnostics. See the repository [README](https://github.com/BuildrAI/Buildr#readme), [Buildr Product](https://github.com/BuildrAI/Buildr/blob/main/projects/product/docs/buildr-product.md), [CLI Reference](https://github.com/BuildrAI/Buildr/blob/main/projects/product/services/buildr/docs/cli-reference.md), and [Runtime Adapters](https://github.com/BuildrAI/Buildr/blob/main/projects/product/services/buildr/docs/agent-runtime-adapters.md) for details.
@@ -1,5 +0,0 @@
1
- # AGENTS.md
2
-
3
- <!-- buildr:required begin -->
4
- 请读取并遵循 [Buildr Core](rules/buildr/core.md)。
5
- <!-- buildr:required end -->
@@ -1,62 +0,0 @@
1
- # Buildr Core
2
-
3
- Buildr workspace 的通用硬约束。按 root → Project → Service 读取当前 scope 的 `AGENTS.md`。
4
-
5
- ## 基本原则
6
-
7
- - Rule 只承载价值观、权威/授权边界、约束和结果不变量;root、Project 或 Service `AGENTS.md` 只能增加当前 scope 的这些内容。
8
- - Rule 不承担 Skill 路由、命令序列、生命周期、重跑/恢复、报告模板或专业状态/Result。Rule 可以命名唯一 owner 和禁止绕过的不变量,但不得复制其流程或当前状态。
9
- - Skill description 发现用户意图,Skill body 承担流程,capability binding 选择 provider,Project declaration 声明能力、适用性和证明范围,Skill/Application 维护状态与 Result;Rule 不得成为第二权威。
10
- - Rule description 只索引语义相关性,不路由路径、角色或 Service。required installed Rule 必须读取;optional installed Rule 语义相关时读取;disabled 或 uninstalled Rule 不生效。
11
- - Agent runtime adapter 只按目录发现和投射 Rule;不替 Agent 判断语义相关性。runtime 是可重建结果,不是源资产。
12
- - Buildr 采用宽而薄的治理:只有继续推进会造成越权、错误对象写入、未经授权的外部或不可逆副作用、证据失真或完成误报时才关闭式失败。其他可恢复的不确定性必须如实报告事实、风险和下一步,并保留 Agent 的安全判断与推进空间;不得把辅助证明、工具偏好或推荐工作方式固化为不必要的硬门禁。
13
- - 创建、修改、替换或卸载 Skill 前必须判断跨 Skill 依赖,并检查相关 `provides`、`requires`、capability binding、入口 routing evidence 和 consumers;不得绕过已知依赖直接激活。
14
- - Agent 组合 Buildr 管理的 Skills 时必须遵守已安装的 capability binding;不得调用已卸载 provider,也不得自行猜测存在歧义的 provider。
15
- - 已初始化 workspace 的 Git tree 改变后必须执行 workspace transition check;Buildr 安装、源资产或 Agent runtime 改变后必须运行当前 Agent 的 doctor。未清除需立即处理的 error,不得视为完成。
16
- - 面向用户使用直接、简练的中文。专业术语使用中文或“中文(English Term)”;无稳定译名时使用“中文释义(English Term)”。命令、标识、路径、错误原文和产品名可保留英文。
17
- - 没有更具体的 Project、Service 或仓库约定时,Git 提交信息的主题和正文默认使用中文;代码标识、路径、scope 和专有名词可保留原文。
18
- - 新建或重写文本文件时,最后一个非空字符后必须且只能保留一个换行符。文件末尾不得存在空白行。正确:`...\n`;错误:`...\n\n`。该限制只针对文件末尾,不限制正文内部的合理空行。
19
- - Agent 是默认操作入口;取得必要授权后直接执行。仅在用户选择手动方式或 Agent 受工具、权限、登录态、外部环境阻塞时提供手动步骤。
20
- - 没有与最终候选一致的验证证据,不得声称完整验证或完成;完成说明必须报告验证范围、结果、耗时和缺口。
21
- - `rules/manifest.yml` 是 root/Organization Rule 的登记与启停用 authority;维护流程由 Skill 承载。
22
-
23
- ## 基本模型
24
-
25
- Buildr 管理源资产和运行时投射;Agent 负责理解、推理和执行。Buildr 不保存 context window。
26
-
27
- ```text
28
- Organization/Root -> Project -> Service
29
- ```
30
-
31
- | 术语 | 含义 |
32
- |------|------|
33
- | 组织(Organization/Root) | workspace 根;拥有组织 Rules、registries、Components、Skills、Commands 和 runtime 投射关系。 |
34
- | 项目(Project) | 业务、产品线、系统或长期工作单元;拥有 Project Rules、OpenSpec、capability/applicability context 和 Service registry。 |
35
- | 服务(Service) | Project 管理的代码仓、应用、模块或可执行资产。 |
36
- | Agent runtime | 从源资产生成的可重建运行入口。 |
37
-
38
- ## 资产边界
39
-
40
- | 资产类型 | 默认位置 |
41
- |----------|----------|
42
- | 规则(Rules) | `AGENTS.md`、`rules/manifest.yml`、`rules/` |
43
- | Project registry | `projects/manifest.yml` |
44
- | 项目资产(Project assets) | `projects/<project>/` |
45
- | Service registry | `projects/<project>/services/manifest.yml` |
46
- | 服务资产(Service assets) | `projects/<project>/services/<service>/` |
47
- | 技能(Skills) | `skills/manifest.yml`、`skills/` |
48
- | 组件(Components) | `components/manifest.yml`、`components/<source>/<id>/component.yml` |
49
- | 命令(Commands) | workspace catalog:`commands/manifest.yml`、`commands/**/manifest.yml`;Project requirements:`projects/<project>/commands.yml` |
50
- | Agent runtime | `.agents/`、`.claude/`、`CLAUDE.md` 等渲染结果 |
51
-
52
- ## 硬边界
53
-
54
- - Buildr 源资产是长期事实;runtime、本机状态、凭证、临时 prompt 和一次性聊天不是源资产。
55
- - Practices 不是独立受管资产;已有 `practices/` 是用户保留数据,Buildr 不自动读取、迁移、覆盖或删除,也不因其存在阻塞正常命令。
56
- - Component 只支持 workspace scope;definition 唯一声明成员,成员只随 Component 生命周期维护。本机 CLI 和 Project 内容不属于 Component。
57
- - Commands 定义权威是 workspace catalog;Project `commands.yml` 只引用 requirement。本机 binary、版本、登录态和凭证不是源资产,Buildr 不安装或 render Commands。
58
- - Workspace 是 Skill 唯一源;Project `capabilities.yml` 只表达 requirements、bindings 和 applicability,runtime destination 不是源。
59
- - 对象级卸载命中 Component 时,Agent 必须展示完整范围和保留项并取得二次确认,CLI 不负责猜测对象边界。
60
- - 组织资产、项目资产和服务代码仓的 Git 边界必须按实际仓库判断,不得凭目录名假设。
61
- - Buildr required block 只引用 Core;Project/Service `AGENTS.md` 只增加 scope 约束,任务流程由 Skill 承载。
62
- - Buildr required Rule 由 Buildr 管理,不得手工改写;损坏时由 Buildr 恢复。
@@ -1,42 +0,0 @@
1
- ---
2
- name: task-environment
3
- description: 正式 Task 需要准备、检查、恢复或清理实际执行环境,或按 Task ID 取得 Environment Receipt 的当前机器事实时使用;不用于任务分流、Task Record、验证结论或 Git 集成。
4
- ---
5
-
6
- # Task Environment Skill
7
-
8
- 本 Skill 是 `buildr.task-environment/v1` 的默认 provider。它调用公开 CLI,不手写或解析 Environment Receipt。
9
-
10
- 开始行动时必须读取 `references/project-environment-preparation-v1.md`。只有经`declaration-intake`完成只读发现、展示精确diff并取得用户授权后,才使用`templates/project-preparation.yml`维护长期声明;提交Task选择时使用 `templates/task-environment-plan-request.json`。未经用户授权不得把候选声明写入Project。
11
-
12
- ## 使用方式
13
-
14
- 必须已有正式 Task Record,并明确 canonical Workspace:
15
-
16
- ```bash
17
- buildr task environment prepare <task-id> --agent <adapter> --target <canonical-workspace> --json
18
- buildr task environment prepare <task-id> --plan <json-file> --agent <adapter> --target <canonical-workspace> --json
19
- buildr task environment plan record <task-id> --input <json-file> --target <canonical-workspace> --json
20
- buildr task environment plan inspect <task-id> --target <canonical-workspace> --json
21
- buildr task environment inspect <task-id> --target <canonical-workspace> --json
22
- buildr task environment cleanup <task-id> --target <canonical-workspace> --json
23
- ```
24
-
25
- - `--agent`对`prepare`必填,必须写成当前宿主,例如 Cursor 会话写`cursor`、Codex 会话写`codex`。不得省略,也不得假设省略后默认为 Codex。未给`--branch`时默认任务分支为`<adapter>/<task-id>`;显式`--branch`优先。
26
- - Project可选维护closed `preparation.yml`,长期声明Project-wide或Service-scoped Recipe。Agent读取Task Record的完整Project/Service scope与构建、验证事实,只选择当前Task需要的Recipe,提交`buildr.task-environment-plan-request/v1`;Application解析声明identity并保存`buildr.task-environment-plan/v2`执行快照。没有长期声明时可显式提交`task-inline` Recipe,但不得静默回写Project。
27
- - `prepare --plan`可一次完成登记与准备;若Agent必须先检查Task checkout,可先运行无Plan的`prepare`取得受控执行根(结果明确blocked),再运行`plan record`和`prepare`。
28
- - Plan Request只是CLI的一次性输入,不是Environment资源或长期事实。需要JSON文件时,Agent必须在操作系统临时目录创建,不得写入Workspace的`.buildr/tmp/`、`.buildr/transient/`或其他受管资产目录;`prepare --plan`或`plan record`成功后必须立即删除。命令失败时,只有仍需用同一输入诊断或重试才能暂时保留,并必须报告路径;问题解决、放弃重试或Task终止后立即删除。
29
- - Application保存的resolved `buildr.task-environment-plan/v2`与`buildr.task-environment-receipt/v5`是Plan和机器状态authority;原始Plan Request不进入SQLite。Environment cleanup只清理Receipt已登记资源与provider-owned执行位置,不扫描或删除调用方临时输入。
30
- - `prepare` 同时承担首次准备和幂等恢复;只重跑输出缺失或 executable/input identity 漂移的 Step,没有单独 `restore`。
31
- - `inspect`只读重新观察已保存Plan的executable、inputs和outputs;它不执行Step、不创建或修复输出、不回写Receipt。
32
- - `cleanup` 只在 Task 已明确 abandon,或由 Task Finish 提交 durable handoff 时成立。普通 Agent 不绕过授权。
33
-
34
- ## 执行边界
35
-
36
- 取得 `ready` 后,只在结果的实际 execution roots / validation root 中写入、构建和测试,并使用结果指定的执行 CLI。Environment Receipt 独占 Runtime、CLI、Preparation Declaration/Scope/Recipe/Step、projection、动态资源、ready、恢复和总 cleanup;Task Record 不保存这些字段。Recipe只允许无 shell 的明确 executable、args、Project或Service相对cwd、input与预期output;受管Node/npm等使用`workspace-foundation` executable,其他技术栈可使用Project/Service wrapper或明确绝对executable。Buildr不实现Node/Python/Go/Rust适配器,也不扫描manifest。不得提交env、secret、stdin或任意shell。Buildr Web Environment GET只展示已保存current,不等同于CLI live inspect。
37
-
38
- 候选 Skill、CLI 与 runtime 可以在自身任务验证工作区测试,但候选不能写 retained Workspace、其他 Task worktree 或共享 user runtime,也不能认领或清理自己的 Environment。真实 Agent session 是否采用候选 runtime 属于 Task Verification,不在这里证明。
39
-
40
- ## 停止条件
41
-
42
- Task/Workspace不匹配、省略`--agent`、Plan Request未完整覆盖Task Project/Service scope、声明/Recipe identity漂移、Receipt损坏、retained Environment Manager不可信或源码dirty、provider/resource identity漂移、required Recipe/Step缺失/漂移/执行失败、必需probe blocked、执行根越界或cleanup未授权时停止,保留现场并报告具体Declaration/Scope/Recipe/Step diagnostic与next action。Task checkout/provider evidence决定源码版本;不要从cwd、分支、同一HEAD或旧worktree receipt猜ownership,retained Buildr hash同样不是ownership;也不要由Environment自动fetch/rebase。
@@ -1,80 +0,0 @@
1
- ---
2
- name: task-finish
3
- description: 用户要求已有 active formal Task 的“收尾”或交付 current formal Development handoff 时使用;在隔离交付载体(Delivery Carrier)上机械复用或进行交付适配(Delivery Adaptation)、推进 retained target 并清理 Environment,只有 Development applicability stale 才返回 Task Development。
4
- ---
5
-
6
- # Task Finish
7
-
8
- 本 Skill 只处理 active formal Task,提供 `buildr.task-finish/v1` 入口;不编排 Development/Review/Verification,不写 Receipt。没有 active Task 时用户说“收尾”,转由直接 Git 路径执行;不得创建临时 Task,也不把 Git Result 冒充 Formal Finish。
9
-
10
- ## 调用前
11
-
12
- 1. 明确正式 Task ID 与 canonical Workspace。
13
- 2. 用户排除 push、install 或 cleanup 而改变交付语义时停止。
14
- 3. 轻量确认任务分支贡献已提交、本机主工作区已对齐目标远端;`--agent`省略或等于 Environment adapter。未提交或落后时先说明并等待处理或明确继续;不得做成新的入口缺口码。
15
- 4. 不要在调用产品前自行链式做 Environment → handoff → target/remote 的 fail-fast;入口聚合与模块分类由产品一次完成。
16
- 5. 根据最终交付内容与Workspace、Project、Service、repository约定形成完整commit message。subject必须描述内容,优先使用简洁Conventional Commits;Task ID由产品写入trailer,不得使用“交付 + Task ID”占位主题。调用前向用户展示subject,正文存在时一并展示。
17
- 6. 直接启动 canonical `buildr task finish run`;若返回 `task_finish.entry_gaps`,按 `error.details.gaps` 的 `development` / `environment` / `delivery` 完整转述,不得只报第一项。
18
- 7. 存在 `development` 缺口(或 `nextWorkflow: task-development`)时路由 `task-development`;Finish 不补齐 Change/Verification/Completion/handoff 事实。仅工作区Task也必须先有current Candidate、Completion Review、proceed decision与Development handoff;Finish只消费handoff,不解释workspace gap或重新接受风险。
19
- - Child承担Parent Contribution时,handoff还必须包含与current Parent Plan和planned binding一致的Contribution Handoff。
20
- - Parent采用Parent Plan时,必须已记录current plan identity的显式最终集成验收;Child全部完成本身不满足该条件。
21
-
22
- ## 执行
23
-
24
- 从 canonical retained Workspace 的可信 Environment Manager 调用:
25
-
26
- ```bash
27
- buildr task finish run --task <task-id> --commit-message '<semantic-message>' --target <canonical-workspace> --detail compact --json
28
- ```
29
-
30
- 直接使用runtime投射到本Skill的精确`buildr.task-finish/v1` capability binding。启动后使用宿主支持的有界长等待消费同一进程/session,直到completed、failed、input-required或当前等待窗口到期;窗口只决定Agent何时恢复控制,不是Finish业务timeout。若仍为running,继续长等待同一session,不启动第二个Finish、不高频读取普通输出,也不承诺固定两次调用或写死45/60秒。
31
-
32
- 产品在创建 run 前一次聚合 Environment / Development / 交付入口观察;通过后固定执行:
33
-
34
- ```text
35
- preflight → prepare → verify → deliver → cleanup
36
- ```
37
-
38
- 五阶段由产品连续执行,Agent不编排阶段、补evidence或设计recovery。
39
-
40
- 完整message只在首次run冻结;resume不得覆盖。新handoff以新message创建新run。旧run仅在preflight且无交付副作用时失效,否则保留现场并返回identity conflict。
41
-
42
- 首次run或resume先预留独立`task-finish/finish-diagnostics` Execution Record;容量不足不启动五阶段。record只保留受控诊断,carrier、lease、resume与cleanup仍由Finish current管理。
43
-
44
- - `preflight`核对handoff、Environment、carrier、retained与远端对齐;各阶段/resume精确核对冻结handoff、Candidate、generation与Content Target。
45
- - `prepare`在隔离交付载体(Delivery Carrier)把任务贡献(Task Contribution)机械应用到最新交付基线(Delivery Baseline)。clean apply记录`deterministic-reuse`;Git conflict保留carrier并返回`delivery-adaptation-required`,不改原Task worktree。
46
- - Agent只在carrier完成交付适配(Delivery Adaptation)。非零适配HEAD必须保持冻结message;若baseline已满足任务且正确适配为零tree delta,保持clean carrier并在matching resume传入`--accept-zero-delta-adaptation`,不得创建空提交或无关差异。resume仍执行bounded compatibility checks,`formalVerificationExecutions` 必须为 `0`。
47
- - `verify` 对clean apply记录确定性Git identity;对适配记录`agent-reviewed-delivery-adaptation`,不得描述为Buildr已证明语义等价。Candidate identity/generation保持不变。
48
- - `deliver`只做fast-forward、push/回读、按冻结Task Contribution选择的runtime activation与Agent Doctor;Doctor失败保留现场并停止cleanup。通用executor不sync、不安装CLI/Buildr Web或接受任意命令。
49
- - render不得产生tracked/staged delta。普通交付的`remoteAfterRef`与`finalRemoteRef`都等于carrier;仅当最新target可证明完整包含carrier时,记录`targetDisposition: already-contained`、原carrier ref与最新后代final remote ref。
50
- - `cleanup` 把 delivery identity 交给 Task Environment;不直接删除 provider 状态或写第二份 Environment 结论。
51
-
52
- target前进时先证明carrier ancestry及changed paths;完整包含才跳过apply/push并继续Doctor与cleanup。恢复不增加 Candidate generation或重跑formal Verification/Completion Review;原Task source/handoff真实stale时才返回`nextWorkflow: task-development`。路径不重叠都不等于语义安全;不得手写token、recovery manifest或claimed semantic equivalence。
53
-
54
- 恢复命令:
55
-
56
- ```bash
57
- buildr task finish run --task <task-id> --run <run-id> --resume <product-token> [--accept-zero-delta-adaptation] --target <canonical-workspace> --detail compact --json
58
- ```
59
-
60
- 只读查看:
61
-
62
- ```bash
63
- buildr task finish inspect --run <run-id> --target <canonical-workspace> --detail compact --json
64
- ```
65
- abandon 后未交付隔离载体:对既有 run 加 `--release-occupancy`;不得 `git worktree remove` 或手删 `.buildr/transient/task-finish/carriers/`,也不作废已推送交付。
66
- ## 禁止事项
67
-
68
- Finish不改变Candidate/generation、Development Receipt、Change或原Task worktree,不发起 Task Verification/Completion Review,也不决定风险。Finish不运行OpenSpec Converge。两种reuse mode都复用handoff;clean apply或resume不等于语义安全。仅当既有run在preflight/prepare发生已记录、无副作用的Product provider exception时,用户才可明确授权`--bootstrap-recovery`;它只让retained Application从current ready Environment和current Development handoff共同确认的clean committed checkout加载run-owned capsule provider。retained Application、SQLite、Execution Record及状态机仍是唯一writer;不得传source/module/manifest/tarball、运行candidate CLI、临时安装或新建run。入口、registry、Application、repository或migration损坏不适用。
69
-
70
- ## 完成标准
71
-
72
- - 五阶段全部 passed/not-applicable;
73
- - Result引用Development handoff、Candidate/generation、Content Target、Task Contribution、Delivery Baseline和Delivery Carrier;
74
- - Result标记`deterministic-reuse`或`agent-reviewed-delivery-adaptation`,后者不声称Buildr证明语义等价;
75
- - carrier equivalence 为 current,target 仅 fast-forward,Environment cleanup 完成;
76
- - Git delivery完成remote回读;普通路径after/final ref等于carrier,`already-contained`保留适用的逐路径或零差异Agent review/baseline/ref/activation paths证明;
77
- - `agentProviderCompletions = 0`、`manualRecoveryManifests = 0`、`formalVerificationExecutions = 0`。
78
- - bootstrap recovery还须证明同一run/capsule、原failure、source commit/tree/provider digest及cleanup后的authority revocation;`bootstrapRecoveryExecutions = 1`。
79
-
80
- `run`结果的additive `executionRecord`必须可解释:`retained`表示本invocation正文已保留;`attention`表示record或diagnostics cleanup需owner后续处理,但不得据此回滚、改写或重跑已经成立的Finish delivery/cleanup/Task终态;`blocked`表示容量门禁在五阶段前停止;invalid或complete no-op为`not-opened`。`task finish inspect`只读Finish current/terminal,不列举records。complete 后先报告终态,再询问是否进行“任务复盘”:当前关注 Agent 耗时、Token、重复尝试和人机协作,Token 不可得可缺失。仅用户同意后路由 `task-retrospective`;blocked/failed 不提示,且复盘不影响终态。
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "任务管理器"
3
- short_description: "管理待办与正式 Task Record 及复盘来源"
4
- default_prompt: "Use $task-manager to inspect or mutate todo and active Task Records and retrospective source links through Buildr product actions."
@@ -1,61 +0,0 @@
1
- ---
2
- schemaVersion: buildr.capability-contract/v1
3
- id: buildr.task-development
4
- version: 2
5
- ---
6
-
7
- # 任务研发(Task Development)
8
-
9
- ## Purpose
10
-
11
- 从正式 Task 的首个研发动作到 current Finish handoff,维护唯一 Development Receipt、可选 planning facts、可选Parent Plan/Contribution binding、Content Target、verification policy、Task Candidate generation、专业 gate/disposition、推进决定与不可变 handoff。Task Development 是研发聚合事实 authority;它不是 Task Core、artifact/Result内容 writer、测试执行器、Git交付器或通用状态机。
12
-
13
- ## Consumer Obligations
14
-
15
- consumer 必须提供active Task ID、canonical Workspace、matching ready Environment与完整Change disposition;code-only Task显式提供空Change列表。`pending`只表达Change仍在专业流程中;提交`converged`前必须已由OpenSpec专业流程完成deterministic convergence/archive,不能把调用方summary当作收敛事实。首个proposal、design、直接实现或其他正式研发动作必须调用`begin`建立current planning snapshot;专业artifact改变时必须调用`planning`更新portable reference、identity与disposition,不得让旧snapshot继续冒充current。`begin|planning`必须显式提交完整`planning`整值;没有node时提交空nodes snapshot,字段omission不得表示清空、保留、patch或推断。
16
-
17
- Planning node可以不存在、`not-applicable`或由用户/业务授权明确`waived`。`current|stale`节点必须绑定专业authority、portable reference与content identity;`waived`必须保存精确summary和authorization source。consumer不得把waiver伪造成Review/Verification Result。
18
-
19
- 内容、测试开发、current knowledge与Change收敛完成后才能调用`observe`建立stable Content Target;任一关联Change仍为`pending`时Application必须在Content Target observation与Receipt写入前失败关闭。verification policy必须来自current Task scope与Task Verification declarations;有效Project集合是显式Project、Service所属Project与Change所属Project的确定性并集。只有该并集为空的真正仅工作区Task才可使用空declarations、空capabilities、唯一`workspace` coverage gap与空overrides;其他Task继续要求完整非空declarations。正式Verification Result只能由`buildr.task-verification@3` provider记录。Completion Result只能由`buildr.task-review@1` provider记录。负向current Result的风险接受必须绑定精确Result digest;跳过整个适用gate必须通过`gate`记录目标、summary与明确授权source。
20
-
21
- consumer不得直接读写Workspace SQLite Development current slot或旧`.buildr/tasks/<task-id>/development.yml`,不得伪造planning/content/Result applicability、Candidate、decision或handoff,也不得把Git HEAD、branch、worktree、Environment path、Agent session或时间当作Candidate identity。
22
-
23
- 采用Parent Plan时,consumer只能保存outcome、architecture invariants、Contribution Map、dependencies与final acceptance,并以内容identity作为Planning Review target。Child必须先有Task Record Parent关系和自己的Development Receipt,再保存planned Contribution binding。Finish handoff必须明确planned、delivered、extra、residual、superseded、affected与唯一next action;普通Child状态变化不得修改Parent Plan或替代handoff。范围越界必须使用expected identity显式reconcile,再分别更新或abandon受影响Child。
24
-
25
- ## Minimum Guarantees
26
-
27
- - Development Application只能通过Task Record、Environment、Review与Verification Applications/ports取得专业事实;不得直接读取其stores。
28
- - Development Application接收`converged`时必须复用Task Record的Task-scoped Change read model,并以当前working copy的`available + archived` lifecycle证明;不得回退到retained baseline、路径扫描、文件存在或调用方summary。后续inspect、freeze、decision、handoff与carrier currentness必须重验该事实,漂移时使Task Context、Candidate与handoff stale或blocked。
29
- - 新写入Receipt使用closed`buildr.task-development-receipt/v3`,保存Task、Environment逻辑引用、Task context、planning current snapshot、可空Parent Plan、planned Contribution bindings、可空Content Target、policy、current Candidate/generation、最小gates/dispositions、decision与append-only handoffs;v1/v2只读归一化为absent Parent facts,不backfill、不迁移。
30
- - provider只读取Workspace SQLite中的合法v2 current Receipt;旧File Store中的v1/v2 Receipt均保持inert,不读取、不迁移、不双写。
31
- - Receipt不保存artifact/Result正文、diff、inventory、stdout/stderr、timing、绝对路径、资源handle、聊天、隐藏推理、完整history/revision/CAS/锁/租约。
32
- - planning snapshot只保存按id排序的最小nodes与aggregate identity;没有实际节点不得创建空artifact或Result。
33
- - Content Target只由ready Environment中原Task source snapshot的deliverable bytes形成;控制metadata、绝对路径、Git载体、Node/npm、OpenSpec与特定测试框架不进入identity。
34
- - policy identity只绑定current declarations、selected capabilities、coverage gaps与明确overrides;Task Verification不拥有policy。仅工作区policy的空集合与workspace gap仍必须形成稳定identity;其Content Target改变时旧policy stale,Task新增Project/Service/Project-bound Change时必须改用完整Project declarations。
35
- - current专业Result、`not-applicable`和明确`waived`是不同gate事实。stale/incomplete Result不得被waiver或风险接受变成current。
36
- - Candidate closed shape继续只绑定generation、Content Target、Task Context与policy identity;planning/gate变化必须清除current Candidate,下一次freeze递增generation,但专业Result identity不得进入Candidate。
37
- - handoff snapshot绑定Candidate、Change dispositions、全部current gate/disposition、proceed decision与精确风险/waiver授权;已写snapshot append-only immutable。
38
- - Contribution Handoff只作为同一immutable handoff的可选专业事实;必须绑定current Parent Plan与已保存planned binding。Parent coordination read model只组合Task Record与已保存Development/Finish facts,不新增progress/lifecycle/event/history store,不回写Child状态。
39
- - Development Application必须把唯一current Receipt事务保存到Workspace SQLite;该Receipt不进入Git或跨机器同步,旧YAML不读取、不迁移、不双写。
40
- - Development Application必须从已保存Task Context、applicability、Content Target、policy与Verification gate派生response-only Formal Verification readiness;它不得进入Receipt、SQLite新slot、Candidate identity或专业Result。明确pending/stale/missing事实报告`blocked`,尚未到交接或已有matching Verification报告`not-applicable`,已知Development facts就绪但current knowledge仍由专业owner即时确认时报告`unknown`。
41
- - Finish carrier equivalence只读;consumer必须提交run冻结的handoff、Candidate、generation与Content Target identity,Application只有在四项全部等于`observed.currentHandoff`时才能返回`equivalent`,不得从历史handoffs选择旧identity。Finish不得修改Development Receipt,也不得读取、解释或执行Change convergence/archive。
42
-
43
- ## Effects and Authorization
44
-
45
- 普通Development授权只覆盖current Receipt整值写入和读取。`begin|planning`只登记专业authority引用;不创建或修改proposal、design、Review/Verification Result。实现、测试、current knowledge、Change convergence、Result record、外部副作用、Git transition与Environment cleanup分别由对应能力授权。`waived`必须来自用户或具备业务授权的明确source,并限制到精确node/gate target。
46
-
47
- ## Result Evidence
48
-
49
- Application operation result使用`buildr.task-development-operation-result/v1`,返回operation、status、Task ID、Receipt read model、response-only receipt digest、planning/content/policy/Candidate/gate/handoff applicability、response-only Formal Verification readiness、精确effects、diagnostic与next actions。内部driver可以显式返回同一次Application result的`buildr.task-development-driver-compact/v1` response projection;该投影只保留current identities/applicability、readiness与同源effects、diagnostic、next actions,不追加Application action、Workspace观察或持久化,也不替代完整Result与Receipt authority。Receipt中的专业Result只保存digest、target、outcome与current snapshot;waiver只保存target、summary与source。
50
-
51
- Next actions只按本次已保存Receipt/applicability提供建议性方向;consumer仍须读取当前阶段的selected专业provider和授权后决定是否执行。timing、调用次数及其他效率指标不得进入建议判断、gate、Task状态、Candidate或自动skip/advance。
52
-
53
- 正式handoff至少保存Candidate identity/generation及其输入identities、Change dispositions、Planning/Verification/Completion gate或disposition、proceed decision、风险/waiver来源和snapshot identity/time;承担Parent Contribution时还保存完整Contribution Handoff。
54
-
55
- ## Decision Points
56
-
57
- Task/Environment非current、planning node证据不完整、waiver无授权、Change pending、Content Target缺失、declaration/policy stale、required Verification事实或policy coverage gap尚未进入matching current Result时不得freeze。Change pending另外不得调用`observe`创建stable Content Target。Formal Verification readiness为`unknown`时只推荐selected current knowledge provider对同一tree执行只读`inspect`;它不构成通用Verification executor硬门禁,provider返回`unresolved`时consumer才停止,`aligned|not-applicable`时直接进入现有Task Verification且不保存ready摘要。仅工作区的matching `not-passed` Result可以使事实完整并freeze,但proceed/handoff仍必须对`workspace` gap绑定精确Result digest与明确风险授权。Completion未得到current专业Result、合法not-applicable或明确waived时不得proceed。Delivery Baseline前进或Finish Git conflict不改变Development applicability;只有原Task source、Task Context、planning/policy/gate或其他真实applicability input变化才重建Candidate/handoff。无法判断时保持blocked。
58
-
59
- ## Allowed Variations
60
-
61
- Project可以定义自己的planning node kind、专业authority与技术栈,并采用Git、tarball、安装包或其他Delivery Carrier。Provider实现可以调整内部action名称和Buildr Web布局;唯一Receipt、Workspace-local current snapshot、明确waiver、专业writer隔离、Candidate shape、append-only handoff与Finish边界不可省略。
@@ -1,37 +0,0 @@
1
- ---
2
- schemaVersion: buildr.capability-contract/v1
3
- id: buildr.task-environment
4
- version: 1
5
- ---
6
-
7
- # 任务环境(Task Environment)
8
-
9
- ## Purpose
10
-
11
- 为正式 Task 准备、检查、恢复和清理实际执行环境,并通过唯一 Environment Receipt 提供当前机器的环境事实。
12
-
13
- ## Consumer Obligations
14
-
15
- consumer必须提供正式Task ID和canonical Workspace。Agent必须根据Task Record的完整Project/Service scope、Project `preparation.yml`及构建/验证事实选择Recipe并提交closed Plan Request;开始修改交付物、构建、测试或创建持久资源前,必须取得matching `ready`结果,并只使用结果允许的执行根和执行CLI。consumer不得手写Receipt、从cwd/分支猜环境,也不得把Agent session采用当作ready条件。
16
-
17
- ## Minimum Guarantees
18
-
19
- provider必须通过共享Task Environment Application管理Workspace SQLite中按Task ID唯一的`task_environment_current` row,并通过公开read model返回`workspace-sqlite:task-environment/<task-id>` locator。Project `preparation.yml`是长期Recipe authority;Plan v2是当前Task选择的执行快照;Receipt v5独占实际scope/root、Task checkout/provider evidence、Declaration/Scope/Recipe/Step current与prepared facts、Runtime、Workspace CLI、runtime projection identity、动态资源、`ready / blocked`、恢复和cleanup事实。Task Record不保存这些字段。Plan必须恰好覆盖Task Project/Service scope,不得由目录扫描、lifecycle projection或runtime current反向推导。retained Buildr只作为可信Environment Manager;其content identity最多是Receipt创建指纹,不是源码版本、ready、资源ownership或Verification applicability authority。旧Receipt只读兼容,只有显式Plan Request才能升级。
20
-
21
- `prepare`必须幂等完成首次准备和串行恢复;Step只接受明确的无shell executable、args、Project或Service相对cwd、input files、expected outputs、required和timeout。Workspace Foundation executable使用受管工具;Project/Service executable的真实路径不得越出所属execution root。只跳过Declaration/Recipe/executable/input identities与prepared identities一致且全部outputs ready的Step。CLI `inspect`必须只读重新观察这些facts,不执行Step、不创建输出、不升级Plan、不回写Receipt;Buildr Web GET必须使用saved-current reader。`cleanup`必须只接受已交付的Finish handoff或明确abandon终态。候选CLI可以在本Task验证工作区测试,但不能写retained、peer Task或共享user runtime,也不能认领或清理自己的Environment。
22
-
23
- ## Effects and Authorization
24
-
25
- Environment 可以调用 selected provider 创建执行位置、准备确定性依赖和投射任务验证 runtime,也可以登记已知产品 provider 创建的非敏感动态资源。部分失败保留可诊断现场并返回 blocked。资源停止和 provider cleanup 由 Environment 统一执行;任意 shell、凭证、远端删除和无法证明 ownership 的效果均不允许写入 Receipt。
26
-
27
- ## Result Evidence
28
-
29
- 返回Task、Workspace、receipt availability、`current-machine`、`observedAt`、状态、实际scopes/roots、controller、Plan identity、逐Declaration/Scope/Recipe/Step current与prepared identity、executed、inputs/outputs/required/status/diagnostic、Runtime/CLI/projection probes、provider evidence、动态资源、effects、diagnostic、nextActions和cleanup摘要。Step的`executed`表示当前prepare调用是否实际执行;effect进一步给出本次执行位置。真实Agent session采用证据由Task Verification管理,不属于本结果。
30
-
31
- ## Decision Points
32
-
33
- Task/Workspace不匹配、Plan缺失/越权/未完整覆盖scope、Receipt损坏、Environment Manager sourceRoot/adapter不可信、Git-backed manager source dirty、provider/resource identity漂移、required Step缺失/漂移/失败、执行根越界、必需probe blocked、可见并发writer、source drift、Task Contribution等价证明失败或cleanup authorization不足时必须fail closed。provider不枚举package manager或技术栈,也不建设包管理框架、锁、CAS、租约、调度器或第二套Environment store。
34
-
35
- ## Allowed Variations
36
-
37
- provider 组合、共享根或 Git checkout 的选择可以不同;唯一 Environment Receipt、可信 retained Environment Manager、Task checkout/provider 源码基础、真实 probe、写入边界和统一 cleanup authority 不可省略。
@@ -1,59 +0,0 @@
1
- ---
2
- schemaVersion: buildr.capability-contract/v1
3
- id: buildr.task-finish
4
- version: 1
5
- ---
6
-
7
- # Task Finish Handoff Consumer
8
-
9
- ## Purpose
10
-
11
- 消费 current formal Development handoff,准备与 Task Candidate Content Target 可证明等价的交付载体(Delivery Carrier),推进目标、按需render Workspace runtime并把 cleanup eligibility 交给 Task Environment。Task Finish 是窄交付 adapter,不是 Development、Change、Review 或 Verification authority。
12
-
13
- ## Consumer Obligations
14
-
15
- consumer 必须提供正式 Task ID、canonical Workspace、matching ready Environment、由 `buildr.task-development@2` Application 读取的 current handoff,以及首次run所需的完整语义化commit message。仅工作区Task与Project/Service Task使用同一handoff入口;Finish不解释其中的空declarations、workspace gap、负向Result或风险授权。Agent负责根据最终内容和Workspace、Project、Service、repository约定确定subject与可选body;产品只规范化、校验、冻结和机械使用,不得根据Task ID、Change、diff或路径推断语义。不得用 Project/Change 参数、Git HEAD、branch、worktree、时间或调用方摘要代替 handoff。retained metadata-only Git handoff 仍须证明 exact paths、验证 identity、目标 branch/remote 和 selected `buildr.git-operations@1` provider ready,并由 Task Finish 分别选择 commit 与 push operation。
16
-
17
- Git-backed Product adapter 必须把 run 绑定到 retained checkout 当前符号分支;显式 target branch 必须与当前分支一致。Environment checkout `startPoint` 只描述候选来源,不得充当交付分支 identity;detached retained checkout、显式不一致或不可解析的 local branch 必须在创建 run 前停止。Product adapter 还必须绑定 retained checkout 中真实配置的 delivery remote。Environment 对 workspace source 没有 remote 时,consumer 可以依赖 target branch upstream 或唯一配置 remote;没有可用 remote、多个 remote 无法消歧或用户指定值未配置时必须停止,不得接受本地-only delivery 冒充远端交付。
18
-
19
- consumer除首次run的commit message外,不得提交caller evidence、Candidate、generation、risk acceptance、Result、claimed semantic equivalence或recovery manifest让产品解释。已有run与resume不得接受message覆盖。新Development handoff必须创建独立run并重新提交commit message,不能继承旧run的message identity。只有Development Application报告handoff/Candidate applicability stale时返回Task Development;Finish机械应用冲突只返回Delivery Adaptation facts。
20
-
21
- 唯一例外是用户单独明确授权的existing-run `--bootstrap-recovery`:它不接收source/module/tarball/manifest,仍进入完整retained registry与Application;Execution Record成功open后,retained Application才可从current ready Environment与current Development handoff共同确认的clean committed checkout派生run-owned capsule,并只加载Task Finish Product phase provider。candidate只获得closed allowlist runtime façade;retained Application、Structured Store runtime、Execution Record、run state machine和Environment cleanup仍是canonical owner。初始failure必须是preflight/prepare的确定provider exception origin,且无carrier、lease、delivery、retained、prepared completion或cleanup事实;否则零capsule副作用fail closed。
22
-
23
- 另一existing-run例外是 `--release-occupancy`:仅当 Task Record 当前为 `abandoned`、指定 run 绑定同一 Task 与 canonical Workspace、且从未形成成功交付时,Finish 才删除可证明属于该 run 的隔离载体。它不 push、不 complete Task Record、不把 abandoned 改成 completed,也不进入五阶段。已交付、Task 仍 active、或 carrier 所有权不可证明时 fail closed 并保留现场。
24
-
25
- Task Finish current run、target lease与compact terminal Result MUST由canonical Workspace SQLite structured store统一持久化。每次真正执行的Finish invocation MUST在任何current/Carrier/target/recovery副作用前open独立`task-finish/finish-diagnostics` Execution Record,并把完整stdout/stderr、timeline与命令诊断先写入invocation-owned transient;只有record retained后才能精确清理该diagnostics transient。Delivery Carrier、lease、resume和其他恢复材料继续只由Finish owner管理,不得被record cleanup删除或延长。`task_finish_current`不得保存record identity/status/history或正文;`.buildr/task-finish/` MUST NOT作为新runtime的输入、authority、reader或双写目标。
26
-
27
- ## Minimum Guarantees
28
-
29
- - canonical首次入口`buildr task finish run --task <id> --commit-message <message>`仍顺序执行`preflight → prepare → verify → deliver → cleanup`,但五阶段只覆盖handoff/current environment检查、carrier preparation、内容等价检查、交付和cleanup。新run在所有Finish副作用前规范化LF、校验非空subject、拒绝精确“交付 + 当前Task ID”占位主题,并确定性加入`Buildr-Task: <task-id>` trailer;已有run的resume只复用冻结message。
30
- - 调用前参数、Task/Environment/handoff、target/remote、resume token与complete/no-op校验完成后,产品必须先取得execution record固定reservation;backpressure不得创建或改变Finish current、Carrier、target、lease、resume或恢复资源。首次run和每次resume使用不同invocation identity,且同一逻辑Finish run的旧record不得被覆盖。
31
- - `preflight` 只能读取 Development handoff、Environment、当前 adapter carrier与retained target readiness;preflight、prepare、verify、deliver及复用这些阶段输出的resume都必须通过Development Application精确核对run冻结的handoff、Candidate、generation与Content Target identity,不得自行遍历历史handoffs;不得检查或解释Project activation配置、Change/current knowledge/Review/Verification store。
32
- - `prepare`可以改变隔离carrier的commit identity,但不得改变Candidate内容或原Task worktree/index/branch。Git adapter从原任务基线到冻结source snapshot计算Task Contribution,在最新Delivery Baseline的run-owned detached worktree中机械应用,并用run-owned完整message创建commit、回读实际`%B`校验identity;clean apply记录`deterministic-reuse`,conflict保留baseline carrier并blocked返回`delivery-adaptation-required`。不执行OpenSpec convergence/archive、runtime generation、target rebase、Candidate freeze或自动冲突解决。
33
- - Agent只可在run-owned carrier完成Delivery Adaptation。最终carrier HEAD的完整message必须保持冻结identity,否则blocked且不得deliver。resume必须核验ownership、baseline ancestry、source/handoff current、cleanliness、message identity及Project policy要求的bounded compatibility checks;resume动作或调用方boolean不得充当semantic equivalence evidence。
34
- - `verify`调用Development Application只读确认applicability,并复核Task Contribution/Delivery Baseline/carrier identities与compatibility evidence;clean apply记录`deterministic-reuse`,适配记录`agent-reviewed-delivery-adaptation`并明确Buildr未证明语义等价。formal Verification executions必须为`0`,不得record Verification Result或执行Completion Review。
35
- - `deliver` 继续使用短 target lease/fencing、fast-forward target transition与普通push,再按冻结 plan执行`none | render-runtime`并运行通用Workspace inventory Doctor。Doctor仍严格要求`health.ready: true`,但不选择Agent adapter把待post-Finish专属激活的Product runtime drift升级为Finish失败。Workspace根runtime source只render,其他变化none;plan不得读取Project/Service声明,也不得包含sync、Buildr development CLI/Buildr Web安装、任意command、args、env或shell。
36
- - `render-runtime`后任何tracked/staged delta都必须blocked。普通路径的`remoteAfterRef`与`finalRemoteRef`必须都等于carrier;只有确定性证明最新target包含carrier ancestry及全部changed-path after mode/blob/删除状态时,才可记录`targetDisposition: already-contained`并以该后代ref进入cleanup。这些动作不取得Development writer authority。
37
- - `cleanup` 先写已有 Finish delivery/completion facts,再将 delivery identities 交给 `buildr.task-environment@1`。Environment 独占资源停止、provider cleanup、共享根解除占用和 cleanup result。
38
- - `cleanup` 必须先持久化 delivery 与 `cleanup_pending` 边界,再幂等消费 Environment cleanup;只有 Environment cleanup、Finish transient cleanup、lease释放和compact terminal Result 写后读取全部完成,Task Record 才能进入 `completed`。若进程在 Environment 已清理后崩溃,resume 只能重试 Finish-owned cleanup 与 terminal transition,不得重跑 delivery。
39
- - invocation结束后必须独立seal受控summary、固定phase timeline、diagnostics与output;record retained后只清理该invocation diagnostics transient。seal、metadata确认或diagnostics cleanup失败只进入公开`executionRecord` operation summary,不得回滚、改写或重放remote delivery、Environment/Carrier cleanup、Task terminal或Finish current。不可捕获死亡保持record open。
40
- - Finish不创建、递增、回退或删除Task Candidate/generation,也不拥有Candidate applicability。clean apply与Agent-reviewed Delivery Adaptation均复用同一Candidate/generation、Verification、Completion Review、decision与handoff;Finish不执行Completion Review,不决定proceed/blocked,不接受用户风险,也不修改Development Receipt。
41
- - `task finish` 是交付收尾入口;`task complete` 只表达上述所有 gates 通过后的 Task Record terminal status。Task Finish 不建立第二套 Task complete authority。
42
- - blocked resume token只能由产品绑定run/phase/carrier/failure生成。Development Application报告handoff/Content Target stale时,无carrier、lease、delivery、retained或cleanup事实的preflight-only旧run可以保留Execution Record后安全失效;已有任一恢复或副作用事实的旧run必须保留现场并返回`task_finish.current_run_identity_conflict`,不得自动删除、终结或换绑。已持久化delivery事实后的cleanup仍按原run完成必要清理。Delivery Adaptation、target-race、compatibility、retained与cleanup阻塞只返回相应facts与exact token。
43
- - 明确授权的bootstrap recovery MAY在同一run重置无副作用的terminal failed preflight/prepare phase,并把原status/failure保存到bootstrap provenance;blocked run及后续阶段继续使用Product token。每个run只能绑定一个source commit/tree/provider digest/capsule identity;cleanup phase必须先持久化passed,再由retained finalizer原子移出精确可执行source并写revocation tombstone,最后执行terminal SQLite finalize。撤销中断保留可判定的source或quarantine供same-run恢复;terminal finalize失败只运行retained shell,不重新导入provider;撤销后的残留回收失败只记attention且不得重放成功phase。Candidate/generation、handoff、formal Verification和Completion Review不得变化。
44
-
45
- ## Effects and Authorization
46
-
47
- 普通“收尾”授权run-owned carrier机械准备、Agent在该carrier中的Delivery Adaptation、适用bounded compatibility checks、目标分支fast-forward/push、Workspace根runtime render、retained Doctor和Task-owned cleanup。它不授权bootstrap recovery;后者需要单独明确授权。两种授权均不允许sync、Buildr development CLI或Buildr Web安装、任意shell、Change convergence/archive、原Candidate或Task worktree修改、target rebase、正式Verification Result写入、Review、风险接受、force push、共享历史改写或丢弃用户改动。Bootstrap授权也不允许candidate canonical writer、任意provider path、npm tarball runtime或递归恢复Task。
48
-
49
- ## Result Evidence
50
-
51
- canonical产品结果使用`buildr.task-finish-result/v2`,包含run identity、Development handoff、Task Candidate/generation、Content Target、Task Contribution、Delivery Baseline、Delivery Carrier及其activation plan、冻结提交的subject与message identity、五阶段状态、`deterministic-reuse|agent-reviewed-delivery-adaptation`、只读equivalence/adaptation facts、delivery、cleanup/completion、primary failure、可选resume token与效率指标。Bootstrap适用时additive记录retained writer mode、原failure、source commit/tree、provider digest、capsule identity/revocation与`bootstrapRecoveryExecutions: 1`;`manualRecoveryManifests`和`formalVerificationExecutions`仍为0。CLI JSON缺省或显式`--detail compact`从同一canonical Result生成closed `buildr.task-finish-compact-result/v1`,只保留状态、关键identity、current phase、主失败、next action、matching resume、关键refs、timing与portable Execution Record摘要;显式`--detail full`原样返回v2。detail不得改变执行、持久化或恢复authority。完整message只由Task Finish current run owner和实际Git commit持有,不得复制到Task Record、Development/Environment Receipt、terminal Result或Execution Record;公开投影只含subject与identity。`run`结果另外以additive portable`executionRecord`表达`not-opened|blocked|retained|attention`、record identity/outcome/body摘要与diagnostics cleanup,不得暴露SQLite、body/transient locator、Carrier绝对路径或Execution Record resource token;`inspect`保持pure Finish read model且不枚举records。record attention不得改变Finish status;complete result的`nextAction`仍按终态提供非阻塞“任务复盘”建议,blocked result继续优先提供确定性恢复动作。Git-backed普通路径的`observedTargetRef`、`carrierRef`、`remoteAfterRef`与`finalRemoteRef`必须分别来自push前观察、carrier、carrier push后回读和通用activation最终回读;`already-contained`路径还必须报告原carrier、ancestor/path-state proof与最新后代ref。所有路径必须报告`formalVerificationExecutions: 0`。兼容字段`runtimeInstall`与`localAppDelivery`可以保留为deprecated `not-applicable`,但不得参与delivered门禁;Workspace专属post-Finish evidence不得写回本Result或复制到其他authority。
52
-
53
- ## Decision Points
54
-
55
- handoff非current、同Task current run identity冲突、Environment漂移、retained target branch detached/不一致、delivery remote缺失/歧义、carrier ownership/baseline/source/cleanliness无法证明、compatibility checks失败、push后远端ref不等于预期、retained checkout含无关dirty或cleanup不安全时停止并按失败类型返回。run factory只有请求与existing run normalized identity digest完全一致时才能幂等复用;不同identity必须抛出`task_finish.current_run_identity_conflict`。carrier准备后target ref前进时先检查精确包含;证明成立则跳过重复transition并继续,证明失败或不可得才blocked并生成精确token,从最新Delivery Baseline恢复`prepare → verify → deliver → cleanup`。Candidate/generation与既有gates保持不变。Git conflict进入Delivery Adaptation;只有Development Application报告applicability stale才返回Development rebuild。路径不重叠、clean apply或Agent resume不得被表述为语义安全。
56
-
57
- ## Allowed Variations
58
-
59
- current Product 只提供一个直接接线的 Git carrier adapter,不建立 adapter registry、选择层或未来 adapter 占位。只有第二个真实交付 adapter 已有实现、调用方与可验证契约时,后续窄 Change 才 MAY 引入选择机制;每个 adapter 都必须证明与 handoff Content Target 等价,且不得把 adapter-specific Git/OpenSpec/Node/npm/Buildr registry 约束写回 Development schema,或恢复旧 Candidate/Verification writer。
@@ -1,63 +0,0 @@
1
- ---
2
- schemaVersion: buildr.capability-contract/v1
3
- id: buildr.task-verification
4
- version: 3
5
- ---
6
-
7
- # Task Verification
8
-
9
- ## Purpose
10
-
11
- 针对正式 Task 的明确交付目标,选择并执行 Project 已声明的适用验证能力,或为真正仅工作区Task记录明确的workspace coverage gap,从 transient Execution Evidence 或完整缺口事实提炼一份可移植值语义、Workspace本地持久化的 current Task Verification Result。
12
-
13
- ## Consumer Obligations
14
-
15
- consumer 必须提供 active Task ID、canonical Workspace 和稳定 target identity;执行能力时还必须使用 Task Environment 允许的 execution root。`record`目标中的 declaration bytes 尚未进入 canonical Workspace 时,consumer 可以提交 matching ready Task Environment 根作为只读 declaration source;Application 必须验证其 ownership,且不得把该本机路径写入 Result。`inspect`不得提交路径或要求Application重新观察声明,只能提交显式identity值做纯值比较。consumer 可以提交实际 capability facts、coverage gaps 和整体验证结论,但不得提交 declaration identity、applicability、Result digest、Task 状态、风险 proceed/blocked 决定或 Candidate generation。
16
-
17
- consumer 必须区分三种动作:`inspect` 只读取 current Result 并派生适用性;`verification run` 执行能力并在正式 Task context 中保留独立 execution record,Task外run仍为transient-only;`record` 只在完整结果已经形成后完整替换 current Result。中断、执行证据不完整或写入失败时不得覆盖 current。
18
-
19
- consumer与Application必须以Task显式Project、Service所属Project和Change所属Project的去重排序并集作为有效Project集合。并集非空时必须观察并保存全部非空Project declarations;只有并集为空时才是仅工作区Task,不得通过省略`scope.projects`绕过Service或Change所属Project。
20
-
21
- ## Minimum Guarantees
22
-
23
- - Project `verification.yml` 使用 `buildr.project-verification/v2`,只声明既有 capability identity、Project/Service scope、invocation、applicability、proves、`requiredForDelivery`,以及确有需要的 environment/effects/resource claims。
24
- - Buildr 不开发测试。声明或适用能力不存在时只形成 coverage gap;不得在 Verification 中创建测试、框架、CI、通用 DAG、调度器或资源平台。
25
- - command capability 可以由 `buildr verification run` 执行;Agent capability 必须作为有界 Agent operation 执行。`effects.authorization: explicit` 和 explicit resource 分别要求精确 capability/resource 授权。正式Task command execution必须在首次target/process/resource副作用前取得Execution Record容量。相同Task、owner、kind与exact invocation identity已有record且未显式`--retry`时,Application必须在同一原子transaction中先选择active、否则选择terminal,并在对应集合按`opened_at DESC, record_id DESC`复用latest record;不得取得resource、观察target、启动process、创建transient evidence或新record。只有显式`--retry`可以为同一identity创建独立run/record;identity输入变化仍创建首次执行。失败、重试、中断与target drift不得互相覆盖。Task外execution仍为transient-only,不提供caller-managed output writer。
26
- - active只允许`running/open`。terminal outcome固定为`passed|failed|blocked|cancelled`,terminal lifecycle固定为`retained|cleanup_pending|cleaned|attention`;`attention`是lifecycle而不是outcome。terminal复用必须返回`not-started-existing-terminal`非执行evidence并保留原outcome/lifecycle;只有非attention的passed可返回成功,负向outcome或任意attention必须非零退出。Execution Record readback不得创建、替换或充当current Verification Result。
27
- - 正式record正文只允许保存可移植摘要、受控stdout/stderr、闭合timeline与diagnostics,并受统一脱敏、截断、配额和retention约束;不得保存本机root、executable path、resource token、Environment handle或完整敏感argv。seal成功后才精确清理transient evidence;seal失败必须保留恢复现场。
28
- - 同一 coordinated resource 的有效 waiter 必须按确定的等待顺序取得可用容量;新 waiter 不得越过仍有效的更早 waiter。等待 ticket 与执行 lease 必须保持分离,取消、timeout、崩溃或过期 ticket 只能按匹配 owner/token 或已证明过期的事实精确清理,并且不得进入 Project declaration 或 current Result。
29
- - Workspace SQLite中的Task-scoped row是唯一current slot,schema 为 `buildr.task-verification-result/v1`。只有Task Verification Application可以解释、读取或事务整值写入该Result。
30
- - current Result不进入Git或跨机器同步;旧`.buildr/tasks/<task-id>/verification.yml`不读取、不迁移、不双写。Execution Record、transient Execution Evidence、log、resource、Environment、runtime 与 response-only digest仍不属于current Result。
31
- - Application 从当前 Task有效Project集合和 Project declaration bytes 生成 declaration identity;调用方不得伪造。Result 绑定 target identity 和全部有效Project declaration identities。真正仅工作区Task保存空declarations、空capabilities、唯一`workspace` coverage gap与`not-passed`,不得自动passed;repository新写入必须拒绝Task scope与declarations不匹配。
32
- - reader 只对调用方显式提供的target/declaration identity与保存值派生applicability:相等为`current`,不等为`stale`,未提供的axis为`unknown`;不得在读取时打开路径、registry或声明文件。applicability与Result digest不持久化。
33
- - repository 必须在 closed-schema normalization 和 serialization round-trip 后,通过单一SQLite transaction精确替换current row并在提交前重读验证;任何失败都rollback并保留旧current value。
34
- - Result 只允许 target、declarations、实际 capabilities/facts、coverage gaps、`passed|not-passed` conclusion 和 completed time。不得保存 stdout/stderr、临时 evidence reference、Environment Receipt、history、revision、CAS、局部 patch、assurance level、proceed/blocked 或 Task progression。
35
- - Task Development 是 lifecycle consumer:它形成独立 verification policy,并通过本 Application 检查 Result target/declarations applicability 与 required facts。Task Finish 不解释、补跑或记录 Verification Result,只消费已经引用该 Result 的 formal Development handoff。
36
-
37
- ## Effects and Authorization
38
-
39
- 声明为本地、临时且 `authorization: implicit` 的已有命令可按当前任务执行。访问外部系统、持久业务数据、共享状态或显式授权资源前必须取得对应授权。Result 写入只影响当前 Task 的固定 current slot;正式execution record在SQLite与owned body目录中持久化,transient evidence只在record retained后精确清理。
40
-
41
- ## Result Evidence
42
-
43
- `inspect` 与 `record` 返回 `buildr.task-verification-operation-result/v1`,至少包含 operation、status、taskId、current slot、Result digest、派生 applicability、effects、diagnostic 和 next actions。
44
-
45
- closed `buildr.task-verification-result/v1` 包含:
46
-
47
- - `taskId`;
48
- - `target.identity` 与可移植 summary;
49
- - Task scope 内每份 declaration 的 Project、Workspace 相对 path 与 `sha256-*|absent` identity;
50
- - 实际 capability 的 Project、id、`passed|failed` 和非空事实;
51
- - Project/Service scoped coverage gaps;仅工作区模式使用唯一`workspace` gap;
52
- - `passed|not-passed` conclusion;
53
- - `completedAt`。
54
-
55
- 存在 failed capability 或 coverage gap 时 conclusion 不得为 passed。Result 至少包含一个实际 capability 或 coverage gap。空declarations只允许与空capabilities、唯一`workspace` gap和`not-passed`组合;既有Result继续兼容读取,不迁移、回填或伪造历史workspace事实。
56
-
57
- ## Decision Points
58
-
59
- Task 非 active、target identity 不稳定、declaration 无效、capability 不在 Task/Service scope、外部副作用未授权、执行仍在进行、证据不完整或无法形成完整 Task 结论时必须停止且不得覆盖 current。测试命令完整失败可以形成 `not-passed` Result;是否带风险继续或阻塞由用户通过 Task Development 决定。
60
-
61
- ## Allowed Variations
62
-
63
- Project 可以使用 command、CI wrapper 或有界 Agent operation,也可以声明确有需要的 coordinated/external resource。Product 自身可在测试实现内部使用专用 DAG;Project declaration、Task Result 和本 contract 不提供通用依赖图或 assurance 层级。