@haaaiawd/loom 1.0.0 → 1.1.0

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ ## 1.1.0 — 2026-07-30
4
+
5
+ ### Added
6
+
7
+ - Capability Graph、Capability Brief 与 coverage/compile 命令,将项目问题面、能力缺口、
8
+ 风险和证据显式回链到 Intent。
9
+ - provenance-backed Capability Graph Proposal 工作流,由 Architect 裁决新发现对 Graph、
10
+ Intent、acceptance 或版本边界的影响。
11
+ - 版本化 Asset Library,校验来源、作者、许可、本地哈希、批准状态与 evidence 双向引用。
12
+ - Authorship System:第五种认知职能 Author、Identity Compiler、可选 Atelier Path,以及
13
+ `loom atelier init|get|validate`。
14
+ - Atelier Record 的 `intent_revision`、`stance_revision`、候选、修正、基线与选择证据校验。
15
+ - Keeper/Quality Proof 的 Atelier 闭合门;`doctor`、`guide` 与 `intent done` 可识别缺失、
16
+ 过期或未绑定的创作证据。
17
+
18
+ ### Compatibility
19
+
20
+ - 旧 Intent 缺少 `quality_strategy` 时等价于 `adaptive`,不会创建 Atelier Record。
21
+ - Atelier 是按需深路径,不增加角色、Intent 状态或验证维度。
22
+ - 旧项目缺少 Capability Graph 时保留兼容诊断,可在后续架构修订中迁移。
package/README.md CHANGED
@@ -15,8 +15,9 @@ LOOM 是一个**哲学驱动的 Agent 质量框架**,核心理念:
15
15
  LOOM 的核心机制:
16
16
  1. **Project Doctrine** 从项目事实中形成长期判断,而不是套用规范模板
17
17
  2. **Intent + Contract** 同时定义可靠完成的底线与可选的质量上限
18
- 3. **Expertise Compiler** 为当前任务临时组装领域、品味、批评与验证能力
18
+ 3. **Expertise Compiler** 为当前任务临时组装领域、品味、作者、批评与验证能力
19
19
  4. **Quality Arena + Quality Proof** 用机制不同的候选和独立证据支撑质量提升
20
+ 5. **Authorship + Atelier** 在真正需要创作判断时形成作者命题、媒介原型与可审计选择
20
21
 
21
22
  ---
22
23
 
@@ -27,7 +28,10 @@ LOOM 的核心机制:
27
28
  | **哲学** | 项目的价值观和工程原则——为什么存在、什么不做、冲突时谁优先。由 Weaver 从真实思想体系织造,不是模板填空 |
28
29
  | **Intent** | 一个意图单元——不是"做什么"(任务),是"为什么做"(意图)。每个 Intent 有验收契约,Keeper 据此判定实现是否忠实 |
29
30
  | **Intent Map** | 所有 Intent 的依赖图(JSON)。Architect 绘制,定义拓扑序和依赖关系 |
31
+ | **Capability Graph** | 在 Intent 前展开项目问题面、能力缺口、风险和证据;高影响节点必须路由,并回链到 Intent |
30
32
  | **Expertise Pack** | Forge 针对当前任务临时编译的专业认知,不成为永久规则 |
33
+ | **Authorial Stance** | 针对单个 Intent 编译的创作命题、选择、拒绝项、媒介语法和验证视角,不是 Persona 扮演 |
34
+ | **Atelier Path** | 可选创作深路径:冻结基线、形成机制不同候选、比较或保留原版,并把证据写入唯一 Atelier Record |
31
35
  | **Quality Arena** | 以基线和机制不同候选进行探索、比较、实现与观察 |
32
36
  | **Quality Proof** | Keeper 独立验证完成与质量声明,证据不足时不允许宣称提升 |
33
37
  | **Intent Loop** | 选择 → 编译专业能力 → 实现/比较 → 独立证明 → 闭合或回流 |
@@ -58,9 +62,22 @@ Keeper 验证(基础四维;有质量契约时增加 quality_achievement,
58
62
 
59
63
  ---
60
64
 
61
- ## 快速开始
62
-
63
- ### 步骤 0:诊断当前阶段
65
+ ## 快速开始
66
+
67
+ ### 安装
68
+
69
+ ```bash
70
+ npm install --global @haaaiawd/loom
71
+ loom --version
72
+ ```
73
+
74
+ 也可以不做全局安装,直接运行:
75
+
76
+ ```bash
77
+ npx @haaaiawd/loom --help
78
+ ```
79
+
80
+ ### 步骤 0:诊断当前阶段
64
81
 
65
82
  ```bash
66
83
  loom guide
@@ -119,9 +136,9 @@ loom activate architect
119
136
  ```
120
137
 
121
138
  **输入**:愿景文档 + 哲学文档
122
- **Architect 会做什么**:设计系统边界 → 绘制 Intent Map → 定义完成契约、按需的质量契约与专业能力需求
123
- **产出**:`.loom/v1/02_ARCHITECTURE.md` + `.loom/v1/04_INTENT_MAP.json`
124
- **怎么判断合格**:完成契约可观察,质量契约可比较,依赖无环,每个 Intent 有叙事引用
139
+ **Architect 会做什么**:先展开 Capability Graph 设计系统边界 → 绘制 Intent Map → 定义完成契约、按需的质量契约与专业能力需求
140
+ **产出**:`.loom/v1/07_CAPABILITY_GRAPH.json` + `07_CAPABILITY_BRIEFS/` + `.loom/v1/02_ARCHITECTURE.md` + `.loom/v1/04_INTENT_MAP.json`
141
+ **怎么判断合格**:高影响图谱节点都有路由、Intent 都可回链到图谱,完成契约可观察,质量契约可比较,依赖无环
125
142
  **下一步**:进入 Intent Loop
126
143
 
127
144
  ### 步骤 5:进入 Intent Loop
@@ -134,6 +151,10 @@ loom intent update INT-001 --status in_progress
134
151
  # Forge 编译专业能力并实现
135
152
  loom activate forge --intent INT-001
136
153
 
154
+ # 仅当 Architect 为该 Intent 声明 quality_strategy=atelier
155
+ loom atelier init INT-001
156
+ loom atelier validate INT-001
157
+
137
158
  # Keeper 独立形成 Quality Proof
138
159
  loom activate keeper --intent INT-001
139
160
  loom verify contract INT-001 # 查看验收契约
@@ -189,7 +210,7 @@ Agent 在用户说"看看进度 / 打开 preview / 看全局"时,先跑 `loom
189
210
  | `loom preview status` | 检查 `loom-preview.html` 是否存在、是否新鲜 |
190
211
  | `loom preview --regen` | 输出提示词,让 Agent 重写 HTML 预览 |
191
212
  | `loom preview --stale` | 强行打开过期预览 |
192
- | `loom help <topic>` | 分层指南(workflow\|concepts\|loop\|version\|patch\|doctor\|preview) |
213
+ | `loom help <topic>` | 分层指南(含 workflowconceptsloop、capability、atelier、versionpatchdoctorpreview) |
193
214
  | `loom version list` | 列出所有版本(* 标记当前) |
194
215
  | `loom version new` | 创建新版本 + 自动切换(Major 升级) |
195
216
  | `loom version use <v>` | 切换当前版本 |
@@ -205,6 +226,10 @@ Agent 在用户说"看看进度 / 打开 preview / 看全局"时,先跑 `loom
205
226
  | `loom intent revise <id> --reason <text>` | 创建修订 draft 并报告反向依赖 |
206
227
  | `loom intent draft <id>` | 查看 draft |
207
228
  | `loom intent finalize <id> [--review <ids> --unaffected <ids>]` | 校验 draft 并原子更新官方 Map/topo_order;修订时必须分类全部下游影响 |
229
+ | `loom capability graph\|frontier\|get\|coverage\|compile` | 查看能力图谱、未路由前沿、覆盖缺口和当前 Intent 的能力编译输入 |
230
+ | `loom capability proposal list\|get\|submit\|decide\|close` | 以 provenance 提交新发现,并由 Architect 裁决和闭合 |
231
+ | `loom asset import\|list\|search\|get\|validate` | 管理带来源、许可、哈希、批准状态与 evidence 回链的本地素材 |
232
+ | `loom atelier init\|get\|validate <id>` | 为显式 Atelier Intent 创建、读取和校验创作记录 |
208
233
  | `loom intent deprecate <id> --reason <text>` | 只读评估当前版本弃用影响;加 `--confirm` 并完整分类依赖方后原子写入 |
209
234
  | `loom intent narrative <id>` | Intent 意图叙事 |
210
235
  | `loom intent trace <id>` | Intent 完整追溯链(依赖+验证+哲学+叙事) |
@@ -241,27 +266,33 @@ LOOM/
241
266
  │ ├── INTENT_LOOP.md Loop 控制流 + Intent Map + Verification 底线
242
267
  │ └── PHILOSOPHY_WEAVER.md 哲学织造器规范
243
268
 
244
- ├── dimensions/ 哲学维度库(Weaver 的弹药库)
245
- │ ├── SEARCH_METHODOLOGY.md 检索方法论(怎么找到优质思想)
246
- │ ├── universal/ 通用层:产品/工程/协作(按需填充)
269
+ ├── dimensions/ 哲学维度库(Weaver 的弹药库)
270
+ │ ├── SEARCH_METHODOLOGY.md 检索方法论(怎么找到优质思想)
271
+ │ ├── AUTHORSHIP.md Atelier 启用时加载的作者性方法
272
+ │ ├── universal/ 通用层:产品/工程/协作(按需填充)
247
273
  │ ├── domain/ 领域层:UX/游戏/后端/AI(按需填充)
248
274
  │ └── crosscutting/ 交叉层:性能/安全/心理学/增长(按需填充)
249
275
 
250
276
  ├── roles/ 角色原型定义
251
277
  │ ├── visionary.md 远见者——定义愿景,织造意图叙事
252
- │ ├── architect.md 建筑师——设计系统,绘制 Intent Map
278
+ │ ├── architect.md 建筑师——展开图谱,设计系统,绘制 Intent Map
253
279
  │ ├── forge.md 锻造师——在哲学约束下自主实现
254
280
  │ └── keeper.md 守护者——验证意图忠实度
255
281
 
256
282
  ├── cli/ CLI 传感器层(Agent 通过 CLI 访问磁盘数据)
257
- │ ├── bin/loom.js 命令入口
258
- │ ├── src/ 核心库(intent-map / philosophy / verify)
259
- └── test/ 端到端测试
283
+ │ ├── bin/loom.js 命令入口
284
+ │ ├── src/ 核心库(intent-map / capability / atelier / verify)
285
+ ├── help/ Agent 可直接读取的工作流指南
286
+ │ └── test/ 端到端测试
260
287
 
261
288
  └── templates/ 项目级起点骨架
262
289
  ├── PHILOSOPHY_TEMPLATE.md 哲学文档起点
263
290
  ├── VISION_TEMPLATE.md 愿景文档起点
264
- └── INTENT_MAP_TEMPLATE.json Intent Map 起点
291
+ ├── INTENT_MAP_TEMPLATE.json Intent Map 起点
292
+ ├── CAPABILITY_GRAPH_TEMPLATE.json Capability Graph 起点
293
+ ├── CAPABILITY_BRIEF_TEMPLATE.md Capability Brief 起点
294
+ ├── ASSET_LIBRARY_MANIFEST_TEMPLATE.json Asset Library 起点
295
+ └── ATELIER_RECORD_TEMPLATE.json Atelier Record 起点
265
296
  ```
266
297
 
267
298
  ### 文档导航
@@ -279,8 +310,10 @@ LOOM/
279
310
  | Forge 做什么 | `roles/forge.md` |
280
311
  | Keeper 做什么 | `roles/keeper.md` |
281
312
  | 哲学文档长什么样 | `templates/PHILOSOPHY_TEMPLATE.md` |
282
- | 愿景文档长什么样 | `templates/VISION_TEMPLATE.md` |
283
- | Intent Map 长什么样 | `templates/INTENT_MAP_TEMPLATE.json` |
313
+ | 愿景文档长什么样 | `templates/VISION_TEMPLATE.md` |
314
+ | Capability Graph 与 Brief 长什么样 | `cli/help/capability.md`、`templates/CAPABILITY_GRAPH_TEMPLATE.json` |
315
+ | Author 与 Atelier 怎么工作 | `cli/help/atelier.md`、`dimensions/AUTHORSHIP.md` |
316
+ | Intent Map 长什么样 | `templates/INTENT_MAP_TEMPLATE.json` |
284
317
  | 怎么搜索高质量参考 | `dimensions/SEARCH_METHODOLOGY.md` |
285
318
 
286
319
  ---
@@ -295,8 +328,9 @@ LOOM/
295
328
  **Agent 生成的**(每个项目跑出来的,厚而灵活):
296
329
  - 哲学文档体系(Weaver 决定要几个、多详细)
297
330
  - 愿景文档(带意图叙事)
298
- - 架构文档(根据哲学决定结构)
299
- - Intent Map(意图依赖图,JSON)
331
+ - 架构文档(根据哲学决定结构)
332
+ - Capability Graph 与按需生成的 Capability Brief
333
+ - Intent Map(意图依赖图,JSON)
300
334
  - 验证契约和验证记录
301
335
 
302
336
  **我们的规范是元规范**——规范"怎么生成规范",不直接规范"规范长什么样"。
@@ -308,7 +342,7 @@ LOOM/
308
342
  | 角色 | 原型 | 职责 | 激活时机 |
309
343
  |---|---|---|---|
310
344
  | **Visionary** 远见者 | 产品联合创始人 | 定义愿景,织造意图叙事 | 项目启动 |
311
- | **Architect** 建筑师 | 系统建筑师 | 设计系统,绘制 Intent Map | Visionary 完成后 |
345
+ | **Architect** 建筑师 | 系统建筑师 | 展开 Capability Graph,设计系统,绘制 Intent Map | Visionary 完成后 |
312
346
  | **Forge** 锻造师 | 高级工程师 | 在哲学约束下自主实现 | Intent Loop 实现阶段 |
313
347
  | **Keeper** 守护者 | 独立验证者(独立激活) | 从磁盘事实验证意图与质量主张 | Intent Loop 验证阶段 |
314
348
 
@@ -360,11 +394,13 @@ Agent 在项目中生成的文档结构:
360
394
  ├── 01_VISION.md Visionary 产出(带意图叙事)
361
395
  ├── 02_ARCHITECTURE.md Architect 产出
362
396
  ├── 03_DECISIONS/ 架构决策记录
363
- ├── 04_INTENT_MAP.json 意图依赖图(DAG)
397
+ ├── 04_INTENT_MAP.json 意图依赖图(DAG)
364
398
  ├── 05_VERIFICATION.md 每个 Intent 的验证契约
365
399
  ├── 06_CHANGELOG.json Patch 变更记录(唯一权威来源)
366
400
  ├── 06_CHANGELOG.md 确定性生成的只读投影
367
- └── verifications/ Keeper 的验证记录
401
+ ├── 07_CAPABILITY_GRAPH.json 问题面、能力缺口、风险、证据与 Intent 回链
402
+ ├── 07_CAPABILITY_BRIEFS/ 按需生成的项目化能力 Brief
403
+ └── verifications/ Keeper 的验证记录
368
404
  ├── INT-001.json
369
405
  ├── INT-001.md
370
406
  └── ...
@@ -393,11 +429,12 @@ Agent 通过 **CLI 访问** JSON,不直接读文件——省 token、更高效
393
429
  2. Visionary 定义愿景
394
430
  → 基于哲学写愿景 → 每个意图带意图叙事 → 识别需要的哲学维度
395
431
 
396
- 3. Architect 设计系统
397
- 基于愿景设计结构 → 绘制 Intent Map → 定义验证契约
432
+ 3. Architect 先展开 Capability Graph,再设计系统
433
+ 基于愿景检查问题面、能力缺口、风险与证据路由高影响节点 → 绘制 Intent Map → 定义验证契约
398
434
 
399
435
  4. LOOM Quality Engine
400
- → Forge 编译 Expertise Pack → Quality Arena 实现/比较 Keeper 形成 Quality Proof
436
+ → Forge 编译 Expertise Pack → 按需编译 Authorial Stance / 进入 Atelier
437
+ → Quality Arena 实现/比较 → Keeper 形成 Quality Proof
401
438
  → 循环直到所有 Intent 闭合
402
439
  ```
403
440
 
@@ -407,11 +444,12 @@ Agent 通过 **CLI 访问** JSON,不直接读文件——省 token、更高效
407
444
 
408
445
  - [x] `meta/` 元规范(4 个文件)
409
446
  - [x] `roles/` 角色原型(4 个角色)
410
- - [x] `templates/` 起点骨架(3 个模板)
447
+ - [x] `templates/` 起点骨架
411
448
  - [x] `README.md` 系统总览
412
449
  - [x] `dimensions/SEARCH_METHODOLOGY.md` 检索方法论
413
- - [x] `cli/` CLI 访问层(118 个测试全过)
414
- - [ ] `dimensions/` 维度文件(按需填充,Weaver 可自主判断)
450
+ - [x] `cli/` CLI 访问层(Capability Graph / Proposal / Asset Library / Atelier / Quality Proof)
451
+ - [x] `dimensions/AUTHORSHIP.md` 按需创作方法
452
+ - [ ] 继续通过真实项目校准专业维度与 Atelier 的质量增益
415
453
 
416
454
  ---
417
455
 
package/cli/bin/loom.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // loom — LOOM 框架的 CLI 传感器层
3
3
  // Agent 通过这个 CLI 访问 Intent Map / 哲学 / 验证记录,不直接读文件。
4
4
 
5
- import { argv, cwd, exit } from 'node:process';
5
+ import { argv, cwd, env, exit } from 'node:process';
6
6
  import { resolve, join, dirname } from 'node:path';
7
7
  import { existsSync, readdirSync, readFileSync } from 'node:fs';
8
8
  import { fileURLToPath } from 'node:url';
@@ -24,6 +24,10 @@ import { generatePreviewPrompt, getPreviewStatus } from '../src/preview.js';
24
24
  import { getPatch, listPatches, recordPatch, validatePatches } from '../src/patch.js';
25
25
  import { addIntentDraft, finalizeIntentDraft, getIntentDraft, reviseIntentDraft } from '../src/intent-draft.js';
26
26
  import { resolveIntentRef } from '../src/shared/intent-ref.js';
27
+ import { compileCapabilityInputs, getCapabilityCoverage, getCapabilityFrontier, getCapabilityGraphProjection, getCapabilityNode } from '../src/capability-graph.js';
28
+ import { getAsset, importAsset, listAssets, recoverAssetImportTransaction, searchAssets, validateAssetLibrary } from '../src/asset-library.js';
29
+ import { closeCapabilityProposal, decideCapabilityProposal, getCapabilityProposal, listCapabilityProposals, submitCapabilityProposal } from '../src/capability-proposals.js';
30
+ import { getAtelierRecord, initAtelierRecord, validateAtelierRecord } from '../src/atelier.js';
27
31
 
28
32
  // ─── 路径解析 ──────────────────────────────────────────
29
33
  // findLoomRoot / findVersionDir / readCurrentPointer 已提取到 shared/paths.js
@@ -58,15 +62,128 @@ const [cmd, sub, ...rest] = argv.slice(2);
58
62
 
59
63
  try {
60
64
  switch (cmd) {
61
- case '--version':
65
+ case '--version':
62
66
  case '-v': {
63
67
  // 从根 package.json 读版本号(cli/bin -> cli -> LOOM root)
64
68
  const pkgPath = resolve(__dirname, '..', '..', 'package.json');
65
69
  const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
66
70
  console.log(`loom ${pkg.version}`);
67
- break;
68
- }
69
-
71
+ break;
72
+ }
73
+
74
+ case 'capability': {
75
+ const versionDir = findVersionDir();
76
+ switch (sub) {
77
+ case 'graph':
78
+ output(getCapabilityGraphProjection(versionDir));
79
+ break;
80
+ case 'frontier':
81
+ output(getCapabilityFrontier(versionDir));
82
+ break;
83
+ case 'get': {
84
+ const id = rest[0];
85
+ if (!id) die('用法: loom capability get <node-id>');
86
+ output(getCapabilityNode(versionDir, id));
87
+ break;
88
+ }
89
+ case 'coverage':
90
+ output(getCapabilityCoverage(versionDir));
91
+ break;
92
+ case 'compile': {
93
+ const intentId = rest[0];
94
+ if (!intentId) die('用法: loom capability compile <intent-id>');
95
+ output(compileCapabilityInputs(versionDir, intentId));
96
+ break;
97
+ }
98
+ case 'proposal': {
99
+ const action = rest[0];
100
+ if (action === 'list') output(listCapabilityProposals(versionDir));
101
+ else if (action === 'get') {
102
+ if (!rest[1]) die('用法: loom capability proposal get <CGP-ID>');
103
+ output(getCapabilityProposal(versionDir, rest[1]));
104
+ } else if (action === 'submit') {
105
+ const fileIndex = argv.indexOf('--json-file');
106
+ const path = fileIndex === -1 ? null : argv[fileIndex + 1];
107
+ if (!path) die('用法: loom capability proposal submit --json-file <proposal.json>');
108
+ output(submitCapabilityProposal(versionDir, JSON.parse(readFileSync(path, 'utf-8'))));
109
+ } else if (action === 'decide') {
110
+ const rationaleIndex = argv.indexOf('--rationale');
111
+ if (!rest[1] || !rest[2] || rationaleIndex === -1 || !argv[rationaleIndex + 1]) die('用法: loom capability proposal decide <CGP-ID> <decision> --rationale <text>');
112
+ output(decideCapabilityProposal(versionDir, rest[1], rest[2], argv[rationaleIndex + 1]));
113
+ } else if (action === 'close') {
114
+ const resolutionIndex = argv.indexOf('--resolution-file');
115
+ if (!rest[1] || resolutionIndex === -1 || !argv[resolutionIndex + 1]) die('用法: loom capability proposal close <CGP-ID> --resolution-file <resolution.json>');
116
+ output(closeCapabilityProposal(versionDir, rest[1], JSON.parse(readFileSync(argv[resolutionIndex + 1], 'utf-8'))));
117
+ } else die('用法: loom capability proposal [list|get|submit|decide|close]');
118
+ break;
119
+ }
120
+ default:
121
+ die(`未知 capability 子命令: ${sub}\n用法: loom capability [graph|frontier|get|coverage|compile|proposal]`);
122
+ }
123
+ break;
124
+ }
125
+
126
+ case 'asset': {
127
+ const versionDir = findVersionDir();
128
+ switch (sub) {
129
+ case 'import': {
130
+ const filePath = rest[0];
131
+ const option = (name) => {
132
+ const index = argv.indexOf(name);
133
+ return index === -1 ? undefined : argv[index + 1];
134
+ };
135
+ if (!filePath || filePath.startsWith('--')) die('用法: loom asset import <本地文件> --tags <标签,...> --source <来源> --author <作者> --license <许可> --approval approved [--kind image] [--evidence <节点,...>]');
136
+ output(importAsset(versionDir, filePath, {
137
+ tags: option('--tags'), source: option('--source'), author: option('--author'), license: option('--license'),
138
+ approval: option('--approval'), kind: option('--kind'), evidenceRefs: option('--evidence'),
139
+ failureInjection: env.NODE_ENV === 'test' && option('--test-fail-after') === 'manifest' ? 'after_manifest'
140
+ : env.NODE_ENV === 'test' && option('--test-fail-after') === 'crash-manifest' ? 'crash_after_manifest' : undefined,
141
+ }));
142
+ break;
143
+ }
144
+ case 'list': output(listAssets(versionDir)); break;
145
+ case 'search': {
146
+ const query = rest[0];
147
+ if (!query) die('用法: loom asset search <查询>');
148
+ output(searchAssets(versionDir, query));
149
+ break;
150
+ }
151
+ case 'get': {
152
+ const id = rest[0];
153
+ if (!id) die('用法: loom asset get <asset-id>');
154
+ output(getAsset(versionDir, id));
155
+ break;
156
+ }
157
+ case 'validate': {
158
+ const recovery = recoverAssetImportTransaction(versionDir);
159
+ output({ valid: true, assets: Object.keys(validateAssetLibrary(versionDir).assets).length, recovered_transaction: recovery.recovered ? recovery : null });
160
+ break;
161
+ }
162
+ default: die(`未知 asset 子命令: ${sub}\n用法: loom asset [import|list|search|get|validate]`);
163
+ }
164
+ break;
165
+ }
166
+
167
+ case 'atelier': {
168
+ const versionDir = findVersionDir();
169
+ const intentId = rest[0];
170
+ if (!intentId) die(`用法: loom atelier ${sub || '<init|get|validate>'} <intent-id>`);
171
+ switch (sub) {
172
+ case 'init':
173
+ output(initAtelierRecord(versionDir, intentId));
174
+ break;
175
+ case 'get':
176
+ output(getAtelierRecord(versionDir, intentId));
177
+ break;
178
+ case 'validate':
179
+ output(validateAtelierRecord(versionDir, intentId));
180
+ break;
181
+ default:
182
+ die(`未知 atelier 子命令: ${sub}\n用法: loom atelier [init|get|validate] <intent-id>`);
183
+ }
184
+ break;
185
+ }
186
+
70
187
  case 'intent': {
71
188
  const versionDir = findVersionDir();
72
189
  switch (sub) {
@@ -227,7 +344,18 @@ try {
227
344
  if (!isVerificationCurrent(intent, latest)) {
228
345
  die(`${id} 最新 passed 验证不属于当前 Intent revision ${intent.revision ?? 1}。先重新验证。`);
229
346
  }
230
- const currentStatus = intent.status;
347
+ if (intent.quality_strategy === 'atelier') {
348
+ const atelier = validateAtelierRecord(versionDir, id);
349
+ if (!['selected', 'baseline_retained'].includes(atelier.status)) {
350
+ die(`${id} 的 Atelier Record 尚未完成选择(当前: ${atelier.status})`);
351
+ }
352
+ if (latest.atelier?.record_ref !== `09_ATELIER/${id}.json`
353
+ || latest.atelier?.stance_revision !== atelier.stance_revision
354
+ || latest.atelier?.status !== atelier.status) {
355
+ die(`${id} 最新 passed 未绑定当前 Atelier Record 与 stance_revision。请在新的 Keeper task 中重新验证。`);
356
+ }
357
+ }
358
+ const currentStatus = intent.status;
231
359
  if (currentStatus === 'completed') {
232
360
  console.log(`${id} 已经是 completed,无需操作`);
233
361
  break;
@@ -796,7 +924,16 @@ To Human:
796
924
  loom patch list 列出当前版本的 Patch
797
925
  loom patch get <id> 返回指定 Patch
798
926
  loom patch validate 校验 Patch ledger 和 Markdown 投影
799
-
927
+
928
+ loom capability graph 输出 Capability Graph 的 Mermaid 投影与摘要
929
+ loom capability frontier 列出尚未路由的高影响节点
930
+ loom capability get <id> 返回节点、关系、Brief 与 Intent 回链
931
+ loom capability coverage 检查图谱覆盖、Brief 和 Intent 回链
932
+ loom capability compile <id> 只读显示会进入该 Intent 的能力输入
933
+ loom atelier init <id> 为 atelier Intent 创建唯一创作记录
934
+ loom atelier get <id> 返回并校验当前 Atelier Record
935
+ loom atelier validate <id> 校验 Record、revision、候选与证据引用
936
+
800
937
  loom intent next 返回下一个可执行 Intent
801
938
  loom intent add --title <text> [--depends-on <ids>] 创建新增 draft
802
939
  loom intent revise <id> --reason <text> 创建修订 draft 并报告反向依赖
@@ -0,0 +1,36 @@
1
+ # Asset Library Protocol
2
+
3
+ Asset Library is the versioned, local-first source of truth for project materials. It stores asset bytes under `.loom/vN/08_ASSET_LIBRARY/files/` and metadata in `manifest.json`. A remote URL, successful download, or HTTP 200 is never proof that an asset is renderable in the target host.
4
+
5
+ ## Import
6
+
7
+ ```bash
8
+ loom asset import ./approved-image.png \
9
+ --kind image \
10
+ --tags "庆祝,表情,项目名" \
11
+ --source "用户自有素材包" \
12
+ --author "作者或权利人" \
13
+ --license "授权说明或许可证" \
14
+ --approval approved
15
+ ```
16
+
17
+ Import copies an explicitly named ordinary local file, computes SHA-256, derives a stable `ASSET-...` ID, and rejects symbolic links, destination/path escape, duplicate bytes, missing provenance, and unapproved assets. It does not fetch remote material.
18
+
19
+ ## Recoverable import transaction
20
+
21
+ An evidence-linked import changes three files: the copied bytes, `manifest.json`, and `07_CAPABILITY_GRAPH.json`. Filesystems do not provide one atomic operation across those files, so Loom does not claim that they do. It first prevalidates the complete candidate, then writes same-directory temporary files and a recovery journal (flushed where the filesystem supports it). If an import errors, Loom rolls back to the recorded pre-import state; if the process is interrupted, the next `loom asset validate`, import, or library read recovers the journal before using the library. `loom asset validate` reports a recovered transaction in its JSON output.
22
+
23
+ ## Discover and verify
24
+
25
+ ```bash
26
+ loom asset list
27
+ loom asset search 表情
28
+ loom asset get ASSET-<hash-prefix>
29
+ loom asset validate
30
+ ```
31
+
32
+ Tags are Unicode strings, so Chinese search works without a separate tokenizer for the small local library. Search returns only active `approval: approved` assets; `asset list` remains the audit view. Only approved assets may be used by Forge.
33
+
34
+ ## Evidence links
35
+
36
+ When importing with `--evidence`, Loom validates the complete prospective manifest and Graph first, then writes both the asset's `evidence_refs` and the evidence node's `asset_refs` as one recoverable transaction. `loom asset validate` checks this reciprocal link plus hashes and provenance. This records bytes and traceability; Keeper must still check the real target host renders the result.
@@ -0,0 +1,37 @@
1
+ # Atelier
2
+
3
+ Atelier 是 `quality_strategy=atelier` 的创作深路径。它让 Authorial Stance、基线、候选、
4
+ 修正和选择证据成为单个版本化记录,不替代 Intent 状态或 Keeper。
5
+
6
+ ## 何时启用
7
+
8
+ 由 Architect 在 Intent 同时声明:
9
+
10
+ ```json
11
+ {
12
+ "quality_contract": "相对基线可观察的质量主张与证据方式",
13
+ "quality_strategy": "atelier",
14
+ "creative_scope": "允许改变什么;必须保护什么。"
15
+ }
16
+ ```
17
+
18
+ 普通任务省略该字段或使用 `adaptive`,不会创建 Atelier Record。
19
+
20
+ ## 工作流
21
+
22
+ ```bash
23
+ loom activate forge --intent INT-001
24
+ loom atelier init INT-001
25
+ loom atelier validate INT-001
26
+ loom atelier get INT-001
27
+ ```
28
+
29
+ 记录位于 `.loom/vN/09_ATELIER/INT-001.json`,证据位于
30
+ `.loom/vN/09_ATELIER/files/INT-001/`。
31
+
32
+ 每个候选必须绑定 `stance_revision`。Stance 改变后,旧候选要设置 `archived: true`,
33
+ 或在重新检查后写 `requalified_for_stance_revision`。局部创作修正写入 `corrections[]`;
34
+ 结构性新发现提交 Capability Graph proposal,由 Architect 裁决。
35
+
36
+ `loom atelier validate` 只证明记录结构、新鲜度和引用合法,不证明作品优秀。最终质量仍由
37
+ 新的 Keeper task 依据 Quality Proof 独立判定。
@@ -0,0 +1,68 @@
1
+ ## Capability Graph 指南
2
+
3
+ Capability Graph 位于 Vision 与 Intent Map 之间:它把项目初衷展开为需要被理解、设计、实现或证明的
4
+ 问题面、能力缺口、风险与证据。它不是待办列表,也不替代 Intent Map。
5
+
6
+ ```bash
7
+ loom capability graph
8
+ loom capability frontier
9
+ loom capability get <node-id>
10
+ loom capability coverage
11
+ loom capability compile <intent-id>
12
+ ```
13
+
14
+ ## 工作方式
15
+
16
+ Visionary 给出 outcome、角色、非目标与项目事实。Architect 用项目类型相符的透镜检查用户旅程、
17
+ 体验、系统、资产、横切质量和未知;每个透镜必须被展开、覆盖或明确排除。
18
+
19
+ 高影响节点不能停在 `open`。它必须继续展开、生成 Capability Brief、编译为 Intent,或带理由地
20
+ 延后/排除。`loom capability frontier` 显示尚未路由的高影响节点;`loom capability coverage` 检查
21
+ 图谱与 Intent 的双向追溯。
22
+
23
+ 高影响 `outcome` 还必须有一条真实的观察链:以 `validated_by` 指向 `evidence` 节点。该 evidence 的
24
+ `verification` 对象必须包含 `method`、`target`、`procedure`、`pass_criteria` 和 `artifact`,并以
25
+ `intent_refs` 回链负责产出该证据的 Intent。`target` 写结果真正要被看见、接收或使用的位置,例如目标
26
+ 宿主的渲染面、用户拿到的导出文件、外部系统的接收端或人工验收现场。不要把“HTTP 200”“URL 可访问”或
27
+ “本地生成了文件”当作用户已得到结果。
28
+
29
+ 不新增媒体、平台或版权专用节点类型:目标宿主与交付链路用 `concern` / `capability` 表达,许可、来源、
30
+ 隐私或平台限制用 `risk` 和 `constrains` 关系表达;只有需要项目化判断时才为相关节点创建 Brief,并在其
31
+ “项目约束”和“产出与验证入口”中写清授权边界与实际交付验证。
32
+
33
+ ```json
34
+ {
35
+ "id": "EVIDENCE-DELIVERY-RENDER",
36
+ "kind": "evidence",
37
+ "title": "在目标宿主中实际呈现交付物",
38
+ "status": "covered",
39
+ "impact": "high",
40
+ "route": "intent",
41
+ "intent_refs": ["INT-004"],
42
+ "verification": {
43
+ "method": "manual_visual",
44
+ "target": "目标桌面客户端的消息渲染面",
45
+ "procedure": "在干净会话中发送产物并观察实际渲染",
46
+ "pass_criteria": "用户无需打开外链即可看见完整内容",
47
+ "artifact": "verifications/INT-004-host-render.png"
48
+ },
49
+ "relationships": []
50
+ }
51
+ ```
52
+
53
+ ## Capability Brief
54
+
55
+ 只有高影响、需要调研、需要专业方法或将进入当前 Intent 的能力节点才需要 Brief。Brief 位于:
56
+
57
+ ```text
58
+ .loom/vN/07_CAPABILITY_BRIEFS/<node-id>.md
59
+ ```
60
+
61
+ 它写当前项目问题、成功判断、约束、能力获取计划、产出/验证入口与非目标。不要复制通用教程,
62
+ 也不要用“你是某领域专家”代替项目化能力说明。
63
+
64
+ ## 编译与回流
65
+
66
+ `loom capability compile <intent-id>` 只读显示会进入当前 Intent 的图谱节点与 Brief。Forge 激活
67
+ Intent 时会获得同一份输入;发现新依赖、风险或能力缺口时必须回流 Architect 更新 Graph,不能静默
68
+ 扩展实现。Keeper 以图谱回链检查高影响问题是否真的被兑现。
@@ -3,7 +3,7 @@
3
3
  LOOM 用一条完整链路把长期判断、当前意图、专业能力、创造性探索和独立证明连起来:
4
4
 
5
5
  ```text
6
- Doctrine → Intent → Contract
6
+ Doctrine → Intent narrative Capability Graph → Contract
7
7
  → Expertise Compiler → Quality Arena → Quality Proof
8
8
  → Reflow
9
9
  ```
@@ -31,6 +31,12 @@ Weaver 从项目事实和决策相关证据中织造 Doctrine;它不预写产
31
31
 
32
32
  Architect 是 Intent DAG 与两类契约的唯一负责人。
33
33
 
34
+ ## Capability Graph
35
+
36
+ Capability Graph 位于 Vision 和 Intent Map 之间。它将项目初衷展开成 `outcome`、`concern`、`capability`、`risk`、`evidence` 五类节点,描述哪些问题必须被理解、设计、实现或证明。
37
+
38
+ 它不是执行 DAG,也不替代 Intent Map:Graph 保留未知、研究与分叉;Intent 只保留边界明确、能独立验收的承诺。高影响节点必须有明确路由(继续展开、Brief、Intent、延后或排除),每个 Intent 必须回链至少一个图谱节点。只有需要专业方法、调研或即将进入当前 Intent 的节点才创建短小的项目化 Capability Brief。
39
+
34
40
  ## System Boundary
35
41
 
36
42
  LOOM 不假装能够清除宿主 Agent 的既有记忆。`loom activate` 生成有序 Context Pack,
@@ -38,7 +44,7 @@ LOOM 不假装能够清除宿主 Agent 的既有记忆。`loom activate` 生成
38
44
 
39
45
  ## Expertise Compiler
40
46
 
41
- Forge 针对当前 Intent 临时组装一个 Expertise Pack,回答:
47
+ Forge 针对当前 Intent 临时组装一个 Expertise Pack。先由 Capability Graph 编译关联节点和 Capability Brief,再回答:
42
48
 
43
49
  1. 这是什么专业问题。
44
50
  2. 优秀作品的判断标准是什么。
@@ -81,6 +87,7 @@ Keeper 在独立上下文中验证:
81
87
  - 长期价值判断 → Weaver
82
88
  - 产品目标与 narrative → Visionary
83
89
  - 系统边界、Intent、契约 → Architect
90
+ - 图谱遗漏、未路由高影响节点或新的能力缺口 → Architect 更新 Capability Graph
84
91
  - 专业能力与实现 → Forge
85
92
  - 证据不足或判定偏离 → Keeper
86
93
 
@@ -0,0 +1,21 @@
1
+ # Capability Graph Change Proposals
2
+
3
+ New user requirements, research findings, and implementation discoveries are candidates, not silent changes to the official Capability Graph or current Intent.
4
+
5
+ ```bash
6
+ loom capability proposal submit --json-file ./CGP-NEW-REQUIREMENT.json
7
+ loom capability proposal list
8
+ loom capability proposal get CGP-NEW-REQUIREMENT
9
+ loom capability proposal decide CGP-NEW-REQUIREMENT graph_update --rationale "..."
10
+ loom capability proposal close CGP-NEW-REQUIREMENT --resolution-file ./CGP-NEW-REQUIREMENT-resolution.json
11
+ ```
12
+
13
+ Each proposal records an origin, provenance (source, observation time, concrete evidence), candidate kind, title and why-now. Candidate kinds are `outcome`, `constraint`, `capability`, `risk`, and `evidence`.
14
+
15
+ Only Architect decides whether it is already covered, needs a Graph update, changes an Intent or acceptance contract, belongs in Minor/Major, or is rejected. A decision still blocks the loop until a structured resolution closes it; an arbitrary path or prose string is not evidence.
16
+
17
+ The resolution is decision-specific and is checked against the current version after the decision baseline: `graph_update` names changed Graph nodes (which must carry the proposal ID); `intent_change` names changed Intents; `acceptance_change` names Intents whose acceptance artifact changed; `covered` names the already-effective Graph coverage plus a rationale; and `minor`, `major`, or `reject` references a newly written `03_DECISIONS/` artifact naming the proposal. A `constraint` decided as `graph_update` must additionally appear in the formal Graph `constraints` array with its affected node IDs.
18
+
19
+ For `covered_by`, use both `covered_by: "NODE-ID"` and a `{ "type": "covered_by", "target": "NODE-ID" }` relationship. The target must be a different, currently covered node with a direct route; chained or self-referential coverage is rejected.
20
+
21
+ Forge and Keeper may submit candidates but cannot use them to expand their active scope.