@haaaiawd/loom 1.3.1 → 2.0.1

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 (84) hide show
  1. package/CHANGELOG.md +16 -86
  2. package/CONTRIBUTING.md +37 -0
  3. package/EVIL_EVAL.md +112 -0
  4. package/README.md +156 -403
  5. package/README.zh-CN.md +176 -0
  6. package/SECURITY.md +11 -0
  7. package/cli/bin/loom.js +171 -998
  8. package/cli/src/protocol.js +411 -0
  9. package/cli/src/store.js +628 -0
  10. package/design.md +201 -0
  11. package/docs/PROMPT_CATALOG.md +106 -0
  12. package/docs/RELEASE_CHECKLIST.md +53 -0
  13. package/docs/UX_FLOW.md +171 -0
  14. package/docs/brand/loom-mark.svg +18 -0
  15. package/docs/brand/loom-readme-header.svg +34 -0
  16. package/docs/brand/loom-readme-header.zh-CN.svg +29 -0
  17. package/docs/loom-eval-loop.drawio +21 -0
  18. package/docs/loom-eval-loop.svg +56 -0
  19. package/docs/loom-production-loop.drawio +41 -0
  20. package/docs/loom-production-loop.svg +92 -0
  21. package/package.json +27 -24
  22. package/EXTERNAL_ACQUISITION_DESIGN.md +0 -143
  23. package/cli/help/asset.md +0 -36
  24. package/cli/help/atelier.md +0 -37
  25. package/cli/help/atlas.md +0 -48
  26. package/cli/help/capability.md +0 -118
  27. package/cli/help/concepts.md +0 -105
  28. package/cli/help/doctor.md +0 -80
  29. package/cli/help/expertise.md +0 -52
  30. package/cli/help/loop.md +0 -134
  31. package/cli/help/patch.md +0 -33
  32. package/cli/help/proposals.md +0 -21
  33. package/cli/help/version.md +0 -136
  34. package/cli/help/workflow.md +0 -116
  35. package/cli/src/activate.js +0 -505
  36. package/cli/src/asset-library.js +0 -384
  37. package/cli/src/atelier.js +0 -331
  38. package/cli/src/atlas.js +0 -282
  39. package/cli/src/auto.js +0 -116
  40. package/cli/src/capability-graph.js +0 -724
  41. package/cli/src/capability-proposals.js +0 -225
  42. package/cli/src/diagnostics.js +0 -859
  43. package/cli/src/expertise-pack.js +0 -336
  44. package/cli/src/guide.js +0 -548
  45. package/cli/src/help.js +0 -41
  46. package/cli/src/init.js +0 -187
  47. package/cli/src/intent-draft.js +0 -303
  48. package/cli/src/intent-map.js +0 -747
  49. package/cli/src/patch.js +0 -214
  50. package/cli/src/philosophy.js +0 -331
  51. package/cli/src/shared/intent-ref.js +0 -38
  52. package/cli/src/shared/md-utils.js +0 -125
  53. package/cli/src/shared/paths.js +0 -73
  54. package/cli/src/shared/proof-reference.js +0 -19
  55. package/cli/src/shared/verification-method.js +0 -32
  56. package/cli/src/verify.js +0 -394
  57. package/cli/src/version.js +0 -134
  58. package/dimensions/AUTHORSHIP.md +0 -45
  59. package/dimensions/PART_DECOMPOSITION.md +0 -42
  60. package/dimensions/SEARCH_METHODOLOGY.md +0 -101
  61. package/dimensions/examples/AGENT_SYSTEM/README.md +0 -219
  62. package/dimensions/examples/CLI_TOOL/README.md +0 -163
  63. package/dimensions/universal/COLLABORATION_PHILOSOPHY.md +0 -28
  64. package/dimensions/universal/ENGINEERING_CREED.md +0 -30
  65. package/dimensions/universal/PRODUCT_PHILOSOPHY.md +0 -32
  66. package/meta/BASELINE.md +0 -91
  67. package/meta/INTENT_LOOP.md +0 -296
  68. package/meta/PHILOSOPHY_WEAVER.md +0 -110
  69. package/meta/ROLE_ACTIVATION.md +0 -114
  70. package/roles/architect.md +0 -92
  71. package/roles/forge.md +0 -110
  72. package/roles/impact-reviewer.md +0 -37
  73. package/roles/keeper.md +0 -113
  74. package/roles/visionary.md +0 -57
  75. package/templates/ASSET_LIBRARY_MANIFEST_TEMPLATE.json +0 -10
  76. package/templates/ATELIER_RECORD_TEMPLATE.json +0 -48
  77. package/templates/ATLAS_TEMPLATE.html +0 -104
  78. package/templates/CAPABILITY_BRIEF_TEMPLATE.md +0 -36
  79. package/templates/CAPABILITY_GRAPH_EXAMPLE.json +0 -188
  80. package/templates/CAPABILITY_GRAPH_TEMPLATE.json +0 -78
  81. package/templates/EXPERTISE_PACK_TEMPLATE.json +0 -22
  82. package/templates/INTENT_MAP_TEMPLATE.json +0 -85
  83. package/templates/PHILOSOPHY_TEMPLATE.md +0 -44
  84. package/templates/VISION_TEMPLATE.md +0 -44
package/CHANGELOG.md CHANGED
@@ -1,88 +1,18 @@
1
1
  # Changelog
2
2
 
3
- ## 1.3.1 — 2026-08-01
4
-
5
- ### Fixed
6
-
7
- - Capability Graph 1.3 新增前置 **Impact Gate**:每个具体 capability 都必须说明影响的用户结果、错判代价、外部知识是否会改变决定与理由。若代价不可逆或外部知识会改变设计/验证,CLI 强制标为 high,并只允许 `external_required`,防止 Agent 通过写成 medium/low 或 `adaptive` 跳过检索。
8
- - Architect 初判后必须让新的 Agent thread / 子代理通过 `loom activate impact-reviewer` 独立逐项审查;high capability 必须至少占具体 capability 的 30%(向上取整,至少一个),防止整张图谱被大量普通节点稀释。
9
- - `guide` 与 `doctor` 会将缺失或试图绕过 Impact Gate 的图谱明确指回 Architect,而非让其继续进入 Intent 阶段。
10
- - Coverage 现在区分“已设计可观察验证入口”与“已完成 Intent 的证据产物已落盘”:规划阶段不再被要求伪造 artifact,完成后缺文件仍是高优先级缺口。
11
-
12
- ### Compatibility
13
-
14
- - Graph 1.0–1.2 保持可读;新建模板使用 1.3。迁移既有图谱时应由 Architect Impact Gate,不由 Forge 静默改写。
15
-
16
- ## 1.3.0 2026-08-01
17
-
18
- ### Added
19
-
20
- - Capability Graph 1.2 引入 `lens_contract` 与 `capability_domains`:Architect 必须审视用户旅程、交互与可访问性、视觉与信息表达、内容与沟通、系统与数据、横切质量与风险;再按项目事实声明 UI/UX、3D 光影、网络安全、心理学、生物学等会改变方案或验证方法的专业领域。两者都必须回链具体 Graph 节点。
21
- - `loom capability graph`、coverage 与 Forge/Keeper Context Pack 现在暴露与当前 Intent 相关的透镜和专业领域,避免图谱只在磁盘上存在。
22
- - 新增 `templates/CAPABILITY_GRAPH_EXAMPLE.json`,展示共享 capability、横切 risk/evidence 与 Lens Contract,而非把 Intent 一一镜像成能力节点。
23
- - `loom atlas` 取代并移除 Preview:CLI 先编译当前版本的架构与决策资料模型,再以 command-assembled Composer Pack 生成必交付的 `loom-atlas.html`。Atlas 固定呈现原则、结构、能力图谱、关键决策与审查入口,不承载项目进度或验证历史。
24
- - Intent 全部闭合后,`guide` 与 `doctor` 将缺少、过期或结构不完整的 Atlas 视为高优先级交付缺口。
25
-
26
- ### Compatibility
27
-
28
- - 既有 Graph 1.0/1.1 保持可读;新 Graph 1.2 缺失 Lens Contract 或 Capability Domain Contract 时,coverage/doctor 会明确阻断并引导 Architect 补全。既有项目迁移应先走 Capability Graph Proposal,不由 Forge 静默改写。
29
- - `loom preview` 及 `loom-preview.html` 不再是 LOOM 功能或合格交付物;迁移到 `loom atlas --regen`。
30
-
31
- ## 1.2.2 — 2026-07-31
32
-
33
- ### Fixed
34
-
35
- - `guide` 只输出下一步命令、Context Pack 提示与完成校验,不再展示文件输入/输出清单;当下一步是角色激活时,由该命令装配 Context Pack。
36
- - `activate weaver` 直接注入检索方法与哲学维度目录;`activate architect` 在无 Intent 的设计阶段直接注入愿景、当前 Capability Graph、Intent Map 与未闭合 proposal。
37
- - Capability Graph 未闭合或 proposal 待裁决时,`guide` 重新指向可推进工作的 Architect Context Pack,而不是重复运行只读检查。
38
- - `loom intent next` 返回开始该 Intent 和获取 Forge Context Pack 的明确后续命令。
39
-
40
- ## 1.2.1 — 2026-07-31
41
-
42
- ### Fixed
43
-
44
- - `verify pass` 现在要求声明独立 Keeper 或人类复核来源,并将该来源写入验证记录;普通自检不能再被快捷命令包装成 `passed`。
45
- - 高影响 capability 若选择 `adaptive`,必须留下为何不启用外部获取强门的理由;无理由的 `adaptive` 不再是静默绕过路径。
46
- - Intent 模板不再默认引用不存在的质量契约章节,并增加叙事语义守恒与反例验证的提示。
47
-
48
- ### Compatibility
49
-
50
- - 旧版结构化验证记录仍可读取;新的 passed 记录(包括 `verify write`)必须声明验证来源。旧记录可供历史追溯,但不自动获得独立验证声明。
51
-
52
- ## 1.2.0 — 2026-07-31
53
-
54
- ### Added
55
-
56
- - External Acquisition Gate:Capability Graph 只声明 `acquisition_mode`,Forge 按当前
57
- Intent 信号派生 Search Plan,并实际通过 Skill registry、网络、官方文档或研究资料获取信息。
58
- - revision-scoped Expertise Pack 与 `loom expertise init|get|validate`,以来源、检索证据和
59
- Capability Capsules 形成类似 Skill 的项目化核心信息组,但不复制或内置第三方内容。
60
- - `guide`、Forge/Keeper activation、`verify pass`、`intent done` 与 `doctor` 的外部能力
61
- 获取强门;passed 记录绑定当前 Pack 内容摘要,Keeper 必须独立重开关键来源。
62
-
63
- ### Compatibility
64
-
65
- - 中低影响 capability 默认为 `adaptive`;高影响 capability 未显式豁免时,以及任意 capability
66
- 显式声明 `external_required` 时启用持久化强门。
67
- - `project_only` 保留内部协议与机械任务路径,但必须说明 `acquisition_rationale`。
68
-
69
- ## 1.1.0 — 2026-07-30
70
-
71
- ### Added
72
-
73
- - Capability Graph、Capability Brief 与 coverage/compile 命令,将项目问题面、能力缺口、
74
- 风险和证据显式回链到 Intent。
75
- - provenance-backed Capability Graph Proposal 工作流,由 Architect 裁决新发现对 Graph、
76
- Intent、acceptance 或版本边界的影响。
77
- - 版本化 Asset Library,校验来源、作者、许可、本地哈希、批准状态与 evidence 双向引用。
78
- - Authorship System:第五种认知职能 Author、Identity Compiler、可选 Atelier Path,以及
79
- `loom atelier init|get|validate`。
80
- - Atelier Record 的 `intent_revision`、`stance_revision`、候选、修正、基线与选择证据校验。
81
- - Keeper/Quality Proof 的 Atelier 闭合门;`doctor`、`guide` 与 `intent done` 可识别缺失、
82
- 过期或未绑定的创作证据。
83
-
84
- ### Compatibility
85
-
86
- - 旧 Intent 缺少 `quality_strategy` 时等价于 `adaptive`,不会创建 Atelier Record。
87
- - Atelier 是按需深路径,不增加角色、Intent 状态或验证维度。
88
- - 旧项目缺少 Capability Graph 时保留兼容诊断,可在后续架构修订中迁移。
3
+ ## 2.0.1
4
+
5
+ - Added an active-Task execution protocol that restores workspace-aware coding guidance, risk-based testing, restartable progress, criterion-level proof, and conditional commit/PR boundaries after context resets.
6
+ - Strengthened the generated `AGENTS.md` anchor so Agents reload LOOM at project entry, after context loss, and before resumed editing without invoking it before every tool call.
7
+
8
+ ## 2.0.0
9
+
10
+ - Rebuilt LOOM as invisible Agent infrastructure around project understanding, a scalable design-document graph, separate professional-field dossiers, a broad Work Map, and one active Task.
11
+ - Replaced fixed roles and stages with an adaptive clarification protocol and explicit convergence conditions.
12
+ - Added human-editable project truth, structured continuity state, and superseding decision history.
13
+ - Added context selection that keeps very large Task maps on disk and injects only the active horizon.
14
+ - Added seven adaptable design-document templates and `loom prompts` as a complete live prompt inventory.
15
+ - Reduced Keeper to one independent build-readiness handoff with revision, changed-digest, fresh-run, and stale-state enforcement.
16
+ - Added controlled Evil Eval scaffolding for equal-condition, repeated, reset-heavy blind comparison.
17
+ - Added bilingual English/Chinese release documentation and a flat, minimal visual system with editable loop diagrams.
18
+ - Deliberately stopped automatic mutation of legacy `.loom/v1` projects.
@@ -0,0 +1,37 @@
1
+ # Contributing to LOOM
2
+
3
+ LOOM should become simpler when it changes. A contribution is strongest when it preserves the natural
4
+ human–Agent conversation, keeps project truth inspectable on disk, and proves its effect without adding
5
+ another ritual.
6
+
7
+ ## Before changing code
8
+
9
+ 1. Read [the system design](design.md) and [the UX loop](docs/UX_FLOW.md).
10
+ 2. Run the current suite and CLI locally:
11
+
12
+ ```bash
13
+ npm test
14
+ node cli/bin/loom.js --help
15
+ node cli/bin/loom.js prompts
16
+ ```
17
+
18
+ 3. Keep a change inside one observable problem. If a contract or stored shape changes, update its design,
19
+ prompt, help text, and tests together.
20
+
21
+ ## Pull requests
22
+
23
+ A useful pull request explains:
24
+
25
+ - the user or Agent failure it fixes;
26
+ - the smallest complete change that fixes it;
27
+ - the exact command or artifact that proves the result;
28
+ - any compatibility, migration, or unverified boundary.
29
+
30
+ Prompt changes must remain visible through `loom prompts` and be reflected in
31
+ [`docs/PROMPT_CATALOG.md`](docs/PROMPT_CATALOG.md). Changes that claim better quality need a baseline-relative
32
+ proof; a nicer-looking output alone is not evidence that LOOM caused the improvement.
33
+
34
+ ## Release checks
35
+
36
+ Run `npm test` and `npm pack --dry-run` before requesting release. See the
37
+ [release checklist](docs/RELEASE_CHECKLIST.md) for the maintainer flow.
package/EVIL_EVAL.md ADDED
@@ -0,0 +1,112 @@
1
+ # Evil Eval
2
+
3
+ Evil Eval asks a hostile question: does LOOM improve real Agent work, or does it merely generate more process
4
+ that resembles rigor?
5
+
6
+ ## Core comparison
7
+
8
+ Each scenario runs two conditions:
9
+
10
+ - Baseline: a normal capable Agent receives the raw brief and all ordinary tools, but no LOOM.
11
+ - LOOM: the same model receives the same raw brief, workspace, tools, user answers, and budget, with LOOM available.
12
+
13
+ The baseline is not weakened. It may inspect files, browse, ask questions, plan, use memory supplied by the host,
14
+ and create any artifacts it normally would. The intended experimental variable is LOOM's protocol and persistent
15
+ state, not permission, information, or model quality.
16
+
17
+ This is the primary causal comparison: **no framework versus LOOM 2**. LOOM 1 may be added as a third regression
18
+ condition when we want to know whether the redesign improved on its ancestor, but it cannot replace the no-framework
19
+ baseline and does not answer whether LOOM itself adds value.
20
+
21
+ ## Scenario shape
22
+
23
+ A scenario records:
24
+
25
+ - the identical raw brief;
26
+ - workspace setup and immutable snapshot;
27
+ - hidden user facts and a deterministic answer script;
28
+ - success criteria that judges can observe;
29
+ - context-reset points;
30
+ - equal token, time, and tool budgets;
31
+ - at least three repetitions per condition.
32
+
33
+ High-signal scenarios include ambiguous greenfield work, changes to an existing project, multidisciplinary
34
+ personalized products, operational command work, and a mid-project user correction that supersedes an earlier
35
+ decision.
36
+
37
+ ## The evil parts
38
+
39
+ 1. Force a context reset after clarification and again mid-Task.
40
+ 2. Include one attractive but wrong implementation assumption.
41
+ 3. Include a professional domain where generic advice is plausible but harmful.
42
+ 4. Change one consequential user answer after the first plan is formed.
43
+ 5. Give both conditions equal access to discoverable repository facts.
44
+ 6. Penalize unnecessary questions, ceremony, document volume, time, and token cost.
45
+ 7. Require an implementation attempt or operational transcript; documents alone cannot win.
46
+
47
+ ## Measures
48
+
49
+ Every score cites observable evidence:
50
+
51
+ | Measure | What it asks |
52
+ |---|---|
53
+ | Intent fidelity | Did the result solve the user's actual problem without unauthorized expansion? |
54
+ | Question value | Did questions change decisions, and did the Agent avoid asking discoverable facts? |
55
+ | Whole-project coverage | Were important behaviors, boundaries, dependencies, and failure paths understood? |
56
+ | Capability depth | Did specialist knowledge produce a distinctive project decision rather than a summary? |
57
+ | Buildability | Could a fresh Agent select and begin the right work without guessing? |
58
+ | Reset continuity | What important truth survived forced context loss? |
59
+ | User burden | How much unnecessary explanation, questioning, and framework operation reached the human? |
60
+ | Cost and time | Was any quality gain worth its added tokens, latency, and artifacts? |
61
+
62
+ ## Blinding and repetition
63
+
64
+ Runs are anonymized. A fresh judge receives A and B in randomized order without framework names. The judge scores
65
+ both, then receives the order swapped and judges again. Order-sensitive conclusions are marked unstable. Each
66
+ condition runs at least three times because a single model trajectory cannot distinguish a system effect from luck.
67
+
68
+ Anonymization may replace condition labels and framework metadata, but it must preserve each runnable artifact's
69
+ internal directory names and relative paths. Before the judge sees a packet, the harness records a source digest/file
70
+ manifest and reruns the condition's declared tests and smoke commands from the anonymized location. A missing file or
71
+ path failure introduced by copying is a harness failure, not a condition failure; repair the packet and rerun the judge
72
+ while preserving the erroneous first judgment as audit evidence.
73
+
74
+ Human judgment should be used for product taste or domain harm when an automated judge cannot observe it. An LLM
75
+ judge may organize evidence but does not become ground truth by being verbose.
76
+
77
+ ## Ablations
78
+
79
+ If full LOOM wins, run smaller comparisons to find the causal mechanism:
80
+
81
+ - Task persistence only;
82
+ - project whole plus Task persistence;
83
+ - capability dossiers without the clarification protocol;
84
+ - full LOOM without forced resets.
85
+
86
+ LOOM should keep only mechanisms whose benefit survives ablation. If the same result comes from a smaller subset,
87
+ delete the rest.
88
+
89
+ ## CLI scaffold
90
+
91
+ Create a scenario description:
92
+
93
+ ```json
94
+ {
95
+ "id": "EVAL-001",
96
+ "title": "Ambiguous multidisciplinary build",
97
+ "brief": "Build a calming recovery tool from this repository.",
98
+ "hidden_user_facts": ["The user must retain manual control."],
99
+ "success_criteria": ["A fresh Agent resumes correctly after a forced reset."],
100
+ "context_reset_points": ["after-shaping", "mid-task"],
101
+ "repetitions": 3
102
+ }
103
+ ```
104
+
105
+ Then run:
106
+
107
+ ```bash
108
+ loom eval scaffold --json-file scenario.json
109
+ ```
110
+
111
+ LOOM writes a manifest, equalized condition prompts, and a blind judge prompt under `.loom/eval/<scenario>/`.
112
+ Launching isolated Agents remains host-specific; do not claim the evaluation ran merely because the scaffold exists.