@sema-agent/settings-schema 33.1.0 → 34.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +664 -0
  2. package/README.md +138 -19
  3. package/conformance/VERSION +1 -1
  4. package/dist/api/credentials.d.ts +94 -14
  5. package/dist/api/credentials.js +33 -8
  6. package/dist/atomic-write.d.ts +68 -3
  7. package/dist/atomic-write.js +314 -4
  8. package/dist/cli.d.ts +5 -2
  9. package/dist/cli.js +15 -3
  10. package/dist/config-d-file.d.ts +0 -3
  11. package/dist/config-d-file.js +1 -6
  12. package/dist/config-dir-migration.d.ts +2 -1
  13. package/dist/config-dir-migration.js +34 -20
  14. package/dist/config-fns.d.ts +60 -14
  15. package/dist/config-fns.js +48 -13
  16. package/dist/conformance/index.d.ts +1 -0
  17. package/dist/conformance/index.js +2 -0
  18. package/dist/conformance/warnings.d.ts +1 -1
  19. package/dist/conformance/warnings.js +3 -3
  20. package/dist/conformance/web-admin-credential-lock.d.ts +17 -0
  21. package/dist/conformance/web-admin-credential-lock.js +347 -0
  22. package/dist/hooks-config.d.ts +12 -4
  23. package/dist/hooks-config.js +28 -11
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.js +3 -2
  26. package/dist/local-load.d.ts +66 -1
  27. package/dist/local-load.js +123 -39
  28. package/dist/mcp-request-entry.d.ts +43 -5
  29. package/dist/mcp-request-entry.js +60 -18
  30. package/dist/node.d.ts +1 -0
  31. package/dist/node.js +2 -0
  32. package/dist/plugin-id-segment.d.ts +15 -0
  33. package/dist/plugin-id-segment.js +15 -0
  34. package/dist/plugin-settings.d.ts +61 -0
  35. package/dist/plugin-settings.js +111 -0
  36. package/dist/read-sentences.d.ts +14 -3
  37. package/dist/read-sentences.js +32 -11
  38. package/dist/safety-merge-spec.d.ts +7 -7
  39. package/dist/safety-merge-spec.js +5 -3
  40. package/dist/settings-units.d.ts +35 -1
  41. package/dist/settings-units.js +51 -16
  42. package/dist/types.d.ts +13 -6
  43. package/dist/types.js +37 -11
  44. package/dist/ui-language.d.ts +3 -1
  45. package/dist/ui-language.js +3 -1
  46. package/dist/web-admin-credential.d.ts +14 -1
  47. package/dist/web-admin-credential.js +15 -1
  48. package/docs/API-SURFACE.md +60 -5
  49. package/docs/CONFORMANCE.md +19 -2
  50. package/docs/CONSUMER-INTEGRATION.md +165 -11
  51. package/llms-full.txt +51 -16
  52. package/llms.txt +18 -8
  53. package/package.json +5 -1
package/dist/types.js CHANGED
@@ -41,6 +41,7 @@ import { DEVICE_RELAY_RULE, deviceRelayFlaws } from "./device-relay.js"; // 16.0
41
41
  import { DEVICE_MAX_PREAUTH_PER_REMOTE_RULE, DEVICE_TRUSTED_PROXY_CIDRS_RULE, readDeviceMaxPreAuthPerRemote, readDeviceTrustedProxyCidrs } from "./device-lane-knobs.js"; // the value grammar of the device lane's two optional knobs (the one judge; engine boot reads the same)
42
42
  import { TOOL_WIRE_NAME_MAX_CHARS, isUsableWireName } from "./wire-name.js"; // 18.0.0: the one "usable wire name" judge (the a2a peer name; the request-plane MCP / A2A readers ask the same function)
43
43
  import { deepFreeze } from "./deep-freeze.js";
44
+ import { PLUGIN_ID_SEGMENT_REGEX, PLUGIN_ID_SEGMENT_SENTENCE } from "./plugin-id-segment.js"; // the one grammar of a plugin id segment + its refusal sentence (a zero-import leaf, package-private; the regex is re-exported below under its own name)
44
45
  import { McpEntryCredential } from "./mcp-entry-credential.js"; // 29.0.0: the http entry's credential reference (the one reading = the engine primitives' readCredentialRef)
45
46
  // COARSE, best-effort literal-secret SHAPE detector (NOT exhaustive — the real boundary is the env-NAME schema
46
47
  // on structured fields). Rejected in free-form value fields (worker `env`, model `extraBody`), URL components,
@@ -1618,7 +1619,7 @@ export const ProjectRegistration = z.object({
1618
1619
  goal: ProjectGoal.optional(),
1619
1620
  /** 项目上下文条目(≤ {@link PROJECT_LIMITS}`.contextItemsMax` 条,见 {@link ProjectContextItem})。 */
1620
1621
  contextItems: ProjectContextItems.optional(),
1621
- /** 归档时刻(RFC 3339)。在场 = 已归档;没有硬删(会话行引用项目)。 */
1622
+ /** 归档时刻(RFC 3339)。在场 = 已归档。归档与删除是两件事:归档保留这条登记;删除由写口按它自己的规则执行 —— 会话行上的 `projectId` 可能指向已删除的项目,读方按「不存在」处置。 */
1622
1623
  archivedAt: RFC3339_DATE_TIME.optional(),
1623
1624
  /** 内容证明时刻(RFC 3339,与 `archivedAt` 同一只判官):中心写口在一次按 `writeRoleFor('projects', …)` 判过 `goal` / `notes` / `contextItems` 的写之后盖的章。
1624
1625
  * 在场 = 这条登记的内容过了那一道;缺席 = 旧登记 / 没经过带章的写口(此前 editor 写下的内容也是这一种)。本包只定形与角色(`DOMAIN_FIELD_WRITE_ROLE.projects.fields.contentAttestedAt` =
@@ -1643,6 +1644,8 @@ function remoteUniquenessIssues(cfg, ctx) {
1643
1644
  }
1644
1645
  }
1645
1646
  }
1647
+ /** 项目登记簿。`projects` 记录的**条目序是契约事实**:它就是登记簿的展示序,唯一来源 = 文档里的条目次序;写者必须保序({@link applyProjectPatch} 已保序)。
1648
+ * 已知分工:今天的内容版本(`configDVersionOf`(`./config-d-file`))按排序后的键计算,只调换条目次序不会换版本号;内容版本自下一个大版本起看得见条目序。 */
1646
1649
  export const ProjectsConfig = z
1647
1650
  .object({
1648
1651
  /** 键=projectId({@link PROJECT_ID_REGEX},generic lowercase UUID——宽读);tenant 半边=web-admin
@@ -1940,12 +1943,14 @@ function retiredEnvIssue(rec, ctx) {
1940
1943
  // ── 7.0.0 M-R2:`runtime.execution` / `runtime.store` 两个结构块 ─────────────────────────────────────────────
1941
1944
  // 词表只有一个正本(`execution-lanes.ts` 的导出表):本包写闸(`WorkerSpec.safeParse`)、web-admin 渲染器、引擎起服三处读同一张表。
1942
1945
  // 拒因都在 zod issue 里(`path` 指到要改的字段、`message` 带出路)—— schema 本身是唯一判据,不另导出拒因函数。
1943
- /** 一个非密字面值(车道坐标 / SQL 坐标):≤2048,不像密钥(与 `env` 逃生口同一条判据 —— 密钥走 env-NAME 引用)。 */
1944
- const nonSecretLiteral = (minLength) => z
1945
- .string()
1946
- .min(minLength)
1947
- .max(2048)
1948
- .refine((s) => !containsSecretToken(s), buildQuotedIssue `looks like a literal secret — a credential goes in a secretRefs field as an env-NAME, never a value here`);
1946
+ /** 一个非密字面值的字数上界(车道坐标 / SQL 坐标 / `env` 逃生口):唯一一份数。 */
1947
+ const NON_SECRET_LITERAL_MAX = 2048;
1948
+ /** 非密字面值的第二条判据:不像密钥(密钥走 env-NAME 引用;与 `env` 逃生口同一条判据)。这句拒句只铸在这一处(源码门要求 `.refine` 的第二参数是 `buildQuotedIssue` 标签模板)。 */
1949
+ const asNonSecretLiteral = (text) => text.refine((s) => !containsSecretToken(s), buildQuotedIssue `looks like a literal secret — a credential goes in a secretRefs field as an env-NAME, never a value here`);
1950
+ /** 一个非密字面值(SQL 坐标):≤{@link NON_SECRET_LITERAL_MAX},不像密钥。 */
1951
+ const nonSecretLiteral = (minLength) => asNonSecretLiteral(z.string().min(minLength).max(NON_SECRET_LITERAL_MAX));
1952
+ /** 车道坐标的值:不像密钥。字数上界**不在这里** —— 它在 `ExecutionBlock` 按键判(那里才知道是哪一个坐标:句子点名坐标并给出路,不是 zod 的泛话 `Too big`),同一个 {@link NON_SECRET_LITERAL_MAX}。 */
1953
+ const coordinateLiteral = asNonSecretLiteral(z.string().min(0));
1949
1954
  /**
1950
1955
  * 可信代理名单一个坏项的拒因片语(进写闸拒句「found:」那一段,整段是定文):**只有位置数与闭集拒因词** —— 参数的型就是这条不变式(`item` / `of` 是数,
1951
1956
  * `flaw` 是拒因闭集的型),名单项的文本(配置里的值)没有参数可进来。逐项的结构化读数是判官交的那一份(`readDeviceTrustedProxyCidrs` 的 `items`),
@@ -2083,7 +2088,7 @@ const ExecutionBlock = z
2083
2088
  .object({
2084
2089
  lane: retiredKey("runtime.execution.lane", { retiredIn: "16.0.0", now: "runtime.execution.lanes (an ordered lane set; the first one is the default)", migration: "SS-M12" }),
2085
2090
  lanes: DeclaredLanes,
2086
- coords: recordOf(ENV_NAME, nonSecretLiteral(0)).prefault({}),
2091
+ coords: recordOf(ENV_NAME, coordinateLiteral).prefault({}),
2087
2092
  secretRefs: LaneSecretRefs.prefault({}),
2088
2093
  })
2089
2094
  .superRefine((x, ctx) => {
@@ -2112,6 +2117,23 @@ const ExecutionBlock = z
2112
2117
  }
2113
2118
  return true;
2114
2119
  };
2120
+ // 字数上界按键判(值 schema 不带上界:句子要点名是哪一个坐标,值 schema 不知道自己的键),且**先于**下面所有按键归属 / 文法的判:长度是它自己的一条拒因,不被别的拒因挡住、也不替它们收声 ——
2121
+ // 条数与此前(值 schema 上的 `.max()`)相同,与键归属 / 文法两类之间的次序也相同:一只坐标可以同时报长度与键归属 / 文法,所有长度条在前、这两类在后。长度条仍排在值 schema 的各条拒因(像密钥、环境变量名格式)之后 —— 已知的边。
2122
+ // 字数按 Unicode 码点量({@link withinCodePoints},与此前 zod 的上界检查同一把尺 —— 一个非 BMP 字符算一个;句子里的字数也按码点数,不按 UTF-16 码元)。
2123
+ // issue 的机读码 / `origin` / `maximum` 与此前 zod 的上界检查给的逐一相同(只有 `message` 换成点名坐标、给出路的句子);句子只带字数,不回显值。
2124
+ for (const [key, value] of Object.entries(x.coords)) {
2125
+ if (withinCodePoints(NON_SECRET_LITERAL_MAX)(value))
2126
+ continue;
2127
+ ctx.addIssue({
2128
+ code: "too_big",
2129
+ origin: "string",
2130
+ maximum: NON_SECRET_LITERAL_MAX,
2131
+ inclusive: true,
2132
+ input: value,
2133
+ path: ["coords", key],
2134
+ ...buildQuotedIssue `coords.${key} is ${[...value].length} characters long — a coordinate value is at most ${fixed(String(NON_SECRET_LITERAL_MAX))} characters; shorten it`,
2135
+ });
2136
+ }
2115
2137
  for (const [key, value] of Object.entries(x.coords)) {
2116
2138
  if (!judgeKey("coords", key))
2117
2139
  continue;
@@ -2276,7 +2298,7 @@ const WorkerSpecObject = z.object({
2276
2298
  * secret 名…)被拒,防 env 改路由/关鉴权/遮蔽密钥(council);墓碑表 `RETIRED_ENVS` 里的旧名被拒(引擎见之拒启;空串 = 未设,同引擎)。
2277
2299
  * 可覆盖非保留键(如 LOG_LEVEL)。hash-included(改它重建)。
2278
2300
  */
2279
- env: recordOf(ENV_NAME, z.string().max(2048))
2301
+ env: recordOf(ENV_NAME, z.string().max(NON_SECRET_LITERAL_MAX))
2280
2302
  .superRefine((rec, ctx) => {
2281
2303
  retiredEnvIssue(rec, ctx);
2282
2304
  for (const [k, v] of Object.entries(rec)) {
@@ -2840,6 +2862,10 @@ export const PLUGIN_ORIGIN = z
2840
2862
  /** A full 40-hex git commit SHA — the ONLY pin form the supply-side treats as 钉死 (a branch/tag `version`
2841
2863
  * is a moving ref; only a commit pin makes the materialized bytes reproducible). */
2842
2864
  export const GIT_COMMIT_SHA = z.string().regex(/^[a-f0-9]{40}$/, "must be a full 40-character lowercase git commit SHA");
2865
+ /** The grammar of ONE segment of a plugin id (`<name>@<marketplace>`): a letter or digit first, then letters / digits / `.` / `_` / `-`, case-insensitive.
2866
+ * Re-exported here under its own name; the ONE definition is the zero-import leaf `./plugin-id-segment` — the `<name>` half (`PluginSpec.name`), the
2867
+ * `<marketplace>` half (the marketplace arm of `PluginSource`) and the id reader `readPluginId` (`./plugin-settings`) all read that same object. */
2868
+ export { PLUGIN_ID_SEGMENT_REGEX };
2843
2869
  /** WHERE a plugin comes from — two forms (产品拍板: git URL 与 marketplace ref 两形态):
2844
2870
  * - `git`: the plugin lives at a git URL directly (repo root = plugin root).
2845
2871
  * - `marketplace`: the plugin is `<name>@<marketplace>` in a plugin marketplace; `marketplace` is the
@@ -2850,13 +2876,13 @@ export const PluginSource = z.discriminatedUnion("kind", [
2850
2876
  z.object({ kind: z.literal("git"), url: PLUGIN_ORIGIN }),
2851
2877
  z.object({
2852
2878
  kind: z.literal("marketplace"),
2853
- marketplace: z.string().min(1).regex(/^[a-z0-9][a-z0-9._-]*$/i, "letters/digits/._- , no spaces"),
2879
+ marketplace: z.string().min(1).regex(PLUGIN_ID_SEGMENT_REGEX, PLUGIN_ID_SEGMENT_SENTENCE),
2854
2880
  url: PLUGIN_ORIGIN.optional(),
2855
2881
  }),
2856
2882
  ]);
2857
2883
  export const PluginSpec = z.object({
2858
2884
  /** Plugin name (the `<name>` half of a `<name>@<marketplace>` id; the whole id for a direct git plugin). */
2859
- name: z.string().min(1).regex(/^[a-z0-9][a-z0-9._-]*$/i, "letters/digits/._- , no spaces"),
2885
+ name: z.string().min(1).regex(PLUGIN_ID_SEGMENT_REGEX, PLUGIN_ID_SEGMENT_SENTENCE),
2860
2886
  source: PluginSource,
2861
2887
  /** Human version label (semver/tag). A moving ref — NOT a pin; pin with `sha`. */
2862
2888
  version: z.string().optional(),
@@ -3,7 +3,9 @@
3
3
  * (CC 的 `language` 键是后者;两个事实不共用一个键)。形照 `cross-session.ts` 的片段契约:导出值闭集 + 一层的读器。纯、浏览器安全。
4
4
  *
5
5
  * - 键 `semaUiLanguage`(沿用终端已写的键,cli `src/sema/i18n/languageStore.ts`,已存值零迁移);作用源 = 用户设置;合并类 = `ui`
6
- * (`SAFETY_MERGE_SPEC.ui`,`enforcement: "client"`,壳侧、不进引擎)。
6
+ * (`SAFETY_MERGE_SPEC.ui`,`enforcement: "client"`)。
7
+ * - 写侧单元 = 单元表 `SETTINGS_UNITS` 的 `semaUiLanguage` 一行(`./settings-units`):它的键名、类目与读自的源(`sources`)从本文件的 {@link UI_LANGUAGE_SETTING} 取,
8
+ * 读法 `uiLanguage` 委托本文件的 {@link readUiLanguage}(判值只有这一只判官);「谁读」只记在那一行的 `reader`(`shell`:只改宿主自己的界面,不进引擎)。
7
9
  * - 合法值闭集 {@link UI_LANGUAGE_VALUES} = `en` / `zh`。
8
10
  * - 缺席或不合法 ⇒ 跟宿主 locale。读器**不猜**:不把 `zh-CN` 折成 `zh`、不按大小写折 —— locale 标签到这两个词的映射是宿主读 locale 时的事,
9
11
  * 不是读设置时的事。
@@ -3,7 +3,9 @@
3
3
  * (CC 的 `language` 键是后者;两个事实不共用一个键)。形照 `cross-session.ts` 的片段契约:导出值闭集 + 一层的读器。纯、浏览器安全。
4
4
  *
5
5
  * - 键 `semaUiLanguage`(沿用终端已写的键,cli `src/sema/i18n/languageStore.ts`,已存值零迁移);作用源 = 用户设置;合并类 = `ui`
6
- * (`SAFETY_MERGE_SPEC.ui`,`enforcement: "client"`,壳侧、不进引擎)。
6
+ * (`SAFETY_MERGE_SPEC.ui`,`enforcement: "client"`)。
7
+ * - 写侧单元 = 单元表 `SETTINGS_UNITS` 的 `semaUiLanguage` 一行(`./settings-units`):它的键名、类目与读自的源(`sources`)从本文件的 {@link UI_LANGUAGE_SETTING} 取,
8
+ * 读法 `uiLanguage` 委托本文件的 {@link readUiLanguage}(判值只有这一只判官);「谁读」只记在那一行的 `reader`(`shell`:只改宿主自己的界面,不进引擎)。
7
9
  * - 合法值闭集 {@link UI_LANGUAGE_VALUES} = `en` / `zh`。
8
10
  * - 缺席或不合法 ⇒ 跟宿主 locale。读器**不猜**:不把 `zh-CN` 折成 `zh`、不按大小写折 —— locale 标签到这两个词的映射是宿主读 locale 时的事,
9
11
  * 不是读设置时的事。
@@ -17,7 +17,9 @@
17
17
  * 声明面(本文件尾段):凭证的二选一判官 {@link judgeWebAdminCredentialDeclaration},读 env 名表 {@link WEB_ADMIN_ENV}
18
18
  * (`./web-admin-env`,八键)里的 `token` / `tokenFile` 两键。
19
19
  *
20
- * 纯契约:零 IO(读文件、写文件、续签都是消费方的事),browser-safe,与本包其余部分同一条纯度律。
20
+ * 单写者锁(文件尾段):协议常量 {@link WEB_ADMIN_CREDENTIAL_FILE_LOCK} 与锁名 {@link webAdminCredentialLockName} 在这里;按它们取锁的原语要读写文件系统,在 `./node`。
21
+ *
22
+ * 纯契约:零 IO(读文件、写文件、续签都是消费方的事;写文件时取锁调 `./node` 的那一只原语),browser-safe,与本包其余部分同一条纯度律。
21
23
  */
22
24
  import { z } from "zod";
23
25
  /** 信封 `kind` 的闭集今只有一员(`SEALED_BOX_ALG` 同式的字面常量:schema 的字面与读方的比较都引它)。 */
@@ -94,3 +96,14 @@ export type WebAdminCredentialDeclaration = {
94
96
  * 只读这一对键,别的 env(另一份凭证的那一对也在内)一概不看。判哪一份由调用方说 —— 没有缺省。
95
97
  */
96
98
  export declare function judgeWebAdminCredentialDeclaration(env: Readonly<Record<string, string | undefined>>, credential: WebAdminCredential): WebAdminCredentialDeclaration;
99
+ /**
100
+ * 凭证文件单写者锁的**协议常量** —— 同一只凭证文件的每个写者(引擎的续签写回、壳的登录 / 刷新 / 登出)读同一个数,所以它是常量、不是部署旋钮。
101
+ *
102
+ * · `staleMs` —— 锁文件的 mtime 早于「现在」这么久,才当崩溃残留收走;mtime 在未来(时钟回拨)= 新鲜。成立的前提是**持锁段只做同步的本机 IO**
103
+ * (一次读 + 一次改名或删除,亚毫秒):把网络调用、等待、再取别的锁放进持锁段的写者,10 s 后会被别的写者当残留挪走。
104
+ */
105
+ export declare const WEB_ADMIN_CREDENTIAL_FILE_LOCK: {
106
+ readonly staleMs: 10000;
107
+ };
108
+ /** 凭证文件的锁文件名:`.<真文件名>.lock`,建在**真目标**(软链解到底的那只文件)所在目录里。入参是真目标的文件名(不带目录)。 */
109
+ export declare function webAdminCredentialLockName(realBasename: string): string;
@@ -17,7 +17,9 @@
17
17
  * 声明面(本文件尾段):凭证的二选一判官 {@link judgeWebAdminCredentialDeclaration},读 env 名表 {@link WEB_ADMIN_ENV}
18
18
  * (`./web-admin-env`,八键)里的 `token` / `tokenFile` 两键。
19
19
  *
20
- * 纯契约:零 IO(读文件、写文件、续签都是消费方的事),browser-safe,与本包其余部分同一条纯度律。
20
+ * 单写者锁(文件尾段):协议常量 {@link WEB_ADMIN_CREDENTIAL_FILE_LOCK} 与锁名 {@link webAdminCredentialLockName} 在这里;按它们取锁的原语要读写文件系统,在 `./node`。
21
+ *
22
+ * 纯契约:零 IO(读文件、写文件、续签都是消费方的事;写文件时取锁调 `./node` 的那一只原语),browser-safe,与本包其余部分同一条纯度律。
21
23
  */
22
24
  import { z } from "zod";
23
25
  import { looksLikeJwt } from "./api/auth-bridge.js";
@@ -149,3 +151,15 @@ export function judgeWebAdminCredentialDeclaration(env, credential) {
149
151
  return { from: "env", token };
150
152
  return { from: "absent" };
151
153
  }
154
+ // ── 凭证文件的单写者锁:协议常量(纯数据;取锁原语在 `./node` 的 `tryWebAdminCredentialFileLock`)──────────────────────────────
155
+ /**
156
+ * 凭证文件单写者锁的**协议常量** —— 同一只凭证文件的每个写者(引擎的续签写回、壳的登录 / 刷新 / 登出)读同一个数,所以它是常量、不是部署旋钮。
157
+ *
158
+ * · `staleMs` —— 锁文件的 mtime 早于「现在」这么久,才当崩溃残留收走;mtime 在未来(时钟回拨)= 新鲜。成立的前提是**持锁段只做同步的本机 IO**
159
+ * (一次读 + 一次改名或删除,亚毫秒):把网络调用、等待、再取别的锁放进持锁段的写者,10 s 后会被别的写者当残留挪走。
160
+ */
161
+ export const WEB_ADMIN_CREDENTIAL_FILE_LOCK = deepFreeze({ staleMs: 10_000 });
162
+ /** 凭证文件的锁文件名:`.<真文件名>.lock`,建在**真目标**(软链解到底的那只文件)所在目录里。入参是真目标的文件名(不带目录)。 */
163
+ export function webAdminCredentialLockName(realBasename) {
164
+ return `.${realBasename}.lock`;
165
+ }
@@ -4,9 +4,9 @@
4
4
  > 每次全量重算并逐名比对 —— 加 / 删 / 改形一个导出而不重生成本档 ⇒ 红。导出面的每次变动因此以本档的 diff 出现在评审里。
5
5
  > 形:`value` = 运行期拿得到的值;`type` = 只在类型层;`value+type` = 同名的值与类型(zod schema 与它推出的类型)。
6
6
 
7
- 子路径 24 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计 1635 个(同名在多条子路径上各计一次)。
7
+ 子路径 25 条(资产出口 `./package.json` / `./fleet-paths.json` 不是模块,不列),导出名合计 1687 个(同名在多条子路径上各计一次)。
8
8
 
9
- ## `.`(876)
9
+ ## `.`(898)
10
10
 
11
11
  - `A2aConfig` — value+type
12
12
  - `A2aPeerSpec` — value+type
@@ -49,6 +49,8 @@
49
49
  - `CONNECTOR_ID_RULE` — value
50
50
  - `CONTROL_AND_BIDI_CHARS` — value
51
51
  - `CREDENTIAL_PARAM_NAMES` — value
52
+ - `CREDENTIAL_PLANE_REFUSALS` — value
53
+ - `CREDENTIAL_PLANE_REFUSAL_ERRORS` — value
52
54
  - `CROSS_SESSION_INBOUND_UNSET` — value
53
55
  - `CROSS_SESSION_INBOUND_VALUES` — value
54
56
  - `CancelSource` — value+type
@@ -86,6 +88,7 @@
86
88
  - `CredentialDrainRequest` — value+type
87
89
  - `CredentialHandleAnswer` — value+type
88
90
  - `CredentialParamName` — type
91
+ - `CredentialPlaneRefusalError` — type
89
92
  - `CredentialResolveRequest` — value+type
90
93
  - `CrossSessionInboundSetting` — value
91
94
  - `CrossSessionInboundSettingValue` — type
@@ -165,6 +168,7 @@
165
168
  - `DroppedEntry` — type
166
169
  - `DroppedEntryIdentity` — type
167
170
  - `DroppedEntryReasonCode` — type
171
+ - `ENABLED_PLUGINS_VALUE_KINDS` — value
168
172
  - `ENGINE_OWNED_HOOK_EVENTS` — value
169
173
  - `ENGINE_OWNED_HOOK_EVENT_SINCE` — value
170
174
  - `ENGINE_SIGNAL_KEY` — value
@@ -182,6 +186,8 @@
182
186
  - `EffectiveWire` — type
183
187
  - `ElicitationHookInput` — value
184
188
  - `ElicitationResultHookInput` — value
189
+ - `EnabledPluginsValue` — type
190
+ - `EnabledPluginsValueKind` — type
185
191
  - `EngineDraining` — value+type
186
192
  - `EngineOwnedHookEvent` — type
187
193
  - `EngineSignal` — value+type
@@ -329,6 +335,7 @@
329
335
  - `MCP_CONTENT_ORIGINS` — value
330
336
  - `MCP_ENTRY_CREDENTIAL_KINDS` — value
331
337
  - `MCP_POLICY_RULES` — value
338
+ - `MCP_REQUEST_CREDENTIAL_KINDS` — value
332
339
  - `MCP_REQUEST_KEY_REFUSALS` — value
333
340
  - `MCP_SERVER_LIST_KEYS` — value
334
341
  - `MEMORY_ENGINE_BACKENDS` — value
@@ -347,6 +354,8 @@
347
354
  - `McpPolicyLayer` — type
348
355
  - `McpPolicyRule` — type
349
356
  - `McpPolicyServer` — type
357
+ - `McpRequestCredential` — type
358
+ - `McpRequestCredentialKind` — type
350
359
  - `McpRequestKeyRefusal` — type
351
360
  - `McpServerListEntry` — type
352
361
  - `McpServerListKey` — type
@@ -383,6 +392,8 @@
383
392
  - `PARSE_TRANSPARENT_KEYS` — value
384
393
  - `PATH_BASE_URL_FORBIDDEN_PARTS` — value
385
394
  - `PLAIN_STRING_RECORD_FAULTS` — value
395
+ - `PLUGIN_ID_SEGMENT_REGEX` — value
396
+ - `PLUGIN_MARKETPLACE_SENTINELS` — value
386
397
  - `PLUGIN_ORIGIN` — value
387
398
  - `PRINCIPAL_INC_CLAIM` — value
388
399
  - `PRINCIPAL_LIFECYCLE_EVENT_KINDS` — value
@@ -411,6 +422,8 @@
411
422
  - `PermissionUpdateDestination` — value+type
412
423
  - `PlainStringRecordFault` — type
413
424
  - `PlainStringRecordRead` — type
425
+ - `PluginId` — type
426
+ - `PluginMarketplaceSentinel` — type
414
427
  - `PluginOptionKeysProblem` — type
415
428
  - `PluginSource` — value+type
416
429
  - `PluginSpec` — value+type
@@ -480,6 +493,7 @@
480
493
  - `RefReferrer` — type
481
494
  - `RefReferrerDomain` — type
482
495
  - `RemoteExecSpec` — value+type
496
+ - `RequestMcpCredentialsVerdict` — type
483
497
  - `RequestMcpTransport` — type
484
498
  - `RequestMcpTransportRead` — type
485
499
  - `RequestStringRecordRead` — type
@@ -526,6 +540,7 @@
526
540
  - `SETTINGS_SOURCES` — value
527
541
  - `SETTINGS_SOURCE_CONTRACT` — value
528
542
  - `SETTINGS_UNITS` — value
543
+ - `SETTINGS_UNIT_READERS` — value
529
544
  - `SHA256_DIGEST_RE` — value
530
545
  - `STALE_HEARTBEAT_MULTIPLIER` — value
531
546
  - `STALE_SESSION_RECORD_MS` — value
@@ -587,6 +602,7 @@
587
602
  - `SettingsSource` — type
588
603
  - `SettingsSourceContract` — type
589
604
  - `SettingsUnitName` — type
605
+ - `SettingsUnitReader` — type
590
606
  - `SetupHookInput` — value
591
607
  - `Sha256Digest` — value
592
608
  - `SiblingResolver` — type
@@ -654,6 +670,7 @@
654
670
  - `WARNING_KINDS` — value
655
671
  - `WEB_ADMIN_CREDENTIALS` — value
656
672
  - `WEB_ADMIN_CREDENTIAL_ENVELOPE_KIND` — value
673
+ - `WEB_ADMIN_CREDENTIAL_FILE_LOCK` — value
657
674
  - `WEB_ADMIN_ENV` — value
658
675
  - `WEB_ADMIN_JWKS_PATH` — value
659
676
  - `WEB_SEARCH_SECTION_KEYS` — value
@@ -754,6 +771,7 @@
754
771
  - `isInstanceStale` — value
755
772
  - `isLoopbackAuthHost` — value
756
773
  - `isLoopbackRouteHost` — value
774
+ - `isPluginMarketplaceSentinel` — value
757
775
  - `isReadyForTraffic` — value
758
776
  - `isRefCheckedDomain` — value
759
777
  - `isReportableRefusalName` — value
@@ -817,6 +835,7 @@
817
835
  - `readDrainRequest` — value
818
836
  - `readDrainRequestReading` — value
819
837
  - `readEffectiveWire` — value
838
+ - `readEnabledPluginsValue` — value
820
839
  - `readEngineSignal` — value
821
840
  - `readEntryIdentityAt` — value
822
841
  - `readEnvModelSlots` — value
@@ -824,6 +843,8 @@
824
843
  - `readHttpHookAllowlistLayer` — value
825
844
  - `readModelRefusals` — value
826
845
  - `readPlainStringRecord` — value
846
+ - `readPluginId` — value
847
+ - `readRequestMcpCredentials` — value
827
848
  - `readRequestMcpTransport` — value
828
849
  - `readRequestStringRecord` — value
829
850
  - `readScopedTokenBinding` — value
@@ -878,6 +899,7 @@
878
899
  - `urlDenyPatternMatches` — value
879
900
  - `urlQueryFragmentHasSecret` — value
880
901
  - `verifyScopedToken` — value
902
+ - `webAdminCredentialLockName` — value
881
903
  - `webAdminSessionUrl` — value
882
904
  - `withheldNameToken` — value
883
905
  - `workerRouteKey` — value
@@ -885,7 +907,7 @@
885
907
  - `writeRoleFor` — value
886
908
  - `wsUrlFlaws` — value
887
909
 
888
- ## `./types`(153)
910
+ ## `./types`(154)
889
911
 
890
912
  - `A2aConfig` — value+type
891
913
  - `A2aPeerSpec` — value+type
@@ -954,6 +976,7 @@
954
976
  - `ModelsConfig` — value+type
955
977
  - `NON_SECRET_URL` — value
956
978
  - `PARSE_TRANSPARENT_KEYS` — value
979
+ - `PLUGIN_ID_SEGMENT_REGEX` — value
957
980
  - `PLUGIN_ORIGIN` — value
958
981
  - `PRIVATE_KEY_PEM_HEADER` — value
959
982
  - `PROBE_CPU_CORES_MAX` — value
@@ -1168,7 +1191,7 @@
1168
1191
  - `withheldNameToken` — value
1169
1192
  - `writeRoleFor` — value
1170
1193
 
1171
- ## `./conformance`(70)
1194
+ ## `./conformance`(73)
1172
1195
 
1173
1196
  - `CaseInput` — type
1174
1197
  - `CaseMeta` — type
@@ -1217,6 +1240,8 @@
1217
1240
  - `WARNING_KINDS` — value
1218
1241
  - `WarningKind` — type
1219
1242
  - `WarningProjection` — type
1243
+ - `WebAdminCredentialLockConformanceReport` — type
1244
+ - `WebAdminCredentialLockImplementation` — type
1220
1245
  - `canonicalize` — value
1221
1246
  - `createContractAdapter` — value
1222
1247
  - `deepEqual` — value
@@ -1238,6 +1263,7 @@
1238
1263
  - `projectionValue` — value
1239
1264
  - `resolveLegExpectation` — value
1240
1265
  - `runConformance` — value
1266
+ - `runWebAdminCredentialLockConformance` — value
1241
1267
  - `stableKey` — value
1242
1268
  - `toManifestDoc` — value
1243
1269
 
@@ -1296,7 +1322,7 @@
1296
1322
  - `tightenVerdict` — value
1297
1323
  - `trustRank` — value
1298
1324
 
1299
- ## `./node`(60)
1325
+ ## `./node`(77)
1300
1326
 
1301
1327
  - `ConditionalWriteResult` — type
1302
1328
  - `ConfigBundle` — type
@@ -1311,6 +1337,17 @@
1311
1337
  - `ConfigDocumentsMigration` — type
1312
1338
  - `ConfigRootIo` — type
1313
1339
  - `DomainReadError` — type
1340
+ - `ENV_FILE_LINE_FAULTS` — value
1341
+ - `ENV_FILE_REF_FAULTS` — value
1342
+ - `EnvFileAssignment` — type
1343
+ - `EnvFileBadLine` — type
1344
+ - `EnvFileLineFault` — type
1345
+ - `EnvFileReading` — type
1346
+ - `EnvFileRefFault` — type
1347
+ - `EnvFileRefusal` — type
1348
+ - `EnvFileResolution` — type
1349
+ - `EnvFileResolveOptions` — type
1350
+ - `EnvFileTrustSeat` — type
1314
1351
  - `EnvModelsDecisionWrite` — type
1315
1352
  - `EnvModelsMigration` — type
1316
1353
  - `EnvModelsMint` — type
@@ -1329,8 +1366,11 @@
1329
1366
  - `SchedulerStoreMutation` — type
1330
1367
  - `TolerantEffective` — type
1331
1368
  - `ValidateResult` — type
1369
+ - `WebAdminCredentialLockHeld` — type
1370
+ - `WebAdminCredentialLockOutcome` — type
1332
1371
  - `createFileSchedulerStore` — value
1333
1372
  - `domainFilePath` — value
1373
+ - `envFilePath` — value
1334
1374
  - `exportBundle` — value
1335
1375
  - `listRequiredEnvNames` — value
1336
1376
  - `loadEnvFile` — value
@@ -1345,11 +1385,14 @@
1345
1385
  - `nodeConfigRootIo` — value
1346
1386
  - `readBundle` — value
1347
1387
  - `readConfigDFileReadingSync` — value
1388
+ - `readEnvFileLines` — value
1348
1389
  - `readEnvModelsDecision` — value
1349
1390
  - `readEnvModelsDecisionSync` — value
1350
1391
  - `readMigrationMarker` — value
1351
1392
  - `remoteExecPath` — value
1393
+ - `resolveEnvFileAssignments` — value
1352
1394
  - `saveSchedulerStore` — value
1395
+ - `tryWebAdminCredentialFileLock` — value
1353
1396
  - `validateDomain` — value
1354
1397
  - `validateRemoteExec` — value
1355
1398
  - `writeBundle` — value
@@ -1610,6 +1653,18 @@
1610
1653
  - `routableInstances` — value
1611
1654
  - `shouldRenewLease` — value
1612
1655
 
1656
+ ## `./plugin-settings`(9)
1657
+
1658
+ - `ENABLED_PLUGINS_VALUE_KINDS` — value
1659
+ - `EnabledPluginsValue` — type
1660
+ - `EnabledPluginsValueKind` — type
1661
+ - `PLUGIN_MARKETPLACE_SENTINELS` — value
1662
+ - `PluginId` — type
1663
+ - `PluginMarketplaceSentinel` — type
1664
+ - `isPluginMarketplaceSentinel` — value
1665
+ - `readEnabledPluginsValue` — value
1666
+ - `readPluginId` — value
1667
+
1613
1668
  ## `./api/auth`(23)
1614
1669
 
1615
1670
  - `ACCESS_TOKEN_TTL_SECONDS` — value
@@ -239,7 +239,9 @@ sema-test 的读数,是本仓自己重跑 `node scripts/conformance-historical.m
239
239
  - **canonical JSON**:对象键排序、数组保序、`undefined` 值的键剔掉。建对象走 `Object.fromEntries`,
240
240
  **不是**逐键赋值 —— 后者对 `"__proto__"` 走原型 setter,会把一个叫 `__proto__` 的顶层键从比对面上
241
241
  悄悄抹掉(两边同样被抹 = 比对器全盲 = 一格假绿)。
242
- - **告警投影**:对 `EffectiveReadWarning` 联合做**穷举 typed 投影** = 每臂减掉 `error`,**从联合逐臂派生**
242
+ - **告警投影**:对 `EffectiveReadWarning` 联合做**穷举 typed 投影** = 每臂减掉 `error` 与该臂声明的**诊断键**(读腿告警里说「触发的是谁 / 为什么 / 哪几只键」的可缺键:`domain-defaulted` 的
243
+ `path` / `identity` / `reasonCode` / `unknownKeys` / `truncatedFrom`、`entry-dropped` 的 `unknownKeys` / `truncatedFrom`;声明只有一处,投影型与 `projectWarning` 都按它走,诊断键读告警本体、不读投影;
244
+ `unknown-keys-*` 的 `truncatedFrom` 不是诊断键,在投影里),**从联合逐臂派生**
243
245
  (4.0.0:属主在契约包的 `./config-fns`,kit 只再导出 —— 此前是 kit 里一份**手写**字段表,给某个 kind 加
244
246
  一个字段两边都不红);`error` 文案**不比对**(它可经脱敏、可随 zod 改字,比文案 = 比实现),但先断言它
245
247
  **不含语料自带的秘密**。`entry-dropped` 的 `identity`(6.1.0:被丢条目原文里读得出的 `name` / `id` /
@@ -260,7 +262,7 @@ sema-test 的读数,是本仓自己重跑 `node scripts/conformance-historical.m
260
262
 
261
263
  ## 8. 秘密扫描的口径(如实登记)
262
264
 
263
- 扫的是**告警**(除 `error` 外的每一只键 + `error` 文案;33.0.0 起不只是投影 —— 不进投影的诊断键,如 `domain-defaulted` 的 `path` / `identity`,也在扫描里),**不是** effective。effective 里逐字承运运维自己写下的那份文档是
265
+ 扫的是**告警**(除 `error` 外的每一只键 + `error` 文案;33.0.0 起不只是投影 —— 不进投影的诊断键,如 `domain-defaulted` 的 `path` / `identity`、词为 `entry-unknown-key` 的 `entry-dropped` 行上的 `unknownKeys` / `truncatedFrom`,也在扫描里),**不是** effective。effective 里逐字承运运维自己写下的那份文档是
264
266
  契约(配置就是他写的那份);而告警是本包**自己铸的新文本** —— 一条把秘密抄进坐标或错误文案的告警,会把
265
267
  秘密带进日志、审计流、管理面,那才是「告警比它诊断的东西更危险」。
266
268
 
@@ -353,3 +355,18 @@ const adapter: ConformanceAdapter = {
353
355
  必须被说出来,而不是被当成「没差别」。6.1.0 起它还两侧剥掉 `entry-dropped.identity`(旧版铸不出):
354
356
  身份的差在 historical 读数里同样看不见;10.1.0 起 `entry-dropped.reasonCode` 同理。
355
357
  - **来源律不能证明非同义反复**(见 §4-4):那一半归消费方半场的变异自证。
358
+
359
+ ## 11. 另一份 kit:凭证文件单写者锁的协议一致性测试
360
+
361
+ 同一子路径还带一份与语料无关的 kit:`runWebAdminCredentialLockConformance(impl)`。`impl` 与 `./node` 的 `tryWebAdminCredentialFileLock` 同签名(同一个把手、同一个四臂结果);
362
+ kit 每格用同一只临时根铸点造一个根、在根下的 `c/` 里放凭证文件,扮「另一个写者」时只做协议里另一个写者会做的事(按协议建锁;接手 = 协议里的收残留:改名挪开、删挪开件、再建自己的锁 —— 从不按路径删锁),跑完删根;
363
+ 报告 `{ ok, cases[{ id, ok, why? }] }`,格 id 稳定、可在消费方的断言里点名。
364
+
365
+ - 格:没人持有 ⇒ 取到(锁在真目标旁、回调拿到锁内读的文本)· 新鲜锁 / 未来 mtime / 未过龄 ⇒ 忙且锁一字不动、不等待 · 过龄 ⇒ 收、不留挪开件 ·
366
+ 持锁期间锁被换成继任者 ⇒ `stillMine()` 假、`replaceWith` 不写、结果 `lost`、继任者的锁原样在 · 同一形下不先问 `stillMine()`,直接 `replaceWith` / `remove` 也不落(两只提交方法各自核身份)·
367
+ 软链写穿、锁在真目标旁 · 悬空软链(链接在、目标不在 —— 经软链到达的凭据文件登出之后的样子)/ 读不了的真目标 / 建不出的锁 /
368
+ 锁名被不是普通文件的东西占着(黑盒格用目录;命名管道与悬空软链在本包白盒钉里)⇒ `unreadable`(有界、不建文件、不写、不碰那只东西、回调不跑;悬空软链是已知限制 —— 登出后再登录写不进去;本版不解析悬空链接的落点:要做就得改原子写器对悬空链接的拒律〔不替链接建它指向的文件〕,那是另一份设计、按大版本排;出路 = 删掉悬空链接,或先重建目标。`./node` 的原语对这一形答的 `unreadable` 多一个可缺的诊断位 `ioKind: "dangling_symlink"`,这份 kit 不判它 —— 别的实现不带这一键也过)·
369
+ `remove()` · 真目标不在 ⇒ `current` 为 `undefined` · 回调抛 ⇒ 放锁原样重抛 · 回调交回 thenable ⇒ `TypeError` · 把手的三只方法出了回调都失效。
370
+ - 黑盒看不到的不判:只试一次的次数、收残留的交错、身份取自 fd 且 fd 钉到放锁 —— 这些要注入系统调用才能排出来,在本包自己的白盒钉里;黑盒只量「忙时不等待」的耗时上界(1 s,单调钟)。
371
+ 过龄格里 kit 自己钉着被收的那只残留(开着一只只读 fd),「新锁不是同一只」的比对因此不受 inode 号复用影响;失锁两格对一只不钉 fd 的实现只是概率性地抓得到。
372
+ - 软链两格(写穿 · 悬空)要求宿主允许建符号链接(Windows 上普通用户默认不允许,那两格会以建链接失败红)。