@opennodes/registry 0.1.55 → 0.1.56
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 +3 -3
- package/package.json +1 -1
- package/src/schedule.js +27 -6
- package/src/server.js +9 -4
- package/src/stageb.js +17 -5
- package/src/stagec.js +54 -2
- package/src/web/index.html +1 -1
package/README.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
The OpenNodes Protocol (ONP) reference registry — an open, federatable discovery service for AI inference nodes.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npx @opennodes/registry@0.1.
|
|
7
|
-
ONP_DB=./registry.db npx @opennodes/registry@0.1.
|
|
8
|
-
ONP_DB=postgres://user:pass@host/db npx @opennodes/registry@0.1.
|
|
6
|
+
npx @opennodes/registry@0.1.56 # web app + API on http://127.0.0.1:4300
|
|
7
|
+
ONP_DB=./registry.db npx @opennodes/registry@0.1.56 # persistent SQLite + persistent signing key
|
|
8
|
+
ONP_DB=postgres://user:pass@host/db npx @opennodes/registry@0.1.56
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
What it does:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opennodes/registry",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.56",
|
|
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",
|
package/src/schedule.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// Re-verification on the registry's own timetable (ONP-3 §4a):
|
|
2
2
|
// - Stage A at least every 6 h and on every new card revision, for registered nodes from `indexed` up;
|
|
3
|
-
// - Stage B for a node that reaches `community`, at a random time within a day; again
|
|
4
|
-
// change to a tested offering's model, serving or
|
|
5
|
-
// a
|
|
3
|
+
// - Stage B for a node that reaches `community`, at a random time within a day; again at a random time
|
|
4
|
+
// within 3 days of any change to a tested offering's model, serving, hardware or binding block (or a
|
|
5
|
+
// new tested offering), within the hour after a confirmed mismatch in a blind identity check
|
|
6
|
+
// (stagec.js), and on a random timer, 1 to 91 days after a pass, otherwise. That timer is its own
|
|
7
|
+
// row (TIMER) and only a run it set off draws it again: a run set off by a change does not, so an
|
|
8
|
+
// operator who changes the card every day cannot keep pushing the random run away.
|
|
6
9
|
// The operator does not choose when Stage B runs, and no API says when it will: the next run time
|
|
7
10
|
// lives only in the private `schedule` table. The server supplies the stage runs (and their effect
|
|
8
11
|
// on the tier); this module only decides when they are due.
|
|
@@ -21,7 +24,9 @@ export const SCHEDULE_DEFAULTS = Object.freeze({
|
|
|
21
24
|
stageBIntervalMs: 91 * DAY,
|
|
22
25
|
stageBRetryMs: 7 * DAY, // after a Stage B that did not pass (and was not a dispute); 85-100% of it
|
|
23
26
|
stageBFirstMs: [HOUR, DAY], // a node that reaches community: first Stage B in this window
|
|
24
|
-
|
|
27
|
+
// After a change to a tested offering (or a new one): anywhere in three days, so that an operator who
|
|
28
|
+
// changes the card cannot know the hour of the run that follows (ONP-3 §4a, re-verification).
|
|
29
|
+
stageBChangeMs: [0, 72 * HOUR],
|
|
25
30
|
// After a confirmed mismatch in a blind identity check (stagec.js). The upper end leaves room for
|
|
26
31
|
// the tick (at most 1.5 x tickMs late), so the run starts within the hour.
|
|
27
32
|
stageBIdentityMs: [0, 50 * 60_000],
|
|
@@ -34,6 +39,12 @@ export const SCHEDULE_DEFAULTS = Object.freeze({
|
|
|
34
39
|
/** States whose nodes get Stage A on schedule, and the subset that gets Stage B. */
|
|
35
40
|
export const STAGE_A_STATES = ['indexed', 'community', 'verified', 'attested'];
|
|
36
41
|
export const STAGE_B_STATES = ['community', 'verified', 'attested'];
|
|
42
|
+
/**
|
|
43
|
+
* The private schedule row holding a node's random Stage B timer (drawn after a pass). Kept apart
|
|
44
|
+
* from row 'B', whose next_at is the soonest of everything due, so that runs set off by a change or
|
|
45
|
+
* a light-check mismatch never redraw it.
|
|
46
|
+
*/
|
|
47
|
+
export const TIMER = 'B:timer';
|
|
37
48
|
|
|
38
49
|
const iso = (ms) => new Date(ms).toISOString();
|
|
39
50
|
const sha256 = (s) => createHash('sha256').update(s).digest('hex');
|
|
@@ -105,8 +116,17 @@ export function makePlanner(store, options = {}) {
|
|
|
105
116
|
await store.setSchedule(nodeId, 'B', { ...prev, next_at: iso(now + between(o.staleRetryMs, random)), failures: (prev.failures ?? 0) + 1 });
|
|
106
117
|
return;
|
|
107
118
|
}
|
|
119
|
+
// The random timer is drawn again only when it is due or missing: a run that a change or a
|
|
120
|
+
// light-check mismatch set off leaves it where it was, so it still fires (ONP-3 §4a).
|
|
121
|
+
let timer = await store.getSchedule(nodeId, TIMER);
|
|
122
|
+
const timerAt = timer?.next_at ? Date.parse(timer.next_at) : null;
|
|
123
|
+
if (result.ok && !result.identityFailed && (timerAt === null || timerAt <= now)) {
|
|
124
|
+
timer = { last_at: iso(now), next_at: iso(now + between([o.stageBMinGapMs, o.stageBIntervalMs], random)) };
|
|
125
|
+
await store.setSchedule(nodeId, TIMER, timer);
|
|
126
|
+
}
|
|
127
|
+
const pending = timer?.next_at && Date.parse(timer.next_at) > now ? Date.parse(timer.next_at) : Infinity;
|
|
108
128
|
const next = result.identityFailed ? null
|
|
109
|
-
: iso(
|
|
129
|
+
: iso(Math.min(pending, result.ok ? Infinity : now + o.stageBRetryMs * between([0.85, 1], random)));
|
|
110
130
|
await store.setSchedule(nodeId, 'B', {
|
|
111
131
|
last_at: iso(now), next_at: next, ok: result.ok, revision: card?.revision ?? null,
|
|
112
132
|
digest: servingDigest(card), pending_digest: null, failures: result.ok ? 0 : (prev.failures ?? 0) + 1,
|
|
@@ -157,7 +177,8 @@ export function startScheduler(store, planner, { stageA, stageB, random = Math.r
|
|
|
157
177
|
}
|
|
158
178
|
const digest = servingDigest(fresh);
|
|
159
179
|
if (b.digest && digest !== b.digest && digest !== b.pending_digest) {
|
|
160
|
-
// A tested offering's model, serving or
|
|
180
|
+
// A tested offering's model, serving, hardware or binding changed since the last Stage B, or a
|
|
181
|
+
// tested offering is new: run it at a random time in the change window.
|
|
161
182
|
nextAt = Math.min(nextAt, now + between(o.stageBChangeMs, random));
|
|
162
183
|
b = { ...b, pending_digest: digest, next_at: iso(nextAt) };
|
|
163
184
|
await store.setSchedule(node.id, 'B', b);
|
package/src/server.js
CHANGED
|
@@ -294,11 +294,13 @@ export async function startRegistry({
|
|
|
294
294
|
* card, capacity) keeps `community` or demotes `verified` to `community`. Returns null when a
|
|
295
295
|
* run is already in progress for the node.
|
|
296
296
|
*/
|
|
297
|
-
async function stageBFor(nodeId) {
|
|
297
|
+
async function stageBFor(nodeId, { refresh = false } = {}) {
|
|
298
298
|
if (stageBRunning.has(nodeId)) return null;
|
|
299
299
|
stageBRunning.add(nodeId);
|
|
300
300
|
try {
|
|
301
|
-
|
|
301
|
+
// Scheduled runs go out on the card already held: a card fetch just before the battery would
|
|
302
|
+
// tell the operator that Stage B is starting (ONP-3 §4a.9). A 409 still re-fetches (below).
|
|
303
|
+
if (refresh) await refreshCard(nodeId);
|
|
302
304
|
const card = await store.latestCard(nodeId);
|
|
303
305
|
const revision = await store.latestRevision(nodeId);
|
|
304
306
|
// Decided before anything is sent: what counts is the key this run's probes carry.
|
|
@@ -442,7 +444,7 @@ export async function startRegistry({
|
|
|
442
444
|
if (!LISTED.includes(node.state)) {
|
|
443
445
|
return problem(res, 409, 'wrong-state', `Stage B requires community tier, node is ${node.state}`);
|
|
444
446
|
}
|
|
445
|
-
const stageB = await stageBFor(params.id);
|
|
447
|
+
const stageB = await stageBFor(params.id, { refresh: true }); // the admin's request: the latest card
|
|
446
448
|
if (!stageB) return problem(res, 409, 'stage-b-running', `Stage B is already running for ${params.id}`);
|
|
447
449
|
if (stageB.stale) {
|
|
448
450
|
return problem(res, 409, 'stale-card', 'the node changed its card revision during the battery; retry');
|
|
@@ -896,7 +898,9 @@ export async function startRegistry({
|
|
|
896
898
|
// without one (ONP_SCHEDULE=0) Stage B runs only on admin request, so the mismatch is only recorded.
|
|
897
899
|
const requestStageB = schedule ? (nodeId, card) => planner.stageBSoon(nodeId, card) : null;
|
|
898
900
|
const stageCHandle = stageC ? startStageC(store, { safeFetch, fetchFor: authFetch, refreshCard, requestStageB, corpus, ...stageC }) : null;
|
|
899
|
-
|
|
901
|
+
// Scheduled runs use the card already held when Stage C re-fetches cards on its own timer
|
|
902
|
+
// (stagec.js cardSweep), so no card fetch announces them; without Stage C, Stage A re-fetches.
|
|
903
|
+
const scheduleHandle = schedule ? startScheduler(store, planner, { stageA: (id) => stageAFor(id, { refresh: !stageCHandle }), stageB: (id) => stageBFor(id) }) : null;
|
|
900
904
|
const reimportHandle = reimport ? startReimport(store, { safeFetch, ...reimport }) : null;
|
|
901
905
|
const locationHandle = location ? startLocationSweep() : null;
|
|
902
906
|
const actualPort = await listen(app, port, host);
|
|
@@ -909,6 +913,7 @@ export async function startRegistry({
|
|
|
909
913
|
scheduleTick: scheduleHandle ? () => scheduleHandle.tick() : null,
|
|
910
914
|
/** Run one Stage C blind sweep, or one look for due follow-ups, now (tests); null when Stage C is off. */
|
|
911
915
|
blindSweep: stageCHandle ? () => stageCHandle.blindSweep() : null,
|
|
916
|
+
cardSweep: stageCHandle ? () => stageCHandle.cardSweep() : null,
|
|
912
917
|
followUpTick: stageCHandle ? () => stageCHandle.followUpTick() : null,
|
|
913
918
|
close: async () => {
|
|
914
919
|
stageCHandle?.stop();
|
package/src/stageb.js
CHANGED
|
@@ -89,7 +89,10 @@ export const STAGE_B_409 = 'identity-409';
|
|
|
89
89
|
* (the card the run holds is stale now, so even an honest node refuses what follows).
|
|
90
90
|
*/
|
|
91
91
|
function makeOn409(store, nodeId, card, { revisionMoved, maxExcused409 }) {
|
|
92
|
-
|
|
92
|
+
// `status`: the reply that sent the registry to the card. Since rev. 14 scheduled runs go out on
|
|
93
|
+
// the card already held, so a 404 for a model the node has just dropped gets the same rule as a
|
|
94
|
+
// 409: re-fetched after the reply, excused only if the revision really moved, within the bound.
|
|
95
|
+
return async (offering, status = 409) => {
|
|
93
96
|
const fresh = revisionMoved ? await revisionMoved() : null;
|
|
94
97
|
if (!fresh) return { kind: 'refused' };
|
|
95
98
|
const since = (await store.getSchedule(nodeId, 'B'))?.last_at ?? '';
|
|
@@ -98,7 +101,7 @@ function makeOn409(store, nodeId, card, { revisionMoved, maxExcused409 }) {
|
|
|
98
101
|
return { kind: 'moved', reason: `the card revision moved again during Stage B, after ${excused} such 409s since the last judged run (at most ${maxExcused409} are excused)` };
|
|
99
102
|
}
|
|
100
103
|
await store.recordProbe(nodeId, offering.offering_id, 'B', STAGE_B_409, false,
|
|
101
|
-
|
|
104
|
+
`${status} with revision ${card.revision} pinned; card re-indexed at ${fresh}; Stage B runs again later`);
|
|
102
105
|
return { kind: 'stale' };
|
|
103
106
|
};
|
|
104
107
|
}
|
|
@@ -113,9 +116,11 @@ async function probeIdentity(safeFetch, card, offering, refs, on409) {
|
|
|
113
116
|
let matches = 0, retried = 0, refused = 0, stop = null;
|
|
114
117
|
const ask = async (prompt) => {
|
|
115
118
|
const { status, text } = await chatOnce(safeFetch, card, offering, prompt);
|
|
116
|
-
if (status
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
if (status !== 200) {
|
|
120
|
+
// A 409, or another failure (a 404 for a model dropped since the card was fetched): only a
|
|
121
|
+
// revision that really moved excuses it; with the current revision pinned it does not match.
|
|
122
|
+
const what = await on409(offering, status);
|
|
123
|
+
if (what.kind === 'refused') { if (status === 409) refused++; } else stop = what;
|
|
119
124
|
return null;
|
|
120
125
|
}
|
|
121
126
|
return status === 200 && text !== null ? sha256(text) : null;
|
|
@@ -293,6 +298,13 @@ export async function runStageB(store, nodeId, card, {
|
|
|
293
298
|
await store.setObservation(nodeId, offering.offering_id, 'context_cap', verdict.context.verified_cap);
|
|
294
299
|
|
|
295
300
|
verdict.capacity = await probeCapacity(safeFetch, card, offering, corpus, capacity);
|
|
301
|
+
if (!verdict.capacity.ok) {
|
|
302
|
+
// A failed ramp on a card that has since moved (the model dropped or changed during the run)
|
|
303
|
+
// is not judged, by the same rule and bound as a 409.
|
|
304
|
+
const what = await on409(offering, 'capacity failure');
|
|
305
|
+
if (what.kind === 'stale') return { ok: false, identityFailed: false, stale: true, verdicts: [...verdicts, verdict], untested };
|
|
306
|
+
if (what.kind === 'moved') return { ok: false, identityFailed: false, reason: `${offering.offering_id}: ${what.reason}`, verdicts: [...verdicts, verdict], untested };
|
|
307
|
+
}
|
|
296
308
|
await store.recordProbe(nodeId, offering.offering_id, 'B', 'capacity', verdict.capacity.ok, null, verdict.capacity);
|
|
297
309
|
if (verdict.capacity.ttft_ms.p50 != null) {
|
|
298
310
|
await store.setObservation(nodeId, offering.offering_id, 'ttft_ms', verdict.capacity.ttft_ms);
|
package/src/stagec.js
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
// - random blind invocations at unpredictable times (anti-"benchmark mode": a node cannot serve the
|
|
5
5
|
// real model only when it detects a test window), worded from the registry's probe corpus like
|
|
6
6
|
// any customer request; repeated failures cost the node its tier
|
|
7
|
+
// - blind invocations use the card the registry already holds: cards are re-fetched on their own
|
|
8
|
+
// jittered timer (cardSweep), never just before a probe, so the card origin's log does not announce
|
|
9
|
+
// the "blind" request that follows (a 409 still re-fetches and retries, below)
|
|
7
10
|
// - an excused 409 is followed by a fresh blind invocation within the hour (ONP-3 §4a.9), so
|
|
8
11
|
// publishing a new card revision to refuse a probe does not buy a quiet stretch
|
|
9
12
|
// - on verified and attested nodes some blind invocations ask an identity prompt instead: a light
|
|
@@ -25,6 +28,11 @@ const MINUTE = 60_000, HOUR = 60 * MINUTE, DAY = 24 * HOUR;
|
|
|
25
28
|
export const LIVENESS_INTERVAL_MS = 300_000;
|
|
26
29
|
/** Mean gap between blind-invocation sweeps: one chat call per node per sweep, same jitter. */
|
|
27
30
|
export const BLIND_INTERVAL_MS = 3_600_000;
|
|
31
|
+
/**
|
|
32
|
+
* Mean gap between card re-fetch sweeps, same jitter. Its own timer, independent of the blind sweeps:
|
|
33
|
+
* a card fetch must not tell a node that a blind invocation is coming.
|
|
34
|
+
*/
|
|
35
|
+
export const CARD_REFRESH_INTERVAL_MS = 3_600_000;
|
|
28
36
|
/** Each gap is the mean times a uniform random factor in this range. */
|
|
29
37
|
export const JITTER = [0.5, 1.5];
|
|
30
38
|
/** Consecutive failed blind invocations (since the node's last state change) that demote it one tier. */
|
|
@@ -70,6 +78,7 @@ export function startStageC(store, {
|
|
|
70
78
|
corpus = loadCorpus(null), // probe prompts (corpus.js)
|
|
71
79
|
livenessIntervalMs = LIVENESS_INTERVAL_MS, // tests shorten this
|
|
72
80
|
blindIntervalMs = BLIND_INTERVAL_MS,
|
|
81
|
+
cardRefreshIntervalMs = CARD_REFRESH_INTERVAL_MS,
|
|
73
82
|
followUpTickMs = FOLLOW_UP_TICK_MS,
|
|
74
83
|
followUpMs = FOLLOW_UP_MS,
|
|
75
84
|
failThreshold = 3,
|
|
@@ -139,7 +148,7 @@ export function startStageC(store, {
|
|
|
139
148
|
for (const node of await store.allNodes()) {
|
|
140
149
|
if (stopped) return;
|
|
141
150
|
if (!OBSERVED_STATES.includes(node.state)) continue;
|
|
142
|
-
|
|
151
|
+
// The card the registry holds, never one fetched just now (cardSweep has its own timer).
|
|
143
152
|
const card = await store.latestCard(node.id);
|
|
144
153
|
if (!card) continue;
|
|
145
154
|
// Blind probes call only offerings the tests can call. A node with none is reported in the
|
|
@@ -160,6 +169,23 @@ export function startStageC(store, {
|
|
|
160
169
|
}
|
|
161
170
|
}
|
|
162
171
|
|
|
172
|
+
/**
|
|
173
|
+
* Re-fetch the cards of observed nodes, in random order, on a timer of its own. A revision the
|
|
174
|
+
* node moved to is picked up here (or on its ping, or by a 409's re-fetch), not just before a probe.
|
|
175
|
+
*/
|
|
176
|
+
async function cardSweep() {
|
|
177
|
+
if (!refreshCard) return;
|
|
178
|
+
const nodes = (await store.allNodes()).filter((n) => OBSERVED_STATES.includes(n.state));
|
|
179
|
+
for (let i = nodes.length - 1; i > 0; i--) {
|
|
180
|
+
const j = Math.floor(random() * (i + 1));
|
|
181
|
+
[nodes[i], nodes[j]] = [nodes[j], nodes[i]];
|
|
182
|
+
}
|
|
183
|
+
for (const node of nodes) {
|
|
184
|
+
if (stopped) return;
|
|
185
|
+
await refreshCard(node.id);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
163
189
|
/**
|
|
164
190
|
* The fresh blind invocations owed after excused 409s: each due one runs now, pinned to the card
|
|
165
191
|
* the registry holds (the revision the node moved to), without fetching the card first. Its 409
|
|
@@ -184,6 +210,7 @@ export function startStageC(store, {
|
|
|
184
210
|
const offering = callable[Math.floor(random() * callable.length)];
|
|
185
211
|
const ref = await identityReference(node, offering);
|
|
186
212
|
const result = await blindProbe(node, card, offering, ref);
|
|
213
|
+
if (result.skipped) return;
|
|
187
214
|
// The record says only whether the reply conformed: never that it carried an identity prompt,
|
|
188
215
|
// nor how that comparison went (node detail publishes the last probe records).
|
|
189
216
|
await store.recordProbe(node.id, result.offeringId, 'C', 'blind', result.ok, result.detail, result.measured);
|
|
@@ -202,6 +229,26 @@ export function startStageC(store, {
|
|
|
202
229
|
return refs.length ? refs[Math.floor(random() * refs.length)] : null;
|
|
203
230
|
}
|
|
204
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Blind probes go out on the card the registry holds, so one can reach an offering the node has
|
|
234
|
+
* since dropped from its card (it answers 404, say, not 409). After such a failure, and never
|
|
235
|
+
* before a probe, the card is re-fetched: when its revision moved and the offering is gone, the
|
|
236
|
+
* failure is not judged. It is excused like a 409, within the same daily bound and with a fresh
|
|
237
|
+
* probe owed within the hour. Null when it counts as a failure.
|
|
238
|
+
*/
|
|
239
|
+
async function droppedOffering(node, card, offering, status) {
|
|
240
|
+
await refreshCard?.(node.id);
|
|
241
|
+
const fresh = await store.latestCard(node.id);
|
|
242
|
+
if (!fresh || fresh.revision === card.revision) return null;
|
|
243
|
+
if (fresh.offerings.some((o) => o.offering_id === offering.offering_id && testable(o))) return null;
|
|
244
|
+
const excused = await store.countProbes(node.id, 'blind-409', iso(Date.now() - DAY));
|
|
245
|
+
if (excused >= maxExcused409) return null;
|
|
246
|
+
await store.recordProbe(node.id, offering.offering_id, 'C', 'blind-409', false,
|
|
247
|
+
`status ${status} for ${offering.offering_id}, which revision ${fresh.revision} no longer offers; a fresh probe due within the hour`);
|
|
248
|
+
await oweFollowUp(node.id, fresh.revision);
|
|
249
|
+
return { skipped: true, offeringId: offering.offering_id };
|
|
250
|
+
}
|
|
251
|
+
|
|
205
252
|
/**
|
|
206
253
|
* One blind chat call, in the identity requests' shape (temperature 0, the same output cap). A fresh
|
|
207
254
|
* 409 is excused within the daily bound: the card is re-indexed, the call retried once at once
|
|
@@ -221,6 +268,7 @@ export function startStageC(store, {
|
|
|
221
268
|
let reply = await ask(card, offering, ref ? ref.prompt : corpus.chatPrompt());
|
|
222
269
|
if (reply.status !== 409) {
|
|
223
270
|
const result = judge(reply, offering);
|
|
271
|
+
if (!result.ok) return (await droppedOffering(node, card, offering, reply.status)) ?? result;
|
|
224
272
|
if (ref && result.ok) result.identity = await lightCheck(reply, () => ask(card, offering, ref.prompt), ref);
|
|
225
273
|
return result;
|
|
226
274
|
}
|
|
@@ -238,7 +286,9 @@ export function startStageC(store, {
|
|
|
238
286
|
await oweFollowUp(node.id, fresh.revision);
|
|
239
287
|
const retryOffering = fresh.offerings.find((o) => o.offering_id === offering.offering_id && testable(o))
|
|
240
288
|
?? fresh.offerings.find(testable);
|
|
241
|
-
|
|
289
|
+
// The node moved to a card with nothing to call (an excused 409, already recorded): nothing
|
|
290
|
+
// was judged, and the next sweep reports it as blind_skipped, as for any such card.
|
|
291
|
+
if (!retryOffering) return { skipped: true, offeringId: offering.offering_id };
|
|
242
292
|
reply = await ask(fresh, retryOffering, corpus.chatPrompt());
|
|
243
293
|
return judge(reply, retryOffering, reply.status === 409 ? 'on the retry with the re-indexed revision' : null);
|
|
244
294
|
} catch (err) {
|
|
@@ -325,12 +375,14 @@ export function startStageC(store, {
|
|
|
325
375
|
};
|
|
326
376
|
loop(livenessSweep, livenessIntervalMs);
|
|
327
377
|
loop(blindSweep, blindIntervalMs);
|
|
378
|
+
loop(cardSweep, cardRefreshIntervalMs);
|
|
328
379
|
loop(followUpTick, followUpTickMs);
|
|
329
380
|
|
|
330
381
|
return {
|
|
331
382
|
stop: () => { stopped = true; },
|
|
332
383
|
/** One blind sweep, or one look for due follow-ups, now (tests). */
|
|
333
384
|
blindSweep,
|
|
385
|
+
cardSweep,
|
|
334
386
|
followUpTick,
|
|
335
387
|
};
|
|
336
388
|
}
|
package/src/web/index.html
CHANGED
|
@@ -663,7 +663,7 @@
|
|
|
663
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>
|
|
664
664
|
<div class="panel pad" style="max-width:56rem" id="probe-load-table">
|
|
665
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
|
|
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; at a random time within 72 hours of a change to a chat offering's model, serving, hardware or binding block, a new chat offering, or a change 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. That random run is set apart: a run that a change brings does not move it. 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
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
668
|
<br>· <b>Calibration:</b> 1 call with about 4,000 characters of text, at most 4 output tokens, to measure your tokenizer.
|
|
669
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).
|