@squadrules/mcp 5.12.1 → 5.13.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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/embed-docs/mem/README.md +12 -12
- package/dist/embed-docs/mem/adapter-migration.md +7 -7
- package/dist/embed-docs/mem/author-adapter.md +4 -4
- package/dist/embed-docs/mem/bulk-insert-adapters-via-cli.md +1 -1
- package/dist/embed-docs/mem/challenge-type-guide.md +35 -25
- package/dist/embed-docs/mem/critic-loop-guide.md +14 -15
- package/dist/embed-docs/mem/critic-loop.md +3 -3
- package/dist/embed-docs/mem/protocol-linking-guide.md +13 -14
- package/dist/embed-docs/mem/refine-search.md +1 -1
- package/dist/resources/embedded-mcp-resources.js +9 -9
- package/dist/resources/embedded-mcp-resources.js.map +1 -1
- package/dist/services/memory/validate-protocol-structure.d.ts.map +1 -1
- package/dist/services/memory/validate-protocol-structure.js +39 -17
- package/dist/services/memory/validate-protocol-structure.js.map +1 -1
- package/dist/services/proof-of-work-store.d.ts +4 -5
- package/dist/services/proof-of-work-store.d.ts.map +1 -1
- package/dist/services/proof-of-work-store.js.map +1 -1
- package/dist/tools/forward-contract-match.d.ts +20 -0
- package/dist/tools/forward-contract-match.d.ts.map +1 -0
- package/dist/tools/forward-contract-match.js +45 -0
- package/dist/tools/forward-contract-match.js.map +1 -0
- package/dist/tools/forward-helpers.js +2 -2
- package/dist/tools/forward-helpers.js.map +1 -1
- package/dist/tools/forward-trace.d.ts.map +1 -1
- package/dist/tools/forward-trace.js +5 -8
- package/dist/tools/forward-trace.js.map +1 -1
- package/dist/tools/forward-view.d.ts.map +1 -1
- package/dist/tools/forward-view.js +5 -7
- package/dist/tools/forward-view.js.map +1 -1
- package/dist/tools/forward_schema.d.ts +25 -25
- package/dist/tools/forward_schema.d.ts.map +1 -1
- package/dist/tools/forward_schema.js +16 -24
- 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 +43 -12
- 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 +19 -14
- package/dist/tools/next-pow-helpers.js.map +1 -1
- package/dist/tools/next-previous-step.js +4 -4
- package/dist/tools/next-previous-step.js.map +1 -1
- package/dist/tools/next-proof-types.d.ts +2 -4
- package/dist/tools/next-proof-types.d.ts.map +1 -1
- package/dist/tools/next_schema.d.ts +20 -18
- package/dist/tools/next_schema.d.ts.map +1 -1
- package/dist/tools/next_schema.js +11 -13
- package/dist/tools/next_schema.js.map +1 -1
- package/dist/tools/squadrules-challenge-display.d.ts.map +1 -1
- package/dist/tools/squadrules-challenge-display.js +8 -11
- package/dist/tools/squadrules-challenge-display.js.map +1 -1
- package/dist/tools/tool-registry.d.ts +12 -11
- package/dist/tools/tool-registry.d.ts.map +1 -1
- package/dist/types/memory.d.ts +7 -5
- package/dist/types/memory.d.ts.map +1 -1
- package/dist/ui/assets/{AccountPage-BhneCJCw.js → AccountPage-Dx42Ohh5.js} +1 -1
- package/dist/ui/assets/ChallengeCard-CdDjzVMc.js +1 -0
- package/dist/ui/assets/{ProtocolDetailPage-kPGgNobg.js → ProtocolDetailPage-DaLHkEk6.js} +1 -1
- package/dist/ui/assets/ProtocolEditPage-si6FjgFJ.js +5 -0
- package/dist/ui/assets/RunGuidedPage-51zvt69k.js +1 -0
- package/dist/ui/assets/{SkillBundlePage-DV9CXjfI.js → SkillBundlePage-DjISl_TJ.js} +1 -1
- package/dist/ui/assets/{export-skill-zip-seCWjJSV.js → export-skill-zip-CHfMqCRE.js} +1 -1
- package/dist/ui/assets/index-CLF3sr9I.css +2 -0
- package/dist/ui/assets/{index-rCZd_925.js → index-v9_N37Or.js} +3 -3
- package/dist/ui/index.html +2 -2
- package/package.json +1 -1
- package/dist/tools/mcp-contract-match.d.ts +0 -21
- package/dist/tools/mcp-contract-match.d.ts.map +0 -1
- package/dist/tools/mcp-contract-match.js +0 -78
- package/dist/tools/mcp-contract-match.js.map +0 -1
- package/dist/ui/assets/ChallengeCard-DVXo4j0b.js +0 -1
- package/dist/ui/assets/ProtocolEditPage-IvFbUiUS.js +0 -5
- package/dist/ui/assets/RunGuidedPage-Db_CQ-9q.js +0 -1
- package/dist/ui/assets/index-BGjXjHf7.css +0 -2
|
@@ -19,7 +19,7 @@ observable verification over polished but weak wording.
|
|
|
19
19
|
**Autonomy (AI-ownership).** The bundle is written for autonomous execution:
|
|
20
20
|
adapters resolve intent from context, run critic-loop in a loop until it returns
|
|
21
21
|
`PASS`, and gate irreversible remote mutations with objective pre/post contracts
|
|
22
|
-
(shell/
|
|
22
|
+
(shell/forward) rather than human confirmation. They do **not** stop to ask a human to
|
|
23
23
|
approve or acknowledge. Human escalation is reserved for genuinely ambiguous intent
|
|
24
24
|
or a hard blocker (a required tool/auth that cannot be established automatically).
|
|
25
25
|
|
|
@@ -28,9 +28,9 @@ observable verification available:
|
|
|
28
28
|
|
|
29
29
|
1. `shell` — for file/state/command verification. **`interpreter` is REQUIRED**
|
|
30
30
|
(allowed: `bash`, `sh`, `python3`, `python`, `node`).
|
|
31
|
-
2. `
|
|
32
|
-
`
|
|
33
|
-
|
|
31
|
+
2. `forward` — **links to another adapter**. Must set `forward.target` matching
|
|
32
|
+
`squadrules://adapter/<slug>`. Bare MCP tool calls are not valid forward
|
|
33
|
+
contracts — delegate them inside a `subagent` (rung 3).
|
|
34
34
|
3. `subagent` — for delegated work that requires multi-step reasoning or tool
|
|
35
35
|
orchestration by another agent.
|
|
36
36
|
4. `user_input` — only for genuine human decisions.
|
|
@@ -61,7 +61,7 @@ author-adapter (Author) → forward(squadrules://adapter/critic-loop) → critic
|
|
|
61
61
|
| File | Slug | Purpose |
|
|
62
62
|
|------|------|---------|
|
|
63
63
|
| [challenge-type-guide.md](challenge-type-guide.md) | `challenge-type-guide` | Challenge type selection, interpreter choice, and verification patterns |
|
|
64
|
-
| [protocol-linking-guide.md](protocol-linking-guide.md) | `protocol-linking-guide` | Layers vs chains, `activate` vs `forward` + slug, chain-root collapsing,
|
|
64
|
+
| [protocol-linking-guide.md](protocol-linking-guide.md) | `protocol-linking-guide` | Layers vs chains, `activate` vs `forward` + slug, chain-root collapsing, forward-link validation |
|
|
65
65
|
| [critic-loop-guide.md](critic-loop-guide.md) | `critic-loop-guide` | Critic-loop integration rules, mutation gates, solution check vs critic decision table |
|
|
66
66
|
|
|
67
67
|
## Cross-Adapter Linking
|
|
@@ -94,17 +94,17 @@ call forward with squadrules://adapter/implement-terraform and no solution to st
|
|
|
94
94
|
Slugs are globally unique (enforced by `train`), so resolution is
|
|
95
95
|
deterministic — no scoring, no ambiguity.
|
|
96
96
|
|
|
97
|
-
###
|
|
97
|
+
### Forward-link contracts
|
|
98
98
|
|
|
99
|
-
All `
|
|
99
|
+
All `forward` contracts must name their target adapter:
|
|
100
100
|
|
|
101
|
-
```json
|
|
102
|
-
{"contract":{"type":"
|
|
101
|
+
Example ```json
|
|
102
|
+
{"contract":{"type":"forward","forward":{"target":"squadrules://adapter/code-review-policy"},"required":true}}
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
The server validates that `
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
The server validates that the submitted `evidence.target` equals the contract's
|
|
106
|
+
`forward.target`. This proves the agent called `forward` with the correct slug,
|
|
107
|
+
not just any `forward` call.
|
|
108
108
|
|
|
109
109
|
### When to use `activate` vs `forward` + slug
|
|
110
110
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: "5.
|
|
2
|
+
version: "5.13.1"
|
|
3
3
|
slug: adapter-migration
|
|
4
4
|
title: Adapter Migration Workflow
|
|
5
5
|
---
|
|
@@ -78,7 +78,7 @@ Export every adapter from the target space using bulk export:
|
|
|
78
78
|
If the space has no adapters, report this and stop.
|
|
79
79
|
|
|
80
80
|
```json
|
|
81
|
-
{"contract":{"type":"subagent","subagent":{"
|
|
81
|
+
{"contract":{"type":"subagent","subagent":{"context":"Export all adapters from the target space using the export tool with all_adapters: true. Record the total count and extract slug, URI, and content for each adapter."},"required":true}}
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
## Analyze and Transform
|
|
@@ -97,8 +97,8 @@ For each exported adapter, perform structural analysis and apply migrations.
|
|
|
97
97
|
(do NOT auto-split; report as manual review needed).
|
|
98
98
|
5. **Shell interpreter** — every shell contract must include `"interpreter"`
|
|
99
99
|
field with an allowed value (`bash`, `sh`, `python3`, `python`, `node`).
|
|
100
|
-
6. **
|
|
101
|
-
|
|
100
|
+
6. **Forward link** — every `forward` contract must set `forward.target`
|
|
101
|
+
matching `squadrules://adapter/<slug>`.
|
|
102
102
|
|
|
103
103
|
### Transformation rules
|
|
104
104
|
|
|
@@ -114,7 +114,7 @@ For each adapter, produce:
|
|
|
114
114
|
- `transformed_content`: the full updated markdown (when `needs_changes`)
|
|
115
115
|
|
|
116
116
|
```json
|
|
117
|
-
{"contract":{"type":"subagent","subagent":{"
|
|
117
|
+
{"contract":{"type":"subagent","subagent":{"context":"Analyze each exported adapter against structural checks (heading order, contract fences, frontmatter, line count, shell interpreter, forward link). Apply conservative transformations and produce per-adapter status, changes, warnings, and transformed content."},"required":true}}
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
## Report Changes
|
|
@@ -152,7 +152,7 @@ For each `needs_changes` adapter, apply the structural changes:
|
|
|
152
152
|
Do NOT change the adapter's space assignment during migration.
|
|
153
153
|
|
|
154
154
|
```json
|
|
155
|
-
{"contract":{"type":"subagent","subagent":{"
|
|
155
|
+
{"contract":{"type":"subagent","subagent":{"context":"Execute the migration: for each needs_changes adapter, call tune (content-level fixes) or train with force_update (structural changes). Record success/failure per adapter."},"required":true}}
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
## Verify and Report
|
|
@@ -187,7 +187,7 @@ scheme. Every adapter has:
|
|
|
187
187
|
- Correct heading order (Activation Patterns first, Reward Signal last).
|
|
188
188
|
- Proper ` ```json ` contract fences.
|
|
189
189
|
- Shell contracts with `interpreter` field.
|
|
190
|
-
-
|
|
190
|
+
- Forward contracts with a `forward.target` adapter URI.
|
|
191
191
|
- Valid frontmatter with `slug` and optional `version`.
|
|
192
192
|
- Been verified post-migration for structural compliance.
|
|
193
193
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
slug: author-adapter
|
|
3
|
-
version: "5.
|
|
3
|
+
version: "5.13.1"
|
|
4
4
|
title: Author Adapter (Create / Review / Refactor)
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -87,7 +87,7 @@ inferred operation and target, then continue. Escalate to the user only when
|
|
|
87
87
|
the request is genuinely ambiguous and no reasonable default exists.
|
|
88
88
|
|
|
89
89
|
```json
|
|
90
|
-
{"contract":{"type":"subagent","subagent":{"
|
|
90
|
+
{"contract":{"type":"subagent","subagent":{"context":"Resolve the authoring operation (create/review/update) and target adapter from user context. Record the decision."},"required":true}}
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
## Gather Requirements
|
|
@@ -121,7 +121,7 @@ Export the target adapter, read the current markdown, identify the exact gap or
|
|
|
121
121
|
error, and plan the minimal change.
|
|
122
122
|
|
|
123
123
|
```json
|
|
124
|
-
{"contract":{"type":"subagent","subagent":{"
|
|
124
|
+
{"contract":{"type":"subagent","subagent":{"context":"Gather requirements for the resolved operation: collect pattern/details for create, audit checklist for review, or identify the specific issue for update."},"required":true}}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
## Draft Markdown
|
|
@@ -167,7 +167,7 @@ For `review`: write a structured gap report to `$REVIEW_FINDINGS_FILE`.
|
|
|
167
167
|
For `update`: apply the identified change and show a diff-style summary.
|
|
168
168
|
|
|
169
169
|
```json
|
|
170
|
-
{"contract":{"type":"subagent","subagent":{"
|
|
170
|
+
{"contract":{"type":"subagent","subagent":{"context":"Draft the adapter markdown (create), findings report (review), or corrected markdown (update) following all shared drafting rules."},"required":true}}
|
|
171
171
|
```
|
|
172
172
|
|
|
173
173
|
## Critic-Loop Review (create and update only)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: "5.
|
|
2
|
+
version: "5.13.1"
|
|
3
3
|
slug: challenge-type-guide
|
|
4
4
|
title: Challenge Type Selection Guide
|
|
5
5
|
---
|
|
@@ -46,7 +46,7 @@ code — use `shell` or `subagent` instead.
|
|
|
46
46
|
|
|
47
47
|
**Mode before challenge type:**
|
|
48
48
|
- **clarify / approve** → `user_input`
|
|
49
|
-
- **chain to another adapter** → `
|
|
49
|
+
- **chain to another adapter** → `forward` (link to another adapter)
|
|
50
50
|
- **execute or verify local state** → `shell`
|
|
51
51
|
- **delegate to another agent** → `subagent`
|
|
52
52
|
- **pure reasoning with no observable artifact** → `comment`
|
|
@@ -55,7 +55,7 @@ code — use `shell` or `subagent` instead.
|
|
|
55
55
|
|
|
56
56
|
```
|
|
57
57
|
Does the step chain to another adapter via forward?
|
|
58
|
-
├─ YES → "
|
|
58
|
+
├─ YES → "forward" (target: squadrules://adapter/<slug>)
|
|
59
59
|
└─ NO → Does the step produce or verify a file, command result, or system state?
|
|
60
60
|
├─ YES → "shell" (with interpreter)
|
|
61
61
|
└─ NO → Does the step require human approval or choice?
|
|
@@ -68,7 +68,7 @@ Does the step chain to another adapter via forward?
|
|
|
68
68
|
### Challenge JSON Formats
|
|
69
69
|
|
|
70
70
|
**shell** (interpreter is REQUIRED)
|
|
71
|
-
```json
|
|
71
|
+
Example ```json
|
|
72
72
|
{"contract":{"type":"shell","shell":{"cmd":"<command>","interpreter":"bash","timeout_seconds":30},"required":true}}
|
|
73
73
|
```
|
|
74
74
|
|
|
@@ -76,31 +76,41 @@ Allowed interpreters: `bash`, `sh`, `python3`, `python`, `node`. Build tools
|
|
|
76
76
|
(`terraform`, `docker`, `npm`, etc.) are **not** interpreters — wrap them in a
|
|
77
77
|
`bash` command instead.
|
|
78
78
|
|
|
79
|
-
**
|
|
80
|
-
```json
|
|
81
|
-
{"contract":{"type":"
|
|
79
|
+
**forward** (links to another adapter — bare MCP tool calls are not valid)
|
|
80
|
+
Example ```json
|
|
81
|
+
{"contract":{"type":"forward","forward":{"target":"squadrules://adapter/<slug>"},"required":true}}
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
The server validates that `
|
|
85
|
-
|
|
86
|
-
`
|
|
84
|
+
The server validates that the submitted `evidence.target` equals the contract's
|
|
85
|
+
`forward.target`, proving the agent called `forward` with the correct target
|
|
86
|
+
slug. Bare MCP tool calls belong in a `subagent.mcp` list (rung 3), never here.
|
|
87
87
|
|
|
88
88
|
**user_input**
|
|
89
|
-
```json
|
|
89
|
+
Example ```json
|
|
90
90
|
{"contract":{"type":"user_input","user_input":{"prompt":"<specific question>"},"required":true}}
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
**subagent**
|
|
94
|
-
```json
|
|
95
|
-
{"contract":{"type":"subagent","subagent":{"
|
|
93
|
+
**subagent** (rung 2 — delegated judgment)
|
|
94
|
+
Example ```json
|
|
95
|
+
{"contract":{"type":"subagent","subagent":{"context":"<task description>"},"required":true}}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Use `subagent` when a step delegates work to another agent rather than executing
|
|
99
|
+
it directly. The `context` field provides task-specific guidance; the mandatory
|
|
100
|
+
delegation instruction is appended automatically. Proof is `evidence.report` —
|
|
101
|
+
the subagent's actual report, not your summary of it.
|
|
102
|
+
|
|
103
|
+
**subagent.mcp** (rung 3 — delegated MCP tool work; optional)
|
|
104
|
+
Example ```json
|
|
105
|
+
{"contract":{"type":"subagent","subagent":{"context":"Export all adapters and report slugs and versions","mcp":[{"tool_name":"export","arguments":{"all_adapters":true}}]},"required":true}}
|
|
96
106
|
```
|
|
97
107
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
108
|
+
`subagent.mcp` names the real MCP tool calls the **subagent** must make. The tool
|
|
109
|
+
transcript stays in the subagent's context and never reaches yours; proof is
|
|
110
|
+
still `evidence.report`. Omit the field for rung-2 judgment work.
|
|
101
111
|
|
|
102
112
|
**comment** (last resort — max 1 per adapter, closing ACK only)
|
|
103
|
-
```json
|
|
113
|
+
Example ```json
|
|
104
114
|
{"contract":{"type":"comment","comment":{"min_length":50},"required":true}}
|
|
105
115
|
```
|
|
106
116
|
|
|
@@ -123,14 +133,14 @@ Every solution follows the same envelope:
|
|
|
123
133
|
{"type":"shell","outcome":"success","evidence":{"exit_code":0,"stdout":"...","stderr":"","duration_seconds":1.2}}
|
|
124
134
|
```
|
|
125
135
|
|
|
126
|
-
**
|
|
136
|
+
**forward solution**
|
|
127
137
|
```json
|
|
128
|
-
{"type":"
|
|
138
|
+
{"type":"forward","outcome":"success","evidence":{"target":"squadrules://adapter/critic-loop","success":true}}
|
|
129
139
|
```
|
|
130
140
|
|
|
131
141
|
**subagent solution**
|
|
132
142
|
```json
|
|
133
|
-
{"type":"subagent","outcome":"success","evidence":{"
|
|
143
|
+
{"type":"subagent","outcome":"success","evidence":{"report":"<the subagent's actual report>"}}
|
|
134
144
|
```
|
|
135
145
|
|
|
136
146
|
**comment solution**
|
|
@@ -225,8 +235,8 @@ shell, then call `critic-loop` for adversarial review.
|
|
|
225
235
|
**Chain-link via forward + slug** — layer N's contract requires `forward` with a
|
|
226
236
|
specific adapter slug. Use when the adapter exceeds 350 lines or needs
|
|
227
237
|
multi-path routing. Example:
|
|
228
|
-
```json
|
|
229
|
-
{"contract":{"type":"
|
|
238
|
+
Example ```json
|
|
239
|
+
{"contract":{"type":"forward","forward":{"target":"squadrules://adapter/implement-plan"},"required":true}}
|
|
230
240
|
```
|
|
231
241
|
|
|
232
242
|
## Artifacts for Shell Contracts
|
|
@@ -242,7 +252,7 @@ rather than inlining it in the contract JSON:
|
|
|
242
252
|
|
|
243
253
|
This keeps adapter markdown clean and makes scripts independently versionable.
|
|
244
254
|
|
|
245
|
-
```json
|
|
255
|
+
Example ```json
|
|
246
256
|
{"contract":{"type":"comment","comment":{"min_length":30},"required":true}}
|
|
247
257
|
```
|
|
248
258
|
|
|
@@ -255,6 +265,6 @@ The agent can now:
|
|
|
255
265
|
2. match challenge type to the step's mode
|
|
256
266
|
3. choose the right interpreter (bash, python3, node)
|
|
257
267
|
4. apply working-directory and security rules
|
|
258
|
-
5. use forward
|
|
268
|
+
5. use forward contracts for chain links
|
|
259
269
|
6. use subagent contracts for delegated work
|
|
260
270
|
7. apply stronger verification patterns instead of weak comment checks
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: "5.
|
|
2
|
+
version: "5.13.1"
|
|
3
3
|
slug: critic-loop-guide
|
|
4
4
|
title: Critic Loop Integration and Mutation Gate Guide
|
|
5
5
|
---
|
|
@@ -83,7 +83,7 @@ review with critic-loop instead of adding a hoop.
|
|
|
83
83
|
| Read data from API | No | Read-only |
|
|
84
84
|
| Compute / transform data | No | Local operation |
|
|
85
85
|
|
|
86
|
-
```json
|
|
86
|
+
Example ```json
|
|
87
87
|
{"contract":{"type":"comment","comment":{"min_length":30},"required":true}}
|
|
88
88
|
```
|
|
89
89
|
|
|
@@ -99,7 +99,7 @@ Split proofs by **reversibility cost**, not by step count:
|
|
|
99
99
|
- **The aggregate proof must be a strict conjunction** that re-verifies every
|
|
100
100
|
sub-condition (`A && B && C && echo OK`):
|
|
101
101
|
|
|
102
|
-
```json
|
|
102
|
+
Example ```json
|
|
103
103
|
{"contract":{"type":"shell","shell":{"cmd":"test -f \"$OUT_A\" && test -f \"$OUT_B\" && grep -q \"$EXPECTED\" \"$OUT_A\" && echo OK","interpreter":"bash","timeout_seconds":10},"required":true}}
|
|
104
104
|
```
|
|
105
105
|
|
|
@@ -114,20 +114,19 @@ The cheapest proof is the precondition that stops an irreversible mistake before
|
|
|
114
114
|
it happens — for example, confirm you are on a throwaway worktree and branch (not
|
|
115
115
|
`main`, not the human's active checkout) **before** making changes:
|
|
116
116
|
|
|
117
|
-
```json
|
|
117
|
+
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
121
|
## How to Chain Critic-Loop into an Adapter
|
|
122
122
|
|
|
123
123
|
Use `forward` + slug to invoke `critic-loop` at phase boundaries. The standard
|
|
124
|
-
pattern is a `
|
|
125
|
-
`critic-loop` slug:
|
|
124
|
+
pattern is a `forward` contract naming the `critic-loop` slug:
|
|
126
125
|
|
|
127
126
|
### After a planning phase
|
|
128
127
|
|
|
129
|
-
```json
|
|
130
|
-
{"contract":{"type":"
|
|
128
|
+
Example ```json
|
|
129
|
+
{"contract":{"type":"forward","forward":{"target":"squadrules://adapter/critic-loop"},"required":true}}
|
|
131
130
|
```
|
|
132
131
|
|
|
133
132
|
### After an implementation phase
|
|
@@ -153,7 +152,7 @@ Record `work` in the handoff file pointed to by `$WORK_MANIFEST`, as flat keys
|
|
|
153
152
|
`kind:`, `root:`, then `items:` with one item per line — so the precondition
|
|
154
153
|
stays a machine-checkable file test instead of prose:
|
|
155
154
|
|
|
156
|
-
```json
|
|
155
|
+
Example ```json
|
|
157
156
|
{"contract":{"type":"shell","shell":{"cmd":"test -f \"${WORK_MANIFEST:-}\" || test -f \"${INPUT_FILE:-}\"","interpreter":"bash","timeout_seconds":3},"required":true}}
|
|
158
157
|
```
|
|
159
158
|
|
|
@@ -193,7 +192,7 @@ Every adapter that chains critic-loop **must** include a shell contract that
|
|
|
193
192
|
fails when the verdict is not PASS. This is the mechanical guard that prevents
|
|
194
193
|
weaker agents from proceeding after FAIL:
|
|
195
194
|
|
|
196
|
-
```json
|
|
195
|
+
Example ```json
|
|
197
196
|
{"contract":{"type":"shell","shell":{"cmd":"head -1 \"$VERDICT_FILE\" | grep -qi '^PASS$'","interpreter":"bash","timeout_seconds":5},"required":true}}
|
|
198
197
|
```
|
|
199
198
|
|
|
@@ -225,10 +224,10 @@ objective, machine-checkable contracts instead:
|
|
|
225
224
|
|
|
226
225
|
### Pre-mutation readiness (objective, no human prompt)
|
|
227
226
|
|
|
228
|
-
Assert the preconditions with a shell or
|
|
227
|
+
Assert the preconditions with a shell or forward contract so the action only runs from a
|
|
229
228
|
valid state — never with a `user_input` "are you sure?" prompt:
|
|
230
229
|
|
|
231
|
-
```json
|
|
230
|
+
Example ```json
|
|
232
231
|
{"contract":{"type":"shell","shell":{"cmd":"test -n \"$TARGET_REPO\" && test -n \"$TARGET_BRANCH\"","interpreter":"bash","timeout_seconds":5},"required":true}}
|
|
233
232
|
```
|
|
234
233
|
|
|
@@ -238,8 +237,8 @@ Confirm the mutation actually took effect by reading the remote state back.
|
|
|
238
237
|
Use a `subagent` contract when the verification requires multi-step reasoning
|
|
239
238
|
or tool orchestration beyond a single shell command:
|
|
240
239
|
|
|
241
|
-
```json
|
|
242
|
-
{"contract":{"type":"subagent","subagent":{"
|
|
240
|
+
Example ```json
|
|
241
|
+
{"contract":{"type":"subagent","subagent":{"context":"Verify the remote mutation took effect: read back the created/updated resource and confirm its state matches the intended outcome."},"required":true}}
|
|
243
242
|
```
|
|
244
243
|
|
|
245
244
|
The guarantee comes from critic-loop (truth of intent) plus these objective
|
|
@@ -278,7 +277,7 @@ When drafting a new adapter, apply this checklist:
|
|
|
278
277
|
8. Verify that `train`/`tune` calls include `review_evidence` from the critic.
|
|
279
278
|
9. Ensure the adapter's Reward Signal describes what the critic protects.
|
|
280
279
|
|
|
281
|
-
```json
|
|
280
|
+
Example ```json
|
|
282
281
|
{"contract":{"type":"comment","comment":{"min_length":80},"required":true}}
|
|
283
282
|
```
|
|
284
283
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: "5.
|
|
2
|
+
version: "5.13.1"
|
|
3
3
|
slug: critic-loop
|
|
4
4
|
title: Critic Loop
|
|
5
5
|
---
|
|
@@ -158,7 +158,7 @@ never guessed at.
|
|
|
158
158
|
**Output:** resolved work inventory for the audit
|
|
159
159
|
|
|
160
160
|
```json
|
|
161
|
-
{"contract":{"type":"subagent","subagent":{"
|
|
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
162
|
```
|
|
163
163
|
|
|
164
164
|
## Audit
|
|
@@ -219,7 +219,7 @@ Any `missing` item — or any `partial` high-risk item — forces FAIL with
|
|
|
219
219
|
**Output:** structured audit findings for the verdict step
|
|
220
220
|
|
|
221
221
|
```json
|
|
222
|
-
{"contract":{"type":"subagent","subagent":{"
|
|
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
223
|
```
|
|
224
224
|
|
|
225
225
|
## Verdict
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: "5.
|
|
2
|
+
version: "5.13.1"
|
|
3
3
|
slug: protocol-linking-guide
|
|
4
4
|
title: Adapter Linking Guide
|
|
5
5
|
---
|
|
@@ -125,21 +125,20 @@ call forward with squadrules://adapter/implement-terraform ...
|
|
|
125
125
|
Slugs are globally unique (enforced by `train`), so resolution is
|
|
126
126
|
deterministic — no scoring, no ambiguity.
|
|
127
127
|
|
|
128
|
-
##
|
|
128
|
+
## Forward-link contracts for chain links
|
|
129
129
|
|
|
130
|
-
All `
|
|
131
|
-
`arguments.uri` pointing to the target adapter slug:
|
|
130
|
+
All `forward` contracts MUST set `forward.target` to the target adapter slug:
|
|
132
131
|
|
|
133
|
-
```json
|
|
134
|
-
{"contract":{"type":"
|
|
132
|
+
Example ```json
|
|
133
|
+
{"contract":{"type":"forward","forward":{"target":"squadrules://adapter/code-review-policy"},"required":true}}
|
|
135
134
|
```
|
|
136
135
|
|
|
137
|
-
The server validates that `
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
The server validates that the submitted `evidence.target` equals the contract's
|
|
137
|
+
`forward.target`. This proves the agent called `forward` with the correct slug,
|
|
138
|
+
not just any `forward` call.
|
|
140
139
|
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
A `forward` contract without `forward.target` is **not valid** — every forward
|
|
141
|
+
contract must specify its target adapter.
|
|
143
142
|
|
|
144
143
|
## Chain-root collapsing
|
|
145
144
|
|
|
@@ -181,11 +180,11 @@ and directing the agent to start from the chain root if those inputs are missing
|
|
|
181
180
|
| Personal adapter (MCP database) | **Nothing** — must be self-contained | Only via `activate` (runtime discovery) |
|
|
182
181
|
|
|
183
182
|
Personal adapters use `subagent` or `comment` contracts to describe what the
|
|
184
|
-
agent should do next, not `
|
|
183
|
+
agent should do next, not `forward` contracts to other personal adapters.
|
|
185
184
|
A personal adapter that chains to `squadrules://adapter/some-personal-slug`
|
|
186
185
|
will fail at runtime when that slug does not exist in the caller's MCP database.
|
|
187
186
|
|
|
188
|
-
```json
|
|
187
|
+
Example ```json
|
|
189
188
|
{"contract":{"type":"comment","comment":{"min_length":30},"required":true}}
|
|
190
189
|
```
|
|
191
190
|
|
|
@@ -197,7 +196,7 @@ The agent can now:
|
|
|
197
196
|
1. decide when to use layers vs chains
|
|
198
197
|
2. choose `activate` vs `forward` + slug correctly
|
|
199
198
|
3. use slug-based linking for all adapters (system and user)
|
|
200
|
-
4. write valid
|
|
199
|
+
4. write valid forward contracts with a target adapter URI
|
|
201
200
|
5. implement `chain_root` collapsing with defense-in-depth safeguards
|
|
202
201
|
6. document chaining back (`chain_root` + prerequisites) and chaining forward
|
|
203
202
|
(`forward` with known slugs) for root + extension families
|