guarantee-based-coding 0.2.1__tar.gz → 0.2.3__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.
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/LICENSE +0 -0
- {guarantee_based_coding-0.2.1/guarantee_based_coding.egg-info → guarantee_based_coding-0.2.3}/PKG-INFO +108 -108
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/README.md +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/__init__.py +1 -1
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/__init__.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/assets.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/config/__init__.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/config/backups.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/config/base.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/config/executor.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/config/project.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/core/__init__.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/core/env.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/core/executor.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/core/guarantee.py +12 -5
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/i18n/__init__.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/i18n/lang.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/i18n/translate.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/intent/__init__.py +0 -0
- guarantee_based_coding-0.2.3/gbc/app/intent/base.py +721 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/intent/cli.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/intent/editor.py +59 -9
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/interface/__init__.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/interface/base.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/interface/cli.py +6 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/interface/mcp.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/models/__init__.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/models/errors.py +11 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/models/meta.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/models/verify.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/utils/__init__.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/utils/file_utils.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/utils/gbc_md.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/utils/json_model_operator.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/app/utils/safe_file_writer.py +0 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/app.js +6 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/css/foundation.css +71 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/css/review.css +41 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/css/workspace.css +65 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/i18n.js +352 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/index.html +82 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/js/actions.js +597 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/js/api.js +43 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/js/diff.js +30 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/js/dom.js +42 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/js/editor-view.js +218 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/js/review-view.js +110 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/js/semantic.js +166 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/js/state.js +19 -0
- guarantee_based_coding-0.2.3/gbc/assets/editor/js/tree-view.js +43 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/assets/i18n/catalog/en.json +4 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/assets/i18n/catalog/zh.json +4 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/assets/i18n/texts/rules.en.md +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/assets/i18n/texts/rules.zh.md +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/assets/i18n/texts/setup.en.md +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/assets/i18n/texts/setup.zh.md +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/assets/skills/README.md +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/assets/skills/gbc-cli/SKILL.md +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/gbc/entry.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3/guarantee_based_coding.egg-info}/PKG-INFO +108 -108
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/guarantee_based_coding.egg-info/SOURCES.txt +16 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/pyproject.toml +5 -1
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/setup.cfg +4 -4
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_assets.py +21 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_cli_commands.py +104 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_config_project.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_core_executor.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_env_actions.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_errors_i18n.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_executor_externalized.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_gbc_md.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_guarantee_crud.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_guarantee_deps.py +84 -1
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_guarantee_verify.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_i18n.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_intent_base.py +0 -0
- guarantee_based_coding-0.2.3/tests/test_intent_editor_api.py +394 -0
- guarantee_based_coding-0.2.3/tests/test_intent_flat.py +311 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_interface_base_crud.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_interface_base_deps.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_interface_base_query.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_interface_base_refactor.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_json_model_and_file_utils.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_mcp_doc_tools.py +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/tests/test_safe_file_writer.py +0 -0
- guarantee_based_coding-0.2.1/gbc/app/intent/base.py +0 -308
- guarantee_based_coding-0.2.1/gbc/assets/editor/index.html +0 -299
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/guarantee_based_coding.egg-info/dependency_links.txt +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/guarantee_based_coding.egg-info/entry_points.txt +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/guarantee_based_coding.egg-info/requires.txt +0 -0
- {guarantee_based_coding-0.2.1 → guarantee_based_coding-0.2.3}/guarantee_based_coding.egg-info/top_level.txt +0 -0
|
File without changes
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: guarantee-based-coding
|
|
3
|
-
Version: 0.2.
|
|
4
|
-
Summary: Make code safely modifiable even when not fully understood — turn implicit inter-module dependencies into explicit, executable, verifiable guarantees.
|
|
5
|
-
Author: Jesse-x86
|
|
6
|
-
License-Expression: Apache-2.0
|
|
7
|
-
Project-URL: Homepage, https://github.com/Jesse-x86/guarantee-based-coding
|
|
8
|
-
Project-URL: Repository, https://github.com/Jesse-x86/guarantee-based-coding
|
|
9
|
-
Keywords: guarantee,testing,ai-coding,mcp,code-safety
|
|
10
|
-
Classifier: Development Status :: 3 - Alpha
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Topic :: Software Development :: Testing
|
|
14
|
-
Requires-Python: >=3.10
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
16
|
-
License-File: LICENSE
|
|
17
|
-
Requires-Dist: typer[all]
|
|
18
|
-
Requires-Dist: pydantic
|
|
19
|
-
Requires-Dist: mcp<2.0,>=1.0
|
|
20
|
-
Dynamic: license-file
|
|
21
|
-
|
|
22
|
-
# Guarantee-Based Coding (GBC)
|
|
23
|
-
|
|
24
|
-
**与其指望 AI 更聪明,不如让再笨的 agent 也改不坏你的代码。**
|
|
25
|
-
|
|
26
|
-
**English version: [docs/en/README.md](docs/en/README.md)**
|
|
27
|
-
|
|
28
|
-
GBC 把「这次改动会不会悄悄碰坏别处」从一种担心,变成可以当场验证的事实:你在意的行为被登记成
|
|
29
|
-
一条条带测试的**保证(guarantee)**,每次改完一跑——全绿就安心,有红就精确告诉你碰坏了谁、谁在
|
|
30
|
-
依赖它。
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## 🚀 快速开始
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
pipx install guarantee-based-coding
|
|
38
|
-
gbc setup # 打印本地化接线指南:怎么把 MCP / skills 接入你的 agent
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
装好后 `gbc` 命令即在 PATH 上。完整上手(安装 → 接入 agent → 冒烟验证)见
|
|
42
|
-
**[docs/zh/quick-start.md](./docs/zh/quick-start.md)**。
|
|
43
|
-
|
|
44
|
-
想让 agent 替你接入?把 **[docs/zh/onboarding-agent.md](./docs/zh/onboarding-agent.md)** 交给它。
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
> 🚧 **交互式 demo 施工中**:旧的演示套件已废弃,新的交互式演示正在筹备。目前请直接读文档上手。
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## 📚 文档
|
|
53
|
-
|
|
54
|
-
| 你想 | 看这里 |
|
|
55
|
-
|------|--------|
|
|
56
|
-
| 装好并跑起来 | [快速开始](./docs/zh/quick-start.md) |
|
|
57
|
-
| 懂 GBC 在保护什么 | [核心概念](./docs/zh/concepts.md) |
|
|
58
|
-
| 在 GBC 下安全改代码 | [工作流](./docs/zh/workflow.md) |
|
|
59
|
-
| 查命令 / 工具 / executor | [参考手册](./docs/zh/reference.md) |
|
|
60
|
-
| 你是 agent,被要求接入 GBC | [Agent 上手](./docs/zh/onboarding-agent.md) |
|
|
61
|
-
|
|
62
|
-
English docs: [docs/en/](./docs/en/)。
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## 核心想法
|
|
67
|
-
|
|
68
|
-
代码之间的依赖本质上是一组**保证**。模块 A 依赖模块 B,不是依赖它的实现细节,而是依赖它的某些
|
|
69
|
-
行为承诺——返回值的类型、格式、语义。把这些保证从隐含变成**显式、可执行、可验证**,正确性的判定
|
|
70
|
-
就从「AI 觉得自己改对了」变成「所有被依赖的保证仍通过」——一个可机械验证的布尔条件。
|
|
71
|
-
|
|
72
|
-

|
|
73
|
-
|
|
74
|
-
GBC **不是**另一个要挑战 Cursor / Aider 的 AI 编程助手,而是填补它们在大型项目里缺的一环:
|
|
75
|
-
**机器可判定的变更边界**。它与那些 agent 配合——改前查依赖树,改后必须跑通所有相关保证;也区别
|
|
76
|
-
于 CI——CI 是事后的,GBC 是准入制的门禁,错误在落地前就被拦在 agent 的上下文里。
|
|
77
|
-
|
|
78
|
-
完整概念、架构图、与已有概念(Design by Contract / 测试)的区别,见
|
|
79
|
-
[核心概念](./docs/zh/concepts.md)。
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## 当前状态
|
|
84
|
-
|
|
85
|
-
GBC 目前是一个可用的 Python 分发包(`pipx install guarantee-based-coding`),自身用 GBC 管理自己的
|
|
86
|
-
`.gbc/`(dogfooding):
|
|
87
|
-
|
|
88
|
-
- ✅ 核心保证机制(具名 id、多对一、出生即绿、退休保护、反查)
|
|
89
|
-
- ✅ 多语言 executor 配置
|
|
90
|
-
- ✅ CLI + MCP 双接口(含意图文档 `gbc doc` 全进 MCP)
|
|
91
|
-
- ✅ 意图文档子系统(`gbc doc` / web 编辑器)
|
|
92
|
-
- ✅ 随包分发的接线指南(`gbc setup`)与 CLI-only agent 的 skill 包
|
|
93
|
-
- ✅ 原子文件写入 + 备份
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
**诚实的局限**:保护能力上限 = 测试质量(测试只走 happy path 就是虚假安全感);依赖需主动登记,
|
|
97
|
-
覆盖率随项目增长需持续投入;每次验证真实跑测试,有一定延迟。详见
|
|
98
|
-
[核心概念 · 局限性](./docs/zh/concepts.md#局限性诚实地说)。
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## 许可
|
|
103
|
-
|
|
104
|
-
本项目采用 [Apache-2.0](./LICENSE) 许可证。
|
|
105
|
-
|
|
106
|
-
## 联系
|
|
107
|
-
|
|
108
|
-
如果你对这个方向感兴趣,欢迎 star、issue 或者直接联系我。
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: guarantee-based-coding
|
|
3
|
+
Version: 0.2.3
|
|
4
|
+
Summary: Make code safely modifiable even when not fully understood — turn implicit inter-module dependencies into explicit, executable, verifiable guarantees.
|
|
5
|
+
Author: Jesse-x86
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/Jesse-x86/guarantee-based-coding
|
|
8
|
+
Project-URL: Repository, https://github.com/Jesse-x86/guarantee-based-coding
|
|
9
|
+
Keywords: guarantee,testing,ai-coding,mcp,code-safety
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Software Development :: Testing
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: typer[all]
|
|
18
|
+
Requires-Dist: pydantic
|
|
19
|
+
Requires-Dist: mcp<2.0,>=1.0
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# Guarantee-Based Coding (GBC)
|
|
23
|
+
|
|
24
|
+
**与其指望 AI 更聪明,不如让再笨的 agent 也改不坏你的代码。**
|
|
25
|
+
|
|
26
|
+
**English version: [docs/en/README.md](docs/en/README.md)**
|
|
27
|
+
|
|
28
|
+
GBC 把「这次改动会不会悄悄碰坏别处」从一种担心,变成可以当场验证的事实:你在意的行为被登记成
|
|
29
|
+
一条条带测试的**保证(guarantee)**,每次改完一跑——全绿就安心,有红就精确告诉你碰坏了谁、谁在
|
|
30
|
+
依赖它。
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 🚀 快速开始
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pipx install guarantee-based-coding
|
|
38
|
+
gbc setup # 打印本地化接线指南:怎么把 MCP / skills 接入你的 agent
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
装好后 `gbc` 命令即在 PATH 上。完整上手(安装 → 接入 agent → 冒烟验证)见
|
|
42
|
+
**[docs/zh/quick-start.md](./docs/zh/quick-start.md)**。
|
|
43
|
+
|
|
44
|
+
想让 agent 替你接入?把 **[docs/zh/onboarding-agent.md](./docs/zh/onboarding-agent.md)** 交给它。
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
> 🚧 **交互式 demo 施工中**:旧的演示套件已废弃,新的交互式演示正在筹备。目前请直接读文档上手。
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 📚 文档
|
|
53
|
+
|
|
54
|
+
| 你想 | 看这里 |
|
|
55
|
+
|------|--------|
|
|
56
|
+
| 装好并跑起来 | [快速开始](./docs/zh/quick-start.md) |
|
|
57
|
+
| 懂 GBC 在保护什么 | [核心概念](./docs/zh/concepts.md) |
|
|
58
|
+
| 在 GBC 下安全改代码 | [工作流](./docs/zh/workflow.md) |
|
|
59
|
+
| 查命令 / 工具 / executor | [参考手册](./docs/zh/reference.md) |
|
|
60
|
+
| 你是 agent,被要求接入 GBC | [Agent 上手](./docs/zh/onboarding-agent.md) |
|
|
61
|
+
|
|
62
|
+
English docs: [docs/en/](./docs/en/)。
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 核心想法
|
|
67
|
+
|
|
68
|
+
代码之间的依赖本质上是一组**保证**。模块 A 依赖模块 B,不是依赖它的实现细节,而是依赖它的某些
|
|
69
|
+
行为承诺——返回值的类型、格式、语义。把这些保证从隐含变成**显式、可执行、可验证**,正确性的判定
|
|
70
|
+
就从「AI 觉得自己改对了」变成「所有被依赖的保证仍通过」——一个可机械验证的布尔条件。
|
|
71
|
+
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+
GBC **不是**另一个要挑战 Cursor / Aider 的 AI 编程助手,而是填补它们在大型项目里缺的一环:
|
|
75
|
+
**机器可判定的变更边界**。它与那些 agent 配合——改前查依赖树,改后必须跑通所有相关保证;也区别
|
|
76
|
+
于 CI——CI 是事后的,GBC 是准入制的门禁,错误在落地前就被拦在 agent 的上下文里。
|
|
77
|
+
|
|
78
|
+
完整概念、架构图、与已有概念(Design by Contract / 测试)的区别,见
|
|
79
|
+
[核心概念](./docs/zh/concepts.md)。
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 当前状态
|
|
84
|
+
|
|
85
|
+
GBC 目前是一个可用的 Python 分发包(`pipx install guarantee-based-coding`),自身用 GBC 管理自己的
|
|
86
|
+
`.gbc/`(dogfooding):
|
|
87
|
+
|
|
88
|
+
- ✅ 核心保证机制(具名 id、多对一、出生即绿、退休保护、反查)
|
|
89
|
+
- ✅ 多语言 executor 配置
|
|
90
|
+
- ✅ CLI + MCP 双接口(含意图文档 `gbc doc` 全进 MCP)
|
|
91
|
+
- ✅ 意图文档子系统(`gbc doc` / web 编辑器)
|
|
92
|
+
- ✅ 随包分发的接线指南(`gbc setup`)与 CLI-only agent 的 skill 包
|
|
93
|
+
- ✅ 原子文件写入 + 备份
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
**诚实的局限**:保护能力上限 = 测试质量(测试只走 happy path 就是虚假安全感);依赖需主动登记,
|
|
97
|
+
覆盖率随项目增长需持续投入;每次验证真实跑测试,有一定延迟。详见
|
|
98
|
+
[核心概念 · 局限性](./docs/zh/concepts.md#局限性诚实地说)。
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 许可
|
|
103
|
+
|
|
104
|
+
本项目采用 [Apache-2.0](./LICENSE) 许可证。
|
|
105
|
+
|
|
106
|
+
## 联系
|
|
107
|
+
|
|
108
|
+
如果你对这个方向感兴趣,欢迎 star、issue 或者直接联系我。
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -241,9 +241,10 @@ def remove_dependency(
|
|
|
241
241
|
) -> None:
|
|
242
242
|
"""撤销一条依赖(add_dependency 的逆操作,同样维护双向一致)。
|
|
243
243
|
|
|
244
|
-
- gid 非 None
|
|
245
|
-
|
|
246
|
-
|
|
244
|
+
- gid 非 None:只摘掉这一个保证依赖,保留 symbol 边(可退为免费依赖)。
|
|
245
|
+
- gid 为 None:整条 symbol 边连同它挂的所有保证一起撤销。
|
|
246
|
+
两种撤销都仅在 consumer 不再通过任何 symbol 依赖同一 provider 的同一保证时,
|
|
247
|
+
才从该保证的 dependents 摘除 consumer。
|
|
247
248
|
"""
|
|
248
249
|
symbol = f"{provider}:{symbol_name}"
|
|
249
250
|
dep = _find_dependency(consumer_meta, symbol)
|
|
@@ -251,19 +252,25 @@ def remove_dependency(
|
|
|
251
252
|
raise GuaranteeNotFoundError(target_file=consumer, guarantee_path=symbol)
|
|
252
253
|
|
|
253
254
|
def _detach(target_gid: str) -> None:
|
|
255
|
+
if any(
|
|
256
|
+
remaining.symbol.startswith(f"{provider}:")
|
|
257
|
+
and target_gid in remaining.guarantees
|
|
258
|
+
for remaining in consumer_meta.depends_on
|
|
259
|
+
):
|
|
260
|
+
return
|
|
254
261
|
guarantee = provider_meta.provides.get(target_gid)
|
|
255
262
|
if guarantee and consumer in guarantee.dependents:
|
|
256
263
|
guarantee.dependents.remove(consumer)
|
|
257
264
|
|
|
258
265
|
if gid is None:
|
|
266
|
+
consumer_meta.depends_on.remove(dep)
|
|
259
267
|
for g in list(dep.guarantees):
|
|
260
268
|
_detach(g)
|
|
261
|
-
consumer_meta.depends_on.remove(dep)
|
|
262
269
|
return
|
|
263
270
|
|
|
264
271
|
if gid in dep.guarantees:
|
|
265
272
|
dep.guarantees.remove(gid)
|
|
266
|
-
|
|
273
|
+
_detach(gid)
|
|
267
274
|
# symbol 边变空(无保证)后是否保留:保留——它仍是一条有效的免费 symbol 依赖。
|
|
268
275
|
|
|
269
276
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|