@namewta/speculo 1.0.10 → 1.0.12

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 (23) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -2
  3. package/template/workflows/learning/G-goal/G-goal.md +74 -0
  4. package/template/workflows/learning/G-goal/chain-template.md +34 -0
  5. package/template/workflows/learning/G-goal/coverage-matrix-template.md +40 -0
  6. package/template/workflows/learning/G-goal/goal-plan-template.md +310 -0
  7. package/template/workflows/learning/G-goal/orchestration-protocol.md +26 -0
  8. package/template/workflows/learning/G-goal/planning-modes.md +19 -0
  9. package/template/workflows/learning/G-goal/probe-template.md +62 -0
  10. package/template/workflows/learning/G-goal/progress-template.md +19 -0
  11. package/template/workflows/learning/G-goal/references/coverage-bar.md +32 -0
  12. package/template/workflows/learning/G-goal/references/external-goal-runner.md +50 -0
  13. package/template/workflows/learning/G-goal/references/lead-orchestration.md +52 -0
  14. package/template/workflows/learning/G-goal/references/mine-unit.md +49 -0
  15. package/template/workflows/learning/G-goal/references/split-rules.md +54 -0
  16. package/template/workflows/learning/G-goal/references/stop-rules.md +27 -0
  17. package/template/workflows/learning/INDEX.md +2 -2
  18. package/template/workflows/learning/README.md +20 -5
  19. package/template/workflows/learning/common/rules/artifact-contract.md +3 -2
  20. package/template/workflows/learning/common/rules/questioning-policy.md +7 -0
  21. package/template/workflows/learning/common/rules/teaching-policy.md +1 -1
  22. package/template/workflows/learning/common/skills/socratic-questioning/SKILL.md +9 -7
  23. package/template/workflows/learning/common/tools/validate-learning.mjs +216 -1
package/README.md CHANGED
@@ -72,7 +72,7 @@ After initialization, the target project gains the following AI agent-callable a
72
72
 
73
73
  | Workflow | Work Entries | Description |
74
74
  |---|---:|---|
75
- | **learning** | 8 | Evidence-aware learning for projects, products, subjects, languages, and skills: complete 30–40 minute plain-language lessons, Socratic inquiry lessons, single-file homework review, optional retention review, and provenance-preserving topic synthesis |
75
+ | **learning** | 9 | Evidence-aware learning for projects, products, subjects, languages, and skills: complete 30–40 minute plain-language lessons, Socratic inquiry lessons, Goal-Plan compilation for later external /goal execution (teach a mine-unit of ≤15 lessons, then fan out miners), single-file homework review, optional retention review, and provenance-preserving topic synthesis |
76
76
  | **specdev** | 14 | Local-first specification-driven development: archive, code review, diagnosis, grilling, implementation, setup, learning, goal planning, prototyping, architecture review, specs, tickets, triage, and wayfinding |
77
77
  | **ops** | 3 | Host inventory and project deployment: initialize, host manage, and APP/shared-service deploy with dual documentation |
78
78
  | **person** | 2 | Persona-methodology and rigorous deliberation workflows (Mao Zedong Cognitive OS; Bidirectional Steelman Deliberation) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namewta/speculo",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Workflow-packaged AI collaboration assets with state-safe refresh tooling.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,7 +13,7 @@
13
13
  "pretest": "pnpm build",
14
14
  "generate-canonical": "node scripts/generate-specdev-canonical.mjs",
15
15
  "validate-source-parity": "node scripts/check-specdev-source-parity.mjs",
16
- "validate-assets": "node scripts/check-specdev-source-parity.mjs && node scripts/generate-specdev-canonical.mjs --check && node scripts/validate-refresh-contracts.mjs && node scripts/validate-framework-assets.mjs && node scripts/check-template-links.mjs && node scripts/validate-workflow-disclosure.mjs && node template/workflows/specdev/common/tools/validate-specdev.mjs --self-check",
16
+ "validate-assets": "node scripts/check-specdev-source-parity.mjs && node scripts/generate-specdev-canonical.mjs --check && node scripts/validate-refresh-contracts.mjs && node scripts/validate-framework-assets.mjs && node scripts/check-template-links.mjs && node scripts/validate-workflow-disclosure.mjs && node template/workflows/specdev/common/tools/validate-specdev.mjs --self-check && node template/workflows/learning/common/tools/validate-learning.mjs --workflow-root template/workflows/learning",
17
17
  "check": "pnpm test && pnpm validate-assets",
18
18
  "verify-bin": "node scripts/verify-bin.mjs",
19
19
  "eval:scenarios": "node scripts/evaluate-scenarios.mjs",
@@ -0,0 +1,74 @@
1
+ ---
2
+ id: learning/goal
3
+ type: workflow-entry
4
+ workflow: learning
5
+ name: 目标学习(目标模式)
6
+ description: 为选定编程项目编译一份可被外部 /goal 执行的完整 Goal-Plan;计划会话可跟随 A 写出课程地图并按库存切 ≤15 的 mine unit,但不写 Lesson、不向学习者提问、不自动串联 H/R/C。
7
+ keywords: [goal, 目标模式, 目标学习, chain, coverage, mine, plan, mine-unit]
8
+ ---
9
+
10
+ # 目标学习(目标模式)
11
+
12
+ > 激活本 Work 后,先读取 `<Path>{roots.workflows}/learning/README.md</Path>`。
13
+
14
+ G-goal 是计划编译器,不是授课编排器。激活后写出完整 Goal-Plan 并停止。授课、挖掘与验收由用户在 AI CLI 中 `/goal` 读取该计划执行:按项目规模划出一个不超过 15 节的教学单元 → 先把这个单元的课全部写完 → 再为每一课派 miner。
15
+
16
+ ## 读取范围
17
+
18
+ 1. 先读取 `<Path>{roots.workflows}/learning/README.md</Path>` 与当前 Work 的状态入口。
19
+ 2. 再读取 `<Path>{roots.workflows}/learning/common/rules/activation-and-memory.md</Path>`,按当前 Change、项目路径和关键词定位最小相关工件。
20
+ 3. 只在本 Work 明确要求恢复、冲突、执行安全、创建 Change 或归档证据时扩展为全量读取;缺少匹配证据或 owner/gateway 时停止受影响分支。
21
+
22
+ ## 模式
23
+
24
+ | 用户意图 | 模式 | 谁执行 | 必须按需读取 |
25
+ | --- | --- | --- | --- |
26
+ | 选定项目并生成完整计划(默认) | `plan` | 本 Work | `<Path>{roots.workflows}/learning/G-goal/planning-modes.md</Path>`、`<Path>{roots.workflows}/learning/G-goal/goal-plan-template.md</Path>`、`<Path>{roots.workflows}/learning/A-assess-and-plan/A-assess-and-plan.md</Path>`、`<Path>{roots.workflows}/learning/G-goal/references/mine-unit.md</Path>` |
27
+ | 源码或范围变化,重编译计划 | `replan` | 本 Work | 同上,加 `<Path>{roots.workflows}/learning/G-goal/orchestration-protocol.md</Path>`;旧 `goal-plan.md` 只读归档到 `goal/revisions/` |
28
+ | 按计划写课与挖掘 | `run` / `resume` | 外部 `/goal` | 计划正文 §5 / §8;本 Work 不在激活会话内执行 |
29
+ | 对照矩阵验收 | `verify` | 外部 `/goal`,或以后再激活本 Work 只读验收 | 计划正文 §6 与 `<Path>{roots.workflows}/learning/G-goal/references/stop-rules.md</Path>` |
30
+
31
+ `plan` 写出的文档不构成执行授权。`ready_for_execution: false`,直到用户把计划交给 `/goal`。
32
+
33
+ ## 流程
34
+
35
+ 1. 解析 roots 与 Learning v2 状态。roots 必须来自已打开的 `<Path>{roots.state}/workspace.json</Path>`。若尚无 `status.json` / `locations.json`,先按 `<Path>{roots.workflows}/learning/I-init-setup/I-init-setup.md</Path>` 写入空状态骨架,不创建知识条目。
36
+ 2. 范围访谈一次只问一个缺口:项目路径、in-scope 模块/公开 API、out-of-scope、`expression_level`、`coverage_depth`。用户已答过不重复问。
37
+ 3. 创建或恢复 `YYYY-MM-DD-<kebab-topic>[-NN]` Change,生成 `.status.json`,设置 `phase=planning`、`current_work=learning/goal`。
38
+ 4. 读取目标仓库,做编程库存:C4 Context + Container、公开入口、主数据存储、一条主路径与一条失败路径、按模块归组的范围内函数。琐碎 helper、生成代码、测试夹具标 `covered-by-parent` 或 `deferred`,不为它们开课。Lead 可派只读库存员。
39
+ 5. 若本 Change 尚无可用 `course.md`,跟随 `<Path>{roots.workflows}/learning/A-assess-and-plan/A-assess-and-plan.md</Path>` 写出 `course.md`、`background/foundation.md`、`baseline.md`、`sources.md` 和 Change `INDEX.md`。这些文件仍归 A 所有;本 Work 只在编译计划时走 A 合同。已有课程地图则核对,不默默重写。
40
+ 6. 按模板写出完整计划,禁止留下「待调研」章节,禁止预写探针题目或深化讲义;按库存把课装进 mine unit(每个 ≤15 节,写入 `chain.md` Units 表):
41
+ - `<Path>{roots.state}/learning/changes/{change}/goal/goal-plan.md</Path>`
42
+ - `<Path>{roots.state}/learning/changes/{change}/goal/chain.md</Path>`
43
+ - `<Path>{roots.state}/learning/changes/{change}/goal/coverage-matrix.md</Path>`
44
+ - `<Path>{roots.state}/learning/changes/{change}/goal/progress.md</Path>`(检查点骨架)
45
+ 7. 计划必须内嵌可粘贴的 `/goal` 启动块,并列出最小读取清单。覆盖规则读 `<Path>{roots.workflows}/learning/G-goal/references/coverage-bar.md</Path>`;停止规则读 `<Path>{roots.workflows}/learning/G-goal/references/stop-rules.md</Path>`;执行器合同读 `<Path>{roots.workflows}/learning/G-goal/references/external-goal-runner.md</Path>`。
46
+ 8. 设置 `ready_for_execution: false`。更新 `learning-log.md` 与 Change `.status.json`:`works_run` 追加 `learning/goal`,清空 `current_work`。向用户打印 Goal-Plan 路径和 `/goal` 粘贴块。
47
+ 9. 停止。不写 `lessons/`,不写 `goal/probes/`,不创建 `inquiry/` 批次,不自动激活 L/H/R/C/A-archive,不写 mastered。
48
+
49
+ ## 完成标准
50
+
51
+ - `goal/goal-plan.md` 按模板填实 Outcome、范围、四轴合同、Chain、Wave、mine unit、派单菜谱、授权矩阵、DoD、HARD NO、Resume 和最小读取清单;
52
+ - `course.md` 有可观察 OBJ;`chain.md` 与矩阵使用库存得到的真实模块名,不是占位符;
53
+ - `chain.md` 有 mine unit 列表,每个 unit ≤15(`mine_unit_cap`);小项目允许远小于 15;不得为凑满 15 而灌水开课;
54
+ - 计划不得预写探针题目或深化讲义;
55
+ - 计划会话结束时 `lessons/` 仍无讲义正文(只允许空 INDEX);
56
+ - 粘贴块含 Outcome、verification surface、constraints、boundaries、iteration policy(teach-then-mine、10 问上限、`split-lesson`、Lead 扇出、unit ≤15)、blocked-stop;
57
+ - 文档中的「允许」不构成 `/goal` 之外的额外授权;
58
+ - 不复活 `Q-quiz`,不把 mine 写成学习者问答课。
59
+
60
+ ## 子文件
61
+
62
+ - 计划模板:`<Path>{roots.workflows}/learning/G-goal/goal-plan-template.md</Path>`
63
+ - Chain 模板:`<Path>{roots.workflows}/learning/G-goal/chain-template.md</Path>`
64
+ - 覆盖矩阵模板:`<Path>{roots.workflows}/learning/G-goal/coverage-matrix-template.md</Path>`
65
+ - 挖掘模板:`<Path>{roots.workflows}/learning/G-goal/probe-template.md</Path>`
66
+ - 进度模板:`<Path>{roots.workflows}/learning/G-goal/progress-template.md</Path>`
67
+ - 模式:`<Path>{roots.workflows}/learning/G-goal/planning-modes.md</Path>`
68
+ - 编排:`<Path>{roots.workflows}/learning/G-goal/orchestration-protocol.md</Path>`
69
+ - Lead 编排:`<Path>{roots.workflows}/learning/G-goal/references/lead-orchestration.md</Path>`
70
+ - 挖掘单元:`<Path>{roots.workflows}/learning/G-goal/references/mine-unit.md</Path>`
71
+ - 拆课规则:`<Path>{roots.workflows}/learning/G-goal/references/split-rules.md</Path>`
72
+ - 覆盖尺:`<Path>{roots.workflows}/learning/G-goal/references/coverage-bar.md</Path>`
73
+ - 停止规则:`<Path>{roots.workflows}/learning/G-goal/references/stop-rules.md</Path>`
74
+ - 外部执行器:`<Path>{roots.workflows}/learning/G-goal/references/external-goal-runner.md</Path>`
@@ -0,0 +1,34 @@
1
+ # Chain: <主题>
2
+
3
+ 本文件是 Goal 的课程序列投影,不是 C-consolidate,不搬迁 Change。权威 OBJ 仍在 `course.md`。mine unit 切分写在本文件 Units 表,不要另造权威文件。
4
+
5
+ ## DAG
6
+
7
+ ```text
8
+ L-001 → L-002
9
+ ```
10
+
11
+ ## Lessons
12
+
13
+ | ID | 标题 | OBJ | 覆盖格子 | 前置 | 估时 | 将写入 | 状态 |
14
+ | --- | --- | --- | --- | --- | --- | --- | --- |
15
+ | L-001 | <系统地图> | OBJ-01 | C:context, D:happy-path | — | 35 | `lessons/L-001-<slug>.md` | planned |
16
+
17
+ 状态:`planned` | `writing` | `written` | `mined` | `split_proposed` | `split` | `revised` | `deferred`。
18
+
19
+ ## Units
20
+
21
+ | unit_id | Lessons | 上限 | 状态 |
22
+ | --- | --- | --- | --- |
23
+ | U1 | L-001 | ≤15 | planned |
24
+
25
+ 任何 unit 课数不得超过 15。15 是上界,不是配额。小项目允许远小于 15。一课不得同时属于两个 unit。前置课尚未 `written` / `mined` / `revised` 的课,不得提前塞进当前单元。
26
+
27
+ ## Waves
28
+
29
+ | Wave | 焦点 | Lessons | 分组尺 | Gate |
30
+ | --- | --- | --- | --- | --- |
31
+ | 1 | C4 Context + Container + 主数据流 | L-001 | 架构与数据流 | G1/G2/G3 |
32
+ | 2 | 范围内公开 API 与方法性状 | | 公开 API | G1/G2/G3 |
33
+
34
+ Wave 是覆盖尺上的内容分组,不是挖掘门,也不是并发授权。不改变任何覆盖格子的节点不要写入本表。
@@ -0,0 +1,40 @@
1
+ # Coverage Matrix: <主题>
2
+
3
+ 状态只允许:`uncovered` | `covered` | `deferred(reason)` | `covered-by-parent`。
4
+
5
+ 默认档:架构/数据流 = Relational;范围内函数/方法 = Unistructural + explained。
6
+
7
+ ## (c) 业务架构
8
+
9
+ | 单元 | 类型 | 状态 | 证据 | 备注 |
10
+ | --- | --- | --- | --- | --- |
11
+ | <系统 Context> | Context | uncovered | | |
12
+ | <容器 A> | Container | uncovered | | |
13
+
14
+ ## (d) 数据流
15
+
16
+ | 路径 | 源 → 汇 | 状态 | 证据 | 备注 |
17
+ | --- | --- | --- | --- | --- |
18
+ | 主路径 | <input> → <store> | uncovered | | |
19
+ | 失败路径 | <input> → <error> | uncovered | | |
20
+
21
+ ## (a) 函数目的
22
+
23
+ | 符号 | 模块 | 状态 | 证据 | 备注 |
24
+ | --- | --- | --- | --- | --- |
25
+ | <exportedFn> | <module> | uncovered | | |
26
+ | <helper> | <module> | covered-by-parent | | 由父模块课覆盖 |
27
+
28
+ ## (b) 方法性状
29
+
30
+ | 符号 | 性状 | 状态 | 证据 | 备注 |
31
+ | --- | --- | --- | --- | --- |
32
+ | <exportedFn> | 副作用/失败路径 | uncovered | | |
33
+
34
+ ## 闭合统计
35
+
36
+ - in-scope 格子总数:
37
+ - covered:
38
+ - deferred:
39
+ - covered-by-parent:
40
+ - uncovered:
@@ -0,0 +1,310 @@
1
+ ---
2
+ schema_version: 1
3
+ artifact: learning-goal-plan
4
+ change: YYYY-MM-DD-<kebab-topic>
5
+ topic: <topic-id>
6
+ project_path: <path-to-source-repo>
7
+ status: draft
8
+ modes: [plan]
9
+ orchestration: external-goal
10
+ run_orchestration: lead-directed
11
+ coverage_domain: programming
12
+ expression_level: plain
13
+ coverage_depth: standard
14
+ mine_unit: project
15
+ mine_unit_cap: 15
16
+ learning_agent_limit: 4
17
+ max_waves: 2
18
+ ready_for_execution: false
19
+ ---
20
+
21
+ # Goal-Plan: <主题>
22
+
23
+ 本文件由 G-goal 在 `plan` / `replan` 会话编译。计划正文里的「允许」不构成执行授权。`ready_for_execution: false`,直到用户把本计划交给外部 AI CLI `/goal`。
24
+
25
+ ## 路径
26
+
27
+ - 本计划:`<Path>{roots.state}/learning/changes/{change}/goal/goal-plan.md</Path>`
28
+ - Chain:`<Path>{roots.state}/learning/changes/{change}/goal/chain.md</Path>`
29
+ - 覆盖矩阵:`<Path>{roots.state}/learning/changes/{change}/goal/coverage-matrix.md</Path>`
30
+ - 进度:`<Path>{roots.state}/learning/changes/{change}/goal/progress.md</Path>`
31
+ - 挖掘探针:`<Path>{roots.state}/learning/changes/{change}/goal/probes/</Path>`
32
+ - 验收:`<Path>{roots.state}/learning/changes/{change}/goal/verify.md</Path>`
33
+ - 旧计划:`<Path>{roots.state}/learning/changes/{change}/goal/revisions/</Path>`
34
+ - 课程地图(A 所有):`<Path>{roots.state}/learning/changes/{change}/course.md</Path>`
35
+ - 讲义(L 所有):`<Path>{roots.state}/learning/changes/{change}/lessons/</Path>`
36
+ - 问答课(Q 所有,`/goal` 不得写入):`<Path>{roots.state}/learning/changes/{change}/inquiry/</Path>`
37
+
38
+ ---
39
+
40
+ ## §0 `/goal` 粘贴块
41
+
42
+ 把下面整块复制到 AI CLI 后发送 `/goal`。不要改写 Outcome 或 HARD NO。
43
+
44
+ ```text
45
+ /goal READ <Path>{roots.state}/learning/changes/{change}/goal/goal-plan.md</Path>
46
+
47
+ Outcome:
48
+ 范围内覆盖矩阵格子全部变为 covered | deferred(reason) | covered-by-parent;
49
+ 每个 chain 节点有一份 L 合同 Lesson;
50
+ 每节新课或改写课至多两份 goal/probes/GP-*-b0N.md(每课 ≤10 问);
51
+ 写好 goal/verify.md。
52
+
53
+ Verification surface:
54
+ goal/coverage-matrix.md 状态列;
55
+ lessons/L-*.md 存在且满足 L-lesson 合同;
56
+ goal/probes/GP-*.md 关闭态且至少改变过一个矩阵格子,或显式 defer / split-proposal;
57
+ goal/verify.md 对照 stop-rules 逐条勾选。
58
+
59
+ Constraints:
60
+ roots 只来自已打开的 workspace.json;
61
+ 只写当前 Change 的 lessons/ 与 goal/;
62
+ 派单跟随 L-lesson 与 socratic-questioning audience=mine;
63
+ 不发明库存里没有的函数;
64
+ mine unit ≤15;每课最多 10 问。
65
+
66
+ Boundaries:
67
+ 不写 inquiry/、homework/、review/、synthesis/、archive/;
68
+ 不写 mastered;
69
+ 不复活 Q-quiz;
70
+ 不把 mine 写成学习者问答课;
71
+ 不自动激活 H/R/C/A-archive。
72
+
73
+ Iteration policy:
74
+ 先按 goal/chain.md 的当前 mine unit 写完该单元全部 L(阶段 T),再按课扇出 mine(阶段 M);
75
+ 禁止 L → mine → L → mine 交错;
76
+ 并行只发生在写集不相交的子代理之间;矩阵、chain、progress、verify、lessons/INDEX 只有 Lead 可写;
77
+ 处置:re-dispatch-L | split-lesson | defer(reason);
78
+ mine-more 只允许在该课尚未满 10 问、且 batch-01 已证明存在真实矩阵缺口时,用来打开 b02;
79
+ 满 10 问后 mine-more 非法;
80
+ 当前 mine unit 课数不得超过 15。超过则停止,回到 G-goal replan 重新切单元。
81
+
82
+ Blocked-stop:
83
+ 本单元矩阵无变化;出现第 11 问;交错 L/mine;miner 写入 lessons/ 或 matrix;
84
+ 同一 unit 规划超过 15 节;用户暂停;
85
+ 缺源码 / 缺 baseline / 目标无法核对;所有权冲突或路径越界。
86
+ ```
87
+
88
+ 最小读取顺序见 §11。
89
+
90
+ ---
91
+
92
+ ## §1 Outcome and Authority
93
+
94
+ ### Outcome
95
+
96
+ 合格读者读完本 Goal 后,能用范围内源码与已写成的 Lesson 说明:系统 Context 与 Container、一条主路径与一条失败路径、范围内公开/领域函数的目的,以及公开 API / 枢纽方法的副作用与失败路径。完成证据是矩阵闭合 + Lesson + probe + `goal/verify.md`,不是「课写完」。
97
+
98
+ ### Success and False Completion
99
+
100
+ 算完成:stop-rules 的「完成即停」全部满足。
101
+
102
+ 不算完成:
103
+
104
+ - 课写完
105
+ - 文件巡览结束
106
+ - 模型表示「已经理解」
107
+ - 主观百分比
108
+ - 只生成了 Goal-Plan 本身
109
+
110
+ ### Non-goals
111
+
112
+ - 不自动激活 `H-homework`、`R-review`、`C-consolidate`、`A-archive`
113
+ - 不写 mastered
114
+ - 不复活 `Q-quiz`
115
+ - 不使用 `Q-question` 的 `inquiry/` Response 协议
116
+ - 不为琐碎 helper、生成代码、测试夹具单独开课
117
+ - 不在本计划里预写探针题目或深化讲义
118
+
119
+ ### Authoritative Inputs
120
+
121
+ | 优先级 | 输入 | 用途 |
122
+ | --- | --- | --- |
123
+ | 1 | 用户当场决定 | 覆盖范围、暂停、defer |
124
+ | 2 | `course.md` OBJ | 权威学习目标;本文件不改写 OBJ |
125
+ | 3 | `goal/coverage-matrix.md` | 格子状态是覆盖权威 |
126
+ | 4 | `goal/chain.md` | 课程序列投影与 mine unit 切分 |
127
+ | 5 | 本计划派单菜谱 | `/goal` 只按 §5 / §7 行动 |
128
+ | 6 | 源码事实 | 库存与证据;不得发明符号 |
129
+
130
+ ---
131
+
132
+ ## §2 Scope
133
+
134
+ ### In-scope
135
+
136
+ - 项目路径:
137
+ - 模块 / 公开 API:
138
+ - 必须覆盖的容器:
139
+
140
+ ### Out-of-scope
141
+
142
+ -
143
+
144
+ ### covered-by-parent / deferred
145
+
146
+ - 琐碎 helper、生成代码、测试夹具:`covered-by-parent` 或 `deferred(reason)`
147
+ - 「每一个函数」= 范围内公开/领域函数,不是仓库里每一个私有 one-liner
148
+ - 不改变任何覆盖格子的 Lesson 或 probe 不要写
149
+
150
+ ### C4 库存快照
151
+
152
+ ```text
153
+ [Context]
154
+ <system> --uses--> <actor / external>
155
+
156
+ [Container]
157
+ <container-a>
158
+ <container-b>
159
+
160
+ [Happy path]
161
+ <input> -> <transform> -> <store>
162
+
163
+ [Fail path]
164
+ <input> -> <error>
165
+ ```
166
+
167
+ 范围内函数按模块归组,清单写在 `goal/coverage-matrix.md` 的 (a)(b) 表,不在本节约维护第二份过期名单。
168
+
169
+ ---
170
+
171
+ ## §3 Coverage Contract
172
+
173
+ v1 只实现编程四轴。默认档与证据规则以 `<Path>{roots.workflows}/learning/G-goal/references/coverage-bar.md</Path>` 为准。
174
+
175
+ | 轴 | 对象 | 默认 SOLO | 证据 |
176
+ | --- | --- | --- | --- |
177
+ | (a) 函数目的 | 范围内公开/领域函数 | Unistructural + explained | Lesson 函数表或父课 covered-by-parent |
178
+ | (b) 方法性状 | 公开 API 与枢纽内部方法 | Unistructural + explained | 副作用、失败路径、幂等、并发、纯/不纯 |
179
+ | (c) 业务架构 | 系统与容器 | Relational | C4 Context + Container + 关键 Component 的 ASCII |
180
+ | (d) 数据流 | 主路径与失败路径 | Relational | 源 → 变换 → 汇 + 存储点 + 所有权 |
181
+
182
+ Extended Abstract 不是完成条件。
183
+
184
+ ---
185
+
186
+ ## §4 Chain, Waves, and Mine Units
187
+
188
+ 权威序列与 mine unit 切分在 `goal/chain.md`。本计划只记录覆盖波与挖掘单元门。Wave 是内容分组,不是挖掘门,也不是并发授权。
189
+
190
+ | Wave | 焦点 | Lessons | 分组尺 | Gate |
191
+ | --- | --- | --- | --- | --- |
192
+ | 1 | C4 Context + Container + 主数据流 | | 架构与数据流 | G1/G2/G3 |
193
+ | 2 | 范围内公开 API 与方法性状 | | 公开 API | G1/G2/G3 |
194
+
195
+ | Mine unit | Lessons | 上限 | 状态 |
196
+ | --- | --- | --- | --- |
197
+ | U1 | | ≤15(上界,不是配额) | planned |
198
+
199
+ 默认最多 `max_waves: 2`。`mine_unit: project`,`mine_unit_cap: 15`。小项目允许远小于 15。切分规则读 `<Path>{roots.workflows}/learning/G-goal/references/mine-unit.md</Path>`。
200
+
201
+ ---
202
+
203
+ ## §5 Dispatch Recipe
204
+
205
+ `/goal` 的 `run` / `resume` 只读本节与 §7 / §8。计划会话不得执行本节。编排读 `<Path>{roots.workflows}/learning/G-goal/references/lead-orchestration.md</Path>`。拆课读 `<Path>{roots.workflows}/learning/G-goal/references/split-rules.md</Path>`。
206
+
207
+ 运行形状是 **teach-then-mine**,不是一课一挖交错:
208
+
209
+ 1. **阶段 T**:按当前 mine unit 为每课派一个 L 子代理。跟随 `<Path>{roots.workflows}/learning/L-lesson/L-lesson.md</Path>` 与 `<Path>{roots.workflows}/learning/common/rules/teaching-policy.md</Path>`,写入各自的 `lessons/L-<NNN>-<slug>.md`。`lessons/INDEX.md` 只有 Lead 可写。本单元全部 planned 节点都有合格 L 合同讲义后,才进入阶段 M。
210
+ 2. **阶段 M**:为每课派一个 miner。跟随 `<Path>{roots.workflows}/learning/common/skills/socratic-questioning/SKILL.md</Path>` 且 `audience=mine`,按 `<Path>{roots.workflows}/learning/G-goal/probe-template.md</Path>` 写入 `goal/probes/GP-<lesson>-b01.md`(Q1–Q5);若仍有真实矩阵缺口且预算未满 10,再开 `b02.md`(Q6–Q10)。审问对象是已写成的 Lesson 与源码,不是学习者。miner 不得写 `lessons/` 或 matrix。
211
+ 3. **阶段 D**:仅 Lead 根据各课缺口表与 `split-proposal` 处置:`re-dispatch-L` | `split-lesson` | `defer(reason)`。Lead 提交矩阵 / progress。满 10 问后禁止 `mine-more`。
212
+
213
+ 禁止:
214
+
215
+ - 跟随 `Q-question` 的 `inquiry/` Response 协议
216
+ - 自动激活 H / R / C / A-archive
217
+ - 把 mine 写成学习者问答课
218
+ - 在计划会话里写 `lessons/` 或 `goal/probes/`
219
+ - 在 Goal-Plan 里预写探针题目或深化讲义
220
+ - 阶段 T 完成前启动 miner
221
+ - `L → mine → L → mine` 交错
222
+ - 同一 `lesson_id` 第 11 问,或 `b03`
223
+
224
+ ---
225
+
226
+ ## §6 Gates and DoD
227
+
228
+ 停止规则以 `<Path>{roots.workflows}/learning/G-goal/references/stop-rules.md</Path>` 为准。
229
+
230
+ | Gate | 含义 | 证据 |
231
+ | --- | --- | --- |
232
+ | G0 | 计划已编译 | `goal/goal-plan.md`、`chain.md`、`coverage-matrix.md`、`progress.md` 存在;`course.md` 有可观察 OBJ;每个 mine unit ≤15 节 |
233
+ | G1 | 本单元全部 planned 节点已写成合格 L 合同讲义 | `lessons/L-*.md`;progress 显示本 unit 先进入 `written` |
234
+ | G2 | 本单元至少改变一个矩阵格子 | 矩阵 diff + `progress.md` 一行事实 |
235
+ | G3 | 本单元新课或改写课有对应 probe,且每课 Q 数 ≤10 | `goal/probes/GP-*-b0N.md` |
236
+ | G-final | 范围内格子全部闭合且已验收 | 矩阵无 uncovered;`goal/verify.md` 已写 |
237
+
238
+ Overall Definition of Done = G-final。课写完不是 DoD。阶段 T 结束之前禁止 miner。阶段 M 结束之前,Lead 不得把「课写完」写成 Goal 完成。
239
+
240
+ ---
241
+
242
+ ## §7 Authorization Matrix
243
+
244
+ | 动作 | plan 会话 | `/goal` Lead | L 子代理 | Miner 子代理 |
245
+ | --- | --- | --- | --- | --- |
246
+ | 跟随 I 写空骨架 | 允许 | 不授权 | 不授权 | 不授权 |
247
+ | 跟随 A 写/核 course 地图 | 允许 | 不授权 | 不授权 | 不授权 |
248
+ | 写 goal-plan / chain 骨架 | 允许 | run 中可追加 split 子节点、切 unit | 不授权 | 不授权 |
249
+ | 更新 matrix / progress | 只写骨架 | 允许(独占) | 不授权 | 不授权 |
250
+ | 写 `lessons/L-*.md` | 不授权 | 不代替 writer | 仅自己的文件 | 不授权 |
251
+ | 写 `goal/probes/` | 不授权 | 不代替 miner | 不授权 | 仅自己的 `GP-b0N` |
252
+ | 写 `goal/verify.md` | 不授权 | 停止规则触发后允许 | 不授权 | 不授权 |
253
+ | `inquiry/` `homework/` `review/` `synthesis/` `archive/` mastered | 禁止 | 禁止 | 禁止 | 禁止 |
254
+
255
+ 文档中的「允许」不构成 `/goal` 之外的额外授权。
256
+
257
+ ---
258
+
259
+ ## §8 Constraints / HARD NO
260
+
261
+ - 不复活 `Q-quiz`
262
+ - mine ≠ 学习者 Q/A;禁止 `inquiry/`、`Response:`、`Submission:`、`verdict`、mastered
263
+ - 不自动串联 H / R / C / A-archive
264
+ - 路径只用 `<Path>{roots.*}/...</Path>`;roots 必须来自已打开的 `workspace.json`
265
+ - 不发明库存里没有的函数、容器或数据流
266
+ - 不把 Wave 当成挖掘门或并发授权
267
+ - 不把 Extended Abstract 当成完成条件
268
+ - 不把计划会话里的「已批准 / 允许」当成执行授权
269
+ - 不预写探针题目,不在 Goal-Plan 里写深化讲义
270
+ - 不在阶段 T 完成前启动 miner
271
+ - 不交错 L 与 mine
272
+ - 同一 `lesson_id` 第 11 问非法;满 10 问禁止 mine-more
273
+ - miner 不得选择处置,只填表
274
+ - `split-lesson` 不得调用 `C-consolidate` 或 `relocate-learning.mjs`
275
+ - 同一 mine unit 不得超过 15 节;不得把 16+ 节一次扇出
276
+ - 宿主没有 team 时,不得借机退回旧交错循环
277
+
278
+ ---
279
+
280
+ ## §9 Resume Protocol
281
+
282
+ 恢复时只读:
283
+
284
+ 1. 本文件 §0、§5、§7、§8
285
+ 2. `goal/progress.md` 当前 `mine_unit` 与阶段
286
+ 3. 最近一份 `goal/probes/GP-*.md`
287
+ 4. `goal/chain.md` 的 Units 表与当前 unit 内状态为 `writing` / `written` / `mined` / 下一个 `planned` 的节点
288
+
289
+ 从最后一个改变了矩阵格子的检查点继续。仍覆盖有效格子的 Lesson 不删除、不重写。源码或范围变了先回到 G-goal `replan`,不要在 `/goal` 里偷偷扩 scope。当前 unit 若尚未全部 `written`,先完成阶段 T,禁止提前 mine。
290
+
291
+ ---
292
+
293
+ ## §10 Progress
294
+
295
+ 只记录可核对事实,权威表在 `goal/progress.md`。不准写主观百分比。progress 必须能看出当前 unit 全部 L 先进入 `written`,再进入 `mined`。
296
+
297
+ ---
298
+
299
+ ## §11 Minimum read order for `/goal`
300
+
301
+ 1. 已打开的 `<Path>{roots.state}/workspace.json</Path>`
302
+ 2. 本计划 §0、§5、§7、§8
303
+ 3. `goal/chain.md` 当前 mine unit
304
+ 4. `<Path>{roots.workflows}/learning/G-goal/references/lead-orchestration.md</Path>` 与 mine-unit / split-rules
305
+ 5. 阶段 T:`<Path>{roots.workflows}/learning/L-lesson/L-lesson.md</Path>` 与 teaching-policy
306
+ 6. 本单元全部 L 写成后:`probe-template.md` + `<Path>{roots.workflows}/learning/common/skills/socratic-questioning/SKILL.md</Path>` 且 `audience=mine`
307
+ 7. `goal/coverage-matrix.md` + `<Path>{roots.workflows}/learning/G-goal/references/stop-rules.md</Path>`
308
+ 8. 停止规则触发后写 `goal/verify.md`
309
+
310
+ 不要整读 archive、其他 Change,或 `inquiry/`。
@@ -0,0 +1,26 @@
1
+ # G-goal 编排协议
2
+
3
+ G-goal 只在 `plan` / `replan` 中编排上游地图。授课与挖掘由外部 `/goal` 按 Goal-Plan 派单。`/goal` 采用 lead-directed:Lead 扇出、写集隔离、mine unit ≤15。细节读 `<Path>{roots.workflows}/learning/G-goal/references/lead-orchestration.md</Path>` 与 `<Path>{roots.workflows}/learning/G-goal/references/mine-unit.md</Path>`。
4
+
5
+ ## 计划会话允许跟随的合同
6
+
7
+ - `I-init-setup`:没有状态时写空骨架
8
+ - `A-assess-and-plan`:写出或核对 `course.md`、background、baseline、sources、Change INDEX
9
+ - 可选只读库存员:产出 C4 与函数分组,不写状态
10
+
11
+ 不得跟随:`L-lesson`、`Q-question`、`H-homework`、`R-review`、`C-consolidate`、`A-archive`。不得写 `lessons/` 或 `goal/probes/`。
12
+
13
+ ## `/goal` 会话允许跟随的合同
14
+
15
+ - `L-lesson`:写 `lessons/L-*.md`(阶段 T,每课一个 writer)
16
+ - `socratic-questioning` 且 `audience=mine`:写 `goal/probes/GP-*.md`(阶段 M,每课一个 miner)
17
+
18
+ 不得跟随:`Q-question` 的 `inquiry/` Response 协议、H/R/C/A-archive。
19
+
20
+ ## 所有权
21
+
22
+ 派单不是改写所有权。A 仍拥有 course 地图,L 仍拥有 lessons,G 拥有 `goal/`,Q 拥有 `inquiry/`。矩阵、chain、progress、verify、`lessons/INDEX` 只有 Lead 可写。
23
+
24
+ ## 并发
25
+
26
+ Lead 扇出 + 写集隔离。只有写集不相交才允许并行。同一 mine unit ≤15 节。Wave 不是并发授权,也不是挖掘门。禁止「同一时间只推进一个 chain 节点」的旧交错循环;禁止因为宿主没有 team 就退回 `L → mine → L → mine`。
@@ -0,0 +1,19 @@
1
+ # G-goal 规划模式
2
+
3
+ 本文件只在激活 G-goal 后按模式读取。
4
+
5
+ ## plan(默认)
6
+
7
+ 写出完整 Goal-Plan、Chain、覆盖矩阵和进度骨架,并可跟随 A 合同写 `course.md` / background / baseline / sources。按库存切出 mine unit 列表(每个 ≤15 节,小项目允许远小于 15)。不写 `lessons/`,不写 `goal/probes/`,不提问学习者,不预写探针题目或深化讲义。`ready_for_execution: false`。计划正文不授权执行。
8
+
9
+ ## replan
10
+
11
+ 源码、范围或用户目标变化时重编译。旧 `goal-plan.md` 移入 `goal/revisions/REV-<NNN>.md` 只读。已写成且仍覆盖有效格子的 Lesson 不删除;失效格子改 `deferred` 或重新入链。mine unit 按新库存重切,仍硬顶 15。
12
+
13
+ ## run / resume
14
+
15
+ 不由本 Work 在激活会话内执行。执行器是用户的外部 `/goal`,合同见 `<Path>{roots.workflows}/learning/G-goal/references/external-goal-runner.md</Path>` 与当前 `goal-plan.md` §5 / §8。运行形状是四段:P 已由计划会话完成;`/goal` 对每个 mine unit 走 T(写完全部课)→ M(按课提问)→ D(Lead 深化或拆课),再进入下一 unit。按项目切 unit,硬顶 15。
16
+
17
+ ## verify
18
+
19
+ 对照矩阵与 `verify.md` 验收。课写完不是完成。可由 `/goal` 在停止规则触发后执行;以后再激活 G-goal 时也可以只读验收,仍不得补写 Lesson 或 probe,除非用户明确改回 `replan` 或把计划交给 `/goal`。
@@ -0,0 +1,62 @@
1
+ ---
2
+ artifact: learning-goal-probe
3
+ probe_id: GP-<lesson>-b0N
4
+ lesson_id: L-<NNN>-<slug>
5
+ audience: mine
6
+ batch: b01
7
+ question_budget_used: 0
8
+ split_depth: 0
9
+ status: open
10
+ ---
11
+
12
+ # Probe GP-<lesson> / b0N
13
+
14
+ 审问对象是已写成的 Lesson 与源码,不是学习者。禁止 `inquiry/`、`Response:`、`Submission:`、`verdict`、mastered。`b01` 承载 Q1–Q5;`b02` 承载 Q6–Q10。禁止 `b03`。miner 不得写 `lessons/`。
15
+
16
+ `question_budget_used` 按 `lesson_id` 累计。`re-dispatch-L` 不重置该课预算。
17
+
18
+ ## Q1 澄清
19
+
20
+ 哪些范围内单元被这节课声称覆盖?
21
+
22
+ ## Q2 证据
23
+
24
+ 源码里哪些函数、容器或数据流真正被讲到?
25
+
26
+ ## Q3 假设与反例
27
+
28
+ 合格读者读完后仍说不出什么?
29
+
30
+ ## Q4 视角
31
+
32
+ 架构边或数据流边缺了哪一条?
33
+
34
+ ## Q5 元问题
35
+
36
+ `mine-more` | `defer` | `re-dispatch-L` | `split-lesson`,原因:
37
+
38
+ (`b02` 的元问题是 Q10,选项相同。满 10 问后 `mine-more` 非法,只允许 `split-lesson` / `defer` / `re-dispatch-L`。)
39
+
40
+ ## 缺口清单
41
+
42
+ | 格子 | 缺口 | 建议补丁 | 处置建议 |
43
+ | --- | --- | --- | --- |
44
+ | | | | mine-more / defer / re-dispatch-L / split-lesson |
45
+
46
+ Miner 只填表,不选择最终处置。
47
+
48
+ ## split-proposal
49
+
50
+ 10 问后仍不清,或操作定义触发时填写;否则写 `none`。
51
+
52
+ | 原 lesson_id | 建议新课标题 | 从原课拿走的格子 | 为什么 10 问不够 |
53
+ | --- | --- | --- | --- |
54
+ | | | | |
55
+
56
+ Lead 裁决:新课进当前或下一 mine unit;当前 unit 加进去会超过 15 则开新 unit。不得调用 `C-consolidate` 或 `relocate-learning.mjs`。
57
+
58
+ ## 关闭
59
+
60
+ - 状态:`open` | `patched` | `deferred` | `split_proposed` | `closed`
61
+ - `question_budget_used`:
62
+ - 是否改变了至少一个矩阵格子,或显式 `defer` / `split-proposal`:
@@ -0,0 +1,19 @@
1
+ # Progress: <主题>
2
+
3
+ 只记录可核对事实。不准写主观百分比。当前 mine unit 必须全部 L 先进入 `written`,再进入 `mined`。
4
+
5
+ | 时间 | mine_unit | Wave | Gate | 写入文件 | 矩阵变化 | Blocker |
6
+ | --- | --- | --- | --- | --- | --- | --- |
7
+ | | U1 | 0 | G0 | goal/goal-plan.md | 骨架已建 | |
8
+
9
+ ## 当前
10
+
11
+ - current_mine_unit:
12
+ - current_phase: `T` | `M` | `D` | `idle`
13
+ - 本单元课数:
14
+ - question_budget_used:(按 lesson_id 累计,re-dispatch-L 不重置)
15
+ - active_subagents:
16
+ - 仍 uncovered:
17
+ - 下一 ready 节点:
18
+ - 最近 probe:
19
+ - 恢复入口:重读 goal-plan.md §8
@@ -0,0 +1,32 @@
1
+ # 覆盖尺(v1 编程)
2
+
3
+ v1 只实现编程四轴。其他领域可同构为 units / properties / structure / flow,但不在 v1 生成完整矩阵。
4
+
5
+ ## 四轴
6
+
7
+ | 轴 | 对象 | 默认 SOLO | 证据 |
8
+ | --- | --- | --- | --- |
9
+ | (a) 函数目的 | 范围内公开/领域函数 | Unistructural + explained | Lesson 函数表或父课 covered-by-parent |
10
+ | (b) 方法性状 | 公开 API 与枢纽内部方法 | Unistructural + explained | 副作用、失败路径、幂等、并发、纯/不纯 |
11
+ | (c) 业务架构 | 系统与容器 | Relational | C4 Context + Container + 关键 Component 的 ASCII |
12
+ | (d) 数据流 | 主路径与失败路径 | Relational | 源 → 变换 → 汇 + 存储点 + 所有权 |
13
+
14
+ ## 范围规则
15
+
16
+ - 「每一个函数」= 范围内公开/领域函数,不是仓库里每一个私有 one-liner
17
+ - helper / 生成代码 / 测试夹具:`covered-by-parent` 或 `deferred(reason)`
18
+ - Code 层不手维护过期清单;从源码生成库存,按模块归组
19
+ - Extended Abstract 不是完成条件
20
+ - 不改变矩阵格子的 Lesson 或 probe 不要写
21
+
22
+ ## Wave(内容分组,不是挖掘门)
23
+
24
+ - Wave 1:Context + Container + 主数据流
25
+ - Wave 2:范围内 Code / 方法性状
26
+ - Wave 只按覆盖轴分组,不决定何时挖,也不是并发授权
27
+ - 默认最多 2 波
28
+ - 3 课的波不必撑到 15;单波若超过 15,只把挖掘切开,不把覆盖波扩成配额
29
+
30
+ ## 挖掘扇出
31
+
32
+ 挖掘扇出上界是 `mine_unit_cap=15`,不是必须凑满。4 节的小项目按 4 节挖。切分规则读 `<Path>{roots.workflows}/learning/G-goal/references/mine-unit.md</Path>`。