@haaaiawd/loom 2.1.1 → 2.1.3

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/design.md CHANGED
@@ -75,8 +75,12 @@ Cross-field synthesis lives in the design document whose decision it changes. A
75
75
  - generic failure modes and observable verification signals;
76
76
  - opened sources, what each changed, conflicts, and uncertainty when research is used.
77
77
 
78
- Acquisition can happen quietly. The Agent may briefly name the capability it is obtaining, but does not
79
- turn research logistics into user workflow.
78
+ Acquisition can happen quietly. The Agent may briefly name the capability it is obtaining, but does not
79
+ turn research logistics into user workflow.
80
+
81
+ Scenario authority is explicit. `capability confirm --source human` records a confirmed scenario;
82
+ `--source agent` records a provisional, reversible selection when the human is unavailable. Context and
83
+ health checks preserve that distinction instead of allowing an Agent assumption to masquerade as user confirmation.
80
84
 
81
85
  ### Work Map and Task
82
86
 
@@ -94,8 +98,10 @@ Task is the single execution contract:
94
98
  "done_when": ["A forced-reset transcript resumes correctly"],
95
99
  "boundaries": ["The human never operates LOOM"],
96
100
  "depends_on": [],
97
- "reads": [".loom/PROJECT.md", ".loom/design/context-system.md", ".loom/capabilities/human-agent-interaction.md", "fixtures/reset-case.md"],
98
- "touches": ["cli/src/context.js"],
101
+ "reads": [".loom/PROJECT.md", ".loom/design/context-system.md", ".loom/capabilities/human-agent-interaction.md", "fixtures/reset-case.md"],
102
+ "touches": ["cli/src/context.js"],
103
+ "implements": ".loom/design/context-system.md#Context selection",
104
+ "capability_hooks": [{ "node": "human-agent-interaction#C1", "at": "selecting reset context" }],
99
105
  "status": "active",
100
106
  "progress": {
101
107
  "completed": [],
@@ -106,17 +112,23 @@ Task is the single execution contract:
106
112
  }
107
113
  ```
108
114
 
109
- There is at most one active Task. Completion requires a concrete evidence mapping for every exact `done_when`
110
- criterion. A completed Task can be reopened with a reason when later evidence disproves it. The Task plan may change without
111
- human approval when the change is a reversible implementation refinement inside the agreed whole; outcome,
112
- authority, risk, or material cost changes return to the conversation.
115
+ There is at most one active Task. Completion requires a concrete evidence mapping for every exact `done_when`
116
+ criterion. A completed Task can be reopened with a reason when later evidence disproves it. The Task plan may change without
117
+ human approval when the change is a reversible implementation refinement inside the agreed whole; outcome,
118
+ authority, risk, or material cost changes return to the conversation.
119
+
120
+ New Tasks must make design and capability applicability explicit: use `implements` and `capability_hooks`, or
121
+ record a concrete `design_exemption` / `capability_exemption`. Task start rejects an unclassified active horizon.
122
+ Completion verifies that every declared local `touches` path exists, and `loom check` detects later filesystem drift.
113
123
 
114
124
  ### One-time Keeper
115
125
 
116
126
  Keeper is not a recurring role. It is a single isolation test at the transition from shaping to material
117
127
  execution. A fresh Agent receives no prior conversation, runs `loom context --keeper`, explains the whole,
118
128
  selects a first Task, navigates its design documents and professional capabilities, and identifies concrete evidence. Every attempt binds a unique
119
- fresh-thread `run_id` to the digest frozen by `project ready`. It may return gaps; summary, evidence and exact gaps
129
+ fresh-thread `run_id` to the digest frozen by `project ready`. A passing record also carries an explicit independent
130
+ review attestation (`review.mode`, reviewer identity, and isolation evidence); known self-review cannot be recorded as
131
+ passed. This is an auditable host assertion, not cryptographic identity proof. It may return gaps; summary, evidence and exact gaps
120
132
  are injected into the main Agent's next context. Revision must change project truth or Task definitions before a
121
133
  new digest and fresh Keeper run are allowed. Once passed, normal Task evidence replaces further Keeper ceremony.
122
134
 
@@ -157,11 +169,12 @@ ready_for_keeper ⇄ fresh Keeper needs_revision or blocked → shaping
157
169
  build_ready → building ⇄ Task repair or block or reopen → complete
158
170
  ```
159
171
 
160
- `project ready` checks only structural prerequisites: PROJECT.md is no longer a template, at least one design
161
- document and a Work Map exist, and no high-impact open question remains. Keeper judges semantic build-readiness. Task start requires Keeper
162
- pass or an explicit recorded skip. An unchanged revision, duplicate Keeper run, wrong digest, or stale prepared
163
- state is rejected. Imported Tasks start open, `task start` rejects missing or directory-level context reads,
164
- generic updates cannot change status, and completion requires criterion-by-criterion evidence.
172
+ `project ready` checks only structural prerequisites: PROJECT.md is no longer a template, at least one design
173
+ document and a Work Map exist, and no high-impact open question remains. Keeper judges semantic build-readiness. Task start requires Keeper
174
+ pass or an explicit recorded skip. An unchanged revision, duplicate Keeper run, wrong digest, or stale prepared
175
+ state is rejected. Imported Tasks start open, `task start` rejects missing or directory-level context reads and
176
+ unclassified design/capability applicability, generic updates cannot change status, and completion requires
177
+ criterion-by-criterion evidence plus existence of every declared local output.
165
178
 
166
179
  ## Context selection
167
180
 
@@ -209,7 +222,8 @@ an automated semantic migration can be designed only after real v1 projects reve
209
222
 
210
223
  - External capability acquisition is represented but not automated yet; the host Agent performs research.
211
224
  - Markdown is intentionally human-editable. LOOM validates file existence and structured state, not prose truth.
212
- - Keeper independence depends on the host creating a fresh thread or window.
225
+ - Keeper independence depends on the host creating a fresh thread or window. LOOM requires and records the
226
+ host's independent-review attestation but cannot cryptographically prove Agent identity.
213
227
  - Evil Eval scaffolding controls experiment design but does not itself launch model runs.
214
228
  - A one-time Keeper verifies build-readiness, not the eventual quality of every implementation Task.
215
229
 
@@ -1,116 +1,139 @@
1
- # LOOM Prompt and Message Catalog
2
-
3
- LOOM's prompts are cognitive interfaces, not a collection of role-playing personas. The exact live
4
- inventory is emitted by:
5
-
6
- ```bash
7
- loom prompts
8
- ```
9
-
10
- The command is the auditable source of truth. It returns the complete text, placeholders, and composition
11
- order as JSON, so documentation cannot quietly describe a different prompt from the one Agents receive.
12
-
13
- ## Instruction layers
14
-
15
- | Layer | Message | Injected when | Purpose |
16
- |---|---|---|---|
17
- | Stable core | `layers.stable_core` | Every `loom context` | Durable collaboration judgment: user ownership, evidence classes, question threshold, corrections, reversible delegation |
18
- | Environment adaptation | `layers.environment_adaptation_available` or `layers.environment_adaptation_unavailable` | Every `loom context` | States whether a human can answer; routes uncertainty through inspection, permitted factual research, clarification, bounded assumption, or block |
19
- | Runtime adaptation | `layers.runtime_protocol` | Every `loom context` | LOOM-specific disk model, document graph, capability boundaries, Work Map, and three production loops |
20
- | Project state | `layers.project_state` | Every `loom context` | Dynamic status, uncertainty, assumptions, document/capability inventory, Task counts, and Keeper feedback |
21
- | Execution protocol | `layers.execution_protocol` | Active Task or `--task` | Recovery, workspace inspection, risk-based testing, progress persistence, exact proof, and delivery boundaries |
22
- | Current task | `layers.current_task` | Active Task or `--task` | Exact Task JSON followed by the exact contents of every path in `reads` |
23
-
24
- This separation is deliberate. Project-specific expertise does not inflate the stable prompt; it lives in
25
- field dossiers. One-off Task instructions do not become global doctrine. Host permissions and tools are not
26
- claimed by prompt text.
27
-
28
- When the human channel is unavailable, the environment message explicitly forbids fabricated user interaction and
29
- forbids treating web research as a substitute for user intent, preference, or authority. It preserves factual
30
- research when the task and host actually permit it, then requires a reversible assumption or block for what cannot
31
- be learned.
32
-
33
- ## Workspace and document messages
34
-
35
- `workspace_anchor` is the short block added to `AGENTS.md`. It tells an entering or reset Agent to run
36
- `loom context`, rerun it before editing after an interruption, persist state at meaningful boundaries rather
37
- than before every tool call, and keep CLI operation invisible to the human.
38
-
39
- `templates.project_index` creates `.loom/PROJECT.md` as a concise whole and document map. It explicitly
40
- prevents a large project's systems from being compressed into one file.
41
-
42
- `templates.design_documents` contains all seven live design templates:
43
-
44
- 1. `product` — outcome, users, problem, product principles, scope, end-to-end behavior, success and failure.
45
- 2. `experience` — journey, information architecture, states, content, visual direction, accessibility, recovery, usability proof.
46
- 3. `system` — responsibilities, boundaries, control flow, data, interfaces, dependencies, failure, implementation, verification.
47
- 4. `contract` — consumers, schemas or commands, invariants, permissions, errors, compatibility, fixtures, contract tests.
48
- 5. `verification` — claims, environments, fixtures, acceptance matrix, commands, negative tests, blind spots.
49
- 6. `operations` — authority, procedures, commands, safety, failure recovery, evidence and audit trail.
50
- 7. `research` — decision, evidence, method, sources, findings, conflicts, consequences and follow-up proof.
51
-
52
- These are possible document kinds, not a fixed seven-file checklist. The Agent creates as many actual
53
- documents as the project's independent decision surfaces require.
54
-
55
- `templates.professional_capability` is the only capability template. It enforces one recognizable field per
56
- file, a project-specific diagnosis and stance, opened evidence, rejected generic defaults, concrete design and
57
- verification consequences, failure modes, and links to adjacent fields without merging them.
58
-
59
- `templates.decision_history` is the preamble for consequential superseding decisions. Current truth stays in
60
- the project map and linked design documents.
61
-
62
- ## Keeper message
63
-
64
- `keeper` is the exact independent handoff prompt. It binds a unique fresh-Agent `run_id` to a frozen
65
- `prepared_digest`, asks the Keeper to navigate the whole corpus and attempt the first Task, and defines three
66
- verdicts:
67
-
68
- - `passed`: a fresh Agent can responsibly begin.
69
- - `needs_revision`: concrete disk-truth gaps can be repaired.
70
- - `blocked`: progress needs unavailable authority or external state.
71
-
72
- A failed result is injected into the next project-state message. A retry requires changed project truth, a
73
- new digest, and another fresh Keeper.
74
-
75
- ## Evil Eval messages
76
-
77
- `evaluation.baseline_condition` gives a normal capable Agent the identical brief and ordinary tools without
78
- LOOM. It does not weaken the baseline or prohibit normal planning.
79
-
80
- `evaluation.loom_condition` gives the same brief, model class, tools, workspace facts, and budget, adding only
81
- LOOM continuity infrastructure and no extra authority.
82
-
83
- `evaluation.unattended_baseline_condition` and `evaluation.unattended_loom_condition` are the same two
84
- conditions when no user response channel exists. The environment fact is equal in both arms; only the LOOM arm
85
- uses `loom context --human-channel unavailable`.
86
-
87
- `evaluation.blind_judge` scores anonymized output on intent fidelity, question value, whole coverage,
88
- professional depth, buildability, reset continuity, implementation evidence, human burden, and cost. It
89
- penalizes ceremony and runs an order swap.
90
-
91
- ## Composition messages
92
-
93
- `composition.normal_resume`, `composition.active_task`, and `composition.keeper_handoff` list the exact block
94
- order. Keeper receives every design and capability document; a normal active Task receives only its declared
95
- reads. This difference is intentional: Keeper audits whole-project coverage, while delivery protects context
96
- focus.
97
-
98
- The active Task composition adds `execution_protocol` between the recovered project whole and the exact Task.
99
- It requires inspection of current workspace/version-control reality, risk-appropriate tests, restartable
100
- progress, and criterion-level proof. It does not force a unit test for non-code claims or a branch/PR for every
101
- Task; those are selected when the behavior, human request, or repository workflow makes them meaningful.
102
-
103
- ## CLI operational messages
104
-
105
- `loom --help` is the complete command-oriented message surface. JSON command results report state and the next
106
- host action. Validation errors are contract enforcement rather than cognitive prompts; they reject unsafe
107
- references, template-only readiness, missing design documents, open high-impact uncertainty, unchanged Keeper
108
- retries, stale digests, duplicate run identities, Task dependency violations, missing or directory-level Task
109
- reads, status bypasses, completion without evidence for every done condition, and reasonless reopening of a
110
- disproven completion.
111
-
112
- The short human fallback when the host cannot create a Keeper Agent remains:
113
-
114
- ```text
115
- Please open a new window in this project, run loom keeper prompt, and follow it.
116
- ```
1
+ # LOOM Prompt and Message Catalog
2
+
3
+ LOOM's prompts are cognitive interfaces, not a collection of role-playing personas. The exact live
4
+ inventory is emitted by:
5
+
6
+ ```bash
7
+ loom prompts
8
+ ```
9
+
10
+ The command is the auditable source of truth. It returns the complete text, placeholders, and composition
11
+ order as JSON, so documentation cannot quietly describe a different prompt from the one Agents receive.
12
+
13
+ ## Instruction layers
14
+
15
+ | Layer | Message | Injected when | Purpose |
16
+ |---|---|---|---|
17
+ | Stable core | `layers.stable_core` | Every `loom context` | Durable collaboration judgment: user ownership, evidence classes, question threshold, corrections, reversible delegation |
18
+ | Environment adaptation | `layers.environment_adaptation_available` or `layers.environment_adaptation_unavailable` | Every `loom context` | States whether a human can answer; routes uncertainty through inspection, permitted factual research, clarification, bounded assumption, or block |
19
+ | Runtime adaptation | `layers.runtime_protocol` | Every `loom context` | LOOM-specific disk model, document graph, capability boundaries, Work Map, and three production loops |
20
+ | Project state | `layers.project_state` | Every `loom context` | Dynamic status, uncertainty, assumptions, document/capability inventory, Task counts, blocked Tasks with reasons and recovery conditions, and Keeper feedback |
21
+ | Project state after failure | `layers.project_state_after_keeper_failure` | Keeper `needs_revision`/`blocked` | Prior finding text, the repair expectation, and the `loom project ready` → fresh-Keeper retry contract |
22
+ | Keeper review of prior failure | `layers.keeper_review_of_prior_failure` | `--keeper` after a failed attempt | The exact prior findings the fresh Keeper must re-verify before passing |
23
+ | Execution protocol | `layers.execution_protocol` | Active Task or `--task` | Recovery, workspace inspection, risk-based testing, progress persistence, exact proof, and delivery boundaries |
24
+ | Current task | `layers.current_task` | Active Task or `--task` | Exact Task JSON followed by the exact contents of every path in `reads` |
25
+ | On-demand map | `layers.on_demand_map` | Every `loom context` | Pointers to decision history, design documents, capability dossiers, and STRUCTURE.md for lazy loading |
26
+ | Keeper context | `layers.keeper_context` | `--keeper` | Full decision history, work-map summary, and every design and capability document for whole-corpus audit |
27
+
28
+ This separation is deliberate. Project-specific expertise does not inflate the stable prompt; it lives in
29
+ field dossiers. One-off Task instructions do not become global doctrine. Host permissions and tools are not
30
+ claimed by prompt text.
31
+
32
+ When the human channel is unavailable, the environment message explicitly forbids fabricated user interaction and
33
+ forbids treating web research as a substitute for user intent, preference, or authority. It preserves factual
34
+ research when the task and host actually permit it, then requires a reversible assumption or block for what cannot
35
+ be learned.
36
+
37
+ ## Workspace and document messages
38
+
39
+ `workspace_anchor` is the short block added to `AGENTS.md`. It tells an entering or reset Agent to run
40
+ `loom context`, rerun it before editing after an interruption, persist state at meaningful boundaries rather
41
+ than before every tool call, and keep CLI operation invisible to the human. The anchor is durable-only:
42
+ `loom init` never rewrites existing `AGENTS.md` content, and current mechanics always reach the Agent through
43
+ `loom context` output rather than through the anchor text.
44
+
45
+ `templates.project_index` creates `.loom/PROJECT.md` as a concise whole and document map. It explicitly
46
+ prevents a large project's systems from being compressed into one file.
47
+
48
+ `templates.design_documents` contains all seven live design templates:
49
+
50
+ 1. `product` — outcome, users, problem, product principles, scope, end-to-end behavior, success and failure.
51
+ 2. `experience` — journey, information architecture, states, content, visual direction, accessibility, recovery, usability proof.
52
+ 3. `system` — responsibilities, boundaries, control flow, data, interfaces, dependencies, failure, implementation, verification.
53
+ 4. `contract` — consumers, schemas or commands, invariants, permissions, errors, compatibility, fixtures, contract tests.
54
+ 5. `verification` — claims, environments, fixtures, acceptance matrix, commands, negative tests, blind spots.
55
+ 6. `operations` — authority, procedures, commands, safety, failure recovery, evidence and audit trail.
56
+ 7. `research` — decision, evidence, method, sources, findings, conflicts, consequences and follow-up proof.
57
+
58
+ These are possible document kinds, not a fixed seven-file checklist. The Agent creates as many actual
59
+ documents as the project's independent decision surfaces require.
60
+
61
+ `templates.professional_capability` is the only capability template. It enforces one recognizable field per
62
+ file, a project-specific diagnosis and stance, opened evidence, rejected generic defaults, concrete design and
63
+ verification consequences, failure modes, and links to adjacent fields without merging them.
64
+
65
+ `templates.decision_history` is the preamble for consequential superseding decisions. Current truth stays in
66
+ the project map and linked design documents.
67
+
68
+ ## Keeper message
69
+
70
+ `keeper` is the exact independent handoff prompt. It binds a unique fresh-Agent `run_id` to a frozen
71
+ `prepared_digest`, asks the Keeper to navigate the whole corpus and attempt the first Task, and defines three
72
+ verdicts:
73
+
74
+ - `passed`: a fresh Agent can responsibly begin.
75
+ - `needs_revision`: concrete disk-truth gaps can be repaired.
76
+ - `blocked`: progress needs unavailable authority or external state.
77
+
78
+ A `passed` verdict must carry independent review provenance (`review.mode: "independent"` plus a
79
+ `reviewer_id` and evidence that a separate Agent ran the review). A self-review or an unattested pass is
80
+ rejected at record time; a legacy unattested pass blocks `task start` and is an error in `loom check` until
81
+ replaced by a fresh review or an explicit `loom keeper skip --reason`.
82
+
83
+ Findings are cumulative across attempts: a pass must carry `closure_results` with evidence for every gap
84
+ still open from earlier rounds, not only the latest attempt's. A changed project digest proves that
85
+ something changed — never that findings were resolved. There is no auto-pass.
86
+
87
+ A failed result is injected into the next project-state message. A retry requires changed project truth, a
88
+ new digest, and another fresh Keeper. `loom review --help` describes the staging steps for opening that
89
+ fresh Agent without inherited conversation.
90
+
91
+ ## Evil Eval messages
92
+
93
+ `evaluation.baseline_condition` gives a normal capable Agent the identical brief and ordinary tools without
94
+ LOOM. It does not weaken the baseline or prohibit normal planning.
95
+
96
+ `evaluation.loom_condition` gives the same brief, model class, tools, workspace facts, and budget, adding only
97
+ LOOM continuity infrastructure and no extra authority.
98
+
99
+ `evaluation.unattended_baseline_condition` and `evaluation.unattended_loom_condition` are the same two
100
+ conditions when no user response channel exists. The environment fact is equal in both arms; only the LOOM arm
101
+ uses `loom context --human-channel unavailable`.
102
+
103
+ `evaluation.blind_judge` scores anonymized output on intent fidelity, question value, whole coverage,
104
+ professional depth, buildability, reset continuity, implementation evidence, human burden, and cost. It
105
+ penalizes ceremony and runs an order swap.
106
+
107
+ ## Composition messages
108
+
109
+ `composition.normal_resume`, `composition.active_task`, and `composition.keeper_handoff` list the exact block
110
+ order. Keeper receives every design and capability document; a normal active Task receives only its declared
111
+ reads. This difference is intentional: Keeper audits whole-project coverage, while delivery protects context
112
+ focus.
113
+
114
+ The active Task composition adds `execution_protocol` between the recovered project whole and the exact Task.
115
+ It requires inspection of current workspace/version-control reality, risk-appropriate tests, restartable
116
+ progress, and criterion-level proof. It does not force a unit test for non-code claims or a branch/PR for every
117
+ Task; those are selected when the behavior, human request, or repository workflow makes them meaningful.
118
+
119
+ ## CLI operational messages
120
+
121
+ `loom --help` is the complete command-oriented message surface. `loom review` and `loom review --help` are
122
+ the read-only entry points an Agent uses to stage an independent Keeper handoff; `loom keeper --help` covers
123
+ `keeper prompt`, `keeper record`, and `keeper skip`. JSON command results report state and the next
124
+ host action. Validation errors are contract enforcement rather than cognitive prompts; they reject unsafe
125
+ references, template-only readiness, missing design documents, open high-impact uncertainty, unchanged Keeper
126
+ retries, stale digests, duplicate run identities, Task dependency violations, missing or directory-level Task
127
+ reads, Task references to nonexistent design sections or capability nodes, status bypasses, completion
128
+ without evidence for every done condition, silent rewriting of a done Task, and reasonless reopening of a
129
+ disproven completion or unmet block.
130
+
131
+ Warning channels are closable rather than permanent: a decision-affected done Task warns only until it is
132
+ reopened and re-completed after the decision, deliverable coverage distinguishes planned from delivered, and
133
+ blocked Tasks surface their recovery conditions in `loom context` until reopened with a concrete reason.
134
+
135
+ The short human fallback when the host cannot create a Keeper Agent remains:
136
+
137
+ ```text
138
+ Please open a new window in this project, run loom keeper prompt, and follow it.
139
+ ```