guarantee-based-coding 0.2.3__tar.gz → 0.4.0__tar.gz

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 (118) hide show
  1. guarantee_based_coding-0.4.0/MANIFEST.in +4 -0
  2. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/PKG-INFO +15 -4
  3. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/README.md +96 -85
  4. guarantee_based_coding-0.4.0/build_support.py +29 -0
  5. guarantee_based_coding-0.4.0/docs/development/0.4.0-validation.md +61 -0
  6. guarantee_based_coding-0.4.0/docs/en/concepts.md +229 -0
  7. guarantee_based_coding-0.4.0/docs/en/onboarding-agent.md +120 -0
  8. guarantee_based_coding-0.4.0/docs/en/quick-start.md +155 -0
  9. guarantee_based_coding-0.4.0/docs/en/reference.md +239 -0
  10. guarantee_based_coding-0.4.0/docs/en/workflow.md +281 -0
  11. guarantee_based_coding-0.4.0/docs/zh/concepts.md +200 -0
  12. guarantee_based_coding-0.4.0/docs/zh/onboarding-agent.md +104 -0
  13. guarantee_based_coding-0.4.0/docs/zh/quick-start.md +144 -0
  14. guarantee_based_coding-0.4.0/docs/zh/reference.md +223 -0
  15. guarantee_based_coding-0.4.0/docs/zh/workflow.md +229 -0
  16. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/__init__.py +1 -1
  17. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/assets.py +16 -0
  18. guarantee_based_coding-0.4.0/gbc/app/documentation/__init__.py +3 -0
  19. guarantee_based_coding-0.4.0/gbc/app/documentation/base.py +109 -0
  20. guarantee_based_coding-0.4.0/gbc/app/documentation/cli.py +54 -0
  21. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/intent/cli.py +124 -124
  22. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/interface/base.py +170 -1
  23. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/interface/cli.py +49 -4
  24. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/interface/mcp.py +675 -629
  25. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/i18n/catalog/en.json +48 -2
  26. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/i18n/catalog/zh.json +48 -2
  27. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/i18n/texts/rules.en.md +71 -64
  28. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/i18n/texts/rules.zh.md +47 -42
  29. guarantee_based_coding-0.4.0/gbc/assets/i18n/texts/setup.en.md +112 -0
  30. guarantee_based_coding-0.4.0/gbc/assets/i18n/texts/setup.zh.md +90 -0
  31. guarantee_based_coding-0.4.0/gbc/assets/skills/README.md +24 -0
  32. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/skills/gbc-cli/SKILL.md +165 -141
  33. guarantee_based_coding-0.4.0/gbc/assets/skills/gbc-workflow/SKILL.md +24 -0
  34. guarantee_based_coding-0.4.0/gbc/assets/skills/gbc-workflow/references/guarantees.md +32 -0
  35. guarantee_based_coding-0.4.0/gbc/assets/skills/gbc-workflow/references/intent.md +21 -0
  36. guarantee_based_coding-0.4.0/gbc/assets/skills/gbc-workflow/references/vocabulary.md +11 -0
  37. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/entry.py +165 -162
  38. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/guarantee_based_coding.egg-info/PKG-INFO +15 -4
  39. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/guarantee_based_coding.egg-info/SOURCES.txt +25 -1
  40. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/pyproject.toml +4 -1
  41. guarantee_based_coding-0.4.0/tests/test_assets.py +124 -0
  42. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_cli_commands.py +750 -682
  43. guarantee_based_coding-0.4.0/tests/test_documentation.py +141 -0
  44. guarantee_based_coding-0.4.0/tests/test_manual_packaging.py +49 -0
  45. guarantee_based_coding-0.4.0/tests/test_mcp_doc_tools.py +85 -0
  46. guarantee_based_coding-0.4.0/tests/test_tree_interfaces.py +166 -0
  47. guarantee_based_coding-0.4.0/tests/test_tree_views.py +98 -0
  48. guarantee_based_coding-0.2.3/gbc/assets/i18n/texts/setup.en.md +0 -87
  49. guarantee_based_coding-0.2.3/gbc/assets/i18n/texts/setup.zh.md +0 -78
  50. guarantee_based_coding-0.2.3/gbc/assets/skills/README.md +0 -16
  51. guarantee_based_coding-0.2.3/tests/test_assets.py +0 -64
  52. guarantee_based_coding-0.2.3/tests/test_mcp_doc_tools.py +0 -49
  53. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/LICENSE +0 -0
  54. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/__init__.py +0 -0
  55. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/config/__init__.py +0 -0
  56. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/config/backups.py +0 -0
  57. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/config/base.py +0 -0
  58. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/config/executor.py +0 -0
  59. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/config/project.py +0 -0
  60. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/core/__init__.py +0 -0
  61. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/core/env.py +0 -0
  62. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/core/executor.py +0 -0
  63. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/core/guarantee.py +0 -0
  64. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/i18n/__init__.py +0 -0
  65. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/i18n/lang.py +0 -0
  66. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/i18n/translate.py +0 -0
  67. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/intent/__init__.py +0 -0
  68. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/intent/base.py +0 -0
  69. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/intent/editor.py +0 -0
  70. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/interface/__init__.py +0 -0
  71. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/models/__init__.py +0 -0
  72. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/models/errors.py +0 -0
  73. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/models/meta.py +0 -0
  74. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/models/verify.py +0 -0
  75. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/utils/__init__.py +0 -0
  76. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/utils/file_utils.py +0 -0
  77. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/utils/gbc_md.py +0 -0
  78. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/utils/json_model_operator.py +0 -0
  79. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/app/utils/safe_file_writer.py +0 -0
  80. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/app.js +0 -0
  81. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/css/foundation.css +0 -0
  82. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/css/review.css +0 -0
  83. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/css/workspace.css +0 -0
  84. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/i18n.js +0 -0
  85. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/index.html +0 -0
  86. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/js/actions.js +0 -0
  87. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/js/api.js +0 -0
  88. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/js/diff.js +0 -0
  89. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/js/dom.js +0 -0
  90. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/js/editor-view.js +0 -0
  91. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/js/review-view.js +0 -0
  92. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/js/semantic.js +0 -0
  93. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/js/state.js +0 -0
  94. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/gbc/assets/editor/js/tree-view.js +0 -0
  95. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/guarantee_based_coding.egg-info/dependency_links.txt +0 -0
  96. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/guarantee_based_coding.egg-info/entry_points.txt +0 -0
  97. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/guarantee_based_coding.egg-info/requires.txt +0 -0
  98. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/guarantee_based_coding.egg-info/top_level.txt +0 -0
  99. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/setup.cfg +0 -0
  100. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_config_project.py +0 -0
  101. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_core_executor.py +0 -0
  102. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_env_actions.py +0 -0
  103. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_errors_i18n.py +0 -0
  104. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_executor_externalized.py +0 -0
  105. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_gbc_md.py +0 -0
  106. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_guarantee_crud.py +0 -0
  107. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_guarantee_deps.py +0 -0
  108. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_guarantee_verify.py +0 -0
  109. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_i18n.py +0 -0
  110. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_intent_base.py +0 -0
  111. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_intent_editor_api.py +0 -0
  112. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_intent_flat.py +0 -0
  113. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_interface_base_crud.py +0 -0
  114. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_interface_base_deps.py +0 -0
  115. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_interface_base_query.py +0 -0
  116. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_interface_base_refactor.py +0 -0
  117. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_json_model_and_file_utils.py +0 -0
  118. {guarantee_based_coding-0.2.3 → guarantee_based_coding-0.4.0}/tests/test_safe_file_writer.py +0 -0
@@ -0,0 +1,4 @@
1
+ include build_support.py
2
+ include docs/en/quick-start.md docs/en/concepts.md docs/en/workflow.md docs/en/reference.md docs/en/onboarding-agent.md
3
+ include docs/zh/quick-start.md docs/zh/concepts.md docs/zh/workflow.md docs/zh/reference.md docs/zh/onboarding-agent.md
4
+ include docs/development/0.4.0-validation.md
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: guarantee-based-coding
3
- Version: 0.2.3
3
+ Version: 0.4.0
4
4
  Summary: Make code safely modifiable even when not fully understood — turn implicit inter-module dependencies into explicit, executable, verifiable guarantees.
5
5
  Author: Jesse-x86
6
6
  License-Expression: Apache-2.0
@@ -61,6 +61,17 @@ gbc setup # 打印本地化接线指南:怎么把 MCP / skills 接入
61
61
 
62
62
  English docs: [docs/en/](./docs/en/)。
63
63
 
64
+ 安装后也能离线查询同版本手册:`gbc doc list --lang zh`、`gbc doc read quick-start --lang zh`、
65
+ `gbc doc search "保证" --lang zh`。`--help` 仍用于查简短命令语法。
66
+
67
+ **0.4.0** 在 0.3.0 的命令职责与离线手册基础上,完善意图起草、保证测试和术语 / 决策复用工作流。
68
+ 0.3.0 中项目架构意图入口由 `gbc doc` 改为 `gbc intent`,MCP 的八个意图工具由 `doc_*`
69
+ 改为 `intent_*`,不保留旧别名。此后的 `gbc doc` 专门查询 GBC 手册。
70
+
71
+ 0.4.0 增加可配合 MCP 或 CLI 使用的 **gbc-workflow** skill:先查证据再起草意图、保护消费者
72
+ 行为的保证测试,以及术语与决策理由复用。**gbc-cli** 保留为命令适配器;用 `gbc setup` 查询
73
+ 随包路径,按客户端需要在项目内接入,不自动全局安装。详见[工作流](./docs/zh/workflow.md)。
74
+
64
75
  ---
65
76
 
66
77
  ## 核心想法
@@ -87,9 +98,9 @@ GBC 目前是一个可用的 Python 分发包(`pipx install guarantee-based-co
87
98
 
88
99
  - ✅ 核心保证机制(具名 id、多对一、出生即绿、退休保护、反查)
89
100
  - ✅ 多语言 executor 配置
90
- - ✅ CLI + MCP 双接口(含意图文档 `gbc doc` 全进 MCP)
91
- - ✅ 意图文档子系统(`gbc doc` / web 编辑器)
92
- - ✅ 随包分发的接线指南(`gbc setup`)与 CLI-only agent skill
101
+ - ✅ CLI + MCP 双接口(含意图文档 `gbc intent` 全进 MCP)
102
+ - ✅ 意图文档子系统(`gbc intent` / web 编辑器)
103
+ - ✅ 随包接线指南(`gbc setup`)、通用于 MCP / CLI 的工作流 skill 与 CLI 命令适配 skill
93
104
  - ✅ 原子文件写入 + 备份
94
105
 
95
106
 
@@ -1,87 +1,98 @@
1
- # Guarantee-Based Coding (GBC)
2
-
3
- **与其指望 AI 更聪明,不如让再笨的 agent 也改不坏你的代码。**
4
-
5
- **English version: [docs/en/README.md](docs/en/README.md)**
6
-
7
- GBC 把「这次改动会不会悄悄碰坏别处」从一种担心,变成可以当场验证的事实:你在意的行为被登记成
8
- 一条条带测试的**保证(guarantee)**,每次改完一跑——全绿就安心,有红就精确告诉你碰坏了谁、谁在
9
- 依赖它。
10
-
11
- ---
12
-
13
- ## 🚀 快速开始
14
-
15
- ```bash
16
- pipx install guarantee-based-coding
17
- gbc setup # 打印本地化接线指南:怎么把 MCP / skills 接入你的 agent
18
- ```
19
-
20
- 装好后 `gbc` 命令即在 PATH 上。完整上手(安装 → 接入 agent → 冒烟验证)见
21
- **[docs/zh/quick-start.md](./docs/zh/quick-start.md)**。
22
-
23
- 想让 agent 替你接入?把 **[docs/zh/onboarding-agent.md](./docs/zh/onboarding-agent.md)** 交给它。
24
-
25
- ---
26
-
27
- > 🚧 **交互式 demo 施工中**:旧的演示套件已废弃,新的交互式演示正在筹备。目前请直接读文档上手。
28
-
29
- ---
30
-
31
- ## 📚 文档
32
-
33
- | 你想 | 看这里 |
34
- |------|--------|
35
- | 装好并跑起来 | [快速开始](./docs/zh/quick-start.md) |
36
- | 懂 GBC 在保护什么 | [核心概念](./docs/zh/concepts.md) |
37
- | 在 GBC 下安全改代码 | [工作流](./docs/zh/workflow.md) |
38
- | 查命令 / 工具 / executor | [参考手册](./docs/zh/reference.md) |
39
- | 你是 agent,被要求接入 GBC | [Agent 上手](./docs/zh/onboarding-agent.md) |
40
-
1
+ # Guarantee-Based Coding (GBC)
2
+
3
+ **与其指望 AI 更聪明,不如让再笨的 agent 也改不坏你的代码。**
4
+
5
+ **English version: [docs/en/README.md](docs/en/README.md)**
6
+
7
+ GBC 把「这次改动会不会悄悄碰坏别处」从一种担心,变成可以当场验证的事实:你在意的行为被登记成
8
+ 一条条带测试的**保证(guarantee)**,每次改完一跑——全绿就安心,有红就精确告诉你碰坏了谁、谁在
9
+ 依赖它。
10
+
11
+ ---
12
+
13
+ ## 🚀 快速开始
14
+
15
+ ```bash
16
+ pipx install guarantee-based-coding
17
+ gbc setup # 打印本地化接线指南:怎么把 MCP / skills 接入你的 agent
18
+ ```
19
+
20
+ 装好后 `gbc` 命令即在 PATH 上。完整上手(安装 → 接入 agent → 冒烟验证)见
21
+ **[docs/zh/quick-start.md](./docs/zh/quick-start.md)**。
22
+
23
+ 想让 agent 替你接入?把 **[docs/zh/onboarding-agent.md](./docs/zh/onboarding-agent.md)** 交给它。
24
+
25
+ ---
26
+
27
+ > 🚧 **交互式 demo 施工中**:旧的演示套件已废弃,新的交互式演示正在筹备。目前请直接读文档上手。
28
+
29
+ ---
30
+
31
+ ## 📚 文档
32
+
33
+ | 你想 | 看这里 |
34
+ |------|--------|
35
+ | 装好并跑起来 | [快速开始](./docs/zh/quick-start.md) |
36
+ | 懂 GBC 在保护什么 | [核心概念](./docs/zh/concepts.md) |
37
+ | 在 GBC 下安全改代码 | [工作流](./docs/zh/workflow.md) |
38
+ | 查命令 / 工具 / executor | [参考手册](./docs/zh/reference.md) |
39
+ | 你是 agent,被要求接入 GBC | [Agent 上手](./docs/zh/onboarding-agent.md) |
40
+
41
41
  English docs: [docs/en/](./docs/en/)。
42
42
 
43
- ---
44
-
45
- ## 核心想法
46
-
47
- 代码之间的依赖本质上是一组**保证**。模块 A 依赖模块 B,不是依赖它的实现细节,而是依赖它的某些
48
- 行为承诺——返回值的类型、格式、语义。把这些保证从隐含变成**显式、可执行、可验证**,正确性的判定
49
- 就从「AI 觉得自己改对了」变成「所有被依赖的保证仍通过」——一个可机械验证的布尔条件。
50
-
51
- ![无 GBC vs GBC](docs/assets/workflow-comparison.svg)
52
-
53
- GBC **不是**另一个要挑战 Cursor / Aider 的 AI 编程助手,而是填补它们在大型项目里缺的一环:
54
- **机器可判定的变更边界**。它与那些 agent 配合——改前查依赖树,改后必须跑通所有相关保证;也区别
55
- 于 CI——CI 是事后的,GBC 是准入制的门禁,错误在落地前就被拦在 agent 的上下文里。
56
-
57
- 完整概念、架构图、与已有概念(Design by Contract / 测试)的区别,见
58
- [核心概念](./docs/zh/concepts.md)。
59
-
60
- ---
61
-
62
- ## 当前状态
63
-
64
- GBC 目前是一个可用的 Python 分发包(`pipx install guarantee-based-coding`),自身用 GBC 管理自己的
65
- `.gbc/`(dogfooding):
66
-
67
- - ✅ 核心保证机制(具名 id、多对一、出生即绿、退休保护、反查)
68
- - 多语言 executor 配置
69
- - ✅ CLI + MCP 双接口(含意图文档 `gbc doc` 全进 MCP)
70
- - ✅ 意图文档子系统(`gbc doc` / web 编辑器)
71
- - ✅ 随包分发的接线指南(`gbc setup`)与 CLI-only agent 的 skill 包
72
- - ✅ 原子文件写入 + 备份
73
-
74
-
75
- **诚实的局限**:保护能力上限 = 测试质量(测试只走 happy path 就是虚假安全感);依赖需主动登记,
76
- 覆盖率随项目增长需持续投入;每次验证真实跑测试,有一定延迟。详见
77
- [核心概念 · 局限性](./docs/zh/concepts.md#局限性诚实地说)。
78
-
79
- ---
80
-
81
- ## 许可
82
-
83
- 本项目采用 [Apache-2.0](./LICENSE) 许可证。
84
-
85
- ## 联系
86
-
87
- 如果你对这个方向感兴趣,欢迎 star、issue 或者直接联系我。
43
+ 安装后也能离线查询同版本手册:`gbc doc list --lang zh`、`gbc doc read quick-start --lang zh`、
44
+ `gbc doc search "保证" --lang zh`。`--help` 仍用于查简短命令语法。
45
+
46
+ **0.4.0** 在 0.3.0 的命令职责与离线手册基础上,完善意图起草、保证测试和术语 / 决策复用工作流。
47
+ 0.3.0 中项目架构意图入口由 `gbc doc` 改为 `gbc intent`,MCP 的八个意图工具由 `doc_*`
48
+ 改为 `intent_*`,不保留旧别名。此后的 `gbc doc` 专门查询 GBC 手册。
49
+
50
+ 0.4.0 增加可配合 MCP 或 CLI 使用的 **gbc-workflow** skill:先查证据再起草意图、保护消费者
51
+ 行为的保证测试,以及术语与决策理由复用。**gbc-cli** 保留为命令适配器;用 `gbc setup` 查询
52
+ 随包路径,按客户端需要在项目内接入,不自动全局安装。详见[工作流](./docs/zh/workflow.md)。
53
+
54
+ ---
55
+
56
+ ## 核心想法
57
+
58
+ 代码之间的依赖本质上是一组**保证**。模块 A 依赖模块 B,不是依赖它的实现细节,而是依赖它的某些
59
+ 行为承诺——返回值的类型、格式、语义。把这些保证从隐含变成**显式、可执行、可验证**,正确性的判定
60
+ 就从「AI 觉得自己改对了」变成「所有被依赖的保证仍通过」——一个可机械验证的布尔条件。
61
+
62
+ ![无 GBC vs 有 GBC](docs/assets/workflow-comparison.svg)
63
+
64
+ GBC **不是**另一个要挑战 Cursor / Aider AI 编程助手,而是填补它们在大型项目里缺的一环:
65
+ **机器可判定的变更边界**。它与那些 agent 配合——改前查依赖树,改后必须跑通所有相关保证;也区别
66
+ 于 CI——CI 是事后的,GBC 是准入制的门禁,错误在落地前就被拦在 agent 的上下文里。
67
+
68
+ 完整概念、架构图、与已有概念(Design by Contract / 测试)的区别,见
69
+ [核心概念](./docs/zh/concepts.md)。
70
+
71
+ ---
72
+
73
+ ## 当前状态
74
+
75
+ GBC 目前是一个可用的 Python 分发包(`pipx install guarantee-based-coding`),自身用 GBC 管理自己的
76
+ `.gbc/`(dogfooding):
77
+
78
+ - ✅ 核心保证机制(具名 id、多对一、出生即绿、退休保护、反查)
79
+ - ✅ 多语言 executor 配置
80
+ - ✅ CLI + MCP 双接口(含意图文档 `gbc intent` 全进 MCP)
81
+ - ✅ 意图文档子系统(`gbc intent` / web 编辑器)
82
+ - ✅ 随包接线指南(`gbc setup`)、通用于 MCP / CLI 的工作流 skill 与 CLI 命令适配 skill
83
+ - ✅ 原子文件写入 + 备份
84
+
85
+
86
+ **诚实的局限**:保护能力上限 = 测试质量(测试只走 happy path 就是虚假安全感);依赖需主动登记,
87
+ 覆盖率随项目增长需持续投入;每次验证真实跑测试,有一定延迟。详见
88
+ [核心概念 · 局限性](./docs/zh/concepts.md#局限性诚实地说)。
89
+
90
+ ---
91
+
92
+ ## 许可
93
+
94
+ 本项目采用 [Apache-2.0](./LICENSE) 许可证。
95
+
96
+ ## 联系
97
+
98
+ 如果你对这个方向感兴趣,欢迎 star、issue 或者直接联系我。
@@ -0,0 +1,29 @@
1
+ """Copy the canonical offline manual into built packages, never the source tree."""
2
+ from pathlib import Path
3
+
4
+ from setuptools.command.build_py import build_py
5
+
6
+
7
+ MANUAL_LANGUAGES = ("en", "zh")
8
+ MANUAL_TOPICS = ("quick-start", "concepts", "workflow", "reference", "onboarding-agent")
9
+
10
+
11
+ class BuildPy(build_py):
12
+ """Include the fixed manual topics when building directly or from an sdist."""
13
+
14
+ def _manual_files(self):
15
+ root = Path(__file__).resolve().parent
16
+ for language in MANUAL_LANGUAGES:
17
+ for topic in MANUAL_TOPICS:
18
+ relative = Path(language) / f"{topic}.md"
19
+ yield root / "docs" / relative, Path(self.build_lib) / "gbc/assets/docs" / relative
20
+
21
+ def run(self):
22
+ super().run()
23
+ for source, destination in self._manual_files():
24
+ self.mkpath(str(destination.parent))
25
+ self.copy_file(str(source), str(destination))
26
+
27
+ def get_outputs(self, include_bytecode=True):
28
+ outputs = super().get_outputs(include_bytecode=include_bytecode)
29
+ return outputs + [str(destination) for _, destination in self._manual_files()]
@@ -0,0 +1,61 @@
1
+ # 0.4.0 workflow validation
2
+
3
+ Date: 2026-09-23. This record distinguishes source inspection, observed test results, and remaining validation. Publication status is tracked in `TODO.md`; a completed local check is not an upload receipt.
4
+
5
+ ## Scope and design basis
6
+
7
+ The authorized change covers three workflow improvements: evidence-first intent drafting with consequential questions; tests that protect consumer behavior; and reuse of vocabulary and material decision reasons. It adds the transport-neutral `gbc-workflow` skill and updates guidance. It does not change the engine, command names, fixed manual topics, guarantee schema, born-green, or the project's existing approval authority. `gbc-cli` remains the CLI adapter.
8
+
9
+ Source inspection found concrete weaknesses in the previous guidance:
10
+
11
+ - `docs/en/workflow.md` and its Chinese counterpart favored non-null/type checks over exact assertions without asking which values consumers actually require.
12
+ - `gbc/assets/i18n/texts/rules.*.md` encouraged reporting every step and asking whenever unsure, without first distinguishing discoverable facts from consequential choices.
13
+ - The workflow's bad-fixture advice could be satisfied by a mock that bypasses the behavior under protection. Passing such an assertion does not demonstrate target-defect sensitivity.
14
+ - Existing guidance already required defined terms and current-state intent. The change adds reuse of existing vocabulary and decision reasons rather than a mandatory new document convention.
15
+
16
+ Existing project evidence supplied the examples: `.gbc/gbc/app/core/gbc.md` requires reverse dependency preservation until the final relevant symbol dependency is removed; `tests/test_guarantee_deps.py` checks the resulting retirement protection. `.gbc/gbc/app/intent/gbc.editor.py.json` distinguishes HTTP 400 for invalid paths from HTTP 200 with `meta: null` for missing metadata. The latter is contract inspection, not a new editor test run. The intent subsystem's existing `base` IO boundary supplies the vocabulary/decision example.
17
+
18
+ Selective design inspiration comes from Matt Pocock's [grilling](https://github.com/mattpocock/skills/blob/main/skills/productivity/grilling/SKILL.md), [tdd](https://github.com/mattpocock/skills/blob/main/skills/engineering/tdd/SKILL.md), and [domain-modeling](https://github.com/mattpocock/skills/blob/main/skills/engineering/domain-modeling/SKILL.md). GBC adopts fact investigation, meaningful behavior boundaries, and vocabulary/scenario/reason reuse within its own existing contracts. It does not require the source skills, exhaustive interviews, per-test-boundary approval, universal red-first, or a new CONTEXT/ADR document.
19
+
20
+ ## Historical defect replay: observed
21
+
22
+ The isolated replay ran the unchanged existing `test_shared_guarantee_keeps_retirement_guard_until_last_symbol_removed` through GBC, covering both single-guarantee removal and whole-symbol removal. Its detailed local record is `.cache/workflow-eval-0.4.0/dependency-replay/REPORT.md`.
23
+
24
+ | Stage | GBC CLI exit | Observed result |
25
+ | --- | ---: | --- |
26
+ | Born-green creation against current implementation | 0 | Registration accepted |
27
+ | Explicit current implementation verification | 0 | 2 passed |
28
+ | Exact historical module substituted | 1 | 2 failed at the target behavioral assertion |
29
+ | Exact current module restored | 0 | 2 passed |
30
+
31
+ The historical source was Git blob `aaaa8521bf3d193d29e5f9ca833a86e6ef5e7090^:gbc/app/core/guarantee.py`. Both failures occurred at test line 165: the consumer disappeared from `dependents_of` after only the first symbol dependency was removed. The failures were behavioral, not import, fixture, or temporary-directory failures. **The historical run stopped before the later retirement assertion; retirement itself was not executed in RED.** A separate final restored verification also returned 2 passed.
32
+
33
+ The test file remained byte-identical. An observation-only `conftest.py` recorded the module path and hash from inside each actual test subprocess. Current/restored SHA-256 was `1f70804b46859927954b8a1f58cdf2350b83ab1dc5f298cdc268d71c8ba3b44e`; historical SHA-256 was `843a25b543d095e357331c807f1d771beb5cb532c604ff637ff11646306fecac`. The sandbox used a fresh executor, the dedicated Windows interpreter, explicit cwd/PYTHONPATH, controlled basetemp, disabled pytest cache and third-party plugin autoload. Tests ran only through GBC. Explicit verification logs contained no skipped, xfail, or warning entries.
34
+
35
+ This establishes sensitivity of **one existing test** to its historical defect. It is a historical module inside the current package/environment, not a full historical-release execution. It does not establish universal workflow efficacy or the quality of newly authored tests. Raw logs, hashes, exact subprocess arguments, and the restoration procedure are in the local replay directory; that cache is supplementary evidence rather than a shipped artifact.
36
+
37
+ ## Forward workflow evaluation: observed, qualitative
38
+
39
+ An independent evaluator read the new skill and handled three realistic requests without changing code or metadata, running tests, or actually questioning the user. The detailed local record is `.cache/workflow-eval-0.4.0/forward-evaluation.md`. The following preserves the substantive outcomes and durable evidence rather than relying only on that local cache:
40
+
41
+ | Request | Observed judgment | Durable evidence examined by the evaluator |
42
+ | --- | --- | --- |
43
+ | Simplify file-meta responses to HTTP 200/null | Rejected flattening invalid paths and non-directory roots into the empty state; traced the frontend's error/empty distinction, reused existing guarantees, and proposed precise HTTP and view assertions. | `gbc/app/intent/editor.py` file-meta handler; `gbc/app/intent/base.py:file_meta_view`; `gbc/assets/editor/js/api.js`, `actions.js`, `editor-view.js`; `tests/test_intent_editor_api.py` |
44
+ | Preserve concurrent editor changes and allow explicit conflict overwrite | Discovered existing field-level three-way merge and force handling; preserved the base IO / HTTP surface boundary and reused selective-write, preservation, and conflict guarantees. Identified UI detail, concurrent writes, and changes occurring after the conflict prompt as distinct possible follow-ups. | `.gbc/gbc/app/intent/gbc.md`; `gbc/app/intent/base.py:save_flat`; `gbc/assets/editor/js/actions.js`; `tests/test_intent_flat.py`; registered base/editor guarantees |
45
+ | Rename heavy as timeout and describe GREEN as every test passing | Rejected both semantic changes using existing definitions and implementation. Proposed clearer wording in existing docs, retaining skipped counts and distinguishing cost rank, timeout, gate result, and execution coverage; did not require a new ADR/CONTEXT file. | `.gbc/gbc.md`; `docs/en/concepts.md`, `docs/zh/concepts.md`; `gbc/app/models/meta.py`; `gbc/app/models/verify.py:VerifySummary.green`; `gbc/app/core/guarantee.py`; `tests/test_cli_commands.py` |
46
+
47
+ The file-meta inspection also found an important boundary: current `meta: null` means no displayable view, including existing handling of damaged/unreadable metadata, not exclusively an unregistered file. A future change must not silently narrow that compatibility behavior. Existing null-versus-error examples in the manual illustrate the missing-metadata case without claiming it is the only null case.
48
+
49
+ For the save request, the evaluator's suggested UI/conflict-version/concurrency refinements are **unapproved proposals outside 0.4.0**, not new implementation commitments. This evaluation did not authorize expanding the release. Test plans described in the responses were not executed, and the inspected editor paths were not retested by these dry-runs.
50
+
51
+ The outputs show evidence-first judgment, consumer-oriented assertions, reuse of terminology/contracts, and awareness of approval boundaries in these three cases. There was no before/after control, productivity measurement, or runtime implementation assessment. The evaluator used the new guidance, so this is limited qualitative forward evidence, not a universal efficacy claim or proof of future agent compliance.
52
+
53
+ ## Packaging and final acceptance
54
+
55
+ Top-level verification through GBC covered seven affected providers and twelve guarantees: **12 passed, 0 failed, 0 skipped**. The providers were assets, documentation base/CLI, translation, interface CLI/MCP, and the entry point. Both graph and intent consistency checks passed. This is affected-scope acceptance, not a claim that every repository test was executed. Exact source-gate results are preserved locally in `.cache/release-receipts-0.4.0/source-gates.json`.
56
+
57
+ Two temporary GBC guarantees ran the official skill-creator `quick_validate` against `gbc-workflow` and `gbc-cli`; both passed. Earlier bounded asset self-verification reported 9 passed. The sdist build, wheel build from that sdist, `twine check --strict`, and installed-environment `pip check` all passed.
58
+
59
+ The built 0.4.0 wheel was installed into a separate virtual environment. The observed `gbc.__file__` resolved to that environment's `site-packages`, and `__version__` was 0.4.0. This environment reused existing system dependencies; the GBC package itself came from its own wheel, not the editable source checkout. A registered GBC guarantee ran **13 installed smoke checks and passed**, including real module/console entry points, CLI migration behavior, all ten English/Chinese manual documents across five fixed topics, localized setup/rules, packaged editor/i18n/skill resources, all four workflow skill files with resolved local reference links, a persistent intent round trip, consistency exit codes, and a real MCP stdio session listing 30 tools. The raw installed gate output is `.cache/release-receipts-0.4.0/installed-gate.log`.
60
+
61
+ The source distribution includes this validation report through an explicit manifest entry. The observations above concern the verified wheel payload; a rebuild that only adds source-distribution documentation requires a payload identity check before those results are reused. Publication status is tracked separately in `TODO.md`; local validation results are not publication receipts.
@@ -0,0 +1,229 @@
1
+ # Core Concepts
2
+
3
+ > Language: [简体中文](../zh/concepts.md) | **English**
4
+
5
+ This page explains GBC's core concepts — what it actually protects, and how. To get hands-on first
6
+ see [quick-start.md](./quick-start.md); for the workflow see [workflow.md](./workflow.md).
7
+
8
+ ---
9
+
10
+ ## The problem: when changing code, how do you know what must not break?
11
+
12
+ A coding agent's core failure mode isn't writing wrong code — that can be retried. The real problem
13
+ is **silently breaking the implicit assumptions of existing code**. When an agent changes a
14
+ function's return format, other modules that depend on that format can quietly break — with no
15
+ mechanism telling the agent those dependencies exist, and none stopping it when the break happens.
16
+
17
+ ## The core idea: turn implicit dependencies into explicit guarantees
18
+
19
+ Dependencies between code are essentially a set of **guarantees**. Module A depends on module B not
20
+ on B's implementation details, but on some of B's behavioral promises — the type, format, semantics
21
+ of return values.
22
+
23
+ Make those guarantees **explicit, executable, and verifiable** and you get:
24
+
25
+ - Every change mechanically verifies whether all guarantees still hold;
26
+ - When a guarantee breaks, you know exactly which one and who depends on it;
27
+ - **Correctness shifts from "the AI thinks it got it right" to "every depended-on guarantee still
28
+ passes"** — a mechanically verifiable boolean.
29
+
30
+ ![Without GBC vs with GBC](../assets/workflow-comparison_en.svg)
31
+
32
+ ---
33
+
34
+ ## Architecture
35
+
36
+ ![GBC architecture](../assets/architecture_en.svg)
37
+
38
+ ### Three design principles
39
+
40
+ 1. **Zero source intrusion**: all metadata lives under the target project's `.gbc/` directory —
41
+ no source edits, no decorators/annotations.
42
+ 2. **Tests are user-owned**: GBC does not generate, store, or manage the test files themselves.
43
+ You organize tests your own way in your own project; GBC only **records which test backs which
44
+ guarantee, runs them, and aggregates results**.
45
+ 3. **Language-agnostic**: any language and test framework, via executor config.
46
+
47
+ ---
48
+
49
+ ## Two layers of contract
50
+
51
+ GBC pins down the impact of a change with two layers:
52
+
53
+ 1. **Intent layer**: in `.gbc/**/gbc.md`. Natural language (Markdown) defining a folder's role,
54
+ internal constraints, and architectural intent. It is the source of truth — it tells an agent
55
+ "what you should and shouldn't do here." **Human-held**; the agent only drafts.
56
+ 2. **Guarantee layer**: in `.gbc/**/*.json`. Executable, test-backed concrete behavioral promises.
57
+
58
+ When changing code, the agent must honor both the intent layer (don't violate the original purpose)
59
+ and the guarantee layer (don't break concrete behavior).
60
+
61
+ How to write intent docs (the three sections: intent / internal constraints / files) is in
62
+ [workflow.md](./workflow.md#writing-intent-docs).
63
+
64
+ ---
65
+
66
+ ## The intent document system (gbc.md)
67
+
68
+ The behavior layer guards "behavior doesn't break"; the intent layer guards "direction doesn't
69
+ drift" — both are pre-change defenses, but of different natures: guarantees are mechanically
70
+ verifiable (born-green / verify), while intent relies on **human sign-off + tool consistency**.
71
+
72
+ ### What it is
73
+
74
+ Each folder's intent lives in `.gbc/<path>/gbc.md`, made of three sections that are really
75
+ **visibility scopes**:
76
+
77
+ | Section | Answers | Who needs to know |
78
+ |---|---|---|
79
+ | **Intent** | What this is and why it exists | Outside (public contract) |
80
+ | **Internal constraints** | What it must / must never do | Internal coordination (package-private) |
81
+ | **Files** | Subfolders + file list, one role line each | Only the file itself (private) |
82
+
83
+ When unsure whether something is "intent vs constraint", ask per sentence: "who needs to know
84
+ this?". It only records the **current state** (what it is now, what it must do now), not diffs
85
+ against the past — phase words, roadmaps, and migration narratives are drift bait.
86
+
87
+ ### How it is maintained
88
+
89
+ - **Hierarchy**: a subfolder's intent auto-projects into its parent's entry; parent/child
90
+ consistency is a **deterministic constraint** maintained by the `gbc intent` tools (`intent check`
91
+ reports DRIFT / ORPHAN, `intent sync` repairs).
92
+ - **The only compliant entry**: `gbc intent` (CLI / MCP intent tools). Never hand-edit — hand-editing
93
+ drifts the deterministic constraint, downgrading "verifiable truth" to "best-effort habit".
94
+ - **Spec-first**: investigate the relevant evidence first. If existing intent covers the task,
95
+ use it; if it must change, draft the delta, obtain the approval required by the project's rules,
96
+ and land it before implementation. See [workflow.md](./workflow.md) and the **gbc-workflow** skill
97
+ for consequential questions, vocabulary reuse, and preserving decision reasons with MCP or CLI.
98
+
99
+ ### How it relates to the guarantee layer
100
+
101
+ The intent layer answers "why, and what are the boundary obligations" — **not mechanically
102
+ verifiable**; it relies on human sign-off + intent check. The guarantee layer answers "does the
103
+ behavior still hold" — **mechanically verifiable**. The former prevents directional drift, the
104
+ latter prevents behavioral breakage; they complement each other.
105
+
106
+ ### How to treat it
107
+
108
+ It is a **snapshot of the current state, not a sacred text**: born to prevent drift, not to
109
+ freeze the architecture. Found it wrong, or it starts blocking reasonable evolution? Draft the
110
+ delta → human sign-off → commit through the tools — legitimate evolution, not a violation.
111
+ Piling responsibilities into one file instead of changing the intent (a god file) is exactly the
112
+ drift-guard mechanism turned upside down. For an agent: **read it (map before acting), obey it
113
+ (stay in scope), propose changes to it (through the official channel) — but don't own it.**
114
+
115
+ ---
116
+
117
+ ## Core terms
118
+
119
+ - **Provider**: the source file that offers a guarantee (e.g. `src/llm_client/client.py`).
120
+ - **Consumer / Dependent**: a file depending on a guarantee (e.g. `src/conversation/manager.py`).
121
+ - **Guarantee**: a **named** behavioral promise (id shaped `<symbol>.<behavior>`, path-free),
122
+ backed by a test + a description. **Multiple consumers may share one guarantee.**
123
+ - **Executor**: config defining how to run tests (command template, working dir, env vars, ...).
124
+
125
+ ### Two tiers of dependency edge
126
+
127
+ - **Symbol dependency (free)**: depends only on a signature or a symbol existing; no test, no
128
+ reverse edge.
129
+ - **Named guarantee dependency**: depends on concrete behavior. Registered **both ways** via the
130
+ reverse-edge mechanism — the provider's `provides[id].dependents` ⇄ the consumer's
131
+ `depends_on[].guarantees`, kept in sync by the tooling.
132
+
133
+ > Default to free symbol dependencies; upgrade to a named guarantee **only** when you depend on
134
+ > concrete behavior (not just a signature), and upgrade lazily.
135
+
136
+ ---
137
+
138
+ ## The unbreakable core invariants
139
+
140
+ Whichever surface you swap in — CLI / MCP / a future GUI — these engine-level invariants hold:
141
+
142
+ - **Guarantees are first-class; identity is a named id** (e.g. `get_config.never_none`, ≠ a test
143
+ path).
144
+ - **Many-to-one**: one guarantee can be shared by many consumers; hitting an existing one appends
145
+ a dependent and reuses it, rather than writing a second test.
146
+ - **Two-section self-contained meta**: one `.gbc` json per code file, `provides` (as provider) +
147
+ `depends_on` (as consumer).
148
+ - **Born-green**: on create / test change the test runs on the spot, and registration is refused
149
+ if it fails — the one integrity invariant, with no backdoor.
150
+ Passing this gate does not establish defect sensitivity; the test must protect the consumer's
151
+ actual behavior, including exact values when contractual (see [workflow.md](./workflow.md#narrow-test-rule)).
152
+ - **Retirement protection**: a guarantee with dependents refuses deletion.
153
+ - **Binary gate**: a test that ran is pass or fail; one that was skipped (heavy) is reported loudly
154
+ but never turns the gate red. Green = no failures.
155
+ - **heavy** is a cost rank (int) + an auto-run authorization: batch runs only heavy ≤ threshold;
156
+ a named verify ignores it.
157
+
158
+ ### What a meta file looks like
159
+
160
+ `client.py` (provider), at `.gbc/src/llm_client/gbc.client.py.json`:
161
+
162
+ ```json
163
+ {
164
+ "provides": {
165
+ "chat.content_is_str": {
166
+ "desc": "chat()'s result['content'] is a str; manager concatenates it into history directly",
167
+ "test": "tests/test_client_content_is_str.py::test_content_is_str",
168
+ "executor": "pytest-myproject",
169
+ "heavy": 0,
170
+ "dependents": ["src/conversation/manager.py"]
171
+ }
172
+ }
173
+ }
174
+ ```
175
+
176
+ `manager.py` (consumer), at `.gbc/src/conversation/gbc.manager.py.json`, records the reverse edge:
177
+
178
+ ```json
179
+ {
180
+ "depends_on": [
181
+ {
182
+ "symbol": "src/llm_client/client.py:chat",
183
+ "guarantees": ["chat.content_is_str"]
184
+ }
185
+ ]
186
+ }
187
+ ```
188
+
189
+ Both directions are written by the tools (CLI / MCP); you don't hand-edit them.
190
+
191
+ ---
192
+
193
+ ## What it is not
194
+
195
+ GBC is **not** another AI coding assistant challenging Cursor or Aider. It fills the piece they lack
196
+ in large, complex projects: a **machine-verifiable boundary for change**.
197
+
198
+ - **Works with Cursor / Aider**: they're good at finding and editing code, but lack explicit
199
+ awareness of cross-module dependencies and thus break things silently. GBC gives them a
200
+ "constraint guardrail" — check the dependency tree before, and pass all relevant guarantees
201
+ after.
202
+ - **Different from CI**: CI is after-the-fact — it catches errors after commit. GBC is
203
+ admission-based — a gate inside the agent's workflow, catching errors before they land, inside
204
+ the agent's context.
205
+
206
+ ### How it differs from existing ideas
207
+
208
+ **"Isn't this just Design by Contract?"** Traditional contract programming has a module declare its
209
+ **own** contract. GBC's key differences: a guarantee is **registered by the dependent** ("what
210
+ behavior of yours I rely on" comes from the user), it **carries attribution** (who registered it
211
+ and why, so breaking it pinpoints impact), and it **targets AI agents** (a boundary for change,
212
+ not a runtime check).
213
+
214
+ **"Isn't this just testing?"** Technically a guarantee is a test file. Conceptually: it **carries
215
+ attribution** (records who registered it, which cross-module dependency it protects), it's a
216
+ **live gate** (not run after-the-fact in CI, but an admission condition when the agent changes
217
+ code), and it's **user-managed** (GBC manages the metadata and running, not the test files
218
+ themselves).
219
+
220
+ ---
221
+
222
+ ## Limitations (stated honestly)
223
+
224
+ - **Protection ceiling = test quality**: GBC only catches what a test can catch. Tests that only
225
+ walk the happy path make guarantees a false sense of safety. (Happy-path-only tests are the
226
+ textbook example.)
227
+ - **Manual registration cost**: dependencies must be registered by an agent or human. The per-edge
228
+ cost is small, but coverage takes ongoing investment as the project grows.
229
+ - **Run performance**: every verification really runs tests, so there's some latency cost.