@sema-agent/settings-schema 25.1.0 → 26.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +319 -0
- package/README.md +65 -33
- package/conformance/VERSION +1 -1
- package/conformance/cases/c27-hosts-array-1025/meta.json +1 -1
- package/conformance/cases/c48-s935-model-headers-transported/expected.json +18 -68
- package/conformance/cases/c48-s935-model-headers-transported/meta.json +1 -1
- package/conformance/cases/c67-s784-retired-field-loud/meta.json +1 -1
- package/conformance/cases/c77-prompts-center-artifact-carried/expected.json +5 -5
- package/conformance/cases/c77-prompts-center-artifact-carried/input.json +2 -2
- package/conformance/cases/c79-prompts-bad-worker-artifact-not-salvaged/expected.json +1 -1
- package/conformance/cases/c79-prompts-bad-worker-artifact-not-salvaged/input.json +3 -3
- package/conformance/cases/c80-prompts-wire-v2-verbatim/expected.json +1 -1
- package/conformance/cases/c80-prompts-wire-v2-verbatim/input.json +1 -1
- package/conformance/cases/c82-prompts-v1-catalog-refused/expected.json +1 -1
- package/conformance/cases/c82-prompts-v1-catalog-refused/input.json +1 -1
- package/conformance/cases/c83-prompts-bad-overlay-not-salvaged/expected.json +1 -1
- package/conformance/cases/c83-prompts-bad-overlay-not-salvaged/input.json +1 -1
- package/dist/cli.d.ts +7 -7
- package/dist/cli.js +11 -19
- package/dist/config-dir-io.js +3 -14
- package/dist/config-dir-migration.d.ts +1 -4
- package/dist/config-dir-migration.js +16 -22
- package/dist/config-document-refusal.d.ts +2 -3
- package/dist/config-fns.d.ts +3 -4
- package/dist/config-fns.js +4 -6
- package/dist/conformance/run.js +89 -29
- package/dist/conformance/types.d.ts +65 -39
- package/dist/execution-lane-index.d.ts +8 -19
- package/dist/execution-lane-index.js +6 -27
- package/dist/file-store.js +2 -3
- package/dist/fleet.d.ts +10 -47
- package/dist/fleet.js +13 -40
- package/dist/fs-failure.d.ts +5 -10
- package/dist/fs-failure.js +4 -8
- package/dist/hooks.d.ts +41 -6
- package/dist/hooks.js +68 -4
- package/dist/migration-receipt.d.ts +12 -14
- package/dist/migration-receipt.js +5 -7
- package/dist/node.js +1 -1
- package/dist/one-time-migrations.d.ts +9 -24
- package/dist/one-time-migrations.js +30 -796
- package/dist/remote-exec.js +2 -3
- package/dist/retired-envs.js +2 -0
- package/dist/retired-form.d.ts +12 -11
- package/dist/retired-form.js +12 -8
- package/dist/sandbox-git.d.ts +1 -1
- package/dist/sandbox-git.js +3 -3
- package/dist/scheduler-lifetime.d.ts +1 -1
- package/dist/scheduler-lifetime.js +1 -1
- package/dist/scheduler-store.d.ts +4 -29
- package/dist/scheduler-store.js +21 -14
- package/dist/types.d.ts +13 -19
- package/dist/types.js +75 -110
- package/dist/web-admin-credential.d.ts +2 -2
- package/dist/web-admin-credential.js +4 -4
- package/dist/worker-row-verdict.d.ts +1 -1
- package/dist/worker-row-verdict.js +1 -1
- package/dist/workers-rows.d.ts +2 -2
- package/dist/workers-rows.js +2 -2
- package/dist/zod-unwrap.d.ts +1 -1
- package/dist/zod-unwrap.js +1 -1
- package/docs/API-SURFACE.md +11 -12
- package/docs/CONFORMANCE.md +25 -13
- package/docs/CONSUMER-INTEGRATION.md +54 -27
- package/llms-full.txt +24 -22
- package/llms.txt +20 -14
- package/package.json +1 -1
- package/dist/runtime-lift-targets.d.ts +0 -7
- package/dist/runtime-lift-targets.js +0 -7
- package/dist/scheduler-store-migration.d.ts +0 -14
- package/dist/scheduler-store-migration.js +0 -14
package/dist/types.js
CHANGED
|
@@ -30,7 +30,7 @@ import { PREVIOUS_WEB_ADMIN_ENV } from "./previous-web-admin-env.js"; // the pre
|
|
|
30
30
|
import { retiredEnvRefusal } from "./retired-envs.js"; // the worker env write gate asks the retired-env tombstone table too (one table, one refusal sentence)
|
|
31
31
|
import { Sha256Digest } from "./sha256.js"; // the one `sha256:<hex>` digest form
|
|
32
32
|
import { EXECUTION_LANES, EXECUTION_LANE_WORDS, LANE_SET_RULE, MEMORY_ENGINE_BACKENDS, SESSION_BACKENDS, STORE_BACKENDS, isBlankCoordinate, laneSetFlaws, retiredLaneWordRefusal } from "./execution-lanes.js"; // 7.0.0 M-R2: the lane / store vocabulary (one exported table)
|
|
33
|
-
import { LANE_ENV_OWNER,
|
|
33
|
+
import { LANE_ENV_OWNER, LATE_LANE_ENV_KEYS, laneEnvSeat, laneRowOf } from "./execution-lane-index.js"; // package-private indexes derived from that table (none of them is in the barrel)
|
|
34
34
|
import { migrationSignpost, retiredFormSentence, retiredKey } from "./retired-form.js"; // 11.0.0: the ONE retired-form sentence + key tombstone (package-private)
|
|
35
35
|
import { retiredRoleWordsRefusal } from "./retired-role-words.js"; // 12.0.0: the retired role-word tombstone (package-private; SS-M8)
|
|
36
36
|
import { buildQuotedIssue, fixed } from "./quoted-issue.js"; // THE minting point of custom issues (package-private)
|
|
@@ -159,59 +159,30 @@ export function urlQueryFragmentHasSecret(u) {
|
|
|
159
159
|
* after it is dropped with it — the engine and server refuse a model route root that carries one, so a stored one only fails
|
|
160
160
|
* later, on the worker). A query is a legitimate request parameter (`?api-version=…`) and stays. */
|
|
161
161
|
const NON_SECRET_URL_FORBIDS = ["userinfo", "fragment"];
|
|
162
|
-
/** The refusal of one flaw at a {@link NON_SECRET_URL} seat (a {@link QuotedIssue} with no operands — the sentence quotes no value): the
|
|
163
|
-
* judge's rule sentence, and — for the one flaw that stored data can carry from before 11.0.0 (a fragment) at a seat the one-time migration
|
|
164
|
-
* reaches — the signpost to the migration that strips it, joined the way the other signposted refusals join it (`<rule>; <signpost>`).
|
|
165
|
-
* Closed over the judge's flaw words: a new word is a compile error here. */
|
|
166
|
-
function nonSecretUrlIssue(flaw, reachedByMigration) {
|
|
167
|
-
switch (flaw) {
|
|
168
|
-
case "fragment":
|
|
169
|
-
return reachedByMigration ? buildQuotedIssue `${fixed(httpUrlRule(flaw))}; ${fixed(migrationSignpost("SS-M7", "11.0.0"))}` : buildQuotedIssue `${fixed(httpUrlRule(flaw))}`;
|
|
170
|
-
case "not-http-url":
|
|
171
|
-
case "userinfo":
|
|
172
|
-
case "query":
|
|
173
|
-
return buildQuotedIssue `${fixed(httpUrlRule(flaw))}`;
|
|
174
|
-
default: {
|
|
175
|
-
const unhandled = flaw;
|
|
176
|
-
throw new Error("nonSecretUrlIssue: unhandled flaw word", { cause: unhandled });
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/** One judge, two seat kinds — the only difference is the fragment refusal's migration signpost. `reachedByMigration` = the seat sits in a
|
|
181
|
-
* stored document the one-time migration SS-M7 rewrites (it finds its seats by this schema's identity, so "carries the
|
|
182
|
-
* signpost" and "is rewritten by SS-M7" cannot drift apart). */
|
|
183
|
-
function createNonSecretUrl(reachedByMigration) {
|
|
184
|
-
return z.string().superRefine((s, ctx) => {
|
|
185
|
-
const flaws = httpUrlFlaws(s, NON_SECRET_URL_FORBIDS);
|
|
186
|
-
for (const flaw of flaws) {
|
|
187
|
-
const refusal = nonSecretUrlIssue(flaw, reachedByMigration);
|
|
188
|
-
ctx.addIssue({ code: "custom", ...refusal, params: { ...refusal.params, flaw } }); // `flaw` = the judge's rule word, beside the sentence's params
|
|
189
|
-
}
|
|
190
|
-
if (flaws.length === 0 && urlQueryFragmentHasSecret(new URL(s))) {
|
|
191
|
-
ctx.addIssue({ code: "custom", ...buildQuotedIssue `must not carry a secret-shaped value in its path or query — secrets go in the *Env (env-NAME) fields` });
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
162
|
/** A URL handed to `fetch` that carries no credential: judged by THE URL shape judge ({@link httpUrlFlaws}, `./url-shape`) — a
|
|
196
163
|
* hierarchical http(s) URL with neither userinfo nor a fragment (an empty `#` included, 11.0.0) — and with no secret-shaped value
|
|
197
164
|
* in its path or query ({@link urlQueryFragmentHasSecret}). One issue per flaw, its message the judge's rule sentence (no value
|
|
198
|
-
* echoed
|
|
199
|
-
* no operands) and `flaw`, the rule word.
|
|
165
|
+
* echoed — the rule sentence is the way out); `params` carries the sentence (`template` / `operands`, no operands) and `flaw`, the rule word.
|
|
200
166
|
*
|
|
201
167
|
* Scope of the secret test: it judges the VALUE's shape (a value that looks like a secret, whatever the parameter is called) — the sibling
|
|
202
168
|
* name-shaped judge `findUrlCredential` (`./url-credential`) asks the other question (a parameter whose NAME is on the credential-name table,
|
|
203
169
|
* whatever the value looks like). Neither contains the other: `?key=abc` passes here and is a hit there; `?x=sk-live-…` is the reverse.
|
|
204
170
|
*
|
|
205
|
-
*
|
|
206
|
-
* `
|
|
207
|
-
*
|
|
171
|
+
* One judge for every such seat, stored or not: the domain documents (models `baseUrl`, mcp `url`, `sessionMirror.engineUrl`, workers
|
|
172
|
+
* `gitApiBaseUrl`), `config.d/remote-exec.json` (k8s `apiUrl`, `s3Snapshot.endpoint`) and wire inputs (the web-admin credential
|
|
173
|
+
* envelope's `issuer`, the sandbox-git connect URL) — 26.0.0 merged the twin that differed only by a migration signpost.
|
|
208
174
|
*
|
|
209
175
|
* The value is kept EXACTLY as written: nothing here trims or normalizes it (zod's own `.url()` would hand back a rewritten string). */
|
|
210
|
-
export const NON_SECRET_URL =
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
176
|
+
export const NON_SECRET_URL = z.string().superRefine((s, ctx) => {
|
|
177
|
+
const flaws = httpUrlFlaws(s, NON_SECRET_URL_FORBIDS);
|
|
178
|
+
for (const flaw of flaws) {
|
|
179
|
+
const refusal = buildQuotedIssue `${fixed(httpUrlRule(flaw))}`;
|
|
180
|
+
ctx.addIssue({ code: "custom", ...refusal, params: { ...refusal.params, flaw } }); // `flaw` = the judge's rule word, beside the sentence's params
|
|
181
|
+
}
|
|
182
|
+
if (flaws.length === 0 && urlQueryFragmentHasSecret(new URL(s))) {
|
|
183
|
+
ctx.addIssue({ code: "custom", ...buildQuotedIssue `must not carry a secret-shaped value in its path or query — secrets go in the *Env (env-NAME) fields` });
|
|
184
|
+
}
|
|
185
|
+
});
|
|
215
186
|
/** Validate a free-form `extraBody`: returns true = UNSAFE (reject). A GETTER-FREE, descriptor-based, bounded
|
|
216
187
|
* walk that rejects — WITHOUT ever invoking a getter (a malicious getter could throw a secret-bearing message,
|
|
217
188
|
* or return different values across the validate vs persist JSON.stringify calls) — anything that isn't plain
|
|
@@ -316,9 +287,9 @@ function vetFreeFormJson(v, field) {
|
|
|
316
287
|
return { ok: true, value: clone };
|
|
317
288
|
}
|
|
318
289
|
/** The transform of every **parse-transparent free-form** key (`z.unknown().optional().transform(createFreeFormTransform(field))`:
|
|
319
|
-
* `ModelEntry.compat`
|
|
320
|
-
*
|
|
321
|
-
*
|
|
290
|
+
* `ModelEntry.compat`) — absent stays absent (key not minted); anything else is the {@link vetFreeFormJson} safety judgment and
|
|
291
|
+
* nothing more (no SHAPE rule — whose job that is, per key, is {@link PARSE_TRANSPARENT_KEYS}). The free-form OBJECT keys
|
|
292
|
+
* (`extraBody` / `headers`) are the other class: {@link createFreeFormObjectTransform}. */
|
|
322
293
|
function createFreeFormTransform(field) {
|
|
323
294
|
return (v, ctx) => {
|
|
324
295
|
if (v === undefined)
|
|
@@ -331,6 +302,27 @@ function createFreeFormTransform(field) {
|
|
|
331
302
|
return vetted.value;
|
|
332
303
|
};
|
|
333
304
|
}
|
|
305
|
+
/** The transform of every **free-form OBJECT** key (`ModelEntry.extraBody` / `ModelEntry.headers`) — ONE closure, so those keys
|
|
306
|
+
* cannot drift apart: absent stays absent (key not minted); the CONTAINER must be a plain JSON object (the package's one seat,
|
|
307
|
+
* `isPlainJsonObject`) — a list, a string, a number, `null` ⇒ one fixed issue on the key, the value never echoed; then the
|
|
308
|
+
* {@link vetFreeFormJson} safety judgment. What is open is the KEY VOCABULARY inside the object (provider request params /
|
|
309
|
+
* header names): this package is not its owner. */
|
|
310
|
+
function createFreeFormObjectTransform(field) {
|
|
311
|
+
return (v, ctx) => {
|
|
312
|
+
if (v === undefined)
|
|
313
|
+
return undefined;
|
|
314
|
+
if (!isPlainJsonObject(v)) {
|
|
315
|
+
ctx.addIssue({ code: "custom", ...buildQuotedIssue `${fixed(field)} must be a plain JSON object` });
|
|
316
|
+
return z.NEVER;
|
|
317
|
+
}
|
|
318
|
+
const vetted = vetFreeFormJson(v, field);
|
|
319
|
+
if (!vetted.ok) {
|
|
320
|
+
ctx.addIssue({ code: "custom", ...vetted.issue });
|
|
321
|
+
return z.NEVER;
|
|
322
|
+
}
|
|
323
|
+
return vetted.value;
|
|
324
|
+
};
|
|
325
|
+
}
|
|
334
326
|
/** A k8s resource quantity ("250m", "1", "0.5", "512Mi", "1Gi", "128M") — catches garbage at config-submit
|
|
335
327
|
* rather than surfacing as a reconcile ApplyError at the apiserver (consistent with ENV_NAME/DURATION guards). */
|
|
336
328
|
export const K8S_QUANTITY = z.string().regex(/^\d+(\.\d+)?(m|[kKMGTPE]i?)?$/, 'must be a k8s quantity like "250m", "512Mi", "1Gi"');
|
|
@@ -395,8 +387,9 @@ export const SealedApiKey = z.object({
|
|
|
395
387
|
* 解析透明,按「本包是不是那张形表的属主」判,不再按「怕连坐」判。
|
|
396
388
|
*
|
|
397
389
|
* 「解析透明」按**行为**定义(不按 schema 的形名):喂一组有代表性的值全收 = 本包对它的形没有任何主张。
|
|
398
|
-
*
|
|
399
|
-
*
|
|
390
|
+
* 所以**自由形对象键** `ModelEntry.extraBody` / `ModelEntry.headers`(26.0.0 起;6.4.0–25.x 它登记在本表)**不在**本表里 ——
|
|
391
|
+
* 本包判它们的容器(必须是纯 JSON 对象,同一只 `createFreeFormObjectTransform`);开放的只是对象里的键名词表(各家 provider 的
|
|
392
|
+
* 请求参数 / 头名),那是另一回事,写在各自的 JSDoc 里。
|
|
400
393
|
*
|
|
401
394
|
* 门:`test/parse-transparent-keys.test.ts` 从 `DOMAIN_SCHEMAS` **派生**出所有解析透明的叶子,与本表
|
|
402
395
|
* 双向对拍 —— 多登记一行(键已经不透明了)红,少登记一行(新键静默溜进来)也红;派生遇到不认识的
|
|
@@ -410,13 +403,6 @@ export const PARSE_TRANSPARENT_KEYS = [
|
|
|
410
403
|
validatedBy: "engine-ingest",
|
|
411
404
|
why: "镜像引擎的 per-model wire-compat 声明(thinkingFormat 等五键);那张词表随引擎走,本包复述一份必漂。",
|
|
412
405
|
},
|
|
413
|
-
{
|
|
414
|
-
domain: "models",
|
|
415
|
-
path: "models[].headers",
|
|
416
|
-
since: "6.4.0",
|
|
417
|
-
validatedBy: "consumer",
|
|
418
|
-
why: "部署 ↔ 供应商的 per-model 附加请求头;判据(头名闭集白名单 × 读它的线路 × 值形)的唯一属主是 server 的目录条目判据(坏声明 ⇒ 该条目整条不可用,不是丢头照常),本包复述一份那张表必漂、两处各一份就是两个写者。",
|
|
419
|
-
},
|
|
420
406
|
{
|
|
421
407
|
domain: "mcp",
|
|
422
408
|
path: "servers[].source",
|
|
@@ -511,8 +497,7 @@ export const ModelEntry = z.object({
|
|
|
511
497
|
apiKeyEnv: ENV_NAME.optional(),
|
|
512
498
|
/** sealed-box 托管密文(0.10.5 默认模式「直接贴 key」;形状见 {@link SealedApiKey})。
|
|
513
499
|
* **二选一**(11.0.0):一个模型的钥匙只有一种写法 —— `sealedApiKey` 与 `apiKeyEnv` 同设 ⇒ 本条目被拒(读写同一只判据,见本
|
|
514
|
-
* schema 的 superRefine)
|
|
515
|
-
* = 当年的生效读法「sealed 赢」)。ABSENT = 未托管(纯 env-NAME 现状)。 */
|
|
500
|
+
* schema 的 superRefine)。切换写法的写者负责清掉另一字段;还带着双设的存量条目读侧逐条丢(`entry-dropped`)、写侧拒。ABSENT = 未托管(纯 env-NAME 现状)。 */
|
|
516
501
|
sealedApiKey: SealedApiKey.optional(),
|
|
517
502
|
/** Price/capability tier — fuels core 1.25 `selectModel({ tier })` role resolution. */
|
|
518
503
|
tier: ModelTier.default("standard"),
|
|
@@ -554,29 +539,13 @@ export const ModelEntry = z.object({
|
|
|
554
539
|
// before our check). The getter-free descriptor walk (extraBodyUnsafe) validates the RAW value without
|
|
555
540
|
// invoking any getter; a Proxy that fakes its descriptors is caught by re-scanning the JSON clone; and the
|
|
556
541
|
// .transform persists that CLONE (concrete plain JSON) so a non-idempotent toJSON can't differ at persist.
|
|
557
|
-
// Round 2-5 hardening.
|
|
558
|
-
// be a plain JSON object
|
|
559
|
-
// object
|
|
542
|
+
// Round 2-5 hardening. A free-form OBJECT key ({@link createFreeFormObjectTransform}, same class as `headers`): the
|
|
543
|
+
// container must be a plain JSON object (it is spread into a request body); what is open is the KEY VOCABULARY inside
|
|
544
|
+
// that object — each provider's request params, and this package is not their owner.
|
|
560
545
|
extraBody: z
|
|
561
546
|
.unknown()
|
|
562
547
|
.optional()
|
|
563
|
-
|
|
564
|
-
// is meaningless here; the SAFETY judgment is the shared vetFreeFormJson pipeline (see its doc: getter-free
|
|
565
|
-
// walk → single stringify → re-scanned clone IS the persisted value).
|
|
566
|
-
.transform((v, ctx) => {
|
|
567
|
-
if (v === undefined)
|
|
568
|
-
return undefined;
|
|
569
|
-
if (!isPlainJsonObject(v)) {
|
|
570
|
-
ctx.addIssue({ code: "custom", ...buildQuotedIssue `extraBody must be a plain JSON object` });
|
|
571
|
-
return z.NEVER;
|
|
572
|
-
}
|
|
573
|
-
const vetted = vetFreeFormJson(v, "extraBody");
|
|
574
|
-
if (!vetted.ok) {
|
|
575
|
-
ctx.addIssue({ code: "custom", ...vetted.issue });
|
|
576
|
-
return z.NEVER;
|
|
577
|
-
}
|
|
578
|
-
return vetted.value;
|
|
579
|
-
}),
|
|
548
|
+
.transform(createFreeFormObjectTransform("extraBody")),
|
|
580
549
|
/** Per-model wire-compat declaration for the OpenAI-completions lane — mirrors the engine's
|
|
581
550
|
* `OpenAICompletionsCompat` (five keys: `thinkingFormat` / `reasoningEffortLevels` / `maxTokensField` /
|
|
582
551
|
* `requiresReasoningContentOnAssistantMessages` / `supportsReasoningEffort`). Real need: a vLLM/Qwen-class
|
|
@@ -600,13 +569,14 @@ export const ModelEntry = z.object({
|
|
|
600
569
|
* declaration is stripped at parse on every read leg, so it never reaches the consumer at all.
|
|
601
570
|
* ABSENT = key not minted = today's behaviour, zero migration.
|
|
602
571
|
*
|
|
603
|
-
*
|
|
604
|
-
*
|
|
605
|
-
* `
|
|
572
|
+
* A free-form OBJECT key (26.0.0; {@link createFreeFormObjectTransform}, the class of `extraBody`): this package judges the
|
|
573
|
+
* CONTAINER — a plain JSON object of header name → value — and the free-form safety boundary; a list / string / number /
|
|
574
|
+
* `null` is a bad entry. The header-name allowlist × the lane that reads it × the value form stay the consumer's catalog-entry
|
|
575
|
+
* judgment (this package copying that table would be a second writer). */
|
|
606
576
|
headers: z
|
|
607
577
|
.unknown()
|
|
608
578
|
.optional()
|
|
609
|
-
.transform(
|
|
579
|
+
.transform(createFreeFormObjectTransform("headers")),
|
|
610
580
|
/** 配额倍率(EXPERT-REDESIGN §4-1):该模型烧 token 双窗额度的倍率,默认 1。折算时点=weight-at-burn
|
|
611
581
|
* (记账时固化到 UsageEntry.quotaWeightAtUse/weightedTokens):改倍率只影响此后记账,不回算窗口内历史。 */
|
|
612
582
|
quotaWeight: z.number().finite().nonnegative().default(1),
|
|
@@ -621,7 +591,7 @@ export const ModelEntry = z.object({
|
|
|
621
591
|
ctx.addIssue({ code: "custom", ...buildQuotedIssue `provider "${m.provider}" + api "${m.api}" mismatch — provider:"anthropic" ⟺ api:"anthropic-messages"`, path: ["api"] });
|
|
622
592
|
// 钥匙二选一(11.0.0):同设 = 两个答案回答「这个模型用哪把钥匙」。此前「sealed 压过 env」只活在注里与消费方三处优先级臂上。
|
|
623
593
|
if (m.sealedApiKey !== undefined && m.apiKeyEnv !== undefined)
|
|
624
|
-
ctx.addIssue({ code: "custom", ...buildQuotedIssue `sealedApiKey and apiKeyEnv are both set — a model's key has ONE form: keep sealedApiKey (a pasted key) or apiKeyEnv (an env-NAME), not both
|
|
594
|
+
ctx.addIssue({ code: "custom", ...buildQuotedIssue `sealedApiKey and apiKeyEnv are both set — a model's key has ONE form: keep sealedApiKey (a pasted key) or apiKeyEnv (an env-NAME), not both`, path: ["apiKeyEnv"] });
|
|
625
595
|
});
|
|
626
596
|
// `verifier` (2026-06-11, SERVICE-RESPONSE-…-PHASE2): real consumer = core's verification gate
|
|
627
597
|
// (runWithVerification/resumeWithVerification resolve the verifier sub-task model via this role). Fallback
|
|
@@ -663,9 +633,9 @@ export const AtMention = z.discriminatedUnion("mode", [
|
|
|
663
633
|
z.object({ mode: z.literal("only"), models: z.array(z.string().min(1)).min(1) }),
|
|
664
634
|
]);
|
|
665
635
|
/** `models.default` 的墓碑(11.0.0,N-7):缺省模型只有 `roles.default` 一位。 */
|
|
666
|
-
const MODELS_DEFAULT_RETIRED = { retiredIn: "11.0.0", now: "roles.default ({model:<catalog name>}) — the one default-model seat"
|
|
636
|
+
const MODELS_DEFAULT_RETIRED = { retiredIn: "11.0.0", now: "roles.default ({model:<catalog name>}) — the one default-model seat" };
|
|
667
637
|
/** `atModelAllowlist` 的墓碑(11.0.0):全局位与 roster 位同一行。 */
|
|
668
|
-
const AT_MODEL_ALLOWLIST_RETIRED = { retiredIn: "11.0.0", now: "atMention ({mode:\"all\"} | {mode:\"none\"} | {mode:\"only\",models:[…]})"
|
|
638
|
+
const AT_MODEL_ALLOWLIST_RETIRED = { retiredIn: "11.0.0", now: "atMention ({mode:\"all\"} | {mode:\"none\"} | {mode:\"only\",models:[…]})" };
|
|
669
639
|
// ── sema 档位(tiers)与档位组(tier groups)──(web-admin 半场, core 1.265 档位车) ──────
|
|
670
640
|
// core 侧接缝 = `RunnerDeps.tiers`(档位词→模型绑定的**单表**, catalog 单点增广 expandTiers);web-admin 侧
|
|
671
641
|
// 把「多套命名预配置」存成 tierGroups,下发时只解析 ACTIVE 那一套成单表(组切换=web-admin 换表下发,零新
|
|
@@ -695,11 +665,11 @@ export const ModelsConfig = z
|
|
|
695
665
|
* (11.0.0, N-7: the structural `models.default` key is retired; it and `roles.default` used to answer the same question twice,
|
|
696
666
|
* the main task ran the first and the core `default` role resolved the second). Which catalog entry is the default is
|
|
697
667
|
* `resolveCatalogDefaultModel` (`./default-model`; a `{select}` default is handed back as-is for the engine to resolve). A stored
|
|
698
|
-
* `default` key is
|
|
668
|
+
* `default` key is refused by its tombstone (the models domain then reads as its default) — write the name here by hand. */
|
|
699
669
|
roles: RoleMap.prefault({}),
|
|
700
670
|
/** Which model names an end user may `@`-mention({@link AtMention});缺省 `{mode:"all"}`。 */
|
|
701
671
|
atMention: AtMention.prefault({ mode: "all" }),
|
|
702
|
-
/** retired 键墓碑(11.0.0)
|
|
672
|
+
/** retired 键墓碑(11.0.0):在场即拒,拒句点名现行位 `atMention`。 */
|
|
703
673
|
atModelAllowlist: retiredKey("atModelAllowlist", AT_MODEL_ALLOWLIST_RETIRED),
|
|
704
674
|
default: retiredKey("models.default", MODELS_DEFAULT_RETIRED),
|
|
705
675
|
/** 命名档位组预配置。只有 ACTIVE 组的绑定表会下发为引擎的 tiers 单表。 */
|
|
@@ -773,7 +743,7 @@ export const RosterEntry = z.object({
|
|
|
773
743
|
roles: RoleMap.optional(),
|
|
774
744
|
/** `@` 点名覆盖({@link AtMention});缺席 = 继承全局 `models.atMention`。 */
|
|
775
745
|
atMention: AtMention.optional(),
|
|
776
|
-
/** retired 键墓碑(11.0.0)
|
|
746
|
+
/** retired 键墓碑(11.0.0):在场即拒,拒句点名现行位 `atMention`。 */
|
|
777
747
|
atModelAllowlist: retiredKey("atModelAllowlist", AT_MODEL_ALLOWLIST_RETIRED),
|
|
778
748
|
notes: z.string().optional(),
|
|
779
749
|
});
|
|
@@ -945,15 +915,14 @@ export const SystemStatusEntry = z.object({
|
|
|
945
915
|
// ── retired 域(11.0.0)─────────────────────────────────────────────────────────────────────────────
|
|
946
916
|
// `runtime` 域retired:0.6.0 起它只剩五个限额键,而 `limits`(0.19.0)全覆盖那五个键 —— 同一个限额两处可发布、判据不同、「limits 赢」
|
|
947
917
|
// 只活在消费方的注里;0.5 期的 runtime 文档还带着治理三闸,读侧靠一只「governance 从未设过就抬升」的臂接住。11.0.0 两件都收:
|
|
948
|
-
// 五个限额键只在 `limits`,治理三闸只在 `governance
|
|
949
|
-
/** retired 域的**墓碑表**:域名 → retired版本 / 事实今天住哪
|
|
918
|
+
// 五个限额键只在 `limits`,治理三闸只在 `governance`;存量 runtime 文档由墓碑拒(拒句点名两个新位;改写它的一次性迁移窗关后已删)。
|
|
919
|
+
/** retired 域的**墓碑表**:域名 → retired版本 / 事实今天住哪(/ 改写存量的一次性迁移,迁移还在时)。读存储文档的每个读者同判(`parseDomain` 拒写、`buildEffective`
|
|
950
920
|
* 向店要retired 域、`readEffectiveWire` 看 wire、`FileConfigStore` 与 `readBundle` 读 `config.d/<名>.json`):文档**带事实**(在场且不是 `{}`)⇒ 响亮拒
|
|
951
|
-
* (`RetiredDomainError
|
|
921
|
+
* (`RetiredDomainError`,句子点名今天的位);缺席或 `{}`(没有可丢的事实)⇒ 不理会。墓碑是拒,不是读法 —— 它不把旧文档读成任何值。 */
|
|
952
922
|
export const RETIRED_DOMAINS = {
|
|
953
923
|
runtime: {
|
|
954
924
|
retiredIn: "11.0.0",
|
|
955
925
|
now: "governance (autonomy / commandPolicy / approvalRequire) and limits (rateLimitPerMin / maxTaskCostUsd / maxTaskTokens / maxPrincipalCostUsd / costQuotaWindowSec)",
|
|
956
|
-
migration: "SS-M1",
|
|
957
926
|
},
|
|
958
927
|
};
|
|
959
928
|
/** 是不是一个retired 域名(墓碑表成员)。 */
|
|
@@ -973,8 +942,7 @@ export function retiredDomainSentence(domain) {
|
|
|
973
942
|
// (CLI/桌面单机形正是热更新战役的主诉求形)。同族先例:governance 当年也是从 runtime 拆成独立顶层域。
|
|
974
943
|
//
|
|
975
944
|
// 五个限额键(rateLimitPerMin / maxTaskCostUsd / maxTaskTokens / maxPrincipalCostUsd / costQuotaWindowSec)11.0.0 起只住这里:
|
|
976
|
-
// 旧位 `runtime` 域已retired(墓碑见 {@link RETIRED_DOMAINS}
|
|
977
|
-
// 「新位赢」的生效读法)。
|
|
945
|
+
// 旧位 `runtime` 域已retired(墓碑见 {@link RETIRED_DOMAINS}:带事实的 runtime 文档读写两面拒,拒句点名今天的两个位)。
|
|
978
946
|
//
|
|
979
947
|
// 判据分工(**宽进严出**,与既有域一致):本域只判**结构**——类型、有限数、数组/记录的元素类型。
|
|
980
948
|
// 业务域值(下限、`0` 关断哨兵、跨键不变量如「窗长必 > 0」「runStaleSec 必严格大于心跳」)的判据属主
|
|
@@ -1801,8 +1769,8 @@ export const WorkerLifecycle = z.object({
|
|
|
1801
1769
|
dependsOn: z.array(z.string().min(1)).optional(),
|
|
1802
1770
|
});
|
|
1803
1771
|
/** 7.0.0 删除的 worker 字段(6.x 存储形)→ 它的新位。墓碑字段写在每个旧键原来所在的对象里({@link retiredKey}):在场即拒、拒句点名
|
|
1804
|
-
*
|
|
1805
|
-
const sixXField = (now) => ({ retiredIn: "7.0.0", now
|
|
1772
|
+
* 新位 —— 不让一行旧数据以「什么都没声明」的样子过闸(zod 会静默剥掉不认识的键)。 */
|
|
1773
|
+
const sixXField = (now) => ({ retiredIn: "7.0.0", now });
|
|
1806
1774
|
const WorkerSecretRefs = z.object({
|
|
1807
1775
|
/** NAME of the host env var holding the model API key → service MODEL_API_KEY (或 anthropic 时 ANTHROPIC_API_KEY). */
|
|
1808
1776
|
apiKeyEnv: ENV_NAME,
|
|
@@ -1826,13 +1794,13 @@ const WorkerSecretRefs = z.object({
|
|
|
1826
1794
|
* 7.0.0 增删(M-R2 结构块):
|
|
1827
1795
|
* · **加** `REMOTE_EXEC` / `REQUIRE_EXECUTION_LANE` + 车道表({@link EXECUTION_LANES})里**全部**车道 env 名 —— 车道有了结构位
|
|
1828
1796
|
* `runtime.execution`,逃生口再能设车道就是两把尺。这是对 0.1.30「执行基座键不保留」的**反转**:当年不保留是因为没有结构位
|
|
1829
|
-
* (活舰队 direct = k8s、canary = e2b 只能在 `worker.env` 里设)
|
|
1797
|
+
* (活舰队 direct = k8s、canary = e2b 只能在 `worker.env` 里设);存量 6.x 行由墓碑字段与保留名拒句接住(26.0.0 起不再有迁移搬)。
|
|
1830
1798
|
* 别的域也读的名(`MINIO_*`、`LOG_LEVEL`、`REMOTE_EXEC_HOME_DIR`)不在车道表里,照旧不保留。
|
|
1831
1799
|
* · **加** `DB_BACKEND` / `MEMORY_ENGINE` / `MEMORY_ENGINE_BACKEND` —— `runtime.store` 产出它们。
|
|
1832
1800
|
* · **删** `MEMORY_BACKEND`(引擎从不读的死名,渲染器不再产出)与 `TIDB_*` 族(引擎的墓碑名,见之拒启;结构字段不再产出它们)。
|
|
1833
1801
|
* MYSQL_* / PG_* 两族归 `runtime.store.db` + `secretRefs.dbPasswordEnv`。
|
|
1834
1802
|
* 18.0.0 删 `REQUIRE_EXECUTION_LANE`:每个部署都点名车道之后它恒真,不再是旋钮 —— 引擎不读、渲染器不写,名字进墓碑表 `RETIRED_ENVS`(去向 `REMOTE_EXEC`);
|
|
1835
|
-
* 逃生口里写它 ⇒ 墓碑句(下一段的第二个问题)
|
|
1803
|
+
* 逃生口里写它 ⇒ 墓碑句(下一段的第二个问题)。
|
|
1836
1804
|
*
|
|
1837
1805
|
* `env` / `secretEnv` 的写闸问**两张表**,各答一个问题,互相独立:
|
|
1838
1806
|
* · 本表答「规格作者可不可以自己设这个名」—— 不可以:它归某个结构字段,或归渲染器 / 编排器写,或与渲染器 / 编排器写的名互斥(拒句指路到那个写位);
|
|
@@ -1901,13 +1869,13 @@ const RESERVED_ENV_FIELD = Object.freeze({
|
|
|
1901
1869
|
export const RESERVED_WORKER_ENV = new Set(Object.keys(RESERVED_ENV_FIELD));
|
|
1902
1870
|
/**
|
|
1903
1871
|
* 保留名被 `env` / `secretEnv` 逃生口设置时的拒因:点名键 + 它的唯一写位。句尾恒是「set it via <字段>」(下游按它抽归属字段,不动)。
|
|
1904
|
-
* **迁移指路只有一条规则(7.0.1;16.0.0 起点名哪一条)**:这个键「旧形 ⇒
|
|
1905
|
-
* 带搬它那一条迁移的指路句(`migrationSignpost`:
|
|
1906
|
-
* 不带 —— 指一条跑了也没用的迁移比不指更糟。
|
|
1872
|
+
* **迁移指路只有一条规则(7.0.1;16.0.0 起点名哪一条)**:这个键「旧形 ⇒ 一条还在的迁移能搬」(`LATE_LANE_ENV_KEYS`,与迁移读同一张表)就在键名后
|
|
1873
|
+
* 带搬它那一条迁移的指路句(`migrationSignpost`),并说出迁移在哪种行上搬它(表行的 `onRow`:26.0.0 起 6.x 行的改写删了,没有 `runtime.execution` 的行上
|
|
1874
|
+
* 同一个键迁移不动);别的保留名(`PORT` / `MODEL_*` / 6.x 行的车道与店键 …)不带 —— 指一条跑了也没用的迁移比不指更糟。
|
|
1907
1875
|
*/
|
|
1908
1876
|
function reservedKeyIssue(slot, key) {
|
|
1909
|
-
const migration =
|
|
1910
|
-
const signpost = migration !== undefined ? " (" + migrationSignpost(migration.migration, migration.before) + ")" : "";
|
|
1877
|
+
const migration = LATE_LANE_ENV_KEYS.get(key);
|
|
1878
|
+
const signpost = migration !== undefined ? " (" + migrationSignpost(migration.migration, migration.before) + " — it moves this key only on " + migration.onRow + ")" : "";
|
|
1911
1879
|
return buildQuotedIssue `${fixed(slot)} cannot set reserved key "${key}"${fixed(signpost)} — set it via ${fixed(RESERVED_ENV_FIELD[key])}`;
|
|
1912
1880
|
}
|
|
1913
1881
|
/** 逃生口里有墓碑表的旧名 ⇒ 一条 issue,句子是墓碑句本身(`retiredEnvRefusal` —— 唯一铸点,本包不另拼;句里只有表里的名,不回显值)。 */
|
|
@@ -2446,16 +2414,13 @@ export const WorkerStatus = z.object({
|
|
|
2446
2414
|
// 是探测数据齐备后的**独立开关**,E2 placement 承接,切换前沿用计数制兜底、不按票数)。
|
|
2447
2415
|
// - `approved` NEW —— 默认 false = 待批(不参与自动排布;enforcement 随 E2 placement 生效,E1 只落契约)。
|
|
2448
2416
|
// 存量迁移 = grandfathering 批量回填 approved:true(0.5 → 0.6 迁移工具,11.0.0 随 `./migrate` 出口删除),存量机器不出现排布空窗(§11-9)。
|
|
2449
|
-
/** DNS-label bound on a host NAME (0.8.0 tightening;
|
|
2450
|
-
* rewrites 0.7-era stored data over it both read this constant). */
|
|
2417
|
+
/** DNS-label bound on a host NAME (0.8.0 tightening; one constant — the schema reads it, and so does every message that names it). */
|
|
2451
2418
|
export const HOST_NAME_MAX = 63;
|
|
2452
2419
|
/** Ceiling on the hosts ARRAY (0.8.0 tightening; same single-source rule as {@link HOST_NAME_MAX}). */
|
|
2453
2420
|
export const HOSTS_ARRAY_MAX = 1024;
|
|
2454
|
-
/** 两条上界的拒句尾:0.8.0 之前存下的超界数据由一次性迁移 SS-M2 改写(11.0.0 起读侧不再夹紧)。 */
|
|
2455
|
-
const HOSTS_BOUND_SIGNPOST = migrationSignpost("SS-M2", "0.8.0");
|
|
2456
2421
|
export const HostEntry = z.object({
|
|
2457
2422
|
// .max(HOST_NAME_MAX=63) = DNS-label bound (E2 F3③ 挂账收账, 0.8.0): web-admin-side probe clamp stays as双保险.
|
|
2458
|
-
name: z.string().min(1).max(HOST_NAME_MAX, `host name longer than ${HOST_NAME_MAX} characters (a DNS label)
|
|
2423
|
+
name: z.string().min(1).max(HOST_NAME_MAX, `host name longer than ${HOST_NAME_MAX} characters (a DNS label)`).regex(/^[a-z0-9][a-z0-9-]*$/, "lowercase letters/digits/-, no spaces"),
|
|
2459
2424
|
/** 待批准入编状态机(§2-3):自注册/新登记默认 false = 待批,不参与自动排布;admin 批准(走 publish)→
|
|
2460
2425
|
* true 参排(enforcement 随 E2)。只管**自动排布**:`placement.auto:false` 的 worker 的 `host` 是钉,钉在哪台由运维写定、与这里无关;
|
|
2461
2426
|
* `auto:true` 的 worker 只会被排到已批准的 host 上(钉 / 提示按 {@link WorkerSpec} 的 `placement.auto` 判)。 */
|
|
@@ -2471,8 +2436,8 @@ export const HostEntry = z.object({
|
|
|
2471
2436
|
export const HostsConfig = z
|
|
2472
2437
|
// .max(HOSTS_ARRAY_MAX=1024) hosts (E2 F3③ 挂账收账, 0.8.0) — a fleet host registry, not a datacenter inventory;
|
|
2473
2438
|
// an absurdly long array is a poisoned publish, fail-loud at save time. The read path judges with the same schema
|
|
2474
|
-
// (11.0.0: the 0.8.1 read-side clamp is gone;
|
|
2475
|
-
.object({ hosts: z.array(HostEntry).max(HOSTS_ARRAY_MAX, `more than ${HOSTS_ARRAY_MAX} hosts
|
|
2439
|
+
// (11.0.0: the 0.8.1 read-side clamp is gone; stored data over these bounds reads as a bad entry / a defaulted domain, with a warning).
|
|
2440
|
+
.object({ hosts: z.array(HostEntry).max(HOSTS_ARRAY_MAX, `more than ${HOSTS_ARRAY_MAX} hosts`).prefault([]) })
|
|
2476
2441
|
.superRefine((cfg, ctx) => {
|
|
2477
2442
|
const seen = new Set();
|
|
2478
2443
|
cfg.hosts.forEach((h, i) => {
|
|
@@ -32,8 +32,8 @@ export declare const WEB_ADMIN_CREDENTIAL_ENVELOPE_KIND: "user-session";
|
|
|
32
32
|
* 文件**取当前值,不用内存旧值(另一个写者可能刚轮换过)。
|
|
33
33
|
* · `expiresAt` —— 访问令牌到期时刻(RFC 3339)。
|
|
34
34
|
* · `issuer` —— 签发它的 web-admin 的**基础 URL**(与读方连 web-admin 的根 URL 同形,可带路径前缀):续签只向同源的 web-admin 发,
|
|
35
|
-
* 同不同源由读方比。URL
|
|
36
|
-
* query / fragment
|
|
35
|
+
* 同不同源由读方比。URL 形判据是包内那一只 URL 判官 {@link NON_SECRET_URL}(http(s)、有 host、userinfo 与
|
|
36
|
+
* query / fragment 里不许夹带凭据)—— 本包不另写一份更窄的 URL 律。
|
|
37
37
|
*/
|
|
38
38
|
export declare const WebAdminCredentialEnvelope: z.ZodObject<{
|
|
39
39
|
kind: z.ZodLiteral<"user-session">;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { z } from "zod";
|
|
23
23
|
import { looksLikeJwt } from "./api/auth-bridge.js";
|
|
24
|
-
import {
|
|
24
|
+
import { NON_SECRET_URL } from "./types.js";
|
|
25
25
|
import { buildQuotedIssue } from "./quoted-issue.js";
|
|
26
26
|
import { RFC3339_DATE_TIME } from "./rfc3339.js"; // the package's one RFC 3339 date-time judge (a project registration's `archivedAt` reads the same one)
|
|
27
27
|
import { WEB_ADMIN_ENV } from "./web-admin-env.js";
|
|
@@ -46,8 +46,8 @@ const TokenString = z.string().regex(TOKEN_CHARS, "must be a token: printable AS
|
|
|
46
46
|
* 文件**取当前值,不用内存旧值(另一个写者可能刚轮换过)。
|
|
47
47
|
* · `expiresAt` —— 访问令牌到期时刻(RFC 3339)。
|
|
48
48
|
* · `issuer` —— 签发它的 web-admin 的**基础 URL**(与读方连 web-admin 的根 URL 同形,可带路径前缀):续签只向同源的 web-admin 发,
|
|
49
|
-
* 同不同源由读方比。URL
|
|
50
|
-
* query / fragment
|
|
49
|
+
* 同不同源由读方比。URL 形判据是包内那一只 URL 判官 {@link NON_SECRET_URL}(http(s)、有 host、userinfo 与
|
|
50
|
+
* query / fragment 里不许夹带凭据)—— 本包不另写一份更窄的 URL 律。
|
|
51
51
|
*/
|
|
52
52
|
export const WebAdminCredentialEnvelope = z
|
|
53
53
|
.object({
|
|
@@ -55,7 +55,7 @@ export const WebAdminCredentialEnvelope = z
|
|
|
55
55
|
accessToken: TokenString.refine(looksLikeJwt, buildQuotedIssue `must be a JWT (three dot-separated segments) — a worker pull token never goes into an envelope`),
|
|
56
56
|
refreshToken: TokenString,
|
|
57
57
|
expiresAt: RFC3339_DATE_TIME,
|
|
58
|
-
issuer:
|
|
58
|
+
issuer: NON_SECRET_URL,
|
|
59
59
|
})
|
|
60
60
|
.strict();
|
|
61
61
|
/** 信封自己的字段名(schema 的键 —— reason 里只许出现这几个名字,不许出现用户写的键)。 */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 包内私有(不进主桶、不进 exports 表):workers 域**一行**的终判与它的拒句拼装 —— 只此一处。两个调用方各判一种形:读口 `readWorkersRows`
|
|
3
|
-
* 判**存储形**的行(读不进 ⇒ 扣下),一次性迁移 SS-
|
|
3
|
+
* 判**存储形**的行(读不进 ⇒ 扣下),一次性迁移 SS-M12 判**改写后**的行(读不进 ⇒ 不写回半成品,收据 `refused`)。
|
|
4
4
|
*
|
|
5
5
|
* 判据只有读侧那一只 schema:只含这一行的 workers 域读不读得进(`WorkersConfig` —— 与 `parseDomain("workers")` 同一只,不另抄任何规则)。
|
|
6
6
|
* 拒句 = `<主语> is not a valid WorkerSpec — <至多三条 issue 的「坐标: 句子」>( (+n more))`,主语点名判的是哪一形(闭集两词);句中坐标已过出门那一道。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 包内私有(不进主桶、不进 exports 表):workers 域**一行**的终判与它的拒句拼装 —— 只此一处。两个调用方各判一种形:读口 `readWorkersRows`
|
|
3
|
-
* 判**存储形**的行(读不进 ⇒ 扣下),一次性迁移 SS-
|
|
3
|
+
* 判**存储形**的行(读不进 ⇒ 扣下),一次性迁移 SS-M12 判**改写后**的行(读不进 ⇒ 不写回半成品,收据 `refused`)。
|
|
4
4
|
*
|
|
5
5
|
* 判据只有读侧那一只 schema:只含这一行的 workers 域读不读得进(`WorkersConfig` —— 与 `parseDomain("workers")` 同一只,不另抄任何规则)。
|
|
6
6
|
* 拒句 = `<主语> is not a valid WorkerSpec — <至多三条 issue 的「坐标: 句子」>( (+n more))`,主语点名判的是哪一形(闭集两词);句中坐标已过出门那一道。
|
package/dist/workers-rows.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* workers 域的**逐行终判**(11.0.0 从 7.0.0 的一次性迁移里拆出 —— 那只函数同时装着「6.x 形改写」与「逐行终判」两件事;改写搬进
|
|
3
|
-
* 一次性迁移 SS-
|
|
3
|
+
* 一次性迁移(今天是 SS-M12),终判留在这里,是 workers 域的**永久读语义**,不是迁移)。纯函数、无 I/O、不改入参。
|
|
4
4
|
*
|
|
5
5
|
* ## 为什么要逐行
|
|
6
6
|
* workers 是 gate 域(读即抛):整域 `parseDomain("workers")` 遇一行坏就整域抛,舰队清单整份读不出 —— 一只坏 worker 拖黑整个舰队。
|
|
7
7
|
* web-admin 的 workers 读口先过本函数:每一只**认得出名字**的 worker 单独过读侧自己的判据(只含这一行的 workers 域读不读得进,
|
|
8
8
|
* `WorkersConfig` —— 与 `parseDomain("workers")` 同一只 schema,不另抄任何规则;判据与拒句拼装在包内私有的 `./worker-row-verdict`,
|
|
9
|
-
* 一次性迁移 SS-
|
|
9
|
+
* 一次性迁移 SS-M12 判改写后的行调同一只);读不进的那一行扣下(`held`,带原文与拒因),
|
|
10
10
|
* 其余照常进 `doc`。整域读侧仍是最后围栏,只剩两类归它:认不出名字的条目(不是朴素 JSON 对象〔类实例 / `Map` / `Date` 一类,JSON 解析不出来,走到这里只能是程序拼的〕/ 没有字符串名字 —— 原样留在 `doc`;
|
|
11
11
|
* 非朴素的**坏**行因此不在这里单行扣下,而是交整域 `parseDomain("workers")` 判,整张舰队清单读不出 —— 响亮、fail-closed,只落在非 JSON 值上)与跨行规则
|
|
12
12
|
* (名字 / 路由前缀唯一 —— 两行单独都读得进、合起来才不行,这里不替运维挑留哪一行)。
|
package/dist/workers-rows.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* workers 域的**逐行终判**(11.0.0 从 7.0.0 的一次性迁移里拆出 —— 那只函数同时装着「6.x 形改写」与「逐行终判」两件事;改写搬进
|
|
3
|
-
* 一次性迁移 SS-
|
|
3
|
+
* 一次性迁移(今天是 SS-M12),终判留在这里,是 workers 域的**永久读语义**,不是迁移)。纯函数、无 I/O、不改入参。
|
|
4
4
|
*
|
|
5
5
|
* ## 为什么要逐行
|
|
6
6
|
* workers 是 gate 域(读即抛):整域 `parseDomain("workers")` 遇一行坏就整域抛,舰队清单整份读不出 —— 一只坏 worker 拖黑整个舰队。
|
|
7
7
|
* web-admin 的 workers 读口先过本函数:每一只**认得出名字**的 worker 单独过读侧自己的判据(只含这一行的 workers 域读不读得进,
|
|
8
8
|
* `WorkersConfig` —— 与 `parseDomain("workers")` 同一只 schema,不另抄任何规则;判据与拒句拼装在包内私有的 `./worker-row-verdict`,
|
|
9
|
-
* 一次性迁移 SS-
|
|
9
|
+
* 一次性迁移 SS-M12 判改写后的行调同一只);读不进的那一行扣下(`held`,带原文与拒因),
|
|
10
10
|
* 其余照常进 `doc`。整域读侧仍是最后围栏,只剩两类归它:认不出名字的条目(不是朴素 JSON 对象〔类实例 / `Map` / `Date` 一类,JSON 解析不出来,走到这里只能是程序拼的〕/ 没有字符串名字 —— 原样留在 `doc`;
|
|
11
11
|
* 非朴素的**坏**行因此不在这里单行扣下,而是交整域 `parseDomain("workers")` 判,整张舰队清单读不出 —— 响亮、fail-closed,只落在非 JSON 值上)与跨行规则
|
|
12
12
|
* (名字 / 路由前缀唯一 —— 两行单独都读得进、合起来才不行,这里不替运维挑留哪一行)。
|
package/dist/zod-unwrap.d.ts
CHANGED
package/dist/zod-unwrap.js
CHANGED
package/docs/API-SURFACE.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
> 每次全量重算并逐名比对 —— 加 / 删 / 改形一个导出而不重生成本档 ⇒ 红。导出面的每次变动因此以本档的 diff 出现在评审里。
|
|
5
5
|
> 形:`value` = 运行期拿得到的值;`type` = 只在类型层;`value+type` = 同名的值与类型(zod schema 与它推出的类型)。
|
|
6
6
|
|
|
7
|
-
子路径 24 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计
|
|
7
|
+
子路径 24 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计 1522 个(同名在多条子路径上各计一次)。
|
|
8
8
|
|
|
9
|
-
## `.`(
|
|
9
|
+
## `.`(798)
|
|
10
10
|
|
|
11
11
|
- `A2aConfig` — value+type
|
|
12
12
|
- `A2aPeerSpec` — value+type
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
- `DroppedEntryIdentity` — type
|
|
144
144
|
- `DroppedEntryReasonCode` — type
|
|
145
145
|
- `ENGINE_OWNED_HOOK_EVENTS` — value
|
|
146
|
+
- `ENGINE_OWNED_HOOK_EVENT_SINCE` — value
|
|
146
147
|
- `ENGINE_SIGNAL_KEY` — value
|
|
147
148
|
- `ENV_MODELS_DECISIONS` — value
|
|
148
149
|
- `ENV_MODELS_DOCUMENT` — value
|
|
@@ -159,6 +160,7 @@
|
|
|
159
160
|
- `ElicitationHookInput` — value
|
|
160
161
|
- `ElicitationResultHookInput` — value
|
|
161
162
|
- `EngineDraining` — value+type
|
|
163
|
+
- `EngineOwnedHookEvent` — type
|
|
162
164
|
- `EngineSignal` — value+type
|
|
163
165
|
- `EntitlementBudget` — value+type
|
|
164
166
|
- `EntitlementConfig` — value+type
|
|
@@ -329,7 +331,6 @@
|
|
|
329
331
|
- `ModelTier` — value+type
|
|
330
332
|
- `ModelsConfig` — value+type
|
|
331
333
|
- `NON_SECRET_URL` — value
|
|
332
|
-
- `NON_SECRET_URL_NO_MIGRATION` — value
|
|
333
334
|
- `NOT_ROUTABLE_CODES` — value
|
|
334
335
|
- `NotRoutableCode` — type
|
|
335
336
|
- `NotificationHookInput` — value
|
|
@@ -654,6 +655,7 @@
|
|
|
654
655
|
- `effectiveScopeRole` — value
|
|
655
656
|
- `emptyEffective` — value
|
|
656
657
|
- `enabledEntryCount` — value
|
|
658
|
+
- `engineOwnsHookEventAt` — value
|
|
657
659
|
- `envModelTableDeclared` — value
|
|
658
660
|
- `envModelTableWriteRefusal` — value
|
|
659
661
|
- `envModelsDecisionTag` — value
|
|
@@ -805,7 +807,7 @@
|
|
|
805
807
|
- `writeRoleFor` — value
|
|
806
808
|
- `wsUrlFlaws` — value
|
|
807
809
|
|
|
808
|
-
## `./types`(
|
|
810
|
+
## `./types`(153)
|
|
809
811
|
|
|
810
812
|
- `A2aConfig` — value+type
|
|
811
813
|
- `A2aPeerSpec` — value+type
|
|
@@ -873,7 +875,6 @@
|
|
|
873
875
|
- `ModelTier` — value+type
|
|
874
876
|
- `ModelsConfig` — value+type
|
|
875
877
|
- `NON_SECRET_URL` — value
|
|
876
|
-
- `NON_SECRET_URL_NO_MIGRATION` — value
|
|
877
878
|
- `PARSE_TRANSPARENT_KEYS` — value
|
|
878
879
|
- `PLUGIN_ORIGIN` — value
|
|
879
880
|
- `PRIVATE_KEY_PEM_HEADER` — value
|
|
@@ -1273,9 +1274,8 @@
|
|
|
1273
1274
|
- `writeEnvModelsDecisionSync` — value
|
|
1274
1275
|
- `writeRemoteExec` — value
|
|
1275
1276
|
|
|
1276
|
-
## `./one-time-migrations`(
|
|
1277
|
+
## `./one-time-migrations`(13)
|
|
1277
1278
|
|
|
1278
|
-
- `DocumentCoverage` — type
|
|
1279
1279
|
- `MIGRATION_APPLIED_AS` — value
|
|
1280
1280
|
- `MigrationAppliedAs` — type
|
|
1281
1281
|
- `MigrationDocument` — type
|
|
@@ -1287,12 +1287,8 @@
|
|
|
1287
1287
|
- `OneTimeMigrationWindow` — type
|
|
1288
1288
|
- `StoredDocuments` — type
|
|
1289
1289
|
- `StoredDocumentsMigration` — type
|
|
1290
|
-
- `WIRE_RETIREMENT_IDS` — value
|
|
1291
|
-
- `WireRetirementId` — type
|
|
1292
1290
|
- `migrateEffectiveSnapshot` — value
|
|
1293
|
-
- `migrateSchedulerRecords` — value
|
|
1294
1291
|
- `migrateStoredDocuments` — value
|
|
1295
|
-
- `urlSeatPatterns` — value
|
|
1296
1292
|
|
|
1297
1293
|
## `./scheduler-store`(10)
|
|
1298
1294
|
|
|
@@ -1307,7 +1303,7 @@
|
|
|
1307
1303
|
- `parseSchedulerStore` — value
|
|
1308
1304
|
- `serializeSchedulerStore` — value
|
|
1309
1305
|
|
|
1310
|
-
## `./hooks`(
|
|
1306
|
+
## `./hooks`(103)
|
|
1311
1307
|
|
|
1312
1308
|
- `AgentHookEntry` — value+type
|
|
1313
1309
|
- `AssistantTurnError` — value+type
|
|
@@ -1323,8 +1319,10 @@
|
|
|
1323
1319
|
- `DIRECTORY_ADDED_SOURCES` — value
|
|
1324
1320
|
- `DirectoryAddedHookInput` — value+type
|
|
1325
1321
|
- `ENGINE_OWNED_HOOK_EVENTS` — value
|
|
1322
|
+
- `ENGINE_OWNED_HOOK_EVENT_SINCE` — value
|
|
1326
1323
|
- `ElicitationHookInput` — value
|
|
1327
1324
|
- `ElicitationResultHookInput` — value
|
|
1325
|
+
- `EngineOwnedHookEvent` — type
|
|
1328
1326
|
- `FileChangedHookInput` — value
|
|
1329
1327
|
- `HOOKS_CLASSIFICATION_OUTCOMES` — value
|
|
1330
1328
|
- `HOOKS_DROPPED_PIECE_CODES` — value
|
|
@@ -1405,6 +1403,7 @@
|
|
|
1405
1403
|
- `WorktreeCreateHookInput` — value
|
|
1406
1404
|
- `WorktreeRemoveHookInput` — value
|
|
1407
1405
|
- `classifyHooksConfig` — value
|
|
1406
|
+
- `engineOwnsHookEventAt` — value
|
|
1408
1407
|
- `hookMatcherForm` — value
|
|
1409
1408
|
- `hookMatcherSelects` — value
|
|
1410
1409
|
- `interpolateHookEnvVars` — value
|