@opennodes/registry 0.1.51 → 0.1.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,23 @@ ONP_DB=postgres://user:pass@host/db npx @opennodes/registry
10
10
 
11
11
  What it does:
12
12
 
13
- - **Registration with proof of resource** — namespace challenge (HTTP or DNS TXT), Stage A conformance probes, Stage B identity fingerprinting / context verification / capacity ramp, Stage C continuous liveness and blind probes. Trust tiers: `unverified → community → verified` (+ `disputed`, `suspended`). Claimed ≠ measured ≠ attested — always labeled, never blended.
13
+ - **Registration with proof of resource** — namespace challenge (HTTP or DNS TXT), Stage A conformance probes, Stage B identity fingerprinting / context verification / capacity ramp, Stage C continuous liveness and blind probes. Trust tiers: `unverified → community → verified` (+ `disputed`, `suspended`). Claimed ≠ measured ≠ attested — always labeled, never blended. The tests cover only chat offerings (`onp.openai.chat/v1`). Speech, embeddings and other offerings are shown with `tested: false` and capped to `unverified`, whatever the node's tier, and listed in node detail and the export feed as `verification.untested_offerings`. A node with no chat offering stays unverified. The web app's qualification page (`/#/qualification`) lists the probe load of each stage: Stage A sends 1 blind call per chat offering at verification and on each `PUT /v0/nodes/{id}/ping`; Stage B sends up to 20 per chat offering when the operator asks for admission; Stage C sends a health check every 5 min and 1 blind call per node every hour, both on average.
14
+ - **Operator marks** (ONP-3 §4b): `institutional` and `founding`, set by the registry admin on registered nodes and shown in `/v0/nodes`, node detail, search results and the web app. Labels only, never rank inputs:
15
+
16
+ ```bash
17
+ curl -X POST https://registry.example/v0/admin/nodes/io.example.ai/founding \
18
+ -H "authorization: Bearer $ONP_ADMIN_TOKEN" -H "content-type: application/json" -d '{"founding": true}'
19
+ ```
20
+
21
+ The same request with `{"founding": false}` clears the mark; `/institutional` takes `{"institutional": true|false}`.
22
+ - **Trusted and open pools** (ONP-3 §5e):
23
+ - **Who lists:** any operator, from any country.
24
+ - **Search filters:** `trust=trusted` returns only offerings for personal data: declared model lineage without CN, tier verified or higher, an operator in the trusted jurisdictions, `retention: none` and no training on inputs. Each part is also a filter of its own: `lineage=declared`, `exclude_lineage=CN`, `retention=none|ephemeral|logged`, `no_training=true`, `jurisdiction=`, `tier=`.
25
+ - **Labels:** every result carries `pool: "trusted"` or `"open"`.
26
+ - **Recommend:** `policy.sensitive: true` uses the trusted pool, always under the registry's own view.
27
+ - **Configuration:** `ONP_TRUSTED_JURISDICTIONS` (default `EU,CA`) sets the trusted countries, and `/v0/health` publishes the view as `trust.trusted`.
28
+ - **Errors:** a misspelt `trust`, `lineage`, `retention` or `no_training` value gets `400 bad-query`, never a wider result.
29
+ - **Request counts** (ONP-3 §6.6): how often search, recommend and the MCP tools returned each node, per ISO week, in node detail (`request_counts`, 12 weeks) and at `GET /v0/stats/requests?weeks=4&node_id=…`. Only node ids and counts are stored, never the query, task or client.
14
30
  - **Search and transparent ranking** (`/v0/offerings`, `sort=rank|price|ttft|tps`) with per-result `rank_explanation`; **enforceable estimates** (`POST /v0/estimate`) pinned to card revisions; the **advisor** (`POST /v0/recommend`).
15
31
  - **Catalog importers** — OpenRouter, Hugging Face Inference Providers, models.dev, the Ollama library — so search is useful on day one, with imported listings labeled and claimable by their operators.
16
32
  - **Where models run** (`/v0/locations`, `?format=csv` or `?format=geojson`): serving sites by country with their evidence (`claimed`, `documented`, `measured`, `attested`), a map point, and the models each serves (ONP-2 §3a, ONP-3 §5c). `near=lat,lon&within_km=` finds what runs close to a point. The GeoJSON opens directly in QGIS, ArcGIS, kepler.gl or any web map; the web app draws it on an interactive map. Built from card locations, the per-provider OpenRouter import (the headquarters, datacentres and region tags providers declare there) and curated seeds in [`src/data/`](src/data/) (Canada, Europe, and every registry provider worldwide). Search takes `region=`, `location_basis=` and `exclude_lineage=`.
@@ -18,7 +34,7 @@ What it does:
18
34
  - **MCP surface** at `/mcp` (including `find_locations` and `find_residency`) and a signed **export feed** for federation.
19
35
  - **Web app** at `/`: OpenRouter-style catalog with model and node pages, hardware and measured performance, playground, multi-model chat (compare / jury / pipeline / iterative), the advisor, the Node Builder, and the "Where models run" page.
20
36
 
21
- Environment: `PORT`, `ONP_DB`, `ONP_REGISTRY_KEY`, `ONP_ADMIN_TOKEN`, `ONP_ALLOW_PRIVATE=1` (dev only: permit localhost nodes), `ONP_STAGE_C=0`, `ONP_REIMPORT=1`, `ONP_REIMPORT_SOURCES` (default `openrouter,huggingface`; also `models-dev`, `ollama`, and `openrouter-providers`, which makes one request per OpenRouter model, so give it a long `ONP_REIMPORT_MS`), `ONP_LOCATION_SEEDS=0` (skip the curated location seeds), `ONP_MAP_TILES` (basemap for the locations map: unset = OpenStreetMap, `off` = no map, or an XYZ URL template with `ONP_MAP_ATTRIBUTION`). The map loads Leaflet from cdnjs, pinned with subresource integrity, only on the "Where models run" page. Viewers' browsers then fetch tiles from the tile server. OpenStreetMap's tile policy asks for light use, so a busy registry should point `ONP_MAP_TILES` at its own or a commercial tile service.
37
+ Environment: `PORT`, `ONP_DB`, `ONP_REGISTRY_KEY`, `ONP_ADMIN_TOKEN`, `ONP_TRUSTED_JURISDICTIONS` (trusted pool operators, default `EU,CA`), `ONP_ALLOW_PRIVATE=1` (dev only: permit localhost nodes), `ONP_STAGE_C=0`, `ONP_REIMPORT=1`, `ONP_REIMPORT_SOURCES` (default `openrouter,huggingface`; also `models-dev`, `ollama`, and `openrouter-providers`, which makes one request per OpenRouter model, so give it a long `ONP_REIMPORT_MS`), `ONP_LOCATION_SEEDS=0` (skip the curated location seeds), `ONP_MAP_TILES` (basemap for the locations map: unset = OpenStreetMap, `off` = no map, or an XYZ URL template with `ONP_MAP_ATTRIBUTION`). The map loads Leaflet from cdnjs, pinned with subresource integrity, only on the "Where models run" page. Viewers' browsers then fetch tiles from the tile server. OpenStreetMap's tile policy asks for light use, so a busy registry should point `ONP_MAP_TILES` at its own or a commercial tile service.
22
38
 
23
39
  Location seeds are dated JSON files (`locations-{seed}.json`): providers, their sites with `basis`, `source` and `checked`, and the models each site serves. A provider whose models are listed becomes a listing-only node `import.seed.{seed}.{id}`; one that publishes no model list is shown with a note. An entry with `nodes` describes existing registry nodes instead: its sites are shown under the first of them, with that node's models when `placement` is `all`. With `placement: "all"`, or `serves_from: "{seed}:{id}"` (the node's whole API runs at that entry's sites), search and recommend also use the live sites as the node's serving locations, marked `via: "seed"`, for offerings whose card declares none, except for listings reached through the Hugging Face router or OpenRouter. Providers carry `kind` and `residency`; `residency_of: "{seed}:{id}"` reuses another entry's commitments (the Canadian and European regions of a cloud share the cloud's). Corrections and new countries are welcome by pull request: cite the provider's own page for `documented`, anything else is `claimed`.
24
40
 
package/bin.js CHANGED
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { startRegistry } from './src/server.js';
3
3
  import { parseSite } from './src/location.js';
4
+ import { LIVENESS_INTERVAL_MS, BLIND_INTERVAL_MS } from './src/stagec.js';
5
+ import { trustedJurisdictionsFrom } from '@opennodes/core';
4
6
 
5
7
  const dbPath = process.env.ONP_DB ?? ':memory:'; // sqlite path/:memory: or postgres:// URL
6
8
  const persistent = dbPath !== ':memory:' && !dbPath.startsWith('postgres');
@@ -15,14 +17,16 @@ const registry = await startRegistry({
15
17
  admitCooldownMs: Number(process.env.ONP_ADMIT_COOLDOWN_MS ?? 30 * 60_000), // Stage B per node
16
18
  trustProxy: process.env.ONP_TRUST_PROXY === '1', // behind Caddy / a CDN
17
19
  adminToken: process.env.ONP_ADMIN_TOKEN ?? null,
20
+ // Operator jurisdictions of the trusted pool (ONP-3 §5e): "EU,CA" unless set, e.g. "EU,CA,CH".
21
+ trustedJurisdictions: trustedJurisdictionsFrom(process.env),
18
22
  locationSeeds: process.env.ONP_LOCATION_SEEDS !== '0', // curated "where models run" seeds
19
23
  // Basemap for the locations map: unset = OpenStreetMap, "off" = no map, else an XYZ tile URL template.
20
24
  ...(process.env.ONP_MAP_TILES ? { mapTiles: process.env.ONP_MAP_TILES === 'off' ? null : {
21
25
  tiles: process.env.ONP_MAP_TILES, attribution: process.env.ONP_MAP_ATTRIBUTION ?? '', max_zoom: 19,
22
26
  } } : {}),
23
27
  stageC: process.env.ONP_STAGE_C === '0' ? null : {
24
- livenessIntervalMs: Number(process.env.ONP_LIVENESS_MS ?? 300_000),
25
- blindIntervalMs: Number(process.env.ONP_BLIND_MS ?? 3_600_000),
28
+ livenessIntervalMs: Number(process.env.ONP_LIVENESS_MS ?? LIVENESS_INTERVAL_MS),
29
+ blindIntervalMs: Number(process.env.ONP_BLIND_MS ?? BLIND_INTERVAL_MS),
26
30
  },
27
31
  // Server-location checks: ONP_LOCATION=1, this registry's site, and optional remote probe agents
28
32
  // ("FI Helsinki 60.17 24.93 https://host/onp-probe", comma-separated) sharing ONP_PROBE_AGENT_TOKEN.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opennodes/registry",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "description": "OpenNodes (ONP) reference registry: node registration with proof-of-resource qualification (Stage A/B/C), transparent ranking, enforceable estimates, catalog importers (OpenRouter, Hugging Face, models.dev, Ollama), MCP surface, and the web app (catalog, chat, advisor, Node Builder)",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -43,7 +43,7 @@
43
43
  "access": "public"
44
44
  },
45
45
  "dependencies": {
46
- "@opennodes/core": "0.1.22",
46
+ "@opennodes/core": "0.1.24",
47
47
  "pg": "^8.13.1"
48
48
  }
49
49
  }
package/src/counts.js ADDED
@@ -0,0 +1,135 @@
1
+ // Request counts (ONP-3 §6.6): how often the registry returns each node to a client, per ISO week and
2
+ // surface. A response counts each node in it once. Only node ids, weeks and counts are kept: never the
3
+ // query, task, prompt or features, and nothing about the client.
4
+
5
+ /** Where a node can be returned: GET /v0/offerings, POST /v0/recommend, and MCP tools/call on /mcp. */
6
+ export const SURFACES = ['search', 'recommend', 'mcp'];
7
+ /** Row key for the number of responses on a surface, whichever nodes they held. */
8
+ const RESPONSES = '*';
9
+ const DAY_MS = 86_400_000;
10
+
11
+ /** ISO 8601 week of a date in UTC, e.g. "2026-W46". */
12
+ export function isoWeek(date = new Date()) {
13
+ const d = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()));
14
+ d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7)); // the week's Thursday decides its year
15
+ const year = d.getUTCFullYear();
16
+ const week = Math.ceil(((d - Date.UTC(year, 0, 1)) / DAY_MS + 1) / 7);
17
+ return `${year}-W${String(week).padStart(2, '0')}`;
18
+ }
19
+
20
+ /** Monday (UTC) that starts an ISO week, as YYYY-MM-DD. */
21
+ export function weekStart(week) {
22
+ const [year, w] = week.split('-W').map(Number);
23
+ const jan4 = Date.UTC(year, 0, 4);
24
+ const monday1 = jan4 - ((new Date(jan4).getUTCDay() || 7) - 1) * DAY_MS;
25
+ return new Date(monday1 + (w - 1) * 7 * DAY_MS).toISOString().slice(0, 10);
26
+ }
27
+
28
+ /** The `n` ISO weeks ending with the one holding `date`, newest first. */
29
+ export function recentWeeks(n, date = new Date()) {
30
+ return Array.from({ length: n }, (_, i) => isoWeek(new Date(date.getTime() - i * 7 * DAY_MS)));
31
+ }
32
+
33
+ /**
34
+ * Every node id anywhere in a response: `node_id` values (offerings, recommendations, scenario
35
+ * roles, sites) and `node_ids` lists (residency providers).
36
+ */
37
+ export function nodeIdsIn(value, ids = new Set()) {
38
+ if (Array.isArray(value)) for (const v of value) nodeIdsIn(v, ids);
39
+ else if (value && typeof value === 'object') {
40
+ for (const [k, v] of Object.entries(value)) {
41
+ if (k === 'node_id' && typeof v === 'string') ids.add(v);
42
+ else if (k === 'node_ids' && Array.isArray(v)) for (const id of v) { if (typeof id === 'string') ids.add(id); }
43
+ else if (v && typeof v === 'object') nodeIdsIn(v, ids);
44
+ }
45
+ }
46
+ return ids;
47
+ }
48
+
49
+ const emptyWeek = (week) => ({ week, starts: weekStart(week), search: 0, recommend: 0, mcp: 0, total: 0 });
50
+
51
+ /**
52
+ * Counts in memory, written to the store in batches (every `flushMs`, before every read, and on
53
+ * stop), so a search never waits on a database write.
54
+ */
55
+ export function makeRequestCounter(store, { flushMs = 60_000, clock = () => new Date() } = {}) {
56
+ let pending = new Map(); // "node\tweek\tsurface" -> n
57
+ const add = (nodeId, week, surface, n) => {
58
+ const key = `${nodeId}\t${week}\t${surface}`;
59
+ pending.set(key, (pending.get(key) ?? 0) + n);
60
+ };
61
+
62
+ /** One response on `surface` returned these nodes (duplicates count once). */
63
+ function count(surface, nodeIds) {
64
+ if (!SURFACES.includes(surface)) throw new Error(`unknown surface: ${surface}`);
65
+ const week = isoWeek(clock());
66
+ add(RESPONSES, week, surface, 1);
67
+ for (const id of new Set(nodeIds)) if (id && id !== RESPONSES) add(id, week, surface, 1);
68
+ }
69
+
70
+ let chain = Promise.resolve();
71
+ function flush() {
72
+ chain = chain.then(async () => {
73
+ if (!pending.size) return;
74
+ const batch = pending;
75
+ pending = new Map();
76
+ const rows = [...batch].map(([key, n]) => {
77
+ const [node_id, week, surface] = key.split('\t');
78
+ return { node_id, week, surface, n };
79
+ });
80
+ try { await store.addRequestCounts(rows); }
81
+ catch { for (const r of rows) add(r.node_id, r.week, r.surface, r.n); } // retried on the next flush
82
+ });
83
+ return chain;
84
+ }
85
+ const timer = flushMs > 0 ? setInterval(() => { flush(); }, flushMs) : null;
86
+ timer?.unref?.();
87
+
88
+ /** Node detail: the last `weeks` ISO weeks for one node, newest first, zero weeks included. */
89
+ async function forNode(nodeId, weeks = 12) {
90
+ await flush();
91
+ const range = recentWeeks(weeks, clock());
92
+ const rows = await store.requestCounts({ nodeId, sinceWeek: range.at(-1) });
93
+ const byWeek = new Map(range.map((w) => [w, emptyWeek(w)]));
94
+ for (const r of rows) {
95
+ const w = byWeek.get(r.week);
96
+ if (!w || !SURFACES.includes(r.surface)) continue;
97
+ w[r.surface] += Number(r.n);
98
+ w.total += Number(r.n);
99
+ }
100
+ return [...byWeek.values()];
101
+ }
102
+
103
+ /**
104
+ * Stats endpoint: per week, the responses on each surface and the nodes they returned (most
105
+ * returned first, at most `limit`), optionally for one node only.
106
+ */
107
+ async function stats({ weeks = 4, nodeId = null, limit = 50 } = {}) {
108
+ await flush();
109
+ const range = recentWeeks(weeks, clock());
110
+ const rows = await store.requestCounts({ sinceWeek: range.at(-1) });
111
+ const out = new Map(range.map((w) => [w, { week: w, starts: weekStart(w), responses: { search: 0, recommend: 0, mcp: 0 }, nodes: new Map() }]));
112
+ for (const r of rows) {
113
+ const w = out.get(r.week);
114
+ if (!w || !SURFACES.includes(r.surface)) continue;
115
+ const n = Number(r.n);
116
+ if (r.node_id === RESPONSES) { w.responses[r.surface] += n; continue; }
117
+ if (nodeId && r.node_id !== nodeId) continue;
118
+ const node = w.nodes.get(r.node_id) ?? { node_id: r.node_id, search: 0, recommend: 0, mcp: 0, total: 0 };
119
+ node[r.surface] += n;
120
+ node.total += n;
121
+ w.nodes.set(r.node_id, node);
122
+ }
123
+ return [...out.values()].map((w) => {
124
+ const nodes = [...w.nodes.values()].sort((a, b) => b.total - a.total || a.node_id.localeCompare(b.node_id));
125
+ return { week: w.week, starts: w.starts, responses: w.responses, nodes_returned: nodes.length, nodes: nodes.slice(0, limit) };
126
+ });
127
+ }
128
+
129
+ async function stop() {
130
+ if (timer) clearInterval(timer);
131
+ await flush();
132
+ }
133
+
134
+ return { count, flush, forNode, stats, stop };
135
+ }
@@ -0,0 +1,93 @@
1
+ {
2
+ "seed": "ua",
3
+ "title": "Ukrainian data centres and GPU clouds",
4
+ "checked": "2026-11-10",
5
+ "note": "Curated by the OpenNodes project from public sources (ONP-2 §3a). Site-only entries: none of these operators serves models through a public API, so none becomes a node; providers that run models here can name them as facility_operator. During the war each site shows no more than the operator publishes itself (a city, or only the country), never an address. Sites outside Ukraine are not listed here. documented = the operator's own page; claimed = news or third-party pages. Corrections, or removal on request, by pull request or to operators@opennodes.io.",
6
+ "providers": [
7
+ {
8
+ "id": "denovo",
9
+ "name": "De Novo",
10
+ "kind": "cloud",
11
+ "residency": [
12
+ { "commitment": "unstated", "scope": [], "availability": "default", "statement": "Colocation and GPU cloud; no statement on model data residency.", "source": "https://denovo.ua/en/data-center/colocation", "checked": "2026-11-10" }
13
+ ],
14
+ "operator": { "name": "De Novo", "country": "UA", "url": "https://denovo.ua/en/" },
15
+ "sites": [
16
+ { "id": "kyiv", "region": "UA-30", "site": "Kyiv", "status": "live", "basis": "documented", "source": "https://denovo.ua/en/data-center/colocation", "checked": "2026-11-10", "note": "Colocation (up to 15 kW a rack in the shielded module) and public cloud", "geo": { "lat": 50.4501, "lon": 30.5234, "precision": "city" } },
17
+ { "id": "lviv", "region": "UA-46", "site": "Lviv", "status": "live", "basis": "documented", "source": "https://denovo.ua/en/data-center/colocation", "checked": "2026-11-10", "note": "Public cloud", "geo": { "lat": 49.8397, "lon": 24.0297, "precision": "city" } }
18
+ ],
19
+ "models": [],
20
+ "models_note": "Colocation and GPU cloud (LLM Cloud with open models preinstalled for tenants); no public model API."
21
+ },
22
+ {
23
+ "id": "gigacloud",
24
+ "name": "GigaCloud",
25
+ "kind": "cloud",
26
+ "residency": [
27
+ { "commitment": "unstated", "scope": [], "availability": "default", "statement": "GPU cloud; no statement on model data residency.", "source": "https://gigacloud.ua/en/", "checked": "2026-11-10" }
28
+ ],
29
+ "operator": { "name": "GigaCloud", "country": "UA", "url": "https://gigacloud.ua/en/" },
30
+ "sites": [
31
+ { "id": "ua", "region": "UA", "site": "Three data centres in Ukraine (cities not published)", "status": "live", "basis": "documented", "source": "https://gigacloud.ua/en/", "checked": "2026-11-10", "note": "Two more data centres in Poland" }
32
+ ],
33
+ "models": [],
34
+ "models_note": "GPU cloud (H100, L40S); no public model API."
35
+ },
36
+ {
37
+ "id": "ucloud",
38
+ "name": "Ucloud",
39
+ "kind": "cloud",
40
+ "residency": [
41
+ { "commitment": "unstated", "scope": [], "availability": "default", "statement": "GPU cloud and colocation; no statement on model data residency.", "source": "https://ucloud.ua/", "checked": "2026-11-10" }
42
+ ],
43
+ "operator": { "name": "Ucloud", "country": "UA", "url": "https://ucloud.ua/" },
44
+ "sites": [
45
+ { "id": "ua", "region": "UA", "site": "Data centres in Ukraine (cities not published)", "status": "live", "basis": "documented", "source": "https://ucloud.ua/", "checked": "2026-11-10", "note": "Also in Poland (Warsaw) and Germany; colocation is offered at BE MOBILE Data Park" }
46
+ ],
47
+ "models": [],
48
+ "models_note": "GPU cloud and colocation; no public model API."
49
+ },
50
+ {
51
+ "id": "bemobile",
52
+ "name": "BE MOBILE Data Park",
53
+ "kind": "cloud",
54
+ "residency": [
55
+ { "commitment": "unstated", "scope": [], "availability": "default", "statement": "Colocation provider; no statement on model data residency.", "source": "https://ucloud.ua/en/service/colocation/", "checked": "2026-11-10" }
56
+ ],
57
+ "operator": { "name": "BE MOBILE", "country": "UA", "url": "https://bemobile.ua/" },
58
+ "sites": [
59
+ { "id": "ua", "region": "UA", "site": "BE MOBILE Data Park", "status": "live", "basis": "claimed", "source": "https://ucloud.ua/en/service/colocation/", "checked": "2026-11-10", "note": "TIA-942 Tier III design and ISO 27001, per Ucloud" }
60
+ ],
61
+ "models": [],
62
+ "models_note": "Colocation only; no model service."
63
+ },
64
+ {
65
+ "id": "colocall",
66
+ "name": "Colocall",
67
+ "kind": "cloud",
68
+ "residency": [
69
+ { "commitment": "unstated", "scope": [], "availability": "default", "statement": "Colocation provider; no statement on model data residency.", "source": "https://www.colocall.net/en/colocation/colocation.html", "checked": "2026-11-10" }
70
+ ],
71
+ "operator": { "name": "Colocall", "country": "UA", "url": "https://www.colocall.net/en/" },
72
+ "sites": [
73
+ { "id": "ua", "region": "UA", "site": "Colocall data centre (city not published)", "status": "live", "basis": "claimed", "source": "https://www.colocall.net/en/colocation/colocation.html", "checked": "2026-11-10", "note": "Colocation and cloud" }
74
+ ],
75
+ "models": [],
76
+ "models_note": "Colocation only; no model service."
77
+ },
78
+ {
79
+ "id": "kyivstar-cloud",
80
+ "name": "Kyivstar Cloud",
81
+ "kind": "cloud",
82
+ "residency": [
83
+ { "commitment": "unstated", "scope": [], "availability": "default", "statement": "Business cloud described as hosted in Ukraine; no statement on model data residency.", "source": "https://forbes.ua/news/kiivstar-zapustiv-vlasniy-khmarniy-servis-dlya-biznesu-24062025-30782", "checked": "2026-11-10" }
84
+ ],
85
+ "operator": { "name": "Kyivstar", "country": "UA", "url": "https://kyivstar.ua/" },
86
+ "sites": [
87
+ { "id": "ua", "region": "UA", "site": "Kyivstar Cloud (facilities not named)", "status": "live", "basis": "claimed", "source": "https://forbes.ua/news/kiivstar-zapustiv-vlasniy-khmarniy-servis-dlya-biznesu-24062025-30782", "checked": "2026-11-10", "note": "Business cloud launched June 2025 on HPE servers, hosted in Ukraine" }
88
+ ],
89
+ "models": [],
90
+ "models_note": "Business cloud; no model service."
91
+ }
92
+ ]
93
+ }
package/src/export.js CHANGED
@@ -2,6 +2,7 @@
2
2
  // replicate without re-crawling. Each line = { payload, jws } signed by this registry,
3
3
  // so provenance survives mirroring.
4
4
  import { signJson } from '@opennodes/core';
5
+ import { verificationOf } from './probes.js';
5
6
 
6
7
  export function exportRoutes(store, registryKeys) {
7
8
  return [
@@ -11,11 +12,15 @@ export function exportRoutes(store, registryKeys) {
11
12
  for (const node of await store.allNodes()) {
12
13
  if (since && node.updated_at <= since) continue;
13
14
  const card = await store.latestCard(node.id);
15
+ const observations = await store.observationsForNode(node.id);
16
+ const nodeObs = Object.fromEntries(observations.filter((o) => o.offering_id === '_node').map((o) => [o.key, o.value]));
14
17
  const payload = {
15
18
  type: 'node',
16
19
  node: { id: node.id, origin: node.origin, state: node.state, source: node.source, updated_at: node.updated_at },
17
20
  card,
18
- observations: await store.observationsForNode(node.id),
21
+ observations,
22
+ // The node's state covers only the offerings its tests could call (ONP-3 §4a).
23
+ verification: verificationOf(card, nodeObs),
19
24
  };
20
25
  const jws = signJson(payload, registryKeys.privateKey, 'registry-1');
21
26
  res.write(JSON.stringify({ payload, jws }) + '\n');
package/src/locations.js CHANGED
@@ -7,7 +7,7 @@ import { readFileSync, readdirSync } from 'node:fs';
7
7
  import { fileURLToPath } from 'node:url';
8
8
  import {
9
9
  sendJson, problem, regionWithin, countryOf, basisRank, pointFor, distanceKm, parsePoint, precisionRank,
10
- residencyAt, residencyMeets, commitmentRank, scopeCovers, RESIDENCY_COMMITMENTS,
10
+ residencyAt, residencyMeets, commitmentRank, scopeCovers, RESIDENCY_COMMITMENTS, lineageAllowed,
11
11
  } from '@opennodes/core';
12
12
  import { siteLocation } from './importers.js';
13
13
 
@@ -237,7 +237,7 @@ export async function collectSites(store, seeds = []) {
237
237
  /**
238
238
  * Filter and summarise. Query: country | region (containment), basis (minimum evidence),
239
239
  * status (live | planned), model (substring of name or artifact), exclude_lineage (CSV of
240
- * countries; drops those models, keeps undeclared lineage), near=lat,lon (adds distance_km,
240
+ * countries; drops those models, keeps undeclared lineage unless lineage=declared), near=lat,lon (adds distance_km,
241
241
  * nearest first) with within_km (radius; country-level points never match), format=csv|geojson.
242
242
  */
243
243
  export async function buildLocations(store, seeds, query) {
@@ -255,12 +255,14 @@ export async function buildLocations(store, seeds, query) {
255
255
  if (!['processing', 'storage'].includes(q('residency'))) throw Object.assign(new Error('residency must be processing or storage'), { status: 400 });
256
256
  sites = sites.filter((s) => residencyMeets(s.residency, q('residency'), q('availability') ?? 'enterprise'));
257
257
  }
258
- const banned = q('exclude_lineage')?.toUpperCase().split(',') ?? [];
258
+ const banned = q('exclude_lineage')?.split(',').filter(Boolean) ?? [];
259
+ if (q('lineage') && !['declared', 'any'].includes(q('lineage'))) throw Object.assign(new Error('lineage must be declared or any'), { status: 400 });
260
+ const declared = q('lineage') === 'declared'; // also drop models that declare no lineage
259
261
  const needle = q('model')?.toLowerCase();
260
- if (banned.length || needle) {
262
+ if (banned.length || declared || needle) {
261
263
  sites = sites.map((s) => ({
262
264
  ...s,
263
- models: s.models.filter((m) => !(m.lineage_origins ?? []).some((c) => banned.includes(c))
265
+ models: s.models.filter((m) => lineageAllowed({ model: m }, { exclude: banned, declared })
264
266
  && (!needle || `${m.name} ${m.artifact}`.toLowerCase().includes(needle))),
265
267
  }));
266
268
  if (needle) sites = sites.filter((s) => s.models.length);
package/src/mcp.js CHANGED
@@ -6,6 +6,8 @@ import { readFileSync } from 'node:fs';
6
6
  import { readJson, sendJson, problem, estimateBounds, round6, extractFeatures, recommend, MCP_TOOLS, MCP_INSTRUCTIONS, summarizeNode } from '@opennodes/core';
7
7
  import { searchOfferingsPaged, searchOfferings, collectOfferings, pricePublished } from './search.js';
8
8
  import { buildLocations, buildResidency } from './locations.js';
9
+ import { nodeIdsIn } from './counts.js';
10
+ import { verificationOf } from './probes.js';
9
11
 
10
12
  /** Tool arguments -> the query string the REST routes take (null/undefined dropped). */
11
13
  const toQuery = (args = {}) => {
@@ -38,13 +40,14 @@ const TOOLS = MCP_TOOLS.map((tool) => {
38
40
  };
39
41
  });
40
42
 
41
- async function runTool(store, seeds, name, args = {}) {
43
+ async function runTool(store, seeds, name, args = {}, trusted = undefined) {
42
44
  switch (name) {
43
45
  case 'recommend': {
44
46
  const features = args.features ?? (args.task != null
45
47
  ? extractFeatures(String(args.task), { est_output_tokens: args.est_output_tokens ?? null }) : null);
46
48
  if (!features) throw new Error('recommend needs "task" or "features"');
47
- return recommend((await collectOfferings(store)).filter((o) => o.invocable), features, args.policy ?? {});
49
+ // policy.sensitive applies this registry's trusted view (the caller cannot pass its own)
50
+ return recommend((await collectOfferings(store)).filter((o) => o.invocable), features, { ...(args.policy ?? {}), ...(trusted ? { trusted } : {}) });
48
51
  }
49
52
  case 'search_offerings':
50
53
  return searchOfferingsPaged(store, toQuery(args));
@@ -61,11 +64,13 @@ async function runTool(store, seeds, name, args = {}) {
61
64
  case 'get_node': {
62
65
  const node = await store.getNode(args.node_id);
63
66
  if (!node) throw new Error(`unknown node: ${args.node_id} (node ids come from search_offerings or recommend results)`);
67
+ const card = await store.latestCard(node.id);
64
68
  return summarizeNode({
65
69
  ...node,
66
- card: await store.latestCard(node.id),
70
+ card,
67
71
  probes: (await store.probesFor(node.id)).slice(0, 20),
68
72
  history: await store.transitionsFor(node.id),
73
+ verification: verificationOf(card, await store.getObservations(node.id, '_node')),
69
74
  }, args.offering_limit ?? 25);
70
75
  }
71
76
  case 'estimate': {
@@ -102,7 +107,14 @@ async function runTool(store, seeds, name, args = {}) {
102
107
  }
103
108
  }
104
109
 
105
- async function handleRpc(store, seeds, msg) {
110
+ /** The nodes a tool result hands back to the client (for request counts). */
111
+ function nodesReturned(name, result) {
112
+ if (name === 'get_node') return [result.id];
113
+ if (name === 'estimate') return result.steps.map((s) => s.offering.split('/')[0]);
114
+ return nodeIdsIn(result);
115
+ }
116
+
117
+ async function handleRpc(store, seeds, msg, onResult, trusted) {
106
118
  const { id, method, params } = msg;
107
119
  const reply = (result) => ({ jsonrpc: '2.0', id, result });
108
120
  const rpcError = (code, message) => ({ jsonrpc: '2.0', id, error: { code, message } });
@@ -121,7 +133,8 @@ async function handleRpc(store, seeds, msg) {
121
133
  return reply({ tools: TOOLS });
122
134
  case 'tools/call':
123
135
  try {
124
- const result = await runTool(store, seeds, params?.name, params?.arguments);
136
+ const result = await runTool(store, seeds, params?.name, params?.arguments, trusted);
137
+ onResult?.(nodesReturned(params.name, result));
125
138
  return reply({
126
139
  content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
127
140
  structuredContent: result,
@@ -140,13 +153,17 @@ async function handleRpc(store, seeds, msg) {
140
153
  }
141
154
  }
142
155
 
143
- /** Routes to mount into the registry app. `seeds` = the curated location seeds (find_locations). */
144
- export function mcpRoutes(store, seeds = []) {
156
+ /**
157
+ * Routes to mount into the registry app. `seeds` = the curated location seeds (find_locations).
158
+ * `onResult(nodeIds)` hears which nodes each successful tool call returned (request counts).
159
+ * `trusted` is the registry's trusted view, used by recommend's `policy.sensitive`.
160
+ */
161
+ export function mcpRoutes(store, seeds = [], { onResult = null, trusted = undefined } = {}) {
145
162
  return [
146
163
  ['POST', '/mcp', async (req, res) => {
147
164
  const body = await readJson(req, 5_000_000);
148
165
  const messages = Array.isArray(body) ? body : [body];
149
- const replies = (await Promise.all(messages.map((m) => handleRpc(store, seeds, m)))).filter(Boolean);
166
+ const replies = (await Promise.all(messages.map((m) => handleRpc(store, seeds, m, onResult, trusted)))).filter(Boolean);
150
167
  if (replies.length === 0) { res.writeHead(202); res.end(); return; }
151
168
  sendJson(res, 200, Array.isArray(body) ? replies : replies[0]);
152
169
  }],
package/src/probes.js CHANGED
@@ -2,6 +2,23 @@
2
2
  // All outbound traffic goes through the SSRF-guarded fetcher (safefetch.js).
3
3
  import { fetchJsonCapped } from './safefetch.js';
4
4
 
5
+ /**
6
+ * Binding profiles the admission tests can call (ONP-3 §4a). Verification covers only these: an
7
+ * offering with another profile is never invoked, so a node's tier says nothing about it.
8
+ */
9
+ export const TESTED_PROFILES = ['onp.openai.chat/v1'];
10
+ /** Whether the registry's tests can call this offering. */
11
+ export const testable = (offering) => TESTED_PROFILES.includes(offering?.binding?.profile);
12
+ /** Offering ids of a card that the tests cannot call. */
13
+ export const untestedOfferings = (card) => (card?.offerings ?? []).filter((o) => !testable(o)).map((o) => o.offering_id);
14
+ export const NO_TESTED_OFFERINGS = `no offerings with a tested profile (${TESTED_PROFILES.join(', ')})`;
15
+ /** The `verification` block of node detail and the export feed; nodeObs = the node's `_node` observations. */
16
+ export const verificationOf = (card, nodeObs = {}) => ({
17
+ tested_profiles: TESTED_PROFILES,
18
+ untested_offerings: untestedOfferings(card),
19
+ blind_skipped: nodeObs.blind_skipped ?? null,
20
+ });
21
+
5
22
  /**
6
23
  * Card rules a schema cannot express (ONP-2 §5): every offering declares a data_policy
7
24
  * (required from `community` up), and offers only payment schemes the node declares.
@@ -56,9 +73,14 @@ export async function runStageA(store, nodeId, card, { safeFetch } = {}) {
56
73
  await record(null, 'models-agreement', false, String(err.message ?? err));
57
74
  }
58
75
 
59
- // 3. Blind invocation per chat offering
76
+ // 3. Blind invocation per offering the tests can call. A node with none gives no functional
77
+ // evidence, so it fails Stage A and stays unverified (ONP-3 §4a item 2).
78
+ if (!card.offerings.some(testable)) {
79
+ const profiles = [...new Set(card.offerings.map((o) => o.binding?.profile))].join(', ');
80
+ await record(null, 'tested-offerings', false, `${NO_TESTED_OFFERINGS}; the card offers ${profiles || 'nothing'}`);
81
+ }
60
82
  for (const offering of card.offerings) {
61
- if (offering.binding.profile !== 'onp.openai.chat/v1') continue;
83
+ if (!testable(offering)) continue;
62
84
  try {
63
85
  const t0 = performance.now();
64
86
  // Generous timeout: CPU-backed nodes legitimately take tens of seconds per completion.
package/src/search.js CHANGED
@@ -2,7 +2,9 @@
2
2
  import {
3
3
  residencyWithin, residencyCodes, servingLocations, basisRank,
4
4
  inJurisdiction, localSizes, pullsOf, specialtyOf, isEmbedder,
5
+ trustedView, poolOf, inTrustedPool, lineageAllowed, meetsDataPolicy, RETENTION_LEVELS,
5
6
  } from '@opennodes/core';
7
+ import { testable } from './probes.js';
6
8
 
7
9
  /** BCP 47 prefix match (ONP-3 §5): `fr` matches `fr` and `fr-CA`; `fr-CA` matches only itself. */
8
10
  export const langMatches = (tag, wanted) => {
@@ -33,6 +35,16 @@ export function setSeedPlacements(store, map) {
33
35
  markCatalogStale(store);
34
36
  }
35
37
 
38
+ // The registry's trusted view (core trustedView: jurisdictions from ONP_TRUSTED_JURISDICTIONS).
39
+ const trustedViews = new WeakMap(); // store -> view
40
+
41
+ /** Use this trusted view for `pool` labels and `trust=trusted` from now on (the server sets it at start). */
42
+ export function setTrustedView(store, view) {
43
+ trustedViews.set(store, view);
44
+ markCatalogStale(store);
45
+ }
46
+ export const trustedViewOf = (store) => trustedViews.get(store) ?? trustedView();
47
+
36
48
  /** Mark the cached catalog stale: the next read rebuilds it. */
37
49
  export function markCatalogStale(store) {
38
50
  const entry = catalogs.get(store);
@@ -41,7 +53,7 @@ export function markCatalogStale(store) {
41
53
 
42
54
  /** Wrap the store's write methods so any change to nodes, cards, probes or observations marks the catalog stale. */
43
55
  export function watchStoreWrites(store) {
44
- for (const name of ['upsertNode', 'setState', 'saveRevision', 'recordProbe', 'addFingerprints', 'setObservation']) {
56
+ for (const name of ['upsertNode', 'setState', 'setNodeFlag', 'saveRevision', 'recordProbe', 'addFingerprints', 'setObservation']) {
45
57
  const write = store[name];
46
58
  if (typeof write !== 'function' || write.__marksCatalogStale) continue;
47
59
  const wrapped = async function (...args) {
@@ -69,6 +81,7 @@ export async function collectOfferings(store) {
69
81
  /** Flatten indexed nodes into searchable offering summaries. */
70
82
  async function buildOfferings(store) {
71
83
  const out = [];
84
+ const view = trustedViewOf(store);
72
85
  for (const node of await store.allNodes()) {
73
86
  if (['delisted', 'suspended', 'submitted', 'challenged', 'disputed', 'claimed'].includes(node.state)) continue;
74
87
  const card = await store.latestCard(node.id);
@@ -101,12 +114,17 @@ async function buildOfferings(store) {
101
114
  serving.context_window = obs.context_cap;
102
115
  serving.context_capped_from = offering.serving.context_window;
103
116
  }
117
+ // Verification covers only profiles the tests can call (ONP-3 §4a): another offering does
118
+ // not inherit the node's tier. Imported listings are never tested.
119
+ const covered = testable(offering);
104
120
  out.push({
105
121
  node_id: node.id,
106
122
  offering_id: offering.offering_id,
107
- tier,
123
+ tier: covered ? tier : 'unverified',
124
+ tested: covered && node.source !== 'import',
108
125
  source: node.source ?? 'registration',
109
126
  institutional: Boolean(node.institutional),
127
+ founding: Boolean(node.founding), // admin-set label (ONP-3 §4b), never a rank input
110
128
  card_revision: card.revision,
111
129
  modality: offering.modality,
112
130
  modalities: offering.modalities ?? null,
@@ -146,11 +164,19 @@ async function buildOfferings(store) {
146
164
  // false for listing-only imports (no known API endpoint): shown, never called
147
165
  invocable: Boolean(card.endpoints?.openai),
148
166
  });
167
+ // Trusted or open pool (ONP-3 §5e), under this registry's trusted view.
168
+ out.at(-1).pool = poolOf(out.at(-1), view);
149
169
  }
150
170
  }
151
171
  return out;
152
172
  }
153
173
 
174
+ const bad = (message) => Object.assign(new Error(message), { status: 400 });
175
+ const oneOf = (name, value, allowed) => {
176
+ if (value != null && !allowed.includes(value)) throw bad(`${name} must be ${allowed.join(' or ')}, not ${JSON.stringify(value)}`);
177
+ return value;
178
+ };
179
+
154
180
  /** Whether an offering publishes a per-token price (imports with no known price leave it out). */
155
181
  export const pricePublished = (pricing) => pricing?.input_per_mtok != null || pricing?.output_per_mtok != null;
156
182
 
@@ -180,10 +206,21 @@ export async function searchOfferingsPaged(store, query) {
180
206
  const min = basisRank(q('location_basis'));
181
207
  items = items.filter((o) => o.locations.length && o.locations.every((l) => basisRank(l.basis) >= min));
182
208
  }
183
- if (q('exclude_lineage')) {
184
- // Origin policy on declared lineage; offerings that declare none are kept (unknown).
185
- const banned = q('exclude_lineage').toUpperCase().split(',');
186
- items = items.filter((o) => !(o.model.lineage_origins ?? []).some((c) => banned.includes(c)));
209
+ // Origin policy on declared lineage: offerings that declare none are kept (unknown), unless
210
+ // lineage=declared asks for a declared lineage.
211
+ const declared = oneOf('lineage', q('lineage'), ['declared', 'any']) === 'declared';
212
+ if (q('exclude_lineage') || declared) {
213
+ const exclude = (q('exclude_lineage') ?? '').split(',').filter(Boolean);
214
+ items = items.filter((o) => lineageAllowed(o, { exclude, declared }));
215
+ }
216
+ // Data policy (ONP-2 §5): at most this retention, no training on inputs. No data_policy fails.
217
+ const retention = oneOf('retention', q('retention'), RETENTION_LEVELS);
218
+ const noTraining = oneOf('no_training', q('no_training'), ['true', 'false']) === 'true';
219
+ if (retention || noTraining) items = items.filter((o) => meetsDataPolicy(o, { retention, no_training: noTraining }));
220
+ // The trusted pool (ONP-3 §5e): every condition of the registry's trusted view at once.
221
+ if (oneOf('trust', q('trust'), ['trusted', 'open']) === 'trusted') {
222
+ const view = trustedViewOf(store);
223
+ items = items.filter((o) => inTrustedPool(o, view));
187
224
  }
188
225
  if (q('tier')) {
189
226
  const order = ['unverified', 'community', 'verified', 'attested'];
package/src/server.js CHANGED
@@ -3,19 +3,19 @@ import { randomUUID } from 'node:crypto';
3
3
  import {
4
4
  createApp, listen, closeApp, sendJson, problem, readJson,
5
5
  validateCard, verifyCardSignature, keyFromJwk, estimateBounds,
6
- extractFeatures, recommend,
6
+ extractFeatures, recommend, trustedView, DEFAULT_TRUSTED_JURISDICTIONS,
7
7
  } from '@opennodes/core';
8
8
  import { resolveTxt } from 'node:dns/promises';
9
9
  import { readFileSync, writeFileSync, existsSync } from 'node:fs';
10
10
  import { fileURLToPath } from 'node:url';
11
11
  import { generateKeypair, keypairFromPem } from '@opennodes/core';
12
12
  import { createStore } from './store.js';
13
- import { runStageA } from './probes.js';
13
+ import { runStageA, verificationOf } from './probes.js';
14
14
  import { runStageB, captureFingerprints } from './stageb.js';
15
15
  import { startStageC } from './stagec.js';
16
16
  import { startReimport } from './reimport.js';
17
17
  import { makeSafeFetch } from './safefetch.js';
18
- import { searchOfferings, searchOfferingsPaged, collectOfferings, watchStoreWrites, setSeedPlacements, RANK_COMPONENTS, pricePublished } from './search.js';
18
+ import { searchOfferings, searchOfferingsPaged, collectOfferings, watchStoreWrites, setSeedPlacements, setTrustedView, RANK_COMPONENTS, pricePublished } from './search.js';
19
19
  import { mcpRoutes } from './mcp.js';
20
20
  import { hostControlsNamespace, isPrivateHost, makeRateLimiter } from './namespace.js';
21
21
  import { exportRoutes } from './export.js';
@@ -28,6 +28,7 @@ import {
28
28
  HF_ROUTER_URL, HF_HUB_URL, OPENROUTER_URL, OPENROUTER_PROVIDERS_URL, OLLAMA_LIBRARY_URL,
29
29
  } from './importers.js';
30
30
  import { locationRoutes, loadLocationSeeds, seedPlacements, seedNodeSites, nodeServes } from './locations.js';
31
+ import { makeRequestCounter, nodeIdsIn } from './counts.js';
31
32
 
32
33
  /** Default basemap. OSM's tile policy asks for attribution and light use; busy registries set their own. */
33
34
  export const OSM_TILES = {
@@ -52,8 +53,11 @@ export async function startRegistry({
52
53
  location = null, // { selfSite, agents, intervalMs, fetchImpl, resolve, rtt } to check server locations
53
54
  locationSeeds = false, // import the bundled curated location seeds (src/data/locations-*.json) at start
54
55
  mapTiles = OSM_TILES, // basemap for the "Where models run" map: { tiles, attribution, max_zoom }, or null for no map
56
+ requestCountFlushMs = 60_000, // how often request counts move from memory to the store (reads flush first)
57
+ trustedJurisdictions = DEFAULT_TRUSTED_JURISDICTIONS, // the trusted pool's operator jurisdictions (ONP_TRUSTED_JURISDICTIONS)
55
58
  } = {}) {
56
59
  const store = watchStoreWrites(await createStore(dbPath)); // sqlite path/:memory: or postgres:// URL; writes refresh the cached catalog
60
+ const requests = makeRequestCounter(store, { flushMs: requestCountFlushMs }); // node ids + counts only
57
61
  const safeFetch = makeSafeFetch({ allowPrivate: allowPrivateTargets });
58
62
  const seeds = locationSeeds ? loadLocationSeeds() : [];
59
63
  for (const seed of seeds) {
@@ -61,6 +65,9 @@ export async function startRegistry({
61
65
  if (result.skipped.length) console.warn(`location seed ${seed.seed}: skipped ${result.skipped.join('; ')}`);
62
66
  }
63
67
  setSeedPlacements(store, seedPlacements(seeds));
68
+ const trusted = trustedView(trustedJurisdictions); // pool labels, trust=trusted, sensitive recommend
69
+ if (!trusted.countries.length) console.warn(`trusted jurisdictions "${trustedJurisdictions}" name no country: no hosted offering is trusted`);
70
+ setTrustedView(store, trusted);
64
71
  const webApp = readFileSync(fileURLToPath(new URL('./web/index.html', import.meta.url)), 'utf8');
65
72
  let registryKeys;
66
73
  if (keyPath && existsSync(keyPath)) {
@@ -328,6 +335,7 @@ export async function startRegistry({
328
335
  tier: node.state === 'indexed' ? 'unverified' : node.state,
329
336
  source: node.source ?? 'registration',
330
337
  institutional: Boolean(node.institutional),
338
+ founding: Boolean(node.founding),
331
339
  updated_at: node.updated_at,
332
340
  name: card?.node?.name ?? node.id,
333
341
  operator: card?.node?.operator?.name ?? null,
@@ -360,17 +368,40 @@ export async function startRegistry({
360
368
  ['GET', '/v0/nodes/:id', async (req, res, { params }) => {
361
369
  const node = await store.getNode(params.id);
362
370
  if (!node) return problem(res, 404, 'unknown-node', params.id);
371
+ const card = await store.latestCard(params.id);
372
+ const nodeObs = await store.getObservations(params.id, '_node');
363
373
  sendJson(res, 200, {
364
374
  ...node,
365
- card: await store.latestCard(params.id),
375
+ institutional: Boolean(node.institutional),
376
+ founding: Boolean(node.founding),
377
+ card,
366
378
  probes: (await store.probesFor(params.id)).slice(0, 20),
367
379
  history: await store.transitionsFor(params.id),
368
- location: (await store.getObservations(params.id, '_node')).location ?? null,
380
+ location: nodeObs.location ?? null,
381
+ // What the tier covers (ONP-3 §4a): the offerings the tests could not call, and whether
382
+ // Stage C has had to skip blind probes because none could be called.
383
+ verification: verificationOf(card, nodeObs),
384
+ // How often search, recommend and MCP returned this node, last 12 ISO weeks, newest first.
385
+ request_counts: await requests.forNode(params.id),
386
+ });
387
+ }],
388
+
389
+ // Request counts (ONP-3 §6.6): per ISO week, the responses on each surface and the nodes they
390
+ // returned. ?weeks=1..52 (default 4), ?node_id= one node, ?limit= nodes per week (default 50).
391
+ ['GET', '/v0/stats/requests', async (req, res, { query }) => {
392
+ const int = (k, dflt, max) => Math.min(max, Math.max(1, Math.floor(Number(query.get(k) ?? dflt)) || dflt));
393
+ sendJson(res, 200, {
394
+ counted: 'responses that returned the node, per ISO week (Monday 00:00 UTC): search = GET /v0/offerings, recommend = POST /v0/recommend, mcp = tools/call on /mcp; each response counts a node once. Only node ids and counts are stored, never the query, task or client.',
395
+ weeks: await requests.stats({ weeks: int('weeks', 4, 52), nodeId: query.get('node_id') || null, limit: int('limit', 50, 500) }),
369
396
  });
370
397
  }],
371
398
 
372
399
  ['GET', '/v0/offerings', async (req, res, { query }) => {
373
- const { offerings, total, offset, counts } = await searchOfferingsPaged(store, query);
400
+ let page;
401
+ try { page = await searchOfferingsPaged(store, query); }
402
+ catch (err) { if (err.status === 400) return problem(res, 400, 'bad-query', err.message); throw err; }
403
+ const { offerings, total, offset, counts } = page;
404
+ requests.count('search', offerings.map((o) => o.node_id));
374
405
  // total = matches before `offset`/`limit`; counts = hosted/local matches before the `local` filter
375
406
  sendJson(res, 200, { offerings, total, offset, counts });
376
407
  }],
@@ -397,7 +428,9 @@ export async function startRegistry({
397
428
  if (!offering) return problem(res, 404, 'unknown-offering', step.offering);
398
429
  } else if (step.select) {
399
430
  const query = new URLSearchParams(step.select);
400
- const results = await searchOfferings(store, query);
431
+ let results;
432
+ try { results = await searchOfferings(store, query); }
433
+ catch (err) { if (err.status === 400) return problem(res, 400, 'bad-query', err.message); throw err; }
401
434
  if (!results.length) return problem(res, 404, 'no-offering-matches', JSON.stringify(step.select));
402
435
  offering = results[0];
403
436
  } else {
@@ -429,7 +462,12 @@ export async function startRegistry({
429
462
  if (!features) return problem(res, 400, 'missing-task', 'body must carry "task" (text) or "features" (from extractFeatures)');
430
463
  // only what a client could actually call: listing-only imports are never recommended
431
464
  const all = (await collectOfferings(store)).filter((o) => o.invocable);
432
- sendJson(res, 200, recommend(all, features, body.policy ?? {}));
465
+ // policy.sensitive / policy.trust apply this registry's trusted view; a client cannot replace it
466
+ let advice;
467
+ try { advice = recommend(all, features, { ...(body.policy ?? {}), trusted }); }
468
+ catch (err) { if (err.status === 400) return problem(res, 400, 'bad-policy', err.message); throw err; }
469
+ requests.count('recommend', nodeIdsIn(advice)); // recommendations, scenario roles, embedders
470
+ sendJson(res, 200, advice);
433
471
  }],
434
472
 
435
473
  // Delist (admin): operator opt-out of an imported listing, or retiring a node. Search,
@@ -461,6 +499,23 @@ export async function startRegistry({
461
499
  sendJson(res, 200, { id: node.id, state: 'indexed' });
462
500
  }],
463
501
 
502
+ // Operator marks (admin, ONP-3 §4b): body {"institutional": true|false} or {"founding": true|false}.
503
+ // Labels shown with the listing, never rank inputs. Setting one needs a registered node (an
504
+ // unclaimed import has no proven operator); clearing always works.
505
+ ...['institutional', 'founding'].map((flag) => ['POST', `/v0/admin/nodes/:id/${flag}`, async (req, res, { params }) => {
506
+ if (!adminOk(req, res)) return;
507
+ const node = await store.getNode(params.id);
508
+ if (!node) return problem(res, 404, 'unknown-node', params.id);
509
+ const body = await readJson(req);
510
+ if (typeof body[flag] !== 'boolean') return problem(res, 400, 'bad-flag', `body must be {"${flag}": true} or {"${flag}": false}`);
511
+ if (body[flag] && node.source === 'import') {
512
+ return problem(res, 409, 'imported-listing', `${node.id} is an unclaimed catalog import; the ${flag} mark needs a registered node`);
513
+ }
514
+ await store.setNodeFlag(node.id, flag, body[flag]);
515
+ const updated = await store.getNode(node.id);
516
+ sendJson(res, 200, { id: node.id, institutional: Boolean(updated.institutional), founding: Boolean(updated.founding) });
517
+ }]),
518
+
464
519
  // Seed importer (admin): body {catalog} in models.dev shape, or {url} to fetch it.
465
520
  ['POST', '/v0/import/models-dev', async (req, res) => {
466
521
  if (!adminOk(req, res)) return;
@@ -548,6 +603,8 @@ export async function startRegistry({
548
603
  map: mapTiles,
549
604
  signing_key: { ...registryKeys.publicJwk, kid: 'registry-1' },
550
605
  stage_c: Boolean(stageC),
606
+ // What trust=trusted, policy.sensitive and each result's `pool` mean here (ONP-3 §5e).
607
+ trust: { pools: ['trusted', 'open'], trusted },
551
608
  });
552
609
  }],
553
610
 
@@ -557,7 +614,7 @@ export async function startRegistry({
557
614
  res.end(webApp);
558
615
  }],
559
616
 
560
- ...mcpRoutes(store, seeds),
617
+ ...mcpRoutes(store, seeds, { onResult: (ids) => requests.count('mcp', ids), trusted }),
561
618
  ...exportRoutes(store, registryKeys),
562
619
  ...locationRoutes(store, seeds),
563
620
  ], { cors: true }); // public read API: third-party web clients may call it directly
@@ -604,6 +661,7 @@ export async function startRegistry({
604
661
  reimportHandle?.stop();
605
662
  locationHandle?.stop();
606
663
  await closeApp(app);
664
+ await requests.stop(); // writes the counts still in memory
607
665
  await store.close();
608
666
  },
609
667
  };
package/src/stageb.js CHANGED
@@ -2,9 +2,15 @@
2
2
  // verification with capping, capacity ramp with measured-over-claimed metrics.
3
3
  import { createHash } from 'node:crypto';
4
4
  import { fetchJsonCapped } from './safefetch.js';
5
+ import { testable, untestedOfferings, NO_TESTED_OFFERINGS } from './probes.js';
5
6
 
6
7
  const sha256 = (s) => createHash('sha256').update(s).digest('hex');
7
8
 
9
+ /** Context probe sizes, as fractions of the claimed window (DS-ADM-03). */
10
+ export const CONTEXT_FRACTIONS = [0.25, 0.5, 0.9];
11
+ /** Capacity ramp (DS-ADM-04): parallel requests per step; one batch per step, all within one time budget. */
12
+ export const CAPACITY_RAMP = { steps: [1, 4, 8], durationMs: 3000 };
13
+
8
14
  /** The fixed identity battery: deterministic prompts, temperature 0. */
9
15
  export const FINGERPRINT_PROMPTS = [
10
16
  'ONP identity probe 1: repeat exactly: correlation-4417',
@@ -97,7 +103,7 @@ async function probeContext(safeFetch, card, offering) {
97
103
  const { charsPerToken, measured } = await calibrate(safeFetch, card, offering);
98
104
  const results = [];
99
105
  let cap = 0, unbroken = true;
100
- for (const fraction of [0.25, 0.5, 0.9]) {
106
+ for (const fraction of CONTEXT_FRACTIONS) {
101
107
  const tokens = Math.floor(claimed * fraction);
102
108
  const digits = String(Math.floor(tokens * 7919)); // deterministic per size
103
109
  const fact = ` The magic number is ${digits}. `;
@@ -122,7 +128,7 @@ async function probeContext(safeFetch, card, offering) {
122
128
  }
123
129
 
124
130
  /** DS-ADM-04: stepped-concurrency ramp; measures TTFT p50/p95 and rough TPS. */
125
- async function probeCapacity(safeFetch, card, offering, { steps = [1, 4, 8], durationMs = 3000 } = {}) {
131
+ async function probeCapacity(safeFetch, card, offering, { steps = CAPACITY_RAMP.steps, durationMs = CAPACITY_RAMP.durationMs } = {}) {
126
132
  const latencies = [];
127
133
  let completed = 0, failed = 0, outputTokens = 0;
128
134
  const deadline = Date.now() + durationMs;
@@ -155,14 +161,20 @@ async function probeCapacity(safeFetch, card, offering, { steps = [1, 4, 8], dur
155
161
  }
156
162
 
157
163
  /**
158
- * Run Stage B for every chat offering. Records probes + observations; returns per-offering verdicts.
164
+ * Run Stage B for every offering the tests can call (TESTED_PROFILES). Records probes + observations;
165
+ * returns per-offering verdicts, and in `untested` the offerings it could not call.
159
166
  * Identity refs come from await store.getFingerprints(artifact); absence of refs is recorded, not failed
160
167
  * (proprietary artifacts are guarded by the vendor-namespace rule instead).
168
+ * A card with no testable offering fails: nothing was measured, so nothing can be verified.
161
169
  */
162
170
  export async function runStageB(store, nodeId, card, { safeFetch, capacity = {} } = {}) {
171
+ const untested = untestedOfferings(card);
172
+ if (!card.offerings.some(testable)) {
173
+ return { ok: false, identityFailed: false, reason: NO_TESTED_OFFERINGS, verdicts: [], untested };
174
+ }
163
175
  const verdicts = [];
164
176
  for (const offering of card.offerings) {
165
- if (offering.binding.profile !== 'onp.openai.chat/v1') continue;
177
+ if (!testable(offering)) continue;
166
178
  const verdict = { offering_id: offering.offering_id, identity: null, context: null, capacity: null };
167
179
 
168
180
  const refs = await store.getFingerprints(offering.model.artifact);
@@ -170,7 +182,7 @@ export async function runStageB(store, nodeId, card, { safeFetch, capacity = {}
170
182
  verdict.identity = await probeIdentity(safeFetch, card, offering, refs);
171
183
  if (verdict.identity.stale) {
172
184
  // The node rejected our pinned revision (409). Abort without judging: the caller re-indexes and retries.
173
- return { ok: false, identityFailed: false, stale: true, verdicts: [...verdicts, verdict] };
185
+ return { ok: false, identityFailed: false, stale: true, verdicts: [...verdicts, verdict], untested };
174
186
  }
175
187
  await store.recordProbe(nodeId, offering.offering_id, 'B', 'identity', verdict.identity.ok,
176
188
  `${verdict.identity.matches}/${verdict.identity.total} reference matches`);
@@ -198,5 +210,5 @@ export async function runStageB(store, nodeId, card, { safeFetch, capacity = {}
198
210
 
199
211
  const identityFailed = verdicts.some((v) => v.identity && !v.identity.ok);
200
212
  const ok = !identityFailed && verdicts.every((v) => v.capacity?.ok);
201
- return { ok, identityFailed, verdicts };
213
+ return { ok, identityFailed, verdicts, untested };
202
214
  }
package/src/stagec.js CHANGED
@@ -4,15 +4,22 @@
4
4
  // - random blind invocations at unpredictable times (anti-"benchmark mode":
5
5
  // a node cannot serve the real model only when it detects a test window)
6
6
  import { fetchJsonCapped } from './safefetch.js';
7
+ import { testable, NO_TESTED_OFFERINGS } from './probes.js';
7
8
 
8
9
  const OBSERVED_STATES = ['community', 'verified', 'attested'];
10
+ /** Mean gap between liveness sweeps (spec: <=5 min); each gap is drawn from 0.5x-1.5x (jitter). */
11
+ export const LIVENESS_INTERVAL_MS = 300_000;
12
+ /** Mean gap between blind-invocation sweeps: one chat call per node per sweep, same jitter. */
13
+ export const BLIND_INTERVAL_MS = 3_600_000;
14
+ /** Each gap is the mean times a uniform random factor in this range. */
15
+ export const JITTER = [0.5, 1.5];
9
16
 
10
17
  export function startStageC(store, {
11
18
  safeFetch,
12
19
  fetchFor = null, // (nodeId, card) -> fetch that carries the node's probe key
13
20
  refreshCard = null, // re-index a node's card when its revision moved (restart / reprice)
14
- livenessIntervalMs = 300_000, // spec: <=5 min; tests shorten this
15
- blindIntervalMs = 3_600_000,
21
+ livenessIntervalMs = LIVENESS_INTERVAL_MS, // tests shorten this
22
+ blindIntervalMs = BLIND_INTERVAL_MS,
16
23
  failThreshold = 3,
17
24
  recoverThreshold = 3, // consecutive liveness successes that lift a liveness suspension
18
25
  } = {}) {
@@ -77,9 +84,21 @@ export function startStageC(store, {
77
84
  await refreshCard?.(node.id);
78
85
  const card = await store.latestCard(node.id);
79
86
  if (!card) continue;
80
- const chatOfferings = card.offerings.filter((o) => o.binding.profile === 'onp.openai.chat/v1');
81
- if (!chatOfferings.length) continue;
82
- const offering = chatOfferings[Math.floor(Math.random() * chatOfferings.length)];
87
+ // Blind probes call only offerings the tests can call. A node with none is reported in the
88
+ // `blind_skipped` observation (node detail, export feed) instead of passing unobserved.
89
+ const callable = card.offerings.filter(testable);
90
+ const skipped = (await store.getObservations(node.id, '_node')).blind_skipped ?? null;
91
+ if (!callable.length) {
92
+ const profiles = [...new Set(card.offerings.map((o) => o.binding?.profile))];
93
+ if (skipped?.revision !== card.revision) {
94
+ await store.setObservation(node.id, '_node', 'blind_skipped', {
95
+ reason: NO_TESTED_OFFERINGS, profiles, revision: card.revision, since: new Date().toISOString(),
96
+ });
97
+ }
98
+ continue;
99
+ }
100
+ if (skipped) await store.setObservation(node.id, '_node', 'blind_skipped', null);
101
+ const offering = callable[Math.floor(Math.random() * callable.length)];
83
102
  try {
84
103
  const f = fetchFor ? await fetchFor(node.id, card) : safeFetch;
85
104
  const { status, body } = await fetchJsonCapped(f, `${card.endpoints.openai}/chat/completions`, {
@@ -106,7 +125,7 @@ export function startStageC(store, {
106
125
  }
107
126
  }
108
127
 
109
- const jitter = (base) => base * (0.5 + Math.random());
128
+ const jitter = (base) => base * (JITTER[0] + Math.random() * (JITTER[1] - JITTER[0]));
110
129
  const loop = (fn, base) => {
111
130
  const tick = async () => {
112
131
  if (stopped) return;
package/src/store-pg.js CHANGED
@@ -5,10 +5,11 @@ import pg from 'pg';
5
5
  const SCHEMA = `
6
6
  CREATE TABLE IF NOT EXISTS nodes (
7
7
  id TEXT PRIMARY KEY, origin TEXT NOT NULL, card_url TEXT NOT NULL,
8
- state TEXT NOT NULL, institutional INTEGER DEFAULT 0,
8
+ state TEXT NOT NULL, institutional INTEGER DEFAULT 0, founding INTEGER DEFAULT 0,
9
9
  source TEXT NOT NULL DEFAULT 'registration',
10
10
  created_at TEXT NOT NULL, updated_at TEXT NOT NULL
11
11
  );
12
+ ALTER TABLE nodes ADD COLUMN IF NOT EXISTS founding INTEGER DEFAULT 0;
12
13
  CREATE TABLE IF NOT EXISTS card_revisions (
13
14
  node_id TEXT NOT NULL, revision TEXT NOT NULL, raw TEXT NOT NULL,
14
15
  sig_ok INTEGER NOT NULL, fetched_at TEXT NOT NULL,
@@ -38,8 +39,14 @@ const SCHEMA = `
38
39
  value TEXT NOT NULL, at TEXT NOT NULL,
39
40
  PRIMARY KEY (node_id, offering_id, key)
40
41
  );
42
+ CREATE TABLE IF NOT EXISTS request_counts (
43
+ node_id TEXT NOT NULL, week TEXT NOT NULL, surface TEXT NOT NULL, n INTEGER NOT NULL,
44
+ PRIMARY KEY (node_id, week, surface)
45
+ );
41
46
  `;
42
47
 
48
+ const NODE_FLAGS = ['institutional', 'founding']; // same list as store.js
49
+
43
50
  export async function createPgStore({ connectionString, pool } = {}) {
44
51
  const p = pool ?? new pg.Pool({ connectionString, max: 10 });
45
52
  for (const stmt of SCHEMA.split(';').map((s) => s.trim()).filter(Boolean)) {
@@ -60,6 +67,10 @@ export async function createPgStore({ connectionString, pool } = {}) {
60
67
  async getNode(id) {
61
68
  return (await q('SELECT * FROM nodes WHERE id = $1', [id]))[0];
62
69
  },
70
+ async setNodeFlag(id, flag, value) {
71
+ if (!NODE_FLAGS.includes(flag)) throw new Error(`unknown node flag: ${flag}`);
72
+ await q(`UPDATE nodes SET ${flag} = $1 WHERE id = $2`, [value ? 1 : 0, id]);
73
+ },
63
74
  async setState(id, toState, reason = null) {
64
75
  const cur = await this.getNode(id);
65
76
  await q('UPDATE nodes SET state = $1, updated_at = $2 WHERE id = $3', [toState, now(), id]);
@@ -135,6 +146,18 @@ export async function createPgStore({ connectionString, pool } = {}) {
135
146
  const rows = await q('SELECT offering_id, key, value FROM observations WHERE node_id = $1', [nodeId]);
136
147
  return rows.map((r) => ({ offering_id: r.offering_id, key: r.key, value: JSON.parse(r.value) }));
137
148
  },
149
+ async addRequestCounts(rows) {
150
+ for (const r of rows) {
151
+ await q(`INSERT INTO request_counts (node_id, week, surface, n) VALUES ($1, $2, $3, $4)
152
+ ON CONFLICT (node_id, week, surface) DO UPDATE SET n = request_counts.n + excluded.n`,
153
+ [r.node_id, r.week, r.surface, r.n]);
154
+ }
155
+ },
156
+ async requestCounts({ nodeId = null, sinceWeek = '0000-W00' } = {}) {
157
+ return nodeId
158
+ ? q('SELECT * FROM request_counts WHERE node_id = $1 AND week >= $2 ORDER BY week DESC', [nodeId, sinceWeek])
159
+ : q('SELECT * FROM request_counts WHERE week >= $1 ORDER BY week DESC', [sinceWeek]);
160
+ },
138
161
  async close() { await p.end(); },
139
162
  };
140
163
  }
package/src/store.js CHANGED
@@ -4,6 +4,9 @@
4
4
  // Every method is async so both drivers present the identical contract.
5
5
  import { DatabaseSync } from 'node:sqlite';
6
6
 
7
+ /** Admin-set node labels: shown with a listing, never rank inputs (ONP-3 §4b). */
8
+ export const NODE_FLAGS = ['institutional', 'founding'];
9
+
7
10
  /** config: ':memory:' | sqlite file path | postgres:// URL */
8
11
  export async function createStore(config = ':memory:') {
9
12
  if (typeof config === 'string' && /^postgres(ql)?:\/\//.test(config)) {
@@ -18,7 +21,7 @@ export async function createSqliteStore(path = ':memory:') {
18
21
  db.exec(`
19
22
  CREATE TABLE IF NOT EXISTS nodes (
20
23
  id TEXT PRIMARY KEY, origin TEXT NOT NULL, card_url TEXT NOT NULL,
21
- state TEXT NOT NULL, institutional INTEGER DEFAULT 0,
24
+ state TEXT NOT NULL, institutional INTEGER DEFAULT 0, founding INTEGER DEFAULT 0,
22
25
  source TEXT NOT NULL DEFAULT 'registration',
23
26
  created_at TEXT NOT NULL, updated_at TEXT NOT NULL
24
27
  );
@@ -53,7 +56,17 @@ export async function createSqliteStore(path = ':memory:') {
53
56
  value TEXT NOT NULL, at TEXT NOT NULL,
54
57
  PRIMARY KEY (node_id, offering_id, key)
55
58
  );
59
+ -- How often the registry returned each node to a client, per ISO week and surface
60
+ -- (search / recommend / mcp). Node ids and counts only: never the query, prompt or client.
61
+ CREATE TABLE IF NOT EXISTS request_counts (
62
+ node_id TEXT NOT NULL, week TEXT NOT NULL, surface TEXT NOT NULL, n INTEGER NOT NULL,
63
+ PRIMARY KEY (node_id, week, surface)
64
+ );
56
65
  `);
66
+ // Databases created before the founding mark existed: add the column in place.
67
+ if (!db.prepare('PRAGMA table_info(nodes)').all().some((c) => c.name === 'founding')) {
68
+ db.exec('ALTER TABLE nodes ADD COLUMN founding INTEGER DEFAULT 0');
69
+ }
57
70
 
58
71
  const now = () => new Date().toISOString();
59
72
 
@@ -67,6 +80,11 @@ export async function createSqliteStore(path = ':memory:') {
67
80
  .run(id, origin, cardUrl, state, source, now(), now());
68
81
  },
69
82
  async getNode(id) { return db.prepare('SELECT * FROM nodes WHERE id = ?').get(id); },
83
+ /** Admin-set labels (`institutional`, `founding`). Not a state change: no transition, updated_at kept. */
84
+ async setNodeFlag(id, flag, value) {
85
+ if (!NODE_FLAGS.includes(flag)) throw new Error(`unknown node flag: ${flag}`);
86
+ db.prepare(`UPDATE nodes SET ${flag} = ? WHERE id = ?`).run(value ? 1 : 0, id);
87
+ },
70
88
  async setState(id, toState, reason = null) {
71
89
  const cur = await this.getNode(id);
72
90
  db.prepare('UPDATE nodes SET state = ?, updated_at = ? WHERE id = ?').run(toState, now(), id);
@@ -136,6 +154,18 @@ export async function createSqliteStore(path = ':memory:') {
136
154
  const rows = db.prepare('SELECT offering_id, key, value FROM observations WHERE node_id = ?').all(nodeId);
137
155
  return rows.map((r) => ({ offering_id: r.offering_id, key: r.key, value: JSON.parse(r.value) }));
138
156
  },
157
+ /** rows: [{node_id, week, surface, n}] — added to the stored counts. */
158
+ async addRequestCounts(rows) {
159
+ const add = db.prepare(`INSERT INTO request_counts (node_id, week, surface, n) VALUES (?, ?, ?, ?)
160
+ ON CONFLICT(node_id, week, surface) DO UPDATE SET n = request_counts.n + excluded.n`);
161
+ for (const r of rows) add.run(r.node_id, r.week, r.surface, r.n);
162
+ },
163
+ /** Counts from `sinceWeek` (ISO week, e.g. 2026-W46) on, newest week first; one node or all. */
164
+ async requestCounts({ nodeId = null, sinceWeek = '0000-W00' } = {}) {
165
+ return nodeId
166
+ ? db.prepare('SELECT * FROM request_counts WHERE node_id = ? AND week >= ? ORDER BY week DESC').all(nodeId, sinceWeek)
167
+ : db.prepare('SELECT * FROM request_counts WHERE week >= ? ORDER BY week DESC').all(sinceWeek);
168
+ },
139
169
  async close() { db.close(); },
140
170
  };
141
171
  }
@@ -116,6 +116,8 @@
116
116
  .chip.t-community { color: var(--accent); border-color: var(--accent); }
117
117
  .chip.t-disputed, .chip.t-suspended { color: var(--bad); border-color: var(--bad); }
118
118
  .chip.inst { color: var(--accent); border-color: var(--accent); }
119
+ .chip.found { color: var(--star); border-color: var(--star); }
120
+ .chip.untested { color: var(--warn); border-color: var(--warn); border-style: dashed; }
119
121
  .chip.imp { background: var(--panel-2); font-weight: 400; }
120
122
  .chip.loc { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
121
123
  .chip.b-documented { color: var(--accent); border-color: var(--accent); }
@@ -650,15 +652,28 @@
650
652
  <h1>The qualification procedure</h1>
651
653
  <p class="sub">Listing is open; tiers are earned. The registry runs an automated admission battery against your live endpoints — no paperwork, no gatekeepers, no exceptions. Every verdict is recorded and visible in your node's listing history.</p>
652
654
  <div class="panel pad" style="max-width:56rem">
653
- <div class="stage"><span class="k">STAGE A</span><span><b>Conformance</b> — gate to <span class="chip t-community">COMMUNITY</span>, minutes. Health endpoint live; card valid and signed; models list agrees with the card; one blind invocation returns proper usage accounting and a signed receipt. Re-run every 6&nbsp;hours and on every card revision.</span></div>
655
+ <div class="stage"><span class="k">STAGE A</span><span><b>Conformance</b> — gate to <span class="chip t-community">COMMUNITY</span>, minutes. Health endpoint live; card valid and signed; models list agrees with the card; one blind invocation returns proper usage accounting and a signed receipt. Runs when you verify your registration, and again whenever you call <code>PUT /v0/nodes/{id}/ping</code>; this registry does not yet re-run it on a timer.</span></div>
654
656
  <div class="stage"><span class="k">STAGE B</span><span><b>Substance</b> — gate to <span class="chip t-verified">VERIFIED</span>, hours. <b>Identity fingerprinting:</b> a deterministic probe battery compared against reference outputs of the claimed model — serving a cheaper substitute under a premium name marks the node <i>disputed</i> and delists it. <b>Context verification:</b> needle-in-haystack probes at 25/50/90% of the claimed window; overclaims are capped to the verified size, visibly. <b>Capacity ramp:</b> stepped concurrent load; measured TTFT/throughput overrides claims in search results.</span></div>
655
657
  <div class="stage"><span class="k">STAGE C</span><span><b>Continuous</b> — keeps the tier honest. Liveness sweeps feed a rolling availability score; random blind invocations at unpredictable times defeat "benchmark mode"; sustained failures auto-suspend the listing.</span></div>
658
+ <div class="stage"><span class="k">COVERAGE</span><span><b>What is tested.</b> This registry has tests only for chat offerings (<code>onp.openai.chat/v1</code>). A tier covers only the offerings it could test: speech, embeddings, image or any other offering is listed as <span class="chip untested">UNTESTED</span>, and its tier is capped to <span class="chip t-unverified">UNVERIFIED</span> whatever the node's tier. A node with no chat offering stays unverified, because Stage A has nothing to call.</span></div>
659
+ </div>
660
+ <h2 id="probe-load">Probe load</h2>
661
+ <p class="sub">Everything this registry sends to your endpoints, as the code runs today. A <i>chat offering</i> is one bound to <code>onp.openai.chat/v1</code>; other offerings get only the health and models checks. Probe calls carry your probe key if you gave one at registration, and the registry does not pay for them.</p>
662
+ <div class="panel pad" style="max-width:56rem" id="probe-load-table">
663
+ <div class="stage"><span class="k">STAGE A</span><span><b>When:</b> once when you verify your registration, and once per <code>PUT /v0/nodes/{id}/ping</code>. No timed re-run yet.<br><b>Sends:</b> 1 GET to your health endpoint, 1 GET to <code>/models</code>, and 1 blind chat completion per chat offering (a short prompt, at most 32 output tokens).</span></div>
664
+ <div class="stage"><span class="k">STAGE B</span><span><b>When:</b> only when you ask for admission (<code>POST /v0/nodes/{id}/admit</code>), at most once every 30&nbsp;minutes per node on registry.opennodes.io.<br><b>Sends, per chat offering</b> (up to 20 chat completions):
665
+ <br>· <b>Fingerprint battery:</b> 3 fixed prompts at temperature 0, at most 64 output tokens each. Skipped when the registry holds no reference outputs for the model.
666
+ <br>· <b>Calibration:</b> 1 call with about 4,000 characters of filler, at most 4 output tokens, to measure your tokenizer.
667
+ <br>· <b>Context:</b> 3 probes sized at 25, 50 and 90% of the claimed context window, at most 64 output tokens each: about 1.65 times the window in prompt tokens altogether (about 210k tokens for a 128k window).
668
+ <br>· <b>Capacity ramp:</b> one batch each of 1, 4 and 8 parallel requests (13 calls, at most 48 output tokens each) inside a 3-second budget; a step that would start after the budget is skipped.</span></div>
669
+ <div class="stage"><span class="k">STAGE C</span><span><b>When:</b> continuously, for community, verified and attested nodes, and for nodes suspended for liveness until they recover.<br><b>Sends:</b> 1 GET to your health endpoint every 5&nbsp;minutes on average (each gap is random, 2.5 to 7.5&nbsp;minutes), and 1 blind chat completion per node per hour on average (30 to 90&nbsp;minutes apart, to a randomly chosen chat offering, at most 32 output tokens), each after a fetch of your card. That is about 288 health checks and 24 chat calls a day per node, whatever the number of offerings.</span></div>
670
+ <div class="stage"><span class="k">LOCATION</span><span><b>When:</b> after verification and then daily.<br><b>Sends:</b> 3 TCP connections to port 443 of your API host from each probe site (Nuremberg and Helsinki). No HTTP request.</span></div>
656
671
  </div>
657
672
  <h2>Principles</h2>
658
673
  <div class="panel pad" style="max-width:56rem; font-size:0.85rem">
659
674
  <p><b>Claimed ≠ measured ≠ attested.</b> Self-reported values are labeled <span class="micro m-claimed">CLAIMED</span>; registry measurements override them and show as <span class="micro m-measured">● MEASURED</span>; third-party Verifiable Credentials earn <i>attested</i>. The three are never blended.</p>
660
675
  <p><b>Transparent rank, by rule.</b> Every result carries its rank explanation — component weights and values. Undisclosed ranking inputs are non-conformant; sponsored placement, if ever present, must be labeled and excluded from rank.</p>
661
- <p style="margin-bottom:0"><b>Probes cost you nothing you don't grant.</b> Your card declares a probe allowance; the registry stays within it or pays like any client.</p>
676
+ <p style="margin-bottom:0"><b>Probe load is bounded and published.</b> The probe load list above is all the traffic the registry sends you. A card may declare a probe allowance (<code>payment.probe_allowance</code>); this registry does not read it yet, so the load above applies whatever the card says.</p>
662
677
  </div>
663
678
  </div>
664
679
 
@@ -682,7 +697,13 @@ const ago = (iso) => {
682
697
  return Math.round(s / 86400) + 'd ago';
683
698
  };
684
699
  const tierChip = (t) => `<span class="chip t-${esc(t)}">${esc(String(t).toUpperCase())}</span>`;
685
- const SUBSCRIPTION_NODE = /-plan(-|$)|\.gitlab$/;
700
+ // Marks the registry admin sets on a node or offering (ONP-3 §4b): labels only, never rank inputs.
701
+ const markChips = (o) => (o.founding ? '<span class="chip found" title="Founding operator: one of the first operators to list with this registry. A label only: it does not change rank.">FOUNDING</span>' : '')
702
+ + (o.institutional ? '<span class="chip inst" title="Operated by a research or public institution. A label only: it does not change rank.">institutional</span>' : '');
703
+ // An offering on a registered node whose profile the registry cannot test (ONP-3 §4a): its tier is capped to unverified.
704
+ const untestedChip = (o) => (o.tested === false && o.source !== 'import' && !o.local
705
+ ? `<span class="chip untested" title="This registry has no tests for ${esc(o.binding?.profile ?? 'this profile')}: the node's tier does not cover this offering.">UNTESTED</span>` : '');
706
+ const SUBSCRIPTION_NODE =/-plan(-|$)|\.gitlab$/;
686
707
  const pricePublished = (p) => p && (p.input_per_mtok != null || p.output_per_mtok != null);
687
708
  const priceStr = (p, nodeId = '') => {
688
709
  if (!pricePublished(p)) return SUBSCRIPTION_NODE.test(nodeId) ? 'in a subscription plan' : 'price not published';
@@ -1066,7 +1087,7 @@ function renderItem(o) {
1066
1087
  return `<div class="mitem" data-artifact="${esc(o.model.artifact)}" data-key="${esc(o.node_id + '/' + o.offering_id)}">
1067
1088
  <div class="t">
1068
1089
  <span class="nm">${esc(o.model.name)}</span>
1069
- ${tierChip(o.tier)}
1090
+ ${tierChip(o.tier)}${markChips(o)}${untestedChip(o)}
1070
1091
  ${o.local ? '<span class="chip loc">LOCAL</span>' : (o.source === 'import' ? '<span class="chip imp">IMP</span>' : '')}
1071
1092
  </div>
1072
1093
  <div class="b">
@@ -1149,7 +1170,7 @@ function renderRow(o, idx) {
1149
1170
  ${tierChip(o.tier)}
1150
1171
  <span class="chip">${esc(o.modality)}</span>
1151
1172
  ${o.local ? '<span class="chip loc">RUNS LOCALLY</span>' : (o.source === 'import' ? '<span class="chip imp">IMPORTED</span>' : '')}
1152
- ${o.institutional ? '<span class="chip inst">institutional</span>' : ''}
1173
+ ${markChips(o)}${untestedChip(o)}
1153
1174
  <a class="nodeid" href="#/node/${encodeURIComponent(o.node_id)}">${esc(o.node_id)}</a>
1154
1175
  <span class="rankwrap" title="rank — expand for the formula">
1155
1176
  <span class="rankbar"><i style="width:${Math.round((o.rank ?? 0) * 100)}%; ${rankMuted ? 'background: var(--faint)' : ''}"></i></span>
@@ -1191,7 +1212,9 @@ function renderScore(artifact) {
1191
1212
  verified: 'verified: passed identity, context and capacity checks',
1192
1213
  community: 'community: passed the registration checks',
1193
1214
  attested: 'attested by a third party',
1194
- }[o.tier] ?? (o.source === 'import' ? 'unverified: imported from a public catalog, not checked by this registry' : 'unverified: not checked yet'),
1215
+ }[o.tier] ?? (o.source === 'import' ? 'unverified: imported from a public catalog, not checked by this registry'
1216
+ : o.tested === false ? `unverified: this registry has no tests for ${o.binding?.profile ?? 'this profile'}, so the node's tier does not cover it`
1217
+ : 'unverified: not checked yet'),
1195
1218
  probe_success: obs.probes > 0 ? `${Math.round((obs.probe_success ?? 0) * obs.probes)} of the last ${obs.probes} checks passed` : 'no checks yet',
1196
1219
  };
1197
1220
  const label = { price: 'Price', tier: 'Trust tier', probe_success: 'Check pass rate' };
@@ -1314,7 +1337,7 @@ async function loadModel(artifact) {
1314
1337
  return `<tr>
1315
1338
  <td><div style="display:flex; flex-direction:column; gap:0.2rem">
1316
1339
  <a href="#/node/${encodeURIComponent(o.node_id)}" style="font-weight:600">${esc(o.node_id)}</a>
1317
- <span style="display:flex; gap:0.3rem">${tierChip(o.tier)}${o.institutional ? '<span class="chip inst">institutional</span>' : ''}${o.source === 'import' ? `<span class="chip imp">IMPORTED</span> <a class="prov" href="#/node/${encodeURIComponent(o.node_id)}">claim</a>` : ''}</span>
1340
+ <span style="display:flex; gap:0.3rem">${tierChip(o.tier)}${markChips(o)}${untestedChip(o)}${o.source === 'import' ? `<span class="chip imp">IMPORTED</span> <a class="prov" href="#/node/${encodeURIComponent(o.node_id)}">claim</a>` : ''}</span>
1318
1341
  </div></td>
1319
1342
  <td><b>${priceStr(o.pricing, o.node_id)}</b></td>
1320
1343
  <td>${hwStr(o) || '<span style="color:var(--faint)" title="Vendor has not disclosed the hardware behind this offering">undisclosed</span>'}</td>
@@ -2236,7 +2259,7 @@ async function loadRankings() {
2236
2259
  <td><div style="display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap">
2237
2260
  <a href="#/model/${encodeURIComponent(o.model.artifact)}" style="font-weight:600">${esc(o.model.name)}</a>
2238
2261
  <span style="color:var(--muted); font-size:0.76rem">${esc(o.node_id)}</span>
2239
- ${tierChip(o.tier)}${o.institutional ? '<span class="chip inst">institutional</span>' : ''}
2262
+ ${tierChip(o.tier)}${markChips(o)}${untestedChip(o)}
2240
2263
  </div></td>
2241
2264
  <td><b>${o.observed?.ttft_ms?.p50 ?? '—'}ms</b></td>
2242
2265
  <td><b>${o.observed?.tps > 0 ? o.observed.tps : '—'}</b></td>
@@ -2268,7 +2291,7 @@ async function loadNodes() {
2268
2291
  <th>NODE</th><th>TIER</th><th>OPERATOR</th><th>REGION</th><th>OFFERINGS</th><th>UP</th><th>UPDATED</th>
2269
2292
  </tr></thead><tbody>` + nodes.map((n) => `<tr>
2270
2293
  <td><a href="#/node/${encodeURIComponent(n.id)}" style="font-weight:600">${esc(n.id)}</a></td>
2271
- <td><span style="display:inline-flex; gap:0.3rem">${tierChip(n.tier)}${n.institutional ? '<span class="chip inst">institutional</span>' : ''}${n.source === 'import' ? '<span class="chip imp">IMPORTED</span>' : ''}</span></td>
2294
+ <td><span style="display:inline-flex; gap:0.3rem">${tierChip(n.tier)}${markChips(n)}${n.source === 'import' ? '<span class="chip imp">IMPORTED</span>' : ''}</span></td>
2272
2295
  <td>${esc(n.operator ?? '—')}${n.country ? ' <span style="color:var(--muted)">(' + esc(n.country) + ')</span>' : ''}</td>
2273
2296
  <td>${servesCell(n.serves)}</td>
2274
2297
  <td>${n.offerings}</td>
@@ -2584,6 +2607,24 @@ function locationRow(loc, imported) {
2584
2607
  return `<tr><td style="color:var(--muted)" class="mono">server</td><td style="font-size:0.8rem">${words[loc.verdict] || esc(loc.verdict)}${srv.asn ? ` · AS${srv.asn}${srv.network ? ' ' + esc(srv.network) : ''}` : ''}<br><span style="color:var(--muted)">latency ${latWord}${sites ? ' (' + sites + ')' : ''} · checked ${esc((loc.checked_at || '').slice(0, 10))} · evidence, not proof</span></td></tr>`;
2585
2608
  }
2586
2609
 
2610
+ /** Request counts (GET /v0/nodes/{id} request_counts): how often clients were shown this node. */
2611
+ function returnedRow(weeks, nodeId) {
2612
+ if (!Array.isArray(weeks) || !weeks.length) return '';
2613
+ const [now, prev] = weeks;
2614
+ const all = weeks.reduce((sum, w) => sum + w.total, 0);
2615
+ const parts = (w) => `search ${fmtInt(w.search)} · recommend ${fmtInt(w.recommend)} · MCP ${fmtInt(w.mcp)}`;
2616
+ return `<tr><td style="color:var(--muted)" class="mono">returned</td><td style="font-size:0.8rem"><b>${fmtInt(now.total)}</b> this week (${parts(now)})${prev ? ` · ${fmtInt(prev.total)} last week` : ''} · ${fmtInt(all)} in ${weeks.length} weeks<br><span style="color:var(--muted)">registry responses that included this node, per ISO week from Monday ${esc(now.starts)} (UTC) · counts only, no queries stored · <a href="/v0/stats/requests?node_id=${encodeURIComponent(nodeId)}">JSON</a></span></td></tr>`;
2617
+ }
2618
+
2619
+ /** What the node's tier covers (GET /v0/nodes/{id} verification): shown only when some offering is untested. */
2620
+ function testedRow(n, total, untested) {
2621
+ const v = n.verification;
2622
+ if (!v || n.source === 'import' || !untested) return '';
2623
+ const profiles = (v.tested_profiles || []).map(esc).join(', ');
2624
+ const skipped = v.blind_skipped ? `<br><span class="warncol">Stage C blind probes skipped since ${esc((v.blind_skipped.since || '').slice(0, 10))}: ${esc(v.blind_skipped.reason)}</span>` : '';
2625
+ return `<tr><td style="color:var(--muted)" class="mono">tested</td><td style="font-size:0.8rem">${fmtInt(total - untested)} of ${fmtInt(total)} offerings · <b>${fmtInt(untested)} untested</b>: this registry tests only ${profiles}, so the trust tier says nothing about the others${skipped}</td></tr>`;
2626
+ }
2627
+
2587
2628
  async function loadNode(id) {
2588
2629
  $('#node-title').textContent = id;
2589
2630
  try {
@@ -2596,9 +2637,11 @@ async function loadNode(id) {
2596
2637
  const tier = n.state === 'indexed' ? 'unverified' : n.state;
2597
2638
  const stat = (v, l) => `<span class="stat"><span class="sv">${v}</span><span class="sl">${l}</span></span>`;
2598
2639
  const offers = (card.offerings || []);
2640
+ // Offerings the registry's tests cannot call (ONP-3 §4a): the node's tier does not cover them.
2641
+ const untested = new Set(n.source === 'import' ? [] : (n.verification?.untested_offerings || []));
2599
2642
  const offerRows = offers.slice(0, 50).map((o) => `<tr>
2600
2643
  <td><a href="#/model/${encodeURIComponent(o.model?.artifact ?? '')}" style="font-weight:600">${esc(o.model?.name ?? o.offering_id)}</a></td>
2601
- <td><span class="chip">${esc(o.modality)}</span></td>
2644
+ <td><span class="chip">${esc(o.modality)}</span>${untested.has(o.offering_id) ? ' ' + untestedChip({ tested: false, source: n.source, binding: o.binding }) : ''}</td>
2602
2645
  <td class="num"><b>${priceStr(o.pricing || {}, o.node_id)}</b></td>
2603
2646
  <td>${hwStr({ hardware: o.hardware ?? card.hardware }) || '<span style="color:var(--faint)">undisclosed</span>'}</td>
2604
2647
  <td class="num">${o.serving?.context_window ? fmtInt(o.serving.context_window) : '—'}</td>
@@ -2609,6 +2652,7 @@ async function loadNode(id) {
2609
2652
  ${card.node?.description ? `<p class="desc">${esc(card.node.description)}</p>` : ''}
2610
2653
  <div class="statstrip">
2611
2654
  ${stat(tierChip(tier), 'TRUST TIER')}
2655
+ ${markChips(n) ? stat(`<span style="display:inline-flex; gap:0.3rem">${markChips(n)}</span>`, 'REGISTRY MARK — label, not a rank input') : ''}
2612
2656
  ${stat(String(offers.length), 'OFFERINGS')}
2613
2657
  ${card.node?.operator?.name ? stat(esc(card.node.operator.name) + (card.node.operator.country ? ' (' + esc(card.node.operator.country) + (n.source === 'import' ? ' · inferred' : '') + ')' : ''), 'OPERATOR') : ''}
2614
2658
  ${(card.node?.regions || []).length ? stat(esc(card.node.regions.join(', ')), 'REGIONS') : ''}
@@ -2619,6 +2663,8 @@ async function loadNode(id) {
2619
2663
  ${docsUrl(card.endpoints) ? `<tr><td style="color:var(--muted)" class="mono">docs</td><td class="mono" style="font-size:0.74rem"><a href="${esc(docsUrl(card.endpoints))}" target="_blank" rel="noopener">${esc(docsUrl(card.endpoints))}</a></td></tr>` : ''}
2620
2664
  ${locationRow(n.location, n.source === 'import')}
2621
2665
  ${card.hardware ? `<tr><td style="color:var(--muted)" class="mono">hardware</td><td style="font-size:0.78rem">${hwStr({ hardware: card.hardware })}</td></tr>` : ''}
2666
+ ${returnedRow(n.request_counts, n.id)}
2667
+ ${testedRow(n, offers.length, untested.size)}
2622
2668
  <tr><td style="color:var(--muted)" class="mono">revision</td><td class="mono" style="font-size:0.74rem">${esc(card.revision ?? '—')}</td></tr>
2623
2669
  </table></div>
2624
2670
  ${offers.length ? `<h2>Offerings</h2><div class="panel tablewrap" style="max-width:56rem"><table class="grid num"><thead><tr>