Skip to content

Commit abfb64d

Browse files
committed
docs(product-tdd): split extension runtime contract
- move shared extension state semantics into InKCre/docs - absorb local runtime mechanics into app/business/extension/AGENTS.md - remove the mixed local extension-runtime doc and record phase 5b
1 parent f43f901 commit abfb64d

File tree

8 files changed

+56
-68
lines changed

8 files changed

+56
-68
lines changed

app/business/extension/AGENTS.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- 修改 extension 安装、同步、启停、配置持久化逻辑
1111
- 修改 extension metadata 读取规则
1212

13-
如果改动会影响跨模块契约,先读 [docs/_shared/20-product-tdd/](../../../docs/_shared/20-product-tdd/)如果还涉及本仓库尚未拆分完的 runtime 细节,再读 [docs/20-product-tdd/extension-runtime.md](../../../docs/20-product-tdd/extension-runtime.md)
13+
如果改动会影响跨模块契约,先读 [docs/_shared/20-product-tdd/](../../../docs/_shared/20-product-tdd/)本仓库的 runtime mechanics 以本文件为准
1414

1515
## 局部执行规则
1616

@@ -41,6 +41,7 @@
4141
- `ExtensionBase.on_start()` 会加载配置、回写 `config_schema`、注册 API router、初始化 source 和 resolver。
4242
- `ExtensionBase.on_close()` 会把运行时配置保存回数据库。
4343
- `ExtensionManager.start_enabled()` 只启动当前 client 已启用的扩展。
44+
- start / close 不只是布尔状态切换;它们会修改当前 runtime 的 router、source、resolver 与配置状态。
4445

4546
### Metadata sources
4647

@@ -62,10 +63,17 @@
6263

6364
不要把“可从任意 URL 安装”写回文档,除非代码先支持。
6465

66+
### State transition boundary
67+
68+
- `installed``enabled``running` 是三个不同层级的状态。
69+
- `enable()` 处理当前 client 的允许运行状态,必要时才引发 runtime start。
70+
- `disable()` 处理当前 client 的允许运行状态移除,并在需要时关闭 runtime。
71+
- 若只想描述共享状态语义,写到 shared Product TDD;若涉及 `install()``enable()``disable()``start_enabled()` 的具体行为,留在这里。
72+
6573
## 编辑指引
6674

6775
- 改 metadata 结构或安装布局时,同时更新这里和 [extensions/AGENTS.md](../../../extensions/AGENTS.md)
68-
- 改 lifecycle 或 enablement 语义时,先判断 shared contract 是否变化;若是,先改 `InKCre/docs` 再 bump `docs/_shared`并同步更新本地 [extension-runtime.md](../../../docs/20-product-tdd/extension-runtime.md) 中仍属本仓库的细节
76+
- 改 lifecycle 或 enablement 语义时,先判断 shared contract 是否变化;若是,先改 `InKCre/docs` 再 bump `docs/_shared`本地 runtime 细节则直接更新这里
6977
- 若新增行为只是局部实现细节,优先写测试或代码注释,不要扩大本文件。
7078

7179
## 创建新 Extension 时要满足的最小形状

docs/20-product-tdd/extension-runtime.md

Lines changed: 0 additions & 54 deletions
This file was deleted.

tasks/product-docs-repo-submodule/00-meta.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Progress checkpoint:
1313
- Phase 4 pilot implemented in `core-py` and pushed to `develop`
1414
- Phase 5 split gate recorded for remaining mixed docs
1515
- Phase 5A executed: shared skill relocated, local `info_base` guide upgraded, local mixed glossary removed
16+
- Phase 5B executed: `extension-runtime` split into shared state contract plus local runtime guide
1617

1718
## Intent
1819

@@ -48,8 +49,9 @@ The previous read-only mirror fan-out design was judged brittle and operationall
4849
- `60-phase-5-mixed-doc-split-gate.md`
4950
- `61-phase-5-split-matrix.md`
5051
- `62-phase-5a-execution-output.md`
52+
- `63-phase-5b-execution-output.md`
5153
- `90-review-checklist.md`
5254

5355
## Immediate Next Step
5456

55-
Proceed with the next gated split only after confirming which shared slices of `extension-runtime` and `info-base-ingestion` truly survive the shared-admission gate.
57+
Proceed with the final gated split only after confirming which shared slices of `info-base-ingestion` truly survive the shared-admission gate.

tasks/product-docs-repo-submodule/00-phase-map.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Dependency:
8383

8484
- Phase 0 completed.
8585
- Phase 1~3 local artifacts recorded in `31-phase-1-3-execution-output.md`.
86-
- Phase 4 rollout recorded in `51-phase-4-execution-output.md` and awaiting final review/commit.
86+
- Phase 4 rollout recorded in `51-phase-4-execution-output.md` and already pushed to `develop`.
8787
- Phase 5 planning recorded in `60-phase-5-mixed-doc-split-gate.md` and `61-phase-5-split-matrix.md`.
8888
- Phase 5A execution recorded in `62-phase-5a-execution-output.md`.
89+
- Phase 5B execution recorded in `63-phase-5b-execution-output.md`.

tasks/product-docs-repo-submodule/60-phase-5-mixed-doc-split-gate.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Split the remaining mixed docs without centralizing `core-py`-local truth into `
66

77
## Remaining Mixed Inputs
88

9-
- `docs/20-product-tdd/extension-runtime.md`
109
- `docs/20-product-tdd/info-base-ingestion.md`
1110

1211
## First-Principles Gate
@@ -29,9 +28,8 @@ If any gate fails, keep the statement local and improve the local container firs
2928

3029
### `docs/20-product-tdd/extension-runtime.md`
3130

32-
- shared admission: partial and not yet fully proven
33-
- reason: some semantics may be cross-unit (`installed` vs `enabled`, client-scoped enablement), but many current bullets are still `core-py` runtime details
34-
- blocking risk: moving method-level lifecycle details into shared docs would lower maintainability
31+
- status: completed in Phase 5B
32+
- result: shared state semantics moved into `InKCre/docs/20-product-tdd/system-state-and-authority.md` and `InKCre/docs/20-product-tdd/cross-unit-contracts.md`; local runtime mechanics were absorbed into `app/business/extension/AGENTS.md`; the mixed local doc was removed
3533

3634
### `docs/20-product-tdd/info-base-ingestion.md`
3735

tasks/product-docs-repo-submodule/61-phase-5-split-matrix.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Status: completed in Phase 5A.
1515

1616
## `docs/20-product-tdd/extension-runtime.md`
1717

18+
Status: completed in Phase 5B.
19+
1820
| current cluster | target owner | target path | action | notes |
1921
| --- | --- | --- | --- | --- |
2022
| one extension ID per deployment / installation state authority | shared candidate | `InKCre/docs/20-product-tdd/system-state-and-authority.md` | rewrite if pressure is proven | express without `ExtensionModel` method-level detail |
@@ -36,11 +38,10 @@ Status: completed in Phase 5A.
3638
## Recommended Execution Order
3739

3840
1. rewrite `app/business/info_base/AGENTS.md` into a v9.2 local guide
39-
2. extract local runtime details from `docs/20-product-tdd/extension-runtime.md` into `app/business/extension/AGENTS.md`
40-
3. extract local ingestion mechanics from `docs/20-product-tdd/info-base-ingestion.md` into `app/business/info_base/AGENTS.md`
41-
4. only then populate shared `InKCre/docs/20-product-tdd/*` with the small set of statements that pass the shared-admission gate
41+
2. extract local ingestion mechanics from `docs/20-product-tdd/info-base-ingestion.md` into `app/business/info_base/AGENTS.md`
42+
3. only then populate shared `InKCre/docs/20-product-tdd/*` with the small set of statements that pass the shared-admission gate
4243

4344
## Recommendation
4445

45-
Do not execute the remaining two splits in one commit.
46-
`extension-runtime.md` and `info-base-ingestion.md` should remain gated until their shared slices can be expressed without `core-py` implementation leakage.
46+
Do not execute the remaining final split casually.
47+
`info-base-ingestion.md` should remain gated until its shared slices can be expressed without `core-py` implementation leakage.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Phase 5B Execution Output
2+
3+
## Scope
4+
5+
This file records the `extension-runtime` split of Phase 5:
6+
7+
- move shared extension state semantics into `InKCre/docs`
8+
- absorb local runtime mechanics into `app/business/extension/AGENTS.md`
9+
- remove the mixed local Product TDD file
10+
11+
## Shared Contract Output
12+
13+
- updated `InKCre/docs/20-product-tdd/system-state-and-authority.md`
14+
- extension installation authority is deployment-level and distinct from permission/runtime state
15+
- updated `InKCre/docs/20-product-tdd/cross-unit-contracts.md`
16+
- `installed` / `enabled` / `running` are explicitly distinct
17+
- enablement is client-scoped
18+
- runtime start/stop has capability and API side effects
19+
20+
## Local Output
21+
22+
- updated `app/business/extension/AGENTS.md`
23+
- local runtime mechanics are now the primary local source
24+
- method-level state transition behavior stays local
25+
- removed local mixed file:
26+
- `docs/20-product-tdd/extension-runtime.md`
27+
28+
## Remaining Phase 5 Scope
29+
30+
- `docs/20-product-tdd/info-base-ingestion.md`
31+
32+
This remains gated until its shared slice can be written without `core-py`-only manager and resolver/storage leakage.

0 commit comments

Comments
 (0)