meguro-mcp 0.2.9 → 0.2.10

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/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to `meguro-mcp` are recorded here. Versions follow Semantic Versioning.
4
4
 
5
+ ## 0.2.10 — 2026-08-10
6
+
7
+ - Adds immutable getting-started v8, product-guide v5, and documentation-index v4 resources that
8
+ cross-link current guidance from one registry-derived currency authority; receipt-guide v7 remains
9
+ the current receipt guide.
10
+ - Removes the remaining fixed Admin API version from current observation-plan metadata and derives
11
+ the declared target from the supported-version registry without changing historical resources.
12
+ - Adds current troubleshooting for incompatible model data, assertion-family exercise guidance, and
13
+ the channel-abstraction explanation while preserving existing tool identities and input schemas.
14
+
5
15
  ## 0.2.9 — 2026-08-10
6
16
 
7
17
  - Keeps the full real-store history-run family in the public STDIO registry while the hosted OAuth
package/README.md CHANGED
@@ -105,15 +105,21 @@ local stdio server and the hosted OAuth resource server:
105
105
  |---|---|
106
106
  | `meguro://docs/gate-policy/v1` | `6d647b3c78fd4e2d93f59a85b90a853096cc73e9cdfd6ba5e3ea505dc07b4aaf` |
107
107
  | `meguro://docs/gate-policy/v2` | `e49378fd745f71aab893db34864aefeb7345c9a25000ad328dfba4e44d007469` |
108
+ | `meguro://docs/gate-policy/v3` | `bcd1434cddf99f42261081d9d217285ebf4a93d9e42d23a47bf577c8ee91fbe9` |
108
109
  | `meguro://docs/getting-started/v1` | `afd19ca6576ae2a8fb03c2e143d25d47fb739682f44180541dd13f779a5f29df` |
109
110
  | `meguro://docs/getting-started/v2` | `70fdbf36d68a6dd7abb93fe9b403f85c9c0323b3dc3472ab638c6cbe5982ec61` |
110
111
  | `meguro://docs/getting-started/v3` | `765cba2b68806f0b1d83255a1742d83ce71ebf7f65f8095e7076cd36e4a1ba6c` |
111
112
  | `meguro://docs/getting-started/v4` | `db534eb544e414be353d6cd4db8dfb9e8dba772dcb10d8287a1a27f8736e5307` |
112
113
  | `meguro://docs/getting-started/v5` | `156dcf81266f2bd4e4203dbd09661e49a481395ba4a63528f0540d8ea89bc285` |
113
114
  | `meguro://docs/getting-started/v6` | `34cf3ab48a32714b0c3edb24a7920843954172c0d5501e60574adc5a1058071f` |
115
+ | `meguro://docs/getting-started/v7` | `650201c983138cb2c34cfef3e93611d510faf42d974f32762207216c3189ece1` |
116
+ | `meguro://docs/index/v1` | `1d52205148a3438339238c9e65271b2c377cd0a96c7088d75de7f2dce9552843` |
117
+ | `meguro://docs/index/v2` | `df861c87fa17db23d3173c1d900a884d39b228d493d7e35fcab9b2a531ae9aad` |
118
+ | `meguro://docs/index/v3` | `422e91488281867aa2454223a8042248a667c57ea2ae56878bdb136693fe4894` |
114
119
  | `meguro://docs/product-guide/v1` | `e5450c1b4181cec4d6ed0a498dbff1cb25d2e223ff2228928aecbbce9674f074` |
115
120
  | `meguro://docs/product-guide/v2` | `b15590df7699f7ad685a30b0698e2c25b5b7b1531afa4e43e9f04a4b38ab9db2` |
116
121
  | `meguro://docs/product-guide/v3` | `8dc9e0fae91a2433ea7ca02b9278484250be0d336e2daac96f949da577487dc9` |
122
+ | `meguro://docs/product-guide/v4` | `a874a1af1bcf18e7abe6b32b8d226a648b1292458010992528a551c270e9816e` |
117
123
  | `meguro://docs/receipt-guide/v1` | `9d8150258765d252cb7cc3bad307acdc429b0435ca22f0362b69cf7471e3a333` |
118
124
  | `meguro://docs/receipt-guide/v2` | `7df261021b48ce732e6043a8917f8a2673b1f83ff1d8790927abc18f34fb3f6f` |
119
125
  | `meguro://docs/receipt-guide/v3` | `c76b823aed8187834c8ae79a751b53d2720fe7245a31b0b195f440deac9b75cb` |
@@ -186,7 +192,7 @@ OAuth support. It requires a workspace-bound `meg_sk_…` API key and exposes th
186
192
  surface. Pin the exact public version in client configuration so a quickstart stays reproducible:
187
193
 
188
194
  ```bash
189
- npx -y meguro-mcp@0.2.9
195
+ npx -y meguro-mcp@0.2.10
190
196
  ```
191
197
 
192
198
  ### Environment
@@ -204,7 +210,7 @@ claude mcp add meguro \
204
210
  -e MEGURO_API_BASE_URL=https://api-dev.meguro.io \
205
211
  -e MEGURO_API_TOKEN=meg_sk_... \
206
212
  -e MEGURO_DASHBOARD_URL=https://... \
207
- -- npx -y meguro-mcp@0.2.9
213
+ -- npx -y meguro-mcp@0.2.10
208
214
  ```
209
215
 
210
216
  ### Register — Cursor (`.cursor/mcp.json`)
@@ -214,7 +220,7 @@ claude mcp add meguro \
214
220
  "mcpServers": {
215
221
  "meguro": {
216
222
  "command": "npx",
217
- "args": ["-y", "meguro-mcp@0.2.9"],
223
+ "args": ["-y", "meguro-mcp@0.2.10"],
218
224
  "env": {
219
225
  "MEGURO_API_BASE_URL": "https://api-dev.meguro.io",
220
226
  "MEGURO_API_TOKEN": "meg_sk_...",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meguro-mcp",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Meguro control-plane MCP server: drive worlds, runs, and verdicts from your own AI tools.",
package/src/docs.mjs CHANGED
@@ -14,6 +14,7 @@ const RECEIPT_GUIDE_V6_VERSION = 6;
14
14
  const RECEIPT_GUIDE_V7_VERSION = 7;
15
15
  const GATE_POLICY_VERSION = 1;
16
16
  const GATE_POLICY_V2_VERSION = 2;
17
+ const GATE_POLICY_V3_VERSION = 3;
17
18
  const GETTING_STARTED_VERSION = 1;
18
19
  const GETTING_STARTED_V2_VERSION = 2;
19
20
  const GETTING_STARTED_LATEST_VERSION = 3;
@@ -21,10 +22,12 @@ const GETTING_STARTED_V4_VERSION = 4;
21
22
  const GETTING_STARTED_V5_VERSION = 5;
22
23
  const GETTING_STARTED_V6_VERSION = 6;
23
24
  const GETTING_STARTED_V7_VERSION = 7;
25
+ const GETTING_STARTED_V8_VERSION = 8;
24
26
  const PRODUCT_GUIDE_VERSION = 1;
25
27
  const PRODUCT_GUIDE_V2_VERSION = 2;
26
28
  const PRODUCT_GUIDE_V3_VERSION = 3;
27
29
  const PRODUCT_GUIDE_V4_VERSION = 4;
30
+ const PRODUCT_GUIDE_V5_VERSION = 5;
28
31
  const RECEIPT_GUIDE_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_VERSION}`;
29
32
  const RECEIPT_GUIDE_V2_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_V2_VERSION}`;
30
33
  const RECEIPT_GUIDE_V3_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_V3_VERSION}`;
@@ -34,6 +37,7 @@ const RECEIPT_GUIDE_V6_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_V6_VE
34
37
  const RECEIPT_GUIDE_V7_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_V7_VERSION}`;
35
38
  const GATE_POLICY_URI = `meguro://docs/gate-policy/v${GATE_POLICY_VERSION}`;
36
39
  const GATE_POLICY_V2_URI = `meguro://docs/gate-policy/v${GATE_POLICY_V2_VERSION}`;
40
+ const GATE_POLICY_V3_URI = `meguro://docs/gate-policy/v${GATE_POLICY_V3_VERSION}`;
37
41
  const GETTING_STARTED_URI = `meguro://docs/getting-started/v${GETTING_STARTED_VERSION}`;
38
42
  const GETTING_STARTED_V2_URI = `meguro://docs/getting-started/v${GETTING_STARTED_V2_VERSION}`;
39
43
  const GETTING_STARTED_LATEST_URI = `meguro://docs/getting-started/v${GETTING_STARTED_LATEST_VERSION}`;
@@ -41,12 +45,16 @@ const GETTING_STARTED_V4_URI = `meguro://docs/getting-started/v${GETTING_STARTED
41
45
  const GETTING_STARTED_V5_URI = `meguro://docs/getting-started/v${GETTING_STARTED_V5_VERSION}`;
42
46
  const GETTING_STARTED_V6_URI = `meguro://docs/getting-started/v${GETTING_STARTED_V6_VERSION}`;
43
47
  const GETTING_STARTED_V7_URI = `meguro://docs/getting-started/v${GETTING_STARTED_V7_VERSION}`;
48
+ const GETTING_STARTED_V8_URI = `meguro://docs/getting-started/v${GETTING_STARTED_V8_VERSION}`;
44
49
  const PRODUCT_GUIDE_URI = `meguro://docs/product-guide/v${PRODUCT_GUIDE_VERSION}`;
45
50
  const PRODUCT_GUIDE_V2_URI = `meguro://docs/product-guide/v${PRODUCT_GUIDE_V2_VERSION}`;
46
51
  const PRODUCT_GUIDE_V3_URI = `meguro://docs/product-guide/v${PRODUCT_GUIDE_V3_VERSION}`;
47
52
  const PRODUCT_GUIDE_V4_URI = `meguro://docs/product-guide/v${PRODUCT_GUIDE_V4_VERSION}`;
53
+ const PRODUCT_GUIDE_V5_URI = `meguro://docs/product-guide/v${PRODUCT_GUIDE_V5_VERSION}`;
48
54
  export const DOCUMENTATION_INDEX_URI = 'meguro://docs/index/v1';
49
55
  export const DOCUMENTATION_INDEX_V2_URI = 'meguro://docs/index/v2';
56
+ export const DOCUMENTATION_INDEX_V3_URI = 'meguro://docs/index/v3';
57
+ export const DOCUMENTATION_INDEX_V4_URI = 'meguro://docs/index/v4';
50
58
 
51
59
  const DOCUMENTATION_CURRENCY_V1 = deepFreeze({
52
60
  indexVersion: 1,
@@ -68,7 +76,27 @@ const DOCUMENTATION_CURRENCY_V2 = deepFreeze({
68
76
  'receipt-guide': RECEIPT_GUIDE_V7_URI,
69
77
  },
70
78
  });
71
- const CURRENT_DOCUMENTATION_CURRENCY = DOCUMENTATION_CURRENCY_V2;
79
+ const DOCUMENTATION_CURRENCY_V3 = deepFreeze({
80
+ indexVersion: 3,
81
+ currentUriByTopic: {
82
+ 'gate-policy': GATE_POLICY_V3_URI,
83
+ 'getting-started': GETTING_STARTED_V7_URI,
84
+ index: DOCUMENTATION_INDEX_V3_URI,
85
+ 'product-guide': PRODUCT_GUIDE_V4_URI,
86
+ 'receipt-guide': RECEIPT_GUIDE_V7_URI,
87
+ },
88
+ });
89
+ const DOCUMENTATION_CURRENCY_V4 = deepFreeze({
90
+ indexVersion: 4,
91
+ currentUriByTopic: {
92
+ 'gate-policy': GATE_POLICY_V3_URI,
93
+ 'getting-started': GETTING_STARTED_V8_URI,
94
+ index: DOCUMENTATION_INDEX_V4_URI,
95
+ 'product-guide': PRODUCT_GUIDE_V5_URI,
96
+ 'receipt-guide': RECEIPT_GUIDE_V7_URI,
97
+ },
98
+ });
99
+ const CURRENT_DOCUMENTATION_CURRENCY = DOCUMENTATION_CURRENCY_V4;
72
100
 
73
101
  function documentationVersionFromUri(uri) {
74
102
  const match = /\/v([1-9][0-9]*)$/u.exec(uri);
@@ -94,7 +122,10 @@ function documentationIndexText(currency, publishedUri = DOCUMENTATION_INDEX_URI
94
122
 
95
123
  const CURRENT_GETTING_STARTED_URI = CURRENT_DOCUMENTATION_CURRENCY.currentUriByTopic['getting-started'];
96
124
  const CURRENT_PRODUCT_GUIDE_URI = CURRENT_DOCUMENTATION_CURRENCY.currentUriByTopic['product-guide'];
97
- export const MCP_INITIALIZE_INSTRUCTIONS = `Start with \`${CURRENT_GETTING_STARTED_URI}\` or call \`docs_read({ topic: "getting-started", version: ${documentationVersionFromUri(CURRENT_GETTING_STARTED_URI)} })\`; for general Meguro questions, read \`${CURRENT_PRODUCT_GUIDE_URI}\` or call \`docs_read({ topic: "product-guide", version: ${documentationVersionFromUri(CURRENT_PRODUCT_GUIDE_URI)} })\`.`;
125
+ const CURRENT_RECEIPT_GUIDE_URI = CURRENT_DOCUMENTATION_CURRENCY.currentUriByTopic['receipt-guide'];
126
+ const CURRENT_GATE_POLICY_URI = CURRENT_DOCUMENTATION_CURRENCY.currentUriByTopic['gate-policy'];
127
+ const CURRENT_INDEX_URI = CURRENT_DOCUMENTATION_CURRENCY.currentUriByTopic.index;
128
+ export const MCP_INITIALIZE_INSTRUCTIONS = `Start with \`${CURRENT_GETTING_STARTED_URI}\` or call \`docs_read({ topic: "getting-started", version: ${documentationVersionFromUri(CURRENT_GETTING_STARTED_URI)} })\`; for general Meguro questions, read \`${CURRENT_PRODUCT_GUIDE_URI}\` or call \`docs_read({ topic: "product-guide", version: ${documentationVersionFromUri(CURRENT_PRODUCT_GUIDE_URI)} })\`; distinguish the documentation resource version in each \`meguro://docs/.../vN\` URI, the runtime Gate policy contract \`meguro.release-gate-policy.v1\` version 1, and the requested Shopify Admin API version from ${ADMIN_API_SUPPORTED_VERSIONS.map((version) => `\`${version}\``).join(' or ')} with default \`${ADMIN_API_DEFAULT_VERSION}\`.`;
98
129
  export const PRODUCT_GUIDE_SHA256 = 'e5450c1b4181cec4d6ed0a498dbff1cb25d2e223ff2228928aecbbce9674f074';
99
130
 
100
131
  function deepFreeze(value) {
@@ -928,6 +959,23 @@ export const GATE_POLICY_V1_CHECKS = deepFreeze([
928
959
  },
929
960
  ]);
930
961
 
962
+ function absoluteGateVerdictFactPath(path) {
963
+ return `facts.${path}`;
964
+ }
965
+
966
+ function absoluteGateVerdictFactText(text) {
967
+ return String(text)
968
+ .replaceAll('catalogSourceSummary.', 'facts.catalogSourceSummary.')
969
+ .replaceAll('summary.', 'facts.summary.');
970
+ }
971
+
972
+ export const GATE_POLICY_V3_CHECKS = deepFreeze(GATE_POLICY_V1_CHECKS.map((check) => ({
973
+ ...check,
974
+ facts: check.facts.map(absoluteGateVerdictFactPath),
975
+ threshold: absoluteGateVerdictFactText(check.threshold),
976
+ flip: absoluteGateVerdictFactText(check.flip),
977
+ })));
978
+
931
979
  const GATE_POLICY_TEXT = `# Meguro Gate policy v1
932
980
 
933
981
  Published URI: \`${GATE_POLICY_URI}\`
@@ -1295,6 +1343,86 @@ ${REAL_STORE_HISTORY_LANE_BRIDGE}`,
1295
1343
  '| What runs exist or what happened? | Call \`runs_list\` and the relevant status, report, or impact tool. |',
1296
1344
  '| What practice runs exist or what happened? | Call \`practice_runs_list\` and the relevant \`practice_run_status\`, \`practice_run_report\`, or \`practice_run_impact\` tool. |',
1297
1345
  );
1346
+ const CURRENT_VERSION_LABELS_TEXT = `## Three different version labels
1347
+
1348
+ - **Documentation resource version:** the trailing \`vN\` in an immutable \`meguro://docs/.../vN\`
1349
+ URI identifies that document's bytes. Read \`${CURRENT_INDEX_URI}\` for the current resource URI in
1350
+ every documentation family.
1351
+ - **Runtime Gate policy contract version:** \`meguro.release-gate-policy.v1\`, version \`1\`, identifies
1352
+ the policy evaluated against receipt facts. The current explanatory documentation for that contract
1353
+ is \`${CURRENT_GATE_POLICY_URI}\`; its documentation resource version is a separate number.
1354
+ - **Requested Shopify Admin API version:** the version segment in an Admin request selects one of
1355
+ ${ADMIN_API_SUPPORTED_VERSIONS.map((version) => `\`${version}\``).join(' or ')}. The current default is
1356
+ \`${ADMIN_API_DEFAULT_VERSION}\`; a caller may still request a supported non-default version, and the
1357
+ resulting plan and evidence retain that requested value.`;
1358
+ const CURRENT_DEEPER_DOCUMENTATION_TEXT = `## Deeper in-band documentation
1359
+
1360
+ - Receipt interpretation: read \`${CURRENT_RECEIPT_GUIDE_URI}\` or call
1361
+ \`docs_read({ topic: "receipt-guide", version: ${documentationVersionFromUri(CURRENT_RECEIPT_GUIDE_URI)} })\`.
1362
+ - Gate policy: read \`${CURRENT_GATE_POLICY_URI}\` or call
1363
+ \`docs_read({ topic: "gate-policy", version: ${documentationVersionFromUri(CURRENT_GATE_POLICY_URI)} })\`.
1364
+ - Current-document pointers: read \`${CURRENT_INDEX_URI}\` or call
1365
+ \`docs_read({ topic: "index", version: ${documentationVersionFromUri(CURRENT_INDEX_URI)} })\`.
1366
+
1367
+ All published documentation resources are immutable. Cite the exact URI, version, and SHA-256
1368
+ digest returned by Meguro.`;
1369
+ const GETTING_STARTED_V7_DEEPER_DOCUMENTATION_TEXT = `## Deeper in-band documentation
1370
+
1371
+ - Receipt interpretation: read \`${RECEIPT_GUIDE_URI}\` or
1372
+ \`${RECEIPT_GUIDE_V2_URI}\`, or call
1373
+ \`docs_read({ topic: "receipt-guide", version: 1 })\` or
1374
+ \`docs_read({ topic: "receipt-guide", version: 2 })\`.
1375
+ - Gate policy: read \`${GATE_POLICY_V2_URI}\`, or call
1376
+ \`docs_read({ topic: "gate-policy", version: 1 })\`.
1377
+
1378
+ All published documentation resources are immutable. Cite the exact URI, version, and SHA-256
1379
+ digest returned by Meguro.`;
1380
+ const CIMD_TROUBLESHOOTING_TEXT = `## Claude Code authentication troubleshooting
1381
+
1382
+ If Claude Code reports Authenticated but calls return \`401 invalid_token\`, remove the stored Meguro
1383
+ server entry and re-add it; the CLI can retain an expired token across logout/login.`;
1384
+ const ASSERTION_FAMILY_EXERCISE_TEXT = `## How to exercise each assertion family
1385
+
1386
+ - **Receipt:** complete a run after the agent sends at least one Admin call, then read the immutable
1387
+ receipt. This exercises receipt construction and attribution; an empty or incomplete run does not.
1388
+ - **State safety:** during an open run, issue the representative supported state-changing action and
1389
+ any intended refusal case, then inspect the recorded accepted/rejected action and resulting store
1390
+ state. A read-only run cannot establish this family.
1391
+ - **Backoff:** use genuinely provoked throttling, for example with cost-heavy queries that drain the
1392
+ configured GraphQL bucket, observe the throttled response, wait as directed, and send the matching
1393
+ retry. Ordinary successful traffic does not exercise retry recovery or throttle discipline.
1394
+ - **Webhook:** this family is not available in this run mode on the current hosted practice lane:
1395
+ the lane has no supported webhook-subscription registration or delivery endpoint. That is a lane limitation,
1396
+ never an agent omission. This documentation adds no webhook capability.`;
1397
+ const CHANNEL_ABSTRACTION_TEXT = `## Effect-level channel abstraction
1398
+
1399
+ Messaging and fulfillment channels are represented as effect-level practice actions. For example,
1400
+ cart-recovery's supported write is **Recover abandoned checkout**, while generic email/SMS sending is
1401
+ \`knownUnsupported\`. The practice world grades the decision's effect, not the delivery channel; a
1402
+ generic channel appearing in \`knownUnsupported\` does not mean the corresponding commerce decision
1403
+ is absent when an effect-level action is declared.`;
1404
+ const GETTING_STARTED_V8_TEXT = GETTING_STARTED_V7_TEXT
1405
+ .replace('# Getting started with Meguro v7', '# Getting started with Meguro v8')
1406
+ .replace(`Published URI: \`${GETTING_STARTED_V7_URI}\``, `Published URI: \`${GETTING_STARTED_V8_URI}\``)
1407
+ .replace(GETTING_STARTED_V7_DEEPER_DOCUMENTATION_TEXT, CURRENT_DEEPER_DOCUMENTATION_TEXT)
1408
+ .replace('## Control and data planes', `${CURRENT_VERSION_LABELS_TEXT}\n\n## Control and data planes`)
1409
+ .replace('## Deeper in-band documentation', `${CIMD_TROUBLESHOOTING_TEXT}\n\n## Deeper in-band documentation`);
1410
+ const PRODUCT_GUIDE_V5_TEXT = PRODUCT_GUIDE_V4_TEXT
1411
+ .replace('# Meguro product guide v4', '# Meguro product guide v5')
1412
+ .replace(`Published URI: \`${PRODUCT_GUIDE_V4_URI}\``, `Published URI: \`${PRODUCT_GUIDE_V5_URI}\``)
1413
+ .replace(
1414
+ `read
1415
+ \`${RECEIPT_GUIDE_URI}\` or \`${RECEIPT_GUIDE_V2_URI}\`.`,
1416
+ `read \`${CURRENT_RECEIPT_GUIDE_URI}\`.`,
1417
+ )
1418
+ .replaceAll(RECEIPT_GUIDE_URI, CURRENT_RECEIPT_GUIDE_URI)
1419
+ .replaceAll(RECEIPT_GUIDE_V2_URI, CURRENT_RECEIPT_GUIDE_URI)
1420
+ .replaceAll(GATE_POLICY_V2_URI, CURRENT_GATE_POLICY_URI)
1421
+ .replaceAll(GETTING_STARTED_V7_URI, CURRENT_GETTING_STARTED_URI)
1422
+ .replace(
1423
+ '## Stable concepts versus changing facts',
1424
+ `${CURRENT_VERSION_LABELS_TEXT}\n\n${ASSERTION_FAMILY_EXERCISE_TEXT}\n\n${CHANNEL_ABSTRACTION_TEXT}\n\n## Stable concepts versus changing facts`,
1425
+ );
1298
1426
  const RECEIPT_GUIDE_V6_TEXT = simulationVocabularyText(
1299
1427
  RECEIPT_GUIDE_V5_TEXT
1300
1428
  .replace('# Meguro receipt guide v5', '# Meguro receipt guide v6')
@@ -1332,6 +1460,71 @@ const GATE_POLICY_V2_TEXT = simulationVocabularyText(
1332
1460
  .replace('# Meguro Gate policy v1', '# Meguro Gate policy v2')
1333
1461
  .replace(`Published URI: \`${GATE_POLICY_URI}\``, `Published URI: \`${GATE_POLICY_V2_URI}\``),
1334
1462
  );
1463
+ const GATE_POLICY_V1_CHECK_TEXT = GATE_POLICY_V1_CHECKS.map((check) => `### ${check.name}
1464
+
1465
+ - Receipt facts: ${check.facts.map((fact) => `\`${fact}\``).join(', ')}
1466
+ - Threshold: ${check.threshold}.
1467
+ - Flip condition: ${check.flip}.`).join('\n\n');
1468
+ const GATE_POLICY_V3_CHECK_TEXT = GATE_POLICY_V3_CHECKS.map((check) => `### ${check.name}
1469
+
1470
+ - Receipt facts: ${check.facts.map((fact) => `\`${fact}\``).join(', ')}
1471
+ - Threshold: ${check.threshold}.
1472
+ - Flip condition: ${check.flip}.`).join('\n\n');
1473
+ const GATE_POLICY_V3_FACT_ROOT_TEXT = `## Canonical fact root
1474
+
1475
+ Every receipt-fact path in this policy is absolute against the complete
1476
+ \`meguro.gate-verdict.v1\` payload returned by \`gate_verdict\`. The authoritative facts live
1477
+ under \`facts\`; do not strip that prefix, resolve a citation against another receipt projection,
1478
+ or copy a citation's value as a substitute for resolving its path.
1479
+
1480
+ Resolve every required path before applying a threshold. If any path is absent, fail closed with:
1481
+
1482
+ \`\`\`json
1483
+ {"schemaVersion":"meguro.gate-policy-fact-resolution.v1","status":"refused","code":"required-receipt-fact-missing","policyUri":"${GATE_POLICY_V3_URI}","missingFactPaths":["facts.example"],"meaning":"The canonical Gate verdict does not contain every fact required by this policy.","nextStep":"Call gate_evaluate for the receipt, then call gate_verdict again. Do not infer, fabricate, or default a missing fact."}
1484
+ \`\`\``;
1485
+ const GATE_POLICY_V3_TEXT = GATE_POLICY_V2_TEXT
1486
+ .replace('# Meguro Gate policy v2', '# Meguro Gate policy v3')
1487
+ .replace(`Published URI: \`${GATE_POLICY_V2_URI}\``, `Published URI: \`${GATE_POLICY_V3_URI}\``)
1488
+ .replace('## Checks', `${GATE_POLICY_V3_FACT_ROOT_TEXT}\n\n## Checks`)
1489
+ .replace(GATE_POLICY_V1_CHECK_TEXT, GATE_POLICY_V3_CHECK_TEXT)
1490
+ .replace(
1491
+ `A verdict citing policy version 1 always resolves to \`${GATE_POLICY_URI}\`. This content and digest
1492
+ do not change. A future policy receives a new id, version, URI, and digest; it is appended beside v1
1493
+ instead of replacing it.`,
1494
+ `The runtime policy remains \`meguro.release-gate-policy.v1\`, version \`1\`. Documentation version 3
1495
+ corrects its fact-path addressing against the complete canonical verdict payload; it does not rewrite
1496
+ the runtime thresholds or either historical documentation resource. Versions 1 and 2 retain their
1497
+ original bytes and digests, while this corrected resource remains immutable at \`${GATE_POLICY_V3_URI}\`.`,
1498
+ );
1499
+
1500
+ function gatePolicyValueAt(value, path) {
1501
+ return path.replace(/\[(\d+)\]/gu, '.$1').split('.').reduce((current, key) => {
1502
+ if (!current || typeof current !== 'object' || !Object.hasOwn(current, key)) return undefined;
1503
+ return current[key];
1504
+ }, value);
1505
+ }
1506
+
1507
+ export function gatePolicyFactResolution(verdict) {
1508
+ const required = [...new Set(GATE_POLICY_V3_CHECKS.flatMap((check) => check.facts))];
1509
+ const missingFactPaths = required.filter((path) => gatePolicyValueAt(verdict, path) === undefined);
1510
+ if (missingFactPaths.length) {
1511
+ return deepFreeze({
1512
+ schemaVersion: 'meguro.gate-policy-fact-resolution.v1',
1513
+ status: 'refused',
1514
+ code: 'required-receipt-fact-missing',
1515
+ policyUri: GATE_POLICY_V3_URI,
1516
+ missingFactPaths,
1517
+ meaning: 'The canonical Gate verdict does not contain every fact required by this policy.',
1518
+ nextStep: 'Call gate_evaluate for the receipt, then call gate_verdict again. Do not infer, fabricate, or default a missing fact.',
1519
+ });
1520
+ }
1521
+ return deepFreeze({
1522
+ schemaVersion: 'meguro.gate-policy-fact-resolution.v1',
1523
+ status: 'resolved',
1524
+ policyUri: GATE_POLICY_V3_URI,
1525
+ resolvedFactPaths: required,
1526
+ });
1527
+ }
1335
1528
 
1336
1529
  function entry(input) {
1337
1530
  const text = String(input.text);
@@ -1471,6 +1664,15 @@ const CATALOG = buildDocumentationCatalog([
1471
1664
  description: `Hosted-first practice-store sequence for Shopify Admin GraphQL ${ADMIN_API_SUPPORTED_VERSIONS.join(' and ')} with default ${ADMIN_API_DEFAULT_VERSION}.`,
1472
1665
  text: GETTING_STARTED_V7_TEXT,
1473
1666
  },
1667
+ {
1668
+ topic: 'getting-started',
1669
+ version: GETTING_STARTED_V8_VERSION,
1670
+ uri: GETTING_STARTED_V8_URI,
1671
+ name: 'Getting started with Meguro v8',
1672
+ title: 'Getting started with Meguro v8',
1673
+ description: `Current-link-derived hosted sequence with explicit document, Gate-contract, and Shopify Admin version labels; supported Admin versions ${ADMIN_API_SUPPORTED_VERSIONS.join(' and ')}, default ${ADMIN_API_DEFAULT_VERSION}.`,
1674
+ text: GETTING_STARTED_V8_TEXT,
1675
+ },
1474
1676
  {
1475
1677
  topic: 'product-guide',
1476
1678
  version: PRODUCT_GUIDE_VERSION,
@@ -1508,6 +1710,15 @@ const CATALOG = buildDocumentationCatalog([
1508
1710
  description: 'Hosted-first product concepts, practice-run vocabulary, evidence boundaries, and question-to-source routing.',
1509
1711
  text: PRODUCT_GUIDE_V4_TEXT,
1510
1712
  },
1713
+ {
1714
+ topic: 'product-guide',
1715
+ version: PRODUCT_GUIDE_V5_VERSION,
1716
+ uri: PRODUCT_GUIDE_V5_URI,
1717
+ name: 'Meguro product guide v5',
1718
+ title: 'Meguro product guide v5',
1719
+ description: 'Current-link-derived product concepts with version-label, assertion-family, and effect-level channel guidance.',
1720
+ text: PRODUCT_GUIDE_V5_TEXT,
1721
+ },
1511
1722
  {
1512
1723
  topic: 'index',
1513
1724
  version: DOCUMENTATION_CURRENCY_V1.indexVersion,
@@ -1526,6 +1737,24 @@ const CATALOG = buildDocumentationCatalog([
1526
1737
  description: 'Immutable current-version pointers for every published Meguro documentation family after the hosted run-lane separation.',
1527
1738
  text: documentationIndexText(DOCUMENTATION_CURRENCY_V2, DOCUMENTATION_INDEX_V2_URI),
1528
1739
  },
1740
+ {
1741
+ topic: 'index',
1742
+ version: DOCUMENTATION_CURRENCY_V3.indexVersion,
1743
+ uri: DOCUMENTATION_INDEX_V3_URI,
1744
+ name: 'Meguro documentation index v3',
1745
+ title: 'Meguro documentation index v3',
1746
+ description: 'Immutable current-version pointers after correcting Gate-policy fact paths against the canonical verdict payload.',
1747
+ text: documentationIndexText(DOCUMENTATION_CURRENCY_V3, DOCUMENTATION_INDEX_V3_URI),
1748
+ },
1749
+ {
1750
+ topic: 'index',
1751
+ version: DOCUMENTATION_CURRENCY_V4.indexVersion,
1752
+ uri: DOCUMENTATION_INDEX_V4_URI,
1753
+ name: 'Meguro documentation index v4',
1754
+ title: 'Meguro documentation index v4',
1755
+ description: 'Immutable current-version pointers after the current-link, version-label, and explanatory-rider documentation mint.',
1756
+ text: documentationIndexText(DOCUMENTATION_CURRENCY_V4, DOCUMENTATION_INDEX_V4_URI),
1757
+ },
1529
1758
  {
1530
1759
  topic: 'receipt-guide',
1531
1760
  version: RECEIPT_GUIDE_VERSION,
@@ -1607,6 +1836,15 @@ const CATALOG = buildDocumentationCatalog([
1607
1836
  description: 'Immutable named checks and flip conditions republished with the simulation-run vocabulary.',
1608
1837
  text: GATE_POLICY_V2_TEXT,
1609
1838
  },
1839
+ {
1840
+ topic: 'gate-policy',
1841
+ version: GATE_POLICY_V3_VERSION,
1842
+ uri: GATE_POLICY_V3_URI,
1843
+ name: 'Meguro Gate policy v3',
1844
+ title: 'Meguro Gate policy v3',
1845
+ description: 'Immutable named checks with absolute fact paths against the complete canonical Gate verdict payload.',
1846
+ text: GATE_POLICY_V3_TEXT,
1847
+ },
1610
1848
  ], CURRENT_DOCUMENTATION_CURRENCY);
1611
1849
 
1612
1850
  export function documentationResources() {
package/src/server.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  } from './protocol.mjs';
15
15
  import { createTools, redactSecrets } from './tools.mjs';
16
16
 
17
- const SERVER_INFO = { name: 'meguro', version: '0.2.9' };
17
+ const SERVER_INFO = { name: 'meguro', version: '0.2.10' };
18
18
  const PROTOCOL_VERSION = '2025-03-26';
19
19
 
20
20
  const tools = createTools({
package/src/tools.mjs CHANGED
@@ -397,7 +397,12 @@ const PRACTICE_RUN_OBSERVATION_REQUEST_INPUT_SCHEMA = Object.freeze({
397
397
  type: 'object',
398
398
  additionalProperties: false,
399
399
  properties: {
400
- apiVersion: { type: 'string', const: '2026-04', description: 'The Admin API version supported by planned checkpoint observations.' },
400
+ apiVersion: {
401
+ type: 'string',
402
+ enum: [...ADMIN_API_SUPPORTED_VERSIONS],
403
+ default: ADMIN_API_DEFAULT_VERSION,
404
+ description: `Requested Shopify Admin API version for this checkpoint observation. Supported: ${ADMIN_API_SUPPORTED_VERSION_LABEL}; default: ${ADMIN_API_DEFAULT_VERSION}. The retained non-default version remains explicit in the stored plan and evidence.`,
405
+ },
401
406
  query: { type: 'string', minLength: 1, maxLength: 30000, description: 'One read-only Shopify Admin GraphQL document.' },
402
407
  operationName: { type: 'string', minLength: 1, description: 'Required when query contains more than one operation.' },
403
408
  // GraphQL variables are deliberately arbitrary JSON keys. The registry sweep pins this one
@@ -725,12 +730,49 @@ function receiptProjection(value) {
725
730
  const practiceRun = attempt.practiceRun ?? value?.practiceRun ?? null;
726
731
  const calls = Array.isArray(value?.events?.calls) ? value.events.calls : [];
727
732
  const actions = Array.isArray(value?.events?.actions) ? value.events.actions : [];
733
+ const capabilityMatrix = value?.receiptEvidence?.assertionCapabilities;
734
+ const webhookCapability = capabilityMatrix?.schemaVersion === 'meguro.receipt-assertion-capabilities.v1'
735
+ && capabilityMatrix?.families?.webhook
736
+ && typeof capabilityMatrix.families.webhook === 'object'
737
+ ? capabilityMatrix.families.webhook
738
+ : null;
728
739
  const assertions = Array.isArray(value?.receiptEvidence?.assertions)
729
- ? value.receiptEvidence.assertions.slice(0, 50).map((assertion) => ({
730
- id: assertion.id,
731
- status: assertion.status,
732
- label: assertion.label,
733
- }))
740
+ ? value.receiptEvidence.assertions.slice(0, 50).map((assertion) => {
741
+ if (assertion?.category !== 'webhook') {
742
+ return { id: assertion.id, status: assertion.status, label: assertion.label };
743
+ }
744
+ if (webhookCapability?.availability === 'available') {
745
+ return { id: assertion.id, status: assertion.status, label: assertion.label, detail: assertion.detail };
746
+ }
747
+ if (webhookCapability?.availability === 'unavailable'
748
+ && webhookCapability.statusLabel === 'not available in this run mode'
749
+ && typeof webhookCapability.detail === 'string'
750
+ && webhookCapability.detail.trim()) {
751
+ return {
752
+ id: assertion.id,
753
+ status: webhookCapability.statusLabel,
754
+ label: assertion.label,
755
+ detail: webhookCapability.detail,
756
+ };
757
+ }
758
+ if (webhookCapability?.availability === 'unknown'
759
+ && webhookCapability.statusLabel === 'availability unknown'
760
+ && typeof webhookCapability.detail === 'string'
761
+ && webhookCapability.detail.trim()) {
762
+ return {
763
+ id: assertion.id,
764
+ status: webhookCapability.statusLabel,
765
+ label: assertion.label,
766
+ detail: webhookCapability.detail,
767
+ };
768
+ }
769
+ return {
770
+ id: assertion.id,
771
+ status: 'availability unknown',
772
+ label: assertion.label,
773
+ detail: 'Webhook assertion availability is unknown because this receipt has no capability metadata.',
774
+ };
775
+ })
734
776
  : [];
735
777
  const verdict = value?.report?.verdict && typeof value.report.verdict === 'object'
736
778
  ? Object.fromEntries(['status', 'outcome', 'grade', 'score', 'headline', 'horizonDays']
@@ -1048,6 +1090,7 @@ function usageProjection(value) {
1048
1090
  ? 'Retained activity does not agree with the tier meter; the competing activity-derived total is withheld.'
1049
1091
  : 'Retained activity is incomplete; no activity-derived consumption total is projected.',
1050
1092
  },
1093
+ simulationRunAccounting: value?.simulationRunAccounting ?? null,
1051
1094
  headroom: {
1052
1095
  remainingSimulationRuns,
1053
1096
  remainingStoreSlots: Math.max(0, activeStoreLimit - activeStores),
@@ -1996,7 +2039,7 @@ export function createTools(config) {
1996
2039
  },
1997
2040
  {
1998
2041
  name: 'usage_read',
1999
- description: 'Read authoritative tier-meter simulation runs, practice-store, and workspace headroom before starting work. A billable simulation-run total is shown only when complete retained activity reconciles to that meter; incomplete coverage or a source mismatch is disclosed without projecting a competing consumption number.',
2042
+ description: 'Read authoritative tier-meter simulation runs, practice-store, and workspace headroom before starting work. When retained activity reconciles, simulationRunAccounting gives the exact counted + excluded non-billable sample = visible completed equation and the stable exclusion-policy identity. Incomplete coverage or a source mismatch is disclosed without projecting a competing consumption number.',
2000
2043
  inputSchema: { type: 'object', additionalProperties: false, properties: {}, required: [] },
2001
2044
  },
2002
2045
  {