chain-insights 0.85.2 → 0.93.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-B8xTh1iM.mjs +760 -0
  10. package/dist/address-risk-B8xTh1iM.mjs.map +1 -0
  11. package/dist/address-risk-WIKbjqy2.cjs +913 -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-BkwTaKxS.cjs +1004 -0
  57. package/dist/token-risk-XVaN_Yp3.mjs +971 -0
  58. package/dist/token-risk-XVaN_Yp3.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 +206 -8
  68. package/docs/stability.md +4 -5
  69. package/docs/testing.md +77 -0
  70. package/package.json +1 -1
  71. package/registry/README.md +20 -5
  72. package/registry/address-card.json +772 -0
  73. package/skills/chain-insights-address-risk/SKILL.md +77 -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 +80 -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,177 @@ 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
+ - `exposed` is present only when the node carries the `exposed` property
369
+ (JSON text, an array with one block per scam kind, sorted by `scam_kind`).
370
+ Each block holds `grade` (always `exposed`), `band` (`top`, `high` or
371
+ `raised`), `scam_kind` and its name, `steps`, `path` (the trail id),
372
+ `path_address`, `way` (addresses, nearest the address first),
373
+ `link_payments`, `link_two_way`, `day`, `profile`, `paid_once` and one
374
+ `text`: "Exposed (high band): in the blast radius of fake-token scams, 2
375
+ payments away: pays 0xWAY, which paid 0xPATH_ADDRESS on the path" (at 1 step:
376
+ "paid 0xPATH_ADDRESS on the path"), with "; paid once, may be a victim"
377
+ when `paid_once` is true. The direction is fixed: the address paid the
378
+ first of `way`, each paid the next, the last paid `path_address`. The
379
+ sentence never says money came to the address. The words come from the card dictionary
380
+ (`exposed`, `exposed_band`, `scam_kind`, `paid_once`, question `exposure`).
381
+ Exposed is a grade below proof: never evidence against the address, no
382
+ number, and it adds no reason and never changes `risk.word`. A value that
383
+ is not valid JSON shows nothing and is logged; an absent property says
384
+ nothing. `exposed_pass` is never read.
385
+ - `exchange_ends` lists the exchange wallets the address paid or was paid by,
386
+ named through the exchange lookup.
387
+ - The node is read first, alone, in its own call. A hub, a node with more
388
+ than 50,000 links (`degree_total`, such as the zero address or a pool
389
+ manager), has its counterparties not ranked: the two partner reads are not
390
+ sent, `exposure.hub` is `true` with its `degree_total`,
391
+ `counterparties_read` is `0`, and `not_read` names part `counterparties`
392
+ with code `hub`. Ask about one counterparty, or one token, instead. The
393
+ word still comes from the card and the model. A node with no
394
+ `degree_total` is not a hub.
395
+ - `not_read` names a partner read that did not answer, with its code; the
396
+ answer still stands. A failed address read is an error.
397
+ - With `surroundings: true` the answer adds the nodes (at most 60) and the
398
+ `FLOWED_TO` links behind it, built from the same reads, for a host that
399
+ draws.
400
+ - The answer holds facts and measures only: no summary, no advice, no
401
+ verdict. The host writes the judgement.
402
+
403
+ `cia mcp call aml_address_risk network=robinhood address=0x...` and
404
+ `cia workflow aml-address-risk --network robinhood --address 0x...` run the same
405
+ screen in a terminal.
406
+
407
+ `aml_token_risk` screens one token contract or one pool, built on the address
408
+ answer. It takes the same three arguments. The node's labels decide what was
409
+ asked: a node with `Pool` is a pool (a launchpad pair carries `Token` and
410
+ `Pool`, and `Pool` wins), and so is a pool manager the exchange registry
411
+ lists; a node with `Token` is a token, and any other
412
+ address is answered with its own word only, to be asked again with
413
+ `aml_address_risk`. At most four `graph_query_batch` calls of at most 20
414
+ reads each, all on `USE topology`. The first reads the subject's node alone;
415
+ a hub's partner reads are never sent, as for `aml_address_risk`:
416
+
417
+ ```mermaid
418
+ flowchart LR
419
+ 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"]
420
+ B1 --> B2["call 3, a token<br/>pools and providers by asset (both directions, first),<br/>founder, factory, gas wallets"]
421
+ B1 --> P2["call 3, a pool<br/>its tokens and its deployer"]
422
+ B2 --> B3["call 4<br/>the 10 biggest pools with their own address:<br/>node and deployment"]
423
+ ```
424
+
425
+ - The founder is the wallet that sent the deployment (`tx_origin`, else the
426
+ deployer). The factory is the contract that deployed it, when the
427
+ deployment kind is `factory`. Its `name` comes from the exchange registry
428
+ row of the factory (`named_by: 'registry'`). A token factory with no row of
429
+ its own, such as the Virtuals token factory, which creates tokens and no
430
+ pools, is named from the token's `launchpad` identity: the first part of
431
+ its value (`virtuals:CIA:graduated` gives `virtuals`) is the registry key
432
+ (`named_by: 'launchpad'`). Otherwise `name` and `named_by` are `null`.
433
+ The founder carries the full address answer: its word, its
434
+ `exposure` and its `exchange_ends`.
435
+ - `risk.word` is the highest of the token's own word, its founder's word and
436
+ each detailed pool's own word. `raised_by` (`token`, `founder` or `pool`)
437
+ and `raised_by_address` say whose, and `set_by` how that word was set
438
+ (`none` when unscored); `risk.own` is the token's own block and
439
+ `risk.score` its own model score. A factory, a gas wallet (the first three
440
+ accounts that paid the founder), an adder and a remover carry their own
441
+ word and never raise it. A pool manager raises nothing. A pool answer
442
+ carries the pool's own word only.
443
+ - The pools come from four whole-chain reads, first in their batch, two
444
+ per direction (`ADDED_LIQUIDITY` into the pool, `REMOVED_LIQUIDITY` from
445
+ the pool to its receiver), each by the token as `asset`:
446
+ - a grouped read, one row per pool address (500 at most): its distinct
447
+ providers, this token's USD sum and its events. It gives the exact
448
+ `pools_found`, and each pool's `providers` and `token_side`;
449
+ - a rows read, one row per pool and provider (200 at most), the biggest
450
+ first. It gives the 5 biggest adders or removers of each pool.
451
+ A read that is refused or times out is named in `not_read`; the other
452
+ reads still answer. When the grouped read does not answer, the pools,
453
+ providers and sums come from the rows read, as far as it reaches.
454
+ - A pool row is one address. The pools inside one pool manager (the manager
455
+ of a vault exchange in the exchange registry, such as Uniswap v4) are
456
+ answered as one row for the manager, not pool by pool: `is_manager: true`,
457
+ `pools_inside: null`, its providers and this token's side. Its node sums
458
+ are the manager's whole book, so `liquidity` is `null`, and it has no
459
+ word. A manager asked about itself sends no adders, removers or assets read
460
+ and lists none (`adders: []`, `removers: []`, `pool_tokens: []`): its
461
+ parties and its tokens are answered per token, so ask the token.
462
+ - Every pool row carries `exchange`, the registry name by its manager or
463
+ its factory, else `null`; `providers` (distinct adders of this token);
464
+ and `token_side` (this token added and removed; `removed_usd` is `0` when
465
+ the grouped removals read answered under 500 rows with no row for the
466
+ pool, and `null` when that read did not answer, came back full, or the
467
+ pool's removals carry no price). A pool with its own
468
+ address, among the 10 biggest, adds its node: its own word in `risk` and
469
+ both sides of `liquidity`.
470
+ - `pools_found` counts every pool address of the token, exact up to 500.
471
+ The 10 biggest by tokens added are detailed (`detail: true`); a pool
472
+ beyond them keeps its providers and `token_side`. `pools_truncated` says
473
+ when more pools exist than are detailed; a grouped read full at 500 is
474
+ named in `not_read` as part `pools` with code `truncated`.
475
+ `parties_truncated` says a rows read came back full, so the adders and
476
+ removers of a pool may miss a party; `not_read` names it as part
477
+ `pool_parties` with code `truncated`.
478
+ - A USD sum with no priced link is `null`, never `0`.
479
+ - `not_read` names every part that did not answer (`pools`,
480
+ `pool_removals`, `founder`, `factory`, `gas_wallets`, a pool's `pool`,
481
+ and more), with its code: the code the refusal names, such as
482
+ `query_timeout`, `family_behind` or `anchor_missing`. A part not read is
483
+ never "none found". A failed subject read is an error.
484
+ - With `surroundings: true` the answer adds the nodes (at most 60; partners
485
+ are dropped first, then removers, then adders) and the `FLOWED_TO`,
486
+ `DEPLOYED_CONTRACT`, `ADDED_LIQUIDITY` and `REMOVED_LIQUIDITY` links
487
+ between them.
488
+ - The answer holds facts and measures only: no summary, no advice, no
489
+ verdict.
490
+
491
+ `cia mcp call aml_token_risk network=robinhood address=0x...` and
492
+ `cia workflow aml-token-risk --network robinhood --address 0x...` run the same
493
+ screen in a terminal.
494
+
308
495
  ## Host parity
309
496
 
310
497
  **A rule a host never loads does not exist for that host.** Each host loads a
@@ -320,6 +507,8 @@ different part of what this package ships:
320
507
  | protocol tool doors | yes | yes | yes | yes | yes | yes |
321
508
  | token door `meta_token_lookup` | yes | yes | yes | yes | yes | yes |
322
509
  | exchange doors `meta_exchange_lookup`, `aml_exchange_deposit_check` | yes | yes | yes | yes | yes | yes |
510
+ | address risk `aml_address_risk` | yes | yes | yes | yes | yes | yes |
511
+ | token risk `aml_token_risk` | yes | yes | yes | yes | yes | yes |
323
512
 
324
513
  The scout agent pins the CLI by version in its image and copies only
325
514
  `chain-insights-cypher` and `chain-insights-virtuals` into its project, yet asks
@@ -340,6 +529,10 @@ The rule:
340
529
  `door: <tool>, <tool>` for a skill with two doors.
341
530
  `chain-insights-aml-exchange` has two: `meta_exchange_lookup` for an
342
531
  exchange by name and `aml_exchange_deposit_check` for one address.
532
+ The risk skills `chain-insights-address-risk` and
533
+ `chain-insights-token-risk` open on `aml_address_risk` and
534
+ `aml_token_risk`. Their question is one address, token or pool, so they
535
+ name no exchange.
343
536
  2. Each door's description carries the rule the skill opens with, and names
344
537
  the skill's trigger words.
345
538
  3. The skill names the door as its first step.
@@ -356,6 +549,14 @@ never search the web), the `graph_query` description sends a named token to
356
549
  it, and the core skill `chain-insights-cypher` repeats it as a row of its
357
550
  question table.
358
551
 
552
+ The behaviour kinds of busy accounts (`behaviour_kind`, `behaviour_group`)
553
+ take the path of the judgement marks. The `graph_query` description carries
554
+ every kind in plain words and the rule: a behaviour kind describes automation
555
+ or volume, it is not a risk signal by itself, and an answer never presents it
556
+ as an accusation. The server instructions and `meta_schema` say the same, and
557
+ the core skill repeats it in its section "Behaviour kinds".
558
+ `tests/behaviour-kinds.test.ts` holds every surface to it.
559
+
359
560
  A host that loads skills gets both. A host that loads none gets the door.
360
561
  `tests/host-parity.test.ts` checks it: every
361
562
  `skills/chain-insights-<protocol>/SKILL.md` has a door, the door is in
@@ -508,9 +709,6 @@ Graph queries take full blockchain addresses directly and return blockchain
508
709
  addresses as the public result surface. The graph is address-grain, so there
509
710
  is no identity-resolution step. Never shorten an address.
510
711
 
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
712
  ## Auth Modes
515
713
 
516
714
  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,77 @@
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 count that grows with the chain is a `*_min` key: a token's pool
36
+ count is `pools_found_min`, never an exact `pools_found`. A run fails when a case fails or the set holds fewer cases than
37
+ `--min` (20 address, 10 pool, 20 token by default).
38
+
39
+ `.github/workflows/verify.yml` runs the same files, by hand and before a
40
+ release. No pull request runs a test. There is no start-up smoke: the
41
+ package runs no StarRocks.
42
+
43
+ ## Where a new test goes
44
+
45
+ | The code | The test |
46
+ |---|---|
47
+ | a rule, a query builder, a tool's text, a registry file | a unit test in `tests/`, over committed fixtures |
48
+ | 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 |
49
+ | what a lane serves | a check of chain-insights-validator. Name it in the pull request |
50
+
51
+ `ci/lint.sh` refuses:
52
+
53
+ - a `*.integration.test.ts` or `*.t2.test.ts` file;
54
+ - a test that reads a live-graph endpoint setting, the retired T2 switch,
55
+ `ANVIL_BIN` or `STARROCKS_*`, or starts anvil.
56
+
57
+ ## What the staging lane judges
58
+
59
+ chain-insights-validator must gain these checks (none exists yet; its one
60
+ check today is `daily_run`):
61
+
62
+ - **Exchange registry.** Every row of `registry/robinhood.json` against the
63
+ lane's graph: every factory, manager and router is a contract; every
64
+ factory with a pool floor deployed at least that many pools; every example
65
+ pool is `:Pool`, carries one of its row's adapter marks, and was deployed by
66
+ one of its factories.
67
+ - **Golden marks.** Every row of `tests/fixtures/graph-marks-golden.json`:
68
+ every golden mark present, every forbidden mark absent, every count at least
69
+ its floor, the card subset held (`lane_only: "staging"` rows on the staging
70
+ lane only).
71
+ - **Documented recipes.** Every recipe of `tests/fixtures/documented-recipes.json`
72
+ and every query of `tests/fixtures/graph-query-corpus.json` is admitted or
73
+ refused as documented, fixture-anchored recipes return rows under their
74
+ `RETURN` aliases, and every address column is a lower-case `0x` address.
75
+ - **Subscription buys.** Every `Received` event of the sink
76
+ `0x67a8c068cc762e371706ea6c399178171f92810d` on Robinhood Chain is from
77
+ 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.93.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.