@squadrules/mcp 5.13.7 → 5.13.8

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 (31) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/cli/commands/export.d.ts +1 -0
  3. package/dist/cli/commands/export.d.ts.map +1 -1
  4. package/dist/cli/commands/export.js +23 -0
  5. package/dist/cli/commands/export.js.map +1 -1
  6. package/dist/embed-docs/mem/README.md +32 -14
  7. package/dist/embed-docs/mem/adapter-migration.md +59 -47
  8. package/dist/embed-docs/mem/author-adapter.md +112 -70
  9. package/dist/embed-docs/mem/bulk-insert-adapters-via-cli.md +59 -24
  10. package/dist/embed-docs/mem/challenge-type-guide.md +43 -13
  11. package/dist/embed-docs/mem/critic-loop-guide.md +38 -17
  12. package/dist/embed-docs/mem/critic-loop.md +24 -17
  13. package/dist/embed-docs/mem/protocol-linking-guide.md +10 -3
  14. package/dist/embed-docs/mem/refine-search.md +1 -1
  15. package/dist/resources/embedded-mcp-resources.js +12 -12
  16. package/dist/resources/embedded-mcp-resources.js.map +1 -1
  17. package/dist/tools/activate.d.ts.map +1 -1
  18. package/dist/tools/activate.js +7 -19
  19. package/dist/tools/activate.js.map +1 -1
  20. package/dist/tools/artifact-materialize-command.d.ts +22 -0
  21. package/dist/tools/artifact-materialize-command.d.ts.map +1 -0
  22. package/dist/tools/artifact-materialize-command.js +37 -0
  23. package/dist/tools/artifact-materialize-command.js.map +1 -0
  24. package/dist/tools/review-evidence-check.d.ts +2 -0
  25. package/dist/tools/review-evidence-check.d.ts.map +1 -1
  26. package/dist/tools/review-evidence-check.js +5 -3
  27. package/dist/tools/review-evidence-check.js.map +1 -1
  28. package/dist/ui/assets/{AccountPage-D5vGSe-z.js → AccountPage-Dj5D6Bhr.js} +1 -1
  29. package/dist/ui/assets/{index-eUOMUZwn.js → index-5bncLBJ8.js} +2 -2
  30. package/dist/ui/index.html +1 -1
  31. package/package.json +1 -1
@@ -13,6 +13,7 @@ interface ExportCliOptions {
13
13
  as?: string;
14
14
  out?: string;
15
15
  zipOut?: string;
16
+ to?: string;
16
17
  adapters?: string[];
17
18
  allAdapters?: boolean;
18
19
  space?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/export.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,8BAA8B,CAAC;AAO9E,UAAU,gBAAgB;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAG,WAAW,CA0ChG;AAkGD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuCpD"}
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/export.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,8BAA8B,CAAC;AAO9E,UAAU,gBAAgB;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAG,WAAW,CA0DhG;AA2GD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwCpD"}
@@ -36,6 +36,21 @@ export function buildExportInput(uri, options) {
36
36
  throw new Error('--space is only valid with --all-adapters.');
37
37
  }
38
38
  const baseFormat = format;
39
+ const toFile = (options.to ?? '').trim();
40
+ if (toFile.length > 0) {
41
+ if (!hasUri) {
42
+ throw new Error('--to <file> requires a single <uri> selection.');
43
+ }
44
+ if (baseFormat === 'skill_zip') {
45
+ throw new Error('--to <file> cannot be combined with skill_zip; use --zip-out <file>.');
46
+ }
47
+ if ((options.zipOut ?? '').trim().length > 0) {
48
+ throw new Error('--to <file> cannot be combined with --zip-out.');
49
+ }
50
+ if ((options.out ?? '').trim().length > 0) {
51
+ throw new Error('--to <file> cannot be combined with --out <dir>.');
52
+ }
53
+ }
39
54
  if (hasUri) {
40
55
  return { uri: trimmedUri, format: baseFormat, include_reward: true };
41
56
  }
@@ -105,6 +120,13 @@ async function writeExport(backend, response, options) {
105
120
  const buf = response.content_encoding === 'base64'
106
121
  ? Buffer.from(response.content ?? '', 'base64')
107
122
  : Buffer.from(response.content ?? '', 'utf8');
123
+ const toFile = (options.to ?? '').trim();
124
+ if (toFile.length > 0) {
125
+ const targetPath = path.resolve(process.cwd(), toFile);
126
+ mkdirSync(path.dirname(targetPath), { recursive: true });
127
+ writeFileSync(targetPath, buf);
128
+ return [{ path: targetPath, bytes: buf.length, format: response.format }];
129
+ }
108
130
  const filePath = path.join(outDir, `${baseNameFor(response)}.${extensionForFormat(response.format)}`);
109
131
  mkdirSync(outDir, { recursive: true });
110
132
  writeFileSync(filePath, buf);
@@ -150,6 +172,7 @@ export function exportCommand(program) {
150
172
  .option('--space <name>', 'Space name (human label, not raw id) — required with --all-adapters')
151
173
  .option('--as <format>', 'export content format: skill_zip (default), markdown, skill_tree, source, trace_jsonl, reward_jsonl, sft_jsonl, preference_jsonl', 'skill_zip')
152
174
  .option('--out <dir>', 'write exported artifact(s) into this directory (default: current directory)')
175
+ .option('--to <file>', 'write the single <uri> payload to this exact file path (any non-skill_zip --as format)')
153
176
  .option('--zip-out <file>', 'write skill_zip bytes to this explicit file path')
154
177
  .action(async (uri, options) => {
155
178
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"export.js","sourceRoot":"","sources":["../../../src/cli/commands/export.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAkBzE,SAAS,gBAAgB,CAAC,KAAa,EAAE,QAAmB;IACxD,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAuB,EAAE,OAAyB;IAC/E,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;IAClD,MAAM,UAAU,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7D,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC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OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC7C,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC9D,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAClD,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE;gBAC/C,MAAM,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC;gBAC7C,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;aAClE,CAAC,CAAC;QACP,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,cAAc,CAAC,KAAK,EAAE,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAChD,CAAC;IACL,CAAC,CACJ,CAAC;AACV,CAAC"}
@@ -17,26 +17,41 @@ review, and handoff. The bundle prefers truth, explicit sequencing, and
17
17
  observable verification over polished but weak wording.
18
18
 
19
19
  **Autonomy (AI-ownership).** The bundle is written for autonomous execution:
20
- adapters resolve intent from context, run critic-loop in a loop until it returns
21
- `PASS`, and gate irreversible remote mutations with objective pre/post contracts
22
- (shell/forward) rather than human confirmation. They do **not** stop to ask a human to
20
+ adapters resolve intent from context, delegate `critic-loop` to a subagent and
21
+ loop until it returns `PASS`, and gate irreversible remote mutations with
22
+ objective pre/post `shell` contracts rather than human confirmation. They do
23
+ **not** stop to ask a human to
23
24
  approve or acknowledge. Human escalation is reserved for genuinely ambiguous intent
24
25
  or a hard blocker (a required tool/auth that cannot be established automatically).
25
26
 
26
- **Verification ladder (hard enforcement).** Every contract must use the strongest
27
- observable verification available:
27
+ **Verification ladder.** Every contract must use the strongest observable
28
+ verification available:
28
29
 
29
30
  1. `shell` — for file/state/command verification. **`interpreter` is REQUIRED**
30
31
  (allowed: `bash`, `sh`, `python3`, `python`, `node`).
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
- 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
32
+ 2. `subagent` — delegated judgment (a critic), and delegated MCP tool work whose
33
+ transcript must stay out of the caller's context.
34
+ 3. `comment` — last resort. Max 1 per adapter, only as closing ACK for
38
35
  knowledge/reference adapters.
39
36
 
37
+ `forward` is not a ladder rung: it is a **link** to another adapter, and it must
38
+ set `forward.target` matching `squadrules://adapter/<slug>`. Bare MCP tool calls
39
+ are not valid `forward` contracts — delegate them inside a `subagent`.
40
+ `user_input` is not a rung either: it is an emergency type for a genuine human
41
+ decision, never a verification (see *`user_input` — emergency only* in
42
+ `docs/adapter-authoring-guide.md`).
43
+
44
+ **The critic never runs on the executor's thread.** A contract that reviews the
45
+ work of the current run is a `subagent` contract whose `subagent.mcp` names
46
+ `forward` → `squadrules://adapter/critic-loop`; it is never a `forward` contract,
47
+ which would have the audited agent perform its own review. A separate
48
+ server-owned review (different model, session, and content-bound receipt) is the
49
+ end state; the subagent hop is the best available form today.
50
+
51
+ Rungs and counts are **soft-enforced** by these docs and the review checklists.
52
+ The fail-closed structural rules are the three objective ones:
53
+ `shell_interpreter_required`, `forward_link_only`, `subagent_mcp_invalid`.
54
+
40
55
  Bundled mem resources intentionally use **adapter** and **workflow** as preferred
41
56
  terms. Avoid bare "protocol" in new copy.
42
57
 
@@ -53,7 +68,7 @@ terms. Avoid bare "protocol" in new copy.
53
68
  ### Linked authoring flow
54
69
 
55
70
  ```text
56
- author-adapter (Author) → forward(squadrules://adapter/critic-loop) → critic-loop (Critic-Loop Review) → train (with review_evidence)
71
+ author-adapter (Author) → subagent hop (forward → critic-loop) → verdict file → gate PASS → train (with review_evidence)
57
72
  ```
58
73
 
59
74
  ## Reference Documents
@@ -87,10 +102,12 @@ lines should stay as one adapter with 6 H2 layers.
87
102
  Both system and user-authored adapters chain using slugs in `next_action`:
88
103
 
89
104
  ```text
90
- call forward with squadrules://adapter/critic-loop and no solution to start the critic loop
91
105
  call forward with squadrules://adapter/implement-terraform and no solution to start this adapter
92
106
  ```
93
107
 
108
+ A review hop is not a chain link: reach `critic-loop` from a `subagent` contract
109
+ so the review runs apart from the agent that produced the work.
110
+
94
111
  Slugs are globally unique (enforced by `train`), so resolution is
95
112
  deterministic — no scoring, no ambiguity.
96
113
 
@@ -115,6 +132,7 @@ not just any `forward` call.
115
132
  | Target depends on runtime classification the current adapter cannot resolve | `activate` |
116
133
  | Linking to the next adapter in a chain | `forward` + slug |
117
134
  | Reusable sub-adapter invoked by multiple parents | `forward` + slug |
135
+ | Inviting `critic-loop` to review this run's work | `subagent` hop naming `forward` |
118
136
 
119
137
  Never call `activate` just to get a slug you already know — it wastes a
120
138
  round-trip and introduces non-determinism.
@@ -1,5 +1,5 @@
1
1
  ---
2
- version: "5.13.7"
2
+ version: "5.13.8"
3
3
  slug: adapter-migration
4
4
  title: Adapter Migration Workflow
5
5
  ---
@@ -33,12 +33,15 @@ to match the latest SQUADRULES requirements.
33
33
  - Guess transformations when the adapter structure is ambiguous.
34
34
  - Delete adapters or layers during migration.
35
35
  - Migrate adapters that already conform (report them as "no changes needed").
36
+ - Review the transformed set yourself: a batch overwrite written by your own hand
37
+ is not checked by re-reading your own hand.
36
38
 
37
39
  **Must Always:**
38
40
  - Export every adapter before making any changes.
39
41
  - Apply only conservative, reversible structural transformations.
40
42
  - Flag ambiguous cases for manual review instead of guessing.
41
43
  - Produce a per-adapter change report before executing any writes.
44
+ - Have the transformed set reviewed by a delegated critic before the batch write.
42
45
  - Preserve the adapter's slug, version, and chain_root fields.
43
46
 
44
47
  **Good trigger examples:**
@@ -56,15 +59,14 @@ Before running migration, verify readiness:
56
59
 
57
60
  1. `export` tool is available and callable.
58
61
  2. `tune` and `train` tools are available for writes.
59
- 3. Target space is identified (personal or a named group space).
60
- 4. The migration is structural-only (no semantic changes).
62
+ 3. A subagent facility is available in this host for the review hop. Without it,
63
+ stop and report the blocker rather than approving your own batch.
64
+ 4. Target space is identified (personal or a named group space).
65
+ 5. The migration is structural-only (no semantic changes).
61
66
 
62
67
  If any tool is unavailable, stop and report the connection blocker with
63
- remediation guidance.
64
-
65
- ```json
66
- {"contract":{"type":"shell","shell":{"cmd":"echo 'preflight: migration tools verified'","interpreter":"bash","timeout_seconds":10},"required":true}}
67
- ```
68
+ remediation guidance. These are checks you perform, not gates: a failure produces
69
+ a repair action, so no contract is spent on them.
68
70
 
69
71
  ## Export All Adapters
70
72
 
@@ -77,10 +79,6 @@ Export every adapter from the target space using bulk export:
77
79
 
78
80
  If the space has no adapters, report this and stop.
79
81
 
80
- ```json
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
- ```
83
-
84
82
  ## Analyze and Transform
85
83
 
86
84
  For each exported adapter, perform structural analysis and apply migrations.
@@ -99,6 +97,11 @@ For each exported adapter, perform structural analysis and apply migrations.
99
97
  field with an allowed value (`bash`, `sh`, `python3`, `python`, `node`).
100
98
  6. **Forward link** — every `forward` contract must set `forward.target`
101
99
  matching `squadrules://adapter/<slug>`.
100
+ 7. **Critic hop** — a `forward` contract whose target is
101
+ `squadrules://adapter/critic-loop` is the deprecated self-review shape: it
102
+ runs the critic on the thread that produced the work. Flag it for manual
103
+ review; converting a review hop into a delegated one changes verification
104
+ semantics and is not a conservative transformation.
102
105
 
103
106
  ### Transformation rules
104
107
 
@@ -113,14 +116,18 @@ For each adapter, produce:
113
116
  - `warnings`: list of items flagged for manual review
114
117
  - `transformed_content`: the full updated markdown (when `needs_changes`)
115
118
 
116
- ```json
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
- ```
119
-
120
119
  ## Report Changes
121
120
 
122
- Write the migration report to `$MIGRATION_REPORT_FILE` (absolute path under
123
- `$SQUADRULES_LOCAL_ARTIFACT_DIR`). Record a summary table:
121
+ Write the migration report to `$MIGRATION_REPORT_FILE` — an absolute path you
122
+ allocate under `$SQUADRULES_LOCAL_ARTIFACT_DIR` (resolve a hint from the
123
+ `squadrules_local_artifact_dir` field of the latest `activate`/`forward` response
124
+ and export it; the server never names a path on your machine). Also allocate
125
+ `$WORK_MANIFEST` and `$VERDICT_FILE` in the same directory. Record the
126
+ transformed drafts as files under one root and write the handoff to
127
+ `$WORK_MANIFEST` as flat keys: `kind: file_set`, `root: <that directory>`, then
128
+ `items:` with one draft path per line.
129
+
130
+ Record a summary table in the report:
124
131
 
125
132
  | Adapter slug | Status | Changes | Warnings |
126
133
  |-------------|--------|---------|----------|
@@ -130,37 +137,36 @@ Write the migration report to `$MIGRATION_REPORT_FILE` (absolute path under
130
137
  For each adapter with `needs_changes`, show the specific transformations.
131
138
  For each `needs_manual_review`, explain what needs human attention.
132
139
 
133
- Apply the migration autonomously:
134
- - **Apply all** `needs_changes` adapters.
135
- - **Leave untouched** every `needs_manual_review` adapter.
136
-
137
- ```json
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}}
139
- ```
140
-
141
- ## Execute Migration
140
+ A report on your own scratch is a local, reversible artifact, so it carries no
141
+ gate. What is gated is the batch write it precedes.
142
142
 
143
- For each `needs_changes` adapter, apply the structural changes:
143
+ ## Review the Transformed Set
144
144
 
145
- 1. For adapters needing only content-level fixes (heading reorder, fence
146
- conversion, interpreter addition): use `tune` with the transformed content
147
- and the adapter's URI.
148
- 2. For adapters needing structural changes that alter layer count or identity:
149
- use `train` with `force_update: true` and the transformed content.
150
- 3. Record the outcome (success or failure) for each adapter.
151
-
152
- Do NOT change the adapter's space assignment during migration.
145
+ Delegate the review of every transformed draft before anything is written:
153
146
 
154
147
  ```json
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}}
148
+ {"contract":{"type":"subagent","subagent":{"context":"Run the critic over the transformed adapter drafts and return its actual report. Call the forward tool with uri squadrules://adapter/critic-loop, submit work from $WORK_MANIFEST (kind file_set, the transformed drafts), calling_protocol_slug adapter-migration, verification_target 'structural migration preserved semantics and did not over-reach', the requirement list of structural checks, and context.verdict_file $VERDICT_FILE with context.iteration and context.max_iterations (8). Do not review the drafts yourself and do not re-delegate the review.","mcp":[{"tool_name":"forward","arguments":{"uri":"squadrules://adapter/critic-loop"}}]},"required":true}}
156
149
  ```
157
150
 
158
- ## Verify and Report
159
-
160
- After executing all migrations:
161
-
162
- 1. Re-export each migrated adapter to verify structural compliance.
163
- 2. Report final status:
151
+ ## Apply, Verify, and Report
152
+
153
+ 1. Run the gate at the end of this section against `$VERDICT_FILE` **before** any
154
+ write. `FAIL` → fix the drafts the critic named, run a fresh critic pass the
155
+ same way (a subagent delegating `squadrules://adapter/critic-loop`,
156
+ `iteration` incremented) and run the gate again. Loop automatically; do not ask
157
+ the user whether to continue. At `failure_class: iteration_ceiling`, stop,
158
+ report the unresolved findings, and write nothing.
159
+ 2. Apply the migration only on a `PASS` verdict:
160
+ - **Apply all** `needs_changes` adapters.
161
+ - **Leave untouched** every `needs_manual_review` adapter.
162
+ - For content-level fixes (heading order, fence conversion, interpreter
163
+ addition): use `tune` with the transformed content, its URI, and
164
+ `review_evidence` from the verdict file.
165
+ - For changes that alter layer count or identity: use `train` with
166
+ `force_update: true` and the same `review_evidence`.
167
+ - Do NOT change an adapter's space assignment during migration.
168
+ 3. After all writes, re-export each migrated adapter to verify structural
169
+ compliance, then report final status:
164
170
 
165
171
  | Metric | Count |
166
172
  |--------|-------|
@@ -170,12 +176,12 @@ After executing all migrations:
170
176
  | Migration failed | N |
171
177
  | Flagged for manual review | N |
172
178
 
173
- 3. For each failure, report the error message and suggested fix.
174
- 4. Recommend running `critic-loop` on migrated adapters to verify semantic
175
- integrity after structural changes.
179
+ For each failure, report the error message and suggested fix. Semantic integrity
180
+ was reviewed before the write; do not present a post-write structural re-export
181
+ as if it re-checked meaning.
176
182
 
177
183
  ```json
178
- {"contract":{"type":"comment","comment":{"min_length":80},"required":true}}
184
+ {"contract":{"type":"shell","shell":{"cmd":"head -1 \"$VERDICT_FILE\" | grep -qi '^PASS$'","interpreter":"bash","timeout_seconds":5},"required":true}}
179
185
  ```
180
186
 
181
187
  ## Reward Signal
@@ -192,3 +198,9 @@ scheme. Every adapter has:
192
198
  - Been verified post-migration for structural compliance.
193
199
 
194
200
  Semantic content (steps, intent, examples, triggers) is preserved unchanged.
201
+
202
+ What the verdict gate proves: a delegated critic pass over the transformed drafts
203
+ left a verdict file reading `PASS`, and the store accepted the writes carrying
204
+ that evidence. What it does not prove: that the report came from the delegated
205
+ context rather than this one, or that the verdict is bound to the drafts it
206
+ reviewed — a content-bound review receipt would be needed for that.