@haaaiawd/loom 2.0.0 → 2.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/README.zh-CN.md CHANGED
@@ -1,174 +1,191 @@
1
- <p align="center"><a href="README.md">English</a> · <strong>简体中文</strong></p>
2
-
3
- <p align="center">
4
- <img src="docs/brand/loom-readme-header.zh-CN.svg" alt="LOOM — 记住全貌,继续工作。" width="100%">
5
- </p>
6
-
7
- <p align="center">
8
- <a href="https://www.npmjs.com/package/@haaaiawd/loom"><img src="https://img.shields.io/npm/v/%40haaaiawd%2Floom?style=flat-square&amp;color=4169E1&amp;label=npm" alt="npm 版本"></a>
9
- <img src="https://img.shields.io/badge/node-%E2%89%A518-17212B?style=flat-square" alt="Node.js 18 或更高版本">
10
- <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-9AD8C2?style=flat-square&amp;labelColor=17212B" alt="MIT 许可证"></a>
11
- </p>
12
-
13
- <p align="center"><strong>人只需要和 Agent 自然聊天。LOOM 在背后帮助 Agent 记住、理解,并继续工作。</strong></p>
14
-
15
- LOOM 是为 AI Agent 准备的、隐形的项目理解与连续性基础设施。凡是能够通过代码或命令行获得实质推进的工作——软件、运维、科研流程、办公自动化、数据处理,以及高度个性化的项目——都在它的能力边界内。
16
-
17
- 用户不需要学习一套框架,也不需要亲自操作 CLI。他只需要描述想要什么、回答真正有价值的问题、提出异议、把某些判断交给 Agent,然后看着结果逐渐成为现实。Agent 在后台使用 LOOM,让项目全貌在上下文压缩、会话切换和长期施工中保持连续。
18
-
19
- <table>
20
- <tr>
21
- <td width="33%"><strong>全貌,而不是碎片</strong><br>让结果、决策、系统与未知始终彼此连接。</td>
22
- <td width="33%"><strong>专业判断,而不是角色扮演</strong><br>编译项目专属的领域能力,而不是装饰性的专家人设。</td>
23
- <td width="33%"><strong>证据,而不是仪式</strong><br>通过独立交接、精确完成条件与磁盘证据证明结果。</td>
24
- </tr>
25
- </table>
26
-
27
- ## 整体闭环
28
-
29
- ![LOOM 的生产闭环](docs/loom-production-loop.svg)
30
-
31
- LOOM 有三个明确的反馈环:理解环不断收敛到项目全貌;陌生 Keeper 检查被冻结的交接内容,并返回具体缺口;可恢复的 Task 则带着实现状态与证据穿过中断继续向前。Keeper 不通过时,结果不会沦为一条大家礼貌看过、然后继续开工的警告——项目必须回到真正有问题的源文件修复,形成新的 digest,再交给另一个全新的 Keeper。
32
-
33
- 这个闭环是自适应的。LOOM 不提供万能问卷、固定专家角色或强制阶段仪式。只要某个未知仍可能改变项目全貌,Agent 就继续澄清;当剩余不确定性已经局部且可逆,或用户在得知具体代价后明确要求跳过,Agent 才继续向前。
34
-
35
- ## 磁盘上的项目事实
36
-
37
- 初始化后的项目只有一条小而稳定的语义骨架:
38
-
39
- ```text
40
- .loom/
41
- ├── PROJECT.md 项目全貌的简洁入口与索引
42
- ├── DECISIONS.md 重要决策被推翻或替代时的简洁历史
43
- ├── design/ 产品、体验、系统、契约、验证、运作或研究文档
44
- ├── capabilities/ 每个可识别专业领域一份项目专属能力卷宗
45
- ├── state.json 已确认事实、假设、未决问题与 Keeper 状态
46
- ├── tasks.json 广度 Work Map 与当前活跃施工地平线
47
- └── eval/ 可选的 Evil Eval 场景,用于检验 LOOM 自身
48
- ```
49
-
50
- 小项目可以只有少量设计文档,大项目也可以拥有很多。当一个重要子系统、体验、接口、契约或运作问题需要被陌生 Agent 独立理解或验证时,它就应拥有自己的文档。`PROJECT.md` 负责映射全貌,而不是慢慢长成一个千行杂物间。
51
-
52
- ### 能力卷宗
53
-
54
- 只有当某种专业知识会改变问题、设计选择、实现方式、风险或验证方法时,才需要建立能力卷宗。每份卷宗代表一个可被正常识别的专业领域,例如 UI/UX 设计、视觉美术、游戏化设计、心理学、安全或分布式系统。
55
-
56
- 即使多个领域紧密耦合,也应保持彼此独立;它们的综合判断写入共同参与塑造的设计文档。分诊、排序、解析或缓存之类的任务技巧,不能伪装成整个项目的专业能力边界。
57
-
58
- ### Work Map 与 Task
59
-
60
- Work Map 可以有几百甚至几千行。它被存储、搜索并持续修订在磁盘上,不会被塞进每一次模型上下文。规划先获得足够广度,只有当前活跃地平线才会被编译成详细步骤。
61
-
62
- Task 不是微型官僚流程。它是最小的、可以在中断后恢复的施工检查点,足以告诉一个陌生 Agent:
63
-
64
- - 要产生什么可观察结果;
65
- - 什么证据能够证明完成;
66
- - 哪些东西绝不能被破坏;
67
- - 当前需要读取哪些项目文档与能力卷宗;
68
- - 之前发生了什么、现在在做什么、接下来是什么;
69
- - 已有哪些证据,以及它们分别证明了哪一条精确完成条件。
70
-
71
- ## Agent 快速开始
72
-
73
- 安装 CLI:
74
-
75
- ```bash
76
- npm install --global @haaaiawd/loom
77
- loom --version
78
- ```
79
-
80
- 开发时也可以直接从仓库安装:
81
-
82
- ```bash
83
- npm install --global .
84
- loom --version
85
- ```
86
-
87
- 进入项目后,Agent 运行:
88
-
89
- ```bash
90
- loom init
91
- loom context
92
- ```
93
-
94
- Agent `.loom/PROJECT.md`、设计文档和能力卷宗作为人类可读的项目事实维护。结构化写入通过 JSON 文件完成,让长内容可以审计,也避免 shell 引号损坏数据:
95
-
96
- ```bash
97
- loom record --json-file understanding-update.json
98
- loom design add product --title "Product definition" --kind product
99
- loom design add local-analysis --title "Local analysis system" --kind system
100
- loom design add acceptance --title "Vertical-slice verification" --kind verification
101
- loom capability add ui-ux-design --title "UI/UX design"
102
- loom capability add behavioral-psychology --title "Behavioral psychology"
103
- loom task plan --json-file initial-work-map.json
104
- loom project ready
105
- ```
106
-
107
- 准备从项目成型进入实质施工时,打开一个全新的 Agent 线程,只给它一句简短指令:
108
-
109
- ```text
110
- Run loom keeper prompt in this project and follow it. Decide whether you can responsibly start.
111
- ```
112
-
113
- 如果 Keeper 返回 `needs_revision` 或 `blocked`,这些具体缺口会重新出现在 `loom context` 中。Agent 修复对应的项目、设计、能力或 Task 源文件,生成发生变化的新 digest,再打开另一个全新的 Keeper。若宿主不支持子代理,用户可以新开一个窗口并使用同一句提示词。
114
-
115
- 一次性交接通过后,施工 Agent 正常启动并维护 Task:
116
-
117
- ```bash
118
- loom task next
119
- loom task start TASK-001
120
- loom context
121
- loom task update TASK-001 --json-file progress.json
122
- loom task block TASK-001 --json-file block.json
123
- loom task reopen TASK-001
124
- loom task reopen TASK-001 --reason "Prior completion evidence was disproven"
125
- loom task done TASK-001 --json-file evidence.json
126
- ```
127
-
128
- 完成条件被刻意设计得非常明确:
129
-
130
- ```json
131
- {
132
- "evidence": ["npm test: 21 passed, 0 failed"],
133
- "checks": [
134
- {
135
- "criterion": "The exact done_when sentence from the Task.",
136
- "evidence": ["The command, artifact, or observation that proves this criterion."]
137
- }
138
- ]
139
- }
140
- ```
141
-
142
- 运行 `loom --help` 查看全部命令,运行 `loom check` 检查结构健康度。`loom prompts` 会打印 LOOM 可能注入的全部认知消息:稳定协作核心、运行时协议、动态状态层、所有文档模板、Keeper 提示词、Eval 条件、裁判提示词,以及它们的组合顺序。详见[提示词与消息目录](docs/PROMPT_CATALOG.md)。
143
-
144
- ## LOOM 刻意删除了什么
145
-
146
- LOOM 2 用一个自适应理解环、可扩展的设计文档图、彼此独立的专业领域卷宗、一张 Work Map 和一个可恢复的 Task 契约,替代了 v1 中 Doctrine、Vision、Capability Graph、Impact Gate、Intent Map、Expertise Pack、Atelier、Quality Arena、逐 Intent Keeper 与 Atlas 组成的漫长链条。
147
-
148
- 真正有价值的部分仍然保留:项目判断、外部专业能力、有作者性的选择、可观察完成、上下文隔离与证据。它们不再需要一连串独立角色和关卡才能成立。
149
-
150
- ## 证明 LOOM 真的有用
151
-
152
- `loom eval scaffold --json-file scenario.json` 会创建一个 Evil Eval 场景。在两个条件中,模型、工具、工作区、用户事实和预算完全相同;唯一预期差异是能否使用 LOOM。实验会重复运行、强制重置上下文、匿名并交换产物顺序,同时把仪式成本、用户负担、时间和 token 消耗与质量一起计分。详见 [EVIL_EVAL.md](EVIL_EVAL.md)。
153
-
154
- ![LOOM Evil Eval](docs/loom-eval-loop.svg)
155
-
156
- ## 开发
157
-
158
- ```bash
159
- npm test
160
- ```
161
-
162
- v2 测试覆盖完整闭环,包括 250 个 Task 的 Work Map、上下文选择、决策替代历史、可扩展设计文档、专业领域分离、能力编译、多轮 Keeper 修订、陈旧 digest 与重复 run 拒绝、精确文件级 Task 启动、阻塞与重开(包括完成证据被推翻)、逐完成条件证据,以及 Evil Eval 的控制变量。详见[完整 UX 与闭环规范](docs/UX_FLOW.md)。
163
-
164
- ## 文档
165
-
166
- | 文档 | 适合在什么时候阅读 |
167
- | --- | --- |
168
- | [系统设计](design.md) | 了解架构、存储模型、不变量与命令契约 |
169
- | [UX 与闭环规范](docs/UX_FLOW.md) | 了解用户、Agent、LOOM、Keeper Task 的全部转换 |
170
- | [提示词与消息目录](docs/PROMPT_CATALOG.md) | 检查 LOOM 注入的所有消息及其组合方式 |
171
- | [Evil Eval 协议](EVIL_EVAL.md) | 进行有框架与无框架的受控比较 |
172
- | [更新记录](CHANGELOG.md) | 了解 LOOM 2 的变化 |
173
-
174
- 两张流程图的可编辑 Draw.io 源文件与图片放在同一个 [`docs/`](docs/) 目录中。
1
+ <p align="center"><a href="README.md">English</a> · <strong>简体中文</strong></p>
2
+
3
+ <p align="center">
4
+ <img src="docs/brand/loom-readme-header.zh-CN.svg" alt="LOOM — 记住全貌,继续工作。" width="100%">
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/@haaaiawd/loom"><img src="https://img.shields.io/npm/v/%40haaaiawd%2Floom?style=flat-square&amp;color=4169E1&amp;label=npm" alt="npm 版本"></a>
9
+ <img src="https://img.shields.io/badge/node-%E2%89%A518-17212B?style=flat-square" alt="Node.js 18 或更高版本">
10
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-9AD8C2?style=flat-square&amp;labelColor=17212B" alt="MIT 许可证"></a>
11
+ </p>
12
+
13
+ <p align="center"><strong>人只需要和 Agent 自然聊天。LOOM 在背后帮助 Agent 记住、理解,并继续工作。</strong></p>
14
+
15
+ LOOM 是为 AI Agent 准备的、隐形的项目理解与连续性基础设施。凡是能够通过代码或命令行获得实质推进的工作——软件、运维、科研流程、办公自动化、数据处理,以及高度个性化的项目——都在它的能力边界内。
16
+
17
+ 用户不需要学习一套框架,也不需要亲自操作 CLI。他只需要描述想要什么、回答真正有价值的问题、提出异议、把某些判断交给 Agent,然后看着结果逐渐成为现实。Agent 在后台使用 LOOM,让项目全貌在上下文压缩、会话切换和长期施工中保持连续。
18
+
19
+ <table>
20
+ <tr>
21
+ <td width="33%"><strong>全貌,而不是碎片</strong><br>让结果、决策、系统与未知始终彼此连接。</td>
22
+ <td width="33%"><strong>专业判断,而不是角色扮演</strong><br>编译项目专属的领域能力,而不是装饰性的专家人设。</td>
23
+ <td width="33%"><strong>证据,而不是仪式</strong><br>通过独立交接、精确完成条件与磁盘证据证明结果。</td>
24
+ </tr>
25
+ </table>
26
+
27
+ ## 整体闭环
28
+
29
+ ![LOOM 的生产闭环](docs/loom-production-loop.svg)
30
+
31
+ LOOM 有三个明确的反馈环:理解环不断收敛到项目全貌;陌生 Keeper 检查被冻结的交接内容,并返回具体缺口;可恢复的 Task 则带着实现状态与证据穿过中断继续向前。Keeper 不通过时,结果不会沦为一条大家礼貌看过、然后继续开工的警告——项目必须回到真正有问题的源文件修复,形成新的 digest,再交给另一个全新的 Keeper。
32
+
33
+ 这个闭环是自适应的。LOOM 不提供万能问卷、固定专家角色或强制阶段仪式。只要某个未知仍可能改变项目全貌,Agent 就继续澄清;当剩余不确定性已经局部且可逆,或用户在得知具体代价后明确要求跳过,Agent 才继续向前。
34
+
35
+ ## 磁盘上的项目事实
36
+
37
+ 初始化后的项目只有一条小而稳定的语义骨架:
38
+
39
+ ```text
40
+ .loom/
41
+ ├── PROJECT.md 项目全貌的简洁入口与索引
42
+ ├── DECISIONS.md 重要决策被推翻或替代时的简洁历史
43
+ ├── design/ 产品、体验、系统、契约、验证、运作或研究文档
44
+ ├── capabilities/ 每个可识别专业领域一份项目专属能力卷宗
45
+ ├── state.json 已确认事实、假设、未决问题与 Keeper 状态
46
+ ├── tasks.json 广度 Work Map 与当前活跃施工地平线
47
+ └── eval/ 可选的 Evil Eval 场景,用于检验 LOOM 自身
48
+ ```
49
+
50
+ 小项目可以只有少量设计文档,大项目也可以拥有很多。当一个重要子系统、体验、接口、契约或运作问题需要被陌生 Agent 独立理解或验证时,它就应拥有自己的文档。`PROJECT.md` 负责映射全貌,而不是慢慢长成一个千行杂物间。
51
+
52
+ ### 能力卷宗
53
+
54
+ 只有当某种专业知识会改变问题、设计选择、实现方式、风险或验证方法时,才需要建立能力卷宗。每份卷宗代表一个可被正常识别的专业领域,例如 UI/UX 设计、视觉美术、游戏化设计、心理学、安全或分布式系统。
55
+
56
+ 即使多个领域紧密耦合,也应保持彼此独立;它们的综合判断写入共同参与塑造的设计文档。分诊、排序、解析或缓存之类的任务技巧,不能伪装成整个项目的专业能力边界。
57
+
58
+ ### Work Map 与 Task
59
+
60
+ Work Map 可以有几百甚至几千行。它被存储、搜索并持续修订在磁盘上,不会被塞进每一次模型上下文。规划先获得足够广度,只有当前活跃地平线才会被编译成详细步骤。
61
+
62
+ Task 不是微型官僚流程。它是最小的、可以在中断后恢复的施工检查点,足以告诉一个陌生 Agent:
63
+
64
+ - 要产生什么可观察结果;
65
+ - 什么证据能够证明完成;
66
+ - 哪些东西绝不能被破坏;
67
+ - 当前需要读取哪些项目文档与能力卷宗;
68
+ - 之前发生了什么、现在在做什么、接下来是什么;
69
+ - 已有哪些证据,以及它们分别证明了哪一条精确完成条件。
70
+
71
+ ## Agent 快速开始
72
+
73
+ 安装 CLI:
74
+
75
+ ```bash
76
+ npm install --global @haaaiawd/loom
77
+ loom --version
78
+ ```
79
+
80
+ 开发时也可以直接从仓库安装:
81
+
82
+ ```bash
83
+ npm install --global .
84
+ loom --version
85
+ ```
86
+
87
+ 进入项目后,Agent 运行:
88
+
89
+ ```bash
90
+ loom init
91
+ loom context
92
+ ```
93
+
94
+ 当存在活跃 Task 时,`loom context` 还会恢复一段紧凑的执行协议:先把 Task 与当前工作区和版本控制状态校准,编辑前检查相关测试,根据风险和精确的 `acceptance` 条件选择证据,在重要交接点写回 `completed/current/next`,在里程碑向人类展示真实可运行的东西,最后只用可复现证据关闭 Task。它不会为了形式感强迫所有工作都写一个测试或开一个 PR。
95
+
96
+ ### 无人值守与 benchmark 运行
97
+
98
+ 当人类不可达时,LOOM 不会凭空编造一次用户对话。向上下文编译器说明人类通道不可用后,Agent 会依次检查工作区和工具、仅在任务许可时研究客观外部事实,然后记录有边界的假设并选择可逆方案;若需要不可逆、高风险或有实质成本的授权,则阻塞。网络搜索永远不能替代用户的意图、偏好或许可。
99
+
100
+ ```bash
101
+ loom context --human-channel unavailable
102
+ ```
103
+
104
+ Benchmark runner 可以通过外部 sidecar 将 LOOM 状态放在评分工作区之外;**每一条** LOOM 命令都要带同一个状态目录。Task 中的 `.loom/PROJECT.md` 等虚拟引用仍能使用,但 `init` 不会在被评分工作区写入 `.loom/` 或 `AGENTS.md`。
105
+
106
+ ```bash
107
+ loom init --state-dir /runner/run-001/loom-state
108
+ loom context --state-dir /runner/run-001/loom-state --human-channel unavailable
109
+ ```
110
+
111
+ Agent 将 `.loom/PROJECT.md`、设计文档和能力卷宗作为人类可读的项目事实维护。结构化写入通过 JSON 文件完成,让长内容可以审计,也避免 shell 引号损坏数据:
112
+
113
+ ```bash
114
+ loom record --json-file understanding-update.json
115
+ loom design add product --title "Product definition" --kind product
116
+ loom design add local-analysis --title "Local analysis system" --kind system
117
+ loom design add acceptance --title "Vertical-slice verification" --kind verification
118
+ loom capability add ui-ux-design --title "UI/UX design"
119
+ loom capability add behavioral-psychology --title "Behavioral psychology"
120
+ loom task plan --json-file initial-work-map.json
121
+ loom project ready
122
+ ```
123
+
124
+ 准备从项目成型进入实质施工时,打开一个全新的 Agent 线程,只给它一句简短指令:
125
+
126
+ ```text
127
+ Run loom keeper prompt in this project and follow it. Decide whether you can responsibly start.
128
+ ```
129
+
130
+ 如果 Keeper 返回 `needs_revision` 或 `blocked`,这些具体缺口会重新出现在 `loom context` 中。Agent 修复对应的项目、设计、能力或 Task 源文件,生成发生变化的新 digest,再打开另一个全新的 Keeper。若宿主不支持子代理,用户可以新开一个窗口并使用同一句提示词。
131
+
132
+ 一次性交接通过后,施工 Agent 正常启动并维护 Task:
133
+
134
+ ```bash
135
+ loom task next
136
+ loom task start TASK-001
137
+ loom context
138
+ loom task update TASK-001 --json-file progress.json
139
+ loom task block TASK-001 --json-file block.json
140
+ loom task reopen TASK-001
141
+ loom task reopen TASK-001 --reason "Prior completion evidence was disproven"
142
+ loom task done TASK-001 --json-file evidence.json
143
+ ```
144
+
145
+ 完成条件被刻意设计得非常明确:
146
+
147
+ ```json
148
+ {
149
+ "evidence": ["npm test: 20 passed, 0 failed"],
150
+ "acceptance_results": [
151
+ {
152
+ "criterion": "The exact acceptance criterion from the Task.",
153
+ "evidence": ["The command, artifact, or observation that proves this criterion."]
154
+ }
155
+ ]
156
+ }
157
+ ```
158
+
159
+ 运行 `loom --help` 查看全部命令,运行 `loom check` 检查结构健康度。`loom prompts` 会打印 LOOM 可能注入的全部认知消息:稳定协作核心、运行时协议、动态状态层、所有文档模板、Keeper 提示词、Eval 条件、裁判提示词,以及它们的组合顺序。详见[提示词与消息目录](docs/PROMPT_CATALOG.md)。
160
+
161
+ ## LOOM 刻意删除了什么
162
+
163
+ LOOM 2 用一个自适应理解环、可扩展的设计文档图、彼此独立的专业领域卷宗、一张 Work Map 和一个可恢复的 Task 契约,替代了 v1 中 Doctrine、Vision、Capability Graph、Impact Gate、Intent Map、Expertise Pack、Atelier、Quality Arena、逐 Intent Keeper 与 Atlas 组成的漫长链条。
164
+
165
+ 真正有价值的部分仍然保留:项目判断、外部专业能力、有作者性的选择、可观察完成、上下文隔离与证据。它们不再需要一连串独立角色和关卡才能成立。
166
+
167
+ ## 证明 LOOM 真的有用
168
+
169
+ `loom eval scaffold --json-file scenario.json` 会创建一个 Evil Eval 场景。在两个条件中,模型、工具、工作区、人类通道可用性、用户事实和预算完全相同;唯一预期差异是能否使用 LOOM。实验会重复运行、强制重置上下文、匿名并交换产物顺序,同时把仪式成本、用户负担、时间和 token 消耗与质量一起计分。详见 [EVIL_EVAL.md](EVIL_EVAL.md)。
170
+
171
+ ![LOOM Evil Eval](docs/loom-eval-loop.svg)
172
+
173
+ ## 开发
174
+
175
+ ```bash
176
+ npm test
177
+ ```
178
+
179
+ v2 测试套件(20 个端到端测试)覆盖完整闭环,包括 250 个 Task 的 Work Map、上下文选择、决策替代历史、可扩展设计文档、专业领域分离、能力编译(含 source 引用校验)、多轮 Keeper 修订(含 auto-pass)、陈旧 digest 与重复 run 拒绝、精确文件级 Task 启动、阻塞与重开(包括完成证据被推翻)、逐 acceptance 条件证据、交付物覆盖、决策记录与受影响 Task 警告,以及 Evil Eval 的控制变量。详见[完整 UX 与闭环规范](docs/UX_FLOW.md)。
180
+
181
+ ## 文档
182
+
183
+ | 文档 | 适合在什么时候阅读 |
184
+ | --- | --- |
185
+ | [系统设计](design.md) | 了解架构、存储模型、不变量与命令契约 |
186
+ | [UX 与闭环规范](docs/UX_FLOW.md) | 了解用户、Agent、LOOM、Keeper 与 Task 的全部转换 |
187
+ | [提示词与消息目录](docs/PROMPT_CATALOG.md) | 检查 LOOM 注入的所有消息及其组合方式 |
188
+ | [Evil Eval 协议](EVIL_EVAL.md) | 进行有框架与无框架的受控比较 |
189
+ | [更新记录](CHANGELOG.md) | 了解 LOOM 2 的变化 |
190
+
191
+ 两张流程图的可编辑 Draw.io 源文件与图片放在同一个 [`docs/`](docs/) 目录中。
package/SECURITY.md CHANGED
@@ -1,11 +1,11 @@
1
- # Security policy
2
-
3
- Please do not publish exploitable details in a public issue.
4
-
5
- Report a vulnerability through [GitHub private vulnerability reporting](https://github.com/Haaaiawd/loom/security/advisories/new).
6
- Include the affected version, reproduction steps, impact, and any suggested mitigation. If private reporting
7
- is unavailable, open a minimal issue asking for a private contact channel without including the vulnerability.
8
-
9
- LOOM reads and writes project-local state and may be used by Agents with broad command-line permissions.
10
- Security reports involving path traversal, unintended workspace mutation, command construction, stale Keeper
11
- authorization, or untrusted project content are especially relevant.
1
+ # Security policy
2
+
3
+ Please do not publish exploitable details in a public issue.
4
+
5
+ Report a vulnerability through [GitHub private vulnerability reporting](https://github.com/Haaaiawd/loom/security/advisories/new).
6
+ Include the affected version, reproduction steps, impact, and any suggested mitigation. If private reporting
7
+ is unavailable, open a minimal issue asking for a private contact channel without including the vulnerability.
8
+
9
+ LOOM reads and writes project-local state and may be used by Agents with broad command-line permissions.
10
+ Security reports involving path traversal, unintended workspace mutation, command construction, stale Keeper
11
+ authorization, or untrusted project content are especially relevant.
package/cli/bin/loom.js CHANGED
@@ -4,26 +4,35 @@ import { readFileSync } from 'node:fs';
4
4
  import { dirname, resolve } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import {
7
+ addDeliverable,
7
8
  blockTask,
8
9
  checkProject,
10
+ checkDeliverableCoverage,
9
11
  compileContext,
10
12
  completeTask,
13
+ confirmCapability,
14
+ configureRuntime,
11
15
  createCapability,
12
16
  createDesign,
17
+ recordDecision,
13
18
  getCapability,
19
+ getCapabilityStatus,
14
20
  getDesign,
15
21
  getKeeperPrompt,
16
22
  getTask,
17
23
  importTasks,
18
24
  initProject,
19
25
  listCapabilities,
26
+ listDeliverables,
20
27
  listDesigns,
21
28
  loadProject,
22
29
  markReady,
23
30
  recordKeeper,
24
31
  recordUnderstanding,
25
32
  reopenTask,
33
+ researchCapability,
26
34
  scaffoldEval,
35
+ synthesizeCapability,
27
36
  skipKeeper,
28
37
  startTask,
29
38
  taskSummary,
@@ -63,19 +72,46 @@ function help() {
63
72
 
64
73
  The human talks naturally to the Agent. The Agent uses these commands silently.
65
74
 
75
+ Typical flow (first pass):
76
+ 1. loom init — create .loom/ skeleton
77
+ 2. loom record — confirm facts, assumptions, open questions
78
+ 3. loom design add — write design documents for consequential systems
79
+ 4. loom capability add → research → synthesize → confirm
80
+ — build professional decision trees for fields that matter
81
+ 5. loom deliverable add — decompose the delivery surface
82
+ 6. loom task plan — write Tasks with acceptance criteria covering deliverables
83
+ 7. loom project ready — freeze a digest for Keeper review
84
+ 8. loom keeper prompt → record — fresh Agent verifies build-readiness (one-time)
85
+ 9. loom task start → done — execute one Task at a time, fill acceptance evidence
86
+ 10. loom check — verify health, coverage, and drift
87
+
88
+ When a new idea changes an existing decision:
89
+ loom decision --json-file <decision.json> — record what changed and affected tasks
90
+ then update the design document directly; loom check warns which done tasks need reopening.
91
+
66
92
  Start and resume
67
93
  loom init
68
- loom context [--task TASK-001] [--keeper]
94
+ loom context [--task TASK-001] [--keeper] [--human-channel available|unavailable]
69
95
  loom check
70
96
  loom prompts
71
97
 
72
98
  Preserve understanding
73
99
  loom record --json-file <update.json>
100
+ loom decision --json-file <decision.json>
74
101
  loom project ready
75
102
  loom design add <slug> --title <text> --kind <product|experience|system|contract|verification|operations|research>
76
103
  loom design list|get <slug>
77
104
  loom capability add <slug> --title <professional-field>
78
105
  loom capability list|get <slug>
106
+ loom capability research <slug> --field <text> (creates research/_guide.md — add .md files there)
107
+ loom capability synthesize <slug> (builds decision tree from research, validates sources)
108
+ loom capability confirm <slug> --scenario <text> (user confirms which expert scenario applies)
109
+ loom capability status <slug>
110
+
111
+ Map the delivery surface
112
+ loom deliverable add <slug> --title <text> --kind <module|feature|behavior|interface|artifact|operational|verification|other>
113
+ loom deliverable list
114
+ loom deliverable coverage
79
115
 
80
116
  Maintain the work map
81
117
  loom task plan --json-file <tasks.json>
@@ -86,6 +122,10 @@ Maintain the work map
86
122
  loom task reopen <id> [--reason <reason>]
87
123
  loom task done <id> --json-file <evidence.json>
88
124
 
125
+ Each Task should produce one verifiable unit of real work. Use acceptance[] with criterion,
126
+ verify_by, and evidence fields. Task completion fills in each acceptance condition's evidence
127
+ with the actual result (for acceptance tasks) or quotes each done_when criterion (for legacy tasks).
128
+
89
129
  One-time independent handoff
90
130
  loom keeper prompt
91
131
  loom keeper record --json-file <result.json>
@@ -94,11 +134,18 @@ One-time independent handoff
94
134
  Evaluate LOOM itself
95
135
  loom eval scaffold --json-file <scenario.json>
96
136
 
137
+ Use \`--state-dir <outside-workspace-dir>\` on every command to keep LOOM state in an isolated sidecar
138
+ (for example, a benchmark runner's per-run state directory). Sidecar initialization never edits AGENTS.md.
139
+
97
140
  Use JSON files for structured writes so long content and shell quoting remain auditable.
98
- Task completion JSON includes evidence plus one check for every exact done_when criterion.`;
141
+ Task completion JSON includes evidence plus either acceptance_results[] (one per acceptance criterion,
142
+ each with concrete evidence) or checks[] (one per done_when criterion, for legacy tasks).`;
99
143
  }
100
144
 
101
145
  try {
146
+ configureRuntime({ stateDir: option('--state-dir') });
147
+ const humanChannel = option('--human-channel');
148
+ if (humanChannel && !['available', 'unavailable'].includes(humanChannel)) throw new Error('--human-channel must be available or unavailable');
102
149
  switch (command) {
103
150
  case '--version':
104
151
  case '-v': {
@@ -117,7 +164,7 @@ try {
117
164
  break;
118
165
  case 'context':
119
166
  case 'resume':
120
- output(compileContext({ taskId: option('--task'), keeper: argv.includes('--keeper') }));
167
+ output(compileContext({ taskId: option('--task'), keeper: argv.includes('--keeper'), humanChannel: humanChannel || 'available' }));
121
168
  break;
122
169
  case 'prompts':
123
170
  output(promptCatalog());
@@ -125,6 +172,9 @@ try {
125
172
  case 'record':
126
173
  output(recordUnderstanding(jsonFile()));
127
174
  break;
175
+ case 'decision':
176
+ output(recordDecision(jsonFile()));
177
+ break;
128
178
  case 'check': {
129
179
  const result = checkProject();
130
180
  output(result);
@@ -159,7 +209,31 @@ try {
159
209
  else if (subcommand === 'get') {
160
210
  if (!rest[0]) throw new Error('Usage: loom capability get <slug>');
161
211
  output(getCapability(rest[0]));
162
- } else throw new Error('Usage: loom capability add|list|get');
212
+ } else if (subcommand === 'research') {
213
+ if (!rest[0]) throw new Error('Usage: loom capability research <slug> --field <text>');
214
+ output(researchCapability(rest[0], { field: option('--field') }));
215
+ } else if (subcommand === 'synthesize') {
216
+ if (!rest[0]) throw new Error('Usage: loom capability synthesize <slug>');
217
+ output(synthesizeCapability(rest[0]));
218
+ } else if (subcommand === 'confirm') {
219
+ if (!rest[0]) throw new Error('Usage: loom capability confirm <slug> --scenario <text>');
220
+ output(confirmCapability(rest[0], { scenario: option('--scenario') }));
221
+ } else if (subcommand === 'status') {
222
+ if (!rest[0]) throw new Error('Usage: loom capability status <slug>');
223
+ output(getCapabilityStatus(rest[0]));
224
+ } else throw new Error('Usage: loom capability add|list|get|research|synthesize|confirm|status');
225
+ break;
226
+ }
227
+ case 'deliverable': {
228
+ if (subcommand === 'add') {
229
+ const slug = rest[0];
230
+ const title = option('--title');
231
+ const kind = option('--kind');
232
+ if (!slug) throw new Error('Usage: loom deliverable add <slug> --title <text> --kind <module|feature|behavior|interface|artifact|operational|verification|other>');
233
+ output(addDeliverable(slug, { title, kind, notes: option('--notes') }));
234
+ } else if (subcommand === 'list') output(listDeliverables());
235
+ else if (subcommand === 'coverage') output(checkDeliverableCoverage());
236
+ else throw new Error('Usage: loom deliverable add|list|coverage');
163
237
  break;
164
238
  }
165
239
  case 'task': {