@opennodes/registry 0.1.52 → 0.1.54
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 +7 -6
- package/bin.js +10 -1
- package/package.json +2 -2
- package/src/corpus.js +166 -0
- package/src/data/proprietary-vendors.json +12 -0
- package/src/importers.js +3 -1
- package/src/location.js +168 -18
- package/src/locations.js +8 -4
- package/src/mcp.js +7 -3
- package/src/probes.js +27 -7
- package/src/schedule.js +178 -0
- package/src/search.js +52 -11
- package/src/server.js +309 -58
- package/src/stageb.js +155 -55
- package/src/stagec.js +222 -27
- package/src/store-pg.js +57 -0
- package/src/store.js +62 -0
- package/src/vendors.js +92 -0
- package/src/web/index.html +63 -29
package/src/store-pg.js
CHANGED
|
@@ -21,6 +21,9 @@ const SCHEMA = `
|
|
|
21
21
|
CREATE TABLE IF NOT EXISTS probe_keys (
|
|
22
22
|
node_id TEXT PRIMARY KEY, secret TEXT, pending TEXT, updated_at TEXT NOT NULL
|
|
23
23
|
);
|
|
24
|
+
CREATE TABLE IF NOT EXISTS customer_keys (
|
|
25
|
+
node_id TEXT PRIMARY KEY, secret TEXT NOT NULL, recorded_at TEXT NOT NULL
|
|
26
|
+
);
|
|
24
27
|
CREATE TABLE IF NOT EXISTS probes (
|
|
25
28
|
id SERIAL PRIMARY KEY, node_id TEXT NOT NULL, offering_id TEXT,
|
|
26
29
|
stage TEXT NOT NULL, kind TEXT NOT NULL, ok INTEGER NOT NULL,
|
|
@@ -43,6 +46,14 @@ const SCHEMA = `
|
|
|
43
46
|
node_id TEXT NOT NULL, week TEXT NOT NULL, surface TEXT NOT NULL, n INTEGER NOT NULL,
|
|
44
47
|
PRIMARY KEY (node_id, week, surface)
|
|
45
48
|
);
|
|
49
|
+
CREATE TABLE IF NOT EXISTS schedule (
|
|
50
|
+
node_id TEXT NOT NULL, stage TEXT NOT NULL, last_at TEXT, next_at TEXT, ok INTEGER,
|
|
51
|
+
revision TEXT, digest TEXT, pending_digest TEXT, failures INTEGER NOT NULL DEFAULT 0,
|
|
52
|
+
PRIMARY KEY (node_id, stage)
|
|
53
|
+
);
|
|
54
|
+
CREATE TABLE IF NOT EXISTS vendor_namespaces (
|
|
55
|
+
vendor TEXT PRIMARY KEY, namespaces TEXT NOT NULL, updated_at TEXT NOT NULL
|
|
56
|
+
);
|
|
46
57
|
`;
|
|
47
58
|
|
|
48
59
|
const NODE_FLAGS = ['institutional', 'founding']; // same list as store.js
|
|
@@ -88,6 +99,10 @@ export async function createPgStore({ connectionString, pool } = {}) {
|
|
|
88
99
|
const rows = await q('SELECT raw FROM card_revisions WHERE node_id = $1 ORDER BY revision DESC LIMIT 1', [nodeId]);
|
|
89
100
|
return rows[0] ? JSON.parse(rows[0].raw) : null;
|
|
90
101
|
},
|
|
102
|
+
async latestRevision(nodeId) {
|
|
103
|
+
const row = (await q('SELECT revision, sig_ok, fetched_at FROM card_revisions WHERE node_id = $1 ORDER BY revision DESC LIMIT 1', [nodeId]))[0];
|
|
104
|
+
return row ? { revision: row.revision, sig_ok: Boolean(Number(row.sig_ok)), fetched_at: row.fetched_at } : null;
|
|
105
|
+
},
|
|
91
106
|
async setPendingProbeKey(nodeId, key) {
|
|
92
107
|
await q(`INSERT INTO probe_keys (node_id, secret, pending, updated_at) VALUES ($1, NULL, $2, $3)
|
|
93
108
|
ON CONFLICT (node_id) DO UPDATE SET pending=excluded.pending, updated_at=excluded.updated_at`, [nodeId, key, now()]);
|
|
@@ -98,6 +113,15 @@ export async function createPgStore({ connectionString, pool } = {}) {
|
|
|
98
113
|
async getProbeKey(nodeId) {
|
|
99
114
|
return (await q('SELECT secret FROM probe_keys WHERE node_id = $1', [nodeId]))[0]?.secret ?? null;
|
|
100
115
|
},
|
|
116
|
+
/** Record the customer access the registry bought for a node (a key), or remove it with null. */
|
|
117
|
+
async setCustomerKey(nodeId, key) {
|
|
118
|
+
if (key == null) await q('DELETE FROM customer_keys WHERE node_id = $1', [nodeId]);
|
|
119
|
+
else await q(`INSERT INTO customer_keys (node_id, secret, recorded_at) VALUES ($1, $2, $3)
|
|
120
|
+
ON CONFLICT (node_id) DO UPDATE SET secret = excluded.secret, recorded_at = excluded.recorded_at`, [nodeId, key, now()]);
|
|
121
|
+
},
|
|
122
|
+
async getCustomerKey(nodeId) {
|
|
123
|
+
return (await q('SELECT secret FROM customer_keys WHERE node_id = $1', [nodeId]))[0]?.secret ?? null;
|
|
124
|
+
},
|
|
101
125
|
async setChallenge(nodeId, token, ttlMs = 72 * 3600 * 1000) {
|
|
102
126
|
await q(`INSERT INTO challenges (node_id, token, expires_at) VALUES ($1, $2, $3)
|
|
103
127
|
ON CONFLICT (node_id) DO UPDATE SET token=excluded.token, expires_at=excluded.expires_at`,
|
|
@@ -115,6 +139,9 @@ export async function createPgStore({ connectionString, pool } = {}) {
|
|
|
115
139
|
async probesFor(nodeId) {
|
|
116
140
|
return q('SELECT * FROM probes WHERE node_id = $1 ORDER BY id DESC LIMIT 100', [nodeId]);
|
|
117
141
|
},
|
|
142
|
+
async countProbes(nodeId, kind, since) {
|
|
143
|
+
return Number((await q('SELECT COUNT(*) AS n FROM probes WHERE node_id = $1 AND kind = $2 AND at > $3', [nodeId, kind, since]))[0].n);
|
|
144
|
+
},
|
|
118
145
|
async transitionsFor(nodeId) {
|
|
119
146
|
return q('SELECT * FROM transitions WHERE node_id = $1 ORDER BY id ASC', [nodeId]);
|
|
120
147
|
},
|
|
@@ -133,6 +160,36 @@ export async function createPgStore({ connectionString, pool } = {}) {
|
|
|
133
160
|
async getFingerprints(artifact) {
|
|
134
161
|
return q('SELECT prompt, expected_hash FROM fingerprints WHERE artifact = $1', [artifact]);
|
|
135
162
|
},
|
|
163
|
+
async clearFingerprints(artifact) {
|
|
164
|
+
await q('DELETE FROM fingerprints WHERE artifact = $1', [artifact]);
|
|
165
|
+
},
|
|
166
|
+
async getSchedule(nodeId, stage) {
|
|
167
|
+
const row = (await q('SELECT * FROM schedule WHERE node_id = $1 AND stage = $2', [nodeId, stage]))[0];
|
|
168
|
+
return row ? { ...row, ok: row.ok == null ? null : Boolean(Number(row.ok)), failures: Number(row.failures ?? 0) } : null;
|
|
169
|
+
},
|
|
170
|
+
async setSchedule(nodeId, stage, s) {
|
|
171
|
+
await q(`INSERT INTO schedule (node_id, stage, last_at, next_at, ok, revision, digest, pending_digest, failures)
|
|
172
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
|
|
173
|
+
ON CONFLICT (node_id, stage) DO UPDATE SET last_at=excluded.last_at, next_at=excluded.next_at, ok=excluded.ok,
|
|
174
|
+
revision=excluded.revision, digest=excluded.digest, pending_digest=excluded.pending_digest, failures=excluded.failures`,
|
|
175
|
+
[nodeId, stage, s.last_at ?? null, s.next_at ?? null, s.ok == null ? null : (s.ok ? 1 : 0),
|
|
176
|
+
s.revision ?? null, s.digest ?? null, s.pending_digest ?? null, s.failures ?? 0]);
|
|
177
|
+
},
|
|
178
|
+
/** Node ids whose row for `stage` has a next_at at or before an ISO time, soonest first. */
|
|
179
|
+
async dueSchedules(stage, before) {
|
|
180
|
+
return (await q('SELECT node_id FROM schedule WHERE stage = $1 AND next_at IS NOT NULL AND next_at <= $2 ORDER BY next_at',
|
|
181
|
+
[stage, before])).map((r) => r.node_id);
|
|
182
|
+
},
|
|
183
|
+
async vendorNamespaces() {
|
|
184
|
+
return (await q('SELECT vendor, namespaces FROM vendor_namespaces ORDER BY vendor'))
|
|
185
|
+
.map((r) => ({ vendor: r.vendor, namespaces: JSON.parse(r.namespaces) }));
|
|
186
|
+
},
|
|
187
|
+
async setVendorNamespaces(vendor, namespaces) {
|
|
188
|
+
if (namespaces == null) await q('DELETE FROM vendor_namespaces WHERE vendor = $1', [vendor]);
|
|
189
|
+
else await q(`INSERT INTO vendor_namespaces (vendor, namespaces, updated_at) VALUES ($1, $2, $3)
|
|
190
|
+
ON CONFLICT (vendor) DO UPDATE SET namespaces=excluded.namespaces, updated_at=excluded.updated_at`,
|
|
191
|
+
[vendor, JSON.stringify(namespaces), now()]);
|
|
192
|
+
},
|
|
136
193
|
async setObservation(nodeId, offeringId, key, value) {
|
|
137
194
|
await q(`INSERT INTO observations (node_id, offering_id, key, value, at) VALUES ($1, $2, $3, $4, $5)
|
|
138
195
|
ON CONFLICT (node_id, offering_id, key) DO UPDATE SET value=excluded.value, at=excluded.at`,
|
package/src/store.js
CHANGED
|
@@ -38,6 +38,12 @@ export async function createSqliteStore(path = ':memory:') {
|
|
|
38
38
|
CREATE TABLE IF NOT EXISTS probe_keys (
|
|
39
39
|
node_id TEXT PRIMARY KEY, secret TEXT, pending TEXT, updated_at TEXT NOT NULL
|
|
40
40
|
);
|
|
41
|
+
-- Access the registry bought as an ordinary customer of a node's API, recorded by its admin
|
|
42
|
+
-- (ONP-3 §4): probes then carry it instead of the operator's dedicated probe key. Like
|
|
43
|
+
-- probe_keys, its own table so no read of nodes, probes or the export can reach it.
|
|
44
|
+
CREATE TABLE IF NOT EXISTS customer_keys (
|
|
45
|
+
node_id TEXT PRIMARY KEY, secret TEXT NOT NULL, recorded_at TEXT NOT NULL
|
|
46
|
+
);
|
|
41
47
|
CREATE TABLE IF NOT EXISTS probes (
|
|
42
48
|
id INTEGER PRIMARY KEY AUTOINCREMENT, node_id TEXT NOT NULL, offering_id TEXT,
|
|
43
49
|
stage TEXT NOT NULL, kind TEXT NOT NULL, ok INTEGER NOT NULL,
|
|
@@ -62,6 +68,17 @@ export async function createSqliteStore(path = ':memory:') {
|
|
|
62
68
|
node_id TEXT NOT NULL, week TEXT NOT NULL, surface TEXT NOT NULL, n INTEGER NOT NULL,
|
|
63
69
|
PRIMARY KEY (node_id, week, surface)
|
|
64
70
|
);
|
|
71
|
+
-- When each stage last ran for a node and when it runs next (schedule.js). Private: the next
|
|
72
|
+
-- run time must stay unpredictable to the operator, so no API or export reads this table.
|
|
73
|
+
CREATE TABLE IF NOT EXISTS schedule (
|
|
74
|
+
node_id TEXT NOT NULL, stage TEXT NOT NULL, last_at TEXT, next_at TEXT, ok INTEGER,
|
|
75
|
+
revision TEXT, digest TEXT, pending_digest TEXT, failures INTEGER NOT NULL DEFAULT 0,
|
|
76
|
+
PRIMARY KEY (node_id, stage)
|
|
77
|
+
);
|
|
78
|
+
-- Admin entries of the vendor-namespace table (vendors.js): vendor -> JSON list of namespaces.
|
|
79
|
+
CREATE TABLE IF NOT EXISTS vendor_namespaces (
|
|
80
|
+
vendor TEXT PRIMARY KEY, namespaces TEXT NOT NULL, updated_at TEXT NOT NULL
|
|
81
|
+
);
|
|
65
82
|
`);
|
|
66
83
|
// Databases created before the founding mark existed: add the column in place.
|
|
67
84
|
if (!db.prepare('PRAGMA table_info(nodes)').all().some((c) => c.name === 'founding')) {
|
|
@@ -99,6 +116,11 @@ export async function createSqliteStore(path = ':memory:') {
|
|
|
99
116
|
const row = db.prepare('SELECT raw FROM card_revisions WHERE node_id = ? ORDER BY revision DESC LIMIT 1').get(nodeId);
|
|
100
117
|
return row ? JSON.parse(row.raw) : null;
|
|
101
118
|
},
|
|
119
|
+
/** The latest revision's record without the card: {revision, sig_ok, fetched_at}, or null. */
|
|
120
|
+
async latestRevision(nodeId) {
|
|
121
|
+
const row = db.prepare('SELECT revision, sig_ok, fetched_at FROM card_revisions WHERE node_id = ? ORDER BY revision DESC LIMIT 1').get(nodeId);
|
|
122
|
+
return row ? { revision: row.revision, sig_ok: Boolean(row.sig_ok), fetched_at: row.fetched_at } : null;
|
|
123
|
+
},
|
|
102
124
|
async setPendingProbeKey(nodeId, key) {
|
|
103
125
|
db.prepare(`INSERT INTO probe_keys (node_id, secret, pending, updated_at) VALUES (?, NULL, ?, ?)
|
|
104
126
|
ON CONFLICT(node_id) DO UPDATE SET pending=excluded.pending, updated_at=excluded.updated_at`).run(nodeId, key, now());
|
|
@@ -109,6 +131,14 @@ export async function createSqliteStore(path = ':memory:') {
|
|
|
109
131
|
async getProbeKey(nodeId) {
|
|
110
132
|
return db.prepare('SELECT secret FROM probe_keys WHERE node_id = ?').get(nodeId)?.secret ?? null;
|
|
111
133
|
},
|
|
134
|
+
/** Record the customer access the registry bought for a node (a key), or remove it with null. */
|
|
135
|
+
async setCustomerKey(nodeId, key) {
|
|
136
|
+
if (key == null) db.prepare('DELETE FROM customer_keys WHERE node_id = ?').run(nodeId);
|
|
137
|
+
else db.prepare('INSERT OR REPLACE INTO customer_keys (node_id, secret, recorded_at) VALUES (?, ?, ?)').run(nodeId, key, now());
|
|
138
|
+
},
|
|
139
|
+
async getCustomerKey(nodeId) {
|
|
140
|
+
return db.prepare('SELECT secret FROM customer_keys WHERE node_id = ?').get(nodeId)?.secret ?? null;
|
|
141
|
+
},
|
|
112
142
|
async setChallenge(nodeId, token, ttlMs = 72 * 3600 * 1000) {
|
|
113
143
|
db.prepare('INSERT OR REPLACE INTO challenges (node_id, token, expires_at) VALUES (?, ?, ?)')
|
|
114
144
|
.run(nodeId, token, new Date(Date.now() + ttlMs).toISOString());
|
|
@@ -125,6 +155,10 @@ export async function createSqliteStore(path = ':memory:') {
|
|
|
125
155
|
async probesFor(nodeId) {
|
|
126
156
|
return db.prepare('SELECT * FROM probes WHERE node_id = ? ORDER BY id DESC LIMIT 100').all(nodeId);
|
|
127
157
|
},
|
|
158
|
+
/** How many probes of one kind a node got since an ISO time (probesFor keeps only the last 100). */
|
|
159
|
+
async countProbes(nodeId, kind, since) {
|
|
160
|
+
return db.prepare('SELECT COUNT(*) AS n FROM probes WHERE node_id = ? AND kind = ? AND at > ?').get(nodeId, kind, since).n;
|
|
161
|
+
},
|
|
128
162
|
async transitionsFor(nodeId) {
|
|
129
163
|
return db.prepare('SELECT * FROM transitions WHERE node_id = ? ORDER BY id ASC').all(nodeId);
|
|
130
164
|
},
|
|
@@ -142,6 +176,34 @@ export async function createSqliteStore(path = ':memory:') {
|
|
|
142
176
|
async getFingerprints(artifact) {
|
|
143
177
|
return db.prepare('SELECT prompt, expected_hash FROM fingerprints WHERE artifact = ?').all(artifact);
|
|
144
178
|
},
|
|
179
|
+
async clearFingerprints(artifact) {
|
|
180
|
+
db.prepare('DELETE FROM fingerprints WHERE artifact = ?').run(artifact);
|
|
181
|
+
},
|
|
182
|
+
async getSchedule(nodeId, stage) {
|
|
183
|
+
const row = db.prepare('SELECT * FROM schedule WHERE node_id = ? AND stage = ?').get(nodeId, stage);
|
|
184
|
+
return row ? { ...row, ok: row.ok == null ? null : Boolean(row.ok) } : null;
|
|
185
|
+
},
|
|
186
|
+
/** Replace a node's schedule row for one stage: {last_at, next_at, ok, revision, digest, pending_digest, failures}. */
|
|
187
|
+
async setSchedule(nodeId, stage, s) {
|
|
188
|
+
db.prepare(`INSERT OR REPLACE INTO schedule (node_id, stage, last_at, next_at, ok, revision, digest, pending_digest, failures)
|
|
189
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(nodeId, stage, s.last_at ?? null, s.next_at ?? null,
|
|
190
|
+
s.ok == null ? null : (s.ok ? 1 : 0), s.revision ?? null, s.digest ?? null, s.pending_digest ?? null, s.failures ?? 0);
|
|
191
|
+
},
|
|
192
|
+
/** Node ids whose row for `stage` has a next_at at or before an ISO time, soonest first. */
|
|
193
|
+
async dueSchedules(stage, before) {
|
|
194
|
+
return db.prepare('SELECT node_id FROM schedule WHERE stage = ? AND next_at IS NOT NULL AND next_at <= ? ORDER BY next_at')
|
|
195
|
+
.all(stage, before).map((r) => r.node_id);
|
|
196
|
+
},
|
|
197
|
+
/** Admin vendor entries: [{vendor, namespaces}]. */
|
|
198
|
+
async vendorNamespaces() {
|
|
199
|
+
return db.prepare('SELECT vendor, namespaces FROM vendor_namespaces ORDER BY vendor').all()
|
|
200
|
+
.map((r) => ({ vendor: r.vendor, namespaces: JSON.parse(r.namespaces) }));
|
|
201
|
+
},
|
|
202
|
+
/** Set a vendor's namespaces, or remove its admin entry with null. */
|
|
203
|
+
async setVendorNamespaces(vendor, namespaces) {
|
|
204
|
+
if (namespaces == null) db.prepare('DELETE FROM vendor_namespaces WHERE vendor = ?').run(vendor);
|
|
205
|
+
else db.prepare('INSERT OR REPLACE INTO vendor_namespaces (vendor, namespaces, updated_at) VALUES (?, ?, ?)').run(vendor, JSON.stringify(namespaces), now());
|
|
206
|
+
},
|
|
145
207
|
async setObservation(nodeId, offeringId, key, value) {
|
|
146
208
|
db.prepare('INSERT OR REPLACE INTO observations (node_id, offering_id, key, value, at) VALUES (?, ?, ?, ?, ?)')
|
|
147
209
|
.run(nodeId, offeringId, key, JSON.stringify(value), now());
|
package/src/vendors.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// The vendor-namespace rule (ONP-3 §6.3): an offering may claim a proprietary artefact,
|
|
2
|
+
// urn:proprietary:{vendor}:{model}, only from the vendor's own namespace.
|
|
3
|
+
// - A vendor in the registry's table (built-in pins below, overridden by admin entries) is
|
|
4
|
+
// admitted only from a node id inside one of its listed namespaces.
|
|
5
|
+
// - A vendor slug that the registry's imported catalogue listings already use (groq, scaleway, …)
|
|
6
|
+
// but that has no entry is admitted only from the domain those listings are served from: a node
|
|
7
|
+
// whose own domain contains the API host of such an import (router hosts do not count, their
|
|
8
|
+
// listings name model authors). The second label alone ignores the TLD, and whoever holds
|
|
9
|
+
// groq.example must not become "groq"; the provider itself, claiming its listing, can.
|
|
10
|
+
// - Any other vendor slug is admitted only from the node's own namespace: the slug must equal the
|
|
11
|
+
// second label of the node id (io.acme.gpu1 may claim urn:proprietary:acme:*). This is what the
|
|
12
|
+
// Node Kit writes for a model it cannot name publicly.
|
|
13
|
+
// A claim that breaks the rule fails Stage A (`artifact-namespace`), so the node stays unverified.
|
|
14
|
+
import { readFileSync } from 'node:fs';
|
|
15
|
+
|
|
16
|
+
const BUILTIN = JSON.parse(readFileSync(new URL('./data/proprietary-vendors.json', import.meta.url), 'utf8')).vendors;
|
|
17
|
+
|
|
18
|
+
export const VENDOR_SLUG = /^[a-z0-9-]+$/;
|
|
19
|
+
export const NAMESPACE = /^[a-z0-9-]+(\.[a-z0-9-]+)+$/;
|
|
20
|
+
/** model.artifact as the schema has it (ONP-2 §5): hf:, ollama: or urn:proprietary:. */
|
|
21
|
+
export const ARTIFACT = /^(hf:[^/\s]+\/[^/\s]+|ollama:[A-Za-z0-9][A-Za-z0-9._-]*(\/[A-Za-z0-9][A-Za-z0-9._-]*)?(:[A-Za-z0-9._-]+)?|urn:proprietary:[a-z0-9-]+:[A-Za-z0-9._-]+)$/;
|
|
22
|
+
|
|
23
|
+
/** The vendor slug of a proprietary artefact, or null for any other artefact. */
|
|
24
|
+
export const proprietaryVendor = (artifact) => /^urn:proprietary:([a-z0-9-]+):/.exec(String(artifact ?? ''))?.[1] ?? null;
|
|
25
|
+
|
|
26
|
+
/** The node's own vendor label: the id's second label (io.opennodes.helsinki -> opennodes). */
|
|
27
|
+
export const ownLabel = (nodeId) => String(nodeId ?? '').toLowerCase().split('.')[1] ?? null;
|
|
28
|
+
|
|
29
|
+
/** Whether `nodeId` lies inside `namespace` (equal, or a child of it). */
|
|
30
|
+
export const withinNamespace = (nodeId, namespace) => {
|
|
31
|
+
const id = String(nodeId ?? '').toLowerCase();
|
|
32
|
+
return id === namespace || id.startsWith(namespace + '.');
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const SECOND_LEVEL = new Set(['co', 'com', 'org', 'net', 'ac', 'gov', 'edu', 'ne', 'or']);
|
|
36
|
+
/**
|
|
37
|
+
* The registrable domain of a node id: its first two labels reversed (io.acme.gpu1 -> acme.io), or
|
|
38
|
+
* three under a country's second-level suffix (uk.co.acme.gpu1 -> acme.co.uk).
|
|
39
|
+
*/
|
|
40
|
+
export function nodeDomain(nodeId) {
|
|
41
|
+
const labels = String(nodeId ?? '').toLowerCase().split('.');
|
|
42
|
+
const n = labels[0]?.length === 2 && SECOND_LEVEL.has(labels[1]) ? 3 : 2;
|
|
43
|
+
return labels.length >= n ? labels.slice(0, n).reverse().join('.') : null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The effective vendor table: built-in pins, with admin entries (rows from the store:
|
|
48
|
+
* [{vendor, namespaces}]) replacing them, and every other slug of `catalog` (Map vendor slug ->
|
|
49
|
+
* API hosts of the imported listings that use it, routers excluded) bound to those hosts.
|
|
50
|
+
* Returns Map vendor -> {namespaces, source, hosts?}.
|
|
51
|
+
*/
|
|
52
|
+
export function vendorTable(adminRows = [], catalog = new Map()) {
|
|
53
|
+
const table = new Map(Object.entries(BUILTIN).map(([vendor, namespaces]) => [vendor, { namespaces, source: 'built-in' }]));
|
|
54
|
+
for (const row of adminRows) table.set(row.vendor, { namespaces: row.namespaces, source: 'admin' });
|
|
55
|
+
for (const [vendor, hosts] of catalog) if (!table.has(vendor)) table.set(vendor, { namespaces: [], hosts: [...hosts], source: 'catalog' });
|
|
56
|
+
return table;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Whether `nodeId` may claim `artifact`. Non-proprietary artefacts always may. */
|
|
60
|
+
export function vendorClaim(artifact, nodeId, table = vendorTable()) {
|
|
61
|
+
const vendor = proprietaryVendor(artifact);
|
|
62
|
+
if (!vendor) return { ok: true, vendor: null };
|
|
63
|
+
const pinned = table.get(vendor);
|
|
64
|
+
if (pinned?.source === 'catalog') {
|
|
65
|
+
const domain = nodeDomain(nodeId);
|
|
66
|
+
const ok = Boolean(domain) && pinned.hosts.some((h) => h === domain || h.endsWith('.' + domain));
|
|
67
|
+
return { ok, vendor, rule: 'catalog', hosts: pinned.hosts };
|
|
68
|
+
}
|
|
69
|
+
if (pinned) {
|
|
70
|
+
return pinned.namespaces.some((ns) => withinNamespace(nodeId, ns))
|
|
71
|
+
? { ok: true, vendor, rule: 'listed', namespaces: pinned.namespaces }
|
|
72
|
+
: { ok: false, vendor, rule: 'listed', namespaces: pinned.namespaces };
|
|
73
|
+
}
|
|
74
|
+
return ownLabel(nodeId) === vendor
|
|
75
|
+
? { ok: true, vendor, rule: 'own-namespace' }
|
|
76
|
+
: { ok: false, vendor, rule: 'own-namespace' };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** One problem per offering of `card` whose proprietary artefact `nodeId` may not claim. */
|
|
80
|
+
export function artifactClaimProblems(card, table = vendorTable()) {
|
|
81
|
+
const problems = [];
|
|
82
|
+
for (const o of card?.offerings ?? []) {
|
|
83
|
+
const claim = vendorClaim(o.model?.artifact, card.node?.id, table);
|
|
84
|
+
if (claim.ok) continue;
|
|
85
|
+
problems.push(claim.rule === 'listed'
|
|
86
|
+
? `${o.offering_id}: ${o.model.artifact} may be claimed only from ${claim.namespaces.join(' or ')}`
|
|
87
|
+
: claim.rule === 'catalog'
|
|
88
|
+
? `${o.offering_id}: vendor "${claim.vendor}" is known from imported listings${claim.hosts.length ? ` served from ${claim.hosts.slice(0, 3).join(', ')}` : ' reached only through routers'}, so only a node in that domain may claim it (or the registry lists the vendor's namespace)`
|
|
89
|
+
: `${o.offering_id}: ${o.model.artifact} names vendor "${claim.vendor}", but this node's namespace is "${ownLabel(card.node?.id)}"; name open-weight models by a public artefact (hf:, ollama:)`);
|
|
90
|
+
}
|
|
91
|
+
return problems;
|
|
92
|
+
}
|
package/src/web/index.html
CHANGED
|
@@ -315,7 +315,8 @@
|
|
|
315
315
|
<div class="toolbar">
|
|
316
316
|
<input type="text" id="f-q" placeholder="Search models, families, nodes…">
|
|
317
317
|
<span class="switchrow hostedonly" id="f-verified" title="identity-fingerprinted · context-verified · continuously probed"><span class="switch"></span><b style="font-size:0.78rem">Verified only</b></span>
|
|
318
|
-
<span class="switchrow hostedonly" id="f-eea" title="
|
|
318
|
+
<span class="switchrow hostedonly" id="f-eea" title="Operators whose country is in the EU, Iceland, Liechtenstein or Norway, as declared in a registered node's signed card, or inferred by the registry for an unclaimed imported listing of a known European provider. A declaration, not proof of where requests are processed: the registry drops only a server it located outside. Each listing shows what its server check found."><span class="switch"></span><b style="font-size:0.78rem">EU-declared operator</b></span>
|
|
319
|
+
<span class="switchrow hostedonly" id="f-srvcheck" title="Only listings whose API server front the registry located in the operator's declared country or region (behind a CDN: every origin address the signed card declares, each answering like the API). A network tripwire for honest mistakes, not proof: a front that forwards requests elsewhere passes it."><span class="switch"></span><b style="font-size:0.78rem">server front checked</b></span>
|
|
319
320
|
<select id="f-modality">
|
|
320
321
|
<option value="">any modality</option>
|
|
321
322
|
<option>text</option><option>multimodal</option><option>image</option>
|
|
@@ -337,7 +338,8 @@
|
|
|
337
338
|
<div class="toolbar" style="margin-top:0.4rem">
|
|
338
339
|
<select id="adv-preset"><option value="">balanced</option><option value="cheap">cheapest</option><option value="fast">fastest</option><option value="quality">best quality</option><option value="private">privacy-first</option></select>
|
|
339
340
|
<span class="switchrow" id="adv-verified"><span class="switch"></span><b style="font-size:0.78rem">Verified only</b></span>
|
|
340
|
-
<span class="switchrow" id="adv-eea" title="
|
|
341
|
+
<span class="switchrow" id="adv-eea" title="Only operators that declare an EU/EEA country (inferred by the registry for unclaimed imported listings): a declaration, not proof of where requests are processed"><span class="switch"></span><b style="font-size:0.78rem">EU-declared operator</b></span>
|
|
342
|
+
<span class="switchrow" id="adv-srvcheck" title="Only offerings whose server front the registry located in the declared country or region (behind a CDN: every declared origin address). A tripwire, not proof."><span class="switch"></span><b style="font-size:0.78rem">server front checked</b></span>
|
|
341
343
|
<button class="btn" id="adv-go">Recommend</button>
|
|
342
344
|
<span class="prov">Deterministic: same catalog + task + policy → same answer, with the score components shown. The <code>onp mcp</code> / gateway advisors extract features locally and never send your prompt; this box sends the text to this registry.</span>
|
|
343
345
|
</div>
|
|
@@ -652,21 +654,22 @@
|
|
|
652
654
|
<h1>The qualification procedure</h1>
|
|
653
655
|
<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>
|
|
654
656
|
<div class="panel pad" style="max-width:56rem">
|
|
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
|
|
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
|
|
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"
|
|
657
|
+
<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; models list agrees with the card; one blind invocation returns proper usage accounting; a proprietary artefact (<code>urn:proprietary:{vendor}:…</code>) only from that vendor's own namespace, so name open-weight models by their public record (<code>hf:</code>, <code>ollama:</code>). Runs when you verify your registration, on every new card revision, and again at least every 6 hours on the registry's own timer.</span></div>
|
|
658
|
+
<div class="stage"><span class="k">STAGE B</span><span><b>Substance</b> — gate to <span class="chip t-verified">VERIFIED</span>, hours. The registry chooses when it runs; nobody can ask for it. <b>Identity fingerprinting:</b> prompts from a private set, at temperature 0, compared with reference answers the registry captured from a deployment of the same weights it trusts. With no reference for your model's artefact, identity is unverified and the node stays at community. A mismatch marks the node <i>disputed</i> and delists it; registering again does not end a dispute, only a resolution the registry records after review. A 409 to a fingerprint prompt stops the run only when your card's revision really changed (then it runs again within the hour, at most 3 times before a run is judged); with the current revision pinned, a 409 counts as a reply that does not match. <b>Signed card:</b> the verified tier needs a card whose signature verifies against your JWKS. <b>Card-only listings:</b> if you gave a probe key at registration, probes carrying it are easy to pick out, so the node stays at community until the registry has bought access to your API as an ordinary customer; from then on probes use that access, and the next Stage B can verify the node. <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>
|
|
659
|
+
<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, worded like ordinary requests, defeat "benchmark mode". On verified nodes some of them ask an identity prompt, and a reply that is not the reference's brings Stage B within the hour. Sustained liveness failures suspend the listing; blind invocations that keep failing while the node answers its health checks cost it a tier.</span></div>
|
|
658
660
|
<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
661
|
</div>
|
|
660
662
|
<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,
|
|
663
|
+
<p class="sub">Everything this registry sends to your endpoints, as the code runs today: how much, how often and what starts it, so you can size your probe allowance. 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, or, once the registry has bought access to your API as a customer, that access instead; the registry does not pay for calls made with your probe key. Their wording comes from a private set of ordinary requests, the same kind your customers send; it is not published.</p>
|
|
662
664
|
<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>
|
|
664
|
-
<div class="stage"><span class="k">STAGE B</span><span><b>When:</b>
|
|
665
|
-
<br>· <b>Fingerprint battery:</b> 3
|
|
666
|
-
<br>· <b>Calibration:</b> 1 call with about 4,000 characters of
|
|
665
|
+
<div class="stage"><span class="k">STAGE A</span><span><b>When:</b> when you verify your registration, on each <code>PUT /v0/nodes/{id}/ping</code>, on every new card revision, and at least every 6 hours (each gap is random, 4.5 to 6 hours), each time after a fetch of your card.<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 request, at most 32 output tokens): about 4 of each a day.</span></div>
|
|
666
|
+
<div class="stage"><span class="k">STAGE B</span><span><b>When:</b> on the registry's schedule, never on request: between 1 and 24 hours after your node reaches community; within 1 hour of a change to a chat offering's model, serving or hardware block, or to your API endpoint; within 1 hour of a confirmed identity mismatch in a blind call (below), at most once a day; within 1 hour after a run stopped because your card's revision changed; again after 7 days when a run did not pass; and after a pass at a random time from 1 day on, and at most every 91 days. The registry admin can also run it.<br><b>Sends, per chat offering</b> (up to 20 chat completions, plus one repeat for each identity reply that does not match):
|
|
667
|
+
<br>· <b>Fingerprint battery:</b> 3 prompts drawn at random from the 8 reference prompts the registry holds for your model's artefact, at temperature 0, at most 64 output tokens each. With no reference for the artefact nothing is asked, and the offering cannot be verified.
|
|
668
|
+
<br>· <b>Calibration:</b> 1 call with about 4,000 characters of text, at most 4 output tokens, to measure your tokenizer.
|
|
667
669
|
<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
670
|
<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 minutes on average (each gap is random, 2.5 to 7.5 minutes), and 1 blind chat completion per node per hour on average (30 to 90 minutes apart, to a randomly chosen chat offering, at most
|
|
671
|
+
<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 minutes on average (each gap is random, 2.5 to 7.5 minutes), and 1 blind chat completion per node per hour on average (30 to 90 minutes apart, to a randomly chosen chat offering, at temperature 0 and at most 64 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.<br><b>Identity:</b> on verified and attested nodes, about 1 in 4 of those calls asks one of the identity prompts the registry holds references for, instead of an ordinary request and in the same form. A reply that does not match is asked once more; a second miss makes Stage B due within the hour, at most once a day. It never changes your tier by itself.<br><b>409 answers:</b> excused only when your card's revision really changed, at most 3 a day; the registry then fetches the new card, asks once more at once, and sends one more blind chat completion against the new revision at a random time within the hour. Any other 409 counts as a failed call. When 3 blind calls in a row fail while your health checks pass, the node drops one tier (verified to community, community to unverified); the scheduled stages bring it back.</span></div>
|
|
672
|
+
<div class="stage"><span class="k">REFERENCES</span><span><b>When:</b> when the registry admin captures identity references for a model, from a deployment of the same weights the registry trusts.<br><b>Sends:</b> 8 chat completions at temperature 0, at most 64 output tokens each.</span></div>
|
|
670
673
|
<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>
|
|
671
674
|
</div>
|
|
672
675
|
<h2>Principles</h2>
|
|
@@ -874,6 +877,7 @@ document.querySelectorAll('.toggle').forEach((b) => b.addEventListener('click',
|
|
|
874
877
|
}));
|
|
875
878
|
$('#f-verified').addEventListener('click', () => { $('#f-verified').classList.toggle('on'); search(); });
|
|
876
879
|
$('#f-eea').addEventListener('click', () => { $('#f-eea').classList.toggle('on'); search(); });
|
|
880
|
+
$('#f-srvcheck').addEventListener('click', () => { $('#f-srvcheck').classList.toggle('on'); search(); });
|
|
877
881
|
let debounce;
|
|
878
882
|
for (const id of ['f-q', 'f-price']) $('#' + id).addEventListener('input', () => { clearTimeout(debounce); debounce = setTimeout(search, 250); });
|
|
879
883
|
for (const id of ['f-modality', 'f-sort', 'f-mem']) $('#' + id).addEventListener('change', search);
|
|
@@ -982,6 +986,7 @@ async function search() {
|
|
|
982
986
|
if (listKind === 'hosted') { // trust, location, price and capabilities describe a server
|
|
983
987
|
if ($('#f-verified').classList.contains('on')) p.set('tier', 'verified');
|
|
984
988
|
if ($('#f-eea').classList.contains('on')) p.set('jurisdiction', 'eea');
|
|
989
|
+
if ($('#f-srvcheck').classList.contains('on')) p.set('server_check', 'passed');
|
|
985
990
|
if ($('#f-price').value) p.set('max_input_price', $('#f-price').value);
|
|
986
991
|
if (sup.size) p.set('supports', [...sup].join(','));
|
|
987
992
|
} else {
|
|
@@ -1011,6 +1016,7 @@ async function search() {
|
|
|
1011
1016
|
/* ---------- advisor (ONP-3 §5b) ---------- */
|
|
1012
1017
|
$('#adv-verified').addEventListener('click', () => $('#adv-verified').classList.toggle('on'));
|
|
1013
1018
|
$('#adv-eea').addEventListener('click', () => $('#adv-eea').classList.toggle('on'));
|
|
1019
|
+
$('#adv-srvcheck').addEventListener('click', () => $('#adv-srvcheck').classList.toggle('on'));
|
|
1014
1020
|
$('#adv-go').addEventListener('click', runAdvisor);
|
|
1015
1021
|
$('#adv-task').addEventListener('keydown', (e) => { if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) runAdvisor(); });
|
|
1016
1022
|
async function runAdvisor() {
|
|
@@ -1020,6 +1026,7 @@ async function runAdvisor() {
|
|
|
1020
1026
|
if ($('#adv-preset').value) policy.preset = $('#adv-preset').value;
|
|
1021
1027
|
if ($('#adv-verified').classList.contains('on')) policy.min_tier = 'verified';
|
|
1022
1028
|
if ($('#adv-eea').classList.contains('on')) policy.jurisdiction = 'eea';
|
|
1029
|
+
if ($('#adv-srvcheck').classList.contains('on')) policy.server_check = 'passed';
|
|
1023
1030
|
$('#adv-out').innerHTML = '<p class="sub">ranking…</p>';
|
|
1024
1031
|
try {
|
|
1025
1032
|
const r = await api('/v0/recommend', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ task, policy }) });
|
|
@@ -1094,6 +1101,8 @@ function renderItem(o) {
|
|
|
1094
1101
|
<span><b style="color:var(--ink)">${priceStr(o.pricing, o.node_id)}</b></span>
|
|
1095
1102
|
${o.serving?.context_window ? `<span>ctx ${fmtInt(o.serving.context_window)}${o.serving.context_capped_from ? ' <span class="micro m-warn">▼</span>' : ''}</span>` : (o.serving?.context_capped_from ? '<span>ctx <span class="micro m-warn">unverified</span></span>' : '')}
|
|
1096
1103
|
${obs.ttft_ms?.p50 != null ? `<span>${obs.ttft_ms.p50}ms <span class="micro m-measured">●</span></span>` : ''}
|
|
1104
|
+
${o.jurisdiction?.country && ($('#f-eea').classList.contains('on') || $('#f-srvcheck').classList.contains('on'))
|
|
1105
|
+
? `<span title="${esc(o.jurisdiction.evidence || '')}">${esc(o.jurisdiction.country)} ${o.jurisdiction.basis === 'inferred' ? 'inferred' : 'declared'} · ${esc(SERVER_CHECK_SHORT[o.jurisdiction.server_check] || 'unchecked')}</span>` : ''}
|
|
1097
1106
|
<span class="mono">${fmt(o.rank)}</span>
|
|
1098
1107
|
</div>
|
|
1099
1108
|
</div>`;
|
|
@@ -1125,6 +1134,7 @@ window.toggleRow = async function (el, idx) {
|
|
|
1125
1134
|
${o.serving?.max_output_tokens ? `<dt>max output</dt><dd class="num">${fmtInt(o.serving.max_output_tokens)}</dd>` : ''}
|
|
1126
1135
|
${hwStr(o) ? `<dt>hardware</dt><dd>${hwStr(o)}</dd>` : ''}
|
|
1127
1136
|
<dt>schemes</dt><dd>${esc((o.pricing.schemes || []).join(', '))}</dd>
|
|
1137
|
+
${o.local ? '' : `<dt>operator</dt><dd>${jurisdictionLine(o)}</dd><dt>data policy</dt><dd>${dataPolicyLine(o)}</dd>`}
|
|
1128
1138
|
${o.local ? '' : `<dt>served from</dt><dd>${o.locations?.length ? locStr(o.locations) : '<span style="color:var(--faint)">location not declared</span>'}</dd>`}
|
|
1129
1139
|
${o.model.lineage_origins ? `<dt>lineage</dt><dd>${esc(o.model.lineage_origins.join(', '))} <span class="prov" style="display:inline">· declared</span></dd>` : ''}
|
|
1130
1140
|
${o.local ? `<dt>run locally</dt><dd><code style="background:var(--panel-2); padding:0.1em 0.4em; border-radius:3px" class="mono">${esc(o.local.run)}</code>${o.local.pulls ? ` <span class="prov" style="display:inline">· ${esc(o.local.pulls)} pulls</span>` : ''}${o.local.sizes ? `<br><span class="prov" style="display:inline" title="Memory to run it at Ollama's default 4-bit quantization: weights plus runtime and a default context; an estimate">memory needed: ${o.local.sizes.map((t) => `${esc(t)} ~${memGb(t) ?? '?'} GB`).join(' · ')}</span>` : ''}</dd>` : ''}
|
|
@@ -1338,6 +1348,8 @@ async function loadModel(artifact) {
|
|
|
1338
1348
|
<td><div style="display:flex; flex-direction:column; gap:0.2rem">
|
|
1339
1349
|
<a href="#/node/${encodeURIComponent(o.node_id)}" style="font-weight:600">${esc(o.node_id)}</a>
|
|
1340
1350
|
<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>
|
|
1351
|
+
<span style="font-size:0.7rem; color:var(--muted)">${jurisdictionLine(o)}</span>
|
|
1352
|
+
<span style="font-size:0.7rem; color:var(--muted)">${dataPolicyLine(o)}</span>
|
|
1341
1353
|
</div></td>
|
|
1342
1354
|
<td><b>${priceStr(o.pricing, o.node_id)}</b></td>
|
|
1343
1355
|
<td>${hwStr(o) || '<span style="color:var(--faint)" title="Vendor has not disclosed the hardware behind this offering">undisclosed</span>'}</td>
|
|
@@ -2574,7 +2586,7 @@ onp-node card --out well-known
|
|
|
2574
2586
|
ONP_PROBE_KEY=<a key with a small quota> onp-node register https://registry.opennodes.io \\
|
|
2575
2587
|
--card-url https://${esc(host)}/.well-known/open-node.json --probe-key-env ONP_PROBE_KEY
|
|
2576
2588
|
# publish the printed challenge at /.well-known/onp-challenge/<token> or as a DNS TXT record</code></pre>
|
|
2577
|
-
<p>The checks then run on their own: model identity, context window, capacity, server location. Passing them earns the
|
|
2589
|
+
<p>The checks then run on their own: model identity, context window, capacity, server location. Passing them earns the community tier, and your listing replaces this import. The verified tier also needs the registry to hold access to your API bought as an ordinary customer: probes that carry the dedicated probe key are easy to spot, so they never decide it. The probe key is sent only to your own API and never appears in any registry response.</p>
|
|
2578
2590
|
</details>` : '';
|
|
2579
2591
|
return `<div class="panel pad" style="max-width:56rem; margin:0.4rem 0 0.8rem; border-left:3px solid var(--accent)">
|
|
2580
2592
|
<p style="margin:0 0 0.35rem; font-weight:600">Do you run ${esc(name)}?</p>
|
|
@@ -2588,23 +2600,53 @@ ONP_PROBE_KEY=<a key with a small quota> onp-node register https://registr
|
|
|
2588
2600
|
</div>`;
|
|
2589
2601
|
}
|
|
2590
2602
|
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2603
|
+
/* Jurisdiction evidence (ONP-3 §6.4, search jurisdiction.server_check): the operator's country is a
|
|
2604
|
+
declaration (inferred by the registry for unclaimed imports); the server check is a network tripwire. */
|
|
2605
|
+
const SERVER_CHECK_WORDS = {
|
|
2606
|
+
passed: '✓ server front checked', passed_origin: '✓ behind a CDN, declared origin checked', cdn: 'behind a CDN, not located',
|
|
2607
|
+
mismatch: '⚠ server front located elsewhere', inconsistent: '⚠ server check inconsistent', unchecked: 'server front not checked',
|
|
2608
|
+
};
|
|
2609
|
+
const SERVER_CHECK_SHORT = { passed: 'front ✓', passed_origin: 'origin ✓', cdn: 'CDN', mismatch: 'front ⚠', inconsistent: 'check ⚠', unchecked: 'unchecked' };
|
|
2610
|
+
function jurisdictionLine(o) {
|
|
2611
|
+
const j = o.jurisdiction || {};
|
|
2612
|
+
if (!j.country) return '<span style="color:var(--faint)">operator country not declared</span>';
|
|
2613
|
+
return `${esc(j.country)} operator <span class="micro m-claimed">${j.basis === 'inferred' ? 'INFERRED' : 'DECLARED'}</span> · `
|
|
2614
|
+
+ `<span title="${esc(j.evidence || '')}: the registry's network check of where the API answers, evidence, not proof">${esc(SERVER_CHECK_WORDS[j.server_check] || SERVER_CHECK_WORDS.unchecked)}</span>`;
|
|
2615
|
+
}
|
|
2616
|
+
/** The data policy is the operator's own statement (ONP-2 §5): probing cannot verify retention or training. */
|
|
2617
|
+
function dataPolicyLine(o) {
|
|
2618
|
+
const dp = o.data_policy;
|
|
2619
|
+
if (!dp) return '<span style="color:var(--faint)">no data policy declared</span>';
|
|
2620
|
+
const ret = { none: 'no retention', ephemeral: `kept up to ${esc(dp.retention_max_seconds ?? '?')} s`, logged: 'may be logged' }[dp.retention] || `retention ${esc(dp.retention ?? 'unstated')}`;
|
|
2621
|
+
const train = dp.training_on_inputs === false ? 'no training on inputs' : dp.training_on_inputs === true ? 'may train on inputs' : 'training unstated';
|
|
2622
|
+
const link = typeof dp.source === 'string' && /^https?:\/\//i.test(dp.source)
|
|
2623
|
+
? ` · <a href="${esc(dp.source)}" target="_blank" rel="noopener nofollow">published policy${dp.checked ? ' (' + esc(dp.checked) + ')' : ''} ↗</a>` : ' · no policy link';
|
|
2624
|
+
return `${ret} · ${train} <span class="micro m-claimed">DECLARED</span>${link}`;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
/** Server-location check (registry location.js) in plain words; `check` is the node's server_check for its current card. */
|
|
2628
|
+
function locationRow(loc, imported, check) {
|
|
2595
2629
|
const claim = imported ? 'inferred for this unclaimed listing' : 'declared by the operator';
|
|
2630
|
+
if (!loc) return `<tr><td style="color:var(--muted)" class="mono">server</td><td style="font-size:0.8rem">not checked yet <span style="color:var(--muted)">· the operator's country is ${claim}, not verified</span></td></tr>`;
|
|
2631
|
+
const srv = loc.server || {};
|
|
2596
2632
|
const words = {
|
|
2597
2633
|
match: `✓ server in ${esc(srv.country)}, matching the country ${imported ? 'inferred for this unclaimed listing' : 'the operator declared'}`,
|
|
2598
2634
|
same_region: `✓ server in ${esc(srv.country)} (EEA); country ${claim}: ${esc(loc.declared)}`,
|
|
2599
2635
|
mismatch: `<b style="color:var(--bad, #b42318)">⚠ server in ${esc(srv.country)}; country ${claim}: ${esc(loc.declared)}</b>`,
|
|
2600
|
-
cdn: `behind a CDN (${esc(srv.network || 'anycast')}) — location not determinable from the network`,
|
|
2636
|
+
cdn: `behind a CDN (${esc(srv.network || 'anycast')}) — location not determinable from the network${loc.origin ? '' : `<br><span style="color:var(--muted)">${imported ? 'Once the operator claims this listing, its signed card' : 'A signed card'} can declare the origin addresses behind the CDN (<code>endpoints.origin_addresses</code>, ONP-2 §4) for the registry to check instead.</span>`}`,
|
|
2601
2637
|
inconsistent: `<b style="color:var(--bad, #b42318)">⚠ geolocation (${esc(srv.country || '?')}) contradicted by measured latency</b>`,
|
|
2602
2638
|
unknown: `not determined${loc.reason ? ' — ' + esc(loc.reason) : ''}`,
|
|
2603
2639
|
};
|
|
2604
2640
|
const lat = loc.latency || {};
|
|
2605
2641
|
const sites = (lat.sites || []).map((v) => `${esc(v.site)} ${v.rtt_ms} ms`).join(', ');
|
|
2606
2642
|
const latWord = { consistent: 'consistent', too_slow: 'slower than expected from every site (soft warning)', too_fast: 'faster than physics allows for the geolocated point', unknown: 'not measured' }[lat.verdict || 'unknown'];
|
|
2607
|
-
|
|
2643
|
+
// Behind a CDN: the origin addresses the operator declares in its card, each checked in place of the front.
|
|
2644
|
+
const originWords = { match: '✓ in the declared country', same_region: '✓ in the EEA with the declared country', mismatch: '⚠ located outside', cdn: 'on a CDN network itself', inconsistent: '⚠ geolocation contradicted by latency', unknown: 'not determined' };
|
|
2645
|
+
const origins = loc.origin ? `<br>declared origin: ${loc.origin.reason ? esc(loc.origin.reason) : (loc.origin.addresses || []).map((a) =>
|
|
2646
|
+
`<span class="mono" style="font-size:0.74rem">${esc(a.address)}</span> ${esc(originWords[a.verdict] || a.verdict)}${a.server_country ? ` (${esc(a.server_country)})` : ''}${a.reason ? ' — ' + esc(a.reason) : ''}`).join('; ')}` : '';
|
|
2647
|
+
const stale = check === 'unchecked' && ['match', 'same_region', 'cdn', 'mismatch', 'inconsistent'].includes(loc.verdict)
|
|
2648
|
+
? `<br><b>This check was made for another API host, declared country or origin list; it counts again after the next check.</b>` : '';
|
|
2649
|
+
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) : ''}` : ''}${origins}${stale}<br><span style="color:var(--muted)">latency ${latWord}${sites ? ' (' + sites + ')' : ''} · checked ${esc((loc.checked_at || '').slice(0, 10))} · evidence of where the API's server front answers, not proof of where requests are processed</span></td></tr>`;
|
|
2608
2650
|
}
|
|
2609
2651
|
|
|
2610
2652
|
/** Request counts (GET /v0/nodes/{id} request_counts): how often clients were shown this node. */
|
|
@@ -2654,14 +2696,14 @@ async function loadNode(id) {
|
|
|
2654
2696
|
${stat(tierChip(tier), 'TRUST TIER')}
|
|
2655
2697
|
${markChips(n) ? stat(`<span style="display:inline-flex; gap:0.3rem">${markChips(n)}</span>`, 'REGISTRY MARK — label, not a rank input') : ''}
|
|
2656
2698
|
${stat(String(offers.length), 'OFFERINGS')}
|
|
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') : ''}
|
|
2699
|
+
${card.node?.operator?.name ? stat(esc(card.node.operator.name) + (card.node.operator.country ? ' (' + esc(card.node.operator.country) + (n.source === 'import' ? ' · inferred by the registry' : ' · declared') + ')' : ''), 'OPERATOR — COUNTRY NOT VERIFIED') : ''}
|
|
2658
2700
|
${(card.node?.regions || []).length ? stat(esc(card.node.regions.join(', ')), 'REGIONS') : ''}
|
|
2659
2701
|
${n.source === 'import' ? stat('<span class="chip imp">IMPORTED</span>', 'SOURCE — unclaimed by operator') : ''}
|
|
2660
2702
|
</div>
|
|
2661
2703
|
<div class="panel pad" style="max-width:56rem; margin-top:0.6rem"><table class="grid">
|
|
2662
2704
|
<tr><td style="color:var(--muted); width:8rem" class="mono">endpoint</td><td class="mono" style="font-size:0.74rem">${card.endpoints?.openai ? esc(card.endpoints.openai) : '— <span style="font-family:inherit; color:var(--muted)">listing only: no known API endpoint, not callable from OpenNodes</span>'}</td></tr>
|
|
2663
2705
|
${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>` : ''}
|
|
2664
|
-
${locationRow(n.location, n.source === 'import')}
|
|
2706
|
+
${locationRow(n.location, n.source === 'import', n.server_check)}
|
|
2665
2707
|
${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
2708
|
${returnedRow(n.request_counts, n.id)}
|
|
2667
2709
|
${testedRow(n, offers.length, untested.size)}
|
|
@@ -2704,15 +2746,7 @@ async function verify() {
|
|
|
2704
2746
|
<h2>Stage A ${v.stage_a?.ok ? '<span class="ok">passed</span>' : '<span class="fail">failed</span>'}</h2>
|
|
2705
2747
|
<p style="font-size:0.84rem">State: ${tierChip(v.state)} · signature ${v.signature_verified ? '<span class="ok">verified</span>' : '<span class="warncol">not verified</span>'}</p>
|
|
2706
2748
|
<div class="panel pad">${rows}</div>
|
|
2707
|
-
${v.state === 'community' ? `<p style="font-size:0.84rem; margin-top:0.8rem">Your node is listed. <a href="#/node/${encodeURIComponent(v.node_id)}">View it</a
|
|
2708
|
-
const admitBtn = $('#btn-admit');
|
|
2709
|
-
if (admitBtn) admitBtn.addEventListener('click', async () => {
|
|
2710
|
-
admitBtn.disabled = true; admitBtn.textContent = 'Running (identity, context, capacity)…';
|
|
2711
|
-
try {
|
|
2712
|
-
const a = await api('/v0/nodes/' + encodeURIComponent(v.node_id) + '/admit', { method: 'POST' });
|
|
2713
|
-
admitBtn.outerHTML = tierChip(a.state) + ` <a href="#/node/${encodeURIComponent(v.node_id)}">details</a>`;
|
|
2714
|
-
} catch (e) { admitBtn.outerHTML = '<span class="err">' + esc(e.message) + '</span>'; }
|
|
2715
|
-
});
|
|
2749
|
+
${v.state === 'community' ? `<p style="font-size:0.84rem; margin-top:0.8rem">Your node is listed. <a href="#/node/${encodeURIComponent(v.node_id)}">View it</a>. <b>Stage B</b> (identity, context, capacity) runs on the registry's schedule, within a day; its result appears in your node's history. It needs identity references for your model's artefact and a signed card: see <a href="#/qualification">the qualification procedure</a>.</p>` : ''}`;
|
|
2716
2750
|
} catch (e) { out.insertAdjacentHTML('beforeend', '<p class="err">' + esc(e.message) + '</p>'); }
|
|
2717
2751
|
}
|
|
2718
2752
|
|