chain-insights 0.85.2 → 0.92.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.
Files changed (89) hide show
  1. package/README.md +2 -0
  2. package/bin/install.cjs +2 -1
  3. package/dist/{active-q3yViZhc.cjs → active-COPA14FA.cjs} +2 -16
  4. package/dist/{active-D2aabYRF.mjs → active-CyC4jFka.mjs} +2 -7
  5. package/dist/{active-D2aabYRF.mjs.map → active-CyC4jFka.mjs.map} +1 -1
  6. package/dist/address-card-C-NB03XP.cjs +218 -0
  7. package/dist/address-card-LYaT5yz0.mjs +190 -0
  8. package/dist/address-card-LYaT5yz0.mjs.map +1 -0
  9. package/dist/address-risk-DPuXBsvH.cjs +806 -0
  10. package/dist/address-risk-Da6FsfGx.mjs +653 -0
  11. package/dist/address-risk-Da6FsfGx.mjs.map +1 -0
  12. package/dist/{capabilities-Mxa4oQdd.cjs → capabilities-DkNreyv7.cjs} +1 -1
  13. package/dist/{capabilities-bZOr5Ads.mjs → capabilities-w5bNR7F9.mjs} +2 -2
  14. package/dist/{capabilities-bZOr5Ads.mjs.map → capabilities-w5bNR7F9.mjs.map} +1 -1
  15. package/dist/cli.cjs +138 -46
  16. package/dist/cli.mjs +138 -46
  17. package/dist/cli.mjs.map +1 -1
  18. package/dist/{deployer-screen-B5yrXZGo.mjs → deployer-screen-Bkw_sz94.mjs} +3 -3
  19. package/dist/{deployer-screen-B5yrXZGo.mjs.map → deployer-screen-Bkw_sz94.mjs.map} +1 -1
  20. package/dist/{deployer-screen-0SOQ_HFf.cjs → deployer-screen-CFLi7OeH.cjs} +2 -2
  21. package/dist/{dex-registry-BY67f4Ul.mjs → dex-registry-Bkri0--q.mjs} +10 -2
  22. package/dist/{dex-registry-BY67f4Ul.mjs.map → dex-registry-Bkri0--q.mjs.map} +1 -1
  23. package/dist/{dex-registry-BhGJUG9_.cjs → dex-registry-CyR3GyRr.cjs} +20 -0
  24. package/dist/{dex-tool-7BK_gD6H.mjs → dex-tool-D0K_Qx4N.mjs} +4 -4
  25. package/dist/dex-tool-D0K_Qx4N.mjs.map +1 -0
  26. package/dist/{dex-tool-Be9NAuD8.cjs → dex-tool-DQ5Eg0LO.cjs} +3 -3
  27. package/dist/{exchange-deposit-check-C5MseGlZ.cjs → exchange-deposit-check-BNzkwQeW.cjs} +18 -18
  28. package/dist/{exchange-deposit-check-CXHZCHWW.mjs → exchange-deposit-check-DIALj2sm.mjs} +19 -19
  29. package/dist/exchange-deposit-check-DIALj2sm.mjs.map +1 -0
  30. package/dist/{exchange-registry-CT0rRW__.cjs → exchange-registry-CEgkeQV1.cjs} +16 -93
  31. package/dist/{exchange-registry-CoLgHw6d.mjs → exchange-registry-Dr5UtcT5.mjs} +17 -94
  32. package/dist/exchange-registry-Dr5UtcT5.mjs.map +1 -0
  33. package/dist/{exchange-tool-Dc46SJ49.mjs → exchange-tool-B7E29YoQ.mjs} +4 -4
  34. package/dist/exchange-tool-B7E29YoQ.mjs.map +1 -0
  35. package/dist/{exchange-tool-B2SMeC5f.cjs → exchange-tool-CXaUBAd2.cjs} +3 -3
  36. package/dist/{graph-schema-CcrYPpSv.cjs → graph-schema-Bn3txQCj.cjs} +115 -12
  37. package/dist/{graph-schema-CRQuKya1.mjs → graph-schema-DvABR1yl.mjs} +97 -12
  38. package/dist/graph-schema-DvABR1yl.mjs.map +1 -0
  39. package/dist/{layer-routing-YDj-ynG9.cjs → layer-routing-j48SQ8Wk.cjs} +2 -2
  40. package/dist/{layer-routing-DCJVNN6O.mjs → layer-routing-r4IbIQSr.mjs} +3 -3
  41. package/dist/layer-routing-r4IbIQSr.mjs.map +1 -0
  42. package/dist/mcp-proxy.cjs +62 -15
  43. package/dist/mcp-proxy.d.cts.map +1 -1
  44. package/dist/mcp-proxy.d.mts.map +1 -1
  45. package/dist/mcp-proxy.mjs +62 -15
  46. package/dist/mcp-proxy.mjs.map +1 -1
  47. package/dist/public-file-BISyAesm.mjs +133 -0
  48. package/dist/public-file-BISyAesm.mjs.map +1 -0
  49. package/dist/public-file-DDp2CrUl.cjs +138 -0
  50. package/dist/{request-timeout-DxwNijQD.cjs → request-timeout-BXiIt9Jy.cjs} +0 -1
  51. package/dist/{request-timeout-K3ljP0pa.mjs → request-timeout-DetG2xO4.mjs} +2 -2
  52. package/dist/{request-timeout-K3ljP0pa.mjs.map → request-timeout-DetG2xO4.mjs.map} +1 -1
  53. package/dist/{token-lookup-Cf59VdGe.mjs → token-lookup-Ck0q7crJ.mjs} +2 -2
  54. package/dist/{token-lookup-Cf59VdGe.mjs.map → token-lookup-Ck0q7crJ.mjs.map} +1 -1
  55. package/dist/{token-lookup-DqjSRIxd.cjs → token-lookup-DLe4erP9.cjs} +1 -1
  56. package/dist/token-risk-CpMfFRoY.cjs +1004 -0
  57. package/dist/token-risk-DhnJc2kJ.mjs +971 -0
  58. package/dist/token-risk-DhnJc2kJ.mjs.map +1 -0
  59. package/dist/{tool-visibility-D8Up081E.cjs → tool-visibility-BCa-tmyZ.cjs} +11 -2
  60. package/dist/{tool-visibility-DuTds7V4.mjs → tool-visibility-BstrSl4s.mjs} +12 -3
  61. package/dist/tool-visibility-BstrSl4s.mjs.map +1 -0
  62. package/docs/contributing.md +10 -8
  63. package/docs/development.md +5 -5
  64. package/docs/evals.md +16 -1
  65. package/docs/graph-query-compatibility.md +15 -2
  66. package/docs/graph-tools.md +44 -6
  67. package/docs/mcp-proxy.md +189 -8
  68. package/docs/stability.md +4 -5
  69. package/docs/testing.md +76 -0
  70. package/package.json +1 -1
  71. package/registry/README.md +20 -5
  72. package/registry/address-card.json +680 -0
  73. package/skills/chain-insights-address-risk/SKILL.md +61 -0
  74. package/skills/chain-insights-address-risk/agents/openai.yaml +4 -0
  75. package/skills/chain-insights-aml-exchange/SKILL.md +9 -7
  76. package/skills/chain-insights-cypher/SKILL.md +79 -3
  77. package/skills/chain-insights-token-risk/SKILL.md +81 -0
  78. package/skills/chain-insights-token-risk/agents/openai.yaml +4 -0
  79. package/skills/chain-insights-virtuals/reference.md +1 -1
  80. package/dist/dex-tool-7BK_gD6H.mjs.map +0 -1
  81. package/dist/exchange-deposit-check-CXHZCHWW.mjs.map +0 -1
  82. package/dist/exchange-registry-CoLgHw6d.mjs.map +0 -1
  83. package/dist/exchange-tool-Dc46SJ49.mjs.map +0 -1
  84. package/dist/graph-schema-CRQuKya1.mjs.map +0 -1
  85. package/dist/layer-routing-DCJVNN6O.mjs.map +0 -1
  86. package/dist/public-tools-CBszU2oX.cjs +0 -1334
  87. package/dist/public-tools-DVhUjSDV.mjs +0 -1333
  88. package/dist/public-tools-DVhUjSDV.mjs.map +0 -1
  89. package/dist/tool-visibility-DuTds7V4.mjs.map +0 -1
package/docs/mcp-proxy.md CHANGED
@@ -86,6 +86,8 @@ The proxy:
86
86
  | `aml_deployer_screen` | Screen who is behind a token or a wallet: launcher, first funder, labels, facts only |
87
87
  | `meta_exchange_lookup` | Turn a centralized exchange name, or one of its wallets, into its listed wallets |
88
88
  | `aml_exchange_deposit_check` | Check one address: an exchange deposit, of which exchange, swept into which wallet |
89
+ | `aml_address_risk` | Screen one address: who it is, its risk word with reasons, model score, partners |
90
+ | `aml_token_risk` | Screen one token or pool: founder, factory, gas wallets, pools, each with its word |
89
91
  | `meta_rules` | Read the answer rules when the `chain-insights-cypher` skill is not loaded |
90
92
  | `meta_help` | Show Chain Insights tool and workflow guidance |
91
93
  | `meta_usage_status` | Check the caller's daily free-tier graph query allowance |
@@ -107,6 +109,20 @@ note, and such a schema is kept for 10 minutes, not 24 hours. In the terminal,
107
109
  structured form and `--refresh` to rebuild it.
108
110
  `cia mcp call meta_schema network=robinhood` does the same.
109
111
 
112
+ The answer also lists the address card, the one card the graph writes on every
113
+ `:Address` node: each card property with its type, the question it answers,
114
+ its meaning and its closed values, and each mark and flag with the card words
115
+ that give it (`address_card` in the structured form). The description carries
116
+ the card's one rule: read the address card (identity, address_roles,
117
+ behaviour, evidence, judgements, risk), not the labels list. The dictionary is
118
+ the public file [`registry/address-card.json`](../registry/address-card.json),
119
+ generated from the label vocabulary and never edited by hand. It is read like
120
+ the exchange lookup: from `main` over `raw.githubusercontent.com`, cached one
121
+ hour in `~/.chain-insights/cache/address-card.json`, the packaged copy when the
122
+ fetch fails. A malformed file is refused with one line in the proxy log and
123
+ the packaged copy answers. `CHAIN_INSIGHTS_ADDRESS_CARD_URL` points the
124
+ proxy at another copy. The card is not part of the 24-hour schema cache.
125
+
110
126
  `meta_dex_lookup` turns the name of a decentralized exchange, a launchpad or a
111
127
  vault into its addresses. It takes `network` (required), `name` (optional:
112
128
  with no name it lists every covered exchange) and `pools` (default `true`).
@@ -256,16 +272,16 @@ same lookup in a terminal.
256
272
  `aml_exchange_deposit_check` checks one address. It takes `network` and
257
273
  `address` (both required). One `graph_query_batch` sends six reads on
258
274
  `USE topology`, all anchored on the address: the address with its
259
- `cex_role`, its `SWEPT` links with each hot wallet it swept into, and four
275
+ `exchange_role`, its `SWEPT` links with each hot wallet it swept into, and four
260
276
  counts of its behaviour.
261
277
 
262
278
  ```mermaid
263
279
  flowchart LR
264
- T["a trail"] -->|"FLOWED_TO"| D["deposit<br/>cex_role deposit"]
265
- D -->|"SWEPT<br/>sweep_count, paths"| H["hot wallet<br/>cex_role hot_wallet"]
280
+ T["a trail"] -->|"FLOWED_TO"| D["deposit<br/>exchange_role deposit"]
281
+ D -->|"SWEPT<br/>sweep_count, paths"| H["hot wallet<br/>exchange_role hot_wallet"]
266
282
  ```
267
283
 
268
- - `is_deposit` is true when the address carries `cex_role` `deposit` or has a
284
+ - `is_deposit` is true when the address carries `exchange_role` `deposit` or has a
269
285
  `SWEPT` link. `SWEPT` is drawn only from an address the deposit rule judged a
270
286
  deposit.
271
287
  - With neither, the node read also takes the exchange model's guess:
@@ -296,7 +312,7 @@ flowchart LR
296
312
  every answer: it is one customer's, few outside addresses pay it,
297
313
  everything it sends goes to the wallets of one exchange, and it never swaps
298
314
  on a DEX. A host asked what makes an address a deposit answers with it. The
299
- graph judges an address against it. The verdict is `is_deposit`, `cex_role`
315
+ graph judges an address against it. The verdict is `is_deposit`, `exchange_role`
300
316
  and `swept`; the counts are the facts behind it.
301
317
  - A trail that reaches a deposit ends there: the exchange can name the
302
318
  customer behind it. A failed read is an error that says it is not "no
@@ -305,6 +321,160 @@ flowchart LR
305
321
  `cia mcp call aml_exchange_deposit_check network=robinhood address=0x...` runs
306
322
  the same check in a terminal.
307
323
 
324
+ `aml_address_risk` screens one address. It takes `network` and `address`
325
+ (both required) and `surroundings` (optional, `true` or `false`). It sends
326
+ three reads on `USE topology`, all anchored on the address, in two
327
+ `graph_query_batch` calls: first the address alone, with its card, the risk
328
+ model's level and score and its link count; then, unless it is not found or
329
+ is a hub, its senders and its receivers (the newest money links worth 1 USD or more, 26 a
330
+ direction to know whether more than 25 exist).
331
+
332
+ ```mermaid
333
+ flowchart LR
334
+ C["card entries<br/>identity, evidence, judgements"] -->|"card dictionary<br/>registry/address-card.json words"| R["rules_word"]
335
+ M["risk model<br/>risk_level, risk_score"] --> W["model_word"]
336
+ R --> H["risk.word = the higher"]
337
+ W --> H
338
+ ```
339
+
340
+ - `risk.word` is `critical`, `high`, `medium`, `low` or `unscored`. It is the
341
+ higher of `rules_word` (the highest level among the card's identity
342
+ words, every one of `identities` counted, and its evidence and judgement
343
+ entries, or `none`) and `model_word` (`high`, `medium`,
344
+ `low` or `not_scored`). Only a label gives `critical`. A label word is never
345
+ lowered by the model. `unscored` means neither speaks: it is not `low`, and
346
+ not safe.
347
+ - `risk.set_by` says who set the word: `rules`, `model`, `both` or `none`.
348
+ `risk.score` is the model's number from 0 to 1, unchanged, or `null`: a
349
+ label never makes a number.
350
+ - `risk.reasons` holds one reason per card word, each with its question, its
351
+ standing, its level and its fixed `plain` sentence from the card dictionary.
352
+ An entry is looked up by its word and value alone, whatever card list it
353
+ came from: `scam:FAKE_TOKEN_LP` is the pattern fact the dictionary says it
354
+ is, and `scam` with any other value is the scam word. A reason whose
355
+ dictionary question is `judgement` reads `pattern`, with its value, and sets
356
+ no level. An identity of `identities` other than the top one adds a reason
357
+ only when it carries a level. A word the model set adds one
358
+ reason with standing `predicted`. A card word the dictionary does not hold
359
+ is listed in `unknown_words` and sets nothing. `card_version` is the
360
+ dictionary version the graph resolved the card with.
361
+ - The word is computed from the entries and the served card dictionary, so a
362
+ dictionary merged on `main` changes every answer within the hour.
363
+ - `exposure` lists the partners that carry a word of `medium` or above, each
364
+ with its own word and reasons, computed by the same rule. A risky partner
365
+ never changes the address's word. `pattern_partners` counts the partners
366
+ with a pattern fact and no word of `medium` or above. A token contract and
367
+ the zero addresses are left out and counted in `left_out`.
368
+ - `exchange_ends` lists the exchange wallets the address paid or was paid by,
369
+ named through the exchange lookup.
370
+ - The node is read first, alone, in its own call. A hub, a node with more
371
+ than 50,000 links (`degree_total`, such as the zero address or a pool
372
+ manager), has its counterparties not ranked: the two partner reads are not
373
+ sent, `exposure.hub` is `true` with its `degree_total`,
374
+ `counterparties_read` is `0`, and `not_read` names part `counterparties`
375
+ with code `hub`. Ask about one counterparty, or one token, instead. The
376
+ word still comes from the card and the model. A node with no
377
+ `degree_total` is not a hub.
378
+ - `not_read` names a partner read that did not answer, with its code; the
379
+ answer still stands. A failed address read is an error.
380
+ - With `surroundings: true` the answer adds the nodes (at most 60) and the
381
+ `FLOWED_TO` links behind it, built from the same reads, for a host that
382
+ draws.
383
+ - The answer holds facts and measures only: no summary, no advice, no
384
+ verdict. The host writes the judgement.
385
+
386
+ `cia mcp call aml_address_risk network=robinhood address=0x...` and
387
+ `cia workflow aml-address-risk --network robinhood --address 0x...` run the same
388
+ screen in a terminal.
389
+
390
+ `aml_token_risk` screens one token contract or one pool, built on the address
391
+ answer. It takes the same three arguments. The node's labels decide what was
392
+ asked: a node with `Pool` is a pool (a launchpad pair carries `Token` and
393
+ `Pool`, and `Pool` wins), and so is a pool manager the exchange registry
394
+ lists; a node with `Token` is a token, and any other
395
+ address is answered with its own word only, to be asked again with
396
+ `aml_address_risk`. At most four `graph_query_batch` calls of at most 20
397
+ reads each, all on `USE topology`. The first reads the subject's node alone;
398
+ a hub's partner reads are never sent, as for `aml_address_risk`:
399
+
400
+ ```mermaid
401
+ flowchart LR
402
+ B0["call 1<br/>the subject node alone:<br/>found, what it is, its link count"] --> B1["call 2<br/>senders and receivers (never for a hub),<br/>deployment, adders, removers, assets"]
403
+ B1 --> B2["call 3, a token<br/>pools and providers by asset (both directions, first),<br/>founder, factory, gas wallets"]
404
+ B1 --> P2["call 3, a pool<br/>its tokens and its deployer"]
405
+ B2 --> B3["call 4<br/>the 10 biggest pools with their own address:<br/>node and deployment"]
406
+ ```
407
+
408
+ - The founder is the wallet that sent the deployment (`tx_origin`, else the
409
+ deployer). The factory is the contract that deployed it, when the
410
+ deployment kind is `factory`. Its `name` comes from the exchange registry
411
+ row of the factory (`named_by: 'registry'`). A token factory with no row of
412
+ its own, such as the Virtuals token factory, which creates tokens and no
413
+ pools, is named from the token's `launchpad` identity: the first part of
414
+ its value (`virtuals:CIA:graduated` gives `virtuals`) is the registry key
415
+ (`named_by: 'launchpad'`). Otherwise `name` and `named_by` are `null`.
416
+ The founder carries the full address answer: its word, its
417
+ `exposure` and its `exchange_ends`.
418
+ - `risk.word` is the highest of the token's own word, its founder's word and
419
+ each detailed pool's own word. `raised_by` (`token`, `founder` or `pool`)
420
+ and `raised_by_address` say whose, and `set_by` how that word was set
421
+ (`none` when unscored); `risk.own` is the token's own block and
422
+ `risk.score` its own model score. A factory, a gas wallet (the first three
423
+ accounts that paid the founder), an adder and a remover carry their own
424
+ word and never raise it. A pool manager raises nothing. A pool answer
425
+ carries the pool's own word only.
426
+ - The pools come from four whole-chain reads, first in their batch, two
427
+ per direction (`ADDED_LIQUIDITY` into the pool, `REMOVED_LIQUIDITY` from
428
+ the pool to its receiver), each by the token as `asset`:
429
+ - a grouped read, one row per pool address (500 at most): its distinct
430
+ providers, this token's USD sum and its events. It gives the exact
431
+ `pools_found`, and each pool's `providers` and `token_side`;
432
+ - a rows read, one row per pool and provider (200 at most), the biggest
433
+ first. It gives the 5 biggest adders or removers of each pool.
434
+ A read that is refused or times out is named in `not_read`; the other
435
+ reads still answer. When the grouped read does not answer, the pools,
436
+ providers and sums come from the rows read, as far as it reaches.
437
+ - A pool row is one address. The pools inside one pool manager (the manager
438
+ of a vault exchange in the exchange registry, such as Uniswap v4) are
439
+ answered as one row for the manager, not pool by pool: `is_manager: true`,
440
+ `pools_inside: null`, its providers and this token's side. Its node sums
441
+ are the manager's whole book, so `liquidity` is `null`, and it has no
442
+ word. A manager asked about itself sends no adders, removers or assets read
443
+ and lists none (`adders: []`, `removers: []`, `pool_tokens: []`): its
444
+ parties and its tokens are answered per token, so ask the token.
445
+ - Every pool row carries `exchange`, the registry name by its manager or
446
+ its factory, else `null`; `providers` (distinct adders of this token);
447
+ and `token_side` (this token added and removed; `removed_usd` is `0` when
448
+ the grouped removals read answered under 500 rows with no row for the
449
+ pool, and `null` when that read did not answer, came back full, or the
450
+ pool's removals carry no price). A pool with its own
451
+ address, among the 10 biggest, adds its node: its own word in `risk` and
452
+ both sides of `liquidity`.
453
+ - `pools_found` counts every pool address of the token, exact up to 500.
454
+ The 10 biggest by tokens added are detailed (`detail: true`); a pool
455
+ beyond them keeps its providers and `token_side`. `pools_truncated` says
456
+ when more pools exist than are detailed; a grouped read full at 500 is
457
+ named in `not_read` as part `pools` with code `truncated`.
458
+ `parties_truncated` says a rows read came back full, so the adders and
459
+ removers of a pool may miss a party; `not_read` names it as part
460
+ `pool_parties` with code `truncated`.
461
+ - A USD sum with no priced link is `null`, never `0`.
462
+ - `not_read` names every part that did not answer (`pools`,
463
+ `pool_removals`, `founder`, `factory`, `gas_wallets`, a pool's `pool`,
464
+ and more), with its code: the code the refusal names, such as
465
+ `query_timeout`, `family_behind` or `anchor_missing`. A part not read is
466
+ never "none found". A failed subject read is an error.
467
+ - With `surroundings: true` the answer adds the nodes (at most 60; partners
468
+ are dropped first, then removers, then adders) and the `FLOWED_TO`,
469
+ `DEPLOYED_CONTRACT`, `ADDED_LIQUIDITY` and `REMOVED_LIQUIDITY` links
470
+ between them.
471
+ - The answer holds facts and measures only: no summary, no advice, no
472
+ verdict.
473
+
474
+ `cia mcp call aml_token_risk network=robinhood address=0x...` and
475
+ `cia workflow aml-token-risk --network robinhood --address 0x...` run the same
476
+ screen in a terminal.
477
+
308
478
  ## Host parity
309
479
 
310
480
  **A rule a host never loads does not exist for that host.** Each host loads a
@@ -320,6 +490,8 @@ different part of what this package ships:
320
490
  | protocol tool doors | yes | yes | yes | yes | yes | yes |
321
491
  | token door `meta_token_lookup` | yes | yes | yes | yes | yes | yes |
322
492
  | exchange doors `meta_exchange_lookup`, `aml_exchange_deposit_check` | yes | yes | yes | yes | yes | yes |
493
+ | address risk `aml_address_risk` | yes | yes | yes | yes | yes | yes |
494
+ | token risk `aml_token_risk` | yes | yes | yes | yes | yes | yes |
323
495
 
324
496
  The scout agent pins the CLI by version in its image and copies only
325
497
  `chain-insights-cypher` and `chain-insights-virtuals` into its project, yet asks
@@ -340,6 +512,10 @@ The rule:
340
512
  `door: <tool>, <tool>` for a skill with two doors.
341
513
  `chain-insights-aml-exchange` has two: `meta_exchange_lookup` for an
342
514
  exchange by name and `aml_exchange_deposit_check` for one address.
515
+ The risk skills `chain-insights-address-risk` and
516
+ `chain-insights-token-risk` open on `aml_address_risk` and
517
+ `aml_token_risk`. Their question is one address, token or pool, so they
518
+ name no exchange.
343
519
  2. Each door's description carries the rule the skill opens with, and names
344
520
  the skill's trigger words.
345
521
  3. The skill names the door as its first step.
@@ -356,6 +532,14 @@ never search the web), the `graph_query` description sends a named token to
356
532
  it, and the core skill `chain-insights-cypher` repeats it as a row of its
357
533
  question table.
358
534
 
535
+ The behaviour kinds of busy accounts (`behaviour_kind`, `behaviour_group`)
536
+ take the path of the judgement marks. The `graph_query` description carries
537
+ every kind in plain words and the rule: a behaviour kind describes automation
538
+ or volume, it is not a risk signal by itself, and an answer never presents it
539
+ as an accusation. The server instructions and `meta_schema` say the same, and
540
+ the core skill repeats it in its section "Behaviour kinds".
541
+ `tests/behaviour-kinds.test.ts` holds every surface to it.
542
+
359
543
  A host that loads skills gets both. A host that loads none gets the door.
360
544
  `tests/host-parity.test.ts` checks it: every
361
545
  `skills/chain-insights-<protocol>/SKILL.md` has a door, the door is in
@@ -508,9 +692,6 @@ Graph queries take full blockchain addresses directly and return blockchain
508
692
  addresses as the public result surface. The graph is address-grain, so there
509
693
  is no identity-resolution step. Never shorten an address.
510
694
 
511
- The proxy does not offer `aml_address_risk`. It is hidden until its verdict is
512
- fixed: `tools/list` omits it, and a call to it is refused as an unknown tool.
513
-
514
695
  ## Auth Modes
515
696
 
516
697
  Local debug mode:
package/docs/stability.md CHANGED
@@ -18,7 +18,7 @@ Exit codes are contract. Scripts and agent harnesses may rely on them.
18
18
 
19
19
  ### MCP tool names
20
20
 
21
- The public MCP surface is these sixteen tools:
21
+ The public MCP surface is these eighteen tools:
22
22
 
23
23
  - `graph_query`
24
24
  - `graph_query_batch`
@@ -29,6 +29,8 @@ The public MCP surface is these sixteen tools:
29
29
  - `aml_deployer_screen`
30
30
  - `meta_exchange_lookup`
31
31
  - `aml_exchange_deposit_check`
32
+ - `aml_address_risk`
33
+ - `aml_token_risk`
32
34
  - `meta_rules`
33
35
  - `meta_help`
34
36
  - `meta_usage_status`
@@ -37,7 +39,7 @@ The public MCP surface is these sixteen tools:
37
39
  - `wallet_topup`
38
40
  - `subscription_topup`
39
41
 
40
- `graph_expand` is the seventeenth tool the proxy registers. The view calls it
42
+ `graph_expand` is the nineteenth tool the proxy registers. The view calls it
41
43
  when you click in a picture; hosts keep it out of the model's tool list. It
42
44
  is not part of the public surface.
43
45
 
@@ -45,9 +47,6 @@ Tool names are contract. Removing or renaming one is a deprecation event.
45
47
  Tool _arguments_ may grow additively at any time; existing argument names and
46
48
  meanings are stable.
47
49
 
48
- `aml_address_risk` is hidden until its verdict is fixed. It is not on the
49
- public surface, and a call to it is refused as an unknown tool.
50
-
51
50
  The CLI supports `--json` for indented structured output.
52
51
 
53
52
  ### Config keys
@@ -0,0 +1,76 @@
1
+ # Chain Insights testing
2
+
3
+ Two checks before a merge, the build before a release, then the staging
4
+ lane (AP1000 change `validator-agents-replace-integration-tests`, 2026-11-20).
5
+ No test here asks for a server or a chain node.
6
+
7
+ ```mermaid
8
+ flowchart TB
9
+ T4["staging lane<br/>chain-insights-validator judges what graphrag-mcp serves<br/>and what a buy does on chain"]
10
+ B["build<br/>ci/build.sh: build, publint, attw, release gate, pack"]
11
+ T1["T1 unit<br/>ci/t1.sh, 300 s: typecheck, build, vitest with coverage"]
12
+ L["lint<br/>ci/lint.sh, 120 s: oxlint, secret scans, no test that asks for a server"]
13
+ T4 --- B --- T1 --- L
14
+ ```
15
+
16
+ ## Commands
17
+
18
+ On the workstation every test run goes through AP1000's test sandbox
19
+ (`test-sandbox.sh`), so no test reads or writes the real home:
20
+
21
+ ```bash
22
+ bash ci/lint.sh
23
+ bash "$AP1000_SANDBOX" <worktree> -- bash ci/t1.sh # AP1000 test-sandbox.sh
24
+ ```
25
+
26
+ The risk golden runner asks the risk tools about known addresses, pools and
27
+ tokens on a live graph. It is not a test of T1 and is not in the package;
28
+ its compare rule is (`tests/risk-golden-compare.test.ts`):
29
+
30
+ ```bash
31
+ RISK_GOLDEN_TOKEN_FILE=<file> npx tsx scripts/risk-golden.mjs token --json > evidence.json
32
+ ```
33
+
34
+ The cases live in `scripts/risk-golden.json`. Each names only the expect keys
35
+ it checks. A run fails when a case fails or the set holds fewer cases than
36
+ `--min` (20 address, 10 pool, 20 token by default).
37
+
38
+ `.github/workflows/verify.yml` runs the same files, by hand and before a
39
+ release. No pull request runs a test. There is no start-up smoke: the
40
+ package runs no StarRocks.
41
+
42
+ ## Where a new test goes
43
+
44
+ | The code | The test |
45
+ |---|---|
46
+ | a rule, a query builder, a tool's text, a registry file | a unit test in `tests/`, over committed fixtures |
47
+ | a step that talks to the chain or to `graphrag-mcp` | a unit test of its own decisions over the answers it is given (`tests/subscription-buy.test.ts`); what the other side does is judged on the staging lane |
48
+ | what a lane serves | a check of chain-insights-validator. Name it in the pull request |
49
+
50
+ `ci/lint.sh` refuses:
51
+
52
+ - a `*.integration.test.ts` or `*.t2.test.ts` file;
53
+ - a test that reads a live-graph endpoint setting, the retired T2 switch,
54
+ `ANVIL_BIN` or `STARROCKS_*`, or starts anvil.
55
+
56
+ ## What the staging lane judges
57
+
58
+ chain-insights-validator must gain these checks (none exists yet; its one
59
+ check today is `daily_run`):
60
+
61
+ - **Exchange registry.** Every row of `registry/robinhood.json` against the
62
+ lane's graph: every factory, manager and router is a contract; every
63
+ factory with a pool floor deployed at least that many pools; every example
64
+ pool is `:Pool`, carries one of its row's adapter marks, and was deployed by
65
+ one of its factories.
66
+ - **Golden marks.** Every row of `tests/fixtures/graph-marks-golden.json`:
67
+ every golden mark present, every forbidden mark absent, every count at least
68
+ its floor, the card subset held (`lane_only: "staging"` rows on the staging
69
+ lane only).
70
+ - **Documented recipes.** Every recipe of `tests/fixtures/documented-recipes.json`
71
+ and every query of `tests/fixtures/graph-query-corpus.json` is admitted or
72
+ refused as documented, fixture-anchored recipes return rows under their
73
+ `RETURN` aliases, and every address column is a lower-case `0x` address.
74
+ - **Subscription buys.** Every `Received` event of the sink
75
+ `0x67a8c068cc762e371706ea6c399178171f92810d` on Robinhood Chain is from
76
+ the paying wallet, for the exact amount, and becomes a grant.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chain-insights",
3
- "version": "0.85.2",
3
+ "version": "0.92.0",
4
4
  "description": "AML investigation CLI and MCP proxy for blockchain risk screening and Chain Insights Graph access",
5
5
  "homepage": "https://chain-insights.ai",
6
6
  "repository": {
@@ -135,10 +135,10 @@ node scripts/render-dex-registry.mjs --check # exit 1 when a memo table differ
135
135
  rows: every adapter in order, the lowest block, the first source;
136
136
  - `example_pool` and `pool_floor` are `null` when the exchange gives none.
137
137
 
138
- The release suite `tests/dex-registry-live.integration.test.ts` reads every
139
- row against a live graph per release candidate: every factory, manager and
140
- router is a contract, every factory with a pool floor shows at least that many
141
- pools, and every example pool is a `:Pool` deployed by its factory.
138
+ chain-insights-validator reads every row against the staging lane's graph:
139
+ every factory, manager and router is a contract, every factory with a pool
140
+ floor shows at least that many pools, and every example pool is a `:Pool`
141
+ deployed by its factory (`docs/testing.md`).
142
142
 
143
143
  ## Centralized exchanges
144
144
 
@@ -147,7 +147,7 @@ indexer-evm-cex registry of the network, and under each only the wallets
147
147
  proven on that network's own data. The proxy tool `meta_exchange_lookup`
148
148
  serves it, and `aml_exchange_deposit_check` names an exchange from it.
149
149
  Whether an address is a deposit is read from the graph, never from this file:
150
- `aml_exchange_deposit_check` reads the address's `cex_role` and its `SWEPT`
150
+ `aml_exchange_deposit_check` reads the address's `exchange_role` and its `SWEPT`
151
151
  links.
152
152
 
153
153
  | File | Exchanges | Wallets proven on the chain |
@@ -174,3 +174,18 @@ writes the file from the indexer's registry, leaves out every wallet with no
174
174
  block, and keeps each exchange's display name and aliases.
175
175
  `tests/exchange-registry.test.ts` holds every file to these rules. A row merged
176
176
  on `main` reaches every running proxy within one hour.
177
+
178
+ ## The address card
179
+
180
+ [address-card.json](address-card.json) is the dictionary of the address card,
181
+ the one card the graph writes on every `:Address` node. It lists each card
182
+ property with its type, its question, its meaning and its closed values, each
183
+ mark and each flag with the card words that give it, and the one `rule`: read
184
+ the address card (identity, address_roles, behaviour, evidence, judgements,
185
+ risk), not the labels list.
186
+
187
+ The file is generated from the label vocabulary and never edited by hand. The
188
+ proxy tool `meta_schema` serves it, read from `main` and cached one hour, with
189
+ the packaged copy offline. `tests/graph-schema-address-card.test.ts` holds the
190
+ answer to the file, and `tests/graph-marks-golden.test.ts` holds the golden
191
+ card rows to it.