@squadrules/mcp 5.6.0 → 5.7.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.
Files changed (68) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/constants/builtin-search-meta.d.ts +1 -1
  3. package/dist/constants/builtin-search-meta.d.ts.map +1 -1
  4. package/dist/constants/builtin-search-meta.js +3 -2
  5. package/dist/constants/builtin-search-meta.js.map +1 -1
  6. package/dist/embed-docs/mem/README.md +3 -2
  7. package/dist/embed-docs/mem/adapter-migration.md +3 -3
  8. package/dist/embed-docs/mem/author-adapter.md +349 -0
  9. package/dist/embed-docs/mem/bulk-insert-adapters-via-cli.md +2 -2
  10. package/dist/embed-docs/mem/challenge-type-guide.md +3 -3
  11. package/dist/embed-docs/mem/create-new-protocol.md +23 -334
  12. package/dist/embed-docs/mem/critic-loop-guide.md +33 -4
  13. package/dist/embed-docs/mem/critic-loop.md +71 -17
  14. package/dist/embed-docs/mem/phase-critic-guide.md +1 -1
  15. package/dist/embed-docs/mem/phase-critic.md +3 -2
  16. package/dist/embed-docs/mem/protocol-linking-guide.md +3 -3
  17. package/dist/embed-docs/mem/refine-search.md +1 -1
  18. package/dist/embed-docs/mem/skill-format-guide.md +3 -3
  19. package/dist/resources/embedded-mcp-resources.d.ts +1 -0
  20. package/dist/resources/embedded-mcp-resources.d.ts.map +1 -1
  21. package/dist/resources/embedded-mcp-resources.js +15 -14
  22. package/dist/resources/embedded-mcp-resources.js.map +1 -1
  23. package/dist/services/forward-runtime-store.d.ts +2 -0
  24. package/dist/services/forward-runtime-store.d.ts.map +1 -1
  25. package/dist/services/forward-runtime-store.js.map +1 -1
  26. package/dist/services/memory/validate-protocol-structure.d.ts +1 -1
  27. package/dist/services/memory/validate-protocol-structure.d.ts.map +1 -1
  28. package/dist/services/memory/validate-protocol-structure.js +1 -1
  29. package/dist/services/memory/validate-protocol-structure.js.map +1 -1
  30. package/dist/services/qdrant/memory-retrieval.d.ts.map +1 -1
  31. package/dist/services/qdrant/memory-retrieval.js +2 -1
  32. package/dist/services/qdrant/memory-retrieval.js.map +1 -1
  33. package/dist/services/vector-store/lancedb/lance-records-reads.d.ts.map +1 -1
  34. package/dist/services/vector-store/lancedb/lance-records-reads.js +2 -1
  35. package/dist/services/vector-store/lancedb/lance-records-reads.js.map +1 -1
  36. package/dist/tools/activate.d.ts.map +1 -1
  37. package/dist/tools/activate.js +37 -0
  38. package/dist/tools/activate.js.map +1 -1
  39. package/dist/tools/activate_schema.d.ts +27 -0
  40. package/dist/tools/activate_schema.d.ts.map +1 -1
  41. package/dist/tools/activate_schema.js +4 -1
  42. package/dist/tools/activate_schema.js.map +1 -1
  43. package/dist/tools/authoring-context.d.ts +13 -0
  44. package/dist/tools/authoring-context.d.ts.map +1 -0
  45. package/dist/tools/authoring-context.js +11 -0
  46. package/dist/tools/authoring-context.js.map +1 -0
  47. package/dist/tools/forward-register.js +1 -1
  48. package/dist/tools/forward-register.js.map +1 -1
  49. package/dist/tools/forward-view.d.ts.map +1 -1
  50. package/dist/tools/forward-view.js +2 -0
  51. package/dist/tools/forward-view.js.map +1 -1
  52. package/dist/tools/forward.d.ts.map +1 -1
  53. package/dist/tools/forward.js +26 -0
  54. package/dist/tools/forward.js.map +1 -1
  55. package/dist/tools/forward_schema.d.ts +36 -0
  56. package/dist/tools/forward_schema.d.ts.map +1 -1
  57. package/dist/tools/forward_schema.js +5 -0
  58. package/dist/tools/forward_schema.js.map +1 -1
  59. package/dist/tools/tool-registry.d.ts +54 -0
  60. package/dist/tools/tool-registry.d.ts.map +1 -1
  61. package/dist/ui/assets/{AccountPage-BI5SGfKn.js → AccountPage-Cdy5F5Uf.js} +1 -1
  62. package/dist/ui/assets/{index-C7OfP-Qk.js → index-BeRiH9ot.js} +2 -2
  63. package/dist/ui/index.html +1 -1
  64. package/dist/utils/adapter-alias.d.ts +6 -0
  65. package/dist/utils/adapter-alias.d.ts.map +1 -0
  66. package/dist/utils/adapter-alias.js +10 -0
  67. package/dist/utils/adapter-alias.js.map +1 -0
  68. package/package.json +1 -1
@@ -1,355 +1,44 @@
1
1
  ---
2
+ version: "5.7.0"
2
3
  slug: create-new-protocol
3
- version: "5.6.0"
4
- title: Create / Review / Refactor SQUADRULES Protocol
4
+ title: Create New Protocol (Redirect to Author Adapter)
5
5
  ---
6
6
 
7
+ # Create New Protocol (Redirect to Author Adapter)
7
8
 
8
-
9
- # Create / Review / Refactor SQUADRULES Protocol
10
-
11
- > **Note to the agent:** SQUADRULES protocols are interfaces for AI agents — you
12
- > are the primary user. When you author a protocol, you design behaviour for
13
- > yourself and others. Write for them: single source of truth (never duplicate
14
- > rules), explicit over implicit (agents fill ambiguity with hallucination),
15
- > phases teach modes (each step teaches its cognitive mode), truth over fluency
16
- > (a protocol that reads well but causes wrong behaviour is worse than one that
17
- > reads rough but executes correctly).
9
+ `create-new-protocol` was renamed to **`author-adapter`** in 5.6.0. This adapter
10
+ is a redirect tombstone: it exists only so a stored adapter that still chains to
11
+ `squadrules://adapter/create-new-protocol` resolves and is sent to the replacement
12
+ instead of dangling. It carries no authoring logic. Do not author new adapters
13
+ against this slug — use `squadrules://adapter/author-adapter`.
18
14
 
19
15
  ## Activation Patterns
20
16
 
21
- SQUADRULES authoring lifecycle — create, review, or update adapters / protocols / workflows.
22
- In this context, those words refer to the same stored artifact and can be treated
23
- as synonyms. Supports three operations:
24
-
25
- - **create** — draft and train a new adapter / protocol from scratch.
26
- - **review** — audit an existing adapter, family, or bundle for structural issues,
27
- missing cross-references, chaining gaps, DRY violations, stale guidance, or
28
- agent-hostile ambiguity. Read-only.
29
- - **update** — apply specific corrections to an existing adapter / protocol and
30
- re-train. Also triggered by: edit, fix, modify, change, improve, patch, refactor.
17
+ **Typically invoked by:** a stored adapter that still forwards to the retired
18
+ `create-new-protocol` slug.
31
19
 
32
- **Run this protocol when the user says ANY of:**
33
-
34
- - "create a new SQUADRULES protocol" / "create new protocol adapter"
35
- - "register personal SQUADRULES adapter" / "register a personal adapter"
36
- - "train adapter into personal" / "train protocol into personal"
37
- - "train a workflow" / "register a new adapter" / "create a new workflow"
38
- - "review protocol" / "audit adapters" / "check protocol families for gaps"
39
- - "update adapter" / "edit adapter" / "fix protocol" / "modify adapter"
40
- - "patch protocol" / "refactor protocol" / "change adapter" / "improve adapter"
41
- - "create new protocol" (when `activate` found no match and user confirms)
42
-
43
- **Trigger pattern:** **create** / **train** / **register** / **review** /
44
- **audit** / **fix** / **update** / **edit** / **modify** / **change** /
45
- **improve** / **patch** / **refactor** / **correct** +
46
- (protocol / adapter / workflow).
20
+ **Can be invoked directly when agent needs:**
21
+ - "create new protocol" — the retired name for the author adapter
47
22
 
48
23
  **Must Never:**
49
- - Run when the user only asked to execute an existing protocol.
50
- - Mutate adapters during a `review` operation.
51
- - Optimise only for pretty wording; this protocol designs agent behaviour.
52
- - Treat "update", "edit", or "modify an existing adapter" as the **update**
53
- operation — never as create.
24
+ - Perform any authoring itself; this tombstone only redirects.
25
+ - Be used as the target of a new adapter chain.
54
26
 
55
27
  **Must Always:**
56
- - Infer `{operation}` from trigger: create / review / update.
57
- When the user says "update", "edit", "modify", or "fix" → operation is **update**.
58
- - Optimise for truth, low ambiguity, explicit sequencing, and user-need alignment.
59
- - Design or review phase transitions explicitly: discovery, clarification,
60
- ideation, planning, execution, validation, review, handoff.
61
- - Include Activation Patterns as the first H2 and Reward Signal as the last H2
62
- in any newly drafted adapter.
63
- - Enforce the 350-line limit per file.
64
-
65
- **Good trigger examples:**
66
- - "Create a new SQUADRULES protocol for code review" → run this protocol (create)
67
- - "No match found; I want to create a new protocol" → run this protocol (create)
68
- - "Review all v4 protocol families for missing cross-references" → run this protocol (review)
69
- - "Update the MR adapter to include a review step" → run this protocol (update)
70
- - "Edit the critic-loop adapter triggers" → run this protocol (update)
71
- - "Refactor the MR adapter to be less ambiguous" → run this protocol (update)
72
-
73
- **Bad trigger examples:**
74
- - "Run the standardise project protocol" → use activate / forward
75
- - "Search for deployment protocol" → use activate
76
- - "Create an MR" → use the MR adapter, not this protocol
77
-
78
- ## Preflight Dependencies
79
-
80
- Before running authoring actions, verify dependency and auth readiness for this
81
- run:
82
-
83
- 1. Required MCP tools are available and reachable: `activate`, `forward`,
84
- `reward`, and the operation-dependent tool (`train`, `export`, or `tune`).
85
- 2. Required CLI tools for planned shell steps are installed and callable.
86
- 3. Required auth/session state is valid for the target MCP server.
87
-
88
- If any check fails, attempt AI-assisted remediation automatically (install or
89
- configure the missing tool, refresh auth/session), then re-run preflight. Only
90
- hard-stop when a required tool or auth genuinely cannot be established
91
- autonomously; report the concrete blocker and the remediation already attempted.
92
- Do not continue to intent resolution until preflight passes.
93
-
94
- ```json
95
- {"contract":{"type":"comment","comment":{"min_length":80},"required":true}}
96
- ```
97
-
98
- ## Resolve Intent Autonomously
99
-
100
- Infer `{operation}` from the user's trigger — do not stop to ask for confirmation:
101
-
102
- | Signal | Operation |
103
- |---|---|
104
- | "create", "new", "train", no match from activate | **create** |
105
- | "review", "audit", "check", "gaps", "cross-references" | **review** |
106
- | "update", "edit", "fix", "modify", "change", "improve", "patch", "refactor", "add missing", "correct" | **update** |
107
-
108
- Resolve the target from context without a confirmation prompt: for `create`,
109
- proceed to author a new adapter; for `review`, select the adapter(s), family, or
110
- bundle named or implied by the request; for `update`, select the adapter and the
111
- specific issue. Record the inferred operation and target, then continue. Escalate
112
- to the user only when the request is genuinely ambiguous and no reasonable default
113
- exists.
114
-
115
- ```json
116
- {"contract":{"type":"comment","comment":{"min_length":80},"required":true}}
117
- ```
118
-
119
- ## Gather Requirements
120
-
121
- ### For `create` — collect details for a new protocol
122
-
123
- **1. Determine the pattern:**
124
-
125
- | Signal | Pattern |
126
- |---|---|
127
- | One workflow, no variants | **Standalone** — one protocol, all steps inline |
128
- | Multiple issue types / output formats / media | **Router + Extensions** — router classifies, routes via `activate` |
129
- | Domain has a decision tree | **Router + Extensions** |
130
- | Single workflow but exceeds 350 lines or too complex for weaker models | **Chain** — split into sequential adapters linked via `forward` + slug |
131
- | Reference material needed by steps | Extract to a separate file, not a protocol |
132
-
133
- **2. Collect per protocol:**
134
-
135
- - **Title** — clear, descriptive H1.
136
- - **User problem** — what real problem does this solve?
137
- - **Agent behaviour** — what behaviour should this create in the agent?
138
- - **Mode map** — which steps are for discovery, clarification, ideation,
139
- planning, execution, validation, review, or handoff?
140
- - **Steps** — each H2 must earn its place and end with a challenge.
141
- - **Challenge type per step** — use the strongest observable contract possible.
142
- - **Domain reference** — guides / docs the protocol should load.
143
- - **Existing protocols** — reuse, compose, or extract shared content.
144
- - **DRY / size check** — extract duplicated content; split if >350 lines.
145
- - **Chain position** — entry, middle, or exit? What slug does the previous link forward to?
146
- - **Failure analysis** — where would a weaker agent misread this protocol?
147
-
148
- **3. If Router pattern:** variants, classification questions, forbidden types,
149
- and which parts stay in the router vs extensions.
150
-
151
- **4. If Chain pattern:** Load `protocol-linking-guide` for full rules
152
- (`forward` with `squadrules://adapter/protocol-linking-guide`). Collect: chain
153
- links and concerns, minimum number of links, entry point (matched by
154
- `activate`), and artifacts flowing between links.
155
-
156
- ### For `review` — audit existing adapters against this checklist
157
-
158
- Export target adapter(s). For each adapter, check:
159
-
160
- 1. **User-need fit** — does the adapter solve a real user problem, or merely
161
- mirror literal wording?
162
- 2. **Mode / phase clarity** — are discovery, clarification, ideation,
163
- execution, validation, and review clearly separated?
164
- 3. **Cross-reference completeness** — are all required related adapters linked?
165
- 4. **Adapter handoff gaps** — does it hand off where another adapter should own
166
- the work?
167
- 5. **DRY violations** — is policy content duplicated instead of linked?
168
- 6. **Contract coverage** — does every executable H2 have the right contract?
169
- 7. **Truth-first behaviour** — does it reduce guessing, fake certainty, and
170
- silent assumption-making?
171
- 8. **Activation pattern accuracy** — do triggers match what users actually say?
172
- 9. **Structure compliance** — first H2 Activation Patterns, last H2 Reward
173
- Signal, no duplicate H2s, under 350 lines.
174
- 10. **Sibling consistency** — are equivalent steps present across sibling
175
- adapters in the same family?
176
- 11. **Chained adapter families** (when applicable) — extension adapters include
177
- `chain_root` and a prerequisite clause pointing at the root; parent adapters
178
- use explicit `forward` when the next adapter slug is already known; reserve
179
- `activate` for ambiguous runtime discovery (see `protocol-linking-guide`,
180
- **Chaining Back and Forward**).
181
- 12. **Critic-loop integration** — does the adapter include critic-loop chain
182
- links at major phase boundaries? Does each critic-loop invocation have a
183
- FAIL gate shell contract (`grep -qi '^PASS$'` on the verdict file)? Are
184
- solution checks restricted to irreversible remote mutations (see
185
- `critic-loop-guide`)?
186
-
187
- ### For `update` — identify the specific issue
188
-
189
- Export the target adapter, read the current markdown, identify the exact gap or
190
- error, and plan the minimal change. Do not alter unrelated layers.
191
-
192
- Summarise gathered requirements or findings.
193
-
194
- ```json
195
- {"contract":{"type":"comment","comment":{"min_length":80},"required":true}}
196
- ```
197
-
198
- ## Draft Markdown
199
-
200
- ### For `create` — draft new adapter markdown
201
-
202
- Draft the full markdown for `train`.
203
-
204
- ### For `review` — draft findings report
205
-
206
- Write a structured gap report to `$REVIEW_FINDINGS_FILE` (an absolute path
207
- provided by the invoking agent or chosen by you under
208
- `$SQUADRULES_LOCAL_ARTIFACT_DIR` with a session-unique segment). For each finding
209
- include:
210
-
211
- - adapter title
212
- - gap type
213
- - severity
214
- - why the issue matters for AI-agent behaviour
215
- - specific recommended fix
216
-
217
- ### For `update` — draft corrected adapter markdown
218
-
219
- Apply the identified change and show a diff-style summary of what changed.
220
-
221
- ### Shared drafting rules (all operations)
28
+ - Send the caller to `squadrules://adapter/author-adapter`, forwarding the same
29
+ context it received.
222
30
 
223
- **Core SQUADRULES rule — right mode at the right time:**
31
+ ## Redirect
224
32
 
225
- Every protocol must help the agent recognise whether the current step is for
226
- exploration, clarification, ideation, planning, execution, validation, review,
227
- or handoff. Do not blur those modes.
228
-
229
- **Truth over fluency:**
230
-
231
- Design protocols to reduce guessing and fake certainty. Prefer explicit prompts,
232
- explicit stop conditions, explicit uncertainty escalation, and observable
233
- verification over narrative reassurance.
234
-
235
- **User need over literal phrasing:**
236
-
237
- The protocol should help the agent provide what the user actually needs, not
238
- just echo the wording used in the request.
239
-
240
- **DRY:**
241
-
242
- Shared content across protocols must live in one place. If two protocols share
243
- >50% of their body, extract shared logic.
244
-
245
- **350-line maximum per file:**
246
-
247
- No protocol file may exceed 350 lines. If it grows beyond that, split it into
248
- linked adapters or extract a reference file.
249
-
250
- **Generic-first — create generic, link from detailed:**
251
-
252
- Create protocols from generic to detailed. The generic adapter must stand alone.
253
- Extensions should contain only the delta.
254
-
255
- **Slug convention — deterministic protocol linking:**
256
-
257
- Every protocol gets a short, unique, lowercase-hyphenated `slug`.
258
-
259
- **Artifacts:**
260
-
261
- Store scripts or config blobs as artifacts via `train` (set `mime`,
262
- `artifact_name`, `adapter_uri`). Retrieve with `export` using
263
- `squadrules://artifact/{uuid}`.
264
-
265
- **Protocol structure:** H1 title, first H2 Activation Patterns, second H2
266
- Preflight Dependencies, middle H2s one per step with JSON contract block, last
267
- H2 Reward Signal. Frontmatter: `slug` (required), `version` (optional),
268
- `chain_root` (required for mid-chain adapters).
269
-
270
- **Challenge types:** Load `challenge-type-guide` for decision rules and JSON
271
- formats (`forward` with `squadrules://adapter/challenge-type-guide`).
272
-
273
- **Critic-loop and mutation gates:** Load `critic-loop-guide` for placement,
274
- FAIL gate, and solution check rules (`forward` with `squadrules://adapter/critic-loop-guide`).
275
-
276
- **If Router pattern:** draft the router and each extension as separate files.
277
-
278
- Post the full drafted markdown.
33
+ Forward to the replacement and continue the run there. `author-adapter` is the
34
+ create / review / update lifecycle that replaced `create-new-protocol`; its
35
+ integration rules live in the adapter itself. See ADR 0016 (the rename).
279
36
 
280
37
  ```json
281
- {"contract":{"type":"comment","comment":{"min_length":120},"required":true}}
282
- ```
283
-
284
- ## Critic-Loop Review (create and update only)
285
-
286
- For `create` and `update`: run critic-loop against the drafted markdown. This is an
287
- autonomous quality loop — the agent owns content, the critic owns quality, and no
288
- human approval is requested at any point.
289
-
290
- 1. Invoke critic-loop via `forward` with `squadrules://adapter/critic-loop`.
291
- Provide the drafted markdown as `input_file`, the slug as
292
- `calling_protocol_slug`, and "structural compliance and agent behaviour"
293
- as `verification_target`.
294
- 2. Run the FAIL gate shell contract on the verdict file:
295
-
296
- ```json
297
- {"contract":{"type":"shell","shell":{"cmd":"head -1 \"$VERDICT_FILE\" | grep -qi '^PASS$'","timeout_seconds":5},"required":true}}
298
- ```
299
-
300
- 3. If FAIL: address every finding, then re-invoke critic-loop and re-run the FAIL
301
- gate. **Loop automatically until the verdict is PASS** — do not proceed and do
302
- not ask the user whether to continue.
303
- 4. If PASS: capture the verdict file path for the `review_evidence` field
304
- in the `train` call below.
305
-
306
- For `review`: skip this step (read-only operation).
307
-
308
- ```json
309
- {"contract":{"type":"comment","comment":{"min_length":80},"required":true}}
310
- ```
311
-
312
- ## Autonomous Review Gate
313
-
314
- No human approval step. The critic-loop PASS verdict from the previous step is the
315
- sole quality gate; once it is PASS, proceed directly to finalise.
316
-
317
- For `create`: record the drafted adapter slug(s) and the critic-loop verdict, then
318
- continue to `train`.
319
-
320
- For `review`: record the findings and the actions taken, then continue.
321
-
322
- For `update`: record the corrected markdown, the change summary, and the critic
323
- verdict, then continue.
324
-
325
- ```json
326
- {"contract":{"type":"comment","comment":{"min_length":80},"required":true}}
327
- ```
328
-
329
- ## FinaliseOperation
330
-
331
- For `create`: call `train` with the drafted markdown and `review_evidence`
332
- from the critic-loop step. Use `force_update: false` unless overwrite was
333
- explicitly requested.
334
-
335
- For `review`: do not call `train`. Save the findings report only if requested.
336
-
337
- For `update`: call `train` with `force_update: true`, `review_evidence` from
338
- the critic-loop step, and update the corresponding repo file.
339
-
340
- Report the outcome: adapter URI(s) for create / update, or findings summary for
341
- review.
342
-
343
- ```json
344
- {"contract":{"type":"comment","comment":{"min_length":80},"required":true}}
38
+ {"contract":{"type":"mcp","mcp":{"tool_name":"forward","arguments":{"uri":"squadrules://adapter/author-adapter"}},"required":true}}
345
39
  ```
346
40
 
347
41
  ## Reward Signal
348
42
 
349
- Protocol complete when:
350
- - `create` — adapter(s) stored via `train` (with review_evidence) and URI(s) reported
351
- - `review` — findings report delivered
352
- - `update` — corrected adapter trained with `force_update: true` + review_evidence, repo file updated
353
-
354
- A successful result means the resulting SQUADRULES adapter is more truthful,
355
- phase-aware, agent-readable, and aligned with human–AI harmony.
43
+ The caller reached `squadrules://adapter/author-adapter`, so the retired slug
44
+ resolved and redirected instead of dangling.
@@ -1,5 +1,5 @@
1
1
  ---
2
- version: "5.6.0"
2
+ version: "5.7.0"
3
3
  slug: critic-loop-guide
4
4
  title: Critic Loop Integration and Mutation Gate Guide
5
5
  ---
@@ -13,7 +13,7 @@ cheap while irreversible boundaries stay guarded.
13
13
 
14
14
  ## Activation Patterns
15
15
 
16
- **Typically invoked by:** `create-new-protocol` during adapter drafting, and
16
+ **Typically invoked by:** `author-adapter` during adapter drafting, and
17
17
  any adapter that includes review or validation phases.
18
18
 
19
19
  **Can be invoked directly when agent needs:**
@@ -45,7 +45,7 @@ any adapter that includes review or validation phases.
45
45
 
46
46
  **Bad trigger examples:**
47
47
  - "run the critic loop" → use `activate` to match `critic-loop`
48
- - "create a new protocol" → use `create-new-protocol`
48
+ - "create a new protocol" → use `author-adapter`
49
49
  - "which challenge type for this step?" → use `challenge-type-guide`
50
50
 
51
51
  ## Core Decision Rule
@@ -54,7 +54,8 @@ any adapter that includes review or validation phases.
54
54
  returns PASS** — not a one-shot step. It verifies claims, gathers evidence,
55
55
  searches for contradictions, and checks the work against the original requirement
56
56
  list. Use it for quality and truthfulness review, and whenever a step is
57
- non-deterministic or has no objective proof.
57
+ non-deterministic or has no objective proof. Run it **before** the work is handed
58
+ to the next step, and before it is presented to the human.
58
59
 
59
60
  **Solution checks** are per-layer contract verification mechanisms (shell
60
61
  commands, MCP tool calls). Use them ONLY where getting it wrong is expensive or
@@ -134,6 +135,34 @@ pattern is a `mcp` contract that requires calling `forward` with the
134
135
  Use the same contract. The critic-loop adapter receives the calling protocol's
135
136
  context and independently verifies the work.
136
137
 
138
+ ### What to submit for review
139
+
140
+ The submission is the **work itself**, not a summary of it. Pass `work` with a
141
+ `kind`, an `items` list, and the absolute `root` the items resolve against:
142
+
143
+ | `kind` | `items` contain | Resolved by | Typical work |
144
+ |---|---|---|---|
145
+ | `file_set` | paths (absolute, or relative to `root`) | read each file | docs, generated code, configs |
146
+ | `links` | URLs, `squadrules://` resource URIs | fetch each one | published pages, external references |
147
+ | `git_diff` | `base..head` refs, or empty for the working tree | `git diff` | an unpushed implementation |
148
+ | `pr` | PR numbers or URLs | `gh pr view` + `gh pr diff` | a reviewable pull request |
149
+ | `command_output` | commands to run from `root` | run and capture | migrations, builds, data pulls |
150
+ | `inline` | the text itself | read the manifest | a plan, a decision, a message draft |
151
+
152
+ Record `work` in the handoff file pointed to by `$WORK_MANIFEST`, as flat keys —
153
+ `kind:`, `root:`, then `items:` with one item per line — so the precondition
154
+ stays a machine-checkable file test instead of prose:
155
+
156
+ ```json
157
+ {"contract":{"type":"shell","shell":{"cmd":"test -f \"${WORK_MANIFEST:-}\" || test -f \"${INPUT_FILE:-}\"","timeout_seconds":3},"required":true}}
158
+ ```
159
+
160
+ Anything that cannot be resolved is `verification_blocked` — an item the critic
161
+ could not read is never treated as an item that passed. `input_file` still works
162
+ and means a one-item `file_set`; prefer `work_manifest` for anything that is not
163
+ a single document. A `pr` or `git_diff` submission is judged on the diff and the
164
+ tests it touches, not on the description written next to it.
165
+
137
166
  ### Feed it the requirements, then loop with a ceiling
138
167
 
139
168
  Pass the original requirement list in the forward context. A critic that sees only
@@ -1,5 +1,5 @@
1
1
  ---
2
- version: "5.6.0"
2
+ version: "5.7.0"
3
3
  slug: critic-loop
4
4
  title: Critic Loop
5
5
  ---
@@ -9,12 +9,13 @@ title: Critic Loop
9
9
  # Critic Loop
10
10
 
11
11
  Bounded adversarial investigator that the calling protocol **loops until it
12
- returns PASS** — not a one-shot review. Receives a reference document, the
12
+ returns PASS** — not a one-shot review. Receives a work submission (files,
13
+ links, a git diff, a pull request, command output, or inline text), the
13
14
  original requirement list, and the calling protocol's invariants, then
14
- independently verifies the target by extracting claims, gathering evidence,
15
- searching for contradictions, and checking requirement-by-requirement coverage.
16
- A FAIL sends the caller back to fix and re-invoke; the loop is bounded by an
17
- explicit iteration ceiling (see Verdict).
15
+ independently verifies the submitted work by extracting claims, gathering
16
+ evidence, searching for contradictions, and checking requirement-by-requirement
17
+ coverage. A FAIL sends the caller back to fix and re-invoke; the loop is bounded
18
+ by an explicit iteration ceiling (see Verdict).
18
19
 
19
20
  ## Activation Patterns
20
21
 
@@ -30,7 +31,7 @@ validation, or review phase via `forward` with the stored adapter URI
30
31
  (phase / plan / implementation / output).
31
32
 
32
33
  **Must Never:**
33
- - Modify any file outside the provided input and output paths.
34
+ - Modify any submitted item or any file other than the verdict path.
34
35
  - Trust the executor's assertions without independent evidence.
35
36
  - Classify a claim as `verified` based only on absence of contradiction.
36
37
  - Keep investigating after a precondition failure that blocks verification.
@@ -49,7 +50,7 @@ validation, or review phase via `forward` with the stored adapter URI
49
50
  - compose protocol fires this after output generation → run this protocol
50
51
 
51
52
  **Bad trigger examples:**
52
- - "Create a new protocol" → use `create-new-protocol`
53
+ - "Create a new protocol" → use `author-adapter`
53
54
  - "Implement a feature" → use an execution protocol, not this one
54
55
 
55
56
  ## Artifact Contract
@@ -58,10 +59,16 @@ This protocol receives:
58
59
 
59
60
  ```text
60
61
  {
61
- input_file: string, // absolute path to the document under review
62
+ work: {
63
+ kind: 'file_set' | 'links' | 'git_diff' | 'pr' | 'command_output' | 'inline',
64
+ items: string[], // paths | URLs | 'base..head' refs | PR URL/number | commands | text
65
+ root: string // absolute cwd used to resolve relative paths, refs and commands
66
+ },
67
+ work_manifest: string, // absolute path to the handoff file recording `work`
68
+ input_file: string, // accepted alias: a one-item work.kind='file_set'
62
69
  calling_protocol_slug: string,
63
70
  verification_target: string,
64
- requirements: string[], // original intent / requirement list to check coverage against
71
+ requirements: string[], // original intent / requirement list to check coverage against
65
72
  context: {
66
73
  operation: string,
67
74
  verdict_file: string, // absolute path where the verdict will be written
@@ -71,6 +78,12 @@ This protocol receives:
71
78
  }
72
79
  ```
73
80
 
81
+ The submission is the **work itself**, not an essay about it. Write `work` to
82
+ `$WORK_MANIFEST` as flat keys so the handoff stays machine-checkable:
83
+ `kind:`, `root:`, then `items:` with one item per line. Callers that still pass
84
+ only `input_file` are handled as `kind: file_set` with that single path; the
85
+ review rules do not change, only the scope of what is submitted.
86
+
74
87
  This protocol produces:
75
88
 
76
89
  ```text
@@ -88,14 +101,16 @@ This protocol produces:
88
101
  Verify foundational preconditions before deep investigation. Early-abort if any
89
102
  are broken.
90
103
 
91
- **Input:** `$INPUT_FILE` (absolute path), calling protocol slug, context
104
+ **Input:** `$WORK_MANIFEST` (or the older-spelling `$INPUT_FILE`), calling protocol slug, context
92
105
 
93
106
  **Actions:**
94
- 1. Verify the input file exists: `test -f "$INPUT_FILE"`.
107
+ 1. Verify a submission handoff is present: `$WORK_MANIFEST`, or `$INPUT_FILE`
108
+ when the caller passed no manifest.
95
109
  2. Verify the verdict output path is writable (parent directory exists).
96
110
  3. Load the calling protocol's Must Never / Must Always sections if possible.
97
111
  4. Verify the target state is available for review.
98
- 5. Verify required tools are available.
112
+ 5. Verify required tools are available for the submission's `kind` (a `pr`
113
+ submission with no `gh` on the host is `verification_blocked`, not skipped).
99
114
 
100
115
  **On early-abort:**
101
116
  - verdict = `FAIL`
@@ -107,15 +122,52 @@ are broken.
107
122
  **Output:** verified preconditions or early-abort diagnostics
108
123
 
109
124
  ```json
110
- {"contract":{"type":"shell","shell":{"cmd":"test -f \"$INPUT_FILE\"","timeout_seconds":3},"required":true}}
125
+ {"contract":{"type":"shell","shell":{"cmd":"test -f \"${WORK_MANIFEST:-}\" || test -f \"${INPUT_FILE:-}\"","timeout_seconds":3},"required":true}}
126
+ ```
127
+
128
+ ## Resolve Submission [SUBAGENT]
129
+
130
+ Turn the submission into the material under review. What cannot be resolved is
131
+ never guessed at.
132
+
133
+ **Input:** `work` recorded in `$WORK_MANIFEST` (or the older-spelling `$INPUT_FILE`),
134
+ `work.root`
135
+
136
+ **Actions:**
137
+ 1. Read `kind`, `root`, `items`. An unknown `kind`, an empty `items` list, or a
138
+ malformed manifest is `verification_blocked`.
139
+ 2. Resolve every item by kind, always from `work.root`:
140
+ - `file_set` — read each path; relative paths resolve against `root`, and a
141
+ missing path is `verification_blocked`.
142
+ - `links` — fetch each URL; a URL that cannot be fetched is
143
+ `verification_blocked`, not an `unverifiable` claim.
144
+ - `git_diff` — `git -C "$root" diff <base>..<head>`, or the working tree when
145
+ no range is given; no `git`, no repository, or a bad ref is
146
+ `verification_blocked`.
147
+ - `pr` — `gh pr view` plus `gh pr diff` for the number or URL; a missing
148
+ `gh`, an expired login, or an unreachable host is `verification_blocked`.
149
+ - `command_output` — run each command from `root` and capture stdout and
150
+ stderr as the material.
151
+ - `inline` — the text recorded in the manifest is the material.
152
+ 3. Record the resolved inventory before auditing: `kind`, item count, per-item
153
+ status (`resolved` or `blocked`), and where each item's evidence lives. The
154
+ audit investigates this inventory and nothing else.
155
+ 4. A `pr` or `git_diff` submission is reviewed as a diff: claims are checked
156
+ against the changed lines and the tests they touch, never against the
157
+ description written alongside them.
158
+
159
+ **Output:** resolved work inventory for the audit
160
+
161
+ ```json
162
+ {"contract":{"type":"comment","comment":{"min_length":80},"required":true}}
111
163
  ```
112
164
 
113
165
  ## Audit [SUBAGENT]
114
166
 
115
- Perform bounded adversarial review of the target against the reference document
116
- and invariants.
167
+ Perform bounded adversarial review of the target against the resolved work
168
+ submission and invariants.
117
169
 
118
- **Input:** reference document, invariants, verification target, requirement list, context
170
+ **Input:** resolved work inventory, invariants, verification target, requirement list, context
119
171
 
120
172
  **Actions:**
121
173
 
@@ -158,6 +210,8 @@ Extract every verifiable claim that matters operationally:
158
210
  **Rules:**
159
211
  - higher-priority evidence overrides lower-priority evidence
160
212
  - priority 5–6 alone is not enough for `verified`
213
+ - a submitted link or PR description is priority 5 evidence: verify the claim
214
+ against the fetched content or the actual diff, never against the summary
161
215
 
162
216
  **Step 4 — Produce claim verdicts**
163
217
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- version: "5.6.0"
2
+ version: "5.7.0"
3
3
  slug: phase-critic-guide
4
4
  title: Phase Critic Guide (Redirect to Critic Loop Guide)
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- version: "5.6.0"
2
+ version: "5.7.0"
3
3
  slug: phase-critic
4
4
  title: Phase Critic (Redirect to Critic Loop)
5
5
  ---
@@ -26,7 +26,8 @@ against this slug — use `squadrules://adapter/critic-loop`.
26
26
 
27
27
  **Must Always:**
28
28
  - Send the caller to `squadrules://adapter/critic-loop`, forwarding the same
29
- `input_file`, `requirements`, and `context` it received.
29
+ `work` submission (or the older-spelling `input_file`), `requirements`, and
30
+ `context` it received.
30
31
 
31
32
  ## Redirect
32
33
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- version: "5.6.0"
2
+ version: "5.7.0"
3
3
  slug: protocol-linking-guide
4
4
  title: Protocol Linking Guide
5
5
  ---
@@ -14,7 +14,7 @@ validation for deterministic cross-protocol linking.
14
14
 
15
15
  ## Activation Patterns
16
16
 
17
- **Typically invoked by:** `create-new-protocol` and
17
+ **Typically invoked by:** `author-adapter` and
18
18
  `critic-loop`.
19
19
 
20
20
  **Can be invoked directly when agent needs:**
@@ -41,7 +41,7 @@ validation for deterministic cross-protocol linking.
41
41
 
42
42
  **Bad trigger examples:**
43
43
  - "which challenge type for this step?" → use `challenge-type-guide`
44
- - "create a new protocol" → use `create-new-protocol`
44
+ - "create a new protocol" → use `author-adapter`
45
45
 
46
46
  ## Layers vs Chains
47
47
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- version: "5.6.0"
2
+ version: "5.7.0"
3
3
  slug: refine-search
4
4
  title: Get help refining your search
5
5
  ---