@squadrules/mcp 5.10.1 → 5.12.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/README.md +15 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/embed-docs/mem/README.md +34 -37
- package/dist/embed-docs/mem/adapter-migration.md +31 -40
- package/dist/embed-docs/mem/author-adapter.md +91 -229
- package/dist/embed-docs/mem/bulk-insert-adapters-via-cli.md +28 -44
- package/dist/embed-docs/mem/challenge-type-guide.md +89 -205
- package/dist/embed-docs/mem/critic-loop-guide.md +10 -8
- package/dist/embed-docs/mem/critic-loop.md +20 -41
- package/dist/embed-docs/mem/protocol-linking-guide.md +36 -81
- package/dist/embed-docs/mem/refine-search.md +10 -33
- package/dist/resources/embedded-mcp-resources.d.ts +0 -4
- package/dist/resources/embedded-mcp-resources.d.ts.map +1 -1
- package/dist/resources/embedded-mcp-resources.js +10 -14
- package/dist/resources/embedded-mcp-resources.js.map +1 -1
- package/dist/resources/mem-resources-boot.d.ts.map +1 -1
- package/dist/resources/mem-resources-boot.js +6 -1
- package/dist/resources/mem-resources-boot.js.map +1 -1
- package/dist/runtime/boot-local-runtime.d.ts.map +1 -1
- package/dist/runtime/boot-local-runtime.js +9 -0
- package/dist/runtime/boot-local-runtime.js.map +1 -1
- package/dist/services/forward-runtime-store.d.ts +1 -5
- package/dist/services/forward-runtime-store.d.ts.map +1 -1
- package/dist/services/forward-runtime-store.js +1 -35
- package/dist/services/forward-runtime-store.js.map +1 -1
- package/dist/services/memory/validate-protocol-structure.d.ts.map +1 -1
- package/dist/services/memory/validate-protocol-structure.js +73 -4
- package/dist/services/memory/validate-protocol-structure.js.map +1 -1
- package/dist/services/qdrant/memory-retrieval.d.ts.map +1 -1
- package/dist/services/qdrant/memory-retrieval.js +1 -2
- package/dist/services/qdrant/memory-retrieval.js.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-engine.d.ts +7 -0
- package/dist/services/vector-store/lancedb/lance-records-engine.d.ts.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-engine.js +30 -1
- package/dist/services/vector-store/lancedb/lance-records-engine.js.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-mutations.d.ts.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-mutations.js +4 -1
- package/dist/services/vector-store/lancedb/lance-records-mutations.js.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-reads.d.ts.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-reads.js +1 -2
- package/dist/services/vector-store/lancedb/lance-records-reads.js.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-search.d.ts.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-search.js +8 -4
- package/dist/services/vector-store/lancedb/lance-records-search.js.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-write-artifact.d.ts.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-write-artifact.js +3 -1
- package/dist/services/vector-store/lancedb/lance-records-write-artifact.js.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-writes.d.ts.map +1 -1
- package/dist/services/vector-store/lancedb/lance-records-writes.js +6 -4
- package/dist/services/vector-store/lancedb/lance-records-writes.js.map +1 -1
- package/dist/services/vector-store/lancedb/lance-store-metadata.d.ts +21 -0
- package/dist/services/vector-store/lancedb/lance-store-metadata.d.ts.map +1 -0
- package/dist/services/vector-store/lancedb/lance-store-metadata.js +69 -0
- package/dist/services/vector-store/lancedb/lance-store-metadata.js.map +1 -0
- package/dist/stdio/stdio-banner.d.ts.map +1 -1
- package/dist/stdio/stdio-banner.js +1 -3
- package/dist/stdio/stdio-banner.js.map +1 -1
- package/dist/tools/export.d.ts.map +1 -1
- package/dist/tools/export.js +39 -0
- package/dist/tools/export.js.map +1 -1
- package/dist/tools/export_schema.d.ts +12 -0
- package/dist/tools/export_schema.d.ts.map +1 -1
- package/dist/tools/export_schema.js +11 -2
- package/dist/tools/export_schema.js.map +1 -1
- package/dist/tools/forward-trace.d.ts +1 -4
- package/dist/tools/forward-trace.d.ts.map +1 -1
- package/dist/tools/forward-trace.js +1 -111
- package/dist/tools/forward-trace.js.map +1 -1
- package/dist/tools/forward-view.d.ts +0 -1
- package/dist/tools/forward-view.d.ts.map +1 -1
- package/dist/tools/forward-view.js +4 -44
- package/dist/tools/forward-view.js.map +1 -1
- package/dist/tools/forward.d.ts.map +1 -1
- package/dist/tools/forward.js +1 -4
- package/dist/tools/forward.js.map +1 -1
- package/dist/tools/forward_schema.d.ts +0 -46
- package/dist/tools/forward_schema.d.ts.map +1 -1
- package/dist/tools/forward_schema.js +7 -32
- 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 +0 -7
- 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 +0 -3
- package/dist/tools/next-pow-helpers.js.map +1 -1
- package/dist/tools/next_schema.d.ts +4 -4
- package/dist/tools/next_schema.js +2 -2
- package/dist/tools/next_schema.js.map +1 -1
- package/dist/tools/search_output.d.ts.map +1 -1
- package/dist/tools/search_output.js +0 -5
- package/dist/tools/search_output.js.map +1 -1
- package/dist/tools/shell-challenge-invocation.d.ts +8 -2
- package/dist/tools/shell-challenge-invocation.d.ts.map +1 -1
- package/dist/tools/shell-challenge-invocation.js +18 -7
- package/dist/tools/shell-challenge-invocation.js.map +1 -1
- package/dist/tools/squadrules-challenge-display.d.ts.map +1 -1
- package/dist/tools/squadrules-challenge-display.js +7 -9
- package/dist/tools/squadrules-challenge-display.js.map +1 -1
- package/dist/tools/tool-registry.d.ts +23 -22
- package/dist/tools/tool-registry.d.ts.map +1 -1
- package/dist/tools/train.d.ts.map +1 -1
- package/dist/tools/train.js +31 -0
- package/dist/tools/train.js.map +1 -1
- package/dist/tools/train_schema.d.ts +11 -0
- package/dist/tools/train_schema.d.ts.map +1 -1
- package/dist/tools/train_schema.js +13 -4
- package/dist/tools/train_schema.js.map +1 -1
- package/dist/types/memory.d.ts +4 -18
- package/dist/types/memory.d.ts.map +1 -1
- package/dist/ui/assets/{AccountPage-BpPby8tL.js → AccountPage-rmFJddfQ.js} +1 -1
- package/dist/ui/assets/{ProtocolDetailPage-DFe_JOr3.js → ProtocolDetailPage-kPGgNobg.js} +1 -1
- package/dist/ui/assets/{ProtocolEditPage-HAcAGXw7.js → ProtocolEditPage-IvFbUiUS.js} +2 -2
- package/dist/ui/assets/RunGuidedPage-Db_CQ-9q.js +1 -0
- package/dist/ui/assets/{SkillBundlePage-CiMQN0nf.js → SkillBundlePage-DV9CXjfI.js} +1 -1
- package/dist/ui/assets/{export-skill-zip-D8iQY1Dl.js → export-skill-zip-seCWjJSV.js} +1 -1
- package/dist/ui/assets/{index-cB_UoTxa.css → index-BGjXjHf7.css} +1 -1
- package/dist/ui/assets/{index-DLLKkKKa.js → index-D_BmxEln.js} +3 -3
- package/dist/ui/index.html +2 -2
- package/dist/utils/adapter-alias.d.ts +1 -11
- package/dist/utils/adapter-alias.d.ts.map +1 -1
- package/dist/utils/adapter-alias.js +2 -20
- package/dist/utils/adapter-alias.js.map +1 -1
- package/dist/utils/directory-access.d.ts +26 -0
- package/dist/utils/directory-access.d.ts.map +1 -0
- package/dist/utils/directory-access.js +153 -0
- package/dist/utils/directory-access.js.map +1 -0
- package/package.json +1 -3
- package/dist/embed-docs/mem/create-new-protocol.md +0 -44
- package/dist/embed-docs/mem/phase-critic-guide.md +0 -42
- package/dist/embed-docs/mem/phase-critic.md +0 -46
- package/dist/embed-docs/mem/skill-format-guide.md +0 -280
- package/dist/ui/assets/RunGuidedPage-Bewi7Wsx.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# Bundled meta-
|
|
1
|
+
# Bundled meta-adapters
|
|
2
2
|
|
|
3
3
|
This directory contains the bundled SQUADRULES-internal adapters and policy
|
|
4
4
|
documents that are injected into the Squadrules app space at boot.
|
|
5
5
|
|
|
6
|
-
<!-- squadrules-doc-keep: directory-local authority for the shipped meta-
|
|
6
|
+
<!-- squadrules-doc-keep: directory-local authority for the shipped meta-adapter bundle (slugs, versions, chain-linking rules); source of truth for these files, not a restatement of wiki Core Concepts -->
|
|
7
7
|
|
|
8
|
-
Version: **
|
|
8
|
+
Version: **5.0.0**
|
|
9
9
|
|
|
10
10
|
## Philosophy
|
|
11
11
|
|
|
@@ -23,17 +23,32 @@ adapters resolve intent from context, run critic-loop in a loop until it returns
|
|
|
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
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
**Verification ladder (hard enforcement).** Every contract must use the strongest
|
|
27
|
+
observable verification available:
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
1. `shell` — for file/state/command verification. **`interpreter` is REQUIRED**
|
|
30
|
+
(allowed: `bash`, `sh`, `python3`, `python`, `node`).
|
|
31
|
+
2. `mcp` — **forward-links only**. Must use `tool_name: "forward"` with
|
|
32
|
+
`arguments.uri` matching `squadrules://adapter/<slug>`. Bare tool-name-only
|
|
33
|
+
mcp contracts are not valid.
|
|
34
|
+
3. `subagent` — for delegated work that requires multi-step reasoning or tool
|
|
35
|
+
orchestration by another agent.
|
|
36
|
+
4. `user_input` — only for genuine human decisions.
|
|
37
|
+
5. `comment` — last resort. Max 1 per adapter, only as closing ACK for
|
|
38
|
+
knowledge/reference adapters.
|
|
39
|
+
|
|
40
|
+
Bundled mem resources intentionally use **adapter** and **workflow** as preferred
|
|
41
|
+
terms. Avoid bare "protocol" in new copy.
|
|
42
|
+
|
|
43
|
+
## Adapters
|
|
30
44
|
|
|
31
45
|
| File | Slug | Purpose |
|
|
32
46
|
|------|------|---------|
|
|
33
|
-
| [author-adapter.md](author-adapter.md) | `author-adapter` | Authoring adapter — create, review, or
|
|
47
|
+
| [author-adapter.md](author-adapter.md) | `author-adapter` | Authoring adapter — create, review, or update SQUADRULES adapters |
|
|
34
48
|
| [refine-search.md](refine-search.md) | `refine-search` | Refine search — recover user intent after failed `activate` |
|
|
35
49
|
| [critic-loop.md](critic-loop.md) | `critic-loop` | Phase-boundary adversarial review — verify claims against evidence |
|
|
36
50
|
| [adapter-migration.md](adapter-migration.md) | `adapter-migration` | Batch structural migration — update all adapters to latest scheme |
|
|
51
|
+
| [bulk-insert-adapters-via-cli.md](bulk-insert-adapters-via-cli.md) | `bulk-insert-adapters-via-cli` | Bulk train adapters from a local directory via CLI |
|
|
37
52
|
|
|
38
53
|
### Linked authoring flow
|
|
39
54
|
|
|
@@ -45,22 +60,11 @@ author-adapter (Author) → forward(squadrules://adapter/critic-loop) → critic
|
|
|
45
60
|
|
|
46
61
|
| File | Slug | Purpose |
|
|
47
62
|
|------|------|---------|
|
|
48
|
-
| [challenge-type-guide.md](challenge-type-guide.md) | `challenge-type-guide` | Challenge type selection, interpreter choice, and
|
|
49
|
-
| [protocol-linking-guide.md](protocol-linking-guide.md) | `protocol-linking-guide` | Layers vs chains, `activate` vs `forward` + slug,
|
|
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, MCP forward-link validation |
|
|
50
65
|
| [critic-loop-guide.md](critic-loop-guide.md) | `critic-loop-guide` | Critic-loop integration rules, mutation gates, solution check vs critic decision table |
|
|
51
66
|
|
|
52
|
-
##
|
|
53
|
-
|
|
54
|
-
Retired slugs kept as thin one-layer redirects so stored adapters that still
|
|
55
|
-
reference them resolve instead of dangling (see ADR 0012):
|
|
56
|
-
|
|
57
|
-
| File | Slug | Redirects to |
|
|
58
|
-
|------|------|--------------|
|
|
59
|
-
| [phase-critic.md](phase-critic.md) | `phase-critic` | `critic-loop` |
|
|
60
|
-
| [phase-critic-guide.md](phase-critic-guide.md) | `phase-critic-guide` | `critic-loop-guide` |
|
|
61
|
-
| [create-new-protocol.md](create-new-protocol.md) | `create-new-protocol` | `author-adapter` |
|
|
62
|
-
|
|
63
|
-
## Cross-Protocol Linking
|
|
67
|
+
## Cross-Adapter Linking
|
|
64
68
|
|
|
65
69
|
### Layers vs chains
|
|
66
70
|
|
|
@@ -75,7 +79,7 @@ cohesive concern.
|
|
|
75
79
|
- runtime routing to different adapters is needed (Router pattern)
|
|
76
80
|
- a step is reusable across multiple parent adapters (e.g. `critic-loop`)
|
|
77
81
|
|
|
78
|
-
Chaining is NOT a replacement for layers. A 6-step
|
|
82
|
+
Chaining is NOT a replacement for layers. A 6-step adapter that fits in 350
|
|
79
83
|
lines should stay as one adapter with 6 H2 layers.
|
|
80
84
|
|
|
81
85
|
### How forward + slug works
|
|
@@ -90,15 +94,9 @@ call forward with squadrules://adapter/implement-terraform and no solution to st
|
|
|
90
94
|
Slugs are globally unique (enforced by `train`), so resolution is
|
|
91
95
|
deterministic — no scoring, no ambiguity.
|
|
92
96
|
|
|
93
|
-
###
|
|
94
|
-
|
|
95
|
-
A bare `mcp` contract checks only the tool name:
|
|
96
|
-
|
|
97
|
-
```json
|
|
98
|
-
{"contract":{"type":"mcp","mcp":{"tool_name":"forward"},"required":true}}
|
|
99
|
-
```
|
|
97
|
+
### MCP forward-link contracts
|
|
100
98
|
|
|
101
|
-
|
|
99
|
+
All `mcp` contracts must be forward-links with arguments:
|
|
102
100
|
|
|
103
101
|
```json
|
|
104
102
|
{"contract":{"type":"mcp","mcp":{"tool_name":"forward","arguments":{"uri":"squadrules://adapter/code-review-policy"}},"required":true}}
|
|
@@ -116,7 +114,7 @@ called `forward` with the correct slug, not just any `forward` call.
|
|
|
116
114
|
| Target adapter is known at authoring time | `forward` + slug |
|
|
117
115
|
| Target depends on runtime classification the current adapter cannot resolve | `activate` |
|
|
118
116
|
| Linking to the next adapter in a chain | `forward` + slug |
|
|
119
|
-
| Reusable sub-
|
|
117
|
+
| Reusable sub-adapter invoked by multiple parents | `forward` + slug |
|
|
120
118
|
|
|
121
119
|
Never call `activate` just to get a slug you already know — it wastes a
|
|
122
120
|
round-trip and introduces non-determinism.
|
|
@@ -125,7 +123,7 @@ round-trip and introduces non-determinism.
|
|
|
125
123
|
|
|
126
124
|
When a chain has multiple adapters, `activate` might match a mid-chain adapter
|
|
127
125
|
directly. Without protection, the agent would start at the wrong step, missing
|
|
128
|
-
prerequisite context gathered by earlier
|
|
126
|
+
prerequisite context gathered by earlier steps.
|
|
129
127
|
|
|
130
128
|
**`chain_root` frontmatter field** solves this at the server level. Add it to
|
|
131
129
|
every mid-chain adapter:
|
|
@@ -144,11 +142,10 @@ choice's `uri` and `next_action` to point there. Multiple mid-chain matches
|
|
|
144
142
|
from the same chain are deduplicated to a single entry. The agent always
|
|
145
143
|
starts at the chain entry point.
|
|
146
144
|
|
|
147
|
-
**Defense in depth
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
missing. This catches direct `forward` calls that bypass `activate`.
|
|
145
|
+
**Defense in depth:** Each mid-chain adapter should include a **Prerequisites**
|
|
146
|
+
paragraph in its Activation Patterns section that lists required inputs from
|
|
147
|
+
earlier steps and directs the agent to start from the chain root if those inputs
|
|
148
|
+
are missing.
|
|
152
149
|
|
|
153
150
|
**Rules:**
|
|
154
151
|
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: "5.
|
|
2
|
+
version: "5.12.0"
|
|
3
3
|
slug: adapter-migration
|
|
4
|
-
title: Adapter Migration
|
|
4
|
+
title: Adapter Migration Workflow
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Adapter Migration
|
|
7
|
+
# Adapter Migration Workflow
|
|
8
8
|
|
|
9
9
|
Batch-migrate all adapters in a space to the current structural scheme. Exports
|
|
10
10
|
every adapter, applies conservative structural transformations, reports changes
|
|
11
11
|
per adapter, and re-trains the conforming subset autonomously.
|
|
12
12
|
|
|
13
|
-
This
|
|
13
|
+
This workflow handles structural migrations only — it preserves semantic content
|
|
14
14
|
(steps, intent, examples) while updating format, headings, and contract shapes
|
|
15
15
|
to match the latest SQUADRULES requirements.
|
|
16
16
|
|
|
17
17
|
## Activation Patterns
|
|
18
18
|
|
|
19
|
-
**Run this
|
|
19
|
+
**Run this workflow when the user says ANY of:**
|
|
20
20
|
|
|
21
21
|
- "migrate all adapters" / "batch update adapters"
|
|
22
22
|
- "update adapters to latest scheme" / "update adapter structure"
|
|
23
|
-
- "run structural migration" / "migrate
|
|
23
|
+
- "run structural migration" / "migrate adapters"
|
|
24
24
|
- "update all my adapters" / "fix adapter structure"
|
|
25
25
|
- "apply latest adapter format" / "restructure adapters"
|
|
26
|
-
- "run adapter migration" / "migrate to new format"
|
|
27
26
|
|
|
28
27
|
**Trigger pattern:** **migrate** / **batch update** / **structural migration** /
|
|
29
|
-
**update format** + (adapters |
|
|
28
|
+
**update format** + (adapters | all | space).
|
|
30
29
|
|
|
31
30
|
**Must Never:**
|
|
32
31
|
- Alter semantic content (step text, trigger phrases, examples, intent).
|
|
@@ -43,9 +42,8 @@ to match the latest SQUADRULES requirements.
|
|
|
43
42
|
- Preserve the adapter's slug, version, and chain_root fields.
|
|
44
43
|
|
|
45
44
|
**Good trigger examples:**
|
|
46
|
-
- "migrate all my personal adapters to the latest format" → run this
|
|
47
|
-
- "update all adapters in the team space" → run this
|
|
48
|
-
- "we changed the solution scheme, update all adapters" → run this protocol
|
|
45
|
+
- "migrate all my personal adapters to the latest format" → run this workflow
|
|
46
|
+
- "update all adapters in the team space" → run this workflow
|
|
49
47
|
|
|
50
48
|
**Bad trigger examples:**
|
|
51
49
|
- "update this one adapter" → use `author-adapter` with `fix` operation
|
|
@@ -65,7 +63,7 @@ If any tool is unavailable, stop and report the connection blocker with
|
|
|
65
63
|
remediation guidance.
|
|
66
64
|
|
|
67
65
|
```json
|
|
68
|
-
{"contract":{"type":"
|
|
66
|
+
{"contract":{"type":"shell","shell":{"cmd":"echo 'preflight: migration tools verified'","interpreter":"bash","timeout_seconds":10},"required":true}}
|
|
69
67
|
```
|
|
70
68
|
|
|
71
69
|
## Export All Adapters
|
|
@@ -80,7 +78,7 @@ Export every adapter from the target space using bulk export:
|
|
|
80
78
|
If the space has no adapters, report this and stop.
|
|
81
79
|
|
|
82
80
|
```json
|
|
83
|
-
{"contract":{"type":"
|
|
81
|
+
{"contract":{"type":"subagent","subagent":{"instruction":"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}}
|
|
84
82
|
```
|
|
85
83
|
|
|
86
84
|
## Analyze and Transform
|
|
@@ -93,24 +91,21 @@ For each exported adapter, perform structural analysis and apply migrations.
|
|
|
93
91
|
`Reward Signal`. If missing or out of order, flag for restructuring.
|
|
94
92
|
2. **Contract fences** — all contract JSON blocks must use ` ```json ` (not
|
|
95
93
|
plain ` ``` `). If plain fences contain contract JSON, convert them.
|
|
96
|
-
3. **
|
|
97
|
-
become `"contract":`. Apply globally within JSON fences.
|
|
98
|
-
4. **Frontmatter** — must include `slug`. Add `version` if missing. Preserve
|
|
94
|
+
3. **Frontmatter** — must include `slug`. Add `version` if missing. Preserve
|
|
99
95
|
existing `chain_root` when present.
|
|
100
|
-
|
|
96
|
+
4. **Line count** — adapters exceeding 350 lines must be flagged for splitting
|
|
101
97
|
(do NOT auto-split; report as manual review needed).
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
5. **Shell interpreter** — every shell contract must include `"interpreter"`
|
|
99
|
+
field with an allowed value (`bash`, `sh`, `python3`, `python`, `node`).
|
|
100
|
+
6. **MCP forward-link** — every mcp contract must use `tool_name: "forward"`
|
|
101
|
+
with `arguments.uri` matching `squadrules://adapter/<slug>`.
|
|
105
102
|
|
|
106
103
|
### Transformation rules
|
|
107
104
|
|
|
108
105
|
- **Conservative only:** If a transformation might change meaning, skip it and
|
|
109
106
|
flag for manual review.
|
|
110
|
-
- **Reversible:** Every change must be expressible as a diff
|
|
111
|
-
|
|
112
|
-
- **Idempotent:** Running migration twice on the same adapter produces no
|
|
113
|
-
additional changes.
|
|
107
|
+
- **Reversible:** Every change must be expressible as a diff.
|
|
108
|
+
- **Idempotent:** Running migration twice produces no additional changes.
|
|
114
109
|
|
|
115
110
|
For each adapter, produce:
|
|
116
111
|
- `status`: `needs_changes` | `up_to_date` | `needs_manual_review`
|
|
@@ -119,33 +114,28 @@ For each adapter, produce:
|
|
|
119
114
|
- `transformed_content`: the full updated markdown (when `needs_changes`)
|
|
120
115
|
|
|
121
116
|
```json
|
|
122
|
-
{"contract":{"type":"
|
|
117
|
+
{"contract":{"type":"subagent","subagent":{"instruction":"Analyze each exported adapter against structural checks (heading order, contract fences, frontmatter, line count, shell interpreter, mcp forward-link). Apply conservative transformations and produce per-adapter status, changes, warnings, and transformed content."},"required":true}}
|
|
123
118
|
```
|
|
124
119
|
|
|
125
120
|
## Report Changes
|
|
126
121
|
|
|
127
|
-
|
|
122
|
+
Write the migration report to `$MIGRATION_REPORT_FILE` (absolute path under
|
|
123
|
+
`$SQUADRULES_LOCAL_ARTIFACT_DIR`). Record a summary table:
|
|
128
124
|
|
|
129
125
|
| Adapter slug | Status | Changes | Warnings |
|
|
130
126
|
|-------------|--------|---------|----------|
|
|
131
127
|
| example-adapter | needs_changes | 3 structural fixes | 0 |
|
|
132
128
|
| another-adapter | up_to_date | 0 | 0 |
|
|
133
|
-
| complex-adapter | needs_manual_review | 1 fix | line count exceeds 350 |
|
|
134
|
-
|
|
135
|
-
For each adapter with `needs_changes`, show the specific transformations:
|
|
136
|
-
- What was changed (before/after for the affected lines).
|
|
137
|
-
- Why (which structural rule it satisfies).
|
|
138
129
|
|
|
139
|
-
For each adapter with `
|
|
140
|
-
|
|
130
|
+
For each adapter with `needs_changes`, show the specific transformations.
|
|
131
|
+
For each `needs_manual_review`, explain what needs human attention.
|
|
141
132
|
|
|
142
133
|
Apply the migration autonomously:
|
|
143
134
|
- **Apply all** `needs_changes` adapters.
|
|
144
|
-
- **Leave untouched** every `needs_manual_review` adapter
|
|
145
|
-
reason it cannot be auto-fixed.
|
|
135
|
+
- **Leave untouched** every `needs_manual_review` adapter.
|
|
146
136
|
|
|
147
137
|
```json
|
|
148
|
-
{"contract":{"type":"
|
|
138
|
+
{"contract":{"type":"shell","shell":{"cmd":"test -f \"$MIGRATION_REPORT_FILE\" && grep -c '|' \"$MIGRATION_REPORT_FILE\" | test $(cat) -gt 1","interpreter":"bash","timeout_seconds":10},"required":true}}
|
|
149
139
|
```
|
|
150
140
|
|
|
151
141
|
## Execute Migration
|
|
@@ -153,8 +143,8 @@ Apply the migration autonomously:
|
|
|
153
143
|
For each `needs_changes` adapter, apply the structural changes:
|
|
154
144
|
|
|
155
145
|
1. For adapters needing only content-level fixes (heading reorder, fence
|
|
156
|
-
conversion,
|
|
157
|
-
the adapter's URI.
|
|
146
|
+
conversion, interpreter addition): use `tune` with the transformed content
|
|
147
|
+
and the adapter's URI.
|
|
158
148
|
2. For adapters needing structural changes that alter layer count or identity:
|
|
159
149
|
use `train` with `force_update: true` and the transformed content.
|
|
160
150
|
3. Record the outcome (success or failure) for each adapter.
|
|
@@ -162,7 +152,7 @@ For each `needs_changes` adapter, apply the structural changes:
|
|
|
162
152
|
Do NOT change the adapter's space assignment during migration.
|
|
163
153
|
|
|
164
154
|
```json
|
|
165
|
-
{"contract":{"type":"
|
|
155
|
+
{"contract":{"type":"subagent","subagent":{"instruction":"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}}
|
|
166
156
|
```
|
|
167
157
|
|
|
168
158
|
## Verify and Report
|
|
@@ -196,7 +186,8 @@ The adapter library in the target space now conforms to the current structural
|
|
|
196
186
|
scheme. Every adapter has:
|
|
197
187
|
- Correct heading order (Activation Patterns first, Reward Signal last).
|
|
198
188
|
- Proper ` ```json ` contract fences.
|
|
199
|
-
-
|
|
189
|
+
- Shell contracts with `interpreter` field.
|
|
190
|
+
- MCP contracts as forward-links with `arguments.uri`.
|
|
200
191
|
- Valid frontmatter with `slug` and optional `version`.
|
|
201
192
|
- Been verified post-migration for structural compliance.
|
|
202
193
|
|