@sema-agent/settings-schema 27.2.0 → 29.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 +753 -0
- package/README.md +88 -12
- package/conformance/VERSION +1 -1
- package/conformance/cases/c01-entry-salvage-then-typo/expected.json +1 -1
- package/conformance/cases/c02-hosts-clamp-stacked/expected.json +1 -1
- package/conformance/cases/c03-literal-dotted-top-key/expected.json +1 -1
- package/conformance/cases/c04-all-bad-collection-not-salvaged/expected.json +1 -1
- package/conformance/cases/c07-hooks-is-not-a-config-domain/expected.json +1 -1
- package/conformance/cases/c08-limits-unknown-carried-64/expected.json +1 -1
- package/conformance/cases/c09-limits-unknown-carried-65/expected.json +1 -1
- package/conformance/cases/c10-record-key-secret-redacted-twice/expected.json +1 -1
- package/conformance/cases/c11-unicode-unknown-keys/expected.json +1 -1
- package/conformance/cases/c12-prototype-name-top-keys/expected.json +1 -1
- package/conformance/cases/c13-models-field-null/expected.json +1 -1
- package/conformance/cases/c14-models-field-empty-array/expected.json +1 -1
- package/conformance/cases/c15-models-field-number/expected.json +1 -1
- package/conformance/cases/c18-wire-envelope-not-an-object/expected.json +1 -1
- package/conformance/cases/c19-wire-envelope-no-version/expected.json +1 -1
- package/conformance/cases/c21-governance-empty-object-wins/expected.json +1 -1
- package/conformance/cases/c23-mixed-validity-models/expected.json +1 -1
- package/conformance/cases/c24-valid-entries-with-unknown-keys/expected.json +1 -1
- package/conformance/cases/c25-published-roundtrip-zero-warnings/expected.json +1 -1
- package/conformance/cases/c26-hosts-array-1024/expected.json +1 -1
- package/conformance/cases/c27-hosts-array-1025/expected.json +1 -1
- package/conformance/cases/c28-large-document-over-1mb/expected.json +1 -1
- package/conformance/cases/c29-salvage-then-domain-refine-fails/expected.json +1 -1
- package/conformance/cases/c30-version-triple-a-first/expected.json +1 -1
- package/conformance/cases/c31-version-triple-b-changed/expected.json +1 -1
- package/conformance/cases/c32-version-triple-a-restored/expected.json +1 -1
- package/conformance/cases/c33-limits-nested-carried-key/expected.json +1 -1
- package/conformance/cases/c34-skills-content-vs-manifest/expected.json +1 -1
- package/conformance/cases/c36-skills-entry-without-content/expected.json +1 -1
- package/conformance/cases/c38-remote-exec-is-a-non-domain-file/expected.json +1 -1
- package/conformance/cases/c39-hidden-file-in-config-d/expected.json +1 -1
- package/conformance/cases/c40-s712-identity-only-what-reads-out/expected.json +1 -1
- package/conformance/cases/c41-s792-encoded-pem-identity/expected.json +1 -1
- package/conformance/cases/c42-s792-unknown-key-secret-redacted/expected.json +1 -1
- package/conformance/cases/c43-s792-form-and-deep-encoded-pem/expected.json +1 -1
- package/conformance/cases/c44-s792-utf8-escape-glued-token/expected.json +1 -1
- package/conformance/cases/c45-s792-identity-bounds-and-decode-depth/expected.json +1 -1
- package/conformance/cases/c46-s811-host-name-url-userinfo-withheld/expected.json +1 -1
- package/conformance/cases/c47-s811-roles-key-url-userinfo-withheld/expected.json +1 -1
- package/conformance/cases/c48-s935-model-headers-transported/expected.json +1 -1
- package/conformance/cases/c49-s935-model-headers-secret-entry-dropped/expected.json +1 -1
- package/conformance/cases/c50-s784-lane-host-legal/expected.json +1 -1
- package/conformance/cases/c51-s784-lane-e2b-legal/expected.json +1 -1
- package/conformance/cases/c52-s784-lane-k8s-legal/expected.json +1 -1
- package/conformance/cases/c53-s784-lane-ssh-legal/expected.json +1 -1
- package/conformance/cases/c54-s784-lane-adb-legal/expected.json +1 -1
- package/conformance/cases/c55-s784-lane-local-docker-legal/expected.json +1 -1
- package/conformance/cases/c56-s784-lane-device-legal/expected.json +1 -1
- package/conformance/cases/c57-s784-g1-enabled-no-lane/expected.json +1 -1
- package/conformance/cases/c58-s784-g2-multitenant-host/expected.json +1 -1
- package/conformance/cases/c59-s784-g3-k8s-missing-image/expected.json +1 -1
- package/conformance/cases/c60-s784-g3-e2b-missing-key/expected.json +1 -1
- package/conformance/cases/c61-s784-g3-other-lane-key/expected.json +1 -1
- package/conformance/cases/c62-s784-g7a-session-tidb/expected.json +1 -1
- package/conformance/cases/c63-s784-host-two-replicas/expected.json +1 -1
- package/conformance/cases/c64-s784-multitenant-local-store/expected.json +1 -1
- package/conformance/cases/c65-s784-pg-without-db/expected.json +1 -1
- package/conformance/cases/c66-s784-memory-backend-mismatch/expected.json +1 -1
- package/conformance/cases/c67-s784-retired-field-loud/expected.json +1 -1
- package/conformance/cases/c68-s784-device-local-store/expected.json +1 -1
- package/conformance/cases/c69-deep-encoded-token-past-every-reading/expected.json +1 -1
- package/conformance/cases/c70-rewritten-token-in-front-of-encoded-pem-header/expected.json +1 -1
- package/conformance/cases/c71-one-scanner-write-reads-display-forms/expected.json +1 -1
- package/conformance/cases/c72-dangling-reference-write-seat-refuses/expected.json +1 -1
- package/conformance/cases/c73-projects-extended-registration-reads/expected.json +1 -1
- package/conformance/cases/c74-projects-over-bound-refused/expected.json +3 -72
- package/conformance/cases/c75-projects-patch-remote-uniqueness/expected.json +3 -72
- package/conformance/cases/c76-projects-entry-salvage-nested/expected.json +1 -1
- package/conformance/cases/c77-prompts-center-artifact-carried/expected.json +1 -1
- package/conformance/cases/c78-prompts-empty-bindings-refused/expected.json +1 -1
- package/conformance/cases/c79-prompts-bad-worker-artifact-not-salvaged/expected.json +1 -1
- package/conformance/cases/c80-prompts-wire-v2-verbatim/expected.json +1 -1
- package/conformance/cases/c81-prompts-declaration-bindings-refused/expected.json +1 -1
- package/conformance/cases/c82-prompts-v1-catalog-refused/expected.json +1 -1
- package/conformance/cases/c83-prompts-bad-overlay-not-salvaged/expected.json +1 -1
- package/conformance/cases/c84-sandbox-git-block-carried-verbatim/expected.json +1 -1
- package/conformance/cases/c85-sandbox-git-refused-block-still-carried/expected.json +1 -1
- package/conformance/cases/c86-a2a-peers-legal/expected.json +1 -1
- package/conformance/cases/c87-a2a-credential-refs-not-partially-salvaged/expected.json +1 -1
- package/conformance/cases/c88-projects-content-attestation-carried/expected.json +1 -1
- package/conformance/cases/c89-projects-content-attestation-malformed/expected.json +1 -1
- package/conformance/cases/c90-mcp-assertion-credential-carried/expected.json +143 -0
- package/conformance/cases/c90-mcp-assertion-credential-carried/input.json +30 -0
- package/conformance/cases/c90-mcp-assertion-credential-carried/meta.json +6 -0
- package/conformance/cases/c91-mcp-assertion-header-retired-entry-dropped/expected.json +105 -0
- package/conformance/cases/c91-mcp-assertion-header-retired-entry-dropped/input.json +27 -0
- package/conformance/cases/c91-mcp-assertion-header-retired-entry-dropped/meta.json +6 -0
- package/conformance/cases/c92-mcp-principal-header-with-assertion-dropped/expected.json +105 -0
- package/conformance/cases/c92-mcp-principal-header-with-assertion-dropped/input.json +31 -0
- package/conformance/cases/c92-mcp-principal-header-with-assertion-dropped/meta.json +6 -0
- package/conformance/cases/c93-mcp-header-refs-with-credentials-dropped/expected.json +105 -0
- package/conformance/cases/c93-mcp-header-refs-with-credentials-dropped/input.json +33 -0
- package/conformance/cases/c93-mcp-header-refs-with-credentials-dropped/meta.json +6 -0
- package/conformance/cases/c94-mcp-credentials-env-kind-dropped/expected.json +105 -0
- package/conformance/cases/c94-mcp-credentials-env-kind-dropped/input.json +32 -0
- package/conformance/cases/c94-mcp-credentials-env-kind-dropped/meta.json +6 -0
- package/conformance/cases/c95-mcp-credentials-audience-not-connector-id-dropped/expected.json +105 -0
- package/conformance/cases/c95-mcp-credentials-audience-not-connector-id-dropped/input.json +30 -0
- package/conformance/cases/c95-mcp-credentials-audience-not-connector-id-dropped/meta.json +6 -0
- package/conformance/cases/c96-mcp-credentials-extra-member-dropped/expected.json +105 -0
- package/conformance/cases/c96-mcp-credentials-extra-member-dropped/input.json +31 -0
- package/conformance/cases/c96-mcp-credentials-extra-member-dropped/meta.json +6 -0
- package/conformance/cases/cc01-mcp-toolfaces-non-object/expected.json +1 -1
- package/conformance/cases/cc02-mcp-source-key-is-transported/expected.json +1 -1
- package/conformance/cases/cc03-model-compat-unknown-subkey/expected.json +1 -1
- package/conformance/cases/cli01-model-name-nfc-vs-nfd/expected.json +1 -1
- package/conformance/cases/cli02-control-and-zero-width-chars/expected.json +1 -1
- package/conformance/cases/cli03-credential-pasted-into-unknown-key/expected.json +1 -1
- package/conformance/cases/cli04-env-value-with-newline/expected.json +1 -1
- package/conformance/cases/cli05-long-and-prefix-colliding-names/expected.json +1 -1
- package/conformance/cases/t01-absent-domain-key-not-null/expected.json +1 -1
- package/conformance/cases/t03-prototype-name-key-not-swallowed/expected.json +1 -1
- package/conformance/cases/t04-secret-literal-never-in-warning-value/expected.json +1 -1
- package/conformance/cases/z01-every-domain-empty-object/expected.json +1 -1
- package/conformance/cases/z02-every-domain-unknown-key/expected.json +1 -1
- package/dist/api/auth-bridge.js +4 -3
- package/dist/api/auth.js +6 -5
- package/dist/api/credentials.js +14 -15
- package/dist/api/lifecycle-events.d.ts +266 -0
- package/dist/api/lifecycle-events.js +169 -0
- package/dist/api/pull-token.js +2 -1
- package/dist/api/scopes.js +5 -4
- package/dist/api/wire-scalars.d.ts +13 -0
- package/dist/api/wire-scalars.js +15 -0
- package/dist/atomic-write.d.ts +4 -0
- package/dist/atomic-write.js +26 -3
- package/dist/center-refs.js +3 -2
- package/dist/config-d-file.d.ts +1 -1
- package/dist/config-dir-io.d.ts +1 -1
- package/dist/config-dir-io.js +3 -2
- package/dist/config-document-refusal.d.ts +5 -5
- package/dist/config-document-refusal.js +2 -1
- package/dist/config-fns.d.ts +5 -5
- package/dist/config-fns.js +17 -16
- package/dist/config-root-documents.d.ts +1 -1
- package/dist/config-root-documents.js +4 -3
- package/dist/config-root-node.d.ts +1 -1
- package/dist/config-root-node.js +5 -3
- package/dist/conformance/corpus.d.ts +1 -1
- package/dist/conformance/derive.d.ts +16 -8
- package/dist/conformance/derive.js +41 -24
- package/dist/conformance/index.d.ts +1 -1
- package/dist/conformance/index.js +1 -1
- package/dist/conformance/run.js +8 -9
- package/dist/conformance/types.js +4 -3
- package/dist/connector-authorize-url.d.ts +23 -0
- package/dist/connector-authorize-url.js +129 -0
- package/dist/connector-id.d.ts +23 -0
- package/dist/connector-id.js +27 -0
- package/dist/cross-domain.js +6 -5
- package/dist/cross-session.js +3 -2
- package/dist/deep-freeze.d.ts +26 -0
- package/dist/deep-freeze.js +69 -0
- package/dist/default-model.js +2 -1
- package/dist/device-relay.d.ts +1 -1
- package/dist/device-relay.js +1 -1
- package/dist/env-model-table.js +2 -1
- package/dist/execution-lane-index.d.ts +1 -1
- package/dist/execution-lane-index.js +5 -4
- package/dist/execution-lanes.d.ts +2 -2
- package/dist/execution-lanes.js +18 -17
- package/dist/file-edit.d.ts +44 -0
- package/dist/file-edit.js +70 -1
- package/dist/file-store.d.ts +12 -7
- package/dist/file-store.js +72 -59
- package/dist/fleet.js +14 -13
- package/dist/hooks-config.d.ts +12 -12
- package/dist/hooks-config.js +16 -15
- package/dist/hooks.d.ts +20 -10
- package/dist/hooks.js +30 -19
- package/dist/http-hook-allowlists.js +2 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +6 -2
- package/dist/mcp-entry-credential.d.ts +47 -0
- package/dist/mcp-entry-credential.js +73 -0
- package/dist/mcp-request-entry.d.ts +32 -13
- package/dist/mcp-request-entry.js +106 -59
- package/dist/mcp-server-policy.js +3 -2
- package/dist/migration-receipt.d.ts +3 -3
- package/dist/migration-receipt.js +4 -3
- package/dist/one-time-migrations.d.ts +2 -2
- package/dist/one-time-migrations.js +75 -57
- package/dist/own-key-read.d.ts +3 -1
- package/dist/plain-json-object.d.ts +6 -3
- package/dist/plain-json-object.js +6 -3
- package/dist/portable-domains.d.ts +18 -12
- package/dist/portable-domains.js +21 -15
- package/dist/reserved-member-name.d.ts +1 -1
- package/dist/reserved-member-name.js +3 -2
- package/dist/resolve-roster.js +3 -2
- package/dist/retired-envs.js +3 -6
- package/dist/retired-role-words.d.ts +1 -1
- package/dist/retired-role-words.js +4 -6
- package/dist/safety-merge-spec.d.ts +11 -4
- package/dist/safety-merge-spec.js +5 -4
- package/dist/scheduler-store-node.d.ts +5 -2
- package/dist/scheduler-store-node.js +8 -5
- package/dist/secret-scan.js +1 -1
- package/dist/settings-sources.js +6 -5
- package/dist/settings-units.js +3 -2
- package/dist/sha256.d.ts +5 -0
- package/dist/sha256.js +7 -0
- package/dist/skills-manifest.js +2 -2
- package/dist/types.d.ts +89 -19
- package/dist/types.js +57 -65
- package/dist/ui-language.js +4 -3
- package/dist/url-credential.js +4 -3
- package/dist/url-shape.d.ts +1 -1
- package/dist/url-shape.js +5 -4
- package/dist/web-admin-credential.js +2 -1
- package/dist/web-admin-env.d.ts +1 -1
- package/dist/web-admin-env.js +4 -3
- package/docs/API-SURFACE.md +47 -7
- package/docs/CONFORMANCE.md +6 -4
- package/docs/CONSUMER-INTEGRATION.md +131 -6
- package/llms-full.txt +46 -24
- package/llms.txt +27 -13
- package/package.json +3 -2
|
@@ -37,25 +37,12 @@ import { outgoingPath, redactSecrets } from "./config-fns.js";
|
|
|
37
37
|
import { LANE_ENV_OWNER, LATE_LANE_ENV_KEYS } from "./execution-lane-index.js";
|
|
38
38
|
import { NOT_PLAIN_DATA, UNINSPECTABLE, UninspectableError, captureJson, dataDescriptor, emptyDocument, ownEntriesOf, ownOrThrow, readDeclaredKey, sentenceOfMinted } from "./own-key-read.js";
|
|
39
39
|
import { isJsonArray, isPlainJsonObject, jsonShapeOf } from "./plain-json-object.js";
|
|
40
|
-
import { RETIRED_ROLE_WORDS } from "./retired-role-words.js";
|
|
41
40
|
import { isDomainName, isRetiredDomainName } from "./types.js";
|
|
42
41
|
import { workerRowVerdict } from "./worker-row-verdict.js";
|
|
42
|
+
import { deepFreeze } from "./deep-freeze.js";
|
|
43
43
|
export { MIGRATION_APPLIED_AS, ONE_TIME_MIGRATION_IDS } from "./migration-receipt.js";
|
|
44
44
|
/** 一次性迁移登记表 —— 本族各条窗的**唯一属主**。别处只写「窗见 `ONE_TIME_MIGRATIONS` 登记表」。 */
|
|
45
|
-
export const ONE_TIME_MIGRATIONS = [
|
|
46
|
-
{
|
|
47
|
-
id: "SS-M8",
|
|
48
|
-
oldForm: "refused",
|
|
49
|
-
introducedIn: "12.0.0",
|
|
50
|
-
releasedOn: "2026-10-12",
|
|
51
|
-
removableAfter: "2026-11-11",
|
|
52
|
-
rewrites: "models / rosters: role words removed by core 7.49.0: team, synthesize — the keys roles.team / roles.synthesize (models.roles and every " +
|
|
53
|
-
"rosters[].roles) are removed whatever their value (12.0.0 drops both words from ModelRole: no role reads them, and the engine refuses " +
|
|
54
|
-
"them); every other role and key stays as stored",
|
|
55
|
-
removal: "the next major after the window: delete the SS-M8 step; the retired role-word tombstone stays — its SS-M8 clause goes",
|
|
56
|
-
afterRemoval: "the retired role-word tombstone (permanent): a residual roles.team / roles.synthesize is refused on read and write (read: the entry is dropped " +
|
|
57
|
-
"when other roles survive, else models degrades to its default; rosters: the scope fails to read)",
|
|
58
|
-
},
|
|
45
|
+
export const ONE_TIME_MIGRATIONS = deepFreeze([
|
|
59
46
|
{
|
|
60
47
|
id: "SS-M10",
|
|
61
48
|
oldForm: "refused",
|
|
@@ -110,7 +97,23 @@ export const ONE_TIME_MIGRATIONS = [
|
|
|
110
97
|
afterRemoval: "the runtime.execution.lane tombstone field, the memory-backend refusal for \"tidb\" and the reserved-env refusal for DEVICE_RELAY_URL (permanent): a residual " +
|
|
111
98
|
"15.x row is refused on write and held by readWorkersRows on read, never rewritten",
|
|
112
99
|
},
|
|
113
|
-
|
|
100
|
+
{
|
|
101
|
+
id: "SS-M13",
|
|
102
|
+
oldForm: "refused",
|
|
103
|
+
introducedIn: "29.0.0",
|
|
104
|
+
releasedOn: "2026-11-15",
|
|
105
|
+
removableAfter: "2026-12-15",
|
|
106
|
+
rewrites: "mcp: on a server entry, the parse-transparent keys authForm / entryKind (12.2.0; no reader ever gave them a meaning, removed in 29.0.0) are " +
|
|
107
|
+
"deleted (dropped-inert). An http entry carrying transport.assertionHeader (retired in 29.0.0) is refused and kept verbatim, the whole entry: the " +
|
|
108
|
+
"stored entry has no connector id, so writing transport.credentials = {\"kind\":\"assertion\",\"audience\":\"<connector id>\"} would be a guess — " +
|
|
109
|
+
"the operator writes it by hand from the deployment registry and deletes assertionHeader",
|
|
110
|
+
removal: "the next major after the window: delete the SS-M13 step and SS-M13 from ONE_TIME_MIGRATION_IDS; the transport.assertionHeader tombstone field " +
|
|
111
|
+
"stays — its SS-M13 clause goes",
|
|
112
|
+
afterRemoval: "the transport.assertionHeader tombstone field (permanent): a residual key is refused on write and its entry is dropped on read (the mcp domain " +
|
|
113
|
+
"degrades to its default when no entry survives); residual authForm / entryKind keys are unknown keys — stripped on write, the entry dropped " +
|
|
114
|
+
"on read (entry-unknown-key)",
|
|
115
|
+
},
|
|
116
|
+
]);
|
|
114
117
|
/**
|
|
115
118
|
* 迁移一组存储文档(见文件头「入口」)。纯函数;没改的文档原样返回;**不抬任何版本号**(结果里没有版本 —— 那是调用方的)。
|
|
116
119
|
* 重跑恒等:第二次跑零改动,只剩第一次就 `refused` 的那几张收据(那些坐标原样留着,读侧照旧拒)。
|
|
@@ -143,8 +146,8 @@ export function migrateStoredDocuments(docs) {
|
|
|
143
146
|
const receipts = [];
|
|
144
147
|
// 步序的律:纯改写步在前,拿新 schema 终判改写结果的 workers 行步最后 —— 它判的是**全部**改写之后的行(否则一跑 refused、二跑才过:既不是一次完成,也不幂等)。
|
|
145
148
|
try {
|
|
146
|
-
stepRetiredRoleWords(out, receipts);
|
|
147
149
|
stepPromptsAxes(out, receipts);
|
|
150
|
+
stepMcpServers(out, receipts);
|
|
148
151
|
stepWorkersRows(out, receipts);
|
|
149
152
|
}
|
|
150
153
|
catch (e) {
|
|
@@ -226,6 +229,18 @@ const without = (o, k) => {
|
|
|
226
229
|
const { [k]: _gone, ...rest } = o;
|
|
227
230
|
return rest;
|
|
228
231
|
};
|
|
232
|
+
/**
|
|
233
|
+
* 一只存储文档里的数组(workers 行 / mcp 条目)的行,**按下标读一次**:内建 `Array.prototype.forEach` 的读法(`length` 一次;`0 … length-1` 里在场的下标各一次 `[[HasProperty]]` + `[[Get]]`,洞不读)——
|
|
234
|
+
* v28.0.0 调的是数组实例上的 `forEach` 且边判边写回(写回时走迭代器把各下标再读一次),自此只有这一次读;不走调用方数组自己的迭代器(展开 / `for…of` 会)、不调它自己的成员(实例上的 `forEach`、`slice` 经 `constructor` 取的 species 都会)。
|
|
235
|
+
* 读到的值按原下标**定义**进一只包自己的数组(洞留洞;定义语义:`Array.prototype` 上被污染出数字键的 setter 吞不掉它)。行步判的与写回的都是这一份副本(拒的行原样就是这一次读到的值)。
|
|
236
|
+
*/
|
|
237
|
+
function rowsByIndex(array) {
|
|
238
|
+
const rows = [];
|
|
239
|
+
Array.prototype.forEach.call(array, (row, index) => {
|
|
240
|
+
Object.defineProperty(rows, index, dataDescriptor(row));
|
|
241
|
+
});
|
|
242
|
+
return rows;
|
|
243
|
+
}
|
|
229
244
|
// 收据的三只铸点。坐标里的键段是用户写的(未知键名、zod issue 路径里的 Record 键),完全可能就是一条粘错位置的凭据 ⇒ 与读侧告警坐标
|
|
230
245
|
// 走同一道出门(`outgoingPath`,codex r1 F1);拒因句过 `redactSecrets`。收据从不带值。
|
|
231
246
|
function receipt(migration, document, path, appliedAs) {
|
|
@@ -328,7 +343,7 @@ function stepWorkersRows(out, receipts) {
|
|
|
328
343
|
const workerRows = ownOrThrow(doc, "workers");
|
|
329
344
|
if (!isJsonArray(workerRows))
|
|
330
345
|
return;
|
|
331
|
-
const rows = workerRows;
|
|
346
|
+
const rows = rowsByIndex(workerRows); // 每一行只读一次:判与写回用同一份读数(拒的行原样就是这一份)
|
|
332
347
|
let next;
|
|
333
348
|
rows.forEach((row, index) => {
|
|
334
349
|
if (!isPlainJsonObject(row) || typeof ownOrThrow(row, "name") !== "string")
|
|
@@ -357,45 +372,48 @@ function stepWorkersRows(out, receipts) {
|
|
|
357
372
|
if (next !== undefined)
|
|
358
373
|
out.workers = { ...doc, workers: next };
|
|
359
374
|
}
|
|
360
|
-
// ── SS-
|
|
361
|
-
/**
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
375
|
+
// ── SS-M13:mcp 条目的两只惰性键与退役的断言头 ──────────────────────────────────────────────────────────────────
|
|
376
|
+
/** SS-M13 拒一条带 `assertionHeader` 的 http 条目时的理由句(点名新位与连接器 id 的出处;不回显值)。 */
|
|
377
|
+
const SS_M13_ASSERTION_HEADER_REFUSAL = "transport.assertionHeader was retired in 29.0.0 and the stored entry has no connector id to rewrite it with — write transport.credentials = " +
|
|
378
|
+
"{\"kind\":\"assertion\",\"audience\":\"<connector id>\"} by hand (the connector id is this connector's name in the deployment registry) and delete assertionHeader";
|
|
379
|
+
/** SS-M13 删掉的两只惰性键(12.2.0 的解析透明键,29.0.0 删除)。 */
|
|
380
|
+
const SS_M13_INERT_KEYS = ["authForm", "entryKind"];
|
|
381
|
+
/**
|
|
382
|
+
* SS-M13(只认形):`mcp.servers[]` 逐条 ——
|
|
383
|
+
* · http 条目的传输带 `assertionHeader`(自有键,任何值)⇒ 一张拒收据(坐标 = 那把键),**整条原样**(同一条上的惰性键也不动:拒的行什么都不写);
|
|
384
|
+
* · 否则条目上的 `authForm` / `entryKind` ⇒ 删掉,每键一张 `dropped-inert` 收据。
|
|
385
|
+
* 认不出的形(`mcp` 不是对象、`servers` 不是数组、条目不是对象)⇒ 不动(判形是读者的事)。
|
|
386
|
+
*/
|
|
387
|
+
function stepMcpServers(out, receipts) {
|
|
388
|
+
const doc = ownOrThrow(out, "mcp");
|
|
389
|
+
if (!isPlainJsonObject(doc))
|
|
390
|
+
return;
|
|
391
|
+
const servers = ownOrThrow(doc, "servers");
|
|
392
|
+
if (!isJsonArray(servers))
|
|
393
|
+
return;
|
|
394
|
+
const rows = rowsByIndex(servers); // 每一条只读一次:判与写回用同一份读数(拒的那条原样就是这一份)
|
|
395
|
+
let next;
|
|
396
|
+
rows.forEach((row, index) => {
|
|
397
|
+
if (!isPlainJsonObject(row))
|
|
398
|
+
return;
|
|
399
|
+
const transport = ownOrThrow(row, "transport");
|
|
400
|
+
if (isPlainJsonObject(transport) && ownOrThrow(transport, "kind") === "http" && has(transport, "assertionHeader")) {
|
|
401
|
+
receipts.push(refused("SS-M13", "mcp", ["servers", index, "transport", "assertionHeader"], SS_M13_ASSERTION_HEADER_REFUSAL));
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
const inert = SS_M13_INERT_KEYS.filter((k) => has(row, k));
|
|
405
|
+
if (inert.length === 0)
|
|
406
|
+
return;
|
|
407
|
+
let rewritten = row;
|
|
408
|
+
for (const k of inert) {
|
|
409
|
+
rewritten = without(rewritten, k);
|
|
410
|
+
receipts.push(receipt("SS-M13", "mcp", ["servers", index, k], "dropped-inert"));
|
|
411
|
+
}
|
|
412
|
+
next ??= [...rows];
|
|
413
|
+
next[index] = rewritten;
|
|
414
|
+
});
|
|
415
|
+
if (next !== undefined)
|
|
416
|
+
out.mcp = { ...doc, servers: next };
|
|
399
417
|
}
|
|
400
418
|
// ── SS-M10:prompts 两轴退役 ───────────────────────────────────────────────────────────────────────────
|
|
401
419
|
/** 14.0.0 的 prompts 域只装中心 artifact;13.x 的两轴键是墓碑。迁移只做只认形的那一件:空的 `bindings: []`(13.x 每份文档恒物化的默认值,
|
package/dist/own-key-read.d.ts
CHANGED
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
* 内核覆盖声明键读与整容器读;**仍自带读法的读者按名登记**(各自写明契约;普查钉按「文件 → 函数 → 读法 API」逐处数,登记外出现即红):
|
|
26
26
|
* 既有、未经内核的数据读者:`tightenVerdict` 的 `none` 规则(`strictJsonCopy`:对象的不可枚举键跳过、访问器 ⇒ 整份 `unreadable`;数组按 `length` 逐位读描述符 —— `length` 走一次 `[[Get]]`、不可枚举的下标照读)·
|
|
27
27
|
* 被丢条目的身份(`readEntryIdentity` 读 `name` / `id`,它调的 `ownEnabledFlag`(`./catalog-manages`,与原文判官共用)读 `enabled` —— 同一读法:访问器 ⇒ 当缺席,从不调)· 传输记录读法(`readPlainStringRecord`:自己枚举成员名 `getOwnPropertyNames`,值经 {@link readKey});
|
|
28
|
-
* 不是数据读的:安全判官 `extraBodyUnsafe` 的审计读(`./types`:问「任何自有键上有没有可疑」,含符号键与会抛的描述符,访问器 ⇒ 判不安全,从不调)
|
|
28
|
+
* 不是数据读的:安全判官 `extraBodyUnsafe` 的审计读(`./types`:问「任何自有键上有没有可疑」,含符号键与会抛的描述符,访问器 ⇒ 判不安全,从不调)·
|
|
29
|
+
* 包内冻结助手 `freezeGraph`(`./deep-freeze`:`getOwnPropertyDescriptor` + `Reflect.ownKeys` 走**包自己的闭集常量**的自有数据属性、决定冻谁,不读嵌入方传来的值;它保持零 import,所以不经本内核 ——
|
|
30
|
+
* 是选择,不是做不到:本内核只 import 座位与 zod 的类型,引它不成环)。
|
|
29
31
|
* 直接用 `[[Get]]` 的几处(不经内核,按名登记):hooks 分类器(`Object.keys` + 成员读;闭包可抄的内建写法,随闭包契约变更收)· `collectDropped` / `collectionSlots`(`./config-fns`:
|
|
30
32
|
* 未知键扫描与条目集合的位置表,自己枚举容器再 `[[Get]]`;既有)· http hook 名单读器与判官的**普通读对拍**(安全轴的名单、判官的 `layers` / `hookVars` 要描述符视图
|
|
31
33
|
* 与普通读两份观测一致才算读到 —— 普通读只作对拍,交出去的值取自描述符那一份;见 `./http-hook-allowlists`)。`stableStringify` 已归零(每个容器经 {@link containerView} 的宽归类列一次成员、
|
|
@@ -6,12 +6,15 @@
|
|
|
6
6
|
* (`./one-time-migrations`)、`config.d` 文档形(`./config-d-file`)、`extraBody` 的形闸与秘密走查(`./types`)、settings 单元读法与严格 JSON 深度判(`./settings-units` / `./safety-merge-spec`)、
|
|
7
7
|
* 请求面传输的记录读法与描述件(`./mcp-request-entry`)、workers 行读口(`./workers-rows`)、有效配置线上载荷读口(`./config-fns` 的 `readEffectiveWire`)、http hook 名单的设置袋(`./http-hook-allowlists`)、
|
|
8
8
|
* fleet 线上载荷的受护判(`./fleet`)、符合性语料的比较器 / 派生 / 语料读口 / 元数据拆分(`./conformance/*`)。零 import。
|
|
9
|
-
* **形状分类核 {@link jsonShapeOf} 是座位的本体**,`isPlainJsonObject` 由它派生(`plain` 那一格)
|
|
9
|
+
* **形状分类核 {@link jsonShapeOf} 是座位的本体**,`isPlainJsonObject` 由它派生(`plain` 那一格);本模块里读原型的只有它与安全轴的朴素数组判据 {@link isPlainJsonArray}(全包另有两处读原型,见下)。**总(不抛)**:检视就抛的对象(已撤销的 Proxy、`getPrototypeOf` 陷阱抛)
|
|
10
10
|
* 核答 `uninspectable`、判官答 `false`,不抛出去 —— 全包经座位的读口因此拒而不抛,律在座位上收一处,不在每个读器各包一个 `try`;读者对 `uninspectable` 一律按最严处置(hooks ⇒ 拒整份文档;名单 ⇒ `malformed`;传输 ⇒ 整只不交)。
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* **形状判的第二处是 `./hooks-config` 的 `hookShapeOf` / `hookIsRecord`,与 {@link jsonShapeOf} / 本函数逐字同文(调用名归一后)**:hooks 分类器的闭包要被消费方生成器整函数抄走(闭包里的自由名只有 `HOOK_EVENTS`),闭包里不能 import 本模块 ——
|
|
13
13
|
* 同文由 `test/plain-json-object-single-seat-14.6.0.test.ts` 逐字证明(漂开即红),闭包契约多注入一个名字时(S-2133)把它并回这里。
|
|
14
|
-
*
|
|
14
|
+
* **第三处是包内冻结助手 `./deep-freeze` 的 `freezeGraph`**:它也问「是不是数组」「原型是什么」,但它只接触包自己的闭集常量(不读嵌入方传来的值),判「朴素对象」用的是原型恒等 `Object.prototype`(或 `null`),
|
|
15
|
+
* 与本模块的判法(原型是 `null`,或原型自己的原型是 `null`)不同 —— 它不是本模块的副本,没有「同文」的要求。助手保持零 import 是一个选择(叶性钉与消费方抄本组不必跟着变),不是做不到:本模块自己零 import,引它不成环。
|
|
16
|
+
* 两种「朴素对象」读法收成一种是后续的设计事项,这条注释不改判据。
|
|
17
|
+
* 同一个门也数全包:返回类型是 `x is Record<string, unknown>` 的函数,除本模块与 `./hooks-config` 那一份这两处之外一处不许有;读原型的调用点,除这两处与冻结助手一处之外一处不许有;内联的「typeof 对象 ∧ 非 null ∧ 非数组」合取则**一处都不许有**(座位里它是分开的 `if` 臂,不是合取)。
|
|
15
18
|
*
|
|
16
19
|
* **读者要的答案不只是「是不是朴素对象」时,调本模块的 {@link jsonShapeOf}**(六词形状分类),不在读者里再推一遍形状:例如托管层的 http hook 名单,非朴素的**对象**袋必须 fail-closed(读成空名单并告警),
|
|
17
20
|
* 而 `null` / 原始值 / 数组仍是「整份设置不是对象 ⇒ 两键都缺」—— 两种不同的答案,只能由形状分类给。`isPlainJsonObject` 就是 `jsonShapeOf` 的「朴素」那一格。
|
|
@@ -6,12 +6,15 @@
|
|
|
6
6
|
* (`./one-time-migrations`)、`config.d` 文档形(`./config-d-file`)、`extraBody` 的形闸与秘密走查(`./types`)、settings 单元读法与严格 JSON 深度判(`./settings-units` / `./safety-merge-spec`)、
|
|
7
7
|
* 请求面传输的记录读法与描述件(`./mcp-request-entry`)、workers 行读口(`./workers-rows`)、有效配置线上载荷读口(`./config-fns` 的 `readEffectiveWire`)、http hook 名单的设置袋(`./http-hook-allowlists`)、
|
|
8
8
|
* fleet 线上载荷的受护判(`./fleet`)、符合性语料的比较器 / 派生 / 语料读口 / 元数据拆分(`./conformance/*`)。零 import。
|
|
9
|
-
* **形状分类核 {@link jsonShapeOf} 是座位的本体**,`isPlainJsonObject` 由它派生(`plain` 那一格)
|
|
9
|
+
* **形状分类核 {@link jsonShapeOf} 是座位的本体**,`isPlainJsonObject` 由它派生(`plain` 那一格);本模块里读原型的只有它与安全轴的朴素数组判据 {@link isPlainJsonArray}(全包另有两处读原型,见下)。**总(不抛)**:检视就抛的对象(已撤销的 Proxy、`getPrototypeOf` 陷阱抛)
|
|
10
10
|
* 核答 `uninspectable`、判官答 `false`,不抛出去 —— 全包经座位的读口因此拒而不抛,律在座位上收一处,不在每个读器各包一个 `try`;读者对 `uninspectable` 一律按最严处置(hooks ⇒ 拒整份文档;名单 ⇒ `malformed`;传输 ⇒ 整只不交)。
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* **形状判的第二处是 `./hooks-config` 的 `hookShapeOf` / `hookIsRecord`,与 {@link jsonShapeOf} / 本函数逐字同文(调用名归一后)**:hooks 分类器的闭包要被消费方生成器整函数抄走(闭包里的自由名只有 `HOOK_EVENTS`),闭包里不能 import 本模块 ——
|
|
13
13
|
* 同文由 `test/plain-json-object-single-seat-14.6.0.test.ts` 逐字证明(漂开即红),闭包契约多注入一个名字时(S-2133)把它并回这里。
|
|
14
|
-
*
|
|
14
|
+
* **第三处是包内冻结助手 `./deep-freeze` 的 `freezeGraph`**:它也问「是不是数组」「原型是什么」,但它只接触包自己的闭集常量(不读嵌入方传来的值),判「朴素对象」用的是原型恒等 `Object.prototype`(或 `null`),
|
|
15
|
+
* 与本模块的判法(原型是 `null`,或原型自己的原型是 `null`)不同 —— 它不是本模块的副本,没有「同文」的要求。助手保持零 import 是一个选择(叶性钉与消费方抄本组不必跟着变),不是做不到:本模块自己零 import,引它不成环。
|
|
16
|
+
* 两种「朴素对象」读法收成一种是后续的设计事项,这条注释不改判据。
|
|
17
|
+
* 同一个门也数全包:返回类型是 `x is Record<string, unknown>` 的函数,除本模块与 `./hooks-config` 那一份这两处之外一处不许有;读原型的调用点,除这两处与冻结助手一处之外一处不许有;内联的「typeof 对象 ∧ 非 null ∧ 非数组」合取则**一处都不许有**(座位里它是分开的 `if` 臂,不是合取)。
|
|
15
18
|
*
|
|
16
19
|
* **读者要的答案不只是「是不是朴素对象」时,调本模块的 {@link jsonShapeOf}**(六词形状分类),不在读者里再推一遍形状:例如托管层的 http hook 名单,非朴素的**对象**袋必须 fail-closed(读成空名单并告警),
|
|
17
20
|
* 而 `null` / 原始值 / 数组仍是「整份设置不是对象 ⇒ 两键都缺」—— 两种不同的答案,只能由形状分类给。`isPlainJsonObject` 就是 `jsonShapeOf` 的「朴素」那一格。
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
/** The domains
|
|
2
|
-
*
|
|
3
|
-
* {@link NON_PORTABLE_DOMAIN_REASONS} 里有一条成文理由(
|
|
1
|
+
/** The domains that **travel**: the **default** domain set of the bundle helpers (`exportBundle` / `readBundle`) and the only domains they accept — `exportBundle` / `readBundle` / `writeBundle`
|
|
2
|
+
* refuse any other name at run time (and the types narrow to {@link PortableDomain}), so a domain outside this set cannot be carried into a bundle however the caller spells it.
|
|
3
|
+
* 每个被排除的域必须在 {@link NON_PORTABLE_DOMAIN_REASONS} 里有一条成文理由(禁裸排除)。
|
|
4
4
|
*
|
|
5
|
-
* ⚠️
|
|
6
|
-
*
|
|
7
|
-
* bundle 的那条口子归调用方纪律(以及各自域的导出面),不是本常量能挡住的;要不要把 bundle API 收窄到
|
|
8
|
-
* `PortableDomain` 是一个独立的行为面裁定(#282 未决项,需三问),本批不擅自改。
|
|
5
|
+
* ⚠️ 这只常量回答的是**搬运**的问题,不是「本地读哪些域」的问题:本地文件店读的域集是 {@link LOCAL_READ_DOMAINS}(= 本集 + `projects`)。两个问题 28.0.0 以前共用这一只常量、答案碰巧相同;
|
|
6
|
+
* `projects` 不可搬运(租户身份数据,随包复制进另一个部署 = 凭空多出的身份登记),但单机部署自己的 `config.d/projects.json` 就是它自己的登记簿 —— 所以它在读取集里、不在本集里。
|
|
9
7
|
*
|
|
10
|
-
* 🔴
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* 今日的兜底:漏登记的文件会被 `FileConfigStore`(`./node`)的 `"unread-config-file"` 警告点名(fail-loud,
|
|
8
|
+
* 🔴 **开新顶层域时必须同步登记**(成案 = 消费方的真事故):域表是**闭集**,不在 {@link LOCAL_READ_DOMAINS}(便携域自动在内)里的域名,`config.d/<域>.json` 不会被读进 effective —— 消费方拿到的是「该域缺席」,
|
|
9
|
+
* 和文件不存在**逐字同形**。当年 `limits` 域就是这样在单机腿静默丢了一整片限额发布(远端腿同批可用,所以更难看出来)。新域要么进本集(可搬运,自动进读取集),要么在 {@link NON_PORTABLE_DOMAIN_REASONS} 里写理由
|
|
10
|
+
* (并在需要本地读取时进 {@link LOCAL_READ_DOMAINS})。今日的兜底:漏登记的文件会被 `FileConfigStore`(`./node`)的 `"unread-config-file"` 警告点名(fail-loud,
|
|
14
11
|
* 见 getEffective),但那只在消费方接了 `onWarning` 时才响 —— **登记仍是第一现场的义务**。 */
|
|
15
12
|
export declare const PORTABLE_DOMAINS: readonly ["models", "rosters", "skills", "mcp", "plugins", "scenarios", "collab", "governance", "execution", "prompts", "limits", "a2a"];
|
|
16
13
|
export type PortableDomain = (typeof PORTABLE_DOMAINS)[number];
|
|
14
|
+
/** The domains the local file store reads: `FileConfigStore` (and so `loadLocalConfig`) reads `<root>/config.d/<domain>.json` for exactly these — `getEffective` (strict and tolerant), `read()`, `getVersion()`,
|
|
15
|
+
* the `updatedAt` stamp and the "file nobody reads" sweep all enumerate **this** set. It is {@link PORTABLE_DOMAINS} plus `projects`, built from it (every portable domain is locally readable by construction).
|
|
16
|
+
*
|
|
17
|
+
* `projects` is here and not in {@link PORTABLE_DOMAINS} on purpose: a project registry is tenant identity data, so it never **travels** (no bundle carries it; the bundle helpers still read {@link PORTABLE_DOMAINS}
|
|
18
|
+
* and refuse it at run time) — but a single-machine deployment's own `config.d/projects.json` is that deployment's registry, not one carried in from elsewhere, and the local reader reads it like any other document.
|
|
19
|
+
* A domain outside this set (`workers` / `hosts` / `systems` / `entitlement`) is not read by the local file store: its file is named by an `"unread-config-file"` warning and its domain resolves to the schema default.
|
|
20
|
+
* New local-reader domains are added HERE, with the reason; a domain that also travels goes into {@link PORTABLE_DOMAINS} and joins this set by construction. */
|
|
21
|
+
export declare const LOCAL_READ_DOMAINS: readonly ["models", "rosters", "skills", "mcp", "plugins", "scenarios", "collab", "governance", "execution", "prompts", "limits", "a2a", "projects"];
|
|
22
|
+
export type LocalReadDomain = (typeof LOCAL_READ_DOMAINS)[number];
|
|
17
23
|
/**
|
|
18
|
-
* 非便携域的**排除理由表**(
|
|
24
|
+
* 非便携域的**排除理由表**(禁裸排除)—— 为什么这个域**不随 bundle 搬运**(搬运义;它能不能被本地读取是 {@link LOCAL_READ_DOMAINS} 的事,`projects` 就是不可搬运、却可本地读取)。
|
|
19
25
|
*
|
|
20
26
|
* `satisfies Record<Exclude<DomainName, PortableDomain>, string>` 让键集在**编译期**双向咬死:新开一个
|
|
21
27
|
* 域却不放进 PORTABLE_DOMAINS ⇒ 这里缺行 ⇒ 编译错;把某域改成便携却忘了删行 ⇒ 多余键 ⇒ 编译错。
|
package/dist/portable-domains.js
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* {@link
|
|
1
|
+
import { deepFreeze } from "./deep-freeze.js";
|
|
2
|
+
/** The domains that **travel**: the **default** domain set of the bundle helpers (`exportBundle` / `readBundle`) and the only domains they accept — `exportBundle` / `readBundle` / `writeBundle`
|
|
3
|
+
* refuse any other name at run time (and the types narrow to {@link PortableDomain}), so a domain outside this set cannot be carried into a bundle however the caller spells it.
|
|
4
|
+
* 每个被排除的域必须在 {@link NON_PORTABLE_DOMAIN_REASONS} 里有一条成文理由(禁裸排除)。
|
|
4
5
|
*
|
|
5
|
-
* ⚠️
|
|
6
|
-
*
|
|
7
|
-
* bundle 的那条口子归调用方纪律(以及各自域的导出面),不是本常量能挡住的;要不要把 bundle API 收窄到
|
|
8
|
-
* `PortableDomain` 是一个独立的行为面裁定(#282 未决项,需三问),本批不擅自改。
|
|
6
|
+
* ⚠️ 这只常量回答的是**搬运**的问题,不是「本地读哪些域」的问题:本地文件店读的域集是 {@link LOCAL_READ_DOMAINS}(= 本集 + `projects`)。两个问题 28.0.0 以前共用这一只常量、答案碰巧相同;
|
|
7
|
+
* `projects` 不可搬运(租户身份数据,随包复制进另一个部署 = 凭空多出的身份登记),但单机部署自己的 `config.d/projects.json` 就是它自己的登记簿 —— 所以它在读取集里、不在本集里。
|
|
9
8
|
*
|
|
10
|
-
* 🔴
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* 今日的兜底:漏登记的文件会被 `FileConfigStore`(`./node`)的 `"unread-config-file"` 警告点名(fail-loud,
|
|
9
|
+
* 🔴 **开新顶层域时必须同步登记**(成案 = 消费方的真事故):域表是**闭集**,不在 {@link LOCAL_READ_DOMAINS}(便携域自动在内)里的域名,`config.d/<域>.json` 不会被读进 effective —— 消费方拿到的是「该域缺席」,
|
|
10
|
+
* 和文件不存在**逐字同形**。当年 `limits` 域就是这样在单机腿静默丢了一整片限额发布(远端腿同批可用,所以更难看出来)。新域要么进本集(可搬运,自动进读取集),要么在 {@link NON_PORTABLE_DOMAIN_REASONS} 里写理由
|
|
11
|
+
* (并在需要本地读取时进 {@link LOCAL_READ_DOMAINS})。今日的兜底:漏登记的文件会被 `FileConfigStore`(`./node`)的 `"unread-config-file"` 警告点名(fail-loud,
|
|
14
12
|
* 见 getEffective),但那只在消费方接了 `onWarning` 时才响 —— **登记仍是第一现场的义务**。 */
|
|
15
|
-
export const PORTABLE_DOMAINS = ["models", "rosters", "skills", "mcp", "plugins", "scenarios", "collab", "governance", "execution", "prompts", "limits", "a2a"];
|
|
13
|
+
export const PORTABLE_DOMAINS = deepFreeze(["models", "rosters", "skills", "mcp", "plugins", "scenarios", "collab", "governance", "execution", "prompts", "limits", "a2a"]);
|
|
14
|
+
/** The domains the local file store reads: `FileConfigStore` (and so `loadLocalConfig`) reads `<root>/config.d/<domain>.json` for exactly these — `getEffective` (strict and tolerant), `read()`, `getVersion()`,
|
|
15
|
+
* the `updatedAt` stamp and the "file nobody reads" sweep all enumerate **this** set. It is {@link PORTABLE_DOMAINS} plus `projects`, built from it (every portable domain is locally readable by construction).
|
|
16
|
+
*
|
|
17
|
+
* `projects` is here and not in {@link PORTABLE_DOMAINS} on purpose: a project registry is tenant identity data, so it never **travels** (no bundle carries it; the bundle helpers still read {@link PORTABLE_DOMAINS}
|
|
18
|
+
* and refuse it at run time) — but a single-machine deployment's own `config.d/projects.json` is that deployment's registry, not one carried in from elsewhere, and the local reader reads it like any other document.
|
|
19
|
+
* A domain outside this set (`workers` / `hosts` / `systems` / `entitlement`) is not read by the local file store: its file is named by an `"unread-config-file"` warning and its domain resolves to the schema default.
|
|
20
|
+
* New local-reader domains are added HERE, with the reason; a domain that also travels goes into {@link PORTABLE_DOMAINS} and joins this set by construction. */
|
|
21
|
+
export const LOCAL_READ_DOMAINS = deepFreeze([...PORTABLE_DOMAINS, "projects"]);
|
|
16
22
|
/**
|
|
17
|
-
* 非便携域的**排除理由表**(
|
|
23
|
+
* 非便携域的**排除理由表**(禁裸排除)—— 为什么这个域**不随 bundle 搬运**(搬运义;它能不能被本地读取是 {@link LOCAL_READ_DOMAINS} 的事,`projects` 就是不可搬运、却可本地读取)。
|
|
18
24
|
*
|
|
19
25
|
* `satisfies Record<Exclude<DomainName, PortableDomain>, string>` 让键集在**编译期**双向咬死:新开一个
|
|
20
26
|
* 域却不放进 PORTABLE_DOMAINS ⇒ 这里缺行 ⇒ 编译错;把某域改成便携却忘了删行 ⇒ 多余键 ⇒ 编译错。
|
|
21
27
|
* (此前是「理由写在注释里」,机器只能做子串匹配——域名出现在文件任何角落都算数,等于没门;对抗复审
|
|
22
28
|
* 复审 round1 F3。)理由要写**为什么它不该被单机/跨部署搬运**,带出处。
|
|
23
29
|
*/
|
|
24
|
-
export const NON_PORTABLE_DOMAIN_REASONS = {
|
|
30
|
+
export const NON_PORTABLE_DOMAIN_REASONS = deepFreeze({
|
|
25
31
|
workers: "FLEET-only:单机没有 reconciler,`{workers:[]}` 的 schema 默认就是正确语义(缺席不需要 stub)。",
|
|
26
32
|
hosts: "FLEET-only:同 workers —— 单机无机器注册表/自动排布,空注册表即正确语义。",
|
|
27
33
|
systems: "FLEET-only:系统接入/凭据下发的元数据(nonce+路由)属于 web-admin 侧生命周期,单机 lane 无对应执法点。",
|
|
28
34
|
projects: "TENANT IDENTITY DATA,不是可搬运的配置:登记簿随包复制进另一个部署 = 凭空多出的身份登记(design/142 §1.4 威胁模型①「carried-in foreign projectId」换了身 import 的衣服)。要带走走 142 §5 的导出面(service 半场)。",
|
|
29
35
|
entitlement: "per-PRINCIPAL 商务/治理数据(tier·预算上限·kill-switch·allowlist),与 projects 同威胁模型(#282 件5 附带裁定,此前是唯一裸排除项):(a) 搬走 = 把一个租户的商务档复制进另一部署;(b) 反向也不成立 —— 单机 TOC 无 principal 轴(无鉴权语境、无 `/effective?principal=` 解析面),本地 entitlement.json 只会造出一份**永不被执法**的假管控面(真执法点在 service / web-admin 边界)。缺席语义如实:本地 buildEffective 给它 schema 默认值(空表),这**不等于**把远端 kill-switch/预算上限搬到了本地 —— 单机 lane 本就没有那个执法点。",
|
|
30
|
-
};
|
|
36
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 包内私有叶子模块(
|
|
2
|
+
* 包内私有叶子模块(运行期只 import 包内私有的零 import 叶 `./deep-freeze`,浏览器安全;不进 `package.json` 的 exports,主桶经 `./mcp-request-entry` 转出这里的公开名):
|
|
3
3
|
* **一个名字能不能作「名 → 串」记录的成员名**的唯一判据 —— 原型链上的三个名字永远不能:`__proto__`(按赋值拷贝会变成原型;zod 的 record 读键前先跳过它、不判它的值)、
|
|
4
4
|
* `constructor` / `prototype`(读方对普通对象做 `obj[名]` 时撞上原型成员)。
|
|
5
5
|
* 三个读口问它,同一张表、同一个答案:域 schema 的凭据引用集合(`./types` 的 `credentialRefs`:在场 ⇒ 集合坏)· 公开的记录读器(`./mcp-request-entry` 的 `readPlainStringRecord` /
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 包内私有叶子模块(
|
|
2
|
+
* 包内私有叶子模块(运行期只 import 包内私有的零 import 叶 `./deep-freeze`,浏览器安全;不进 `package.json` 的 exports,主桶经 `./mcp-request-entry` 转出这里的公开名):
|
|
3
3
|
* **一个名字能不能作「名 → 串」记录的成员名**的唯一判据 —— 原型链上的三个名字永远不能:`__proto__`(按赋值拷贝会变成原型;zod 的 record 读键前先跳过它、不判它的值)、
|
|
4
4
|
* `constructor` / `prototype`(读方对普通对象做 `obj[名]` 时撞上原型成员)。
|
|
5
5
|
* 三个读口问它,同一张表、同一个答案:域 schema 的凭据引用集合(`./types` 的 `credentialRefs`:在场 ⇒ 集合坏)· 公开的记录读器(`./mcp-request-entry` 的 `readPlainStringRecord` /
|
|
6
6
|
* `isStringRecord`,请求面传输的 `env` / `headers` 同读:剔出副本并点名)· 中心引用解析口(`./center-refs`,经记录读器:在场 ⇒ `refs_unreadable`)。
|
|
7
7
|
* 住在叶子里,是因为 `./types` 与 `./mcp-request-entry` 都要它,而后者反过来引 `./types`。
|
|
8
8
|
*/
|
|
9
|
+
import { deepFreeze } from "./deep-freeze.js";
|
|
9
10
|
/** 保留成员名,闭集。 */
|
|
10
|
-
export const RESERVED_MEMBER_NAMES = ["__proto__", "constructor", "prototype"];
|
|
11
|
+
export const RESERVED_MEMBER_NAMES = deepFreeze(["__proto__", "constructor", "prototype"]);
|
|
11
12
|
/** 这个名字是保留成员名吗(大小写敏感:`Constructor` / `X-Prototype` 不是)。 */
|
|
12
13
|
export function isReservedMemberName(name) {
|
|
13
14
|
return RESERVED_MEMBER_NAMES.includes(name);
|
package/dist/resolve-roster.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { stableHash } from "./hash.js";
|
|
2
2
|
import { danglingRefs } from "./cross-domain.js";
|
|
3
3
|
import { toSkillsManifest } from "./skills-manifest.js";
|
|
4
|
+
import { deepFreeze } from "./deep-freeze.js";
|
|
4
5
|
// ── 主/cheap 角色标记语义(0.6.3, E3)────────────────────────────────
|
|
5
6
|
// service 现有 ModelRoles 口径:default→主(12.0.0 起唯一;`team` / `synthesize` 随 core 7.49.0 删)、subagent/summarize→cheap。1.8.0 起 `classifier`/`consolidate`
|
|
6
7
|
// 同 `verifier` 一样**不派生**(归 cheap 会盖掉 models.tiers 档位与 core 兜底链)。`verifier` 刻意
|
|
7
8
|
// 不派生(unset→core 的 default 兜底链,与 service 语义一致)。常量导出=单一语义源,service 收敛小单与
|
|
8
9
|
// web-admin 表单同源引用,别第二份。
|
|
9
10
|
/** primaryModel 标记喂的角色族(§3)。 */
|
|
10
|
-
export const ROSTER_PRIMARY_ROLES = ["default"];
|
|
11
|
+
export const ROSTER_PRIMARY_ROLES = deepFreeze(["default"]);
|
|
11
12
|
/** cheapModel 标记喂的角色族(§3)。 */
|
|
12
|
-
export const ROSTER_CHEAP_ROLES = ["subagent", "summarize"];
|
|
13
|
+
export const ROSTER_CHEAP_ROLES = deepFreeze(["subagent", "summarize"]);
|
|
13
14
|
/** 把 roster 的主/cheap 角色标记派生成 roles 片段(PURE)。显式 roster.roles 逐角色盖过它;它盖过全局
|
|
14
15
|
* models.roles(合并点见 {@link resolveEffectiveForWorker})。wire 形状不变——service 零改仍兼容,
|
|
15
16
|
* 收敛后直接读标记亦可(effective 的 rosters 域不上 wire,标记经此物化进 models.roles)。 */
|
package/dist/retired-envs.js
CHANGED
|
@@ -25,13 +25,14 @@
|
|
|
25
25
|
*
|
|
26
26
|
* 行形 = 字面元组(第三元是族词),一行一个旧名。纯数据 + 纯函数,零 IO,browser-safe。
|
|
27
27
|
*/
|
|
28
|
+
import { deepFreeze } from "./deep-freeze.js";
|
|
28
29
|
import { PREVIOUS_WEB_ADMIN_ENV } from "./previous-web-admin-env.js";
|
|
29
30
|
import { WEB_ADMIN_ENV } from "./web-admin-env.js";
|
|
30
31
|
/** 墓碑拒启码(机读;拒句方括号里)。 */
|
|
31
32
|
export const RETIRED_ENV_REFUSAL_CODE = "config.env_key_retired";
|
|
32
33
|
const OA_REMOVED = "the OA scenario was removed in 5.0.0";
|
|
33
34
|
const negativeAliasWhy = (old, positive) => `negative-name alias retired in server 3.0.0 — unset it; the polarity is inverted: ${old}=true is ${positive}=false (the positive name defaults on)`;
|
|
34
|
-
export const RETIRED_ENVS = [
|
|
35
|
+
export const RETIRED_ENVS = deepFreeze([
|
|
35
36
|
["TIDB_HOST", "MYSQL_HOST", "renamed"],
|
|
36
37
|
["TIDB_PORT", "MYSQL_PORT", "renamed"],
|
|
37
38
|
["TIDB_USER", "MYSQL_USER", "renamed"],
|
|
@@ -85,11 +86,7 @@ export const RETIRED_ENVS = [
|
|
|
85
86
|
// 壳的总开关没有可 rename 的目标(出路是在目录条目上声明链,不是换个 env 名)⇒ removed。近预算降级线的三个旋钮(`MODEL_DEGRADE_TO` / `_AT_COST_FRACTION` / `_TO_VISION`)仍是活旋钮,不在本表。
|
|
86
87
|
["MODEL_DEGRADE_ON", "MODEL_FALLBACK_ON", "replaced", "the gate words moved to the engine's per-model fallback chain: budget is no longer a gate word, network / auth / stream_torn are new, and the gate now applies to every catalog chain instead of one whole-Brain target"],
|
|
87
88
|
["MODEL_DEGRADE_REACTIVE", "the env-driven whole-Brain reactive degrade shell was retired: declare `fallbacks` on the catalog entry (models.models[].fallbacks) — a fallback chain is catalog data now; the gate words that decide when a hop is taken are MODEL_FALLBACK_ON", "removed"],
|
|
88
|
-
];
|
|
89
|
-
// 冻结:拿到导出的人改不了拒启判据(读拒句的与投影 wire 的是同一个数组对象)。
|
|
90
|
-
for (const row of RETIRED_ENVS)
|
|
91
|
-
Object.freeze(row);
|
|
92
|
-
Object.freeze(RETIRED_ENVS);
|
|
89
|
+
]);
|
|
93
90
|
/** 墓碑表 → wire 投影(纯数据)。**同一张表、同序**;族是闭集,穷举 switch(加一族不写这里 ⇒ 编译红)。 */
|
|
94
91
|
export function buildRetiredEnvWire() {
|
|
95
92
|
return RETIRED_ENVS.map((row) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** 退役的角色词(闭集;逐字)。 */
|
|
2
2
|
export declare const RETIRED_ROLE_WORDS: readonly ["team", "synthesize"];
|
|
3
|
-
/** 一组被判官拒下的角色键 / 角色词里若有退役词 ⇒ 那一句(
|
|
3
|
+
/** 一组被判官拒下的角色键 / 角色词里若有退役词 ⇒ 那一句(点名退役词、退役的版本与出路;同组里别的不认识的词也点名,一个不漏);没有 ⇒ `undefined`
|
|
4
4
|
* (交回 zod 自己的句子)。`ModelRole` 的判句(一个词)与 `roles` 图的未知键判句(一组键)都调这一只。 */
|
|
5
5
|
export declare function retiredRoleWordsRefusal(words: readonly unknown[]): string | undefined;
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 包内私有(不进主桶、不进 exports 表):12.0.0 退役的**角色词**墓碑 —— 引擎 core 7.49.0 把 `team` / `synthesize` 从角色表里删了(对未知角色词响亮拒),
|
|
3
|
-
* 本包的 `ModelRole` 随之收成 6
|
|
4
|
-
*
|
|
5
|
-
* 迁移族按登记表的窗整族删,墓碑留下 —— 到那时句子里的迁移指路由删码那一车去掉(登记表 SS-M8 行的 `removal`)。
|
|
3
|
+
* 本包的 `ModelRole` 随之收成 6 词。墓碑是**拒**,不是第二种读法:判官遇到这两个词不把它们读成任何角色,只说「这是一份旧形」、没有角色读它、出路是把那个键从存储文档里删掉。
|
|
4
|
+
* 一处写词、一处写句:`ModelRole` 的判句与 `roles` 图的未知键判句都读这里。12.0.0 起存量由一次性迁移 SS-M8 删这两个键;29.0.0 起那一步随窗到期删了,墓碑留下、句子里的迁移指路随之去掉。
|
|
6
5
|
*/
|
|
7
6
|
import { retiredFormSentence } from "./retired-form.js";
|
|
8
7
|
/** 退役的角色词(闭集;逐字)。 */
|
|
9
8
|
export const RETIRED_ROLE_WORDS = ["team", "synthesize"];
|
|
10
9
|
const ROLE_WORDS_RETIRED = {
|
|
11
10
|
retiredIn: "12.0.0",
|
|
12
|
-
now: "no role reads it (core 7.49.0 removed the role and refuses the word)",
|
|
13
|
-
migration: "SS-M8",
|
|
11
|
+
now: "no role reads it (core 7.49.0 removed the role and refuses the word) — delete the key from the stored document",
|
|
14
12
|
};
|
|
15
13
|
const isRetiredRoleWord = (w) => RETIRED_ROLE_WORDS.some((r) => r === w);
|
|
16
|
-
/** 一组被判官拒下的角色键 / 角色词里若有退役词 ⇒ 那一句(
|
|
14
|
+
/** 一组被判官拒下的角色键 / 角色词里若有退役词 ⇒ 那一句(点名退役词、退役的版本与出路;同组里别的不认识的词也点名,一个不漏);没有 ⇒ `undefined`
|
|
17
15
|
* (交回 zod 自己的句子)。`ModelRole` 的判句(一个词)与 `roles` 图的未知键判句(一组键)都调这一只。 */
|
|
18
16
|
export function retiredRoleWordsRefusal(words) {
|
|
19
17
|
const retired = RETIRED_ROLE_WORDS.filter((r) => words.includes(r));
|
|
@@ -198,6 +198,12 @@ export declare const FailMode: z.ZodEnum<{
|
|
|
198
198
|
open: "open";
|
|
199
199
|
}>;
|
|
200
200
|
export type FailMode = z.infer<typeof FailMode>;
|
|
201
|
+
/** `T` with every field and every array read-only, at every depth (type level only — no runtime effect). The spec table {@link SAFETY_MERGE_SPEC} is deep-frozen, so the
|
|
202
|
+
* type of one of its rows, and of a rule read off one, must not offer a write the frozen row refuses; a `z.infer` type is mutable by construction,
|
|
203
|
+
* this is its read-only projection. A mutable value is assignable to it, so a caller that builds a rule or a row keeps compiling. */
|
|
204
|
+
type ReadonlyDeep<T> = T extends readonly (infer U)[] ? readonly ReadonlyDeep<U>[] : T extends object ? {
|
|
205
|
+
readonly [K in keyof T]: ReadonlyDeep<T[K]>;
|
|
206
|
+
} : T;
|
|
201
207
|
/** The monotone tighten-only direction for a category (which way is "stricter"). `enumRank.order` lists values
|
|
202
208
|
* from LOOSEST→STRICTEST — the category's whole vocabulary: a word outside it is refused, and a ONE-word order (11.0.0:
|
|
203
209
|
* `shellGate`, whose engine vocabulary is the single floor word) is the degenerate rank where the only merge is identity;
|
|
@@ -225,7 +231,7 @@ export declare const TightenRule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
225
231
|
}, z.core.$strip>, z.ZodObject<{
|
|
226
232
|
rule: z.ZodLiteral<"numericLower">;
|
|
227
233
|
}, z.core.$strip>], "rule">;
|
|
228
|
-
export type TightenRule = z.infer<typeof TightenRule
|
|
234
|
+
export type TightenRule = ReadonlyDeep<z.infer<typeof TightenRule>>;
|
|
229
235
|
/** Where `candidate` lands relative to `existing` under a {@link TightenRule} (14.6.0; closed, in this order):
|
|
230
236
|
* `equal` · `stricter` · `looser` · `unordered` (comparable values, neither side contains the other — two different sets,
|
|
231
237
|
* two different `none` values) · `unreadable` (a side is outside the rule's normalized domain — absent, misspelled,
|
|
@@ -333,7 +339,7 @@ export declare const MergeCategorySpec: z.ZodObject<{
|
|
|
333
339
|
list: z.ZodOptional<z.ZodLiteral<true>>;
|
|
334
340
|
}, z.core.$strip>>>;
|
|
335
341
|
}, z.core.$strip>;
|
|
336
|
-
export type MergeCategorySpec = z.infer<typeof MergeCategorySpec
|
|
342
|
+
export type MergeCategorySpec = ReadonlyDeep<z.infer<typeof MergeCategorySpec>>;
|
|
337
343
|
/** The category spec. Keys = the unified settings categories both seats map their concrete keys/fields into.
|
|
338
344
|
* Faithful to settings-core v2-design §3 (the semantic source of record). */
|
|
339
345
|
export declare const SAFETY_MERGE_SPEC: {
|
|
@@ -370,7 +376,7 @@ export declare const SAFETY_MERGE_SPEC: {
|
|
|
370
376
|
readonly minTrust: "global";
|
|
371
377
|
readonly tighten: {
|
|
372
378
|
readonly rule: "enumRank";
|
|
373
|
-
readonly order: ["bypassPermissions", "auto", "acceptEdits", "default", "dontAsk", "plan"];
|
|
379
|
+
readonly order: readonly ["bypassPermissions", "auto", "acceptEdits", "default", "dontAsk", "plan"];
|
|
374
380
|
};
|
|
375
381
|
readonly enforcement: "gate";
|
|
376
382
|
readonly fail: "closed";
|
|
@@ -392,7 +398,7 @@ export declare const SAFETY_MERGE_SPEC: {
|
|
|
392
398
|
readonly minTrust: "global";
|
|
393
399
|
readonly tighten: {
|
|
394
400
|
readonly rule: "enumRank";
|
|
395
|
-
readonly order: ["always"];
|
|
401
|
+
readonly order: readonly ["always"];
|
|
396
402
|
};
|
|
397
403
|
readonly enforcement: "gate";
|
|
398
404
|
readonly fail: "closed";
|
|
@@ -690,3 +696,4 @@ export declare function resolveMemberTighten(spec: MergeCategorySpec, member: st
|
|
|
690
696
|
/** A declared member's comparator from the published table (see {@link resolveMemberTighten}); compare two of its values with
|
|
691
697
|
* {@link tightenVerdict}. Unknown category or member ⇒ RangeError (never the category rule as a fallback). */
|
|
692
698
|
export declare function memberTighten<C extends SafetyMergeCategory>(category: C, member: SafetyMergeMember<C>): TightenRule;
|
|
699
|
+
export {};
|
|
@@ -68,6 +68,7 @@ import { z } from "zod";
|
|
|
68
68
|
import { MAX_HASH_DEPTH, stableStringify } from "./hash.js";
|
|
69
69
|
import { captureStringArray, dataDescriptor, isAccessorDescriptor, isolatedObject } from "./own-key-read.js";
|
|
70
70
|
import { jsonShapeOf } from "./plain-json-object.js";
|
|
71
|
+
import { deepFreeze } from "./deep-freeze.js";
|
|
71
72
|
/** How values from different layers/principals combine for a category. */
|
|
72
73
|
export const MergeShape = z.enum(["denyFirst", "replace", "runAll", "overrideByName", "concat"]);
|
|
73
74
|
/** The trust-tier VOCABULARY as a RUNTIME VALUE — the ONE source of the ladder's words, in the same form as
|
|
@@ -77,7 +78,7 @@ export const MergeShape = z.enum(["denyFirst", "replace", "runAll", "overrideByN
|
|
|
77
78
|
* table as the one global the closure needs, instead of writing a ladder of its own.
|
|
78
79
|
* ⚠️ The DECLARATION ORDER is NOT the rank (it is the 1.1.0 order with `task` appended — kept byte-stable because
|
|
79
80
|
* reordering is breaking); never index it as a ladder — use {@link trustRank}. */
|
|
80
|
-
export const MIN_TRUST_WORDS = ["local", "session", "project", "global", "managed", "task"];
|
|
81
|
+
export const MIN_TRUST_WORDS = deepFreeze(["local", "session", "project", "global", "managed", "task"]);
|
|
81
82
|
/** The trust-tier VOCABULARY a category — or, since 1.1.0, one of its members — names as its admission floor
|
|
82
83
|
* (the MINIMUM trust a layer/principal must have to set it). The RANK is v2-design §1:29,
|
|
83
84
|
* `managed 6 > global 5 > project 4 > local 3 > session 2 > task 1`, published as {@link trustRank}; compare with
|
|
@@ -177,7 +178,7 @@ export const TightenRule = z.discriminatedUnion("rule", [
|
|
|
177
178
|
* `equal` · `stricter` · `looser` · `unordered` (comparable values, neither side contains the other — two different sets,
|
|
178
179
|
* two different `none` values) · `unreadable` (a side is outside the rule's normalized domain — absent, misspelled,
|
|
179
180
|
* the wrong type). */
|
|
180
|
-
export const TIGHTEN_VERDICTS = ["equal", "stricter", "looser", "unordered", "unreadable"];
|
|
181
|
+
export const TIGHTEN_VERDICTS = deepFreeze(["equal", "stricter", "looser", "unordered", "unreadable"]);
|
|
181
182
|
/** `diff` > 0 ⇒ the candidate is higher on the strictness order. */
|
|
182
183
|
function orderVerdict(diff) {
|
|
183
184
|
return diff > 0 ? "stricter" : diff < 0 ? "looser" : "equal";
|
|
@@ -348,7 +349,7 @@ export const MergeCategorySpec = z.object({
|
|
|
348
349
|
});
|
|
349
350
|
/** The category spec. Keys = the unified settings categories both seats map their concrete keys/fields into.
|
|
350
351
|
* Faithful to settings-core v2-design §3 (the semantic source of record). */
|
|
351
|
-
export const SAFETY_MERGE_SPEC = {
|
|
352
|
+
export const SAFETY_MERGE_SPEC = deepFreeze({
|
|
352
353
|
// 1.1.0 [5797] ④ — member-level admission, direction-asymmetric (header): allow = loosen ⇒ global-or-managed;
|
|
353
354
|
// deny/ask = tighten ⇒ every settings-file layer (local = the lowest file tier). The category minTrust stays
|
|
354
355
|
// "global" = the DEFAULT floor (member rows override it; consumers that predate `members` still enforce it on
|
|
@@ -459,7 +460,7 @@ export const SAFETY_MERGE_SPEC = {
|
|
|
459
460
|
disableAutoMode: { direction: "tighten", minTrust: "global", boolPole: { strict: true, minTrust: "local" } },
|
|
460
461
|
},
|
|
461
462
|
},
|
|
462
|
-
};
|
|
463
|
+
});
|
|
463
464
|
/** Own-property table lookup. The category union is compile-time only; a JavaScript or deserialized caller can
|
|
464
465
|
* hand in `"__proto__"` / `"constructor"` / `"toString"`, which a bare index resolves through Object.prototype
|
|
465
466
|
* to a non-spec object — `membersOf` would then answer `[]` = "whole key, nothing to check" (fail-OPEN). An
|
|
@@ -9,10 +9,13 @@ import { type SchedulerParseWarning, type SchedulerReadOptions, type SchedulerRe
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function loadSchedulerStore(path: string, opts: SchedulerReadOptions): SchedulerStoreRead;
|
|
11
11
|
/**
|
|
12
|
-
* Persist ATOMICALLY:
|
|
12
|
+
* Persist ATOMICALLY: create the parent if it is missing, then the package's one atomic writer (`./atomic-write`: a uniquely-named `.tmp`
|
|
13
13
|
* sibling, then `rename` over the target — atomic on POSIX, so a concurrent reader never sees a partial file). The file mode
|
|
14
14
|
* is the `scheduler-store` class's (0o600 — owner-only, the records may carry principal/session identifiers; every save
|
|
15
|
-
* restores it).
|
|
15
|
+
* restores it). A missing parent is created by the package's one owner-only directory maker (`ensureOwnerOnlyDirectory`, the same
|
|
16
|
+
* one that creates a config root): every missing level is exactly 0o700 whatever the process umask (29.0.0; before, `mkdir -p`
|
|
17
|
+
* under the umask — 002 gave a group-writable directory, which a directory-trust check on the store's path refuses);
|
|
18
|
+
* a directory that already exists keeps its mode. Throws on IO failure (caller maps to a domain error).
|
|
16
19
|
*/
|
|
17
20
|
export declare function saveSchedulerStore(path: string, records: SchedulerRecord[]): void;
|
|
18
21
|
/** A filesystem-backed {@link SchedulerStore} bound to a path (convenience for the daemon/backend constructors).
|