@squadrules/mcp 5.13.7 → 5.14.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/dist/.tsbuildinfo +1 -1
- package/dist/cli/commands/export.d.ts +1 -0
- package/dist/cli/commands/export.d.ts.map +1 -1
- package/dist/cli/commands/export.js +23 -0
- package/dist/cli/commands/export.js.map +1 -1
- package/dist/embed-docs/mem/README.md +32 -14
- package/dist/embed-docs/mem/adapter-migration.md +59 -47
- package/dist/embed-docs/mem/author-adapter.md +132 -70
- package/dist/embed-docs/mem/bulk-insert-adapters-via-cli.md +59 -24
- package/dist/embed-docs/mem/challenge-type-guide.md +53 -13
- package/dist/embed-docs/mem/critic-loop-guide.md +38 -17
- package/dist/embed-docs/mem/critic-loop.md +24 -17
- package/dist/embed-docs/mem/protocol-linking-guide.md +10 -3
- package/dist/embed-docs/mem/refine-search.md +1 -1
- package/dist/resources/embedded-mcp-resources.js +13 -13
- package/dist/resources/embedded-mcp-resources.js.map +1 -1
- package/dist/services/memory/qdrant-point-to-memory.d.ts.map +1 -1
- package/dist/services/memory/qdrant-point-to-memory.js +10 -1
- package/dist/services/memory/qdrant-point-to-memory.js.map +1 -1
- package/dist/tools/activate-artifacts.d.ts +25 -0
- package/dist/tools/activate-artifacts.d.ts.map +1 -0
- package/dist/tools/activate-artifacts.js +57 -0
- package/dist/tools/activate-artifacts.js.map +1 -0
- package/dist/tools/activate.d.ts.map +1 -1
- package/dist/tools/activate.js +17 -64
- package/dist/tools/activate.js.map +1 -1
- package/dist/tools/activate_schema.d.ts +9 -0
- package/dist/tools/activate_schema.d.ts.map +1 -1
- package/dist/tools/activate_schema.js +2 -1
- package/dist/tools/activate_schema.js.map +1 -1
- package/dist/tools/artifact-materialize-command.d.ts +22 -0
- package/dist/tools/artifact-materialize-command.d.ts.map +1 -0
- package/dist/tools/artifact-materialize-command.js +37 -0
- package/dist/tools/artifact-materialize-command.js.map +1 -0
- package/dist/tools/forward-error-payload.d.ts +7 -0
- package/dist/tools/forward-error-payload.d.ts.map +1 -0
- package/dist/tools/forward-error-payload.js +30 -0
- package/dist/tools/forward-error-payload.js.map +1 -0
- package/dist/tools/forward-helpers.d.ts +7 -0
- package/dist/tools/forward-helpers.d.ts.map +1 -1
- package/dist/tools/forward-helpers.js +9 -2
- package/dist/tools/forward-helpers.js.map +1 -1
- package/dist/tools/forward-view.d.ts +2 -0
- package/dist/tools/forward-view.d.ts.map +1 -1
- package/dist/tools/forward-view.js +17 -3
- package/dist/tools/forward-view.js.map +1 -1
- package/dist/tools/forward_schema.d.ts +26 -1
- package/dist/tools/forward_schema.d.ts.map +1 -1
- package/dist/tools/forward_schema.js +8 -2
- package/dist/tools/forward_schema.js.map +1 -1
- package/dist/tools/next-pow-challenge-shape.d.ts.map +1 -1
- package/dist/tools/next-pow-challenge-shape.js +45 -2
- package/dist/tools/next-pow-challenge-shape.js.map +1 -1
- package/dist/tools/next-pow-helpers.d.ts.map +1 -1
- package/dist/tools/next-pow-helpers.js +13 -29
- package/dist/tools/next-pow-helpers.js.map +1 -1
- package/dist/tools/review-evidence-check.d.ts +2 -0
- package/dist/tools/review-evidence-check.d.ts.map +1 -1
- package/dist/tools/review-evidence-check.js +5 -3
- package/dist/tools/review-evidence-check.js.map +1 -1
- package/dist/tools/reward.d.ts.map +1 -1
- package/dist/tools/reward.js +15 -0
- package/dist/tools/reward.js.map +1 -1
- package/dist/tools/shell-failure-diagnostics.d.ts +19 -0
- package/dist/tools/shell-failure-diagnostics.d.ts.map +1 -0
- package/dist/tools/shell-failure-diagnostics.js +58 -0
- package/dist/tools/shell-failure-diagnostics.js.map +1 -0
- package/dist/tools/tool-registry.d.ts +24 -1
- package/dist/tools/tool-registry.d.ts.map +1 -1
- package/dist/ui/assets/{AccountPage-D5vGSe-z.js → AccountPage-Co_hJpj2.js} +1 -1
- package/dist/ui/assets/{index-eUOMUZwn.js → index-_ERynoIs.js} +2 -2
- package/dist/ui/index.html +1 -1
- package/package.json +1 -1
- package/dist/tools/squadrules-challenge-display.d.ts +0 -4
- package/dist/tools/squadrules-challenge-display.d.ts.map +0 -1
- package/dist/tools/squadrules-challenge-display.js +0 -81
- package/dist/tools/squadrules-challenge-display.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: "5.
|
|
2
|
+
version: "5.14.0"
|
|
3
3
|
slug: critic-loop-guide
|
|
4
4
|
title: Critic Loop Integration and Mutation Gate Guide
|
|
5
5
|
---
|
|
@@ -118,21 +118,34 @@ Example ```json
|
|
|
118
118
|
{"contract":{"type":"shell","shell":{"cmd":"test \"$(git rev-parse --abbrev-ref HEAD)\" != main && git rev-parse --git-common-dir | grep -q worktrees","interpreter":"bash","timeout_seconds":5},"required":true}}
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
## How to
|
|
121
|
+
## How to Invoke Critic-Loop from an Adapter
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
Reach `critic-loop` at a phase boundary with a **`subagent` contract**, never a
|
|
124
|
+
`forward` contract. A `forward` hop keeps the review on the thread that produced
|
|
125
|
+
the work: the same agent reads the critic's instructions, performs them, and
|
|
126
|
+
writes the verdict it is then gated on. The hop names the call the subagent must
|
|
127
|
+
really make, so it cannot substitute an improvised review:
|
|
125
128
|
|
|
126
129
|
### After a planning phase
|
|
127
130
|
|
|
128
131
|
Example ```json
|
|
129
|
-
{"contract":{"type":"forward","forward":{"
|
|
132
|
+
{"contract":{"type":"subagent","subagent":{"context":"Run the critic on the plan and return its actual report. Call the forward tool with uri squadrules://adapter/critic-loop, submit the work from $WORK_MANIFEST with the requirement list, and let the critic write $VERDICT_FILE. Do not review it yourself.","mcp":[{"tool_name":"forward","arguments":{"uri":"squadrules://adapter/critic-loop"}}]},"required":true}}
|
|
130
133
|
```
|
|
131
134
|
|
|
132
135
|
### After an implementation phase
|
|
133
136
|
|
|
134
|
-
Use the same contract. The
|
|
135
|
-
context and
|
|
137
|
+
Use the same contract shape. The subagent receives the calling protocol's
|
|
138
|
+
context, drives `critic-loop` to its end in its own context, and returns only its
|
|
139
|
+
report — the tool transcript never re-enters the caller's reasoning.
|
|
140
|
+
|
|
141
|
+
`forward` + slug stays correct for **chain continuation** — handing work to the
|
|
142
|
+
next stage of the same effort, or to a reusable sub-adapter that is not auditing
|
|
143
|
+
the caller. The test is not "does it link to an adapter" but "is the linked
|
|
144
|
+
adapter the caller's auditor". Separation is the point: a review the audited agent
|
|
145
|
+
runs on itself restates its work instead of checking it.
|
|
146
|
+
|
|
147
|
+
A host with no subagent facility cannot satisfy this hop. Report that as a
|
|
148
|
+
blocker; do not fall back to reviewing your own work.
|
|
136
149
|
|
|
137
150
|
### What to submit for review
|
|
138
151
|
|
|
@@ -174,7 +187,8 @@ surfaces the unresolved findings; it prevents a weak agent from thrashing foreve
|
|
|
174
187
|
|
|
175
188
|
### Verdict handoff pattern
|
|
176
189
|
|
|
177
|
-
Critic-loop writes a verdict file. The calling adapter reads
|
|
190
|
+
Critic-loop writes a verdict file in the delegated run. The calling adapter reads
|
|
191
|
+
it:
|
|
178
192
|
|
|
179
193
|
1. Critic-loop writes `$VERDICT_FILE` with `PASS`/`FAIL` on line 1.
|
|
180
194
|
2. Calling adapter's next layer reads the verdict file.
|
|
@@ -188,7 +202,7 @@ review. The correct action is to fix the findings and re-invoke critic-loop.
|
|
|
188
202
|
|
|
189
203
|
### FAIL gate contract (required after every critic-loop invocation)
|
|
190
204
|
|
|
191
|
-
Every adapter that
|
|
205
|
+
Every adapter that invokes critic-loop **must** include a shell contract that
|
|
192
206
|
fails when the verdict is not PASS. This is the mechanical guard that prevents
|
|
193
207
|
weaker agents from proceeding after FAIL:
|
|
194
208
|
|
|
@@ -250,24 +264,30 @@ confirmation gates for remote mutations.
|
|
|
250
264
|
1. **Loop critic-loop until PASS at every major phase boundary** — after planning,
|
|
251
265
|
after implementation, after validation — feeding it the requirement list and
|
|
252
266
|
bounding it with an iteration ceiling.
|
|
253
|
-
2. **
|
|
267
|
+
2. **Invoke the critic from a separate context** — a `subagent` contract, never a
|
|
268
|
+
`forward` contract on the thread that produced the work.
|
|
269
|
+
3. **Do NOT add critic-loop between every layer** — it is a phase-level review,
|
|
254
270
|
not a step-level check.
|
|
255
|
-
|
|
271
|
+
4. **Put one objective proof at each irreversibility boundary** — remote mutation
|
|
256
272
|
or the local precondition that guards it: pre-mutation readiness +
|
|
257
273
|
post-mutation verification, never a human confirmation prompt.
|
|
258
|
-
|
|
274
|
+
5. **Batch reversible, checkable steps into one aggregate strict-conjunction
|
|
259
275
|
proof** instead of one proof per step; never let it degrade to `echo "done"`.
|
|
260
|
-
|
|
276
|
+
6. **Never replace a boundary proof with critic-loop** — critic-loop reviews truth
|
|
261
277
|
after the fact; it does not block an irreversible step.
|
|
262
|
-
|
|
278
|
+
7. **Never add a proof for purely local, reversible operations** — critic-loop
|
|
263
279
|
provides sufficient review.
|
|
280
|
+
8. **Never gate what you cannot observe** — if no shell command can see the
|
|
281
|
+
outcome, state it as an instruction with a completion criterion instead of
|
|
282
|
+
inventing a command that prints `ok`.
|
|
264
283
|
|
|
265
284
|
## Adapter Authoring Checklist
|
|
266
285
|
|
|
267
286
|
When drafting a new adapter, apply this checklist:
|
|
268
287
|
|
|
269
288
|
1. Identify all phase boundaries in the adapter flow.
|
|
270
|
-
2. Add a `
|
|
289
|
+
2. Add a `subagent` critic hop at each boundary — never a `forward` hop to
|
|
290
|
+
`critic-loop`.
|
|
271
291
|
3. Identify all steps that perform irreversible remote mutations.
|
|
272
292
|
4. Add objective solution checks (pre-mutation readiness + post-action
|
|
273
293
|
verification) for each — no `user_input` human-confirmation gate.
|
|
@@ -275,7 +295,8 @@ When drafting a new adapter, apply this checklist:
|
|
|
275
295
|
6. Verify that the critic-loop verdict handoff pattern is present.
|
|
276
296
|
7. Verify that a FAIL gate shell contract follows every critic-loop invocation.
|
|
277
297
|
8. Verify that `train`/`tune` calls include `review_evidence` from the critic.
|
|
278
|
-
9. Ensure the adapter's Reward Signal describes what the critic protects
|
|
298
|
+
9. Ensure the adapter's Reward Signal describes what the critic protects, and
|
|
299
|
+
states what the verdict does **not** prove.
|
|
279
300
|
|
|
280
301
|
Example ```json
|
|
281
302
|
{"contract":{"type":"comment","comment":{"min_length":80},"required":true}}
|
|
@@ -288,6 +309,6 @@ Only reachable after all prior steps are solved.
|
|
|
288
309
|
The agent can now:
|
|
289
310
|
1. Decide when to use critic-loop versus solution checks
|
|
290
311
|
2. Identify irreversible remote mutations that need hard gates
|
|
291
|
-
3.
|
|
312
|
+
3. Invoke critic-loop from a delegated subagent at the correct phase boundaries
|
|
292
313
|
4. Apply the mutation gate pattern for remote-system actions
|
|
293
314
|
5. Avoid unnecessary solution checks for local or read-only operations
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: "5.
|
|
2
|
+
version: "5.14.0"
|
|
3
3
|
slug: critic-loop
|
|
4
4
|
title: Critic Loop
|
|
5
5
|
---
|
|
@@ -20,8 +20,11 @@ by an explicit iteration ceiling (see Verdict).
|
|
|
20
20
|
## Activation Patterns
|
|
21
21
|
|
|
22
22
|
**Typically invoked by:** another protocol at the end of a plan, implement,
|
|
23
|
-
validation, or review phase
|
|
24
|
-
`
|
|
23
|
+
validation, or review phase, reached from a `subagent` contract whose
|
|
24
|
+
`subagent.mcp` names `forward` with the stored adapter URI
|
|
25
|
+
`squadrules://adapter/critic-loop`. The critic runs in the delegated context, not
|
|
26
|
+
on the audited agent's thread — that separation is why the type is `subagent` and
|
|
27
|
+
not `forward`.
|
|
25
28
|
|
|
26
29
|
**Can be invoked directly when agent needs:**
|
|
27
30
|
- "review phase output" / "verify plan" / "audit implementation"
|
|
@@ -35,6 +38,8 @@ validation, or review phase via `forward` with the stored adapter URI
|
|
|
35
38
|
- Trust the executor's assertions without independent evidence.
|
|
36
39
|
- Classify a claim as `verified` based only on absence of contradiction.
|
|
37
40
|
- Keep investigating after a precondition failure that blocks verification.
|
|
41
|
+
- Re-delegate this review to another subagent: you are the separation the caller
|
|
42
|
+
asked for, and nesting a second layer of delegation hides the verdict's author.
|
|
38
43
|
|
|
39
44
|
**Must Always:**
|
|
40
45
|
- Extract claims before investigating.
|
|
@@ -43,6 +48,8 @@ validation, or review phase via `forward` with the stored adapter URI
|
|
|
43
48
|
- Check every item in the supplied requirement list for coverage; a missing
|
|
44
49
|
requirement is a FAIL even when the output is internally consistent.
|
|
45
50
|
- Include confidence in every verdict and failure class in every FAIL verdict.
|
|
51
|
+
- Write `$VERDICT_FILE` on **every** path, including an early-abort, so the
|
|
52
|
+
caller's gate always reads a real verdict instead of failing on a missing file.
|
|
46
53
|
- Preserve the boundary between execution and review.
|
|
47
54
|
|
|
48
55
|
**Good trigger examples:**
|
|
@@ -117,14 +124,10 @@ are broken.
|
|
|
117
124
|
- failure class = `verification_blocked`
|
|
118
125
|
- confidence = `Low`
|
|
119
126
|
- write focused diagnostics
|
|
120
|
-
- skip all later steps
|
|
127
|
+
- write `$VERDICT_FILE` with those diagnostics, then skip all later steps
|
|
121
128
|
|
|
122
129
|
**Output:** verified preconditions or early-abort diagnostics
|
|
123
130
|
|
|
124
|
-
```json
|
|
125
|
-
{"contract":{"type":"shell","shell":{"cmd":"test -f \"${WORK_MANIFEST:-}\" || test -f \"${INPUT_FILE:-}\"","interpreter":"bash","timeout_seconds":3},"required":true}}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
131
|
## Resolve Submission
|
|
129
132
|
|
|
130
133
|
Turn the submission into the material under review. What cannot be resolved is
|
|
@@ -157,10 +160,6 @@ never guessed at.
|
|
|
157
160
|
|
|
158
161
|
**Output:** resolved work inventory for the audit
|
|
159
162
|
|
|
160
|
-
```json
|
|
161
|
-
{"contract":{"type":"subagent","subagent":{"context":"Resolve the work submission into reviewable material: read the manifest, resolve each item by kind from work.root, and record the resolved inventory with per-item status."},"required":true}}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
163
|
## Audit
|
|
165
164
|
|
|
166
165
|
Perform bounded adversarial review of the target against the resolved work
|
|
@@ -218,10 +217,6 @@ Any `missing` item — or any `partial` high-risk item — forces FAIL with
|
|
|
218
217
|
|
|
219
218
|
**Output:** structured audit findings for the verdict step
|
|
220
219
|
|
|
221
|
-
```json
|
|
222
|
-
{"contract":{"type":"subagent","subagent":{"context":"Perform bounded adversarial audit: extract claims, investigate with scope discipline, gather evidence by priority hierarchy, produce claim verdicts, review phase boundary, and check requirement coverage."},"required":true}}
|
|
223
|
-
```
|
|
224
|
-
|
|
225
220
|
## Verdict
|
|
226
221
|
|
|
227
222
|
Turn the audit into a final PASS / FAIL result.
|
|
@@ -246,7 +241,8 @@ Turn the audit into a final PASS / FAIL result.
|
|
|
246
241
|
- Line 1 is `PASS` → the loop is satisfied; the calling adapter may continue.
|
|
247
242
|
- Line 1 is `FAIL` → the calling adapter **MUST NOT** proceed to reward, **MUST
|
|
248
243
|
NOT** ask the user for approval, and **MUST NOT** continue. It must address the
|
|
249
|
-
findings, increment `context.iteration`, and re-invoke critic-loop
|
|
244
|
+
findings, increment `context.iteration`, and re-invoke critic-loop from a fresh
|
|
245
|
+
delegated subagent — never on the thread that produced the work under review.
|
|
250
246
|
- `failure_class: iteration_ceiling` → stop looping and surface the unresolved
|
|
251
247
|
findings; never silently pass. The ceiling bounds the loop so a weak agent
|
|
252
248
|
cannot thrash forever.
|
|
@@ -265,3 +261,14 @@ The phase output has been independently challenged and looped until satisfied. T
|
|
|
265
261
|
resulting verdict is more truthful because it is based on extracted claims,
|
|
266
262
|
explicit evidence, contradiction search, requirement-by-requirement coverage, and
|
|
267
263
|
a clean boundary between execution and review.
|
|
264
|
+
|
|
265
|
+
The single contract on this adapter is the verdict-file syntax gate: it is the
|
|
266
|
+
one artifact the critic produces, and everything before it is the critic's own
|
|
267
|
+
reasoning. The precondition, submission-resolution, and audit steps carry no
|
|
268
|
+
contracts because a contract gates an outcome, not a step, and a critic that
|
|
269
|
+
gates itself inward re-delegates work it was delegated to perform.
|
|
270
|
+
|
|
271
|
+
That gate asserts the verdict file's **shape**, not the review's soundness: a
|
|
272
|
+
`PASS` is this critic's judgment, and the separation that makes it worth
|
|
273
|
+
something is that a critic was run apart from the executor. The caller's own
|
|
274
|
+
`PASS` gate proves only that a file was written saying `PASS`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: "5.
|
|
2
|
+
version: "5.14.0"
|
|
3
3
|
slug: protocol-linking-guide
|
|
4
4
|
title: Adapter Linking Guide
|
|
5
5
|
---
|
|
@@ -50,7 +50,12 @@ cohesive concern.
|
|
|
50
50
|
- the adapter exceeds 350 lines
|
|
51
51
|
- weaker models cannot follow the full adapter in one pass
|
|
52
52
|
- runtime routing to different adapters is needed (Router pattern)
|
|
53
|
-
- a step is reusable across multiple parent adapters (e.g.
|
|
53
|
+
- a step is reusable across multiple parent adapters (e.g. a shared
|
|
54
|
+
deployment-check adapter)
|
|
55
|
+
|
|
56
|
+
A review is **not** a chain link: reaching `critic-loop` to audit the current
|
|
57
|
+
run's work is a `subagent` hop, because a `forward` hop leaves the critic on the
|
|
58
|
+
thread that made the mistakes.
|
|
54
59
|
|
|
55
60
|
Chaining is NOT a replacement for layers. A 6-step adapter that fits in 350
|
|
56
61
|
lines should stay as one adapter with 6 H2 layers.
|
|
@@ -118,10 +123,12 @@ To run an extension adapter, call **`forward`** with
|
|
|
118
123
|
Both system and user-authored adapters chain using slugs in `next_action`:
|
|
119
124
|
|
|
120
125
|
```text
|
|
121
|
-
call forward with squadrules://adapter/critic-loop ...
|
|
122
126
|
call forward with squadrules://adapter/implement-terraform ...
|
|
123
127
|
```
|
|
124
128
|
|
|
129
|
+
A review hop is not a chain link — reach `critic-loop` from a `subagent` contract
|
|
130
|
+
whose `subagent.mcp` names `forward`.
|
|
131
|
+
|
|
125
132
|
Slugs are globally unique (enforced by `train`), so resolution is
|
|
126
133
|
deterministic — no scoring, no ambiguity.
|
|
127
134
|
|