@sema-agent/settings-schema 32.0.0 → 33.0.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.
@@ -185,7 +185,7 @@ export declare class RetiredDomainError extends Error {
185
185
  * 一句中性 TypeError;逐条丢弃域里条目体内有被剥的键且救不活 = `unrecognized_keys` 的 ZodError)。`message` 点名域并接原拒的句子 —— 原拒已脱敏,这里不读任何
186
186
  * 脱敏之前的东西;原拒的句子读不出 ⇒ 只留点名域的前半句。
187
187
  * 铸点只有一处(视图面读的整域档位,{@link readViewOr})。单域读口(`parseDomain` / `parseDomainLoud` / `parseDomainSalvaged`)照抛原拒 —— 调用方自己点了域;
188
- * 目录域整域读不进不抛:回落默认 + 一条 `domain-defaulted`,告警的 `error` 就是这里的 `cause`,告警自带 `domain`。retired 域的墓碑拒是另一件事({@link RetiredDomainError})。
188
+ * 目录域整域读不进不抛:回落默认 + 一条 `domain-defaulted`,告警的 `error` 与这里的 `cause` 是同一只原拒的 `issues`(另一只对象:同类、同 `issues`,`message` 换成一句话),告警自带 `domain`。retired 域的墓碑拒是另一件事({@link RetiredDomainError})。
189
189
  */
190
190
  export declare class DomainReadRefusedError extends Error {
191
191
  readonly domain: DomainName;
@@ -314,6 +314,14 @@ export declare function isReportableRefusalName(name: string): boolean;
314
314
  * 摘要输入取 `JSON.stringify(name)`:UTF-8 编码会把孤立代理项换成 U+FFFD(`"\ud800"` / `"\ud801"` / `"\ufffd"` 三个不同的名同一串字节),
315
315
  * JSON 串形逐个 UTF-16 码元保留(孤立代理项写成转义)—— 不同的名恒是不同的输入。 */
316
316
  export declare function withheldNameToken(name: string): string;
317
+ /**
318
+ * 一个坐标落进的那一条**条目**的身份(只带可披露的名与 id,见 {@link DroppedEntryIdentity}):坐标形如 `[<集合字段>, <下标>, …]` 且文档里那一处是数组里的一个条目 ⇒ 读它的身份;
319
+ * 否则(域级的键、整份文档、Record 里的值)⇒ `undefined`。条目身份的读法只有 {@link readEntryIdentity} 一只:`entry-dropped` 的身份由抢救记账时对那一条原文调它;
320
+ * 按坐标找到那一条再调它的,是这一只 —— `domain-defaulted`(抢救账里没有那一条时)与命令行报告的 `refused[]` 说「是哪一条」读它。坐标只给下标,
321
+ * 消费方自己渲染诊断、要点名一条条目时调它(`doc` 是坐标所指的那份文档的原文,`path` 是 {@link ConfigPath}),不另写一份读名字的代码。读文档只走内核的自有成员读;
322
+ * 读不出(含 `path` 不是数组、读它就抛)⇒ `undefined`,从不抛。
323
+ */
324
+ export declare function readEntryIdentityAt(doc: unknown, path: ConfigPath): DroppedEntryIdentity | undefined;
317
325
  /** 抢救造成的**下标位移表**:被压缩过的数组 → 它压缩后每个位置的**原**下标(`kept[j]` = 压缩后第 j 条
318
326
  * 在原文档里的下标)。纯数据,无行为。
319
327
  *
@@ -411,10 +419,17 @@ export declare function statusRowsToPrune(rows: {
411
419
  * 0.19.0 加了两个 kind(additive union member —— 用 `switch` 穷举本类型的消费方需补臂):
412
420
  * `"unknown-keys-dropped"` / `"unread-config-file"`,成案见 {@link droppedKeys}(消费方
413
421
  * #322:配置写了、进程跑着、值没到,而没有任何一个字说出来)。 */
414
- export type EffectiveReadWarning = {
422
+ export type EffectiveReadWarning =
423
+ /** 整个域读不进、按 schema 缺省读。`error` 与判官的原拒同类、同 `issues`(`ZodError` 的 `issues` 一字不动;仍是 `Error` 的实例、带 `stack`),它的 `message` 是**一句话**(整域按缺省读 · 为什么 · 触发的条目是谁 · 在这份文档里手改),不是多行的 JSON 数组文本。
424
+ * 另有三个可缺的键(加性):`path` = 触发的那一处坐标(原拒的第一条 issue 的坐标,出门形;可以是域级的键,如 `["default"]`);`identity` / `reasonCode` = 触发的**条目**是谁、为什么(坐标落在某个条目体内时才有,
425
+ * 与同一条条目在 `entry-dropped` 上的两键同一读法 —— 零幸存者时只剩这一条告警,身份与原因词就在这里)。三键不进符合性投影({@link projectWarning} 仍是 `{ kind, domain }`):它们是诊断,不是读法。 */
426
+ {
415
427
  domain: DomainName;
416
428
  kind: "domain-defaulted";
417
429
  error: unknown;
430
+ path?: ConfigPath;
431
+ identity?: DroppedEntryIdentity;
432
+ reasonCode?: DroppedEntryReasonCode;
418
433
  }
419
434
  /** 域文档里那些**不属于该域 schema** 的键:行为照旧(zod 非 strict = 剥掉,前向兼容不动),但点名
420
435
  * 说出来。`keys` = 段坐标({@link ConfigPath};`["infraCostRates","toolCalMicroUsd"]` /
@@ -527,6 +542,7 @@ export declare function projectWarning(w: EffectiveReadWarning): WarningProjecti
527
542
  * 说的就是这件事。{@link salvageEntries} 铸 `entry-dropped` 时用的是它**入参**那份文档的坐标;若那份文档本身被外层
528
543
  * 压缩过,外层照样要回写它一次。今天读路径上只有一个压缩点(11.0.0 起 hosts 的读侧夹紧臂已retired),所以这一臂当下
529
544
  * 只对 `keptIndex` 为空的表恒等;把「不动」写成一条臂的性质,就是把「哪一层」这件事错记在了「哪个 kind」上。
545
+ * `domain-defaulted` 的可缺坐标 `path`(33.0.0)同理:在场就回写,缺席就原样。
530
546
  *
531
547
  * **恒等纪律**:没有任何一条路径真的变了(含 `keptIndex` 为空)⇒ 返回**同一个对象引用**,连 `keys`
532
548
  * 数组也不复制(好数据穿过读路径 byte 不变)。
@@ -20,6 +20,7 @@ import { MODEL_ENTRY_REFUSAL_CODES, ModelRefusalsWire } from "./fleet.js";
20
20
  import { UNINSPECTABLE, dataDescriptor, emptyDocument, guardedSafeParse, inspect, isAccessorDescriptor, isolatedObject, ownEntriesOf, ownRow, ownValueOf } from "./own-key-read.js";
21
21
  import { stableStringify } from "./hash.js";
22
22
  import { ownEnabledFlag } from "./catalog-manages.js";
23
+ import { causeText, defaultedDomainSentence, droppedEntrySentence, identityText, issueSentence } from "./read-sentences.js"; // package-private: the one wording of the read-leg diagnostic sentences
23
24
  import { isJsonArray, isPlainJsonObject, jsonShapeOf } from "./plain-json-object.js";
24
25
  import { carriesUserinfo, secretScanForms } from "./secret-scan.js"; // package-private normalization (both scanners read it) + the userinfo judgement (not in the barrel)
25
26
  import { sha256Hex } from "./sha256.js";
@@ -338,7 +339,7 @@ export class RetiredDomainError extends Error {
338
339
  * 一句中性 TypeError;逐条丢弃域里条目体内有被剥的键且救不活 = `unrecognized_keys` 的 ZodError)。`message` 点名域并接原拒的句子 —— 原拒已脱敏,这里不读任何
339
340
  * 脱敏之前的东西;原拒的句子读不出 ⇒ 只留点名域的前半句。
340
341
  * 铸点只有一处(视图面读的整域档位,{@link readViewOr})。单域读口(`parseDomain` / `parseDomainLoud` / `parseDomainSalvaged`)照抛原拒 —— 调用方自己点了域;
341
- * 目录域整域读不进不抛:回落默认 + 一条 `domain-defaulted`,告警的 `error` 就是这里的 `cause`,告警自带 `domain`。retired 域的墓碑拒是另一件事({@link RetiredDomainError})。
342
+ * 目录域整域读不进不抛:回落默认 + 一条 `domain-defaulted`,告警的 `error` 与这里的 `cause` 是同一只原拒的 `issues`(另一只对象:同类、同 `issues`,`message` 换成一句话),告警自带 `domain`。retired 域的墓碑拒是另一件事({@link RetiredDomainError})。
342
343
  */
343
344
  export class DomainReadRefusedError extends Error {
344
345
  domain;
@@ -501,7 +502,8 @@ export function withheldNameToken(name) {
501
502
  }
502
503
  /** 一条被丢条目原文的身份({@link DroppedEntryIdentity} 的**唯一**读法)。只看纯 JSON 对象的**自有数据
503
504
  * 属性**;任何反射/陷阱抛错 ⇒ 当作读不出(身份是诊断面的附件,绝不许把抢救拖下水)。`enabled` 读的是「显式停用」的那一只
504
- * ({@link ownEnabledFlag},`./catalog-manages`):目录管不管模型面的原文判官与这里同一份读法。 */
505
+ * ({@link ownEnabledFlag},`./catalog-manages`):目录管不管模型面的原文判官与这里同一份读法。
506
+ * 包内私有:公开的读口是按坐标读的 {@link readEntryIdentityAt}。 */
505
507
  function readEntryIdentity(entry) {
506
508
  try {
507
509
  if (!isPlainJsonObject(entry))
@@ -524,6 +526,28 @@ function readEntryIdentity(entry) {
524
526
  return undefined;
525
527
  }
526
528
  }
529
+ /**
530
+ * 一个坐标落进的那一条**条目**的身份(只带可披露的名与 id,见 {@link DroppedEntryIdentity}):坐标形如 `[<集合字段>, <下标>, …]` 且文档里那一处是数组里的一个条目 ⇒ 读它的身份;
531
+ * 否则(域级的键、整份文档、Record 里的值)⇒ `undefined`。条目身份的读法只有 {@link readEntryIdentity} 一只:`entry-dropped` 的身份由抢救记账时对那一条原文调它;
532
+ * 按坐标找到那一条再调它的,是这一只 —— `domain-defaulted`(抢救账里没有那一条时)与命令行报告的 `refused[]` 说「是哪一条」读它。坐标只给下标,
533
+ * 消费方自己渲染诊断、要点名一条条目时调它(`doc` 是坐标所指的那份文档的原文,`path` 是 {@link ConfigPath}),不另写一份读名字的代码。读文档只走内核的自有成员读;
534
+ * 读不出(含 `path` 不是数组、读它就抛)⇒ `undefined`,从不抛。
535
+ */
536
+ export function readEntryIdentityAt(doc, path) {
537
+ const read = inspect(() => {
538
+ if (!isJsonArray(path))
539
+ return undefined;
540
+ const [field, index] = path;
541
+ if (typeof field !== "string" || typeof index !== "number" || !isPlainJsonObject(doc))
542
+ return undefined;
543
+ const collection = ownValueOf(doc, field);
544
+ if (!collection.ok || !isJsonArray(collection.value))
545
+ return undefined;
546
+ const entry = ownValueOf(collection.value, String(index));
547
+ return entry.ok ? readEntryIdentity(entry.value) : undefined;
548
+ });
549
+ return read.ok ? read.value : undefined;
550
+ }
527
551
  /** 一条记账行 → 它的 `entry-dropped` 告警。域面({@link buildEffective})与 wire 面(skills manifest)共用
528
552
  * 这**一只** —— 告警形只在这里拼,新字段不会在一条腿上漏铸。 */
529
553
  function entryDroppedWarning(domain, d) {
@@ -531,11 +555,47 @@ function entryDroppedWarning(domain, d) {
531
555
  domain,
532
556
  kind: "entry-dropped",
533
557
  path: d.path,
534
- error: d.error,
558
+ error: droppedEntryError(domain, d),
535
559
  ...(d.reasonCode === undefined ? {} : { reasonCode: d.reasonCode }),
536
560
  ...(d.identity === undefined ? {} : { identity: d.identity }),
537
561
  };
538
562
  }
563
+ /** 一条 issue 清单的**每条一句话**(坐标出门形的串 + 句子):`ZodError` 逐条 issue 读(联合取各选项的句子),别的错只有它的 `message`。读不出 ⇒ 空清单(诊断是旁路,不许把读拖下水)。 */
564
+ function pathedSentencesOf(error) {
565
+ const read = inspect(() => {
566
+ if (error instanceof z.ZodError)
567
+ return error.issues.map((i) => ({ path: formatConfigPath(i.path), sentence: issueSentence(i) }));
568
+ if (error instanceof Error)
569
+ return [{ path: "", sentence: issueSentence({ message: error.message }) }];
570
+ return [];
571
+ });
572
+ return read.ok ? read.value : [];
573
+ }
574
+ /** 给一只原拒换上**一句话**的 `message`(单行):`ZodError` ⇒ 同一份 `issues` 的新 `ZodError`(原对象不动 —— 它还在别处用:域读拒的 `cause`、公开的 {@link salvageEntries} 结果),
575
+ * `TypeError` ⇒ 一只新的 `TypeError`;别的错不认识 ⇒ 原样交回。铸不出 ⇒ 原样交回(旁路)。
576
+ * 新铸的 `ZodError` 是 zod 解析失败时交出的那一种(`ZodRealError`:`Error` 的实例、带 `stack`)—— 与原拒同读:按 `instanceof Error` 分流的读者读到的仍是一只错;
577
+ * `ZodError` 这只构造器本身铸的不是 `Error`。
578
+ * 句子出门前过本包唯一的脱敏器({@link redactSecrets}):句子里回显的串(键名、坐标、别人的句子)在铸句时已折成一行、剥掉一行回显的剥除集 ——
579
+ * 剥掉一个隔开的字符可以把两段拼成一个密钥形(`g<U+202E>hp_…` ⇒ `ghp_…`),所以脱敏判在剥之后、对最终的那一串再做一次。 */
580
+ function withSentence(error, sentence) {
581
+ const minted = inspect(() => {
582
+ const outgoing = redactSecrets(sentence);
583
+ if (error instanceof z.ZodError) {
584
+ const sentenced = new z.ZodRealError(error.issues);
585
+ sentenced.message = outgoing;
586
+ if (typeof Error.captureStackTrace === "function")
587
+ Error.captureStackTrace(sentenced, withSentence); // zod 铸错时不采栈(解析口事后补上);这里同样补上,栈头是这一句
588
+ return sentenced;
589
+ }
590
+ return error instanceof TypeError ? new TypeError(outgoing) : error;
591
+ });
592
+ return minted.ok ? minted.value : error;
593
+ }
594
+ /** `entry-dropped` 告警的 `error`:原拒的 `issues` 不动,`message` 是一句话 —— 哪一条、是谁、为什么、其余照常、手改回来({@link droppedEntrySentence})。 */
595
+ function droppedEntryError(domain, d) {
596
+ const sentence = inspect(() => droppedEntrySentence({ domain, entry: `entry ${formatConfigPath(d.path)}`, identity: identityText(d.identity), cause: causeText(pathedSentencesOf(d.error)) }));
597
+ return sentence.ok ? withSentence(d.error, sentence.value) : d.error;
598
+ }
539
599
  /** 一条被丢条目的记账行 —— `salvageEntries` 两种集合形(数组 / Record)共用的**唯一**铸点。词随判决来({@link EntryVerdict}),
540
600
  * 不在这里另行推断:判的那一刻才知道是哪种丢法。 */
541
601
  function droppedEntry(path, verdict, entry) {
@@ -643,15 +703,25 @@ function judgeEntry(element, entry, domain, from) {
643
703
  export function salvageEntries(schema, raw, domain) {
644
704
  if (!isDomainName(domain))
645
705
  throw new TypeError(`salvageEntries: "${outgoingSegment(String(domain))}" is not a config domain (the third argument names whose extension namespaces apply)`);
706
+ const { raw: salvaged, dropped, keptIndex } = salvageLedger(schema, raw, domain);
707
+ return { raw: salvaged, dropped, keptIndex };
708
+ }
709
+ /** 整域读不进时第一次判留下的抢救账,按它抛出去的那只原拒挂着(包内私有的旁路:公开读口抛的仍是原拒、对象与形都不变)。读腿告警 `domain-defaulted` 说「触发的是哪一条」读它,
710
+ * 不把文档再抢救一遍(有状态的 getter 下两遍读到的可以不是同一份)。范围照实:触发的条目在这本账里(条目本身坏)⇒ 身份与原因词都取账上的,不再读文档;
711
+ * 账里没有它(重名、悬空引用这类域级跨行规则把整域拒了)⇒ 身份按坐标回原文读那一条({@link readEntryIdentityAt}),集合字段多读一次。WeakMap:原拒没人留着,账随它一起走。 */
712
+ const LEDGER_OF_REFUSAL = new WeakMap();
713
+ /** 抢救的**完整账**(包内私有):{@link salvageEntries} 的结果,外加 `lost` = 「一个集合里条目全坏、所以一条没丢」的那些条目的记账行(零幸存者律:不凭空造出空集合)。
714
+ * 整域因此读不进时,它们就是病因 —— 读腿告警 `domain-defaulted` 点名其中的身份与原因词读的是这一份;公开的 {@link salvageEntries} 不带它(结果形不变)。 */
715
+ function salvageLedger(schema, raw, domain) {
646
716
  const layer = salvageLayer(schema, raw, domain, []);
647
- return { raw: layer.raw, dropped: layer.dropped, keptIndex: keptIndexOf(layer.shifts) };
717
+ return { raw: layer.raw, dropped: layer.dropped, keptIndex: keptIndexOf(layer.shifts), lost: layer.lost };
648
718
  }
649
719
  /** 一层抢救,抢不动就当没抢救(反射 / 访问器抛错:绝不外泄其文案)。最外层与每一条条目体内走的是**同一只** —— 一条条目体内抢不动,
650
720
  * 只是这一条不下钻、照原样去判,不连坐它所在的那一层。`origin` = 本层文档在域文档里的**原文**坐标(未脱敏、原下标;最外层 `[]`)——
651
721
  * 扩展命名空间按运维写下的段判,出门坐标(脱敏)另由 `outgoingPath` 铸。 */
652
722
  function salvageLayer(schema, raw, domain, origin) {
653
723
  const layer = inspect(() => salvageLayerUnsafe(schema, raw, domain, origin));
654
- return layer.ok ? layer.value : { raw, dropped: [], shifts: [] };
724
+ return layer.ok ? layer.value : { raw, dropped: [], shifts: [], lost: [] };
655
725
  }
656
726
  /** 「哪些字段是一组条目」的**唯一**派生(逐条抢救 {@link salvageLayerUnsafe} 与视图面判官 {@link entryHeldStrippedKeys} 同读这一只):
657
727
  * 根(拆掉包装层后)是对象 ⇒ 它的每个元素是条目({@link isEntrySchema})的数组 / Record 字段。元素不是条目的集合(值名单、凭据引用)是一个值,
@@ -694,10 +764,11 @@ function collectionSlots(value, isArray) {
694
764
  return isPlainJsonObject(value) ? Object.entries(value) : undefined;
695
765
  }
696
766
  function salvageLayerUnsafe(schema, raw, domain, origin) {
697
- const untouched = { raw, dropped: [], shifts: [] };
767
+ const untouched = { raw, dropped: [], shifts: [], lost: [] };
698
768
  if (!isPlainJsonObject(raw))
699
769
  return untouched;
700
770
  const dropped = [];
771
+ const lost = [];
701
772
  const shifts = [];
702
773
  const patch = {};
703
774
  for (const { field, isArray, element, keySchema } of entryCollectionsOf(schema)) {
@@ -735,6 +806,8 @@ function salvageLayerUnsafe(schema, raw, domain, origin) {
735
806
  innerShifts.push({ at: [...at, ...s.at], kept: s.kept });
736
807
  }
737
808
  // 零幸存者 ⇒ 没有要抢救的东西(见头注:绝不凭空造出一个空集合);什么都没上账 ⇒ 这个字段原样不动。
809
+ if (survivors.length === 0)
810
+ lost.push(...found); // 全坏的集合:一条不丢(不改 raw),但这些条目就是整域读不进的病因,记在 `lost` 里
738
811
  if (survivors.length === 0 || found.length === 0)
739
812
  continue;
740
813
  dropped.push(...found);
@@ -746,8 +819,8 @@ function salvageLayerUnsafe(schema, raw, domain, origin) {
746
819
  shifts.push(...innerShifts);
747
820
  }
748
821
  if (dropped.length === 0)
749
- return untouched;
750
- return { raw: { ...raw, ...patch }, dropped, shifts };
822
+ return lost.length === 0 ? untouched : { raw, dropped: [], shifts: [], lost };
823
+ return { raw: { ...raw, ...patch }, dropped, shifts, lost };
751
824
  }
752
825
  /** 段坐标记的位移账 → {@link EntryKeptIndex}(键 = 全路径的出门串)。同一个键出现两次只可能是两只被打码成同一串的 Record 键
753
826
  * (坐标本身已分不清是谁)⇒ 那个键不登记。什么都没压缩 ⇒ 冻结的共享空表。 */
@@ -847,6 +920,7 @@ export function projectWarning(w) {
847
920
  * 说的就是这件事。{@link salvageEntries} 铸 `entry-dropped` 时用的是它**入参**那份文档的坐标;若那份文档本身被外层
848
921
  * 压缩过,外层照样要回写它一次。今天读路径上只有一个压缩点(11.0.0 起 hosts 的读侧夹紧臂已retired),所以这一臂当下
849
922
  * 只对 `keptIndex` 为空的表恒等;把「不动」写成一条臂的性质,就是把「哪一层」这件事错记在了「哪个 kind」上。
923
+ * `domain-defaulted` 的可缺坐标 `path`(33.0.0)同理:在场就回写,缺席就原样。
850
924
  *
851
925
  * **恒等纪律**:没有任何一条路径真的变了(含 `keptIndex` 为空)⇒ 返回**同一个对象引用**,连 `keys`
852
926
  * 数组也不复制(好数据穿过读路径 byte 不变)。
@@ -866,8 +940,14 @@ export function rebaseWarningPaths(w, keptIndex) {
866
940
  const path = rebasePath(w.path, keptIndex);
867
941
  return path === w.path ? w : { ...w, path };
868
942
  }
869
- // 以下两臂不带任何坐标:点名的是错误 / 文件名。
870
- case "domain-defaulted":
943
+ // 33.0.0 起 `domain-defaulted` 可带一只坐标(`path`,触发的那一处):与 `entry-dropped` 同一条律 —— 铸它那一层用的是它入参那份文档的坐标,外层压缩过就回写一次。
944
+ case "domain-defaulted": {
945
+ if (w.path === undefined)
946
+ return w;
947
+ const path = rebasePath(w.path, keptIndex);
948
+ return path === w.path ? w : { ...w, path };
949
+ }
950
+ // 这一臂不带任何坐标:点名的是文件名。
871
951
  case "unread-config-file":
872
952
  return w;
873
953
  default: {
@@ -1258,9 +1338,40 @@ const SKILLS_MANIFEST_SEAT = { domain: "skills", schema: SkillsManifestSchema };
1258
1338
  function readView(seat, raw, onWarning) {
1259
1339
  return readDomainDocument(seat.domain, raw, onWarning, (doc) => parseForView(seat, doc), (unreadable) => parseSalvaged(seat, raw, unreadable, onWarning));
1260
1340
  }
1341
+ /** `a` 是不是 `prefix` 的延伸(逐段相等;空前缀不算 —— 没有坐标就没有条目)。 */
1342
+ const startsWithPath = (path, prefix) => prefix.length > 0 && prefix.length <= path.length && prefix.every((seg, i) => path[i] === seg);
1343
+ /**
1344
+ * 读腿整域读不进、按缺省读时的告警(`domain-defaulted`;唯一铸点,{@link readViewOr} 调它):`error` = 原拒换上一句话的 `message`(整域按缺省读 · 为什么 · 触发的条目是谁 · 在这份文档里手改);
1345
+ * 三个可缺的键说出**触发的是谁** —— `path` = 原拒第一条 issue 的坐标;`identity` = 坐标落进的那一条条目的身份(条目本身没坏、只是域级的跨行规则 —— 重名、悬空引用 —— 把整域拒了,也有);
1346
+ * `reasonCode` = 那一条条目为什么坏(只有条目本身坏才有;域级的毛病没有)。
1347
+ * 条目为什么坏读第一次判留下的抢救账({@link salvageLedger},随原拒带来:丢掉的条目,与零幸存者的集合里那些一条没丢的条目)—— 不把文档再抢救一遍;
1348
+ * 身份先取账上那一行的(条目本身坏 ⇒ 不再读文档),账里没有那一条(域级跨行规则)才按坐标回原文读那一条({@link readEntryIdentityAt},与命令行 `refused[]` 同一只;集合字段多读一次)。
1349
+ * 诊断是旁路 —— 任何一步读不出 ⇒ 少几个键、`error` 原样,从不把读拖下水。
1350
+ */
1351
+ function domainDefaultedWarning(seat, raw, refusal) {
1352
+ const issues = pathedSentencesOf(refusal);
1353
+ const first = inspect(() => (refusal instanceof z.ZodError ? refusal.issues[0]?.path : undefined));
1354
+ const path = first.ok && first.value !== undefined && first.value.length > 0 ? first.value : undefined;
1355
+ const held = inspect(() => (refusal instanceof Error ? LEDGER_OF_REFUSAL.get(refusal) : undefined));
1356
+ const ledger = held.ok ? held.value : undefined;
1357
+ const culprit = path === undefined || ledger === undefined ? undefined : [...ledger.lost, ...ledger.dropped].find((c) => startsWithPath(path, c.path));
1358
+ const identity = culprit?.identity ?? (path === undefined ? undefined : readEntryIdentityAt(raw, path));
1359
+ const entryPath = culprit?.path ?? (path !== undefined && typeof path[1] === "number" ? path.slice(0, 2) : undefined);
1360
+ const entry = entryPath === undefined || (culprit === undefined && identity === undefined) ? undefined : `entry ${formatConfigPath(entryPath)}`;
1361
+ const who = identityText(identity);
1362
+ const sentence = inspect(() => defaultedDomainSentence({ domain: seat.domain, cause: causeText(issues), culprit: entry === undefined ? undefined : who === undefined ? entry : `${entry}: ${who}` }));
1363
+ return {
1364
+ domain: seat.domain,
1365
+ kind: "domain-defaulted",
1366
+ error: sentence.ok ? withSentence(refusal, sentence.value) : refusal,
1367
+ ...(path === undefined ? {} : { path }),
1368
+ ...(identity === undefined ? {} : { identity }),
1369
+ ...(culprit?.reasonCode === undefined ? {} : { reasonCode: culprit.reasonCode }),
1370
+ };
1371
+ }
1261
1372
  /**
1262
1373
  * 视图面读一份文档,**读不进时按 {@link DOMAIN_READ_FALLBACK} 答**:`"throw"` ⇒ 抛 {@link DomainReadRefusedError}(`domain` = 这个域,`cause` = 判官的原拒);
1263
- * `"default"` ⇒ schema 默认 + 一条 `domain-defaulted`(`error` = 同一个原拒)。这里是那只错的唯一铸点。
1374
+ * `"default"` ⇒ schema 默认 + 一条 `domain-defaulted`(`error` = 原拒的同类、同 `issues`,`message` 换成一句话,见 {@link domainDefaultedWarning})。这里是那只错的唯一铸点。
1264
1375
  * `buildEffective` 的每个域与 `readEffectiveWire` 的 skills 清单都经这一只 —— 两张表各问一次,同一个域在每条读腿上同一个答案(24.0.0 前清单是单列一臂,
1265
1376
  * 恒逐条抢救、恒默认化,不读这两张表)。好文档的路径一字不动。
1266
1377
  *
@@ -1276,7 +1387,8 @@ function readViewOr(seat, raw, onWarning) {
1276
1387
  catch (refusal) {
1277
1388
  if (DOMAIN_READ_FALLBACK[seat.domain] === "throw")
1278
1389
  throw new DomainReadRefusedError(seat.domain, refusal);
1279
- onWarning?.({ domain: seat.domain, kind: "domain-defaulted", error: refusal });
1390
+ if (onWarning !== undefined)
1391
+ onWarning(domainDefaultedWarning(seat, raw, refusal));
1280
1392
  return strictParse(seat.schema, seat.domain, emptyDocument()); // schema default — always valid
1281
1393
  }
1282
1394
  if (onWarning !== undefined)
@@ -1337,16 +1449,23 @@ function parseSalvaged(seat, raw, unreadable, onWarning) {
1337
1449
  * 抛 `unreadable`(第一次严判的原错)—— 一个文档一个结论,没救活就不留「丢了某条」的半路叙述。`domain` = 哪个域的扩展命名空间生效(见 {@link salvageEntries})。
1338
1450
  */
1339
1451
  function salvageThenParse(schema, domain, raw, parse, unreadable) {
1340
- const salvage = salvageEntries(schema, raw, domain);
1452
+ const salvage = salvageLedger(schema, raw, domain);
1341
1453
  if (salvage.dropped.length === 0)
1342
- throw unreadable;
1454
+ return refuseWithLedger(unreadable, salvage);
1343
1455
  try {
1344
1456
  return { parsed: parse(salvage.raw), salvage };
1345
1457
  }
1346
1458
  catch {
1347
- throw unreadable;
1459
+ return refuseWithLedger(unreadable, salvage);
1348
1460
  }
1349
1461
  }
1462
+ /** 抛 `unreadable`(第一次严判的原错),抛之前把抢救账挂在它身上(原拒不是 `Error` ⇒ 只抛、不挂:本包铸的原拒都是 `Error`)。 */
1463
+ function refuseWithLedger(unreadable, ledger) {
1464
+ const isError = inspect(() => unreadable instanceof Error);
1465
+ if (isError.ok && isError.value && unreadable instanceof Error)
1466
+ LEDGER_OF_REFUSAL.set(unreadable, ledger);
1467
+ throw unreadable;
1468
+ }
1350
1469
  /** 未知键两条告警(剥掉的 / 承运的)—— `raw` 是这次真被 parse 的那份文档,`emit` 决定坐标出门前要不要回写。 */
1351
1470
  function announceUnknownKeys(domain, raw, parsed, emit) {
1352
1471
  const dropped = droppedKeys(domain, raw, parsed);
@@ -38,7 +38,7 @@ export declare function diffWarningMultiset(expected: readonly WarningProjection
38
38
  extra: unknown[];
39
39
  };
40
40
  /**
41
- * 告警面(投影 + `error` 文案)里有没有语料自带的秘密。
41
+ * 告警面(除 `error` 外的每一只键 + `error` 文案 —— 不只是投影:不进投影的诊断键同样出门)里有没有语料自带的秘密。
42
42
  *
43
43
  * 口径(诚实登记,docs/CONFORMANCE.md 同步写明):扫的是**告警**,不是 effective。effective 里逐字承运
44
44
  * 运维自己写下的那份文档是契约(配置就是他写的那份),而告警是**本包自己铸的新文本** —— 一条把秘密
@@ -111,7 +111,7 @@ function errorText(w) {
111
111
  }
112
112
  }
113
113
  /**
114
- * 告警面(投影 + `error` 文案)里有没有语料自带的秘密。
114
+ * 告警面(除 `error` 外的每一只键 + `error` 文案 —— 不只是投影:不进投影的诊断键同样出门)里有没有语料自带的秘密。
115
115
  *
116
116
  * 口径(诚实登记,docs/CONFORMANCE.md 同步写明):扫的是**告警**,不是 effective。effective 里逐字承运
117
117
  * 运维自己写下的那份文档是契约(配置就是他写的那份),而告警是**本包自己铸的新文本** —— 一条把秘密
@@ -120,6 +120,12 @@ function errorText(w) {
120
120
  export function findSecretLeaks(warnings, secrets) {
121
121
  if (secrets.length === 0)
122
122
  return [];
123
- const hay = warnings.map((w) => `${stableKey(projectWarning(w))}${JOINER}${errorText(w)}`).join(JOINER);
123
+ // 投影照旧先算一次:它是闭集穷举(不认识的 kind ⇒ 抛,不静默扫成空);扫的是投影之外还带出门的每一只键
124
+ const hay = warnings.map((w) => `${stableKey(projectWarning(w))}${JOINER}${stableKey(fieldsBesideError(w))}${JOINER}${errorText(w)}`).join(JOINER);
124
125
  return secrets.filter((s) => s.length > 0 && hay.includes(s));
125
126
  }
127
+ /** 一条告警除 `error` 外的**每一只**键(扫描用,不是投影):投影只留比对用的键(`domain-defaulted` 的 `path` / `identity` / `reasonCode` 是诊断、不进投影),
128
+ * 扫描却要看告警带出门的一切 —— 每个 kind 同一个读法,新加的键不会因为不在投影里就躲过扫描。 */
129
+ function fieldsBesideError(w) {
130
+ return Object.fromEntries(Object.entries(w).filter(([k]) => k !== "error")); // fromEntries(不是逐键赋值):键名不走原型 setter
131
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * 读腿读不进一份文档(或一条条目)时的**诊断句措辞** —— 包内私有(不进主桶),纯字符串函数,只 import 两只零 import 的叶(形状座位、一行回显的剥除集),所以谁都能调、不成环;句子**不含换行与双向控制符**(回显进来的键名 / 值 / 别人的句子都过 `stripControlAndBidi`)。
3
+ *
4
+ * 在这里铸的(照实):读腿两条告警的一句话({@link droppedEntrySentence} / {@link defaultedDomainSentence})、issue 的一句话({@link issueSentence})、
5
+ * 条目身份与原因的小段字,以及「读腿会怎么处置一份读不进的域文档」的后果句({@link readConsequenceSentence} —— 命令行 `migrate` 对在场文档的拒句取它)。
6
+ * 不在这里铸的:retired 域的墓碑句与它的出路(`./retired-form`,读写两面同一句)、命令行 `migrate` 拒句里 retired 域 / `remote-exec` 的后果、
7
+ * 「在 `<文件>` 里手改」那一截与整份 `why`(`./config-dir-migration`)。句子**一句一行**(不含换行):它们被日志、终端、网页端、管理台逐字渲染,
8
+ * 多行的 JSON 数组文本读起来不是一句人话。本模块剥了一行回显的剥除集之后的串不是出门形:剥掉一个隔开的字符可以拼出密钥形,铸点(`./config-fns`、
9
+ * `./config-dir-migration`)把最终的那一串再过一次本包唯一的脱敏器。
10
+ *
11
+ * 后果句读两张表的答案(`DOMAIN_READ_FALLBACK` 与 `DOMAIN_ENTRY_SALVAGE`,表在 `./config-fns`,本模块不读表、只收两张表的答案;两张表互不读,句子按两半各自穷举):
12
+ * · 整域读不进时:整域拒(`throw`,读腿抛)/ 整域退缺省(`default`);
13
+ * · 在那之前:逐条丢弃域先丢坏的那一条、其余照读(`salvage`)/ 不逐条丢(`none`)。
14
+ */
15
+ /** 一个域在读腿上的两张表的答案(`DOMAIN_READ_FALLBACK[域]` / `DOMAIN_ENTRY_SALVAGE[域]`)。 */
16
+ export interface ReadStanceWords {
17
+ readonly fallback: "throw" | "default";
18
+ readonly salvage: "salvage" | "none";
19
+ }
20
+ /** 一条 zod issue 的形(只取本模块读的几个键;不 import zod)。 */
21
+ export interface IssueLike {
22
+ readonly message: string;
23
+ readonly code?: string;
24
+ readonly errors?: unknown;
25
+ }
26
+ /**
27
+ * 一条 zod issue 的**一句话**(不含换行):联合(`invalid_union`)自己只说 `Invalid input`,真正的拒句在各选项的 issue 里 —— 取各选项第一条的句子(去重,至多三条,用 ` / ` 连);
28
+ * 别的 issue 就是它自己的 `message`(换行折成空格)。出门前这些句子已经过本包唯一的脱敏器(`sanitizeZodError` 递归进联合的 `errors`),这里只读不改。
29
+ */
30
+ export declare function issueSentence(issue: IssueLike, depth?: number): string;
31
+ /** 一条 issue 的坐标(出门形的串,空串 = 在文档 / 条目的根上)与它的一句话。 */
32
+ export interface PathedSentence {
33
+ readonly path: string;
34
+ readonly sentence: string;
35
+ }
36
+ /** 被丢 / 触发条目的身份,一小段字:只说可披露的名与 id(扣名只说「有名但不给」);没有可说的 ⇒ `undefined`。 */
37
+ export declare function identityText(identity: {
38
+ readonly name?: string;
39
+ readonly id?: string;
40
+ readonly nameWithheld?: true;
41
+ readonly idWithheld?: true;
42
+ } | undefined): string | undefined;
43
+ /** 原因,一段字:最多三条 issue(`<坐标>: <句子>`,坐标是根时只有句子),多出来的写个数。 */
44
+ export declare function causeText(issues: readonly PathedSentence[]): string;
45
+ /**
46
+ * `entry-dropped` 的一句话:哪一条(`entry <坐标>`,有身份再接括号)· 为什么 · 后果(其余条目照常)· 出路(在这份文档里手改,改回来就读得到)。
47
+ * `entry` 是 `entry <坐标>`、`identity` 是 {@link identityText} 的答案。
48
+ */
49
+ export declare function droppedEntrySentence(a: {
50
+ readonly domain: string;
51
+ readonly entry: string;
52
+ readonly identity: string | undefined;
53
+ readonly cause: string;
54
+ }): string;
55
+ /**
56
+ * `domain-defaulted` 的一句话:后果(整域按缺省读)· 为什么(触发的坐标与原因)· 触发的条目是谁(有才写)· 出路(在这份文档里手改)。
57
+ * `culprit` = 触发的条目,一小段字(`entry <坐标>` 加身份),域级的毛病没有。
58
+ */
59
+ export declare function defaultedDomainSentence(a: {
60
+ readonly domain: string;
61
+ readonly cause: string;
62
+ readonly culprit: string | undefined;
63
+ }): string;
64
+ /** 读腿对「这个域的文档读不进」的处置,一句话(不含换行;`domain` 是闭集里的域名)。两张表各答一半、各自穷举:`fallback` 说整域读不进时怎么办,
65
+ * `salvage` 说先不先丢那一条 —— 两半拼成一句,四种组合各有自己的话(「整域拒 + 逐条丢」的域两半都说)。 */
66
+ export declare function readConsequenceSentence(domain: string, stance: ReadStanceWords): string;
@@ -0,0 +1,85 @@
1
+ import { stripControlAndBidi } from "./control-and-bidi.js"; // 一行回显的剥除集(唯一一份):句子里回显的串(zod 句子里的键名 / 值)不许带换行与双向控制符
2
+ import { isJsonArray } from "./plain-json-object.js"; // 形状只问座位:这里的「是不是数组」不裸写 `Array.isArray`(全包反向门)
3
+ /** 一行:空白(含换行、制表)的每一段折成一个空格,再剥掉一行回显的剥除集({@link stripControlAndBidi}:C0、DEL、双向控制符),两端去空白。句子里回显的任何一串(键名、值、别人的句子)都经它,一个换行伪造不出第二行。 */
4
+ const oneLine = (text) => stripControlAndBidi(text.replace(/\s+/g, " ")).trim();
5
+ /**
6
+ * 一条 zod issue 的**一句话**(不含换行):联合(`invalid_union`)自己只说 `Invalid input`,真正的拒句在各选项的 issue 里 —— 取各选项第一条的句子(去重,至多三条,用 ` / ` 连);
7
+ * 别的 issue 就是它自己的 `message`(换行折成空格)。出门前这些句子已经过本包唯一的脱敏器(`sanitizeZodError` 递归进联合的 `errors`),这里只读不改。
8
+ */
9
+ export function issueSentence(issue, depth = 0) {
10
+ if (issue.code === "invalid_union" && isJsonArray(issue.errors) && depth < 4) {
11
+ const branches = [];
12
+ for (const branch of issue.errors) {
13
+ const first = isJsonArray(branch) ? branch[0] : undefined;
14
+ if (first !== undefined && typeof first.message === "string")
15
+ branches.push(issueSentence(first, depth + 1));
16
+ }
17
+ const distinct = [...new Set(branches)].slice(0, 3);
18
+ if (distinct.length > 0)
19
+ return distinct.join(" / ");
20
+ }
21
+ return oneLine(issue.message);
22
+ }
23
+ /** 被丢 / 触发条目的身份,一小段字:只说可披露的名与 id(扣名只说「有名但不给」);没有可说的 ⇒ `undefined`。 */
24
+ export function identityText(identity) {
25
+ if (identity === undefined)
26
+ return undefined;
27
+ const parts = [];
28
+ if (identity.name !== undefined)
29
+ parts.push(`name ${JSON.stringify(identity.name)}`);
30
+ else if (identity.nameWithheld === true)
31
+ parts.push("name withheld");
32
+ if (identity.id !== undefined)
33
+ parts.push(`id ${JSON.stringify(identity.id)}`);
34
+ else if (identity.idWithheld === true)
35
+ parts.push("id withheld");
36
+ return parts.length === 0 ? undefined : parts.join(", ");
37
+ }
38
+ /** 原因,一段字:最多三条 issue(`<坐标>: <句子>`,坐标是根时只有句子),多出来的写个数。 */
39
+ export function causeText(issues) {
40
+ const shown = issues.slice(0, 3).map((i) => (i.path === "" ? i.sentence : `${i.path}: ${i.sentence}`));
41
+ const more = issues.length - shown.length;
42
+ return more > 0 ? `${shown.join("; ")} (+${more} more)` : shown.join("; ");
43
+ }
44
+ /**
45
+ * `entry-dropped` 的一句话:哪一条(`entry <坐标>`,有身份再接括号)· 为什么 · 后果(其余条目照常)· 出路(在这份文档里手改,改回来就读得到)。
46
+ * `entry` 是 `entry <坐标>`、`identity` 是 {@link identityText} 的答案。
47
+ */
48
+ export function droppedEntrySentence(a) {
49
+ const who = a.identity === undefined ? a.entry : `${a.entry} (${a.identity})`;
50
+ return oneLine(`${who} was dropped from the "${a.domain}" domain: ${a.cause === "" ? "it does not read" : a.cause}; the other entries are read as written — fix it in the "${a.domain}" document by hand to bring it back`);
51
+ }
52
+ /**
53
+ * `domain-defaulted` 的一句话:后果(整域按缺省读)· 为什么(触发的坐标与原因)· 触发的条目是谁(有才写)· 出路(在这份文档里手改)。
54
+ * `culprit` = 触发的条目,一小段字(`entry <坐标>` 加身份),域级的毛病没有。
55
+ */
56
+ export function defaultedDomainSentence(a) {
57
+ const tail = a.culprit === undefined ? "" : ` (${a.culprit})`;
58
+ return oneLine(`the whole "${a.domain}" domain is read as its default: ${a.cause === "" ? "it does not read" : a.cause}${tail}; fix it in the "${a.domain}" document by hand`);
59
+ }
60
+ /** 读腿对「这个域的文档读不进」的处置,一句话(不含换行;`domain` 是闭集里的域名)。两张表各答一半、各自穷举:`fallback` 说整域读不进时怎么办,
61
+ * `salvage` 说先不先丢那一条 —— 两半拼成一句,四种组合各有自己的话(「整域拒 + 逐条丢」的域两半都说)。 */
62
+ export function readConsequenceSentence(domain, stance) {
63
+ const whole = (() => {
64
+ switch (stance.fallback) {
65
+ case "throw":
66
+ return `refuses the whole "${domain}" domain`;
67
+ case "default":
68
+ return `reads the whole "${domain}" domain as its default`;
69
+ default: {
70
+ const unhandled = stance.fallback;
71
+ throw new Error(`readConsequenceSentence: unhandled fallback ${String(unhandled)}`);
72
+ }
73
+ }
74
+ })();
75
+ switch (stance.salvage) {
76
+ case "salvage":
77
+ return `the reader drops the offending entry, or ${whole} when no entry can be dropped`;
78
+ case "none":
79
+ return `the reader ${whole}`;
80
+ default: {
81
+ const unhandled = stance.salvage;
82
+ throw new Error(`readConsequenceSentence: unhandled salvage ${String(unhandled)}`);
83
+ }
84
+ }
85
+ }
@@ -32,6 +32,8 @@ export interface RetiredForm {
32
32
  /** 改写存量的一次性迁移 id(`./one-time-migrations` 的闭集;到期门核它在登记表里)。**只在那条迁移还在时写**:迁移到期删了,删码那一车删掉这一格。 */
33
33
  readonly migration?: OneTimeMigrationId;
34
34
  }
35
+ /** 一个retired 域的**出路**(拒句尾,一句一行):把还要用的值手抄到今天的位置上,再删掉旧文档(本地根上它就是 `config.d/<域>.json`)。retired 域的拒句 = 墓碑句 + 这一句,读写两面同一句。 */
36
+ export declare function retiredDomainWayOut(domain: string): string;
35
37
  export declare function retiredFormSentence(form: string, t: RetiredForm): string;
36
38
  /** 墓碑表的一行:`key` 是墓碑字段在它所在对象里的点路径(例:`runtime.sessionBackend`),`sentence` 是它的拒句整句(= 那条 zod issue 的 message)。 */
37
39
  export interface RetiredKeyRow {
@@ -27,6 +27,10 @@ export function migrateCommandFor(configDir) {
27
27
  export function migrationSignpost(migration, before) {
28
28
  return `data stored before ${before}: run the one-time migration ${migration} (@sema-agent/settings-schema/one-time-migrations, or ${MIGRATE_COMMAND_TEMPLATE})`;
29
29
  }
30
+ /** 一个retired 域的**出路**(拒句尾,一句一行):把还要用的值手抄到今天的位置上,再删掉旧文档(本地根上它就是 `config.d/<域>.json`)。retired 域的拒句 = 墓碑句 + 这一句,读写两面同一句。 */
31
+ export function retiredDomainWayOut(domain) {
32
+ return `copy the values you still need to those keys by hand, then delete the "${domain}" document (on a local root: config.d/${domain}.json)`;
33
+ }
30
34
  export function retiredFormSentence(form, t) {
31
35
  const head = `${form} was retired in ${t.retiredIn} — now ${t.now}`;
32
36
  return t.migration === undefined ? head : `${head}; ${migrationSignpost(t.migration, t.retiredIn)}`;
package/dist/types.d.ts CHANGED
@@ -616,7 +616,7 @@ export declare const RETIRED_DOMAINS: {
616
616
  export type RetiredDomainName = keyof typeof RETIRED_DOMAINS;
617
617
  /** 是不是一个retired 域名(墓碑表成员)。 */
618
618
  export declare function isRetiredDomainName(x: unknown): x is RetiredDomainName;
619
- /** 一个retired 域的拒句(读写两面同一句)。 */
619
+ /** 一个retired 域的拒句(读写两面同一句):墓碑句(哪一版 retired、事实今天住哪)加出路({@link retiredDomainWayOut}:把还要用的值手抄到今天的位置上、删掉旧文档)。整句一行。 */
620
620
  export declare function retiredDomainSentence(domain: RetiredDomainName): string;
621
621
  /** 基建计价(micro-USD/单位)。三键各自 optional:缺席 = 该项不改。**嵌套层同样 open-world**
622
622
  * (`.passthrough()`,与 {@link LimitsConfig} 顶层同判据):默认 strip 会把「消费方新增了一个计价项、
package/dist/types.js CHANGED
@@ -31,7 +31,7 @@ import { retiredEnvRefusal } from "./retired-envs.js"; // the worker env write g
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
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
- import { migrationSignpost, retiredFormSentence, retiredKey } from "./retired-form.js"; // 11.0.0: the ONE retired-form sentence + key tombstone (package-private)
34
+ import { migrationSignpost, retiredDomainWayOut, 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)
36
36
  import { buildQuotedIssue, fixed } from "./quoted-issue.js"; // THE minting point of custom issues (package-private)
37
37
  import { RECORD_MEMBER_NAME, partialRecordOf, recordOf } from "./record-seat.js"; // the one way to mint a record seat (its guard refuses a reserved own member name — the table the record reader and the center-refs resolver read) · the judge every name that keys a record seat starts from (worker name, catalog entry name, HTTP header name: a reserved name is refused where the name is minted)
@@ -959,9 +959,9 @@ export const RETIRED_DOMAINS = deepFreeze({
959
959
  export function isRetiredDomainName(x) {
960
960
  return typeof x === "string" && Object.prototype.hasOwnProperty.call(RETIRED_DOMAINS, x);
961
961
  }
962
- /** 一个retired 域的拒句(读写两面同一句)。 */
962
+ /** 一个retired 域的拒句(读写两面同一句):墓碑句(哪一版 retired、事实今天住哪)加出路({@link retiredDomainWayOut}:把还要用的值手抄到今天的位置上、删掉旧文档)。整句一行。 */
963
963
  export function retiredDomainSentence(domain) {
964
- return retiredFormSentence(`the "${domain}" config domain`, RETIRED_DOMAINS[domain]);
964
+ return [retiredFormSentence(`the "${domain}" config domain`, RETIRED_DOMAINS[domain]), retiredDomainWayOut(domain)].join("; ");
965
965
  }
966
966
  // ── Domain: limits (cost/限流族的热更新发布位 — 0.19.0, 消费方 #322 批1) ──────
967
967
  // 为什么是**新顶层域**而不是往 `runtime` 里加键(消费方亲验,不是推测):`RuntimeConfig` 是 zod 默认的
@@ -4,9 +4,9 @@
4
4
  > 每次全量重算并逐名比对 —— 加 / 删 / 改形一个导出而不重生成本档 ⇒ 红。导出面的每次变动因此以本档的 diff 出现在评审里。
5
5
  > 形:`value` = 运行期拿得到的值;`type` = 只在类型层;`value+type` = 同名的值与类型(zod schema 与它推出的类型)。
6
6
 
7
- 子路径 24 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计 1613 个(同名在多条子路径上各计一次)。
7
+ 子路径 24 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计 1615 个(同名在多条子路径上各计一次)。
8
8
 
9
- ## `.`(865)
9
+ ## `.`(866)
10
10
 
11
11
  - `A2aConfig` — value+type
12
12
  - `A2aPeerSpec` — value+type
@@ -808,6 +808,7 @@
808
808
  - `readDrainRequest` — value
809
809
  - `readEffectiveWire` — value
810
810
  - `readEngineSignal` — value
811
+ - `readEntryIdentityAt` — value
811
812
  - `readEnvModelSlots` — value
812
813
  - `readHookPluginOptionRef` — value
813
814
  - `readHttpHookAllowlistLayer` — value
@@ -1095,7 +1096,7 @@
1095
1096
  - `resolveEffectiveForWorker` — value
1096
1097
  - `rosterMarkerRoles` — value
1097
1098
 
1098
- ## `./config-fns`(58)
1099
+ ## `./config-fns`(59)
1099
1100
 
1100
1101
  - `ANY_INDEX` — value
1101
1102
  - `ApprovePublishResult` — type
@@ -1145,6 +1146,7 @@
1145
1146
  - `parseDomainSalvaged` — value
1146
1147
  - `projectWarning` — value
1147
1148
  - `readEffectiveWire` — value
1149
+ - `readEntryIdentityAt` — value
1148
1150
  - `rebaseWarningPaths` — value
1149
1151
  - `redactSecrets` — value
1150
1152
  - `refuseRetiredDomain` — value
@@ -260,11 +260,11 @@ sema-test 的读数,是本仓自己重跑 `node scripts/conformance-historical.m
260
260
 
261
261
  ## 8. 秘密扫描的口径(如实登记)
262
262
 
263
- 扫的是**告警**(投影 + `error` 文案),**不是** effective。effective 里逐字承运运维自己写下的那份文档是
263
+ 扫的是**告警**(除 `error` 外的每一只键 + `error` 文案;33.0.0 起不只是投影 —— 不进投影的诊断键,如 `domain-defaulted` 的 `path` / `identity`,也在扫描里),**不是** effective。effective 里逐字承运运维自己写下的那份文档是
264
264
  契约(配置就是他写的那份);而告警是本包**自己铸的新文本** —— 一条把秘密抄进坐标或错误文案的告警,会把
265
265
  秘密带进日志、审计流、管理面,那才是「告警比它诊断的东西更危险」。
266
266
 
267
- 扫的是一条腿交回的**每一处新文本**:读出时的告警(投影 + `error` 文案)、拒绝时的诊断句(`diagnostics`)。而且**先于一切**判
267
+ 扫的是一条腿交回的**每一处新文本**:读出时的告警(除 `error` 外的每一只键 + `error` 文案)、拒绝时的诊断句(`diagnostics`)。而且**先于一切**判
268
268
  (11.0.0):带着语料秘密的一格不论结局形对不对、账本盖不盖得住,都是 `diff`、不可入账 —— 此前「期望拒、实际读出」这类结局分歧在
269
269
  判秘密之前就早返回,那条腿确实交回了告警,泄漏却被跳过。
270
270