@sema-agent/settings-schema 34.0.0 → 35.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.
- package/CHANGELOG.md +648 -0
- package/README.md +86 -39
- package/conformance/VERSION +1 -1
- package/conformance/cases/c100-a2a-inside-stale-fingerprint-dropped/expected.json +101 -0
- package/conformance/cases/c100-a2a-inside-stale-fingerprint-dropped/input.json +28 -0
- package/conformance/cases/c100-a2a-inside-stale-fingerprint-dropped/meta.json +6 -0
- package/conformance/cases/c101-a2a-inside-incomplete-dropped/expected.json +113 -0
- package/conformance/cases/c101-a2a-inside-incomplete-dropped/input.json +38 -0
- package/conformance/cases/c101-a2a-inside-incomplete-dropped/meta.json +6 -0
- package/conformance/cases/c102-a2a-inside-incomplete-zero-survivors/expected.json +85 -0
- package/conformance/cases/c102-a2a-inside-incomplete-zero-survivors/input.json +34 -0
- package/conformance/cases/c102-a2a-inside-incomplete-zero-survivors/meta.json +6 -0
- package/conformance/cases/c103-mcp-caller-meta-declared/expected.json +106 -0
- package/conformance/cases/c103-mcp-caller-meta-declared/input.json +28 -0
- package/conformance/cases/c103-mcp-caller-meta-declared/meta.json +6 -0
- package/conformance/cases/c98-a2a-registration-keys-carried/expected.json +163 -0
- package/conformance/cases/c98-a2a-registration-keys-carried/input.json +42 -0
- package/conformance/cases/c98-a2a-registration-keys-carried/meta.json +6 -0
- package/conformance/cases/c99-a2a-preapproval-on-outside-peer-dropped/expected.json +100 -0
- package/conformance/cases/c99-a2a-preapproval-on-outside-peer-dropped/input.json +23 -0
- package/conformance/cases/c99-a2a-preapproval-on-outside-peer-dropped/meta.json +6 -0
- package/dist/a2a-peer-identity.d.ts +116 -0
- package/dist/a2a-peer-identity.js +182 -0
- package/dist/api/credentials.d.ts +94 -14
- package/dist/api/credentials.js +33 -8
- package/dist/atomic-write.d.ts +9 -3
- package/dist/atomic-write.js +14 -6
- package/dist/catalog-manages.js +2 -2
- package/dist/config-d-file.d.ts +0 -3
- package/dist/config-d-file.js +1 -6
- package/dist/config-dir-migration.js +0 -1
- package/dist/config-document-refusal.d.ts +1 -1
- package/dist/config-fns.d.ts +21 -8
- package/dist/config-fns.js +16 -3
- package/dist/config-root-documents.d.ts +3 -54
- package/dist/config-root-documents.js +24 -21
- package/dist/config-root-node.d.ts +2 -96
- package/dist/config-root-node.js +15 -163
- package/dist/conformance/warnings.js +1 -1
- package/dist/conformance/web-admin-credential-lock.js +3 -2
- package/dist/cross-session.d.ts +2 -2
- package/dist/env-model-table.d.ts +3 -3
- package/dist/env-model-table.js +5 -5
- package/dist/fleet.d.ts +5 -5
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/mcp-request-entry.d.ts +19 -0
- package/dist/mcp-request-entry.js +15 -13
- package/dist/migration-receipt.d.ts +9 -11
- package/dist/migration-receipt.js +4 -5
- package/dist/node.d.ts +3 -3
- package/dist/node.js +3 -3
- package/dist/one-time-migrations.d.ts +3 -4
- package/dist/one-time-migrations.js +3 -28
- package/dist/plugin-id-segment.d.ts +15 -0
- package/dist/plugin-id-segment.js +15 -0
- package/dist/plugin-settings.d.ts +61 -0
- package/dist/plugin-settings.js +111 -0
- package/dist/retired-envs.js +5 -0
- package/dist/safety-merge-spec.d.ts +23 -2
- package/dist/safety-merge-spec.js +13 -0
- package/dist/scheduler-store-node.d.ts +14 -11
- package/dist/scheduler-store-node.js +22 -34
- package/dist/scheduler-store.d.ts +21 -6
- package/dist/scheduler-store.js +100 -19
- package/dist/settings-units.d.ts +9 -0
- package/dist/settings-units.js +12 -7
- package/dist/types.d.ts +53 -4
- package/dist/types.js +79 -4
- package/docs/API-SURFACE.md +51 -11
- package/docs/CC-DIVERGENCE.md +2 -1
- package/docs/CONFORMANCE.md +4 -4
- package/docs/CONSUMER-INTEGRATION.md +158 -13
- package/llms-full.txt +47 -18
- package/llms.txt +18 -7
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -36,8 +36,9 @@ server (the workers), and the client (desktop/CLI) seams. No two copies of the s
|
|
|
36
36
|
|
|
37
37
|
The package is **pure**: zero `next`/`react`/server imports, zero DB drivers. It has two runtime dependencies (29.0.0):
|
|
38
38
|
`zod` (a `dependency` pinned `^4.6.3`, also declared as a `peerDependency` with the same range) and `@sema-agent/primitives`
|
|
39
|
-
(`^7.
|
|
40
|
-
`readCredentialRef`,
|
|
39
|
+
(`^7.70.0`, the engine's zero-dependency, browser-safe primitives package — a credential reference is judged by its one reader
|
|
40
|
+
`readCredentialRef`, "is this an absolute host path" by its one judge `isAbsoluteHostPath` (this package re-exports that same function, from 32.0.0),
|
|
41
|
+
and "is this a2a peer registration complete" by its one judge `a2aRegistrationProblems` (the `a2a` entry judge asks it),
|
|
41
42
|
so this package carries no second reading of its own). `npm ls --prod` therefore shows those two. Node built-ins
|
|
42
43
|
only (`node:crypto`, `node:fs`). The machine gate is `test/runtime-dependencies-29.0.0.test.ts`.
|
|
43
44
|
|
|
@@ -52,6 +53,37 @@ only (`node:crypto`, `node:fs`). The machine gate is `test/runtime-dependencies-
|
|
|
52
53
|
> zod 3, nested inside every zod-4 host). The move to zod 4 did not change what any schema accepts or produces —
|
|
53
54
|
> the conformance corpus reads byte-identically on both — only the wording of validation errors (see CHANGELOG 11.0.0).
|
|
54
55
|
|
|
56
|
+
## 升级指引:34.1.x → 35.0.0(BREAKING 八处:`a2a` 对端条目 `A2aPeerSpec` 的条目判 · `a2a` 七只登记键的校验收紧 · MCP 条目 `callerMeta` 坏值整条拒 · 调度店文件读口多必填 `absent`、悬空软链读也抛 · 调度店的记录判官收紧 · 墓碑表加 `SEND_USER_FILE_SANDBOX_PUT_ENDPOINT` · 一次性迁移 SS-M11 窗关删码 · 权益档位 `EntitlementTier.displayName` 坏值整域拒;加性:`a2a` 七只登记键与 14 个新导出 · 自动记忆开关 `autoMemoryEnabled` · `SchedulerRecord` 可选 `lifetime` / `mode` · 权益档位展示名 `EntitlementTier.displayName` 与上界常量 `ENTITLEMENT_TIER_LIMITS`)
|
|
57
|
+
|
|
58
|
+
会让按 34.1.x 写的消费方红的是 A – F 六条(A、C 各含两处);G 起是加性与闭集加词(闭集加词对穷举它们的消费方是破坏,会红一次)。逐件的「改前 → 改后 → 怎么改」、三问、各消费方表与黑盒判据见 CHANGELOG 35.0.0 与 `docs/CONSUMER-INTEGRATION.md` §17、§58 – §61。
|
|
59
|
+
- **A · `a2a` 对端条目判**(BREAKING,运行期):`A2aPeerSpec` 有了第一个 refinement —— 对它调 `.pick()` / `.omit()` / `.partial()`、以它为接收方调 `.merge()`、用 `.extend()` 覆盖已有键,自此运行期抛。要子形的从型派生(`Pick<A2aPeerSpec, …>`)或用 `A2aPeerSpec.shape.<键>` 自己拼;要加键用 `.safeExtend()`;校验条目只用 `A2aPeerSpec` 本身。七只可选登记键(`id` / `boundary` / `fingerprint` / `ownerTeam` / `displayName` / `askEverySkills` / `preApprovedFor`)由读方先升、管理台后写;丢弃词 `DROPPED_ENTRY_REASON_CODES` 尾插 `entry-registration-refused`(穷举的一方补一臂)。**校验收紧**(BREAKING,运行期):存量文档里写着这些键的,值写坏的、不完备的内部条目、两条带同一个 `id` 的,文档面由剥键受理变整份拒;重复 `id` 在视图面让整域落缺省(`domain-defaulted`,不带新键的兄弟条目一起不在)。升级前对存量 `a2a` 文档跑 `validateDomain("a2a", 文档)`,拒的改成合法值、补齐内部登记、去掉重复 `id`,或删掉这些键。
|
|
60
|
+
- **B · MCP 条目 `callerMeta`**(BREAKING,校验收紧):可选布尔,`true` 让引擎在每次调用的 `_meta` 里送调用方标识;布尔之外的值视图面整条丢、文档面整份拒(此前剥键受理)。升级前跑 `validateDomain("mcp", 文档)`,把非布尔值改成 `true` / `false` 或删掉。
|
|
61
|
+
- **C · 调度店文件读口**(BREAKING):`loadSchedulerStore` / `createFileSchedulerStore().load()` 返回 `SchedulerStoreFileRead`(多必填 `absent`:路径不在 ⇒ `true`);店路径是悬空软链时读也抛(此前读作空店)。手搭 / 仿造这两只读口返回值的一方补 `absent`;店路径上的悬空软链修好或删掉。`mutateSchedulerStore` 的回调多第二参 `{ absent }`(单参回调照常)。**记录判官收紧**(BREAKING,运行期):`isSchedulerRecord` 判每一只声明成员的型(`lifetime: {}`、`mode: 1` 不再是记录),并要求整条元素是纯 JSON 数据、其中任何一处的数都是有限数(`createdMs: 1e400`、自定义字段里嵌着的 `1e400` 同此;叶子只许串 / 有限数 / 布尔 / `null`,数组里不许有洞或 `undefined`);不合的元素读成 `malformed-record`(带下标与原值),不进任何读数。经 `mutateSchedulerStore` 的写 = 解析后整只重写(文本表示不保留;读口收下的元素解析后的值不变),读时滤掉的坏记录与过期满七天的会话链记录在下一次这样的写之后从盘上消失。受影响的有三种:手改过店文件、写进型外值的;合型的旧写者往数成员写了非有限数的(写口把内存里的 `NaN` / `Infinity` 落成 `null`:必填的数成员上 34.1.0 读口本来就丢,可选的 `nextRunMs` 上 34.1.0 收、本版判坏形元素,自定义字段上两版都收);拿内存值调 `isSchedulerRecord` 的(`bigint` 叶子、数组的洞、数组里的 `undefined` 现在不算记录)。预检:升级前装上本版,用 `./node` 的 `loadSchedulerStore(店路径, { nowMs: Date.now() })` 只读地读一遍,`warnings` 里有 `malformed-record` 就先改好或删掉盘上那几条再升级。写口不判(照原样序列化交来的数组)。见下面「Scheduler store contract」一条。
|
|
62
|
+
- **D · 墓碑表 `SEND_USER_FILE_SANDBOX_PUT_ENDPOINT`**(BREAKING,运行期):设着非空值即拒启(拒句说删掉它、不需要替代)。服务端删掉沙箱直传通道的那一版才提本版;部署 env 与 worker 规格里删掉这一行。
|
|
63
|
+
- **E · 一次性迁移 SS-M11 删码**(BREAKING):`./node` 不再导出 `migrateEnvModelsDecision` / `readMigrationMarker`(与型 `EnvModelsMigration` / `EnvModelsMint`),包根不再导出 `MigrationMarker` / `MarkedMigrationId`,`ConfigRootIo` 少 `ensureDirectory`;`CONFIG_ROOT_DOCUMENTS` 只剩决定文档;闭集 `ONE_TIME_MIGRATION_IDS` / `MIGRATION_APPLIED_AS` / `OneTimeMigrationWindow.oldForm` 各少一词。起服时调迁移的宿主删掉那一步;决定缺席自此无条件读作 `kept` —— 没被迁移过的本地根要目录顶替 env 模型,就在配置根写 `config.env-models.json` = `{"envModels":"replaced"}`,或从环境里撤掉 `MODEL_ID` / `MODEL_CHEAP_ID`(写 `kept` 与缺席同答,不是出路)。
|
|
64
|
+
- **F · 权益档位 `EntitlementTier.displayName`**(BREAKING,校验收紧):可选展示名,长度 `1..ENTITLEMENT_TIER_LIMITS.displayNameMax`,按原文承运(不裁剪空白、不唯一、不参与匹配,`id` 仍是唯一键),上界常量 `ENTITLEMENT_TIER_LIMITS` 从包根或 `./types` 导入(不手抄数字)。改前每一只读面都将该键当作未知键剥除受理;改后非串 / 空串 / 超长值整域拒(`validateDomain` 答 `ok: false` 指向 `["tiers", i, "displayName"]`,`parseDomain` / `parseDomainLoud` / `parseDomainSalvaged` 抛错,`buildEffective` / `readEffectiveWire` 抛 `DomainReadRefusedError`,整份有效读不返回结果)。本包不主动生成该键(常规写口落盘前会剥掉它,但目录迁移写回的原文档会保留手改或外部写入带进来的未知键),升级前应用本版的 `validateDomain("entitlement", 文档)` 判每一份存量 `entitlement` 文档,有坏值就改成合法字符串或删掉该键。
|
|
65
|
+
- **G · `SchedulerRecord` 的 `lifetime` / `mode`**(加性;对按两词闭集写死的读者是破坏):型 = 已知两词 | 别的串(读口原样交回较新写者的词);把它直接赋给自己两词闭集型的一方编译红一次,改成按词判。
|
|
66
|
+
- **H · 运行依赖** `@sema-agent/primitives` 下界 `^7.70.0`(宿主树里原语包还在 7.69.x 的,npm 会给本包另装一份;要一份就把宿主的抬上去)。
|
|
67
|
+
- **I · 文书更正**:判口 `readRequestMcpCredentials` 的「改成穷举」与「内容版本看得见条目序」两句许诺本版不兑现,随包文字已改成「另行设计」,见 CHANGELOG 35.0.0「更正与写明」。
|
|
68
|
+
|
|
69
|
+
以下为同版的自动记忆开关契约(按发版纪律本块自身为加性;既有输入的读数逐字不变):
|
|
70
|
+
1. **层准入表尾插类目 `autoMemory` 与成员 `autoMemoryEnabled`**:`SAFETY_MERGE_SPEC.autoMemory` 尾插在 `webSearch` 之后(`mergeShape: "replace"` / `minTrust: "global"` / `tighten: { rule: "boolStricter", strict: false }` / `enforcement: "resolver"` / `fail: "closed"`),成员 `autoMemoryEnabled` 为值向收紧(`direction: "tighten"` / 行地板 `"global"` / `boolPole: { strict: false, minTrust: "local" }`)。调用形为 `layerAdmission(source, reading, "autoMemory", "autoMemoryEnabled", value)`(**必须传入 `value`**):`false` 在六个源 × 三种工作区读数下全部 `admitted`;`true`、不带值与非布尔仅在 `userSettings` / `flagSettings` / `policySettings` 下 `admitted`,在 `projectSettings` / `localSettings` / `foreignProjectSettings` 下无论信任读数一律 `below_trust_floor`。
|
|
71
|
+
2. **单元表第十二行 `autoMemoryEnabled` 与纯布尔读法 `"boolean"`**:`SETTINGS_UNITS.autoMemoryEnabled` 尾插在 `semaUiLanguage` 之后(`path: ["autoMemoryEnabled"]` / `reads: "member"` / `reading: "boolean"` / `reader: "engine"` / `sources: SETTINGS_SOURCES`)。`readSettingsUnit("autoMemoryEnabled", raw)` 只认严格布尔 `true` / `false`(不改写 `"disable"` 等字符串,其余与缺席均为 `unreadable`;类目 `fail: "closed"`,收紧成员读不进时不得丢弃,按最严值 `false` 处置)。
|
|
72
|
+
3. **闭集加词(对穷举它们的消费方是破坏)**:对 `SafetyMergeCategory` / `SafetyMergeMember<SafetyMergeCategory>` / `SettingsUnitName` 写穷举或钉表尾次序的地方编译/测试红一次;遍历 `Object.keys(SAFETY_MERGE_SPEC)` / `Object.keys(SETTINGS_UNITS)` 查自己表的消费方会在**运行期**遇到新类目 `autoMemory` 与新单元 `autoMemoryEnabled` —— 补对应行 / 分支即可。
|
|
73
|
+
4. **偏离参照与出路**:参照实现整值替换、最高层赢、项目层可写 `true`;本契约只许越合越紧(`false` 恒胜),在用户层写了 `false` 的用户无法在项目设置文件里重新打开,出路是删掉用户层的 `false` 或使用产品环境变量覆盖(详见 `docs/CC-DIVERGENCE.md` `SS-CCD-11` 与 `docs/CONSUMER-INTEGRATION.md` §58)。
|
|
74
|
+
|
|
75
|
+
## 升级指引:34.0.x → 34.1.0(minor,加性:沙箱 git 拒答表尾插第十一词 `plane_misconfigured` 与凭据平面共享拒答表 `CREDENTIAL_PLANE_REFUSALS` · web-admin 凭证文件锁 `unreadable` 臂的可缺诊断位 `ioKind` · 请求面凭据值的独立判口 `readRequestMcpCredentials` · 插件设置三只纯读法 `readEnabledPluginsValue` / `readPluginId` / `PLUGIN_MARKETPLACE_SENTINELS`(新子路径 `./plugin-settings`;名段文法提成常量 `PLUGIN_ID_SEGMENT_REGEX`);文书:项目登记簿两句、凭据锁「根修」那半句)
|
|
76
|
+
|
|
77
|
+
只加导出、一个闭集尾插词与一个可选键:除新词那一例(`SandboxGitCredentialRefusal` 对 `plane_misconfigured` 由拒变收,两张拒答表各多一行 / 一员)与凭据锁 `unreadable` 答多一个可缺的 `ioKind` 外,既有输入的读数不变、没有校验收紧 —— 不涉及所列例外(第 1、2 条)的消费方代码零动作可升;第 1、2 条会让一部分消费方提货后红一次(对 `SandboxGitRefusalError` 的穷举 `switch` 与 `Record<…>` 全量映射表、对拒答词表按十个词的逐字比对、对 `unreadable` 臂整个结果的深相等)。逐件的读法表、三问、各消费方表与黑盒判据 K43 – K53 见 CHANGELOG 34.1.0 与 `docs/CONSUMER-INTEGRATION.md` §12.5、§56(末尾)、§57,凭据锁那一件在 §8 里 web-admin 凭证文件那一条。
|
|
78
|
+
1. **沙箱 git 拒答表多第十一个词**(加性,提货成本):`SandboxGitRefusalError` / `SANDBOX_GIT_REFUSAL_ERRORS` 尾插 `plane_misconfigured`(状态 503、`terminal`:凭据平面在答方配置错,运维改配置之前定时重试不会成功),既有十词的次序、状态集与 `permanence` 逐字不变;新导出 `CREDENTIAL_PLANE_REFUSALS`(凭据平面共享拒答表,九词)· `CREDENTIAL_PLANE_REFUSAL_ERRORS` · 型 `CredentialPlaneRefusalError`,`SANDBOX_GIT_REFUSALS` 按声明次序由共享表与本口自有两词派生(共享的九行与共享表是同一批对象)。对 `SandboxGitRefusalError` 做穷举 `switch` 的一方补一臂,对它写 `Record<SandboxGitRefusalError, …>` 这类全量映射表的一方补一行;对拒答词表按「十个词」逐字比对的钉改成十一个。**次序:读方先升、发这个词的一方最后改答** —— 没升级的收方遇到它:按本包规则读的当畸形应答、按 HTTP 5xx 兜底的当暂不可用并退避重试,两种都不取值;升级后才读得到 `terminal`、停止定时重试。
|
|
79
|
+
2. **凭据锁 `unreadable` 臂多可缺的 `ioKind`**(加性):`tryWebAdminCredentialFileLock` 在「解凭证路径」那一步失败时,`unreadable` 的结果多一个可缺键 `ioKind`(`dangling_symlink` = 悬空软链〔登出删掉真目标之后链接悬空〕,`read_error` = 别的读不出;词表是包根既有的 `CONFIG_DOCUMENT_IO_KINDS`,不加词);别的 `unreadable`(锁建不出 / 锁名被不是普通文件的东西占着 / 锁内读不了真目标)不带这一键(键不在场,不是 `undefined`)。壳据它直接渲出路(删掉悬空链接,或先重建目标),不解析句子;只有**凭证文件本身**是悬空软链时才是 `dangling_symlink` —— 上层目录的软链悬空时,解路径那一步读不到(ENOENT)照「不存在」往下走,到建锁才失败,答 `unreadable` 而不带这一键(`error` 的句子只说目录写不进〔ENOENT〕,不点名悬空链接)。**悬空软链答 `unreadable` 是本版有意维持的行为**:不建文件、不写,与本包原子写器对悬空链接的拒同一条律;34.0.0 的节与几处随包文字曾把这一形写成「根修后翻成写穿」「后续版本设计先行」「本版不带」,说得不准,撤掉了(随包文字里同类的句子 —— 原子写器头注、一致性测试头注、`docs/CONFORMANCE.md`、本档协议段、`llms-full.txt` 与接入档里的凭据锁段 —— 已改成同一说法;34.0.0 节本身不改字,订正写在 CHANGELOG 34.1.0 节末):本版不解析悬空链接的落点,要做就得改原子写器对悬空链接的拒律(不替链接建它指向的文件),那是另一份设计、按大版本排。对 `unreadable` 臂整个结果做深相等的钉,在「解凭证路径」失败的形上多见一键。
|
|
80
|
+
3. **请求面凭据值的独立判口 `readRequestMcpCredentials`**(加性,包根两个新导出:函数与型 `RequestMcpCredentialsVerdict`):问一个已读出的 `credentials` 值收不收 —— `{ kind: "absent" }` · `{ kind: "taken", credential }`(新造的冻结副本)· `{ kind: "refused", refusal: "credentials_not_carried", reason }`(三臂答案都冻结)。读器 `readRequestMcpTransport` 现在调的就是它,判法与每一句拒句一字未动;只想问「这一个值收不收」、不想为此拼一整条传输的消费方改用它(整条传输还会因 `url` / `headers` 等别的键答 `ok: false`,判口不知道那些)。能力面「请求面收哪些凭据引用种类」的唯一值源仍是 `MCP_REQUEST_CREDENTIAL_KINDS`。**已知的边**:`transport` 形参的型是闭集 `"stdio" | "http"`,类型内的调用到不了表外词;运行期传表外词(纯 JS / 强制转型)会按 http 臂判,对合形保管库引用答 `taken`;改不改、哪一版改另行设计(35.0.0 没有改),要把请求里的 `transport.kind` 交给它的调用方先自己判成两词之一。
|
|
81
|
+
4. **插件设置的三只纯读法**(加性,新子路径 `./plugin-settings`,与包根同一批对象):`readEnabledPluginsValue(v)` 读 `enabledPlugins` 里一个键的值(`true` / `false` / 字符串数组 ⇒ `on` / `off` / `versions`,其余 ⇒ `unreadable`;数组元素不细判)· `readPluginId(v)` 拆插件 id(`<名>@<市场>` 恰一个 `@`,两半各过名段文法;npm 来源 id `@<scope>/<包名>@npm`〔读出的名含 `@` 与 `/`,**不是合法的 `PluginSpec.name`**:中心层插件条目没有 npm 来源形,这样的 id 只能读出、不能原样写成中心层条目〕;`<名>@skills-dir` 是合法 id;读不出 ⇒ `undefined`)· `PLUGIN_MARKETPLACE_SENTINELS`(`inline` / `skills-dir` / `synced` / `builtin` 四词,深冻)与 `isPluginMarketplaceSentinel`。三只都只读值、**不定合并**:中心层 `plugins[].enabled` 与设置层 `enabledPlugins` 怎么组合不在本版 —— 合并读法到货之前,同时读中心 `plugins` 与本机设置文件的宿主只照中心层答、不自己拼;托管策略表与它的哨兵臂、`pluginConfigs` / `extraKnownMarketplaces` 的条目形也不在本版。
|
|
82
|
+
5. **名段文法提成常量 `PLUGIN_ID_SEGMENT_REGEX`**(加性,包根与 `./types`;行为逐字不变):`PluginSpec.name` 与 `PluginSource` 的 marketplace 臂此前各写一遍的名段正则与同一句拒句,现在只有一处定义(包内私有的零 import 叶,`./types` 与包根上是它的原名转出);对同一组坏名,两处的拒句、路径与条数与上一版逐字相同。`./plugin-settings` 冷载入不带出 `./types`、不带出 zod。
|
|
83
|
+
6. **文书更正**(类型旁的注释与随包文字,不改任何类型、校验与导出面):`ProjectRegistration.archivedAt` 的说明原写「没有硬删」,不准 —— 归档保留登记,删除后会话行上的 `projectId` 可能指向已删除的项目,读方按「不存在」处置;`projects` 记录的条目序是契约事实(登记簿的展示序,唯一来源 = 文档条目次序),写者必须保序,今天的内容版本按排序后的键计算、只调换次序不换版本号;凭据锁「后续版本设计先行」那半句更正见第 2 条。
|
|
84
|
+
|
|
85
|
+
本版没有新登记的一次性迁移,也没有到期删码的(`SS-M11` 的窗到 2026-11-26)。
|
|
86
|
+
|
|
55
87
|
## 升级指引:33.1.x → 34.0.0(BREAKING,编译期三处:`planHookCommandSpawn` 入参 `entry.plugin` 必带 `name` · 钩子命令行三只选项词的拒因多必填 `pluginName`(三句拒句改字面)· 公共型 `WarningProjection` 逐臂减掉诊断键;BREAKING,运行期一处(校验放宽):请求面 MCP 条目的 http 传输收 `vault` 凭据引用;加性:被丢条目与告警 `entry-dropped` / `domain-defaulted` 多可缺的 `unknownKeys` / `truncatedFrom` · 单元表第十一个单元 `semaUiLanguage`、每行必填的读者位 `reader` 与读自哪些源 `sources`、新导出 `SETTINGS_UNIT_READERS` / `SettingsUnitReader` · 本地 `.env` 两步读法 · web-admin 凭证文件的单写者锁;文案与命令行:`--help` / `-h` 退 0、拒句一批改字)
|
|
56
88
|
|
|
57
89
|
没有校验收紧、没有已存数据要迁移 —— 会让按 33.1.x 写的消费方红的是第 1 – 3 条(编译期,tsc 报给你)与第 9 条(运行期:同一份请求读出不同结果),第 4 – 6 条与第 10 – 11 条是加性与提货成本,第 7 – 8 条是命令行与文案;下面任何一条都不碰的消费方零动作可升。逐件的「改前 → 改后」、三问、各消费方表与黑盒判据 K1 – K42 见 CHANGELOG 34.0.0 与 `docs/CONSUMER-INTEGRATION.md` §53 – §56。
|
|
@@ -558,11 +590,13 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
558
590
|
|
|
559
591
|
## 升级指引:14.7.x → 14.8.0(加性:配置根上的两份根级文档 · env 模型表的一份读法与写者的计划助手 · 一次性迁移 SS-M11)
|
|
560
592
|
|
|
593
|
+
> 35.0.0 删了本节的一次性迁移 SS-M11 与它的运行记录(窗已关,见「升级指引:34.1.x → 35.0.0」):下面讲迁移与运行记录的句子只是历史;自 35.0.0 起决定缺席无条件读作 `kept`,`readMigrationMarker` / `migrateEnvModelsDecision` 不再导出。
|
|
594
|
+
|
|
561
595
|
- **新面**:配置根(持有 `config.d` 的那个目录)上多两份**根级文档** —— `config.env-models.json`(`{"envModels":"replaced"|"kept"}`:一份管模型面的
|
|
562
596
|
`config.d/models.json` 能不能顶替 env 模型表 `MODEL_ID` / `MODEL_CHEAP_ID`;运行记录在场之后缺席 ≡ `kept`)与 `config.migration.SS-M11.json`(一次性迁移 SS-M11 的运行记录,按 id 一份)。
|
|
563
597
|
读只经 `readEnvModelsDecision` / `readMigrationMarker`;决定文件的写只经 `writeEnvModelsDecision`(迁移铸确认也经它),运行记录由迁移独占创建(都在 `./node`);名字、闭集答案表与读数身份 `envModelsDecisionTag` 在包根。
|
|
564
598
|
这道闸的两样东西由本包出、供引擎读:组拒码常量 `CATALOG_REPLACES_ENV_MODELS_CODE`(`config.catalog_replaces_env_models`)与上面的决定文档;码的意思是 —— env 表已声明、决定不是 `replaced` 时,管模型面的目录被整组拒、env 模型照服。
|
|
565
|
-
强制在引擎一侧:今天引擎(`@sema-agent/core` 7.
|
|
599
|
+
强制在引擎一侧:今天引擎(`@sema-agent/core` 7.71.1)不拒这个组。
|
|
566
600
|
- **写者要做的**(改写 `config.d/models.json` 的每一条路):写之前读 `readEnvModelsDecision(root)`,调 `planEnvModelTableWrite({ env, target, decision, candidate, intent? })`;
|
|
567
601
|
`confirm` ⇒ 把回执给用户看(句子可用 `envModelTableWriteRefusal`),确认后带回 `confirmKey` 再调;`write_with_decision` ⇒ 先
|
|
568
602
|
`writeEnvModelsDecision(root, "replaced", { write: "overwrite" })`、再写 models.json(两次写在你对 models.json 的同一把锁里);`fix_first` ⇒ 先改文档。env 表未声明时计划照写、不写确认。
|
|
@@ -623,7 +657,7 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
623
657
|
```
|
|
624
658
|
|
|
625
659
|
`docs` 里没改的文档是**同一引用** —— 据此写回(26.0.0 起没有一步移除或新建文档;`coverage` 选项随它唯一的读者 SS-M1 删了)。
|
|
626
|
-
`receipts` 逐条说「对哪个坐标做了什么」(`moved` / `rewritten` / `dropped-inert` / `refused
|
|
660
|
+
`receipts` 逐条说「对哪个坐标做了什么」(`moved` / `rewritten` / `dropped-inert` / `refused`;不带值;35.0.0 起没有 `minted` —— 唯一铸它的 SS-M11 删了)。
|
|
627
661
|
`refused` 的坐标原样留着,读侧照旧拒:要人改。再跑一次 = 零改动。
|
|
628
662
|
- **目录形**:`npx @sema-agent/settings-schema migrate <config.d directory> [--check]`(同一只函数;目录当一个 scope;有 refused 一字不写、退出 1;
|
|
629
663
|
`--check` 有改动退出 3;拒收时 stderr 一行说几处被拒、每处的文件 / 坐标 / 原因与出路 —— 与函数结果的 `why` 同一句,原因就是 `refused[]` 里那条 `reason` 开头的那一句;`--help` / `-h` 是求用法:用法打 stdout、退出 0,无参与别的用法错仍是 stderr、退出 2)。命令行问的是「这个目录现在干不干净」:在场的**每一份**文档过文档面的整文档判官(`parseDomain` 一类),判不过的文档 —— 迁移不再改写的陈旧形
|
|
@@ -834,6 +868,12 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
834
868
|
(this package has no reading of the section's shape); the section's settings-document key is published as `WEB_SEARCH_SECTION_KEYS`
|
|
835
869
|
(`["webSearch"]`, the same shape as `HTTP_HOOK_ALLOWLIST_KEYS` / `MCP_SERVER_LIST_KEYS`; each key is also its category's name). The row
|
|
836
870
|
changes no host by itself: a consumer that picks the section has to ask `layerAdmission` for it.
|
|
871
|
+
The auto-memory switch (`autoMemoryEnabled`) has its own appended, memberized row, `autoMemory` (`replace`, `minTrust: "global"`,
|
|
872
|
+
`boolStricter` with `strict: false`, `enforcement: "resolver"`, `fail: "closed"`): tightening-only from every layer — `false` is
|
|
873
|
+
admitted at `local` (all six sources × all three workspace trust readings), while `true`, a non-boolean, or a valueless query sits at
|
|
874
|
+
the row floor `global` (`userSettings` / `flagSettings` / `policySettings` admitted; `projectSettings` / `localSettings` /
|
|
875
|
+
`foreignProjectSettings` ⇒ `below_trust_floor` at every reading). Call `layerAdmission(source, reading, "autoMemory", "autoMemoryEnabled", value)`
|
|
876
|
+
passing `value`, and merge with `boolStricter(strict: false)` (once any admitted layer sets `false`, it stays `false`).
|
|
837
877
|
The ladder's words are a runtime value, the pure-data table `MIN_TRUST_WORDS` (`["local", "session", "project", "global", "managed", "task"]`): `MinTrust` (the
|
|
838
878
|
zod enum) is derived from it, and `trustRank` / `isAtLeast` read nothing else — apart from the JavaScript built-ins `RangeError` / `String`, the body of
|
|
839
879
|
`trustRank` names `MIN_TRUST_WORDS` and `isAtLeast` names `trustRank`, so a consumer that copies the pair whole (a closure with no import, only globals
|
|
@@ -853,19 +893,19 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
853
893
|
A category's `tighten` answers only a `whole` unit's value; a declared member's comparator comes from its row's value class —
|
|
854
894
|
`MemberAdmission.list: true` marks a string-list member, `boolPole` a boolean one, exactly one per row — via
|
|
855
895
|
`memberTighten(category, member)` (`list` ⇒ setUnion for tighten / setNarrower for loosen; neither or both ⇒ RangeError).
|
|
856
|
-
The settings-document unit table is published here too: `SETTINGS_UNITS` (
|
|
896
|
+
The settings-document unit table is published here too: `SETTINGS_UNITS` (twelve units: `permissions` · `permissionMode` ·
|
|
857
897
|
`additionalDirectories` · `sandbox` · `disableBypassPermissionsMode` · `disableAutoMode` · `hooks` · `env` · `model` · `outputStyle` ·
|
|
858
|
-
`semaUiLanguage`, each with its document `path`, category, addressing, reading, `reader` and `sources`), `unitTighten(unit, member?)` (a unit's
|
|
898
|
+
`semaUiLanguage` · `autoMemoryEnabled`, each with its document `path`, category, addressing, reading, `reader` and `sources`), `unitTighten(unit, member?)` (a unit's
|
|
859
899
|
comparator) and `readSettingsUnit(unit, raw, member?)` (its raw-value reading: `"manual"` ⇒ `"default"`, `"disable"` ⇒ `true`, `false`
|
|
860
900
|
stays `false`, `"bypassPermissions"` ⇒ `launch_only`, `semaUiLanguage` takes exactly `en` / `zh` — `zh-CN`, `EN` and the like are not
|
|
861
|
-
folded —, everything outside the unit's reading — and `undefined` / `null` — ⇒ `unreadable`). A writer judges the value it is about to
|
|
901
|
+
folded —, `autoMemoryEnabled` uses the `"boolean"` reading — strictly `true` or `false`, with no string rewrite —, everything outside the unit's reading — and `undefined` / `null` — ⇒ `unreadable`). A writer judges the value it is about to
|
|
862
902
|
write with the same call, so the refusal word is the reading's `reason`. Who reads a unit is its row's `reader`, one of
|
|
863
903
|
`SETTINGS_UNIT_READERS` (`shell` = only the host's own interface, never the engine, wherever it runs — `semaUiLanguage`; `engine` =
|
|
864
904
|
the conservative answer for the rest: the value can change what the engine does, whether the engine reads it or a host folds it into
|
|
865
|
-
the engine's request — the other
|
|
905
|
+
the engine's request — the other eleven, `outputStyle` and `autoMemoryEnabled` included; whether one write reaches one engine depends on how that host feeds
|
|
866
906
|
it, so ask the host): a fact per key, not per category (the `ui` category holds both kinds; its seam string points at the units'
|
|
867
907
|
`reader`); `hooks` is `engine` as a whole, the per-event owner is `HOOK_EVENT_OWNER`. Which settings sources carry a unit is its
|
|
868
|
-
row's `sources`: a value in any other source is not read, and inside them `layerAdmission` answers — the
|
|
908
|
+
row's `sources`: a value in any other source is not read, and inside them `layerAdmission` answers — the eleven other than `semaUiLanguage` carry every source
|
|
869
909
|
(`SETTINGS_SOURCES`), `semaUiLanguage` only `UI_LANGUAGE_SETTING.source` (user settings, which `layerAdmission` admits for `ui`).
|
|
870
910
|
The UI-language row takes its key, category and source from `UI_LANGUAGE_SETTING`; its comparator is the `ui` category's `none`.
|
|
871
911
|
- **Settings sources + layer admission** (`settings-sources.ts`, main barrel): `SETTINGS_SOURCES` (declaration order =
|
|
@@ -950,14 +990,16 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
950
990
|
(nothing written) when the lock is no longer this caller's. Loss is sticky: once the handle has answered "not mine" (including "could not tell"),
|
|
951
991
|
it never writes again. The answer is closed: `acquired` / `lost` (the callback ran, but the lock was found taken over or could not be confirmed —
|
|
952
992
|
a write the handle answered `true` for BEFORE that point did land; whether a write landed is the method's own answer, not the status) / `busy` (`heldForMs` when the age was read and not in the future) / `unreadable` (the lock or
|
|
953
|
-
the target could not be created / read; nothing ran, nothing was written — never an unlocked fallback
|
|
993
|
+
the target could not be created / read; nothing ran, nothing was written — never an unlocked fallback; when it is the credential path itself that could not be resolved the
|
|
994
|
+
answer also carries an optional `ioKind` — `dangling_symlink` for a dangling link, `read_error` for anything else — so a shell can show the way out without parsing the sentence; the
|
|
995
|
+
other `unreadable` answers do not carry the key). The callback must be synchronous: an
|
|
954
996
|
`async` callback is a compile error, and a callback that returns a promise at runtime is refused with a `TypeError` after the lock is released.
|
|
955
997
|
**Another implementation of this protocol must pass `runWebAdminCredentialLockConformance(implementation)`** (`./conformance`; same signature as
|
|
956
998
|
`tryWebAdminCredentialFileLock`) — one protocol, one set of checks; two implementations each declaring themselves compliant does not count.
|
|
957
999
|
Limits, stated: **a credential file reached through a symbolic link is not writable again after a logout deletes the link's target** — the link now dangles
|
|
958
1000
|
and the next lock attempt answers `unreadable` (fail closed: nothing created, nothing written; the way out is to remove the dangling link or recreate its
|
|
959
|
-
target; a credential path that is the real file is not affected);
|
|
960
|
-
|
|
1001
|
+
target; a credential path that is the real file is not affected); this version does not resolve a dangling link to the place it points at — that
|
|
1002
|
+
would mean changing the package's atomic writer, which refuses to create the file a link points at, so it would be a separate design and a major release. The
|
|
961
1003
|
lock name's occupant is judged as seen when the lock is attempted; swapped between the type check and the act it can show up as the kernel's own `code`
|
|
962
1004
|
and sentence (a link put there between the check and the open), as `busy` (a directory or link put there between the first collision and the second
|
|
963
1005
|
exclusive create), or as a link moved aside and deleted like a stale lock (put there under an old lock between its stat and the rename). A holder frozen for longer than `staleMs` (debugger, `SIGSTOP`) is taken over, and the one system call between its last identity
|
|
@@ -977,11 +1019,12 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
977
1019
|
default, carried verbatim by `readEffectiveWire` (`EffectiveWire.sandboxGit` is `unknown`) and judged by the consumer with `SandboxGitConfig`.
|
|
978
1020
|
(2) The credential port's wire for `kind: "sandbox_git"`: `SandboxGitCredentialRequest` (claim a handle), `CredentialHandleAnswer` /
|
|
979
1021
|
`CredentialResolveRequest` (kind-independent), `SandboxGitCredentialAnswer` with one `SandboxGitOriginAnswer` per origin (discriminated by
|
|
980
|
-
`state`; `secret` only on the `active` arm — other arms strip it), `SandboxGitCredentialRefusal` (`{ error, permanence, message }`).
|
|
981
|
-
each
|
|
982
|
-
and the answer arms' reason domains derive from it), `SANDBOX_GIT_REFUSALS` (
|
|
983
|
-
|
|
984
|
-
`
|
|
1022
|
+
`state`; `secret` only on the `active` arm — other arms strip it), `SandboxGitCredentialRefusal` (`{ error, permanence, message }`). Word tables
|
|
1023
|
+
(each word's row — HTTP statuses and `permanence` — is written once): `SANDBOX_GIT_ORIGIN_VERDICTS` (the 11-row per-origin judgment order; `SANDBOX_GIT_ORIGIN_STATES` / `SANDBOX_GIT_ORIGIN_REASONS`
|
|
1024
|
+
and the answer arms' reason domains derive from it), `SANDBOX_GIT_REFUSALS` (11 refusal words → HTTP statuses + `permanence`, derived in a
|
|
1025
|
+
declared order from the credential plane's shared table `CREDENTIAL_PLANE_REFUSALS` (9 words) and this port's own two words — the previous
|
|
1026
|
+
release's ten words keep their order, new words are appended; `SANDBOX_GIT_REFUSAL_ERRORS` derives from it), `SANDBOX_GIT_PERMANENCE`
|
|
1027
|
+
(`terminal` / `transient`). Both sides' reading is in `docs/CONSUMER-INTEGRATION.md` §12.
|
|
985
1028
|
- **User lifecycle events** (29.0.0; `api/lifecycle-events.ts`, main barrel only — no subpath): the wire shapes of "this principal was deleted /
|
|
986
1029
|
demoted / removed from a space" — the producer (web-admin) emits sequenced events, the consumer (the execution plane) pulls them in pages, dedups by
|
|
987
1030
|
`seq`, and reconciles principals' standing at start-up and when its cursor stops being valid. Shapes and word tables only, no IO; unknown KEYS are stripped
|
|
@@ -1010,16 +1053,15 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
1010
1053
|
writer (the orchestrator that renders the value) and the reader (the engine at boot) import. Judge the value AFTER placeholders are expanded: `http://$(POD_IP):8090` passes,
|
|
1011
1054
|
`http://[$(POD_IP)]:8090` does not (a bracketed host must parse as IPv6). Placeholder expansion, reachability and the absent / empty-string reading are not this package's;
|
|
1012
1055
|
the env name is not a reserved worker env name. Both sides' reading is in `docs/CONSUMER-INTEGRATION.md` §13.
|
|
1013
|
-
- **Config-root documents and the env model table** (14.8.0; names / types / judges / plan in the main barrel,
|
|
1014
|
-
root (the directory holding `config.d`) carries
|
|
1015
|
-
that manages the model plane may replace the env model table, `replaced` | `kept`; absent ≡ `kept`
|
|
1016
|
-
(
|
|
1017
|
-
`
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
the only minter; a `config.d/models.json` that cannot be read — anything but `ENOENT` — mints nothing and is reported with its errno when the error carries one). The judge `catalogManagesModelPlane(doc)` (raw half: at least one entry not explicitly disabled — the same `enabled` reading as a dropped entry's
|
|
1056
|
+
- **Config-root documents and the env model table** (14.8.0; names / types / judges / plan in the main barrel, reader / writer in `./node`): the config
|
|
1057
|
+
root (the directory holding `config.d`) carries one root-level document outside `config.d` — `config.env-models.json` (`ENV_MODELS_DOCUMENT`: whether a catalog
|
|
1058
|
+
that manages the model plane may replace the env model table, `replaced` | `kept`; absent ≡ `kept`); `CONFIG_ROOT_DOCUMENTS` is the list an engine's directory trust judge walks. ONE reader —
|
|
1059
|
+
`readEnvModelsDecision(root)` → `absent | replaced{digest} | kept{digest} | unreadable{bad_json|bad_shape, digest} | unreadable{io, errno}` (the engine gate and
|
|
1060
|
+
the writer's plan answer from it; `envModelsDecisionTag` is the one tagged identity of a reading — `absent` / `d:<digest>` / `io:<errno>` —
|
|
1061
|
+
for warning dedup and the etag) — and ONE writer of the decision,
|
|
1062
|
+
`writeEnvModelsDecision(root, "replaced"|"kept", { write: "overwrite" | "createIfAbsent" })` (the package's atomic writer, the same mode rule as a `config.d` domain document: a new file is 0o644 through the process umask, an existing file keeps its own mode).
|
|
1063
|
+
Since 35.0.0 there is no one-time migration on the root: SS-M11 (which minted `replaced` once where the decision was absent, with a run marker
|
|
1064
|
+
`config.migration.SS-M11.json`), its run-marker reader and the marker's entry in `CONFIG_ROOT_DOCUMENTS` were removed after the window; a marker left on disk is inert. The judge `catalogManagesModelPlane(doc)` (raw half: at least one entry not explicitly disabled — the same `enabled` reading as a dropped entry's
|
|
1023
1065
|
identity) and `enabledEntryCount(doc)`. The env model table read once — `readEnvModelSlots` / `envModelTableDeclared` (`MODEL_ID` present and non-empty) /
|
|
1024
1066
|
`buildEnvModelBaseline` — and the writer's plan `planEnvModelTableWrite({ env, target, decision, candidate, intent? })` (receipt by upstream id with landings
|
|
1025
1067
|
`{name, id}`, `confirmKey` = the receipt's sorted JSON) with its one sentence `envModelTableWriteRefusal(plan)`. Group-refusal codes
|
|
@@ -1038,7 +1080,8 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
1038
1080
|
two families with a replacement, setting it alongside does not lift the refusal; an empty string is unset); a chain is one hop (every row points at a current name). `retiredEnvRefusal(env)` is
|
|
1039
1081
|
the one refusal sentence (code `RETIRED_ENV_REFUSAL_CODE` = `config.env_key_retired`; names keys, never values;
|
|
1040
1082
|
pure — pass the env you are judging); `buildRetiredEnvWire()` is the catalog projection (`retired[]`). The engine's
|
|
1041
|
-
boot, the shell starting a local engine and web-admin rendering worker env all judge this one table
|
|
1083
|
+
boot, the shell starting a local engine and web-admin rendering worker env all judge this one table (including
|
|
1084
|
+
`SEND_USER_FILE_SANDBOX_PUT_ENDPOINT` as a `removed` row after the sandbox direct-upload lane was removed — delete the variable; no replacement is needed).
|
|
1042
1085
|
- **Multi-tenant scopes** (`api/scopes.ts`, subpath `./api/scopes`): the scope contract — the `Scope`
|
|
1043
1086
|
entity (`{id,name,createdAt}`, reserved default `"global"` always exists), per-scope `ScopeMember`
|
|
1044
1087
|
rows (`{scopeId,principal,role}` on the existing viewer<editor<publisher<admin ladder), the JWT
|
|
@@ -1218,8 +1261,13 @@ settings 单元读不进的成员**不是缺席**(`loosen` 可丢且要响,`tigh
|
|
|
1218
1261
|
(wake/next-turn/hold/refuse — the core 7.30.0 vocabulary, `accept` retired in 6.0.0; `default` = unset) and `dialogExpiry` (60s/5m/10m/never), each with a reader that
|
|
1219
1262
|
answers `ok:false` on a bad value instead of silently folding to the default.
|
|
1220
1263
|
- **Scheduler store contract** (`scheduler-store.ts`, subpath `./scheduler-store`; the fs binding is in
|
|
1221
|
-
`./node`): the durable self-wake record shape + `parseSchedulerStore` / `serializeSchedulerStore`
|
|
1222
|
-
(forward-compatible: unknown fields survive a round-trip, malformed records are dropped one by one).
|
|
1264
|
+
`./node`): the durable self-wake record shape (`SchedulerRecord`, including optional `lifetime?: "durable" | "session" | (string & {})` and `mode?: "task" | "session-wakeup" | (string & {})` — the type is open past the known words because `isSchedulerRecord` judges only that these two keys are strings when present, not which word, and hands a newer writer's word back verbatim; read them word by word) + `parseSchedulerStore` / `serializeSchedulerStore`
|
|
1265
|
+
(forward-compatible: unknown fields survive a round-trip, malformed records are dropped one by one; `parseSchedulerStore` and `SchedulerStore.load()` return `SchedulerStoreRead`).
|
|
1266
|
+
The one record judge `isSchedulerRecord` (35.0.0) has two rules: every declared member that is present holds its declared type (the required ones are present), and the element is plain JSON data in which every number — declared members, custom fields and their nesting alike — is finite (`1e400` parses to `Infinity`; leaves are strings, finite numbers, booleans or `null`, and an array has no holes and no `undefined`); anything else is a `malformed-record` (carrying its index and the raw value) and is in no reading. The writers do not judge: they serialize the array they are handed, so an in-memory `NaN` / `Infinity` lands on disk as `null` (on a declared number member that record is malformed on the next read; on a custom field the value silently becomes `null`).
|
|
1267
|
+
What a write does to the file: every write rewrites the whole array (`serializeSchedulerStore`, two-space JSON), never the original text. `mutateSchedulerStore` (the one cross-process write primitive) writes an array that came from its own parse of the file, so a write through it is parse-then-rewrite — the text is not kept (spacing, a repeated key keeps only its last value, number spelling: an integer above 2^53 is written back as the rounded number it parsed to, `-0` as `0`); the parsed value of every record the read kept is unchanged by the write (numbers compared as JSON numbers) — a number beyond the double range never becomes `null`, because the element carrying it is malformed when read; `saveSchedulerStore` / `createFileSchedulerStore().save` write the array the caller hands in and do not read the file (the same holds when that array is a read's `records`). A record the read dropped is gone from disk after the next successful write of a parsed array: a malformed record (`malformed-record`) and a stale session-chain record (four conditions at once: `lifetime` is `"session"`, `sessionId` is a non-empty string, `nextRunMs` is present, and it is at least `STALE_SESSION_RECORD_MS` (7 days) in the past) (`stale-session-record`) are filtered when the file is read, so they are not in the array `mutateSchedulerStore` hands its callback and are not written back. A caller that wants to keep a copy reads the warnings first (`malformed-record` carries the raw value; `stale-session-record` carries only `id` / `sessionId` / `nextRunMs`).
|
|
1268
|
+
The `./node` file reader (`loadSchedulerStore` and `createFileSchedulerStore().load()`) returns `SchedulerStoreFileRead` (`SchedulerStoreRead & { readonly absent: boolean }`, exported from the package root and `./scheduler-store`; `SchedulerStore` itself is unchanged): a missing target returns `{ records: [], warnings: [], absent: true }`, while any read file (including `[]` or unreadable non-array JSON) returns `absent: false`.
|
|
1269
|
+
Both `loadSchedulerStore` and `mutateSchedulerStore` read through the package's one sync read-if-present reader: they read the file first (a symlink to a real store file reads that file, `absent: false`); only when that read answers `ENOENT` do they ask the symlink judge (`resolveSymlinkTarget`, the one the writers use), which tells a path with nothing on it (`absent: true`) from a dangling symlink (throws the same dangling-link sentence as the writers). Other read failures are thrown as they come — the same error class and code as before; the write path still refuses a dangling symlink.
|
|
1270
|
+
`mutateSchedulerStore` passes `{ readonly absent: boolean }` as the second argument to its callback on every attempt (including replays after a lost race); single-parameter callbacks and `SchedulerStoreMutation` are unchanged.
|
|
1223
1271
|
The `./node` writers (`saveSchedulerStore` / `mutateSchedulerStore` / `createFileSchedulerStore().save`) write the store file 0o600 through the
|
|
1224
1272
|
process umask (a stricter umask only makes it stricter) and, since 29.0.0, create a missing parent directory exactly 0o700 at every level, whatever
|
|
1225
1273
|
the process umask (an existing directory keeps its mode; POSIX permission bits — on Windows the mode maps only to the read-only attribute, no
|
|
@@ -1365,18 +1413,17 @@ local `.env`). This package never carries a credential.
|
|
|
1365
1413
|
collab.json runtime.json governance.json execution.json prompts.json limits.json
|
|
1366
1414
|
remote-exec.json # NOT a domain (the exec backend; read by loadRemoteExec)
|
|
1367
1415
|
config.env-models.json # the env-model-table decision {"envModels":"replaced"|"kept"} (readEnvModelsDecision / writeEnvModelsDecision)
|
|
1368
|
-
config.migration.SS-M11.json # the run marker of one-time migration SS-M11 {"migration":"SS-M11"} (readMigrationMarker; written only by the migration)
|
|
1369
1416
|
.env # secret VALUES only (KEY=value); gitignored; never read into any *.json (read by loadEnvFile = readEnvFileLines + resolveEnvFileAssignments)
|
|
1370
1417
|
```
|
|
1371
1418
|
|
|
1372
|
-
**The root belongs to the client (TOC).** An engine writes exactly
|
|
1373
|
-
file stores read only `config.d`, and no inspected config reader treats
|
|
1374
|
-
keeps
|
|
1375
|
-
portable `config.d` domains:
|
|
1376
|
-
ConfigMap, a restore), the
|
|
1377
|
-
decision before `config.d/models.json` (both under its lock on `models.json`)
|
|
1378
|
-
|
|
1379
|
-
|
|
1419
|
+
**The root belongs to the client (TOC).** An engine writes exactly one file in it — the root-level decision document above, outside `config.d` (the sampled
|
|
1420
|
+
file stores read only `config.d`, and no inspected config reader treats it as a domain document, so it is inert to old and new engines alike); a client
|
|
1421
|
+
keeps it in its own registry of persistent files (hygiene, export and reset must not drop or flag it). Bundles (`exportBundle` / `readBundle`) carry only the
|
|
1422
|
+
portable `config.d` domains: the decision is a deployment decision and does not travel. Laid down offline (before any engine starts on the root: an image, a
|
|
1423
|
+
ConfigMap, a restore), the decision and the domain documents may be written in any order; at runtime the order is fixed — a writer writes the
|
|
1424
|
+
decision before `config.d/models.json` (both under its lock on `models.json`). Since 35.0.0 there is no run marker and no migration that mints the decision
|
|
1425
|
+
(one-time migration SS-M11 was removed after its window): an absent decision reads as `kept`, and a `config.migration.SS-M11.json` left in a root by an older
|
|
1426
|
+
engine is an inert file nothing reads (a client may keep or delete it).
|
|
1380
1427
|
|
|
1381
1428
|
Fleet-only domains (`workers`, `hosts`, `systems`) are omitted on a single machine — they resolve to schema
|
|
1382
1429
|
defaults. Each `config.d/<domain>.json` is exactly that domain's zod object.
|
package/conformance/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
35.0.0
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"domains": {
|
|
3
|
+
"outcome": "effective",
|
|
4
|
+
"effective": {
|
|
5
|
+
"a2a": {
|
|
6
|
+
"peers": [
|
|
7
|
+
{
|
|
8
|
+
"enabled": true,
|
|
9
|
+
"name": "ops",
|
|
10
|
+
"scenarios": [],
|
|
11
|
+
"url": "https://ops.example/"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"collab": {
|
|
16
|
+
"templates": []
|
|
17
|
+
},
|
|
18
|
+
"entitlement": {
|
|
19
|
+
"budgetGroups": [],
|
|
20
|
+
"groupBindings": [],
|
|
21
|
+
"subjects": [],
|
|
22
|
+
"tiers": []
|
|
23
|
+
},
|
|
24
|
+
"execution": {
|
|
25
|
+
"allowedLanes": [
|
|
26
|
+
"host"
|
|
27
|
+
],
|
|
28
|
+
"required": false
|
|
29
|
+
},
|
|
30
|
+
"governance": {},
|
|
31
|
+
"hosts": {
|
|
32
|
+
"hosts": []
|
|
33
|
+
},
|
|
34
|
+
"limits": {},
|
|
35
|
+
"mcp": {
|
|
36
|
+
"servers": []
|
|
37
|
+
},
|
|
38
|
+
"models": {
|
|
39
|
+
"atMention": {
|
|
40
|
+
"mode": "all"
|
|
41
|
+
},
|
|
42
|
+
"models": [],
|
|
43
|
+
"roles": {},
|
|
44
|
+
"tierGroups": []
|
|
45
|
+
},
|
|
46
|
+
"plugins": {
|
|
47
|
+
"plugins": []
|
|
48
|
+
},
|
|
49
|
+
"projects": {
|
|
50
|
+
"projects": {}
|
|
51
|
+
},
|
|
52
|
+
"prompts": {},
|
|
53
|
+
"rosters": {
|
|
54
|
+
"rosters": []
|
|
55
|
+
},
|
|
56
|
+
"scenarios": {
|
|
57
|
+
"scenarios": []
|
|
58
|
+
},
|
|
59
|
+
"skills": {
|
|
60
|
+
"skills": []
|
|
61
|
+
},
|
|
62
|
+
"systems": {
|
|
63
|
+
"systems": []
|
|
64
|
+
},
|
|
65
|
+
"workers": {
|
|
66
|
+
"workers": []
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"warnings": [
|
|
70
|
+
{
|
|
71
|
+
"domain": "a2a",
|
|
72
|
+
"identity": {
|
|
73
|
+
"id": "peer-billing-01",
|
|
74
|
+
"name": "billing"
|
|
75
|
+
},
|
|
76
|
+
"kind": "entry-dropped",
|
|
77
|
+
"path": [
|
|
78
|
+
"peers",
|
|
79
|
+
0
|
|
80
|
+
],
|
|
81
|
+
"reasonCode": "entry-registration-refused"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"metadata": {
|
|
85
|
+
"version": 30,
|
|
86
|
+
"updatedAt": "2026-11-17T00:00:00.000Z"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"strictWrite": {
|
|
90
|
+
"outcome": "rejected",
|
|
91
|
+
"stage": "validate",
|
|
92
|
+
"why": "拒:内部条目的戳摘要半段与身份字段对不上(条目判,问题词 fingerprint_stale);读腿逐条丢这一条(entry-dropped,entry-registration-refused),严写 ⇒ 整份不受理。"
|
|
93
|
+
},
|
|
94
|
+
"wire": {
|
|
95
|
+
"derive": true
|
|
96
|
+
},
|
|
97
|
+
"localRoot": {
|
|
98
|
+
"derive": true,
|
|
99
|
+
"localVersion": 3704274152517189
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"version": 30,
|
|
4
|
+
"updatedAt": "2026-11-17T00:00:00.000Z"
|
|
5
|
+
},
|
|
6
|
+
"domains": {
|
|
7
|
+
"a2a": {
|
|
8
|
+
"peers": [
|
|
9
|
+
{
|
|
10
|
+
"name": "billing",
|
|
11
|
+
"url": "https://billing.elsewhere.example/a2a",
|
|
12
|
+
"id": "peer-billing-01",
|
|
13
|
+
"boundary": "inside",
|
|
14
|
+
"fingerprint": "720c5b110eab3e43cb5dbb22cc7820f6.0949683e0604f4f4ed4dcdc13690fc5e",
|
|
15
|
+
"ownerTeam": "Finance platform",
|
|
16
|
+
"principalHeader": "X-Principal",
|
|
17
|
+
"allowSkills": [
|
|
18
|
+
"reconcile"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "ops",
|
|
23
|
+
"url": "https://ops.example/"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contributor": "contract",
|
|
3
|
+
"claim": "内部条目的身份戳摘要半段与它的身份字段对不上(戳是按 `https://billing.internal.example/a2a` 铸的,地址被改成了别的、戳没换)⇒ 读腿整条丢(`entry-dropped`,`entry-registration-refused`,身份点名)、兄弟存活;严写整份拒(问题词 `fingerprint_stale`)。条目别的登记都齐(`id` / 团队 / 能力名单 / 主体头 / https),所以这一条只测旧戳。打的是:只比「戳在不在」、不复算摘要的读者 —— 改走地址的内部对端带着旧身份的戳被挂上,对旧身份给过的放行跟着生效。",
|
|
4
|
+
"firstRedOn": [],
|
|
5
|
+
"note": "firstRedOn 为空:入库的 historical 阶梯不覆盖这一批的新键;22.0.0 起、加键之前的每一版读方对这一条同样整条丢,但原因词是 `entry-unknown-key`(它不认识这些键),不是本条要打的那条律。逐条问题词(`registrationProblems: [\"fingerprint_stale\"]`)是诊断键、不进投影,由 test/a2a-peer-registration.test.ts 钉着。"
|
|
6
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"domains": {
|
|
3
|
+
"outcome": "effective",
|
|
4
|
+
"effective": {
|
|
5
|
+
"a2a": {
|
|
6
|
+
"peers": [
|
|
7
|
+
{
|
|
8
|
+
"enabled": true,
|
|
9
|
+
"name": "ops",
|
|
10
|
+
"scenarios": [],
|
|
11
|
+
"url": "https://ops.example/"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"collab": {
|
|
16
|
+
"templates": []
|
|
17
|
+
},
|
|
18
|
+
"entitlement": {
|
|
19
|
+
"budgetGroups": [],
|
|
20
|
+
"groupBindings": [],
|
|
21
|
+
"subjects": [],
|
|
22
|
+
"tiers": []
|
|
23
|
+
},
|
|
24
|
+
"execution": {
|
|
25
|
+
"allowedLanes": [
|
|
26
|
+
"host"
|
|
27
|
+
],
|
|
28
|
+
"required": false
|
|
29
|
+
},
|
|
30
|
+
"governance": {},
|
|
31
|
+
"hosts": {
|
|
32
|
+
"hosts": []
|
|
33
|
+
},
|
|
34
|
+
"limits": {},
|
|
35
|
+
"mcp": {
|
|
36
|
+
"servers": []
|
|
37
|
+
},
|
|
38
|
+
"models": {
|
|
39
|
+
"atMention": {
|
|
40
|
+
"mode": "all"
|
|
41
|
+
},
|
|
42
|
+
"models": [],
|
|
43
|
+
"roles": {},
|
|
44
|
+
"tierGroups": []
|
|
45
|
+
},
|
|
46
|
+
"plugins": {
|
|
47
|
+
"plugins": []
|
|
48
|
+
},
|
|
49
|
+
"projects": {
|
|
50
|
+
"projects": {}
|
|
51
|
+
},
|
|
52
|
+
"prompts": {},
|
|
53
|
+
"rosters": {
|
|
54
|
+
"rosters": []
|
|
55
|
+
},
|
|
56
|
+
"scenarios": {
|
|
57
|
+
"scenarios": []
|
|
58
|
+
},
|
|
59
|
+
"skills": {
|
|
60
|
+
"skills": []
|
|
61
|
+
},
|
|
62
|
+
"systems": {
|
|
63
|
+
"systems": []
|
|
64
|
+
},
|
|
65
|
+
"workers": {
|
|
66
|
+
"workers": []
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"warnings": [
|
|
70
|
+
{
|
|
71
|
+
"domain": "a2a",
|
|
72
|
+
"identity": {
|
|
73
|
+
"id": "peer-billing-01",
|
|
74
|
+
"name": "billing"
|
|
75
|
+
},
|
|
76
|
+
"kind": "entry-dropped",
|
|
77
|
+
"path": [
|
|
78
|
+
"peers",
|
|
79
|
+
0
|
|
80
|
+
],
|
|
81
|
+
"reasonCode": "entry-registration-refused"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"domain": "a2a",
|
|
85
|
+
"identity": {
|
|
86
|
+
"name": "ledger"
|
|
87
|
+
},
|
|
88
|
+
"kind": "entry-dropped",
|
|
89
|
+
"path": [
|
|
90
|
+
"peers",
|
|
91
|
+
1
|
|
92
|
+
],
|
|
93
|
+
"reasonCode": "entry-registration-refused"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"metadata": {
|
|
97
|
+
"version": 30,
|
|
98
|
+
"updatedAt": "2026-11-17T00:00:00.000Z"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"strictWrite": {
|
|
102
|
+
"outcome": "rejected",
|
|
103
|
+
"stage": "validate",
|
|
104
|
+
"why": "拒:两条内部条目登记不完备(一条缺 principalHeader:principal_header_missing;一条缺 id:id_missing);读腿逐条丢这两条(entry-dropped,entry-registration-refused),外部条目照读;严写 ⇒ 整份不受理。"
|
|
105
|
+
},
|
|
106
|
+
"wire": {
|
|
107
|
+
"derive": true
|
|
108
|
+
},
|
|
109
|
+
"localRoot": {
|
|
110
|
+
"derive": true,
|
|
111
|
+
"localVersion": 4458594676457842
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"version": 30,
|
|
4
|
+
"updatedAt": "2026-11-17T00:00:00.000Z"
|
|
5
|
+
},
|
|
6
|
+
"domains": {
|
|
7
|
+
"a2a": {
|
|
8
|
+
"peers": [
|
|
9
|
+
{
|
|
10
|
+
"name": "billing",
|
|
11
|
+
"url": "https://billing.internal.example/a2a",
|
|
12
|
+
"id": "peer-billing-01",
|
|
13
|
+
"boundary": "inside",
|
|
14
|
+
"fingerprint": "720c5b110eab3e43cb5dbb22cc7820f6.0949683e0604f4f4ed4dcdc13690fc5e",
|
|
15
|
+
"ownerTeam": "Finance platform",
|
|
16
|
+
"allowSkills": [
|
|
17
|
+
"reconcile"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "ledger",
|
|
22
|
+
"url": "https://billing.internal.example/a2a",
|
|
23
|
+
"boundary": "inside",
|
|
24
|
+
"fingerprint": "720c5b110eab3e43cb5dbb22cc7820f6.0949683e0604f4f4ed4dcdc13690fc5e",
|
|
25
|
+
"ownerTeam": "Finance platform",
|
|
26
|
+
"principalHeader": "X-Principal",
|
|
27
|
+
"allowSkills": [
|
|
28
|
+
"reconcile"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "ops",
|
|
33
|
+
"url": "https://ops.example/"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contributor": "contract",
|
|
3
|
+
"claim": "内部条目(`boundary: \"inside\"`)登记不完备 ⇒ 读腿逐条丢、兄弟存活:`billing` 没有 `principalHeader`(引擎原语包的完备性判官:`principal_header_missing`)、`ledger` 没有 `id`(本包的词 `id_missing`),两条各一行 `entry-dropped`,原因词 `entry-registration-refused`,身份点名;外部条目 `ops` 照读;严写整份拒。两条的戳都由 `mintA2aPeerFingerprint` 按同一组身份字段铸(戳本身对得上,不是本条要打的)。打的是:不问完备性、把缺主体头的内部条目当内部挂上的读者 —— 对端从此把部署的每个用户看成同一个人;以及把缺 `id` 的内部条目放进读口与审计的读者。",
|
|
4
|
+
"firstRedOn": [],
|
|
5
|
+
"note": "firstRedOn 为空:入库的 historical 阶梯不覆盖这一批的新键;22.0.0 起、加键之前的每一版读方对前两条整条丢,原因词是 `entry-unknown-key`。逐条问题词(`registrationProblems`)是诊断键、不进投影,由 test/a2a-peer-registration.test.ts 钉着。零幸存者那一路见 c102。"
|
|
6
|
+
}
|