@tbox.cn/app-toolkit 0.7.3 → 0.7.5
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/dist/index.d.ts +114 -114
- package/dist/index.js +1 -1
- package/package.json +2 -3
- package/src/assembly/app-manifest.ts +1 -1
- package/src/assembly/provider-catalog.ts +4 -4
- package/src/assembly/resolve-key.ts +1 -1
- package/src/assembly/walk-manifests.ts +8 -8
- package/src/core/contracts-expected.ts +1 -1
- package/src/core/contracts-resolver.ts +9 -9
- package/src/core/file-cache.ts +3 -3
- package/src/core/module-schema.ts +1 -1
- package/src/dto.ts +30 -30
- package/src/factory.ts +31 -31
- package/src/index.ts +1 -1
- package/src/integrations/credentials.ts +4 -4
- package/src/integrations/evaluate-app.ts +2 -2
- package/src/integrations/mock-bindings.ts +1 -1
- package/src/integrations/module-binding.ts +4 -4
- package/src/integrations/predicate-io.ts +1 -1
- package/src/integrations/predicate.ts +9 -9
- package/src/integrations/prune-bindings.ts +6 -6
- package/src/integrations/read.ts +3 -3
- package/src/integrations/write.ts +17 -17
- package/src/views/app.ts +3 -3
- package/src/views/credential-types.ts +1 -1
- package/src/views/credentials.ts +2 -2
- package/src/views/integration-schemas.ts +28 -28
- package/src/views/modules.ts +1 -1
- package/src/views/providers.ts +8 -8
- package/src/views/service-detail.ts +3 -3
- package/src/views/service-resolutions.ts +17 -17
package/src/integrations/read.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { AppToolkitError } from '../core/errors.js';
|
|
|
5
5
|
import type { FileCache } from '../core/file-cache.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* integrations.json 文件级读(
|
|
8
|
+
* integrations.json 文件级读(read)。
|
|
9
9
|
* 严格校验面(≥0.9)在场 → contracts parseIntegrationsConfig(assertNoInlineSecrets →
|
|
10
10
|
* 旧键直切防线 → zod strict);缺席/降级 → 原文 JSON 透传(谓词宽松透传语义——
|
|
11
11
|
* doctor 读裸 JSON 先例;写路径门控在工厂边缘,读不阻断静态面)。
|
|
@@ -66,8 +66,8 @@ export async function readIntegrationsStrict(
|
|
|
66
66
|
return { config: raw, strict: false, contracts };
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
/**
|
|
70
|
-
* 逐字冻结(api.md
|
|
69
|
+
/** 服务身份判据单源(A2):GET/PUT/DELETE 共用「词汇 ∪ 已配置 ∪ 归属」——service-detail 判据
|
|
70
|
+
* 逐字冻结(api.md 的「demanded 退化」口径为文档层 nuance,现行实现与 GET 均不含 demanded——冻结现状即单源)。
|
|
71
71
|
* v6.1 += 归属键(O6 对称——纯归属无词汇/demand/配置的 owns 合法,resolveServiceKey 供给足迹先例):
|
|
72
72
|
* 求值轴可见(resolutionKeys 同批接入)而静态/写轴 404 会造死锁(诊断指引的编辑被拒)。 */
|
|
73
73
|
export function isKnownService(
|
|
@@ -24,12 +24,12 @@ import { AppToolkitError } from '../core/errors.js';
|
|
|
24
24
|
import { MODULE_INTEGRATION_NODE_KEYS } from '../dto.js';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* 写核心(
|
|
27
|
+
* 写核心(write;FX-1c 管线重排—— 九步定序 + D-B2 语义 + 输入扩位):
|
|
28
28
|
* PUT = 节点全量替换(三同构——body ≡ 文件节点;三 PUT 端点无例外)。
|
|
29
29
|
*
|
|
30
30
|
* 九步定序(applyApp / applyService 同构):
|
|
31
|
-
* 1 输入约束(assertSafeNames 值位 + assertSafeInstanceKeys map
|
|
32
|
-
* 2 合并 node → next;文件缺席 →
|
|
31
|
+
* 1 输入约束(assertSafeNames 值位 + assertSafeInstanceKeys map 键位——)
|
|
32
|
+
* 2 合并 node → next;文件缺席 → 骨架物化(语义翻转提示入 issues)
|
|
33
33
|
* 3 凭据校验链(type 匹配 400 + credentialSchema ajv 字段级——schema 缺席宽松;dryRun 也跑)
|
|
34
34
|
* 4 凭据 stem/ref **纯派生**(plan*——零 I/O)+ ref 回填节点(**先于 no-diff**:
|
|
35
35
|
* node 缺 ref + 带 credentials → 节点变化 → 全量写;node 已含同 ref → 节点不变 → 纯凭据写)
|
|
@@ -38,12 +38,12 @@ import { MODULE_INTEGRATION_NODE_KEYS } from '../dto.js';
|
|
|
38
38
|
* 7 严格整文档校验(contracts parseIntegrationsConfig——触发 = !noDiff ∥ 有凭据输入)
|
|
39
39
|
* 8 凭据工件落盘(**后置于校验通过**——防「凭据已写 + zod 拒绝」不一致态;
|
|
40
40
|
* dryRun → writeCredentialArtifacts 零写盘 + existsSync 预览)
|
|
41
|
-
* 9 finalize
|
|
41
|
+
* 9 finalize:planned = 将触碰(files 预览单源——dryRun 响应 ≡ 同 body 真实写,files 逐字对称);
|
|
42
42
|
* written = 实写(!dryRun 派生,D-B2);restartScheduled = written && onApplied(凭据影响 boot 装配——
|
|
43
43
|
* 重启正当);写后缓存失效
|
|
44
44
|
* 归一化:N1 模块节点 {} → 删 domains[键];N3 服务节点 {} 不归一化(显式通配激活 = 合法 TIER0 态);
|
|
45
45
|
* N2 已随 ?instance= 退役。dryRun(PUT only):复读完整管线不落盘不排程。
|
|
46
|
-
* DELETE:节点移除 + 孤儿凭据写后对账(覆盖 DELETE 与 PUT
|
|
46
|
+
* DELETE:节点移除 + 孤儿凭据写后对账(覆盖 DELETE 与 PUT 替换两类来源,只报告不清理——)。
|
|
47
47
|
* 并发:进程内串行(per-factory promise chain 由工厂持有——本模块假设单飞调用)。
|
|
48
48
|
*/
|
|
49
49
|
|
|
@@ -85,7 +85,7 @@ export function deepEqual(a: unknown, b: unknown): boolean {
|
|
|
85
85
|
return false;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
/** 输入约束①(安全钉子,
|
|
88
|
+
/** 输入约束①(安全钉子, 扩位):node 内 provider/instanceId 值位 + map 键位字符集校验
|
|
89
89
|
* (第一道;deriveStem 断言为第二道)。违例 → 400 + fields 指向。 */
|
|
90
90
|
function assertSafeNames(value: unknown, path: string): void {
|
|
91
91
|
if (typeof value === 'string') return;
|
|
@@ -104,7 +104,7 @@ function assertSafeNames(value: unknown, path: string): void {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
/**
|
|
107
|
+
/** map 键位校验:进凭据 stem 派生的 map 键(instances 覆盖位 / ByInstance 位 / credentialsByInstance 选项)。
|
|
108
108
|
* 通配键:instances map 的 '*'/'**' 豁免(TIER0 通配激活合法态——合法性归 zod/谓词 #8);
|
|
109
109
|
* ByInstance 层与 credentialsByInstance 无通配语义(TIER0 精确键)→ '*' 亦拒。 */
|
|
110
110
|
function assertSafeMapKeys(map: unknown, where: string, wildcardOk: boolean): void {
|
|
@@ -122,7 +122,7 @@ function assertSafeMapKeys(map: unknown, where: string, wildcardOk: boolean): vo
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
/**
|
|
125
|
+
/** 调用面:按节点形态分派 map 键位校验(applyApp root / applyService slot / credentialsByInstance 选项) */
|
|
126
126
|
function assertSafeInstanceKeys(node: Record<string, unknown>, writeOpts: WriteOptions, kind: 'root' | 'slot'): void {
|
|
127
127
|
if (kind === 'root') {
|
|
128
128
|
// root.instances[].id(注册表 id——谓词 #8 白名单与实例键检查的同一空间)
|
|
@@ -195,7 +195,7 @@ function validateCredential(
|
|
|
195
195
|
if (typeof credentials.type !== 'string' || credentials.type.length === 0) {
|
|
196
196
|
throw new AppToolkitError('VALIDATION_FAILED', 400, '凭据 type 缺失或为空字符串', ['credentials.type']);
|
|
197
197
|
}
|
|
198
|
-
// ① type 匹配(内联声明优先;catalog 槽供给次之;均缺席 → 跳过——宽松与
|
|
198
|
+
// ① type 匹配(内联声明优先;catalog 槽供给次之;均缺席 → 跳过——宽松与 对齐)
|
|
199
199
|
const expectedType = inlineCredentialType ?? declaredCredentialType(appDir, provider, service, cache);
|
|
200
200
|
if (expectedType !== undefined && expectedType !== '-' && credentials.type !== expectedType) {
|
|
201
201
|
throw new AppToolkitError(
|
|
@@ -250,7 +250,7 @@ export function createWriteCore(appDir: string, opts: WriteCoreOptions = {}): Wr
|
|
|
250
250
|
issues: IntegrationServiceIssue[],
|
|
251
251
|
dryRun: boolean | undefined,
|
|
252
252
|
): SaveResult {
|
|
253
|
-
//
|
|
253
|
+
// 双轴派生:planned = 将触碰(files 预览单源——dryRun 响应 ≡ 同 body 真实写,files 逐字对称);
|
|
254
254
|
// written = 实际落盘(!dryRun 派生——D-B2);restartScheduled 跟随 written(凭据文件影响 boot 装配——重启正当)
|
|
255
255
|
const integrationsPlanned = next !== null;
|
|
256
256
|
const credentialsPlanned = appliedCredentials.length > 0;
|
|
@@ -339,10 +339,10 @@ export function createWriteCore(appDir: string, opts: WriteCoreOptions = {}): Wr
|
|
|
339
339
|
issues.push({
|
|
340
340
|
severity: 'warning',
|
|
341
341
|
code: 'SKELETON_MATERIALIZED',
|
|
342
|
-
message: 'config/integrations.json 缺席——已物化骨架(写时自动初始化;
|
|
342
|
+
message: 'config/integrations.json 缺席——已物化骨架(写时自动初始化; 语义翻转提示)',
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
|
-
// root
|
|
345
|
+
// root 全量替换(无例外语义):缺席根键删除(services/modules 域不在根键集——随 base 保留;v6 domains 键已退役),
|
|
346
346
|
// node 全键置入(未知键交严格 zod 拒——fail-visible;B10:原实现 spread+merge 残留 stale 根键)
|
|
347
347
|
const next: Record<string, unknown> = { ...base };
|
|
348
348
|
for (const k of APP_INTEGRATION_NODE_KEYS) if (!(k in node)) delete next[k];
|
|
@@ -403,7 +403,7 @@ export function createWriteCore(appDir: string, opts: WriteCoreOptions = {}): Wr
|
|
|
403
403
|
issues.push({
|
|
404
404
|
severity: 'warning',
|
|
405
405
|
code: 'SKELETON_MATERIALIZED',
|
|
406
|
-
message: 'config/integrations.json 缺席——已物化骨架(写时自动初始化;
|
|
406
|
+
message: 'config/integrations.json 缺席——已物化骨架(写时自动初始化; 语义翻转提示)',
|
|
407
407
|
});
|
|
408
408
|
}
|
|
409
409
|
const base: Record<string, unknown> = current ?? { services: {} };
|
|
@@ -449,7 +449,7 @@ export function createWriteCore(appDir: string, opts: WriteCoreOptions = {}): Wr
|
|
|
449
449
|
assertSafeInstanceKeys(node, writeOpts, 'slot');
|
|
450
450
|
const issues: IntegrationServiceIssue[] = [];
|
|
451
451
|
const current = loadConfig(appDir, cache);
|
|
452
|
-
//
|
|
452
|
+
// 服务身份判据单源(A2):写入集 = 词汇 ∪ 已配置 ∪ 归属——未知服务(含 typo)404(api.md §5;
|
|
453
453
|
// v6.1 += 归属键——owned ∖ 词汇服务可配置,与求值轴 resolutionKeys 同批接入)。
|
|
454
454
|
// walkManifests 单次调用(目录枚举零缓存——双调 = 每写多一整轮遍历)
|
|
455
455
|
const walk = walkManifests(appDir, cache);
|
|
@@ -460,7 +460,7 @@ export function createWriteCore(appDir: string, opts: WriteCoreOptions = {}): Wr
|
|
|
460
460
|
issues.push({
|
|
461
461
|
severity: 'warning',
|
|
462
462
|
code: 'SKELETON_MATERIALIZED',
|
|
463
|
-
message: 'config/integrations.json 缺席——已物化骨架(写时自动初始化;
|
|
463
|
+
message: 'config/integrations.json 缺席——已物化骨架(写时自动初始化; 语义翻转提示)',
|
|
464
464
|
});
|
|
465
465
|
}
|
|
466
466
|
const base: Record<string, unknown> = current ?? { services: {} };
|
|
@@ -507,7 +507,7 @@ export function createWriteCore(appDir: string, opts: WriteCoreOptions = {}): Wr
|
|
|
507
507
|
deleteService(service: string): SaveResult {
|
|
508
508
|
const issues: IntegrationServiceIssue[] = [];
|
|
509
509
|
const current = loadConfig(appDir, cache);
|
|
510
|
-
//
|
|
510
|
+
// 服务身份判据单源(A2):判据外未知服务 404;判据内缺席节点维持幂等 written:false
|
|
511
511
|
// (v6.1 判据 += 归属键——同 applyService;walkManifests 单次调用)
|
|
512
512
|
const walk = walkManifests(appDir, cache);
|
|
513
513
|
if (!isKnownService(walk.vocabulary, Object.keys((current?.services as Record<string, unknown> | undefined) ?? {}), service, Object.keys(walk.ownership))) {
|
|
@@ -522,7 +522,7 @@ export function createWriteCore(appDir: string, opts: WriteCoreOptions = {}): Wr
|
|
|
522
522
|
const next: Record<string, unknown> = { ...(current ?? { services: {} }), services };
|
|
523
523
|
writeAtomic(join(appDir, INTEGRATIONS_FILE), `${JSON.stringify(next, null, 2)}\n`);
|
|
524
524
|
cache?.invalidate([join(appDir, INTEGRATIONS_FILE)]);
|
|
525
|
-
//
|
|
525
|
+
// 孤儿凭据写后对账(——覆盖 DELETE 与 PUT 替换两类来源)
|
|
526
526
|
issues.push(...reconcileOrphanCredentials(appDir));
|
|
527
527
|
const restartScheduled = onApplied !== undefined;
|
|
528
528
|
if (restartScheduled) onApplied?.();
|
package/src/views/app.ts
CHANGED
|
@@ -3,11 +3,11 @@ import { APP_INTEGRATION_NODE_KEYS } from '../dto.js';
|
|
|
3
3
|
import { moduleOccupiedServices, resolveServiceDisplay, type ViewSnapshot } from './context.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* 应用静态投影(views/app;C4;FX-1c B10——root 节点投影修;v4.4
|
|
6
|
+
* 应用静态投影(views/app;C4;FX-1c B10——root 节点投影修;v4.4——services 双端点同型)。
|
|
7
7
|
* /app = 平台服务 + root 节点原值(纯静态):services = 服务词汇 − 模块占用
|
|
8
|
-
* (ServiceDemand[]——平台条目 required 恒 false、name/description
|
|
8
|
+
* (ServiceDemand[]——平台条目 required 恒 false、name/description 缺席);
|
|
9
9
|
* 平台服务状态不在此(→ /service-resolutions);模块服务不在此(→ /modules/:m)。
|
|
10
|
-
* integration = **root 节点投影**(APP_INTEGRATION_NODE_KEYS
|
|
10
|
+
* integration = **root 节点投影**(APP_INTEGRATION_NODE_KEYS——/L1:GET 预填 ≡ PUT body;
|
|
11
11
|
* 文件另含 services/modules 域键,不进 root 节点投影——原实现整文件透传,
|
|
12
12
|
* PUT 回会级联写回域键);文件缺席 = null,文件在场 → 投影对象(可为空)。
|
|
13
13
|
*/
|
|
@@ -3,7 +3,7 @@ import type { ViewSnapshot } from './context.js';
|
|
|
3
3
|
import { readSchemaRef } from './providers.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* 供给轴凭据结构清单(views/credential-types;v4.4
|
|
6
|
+
* 供给轴凭据结构清单(views/credential-types;v4.4 独立端点 GET /credential-types[?provider=]):
|
|
7
7
|
* 结构按 credentialType 键(wanda 全部槽共享同一 type 同一 schema 文件——(provider, service)
|
|
8
8
|
* 组合寻址是错位键);源 = catalog.credentialTypes(既有聚合产物零新读取路径,聚合条目携
|
|
9
9
|
* packageDir 供 schema 文件解析)。静态轴(稳定可缓存、永不 503)。
|
package/src/views/credentials.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { maskCredentialValues, readCredentialFile, stemToFilePath } from '../cor
|
|
|
3
3
|
import type { ViewSnapshot } from './context.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* 凭据状态轴投影(views/credentials;v4.4
|
|
6
|
+
* 凭据状态轴投影(views/credentials;v4.4 独立端点 GET /credentials):
|
|
7
7
|
* 绑定位全量掩码回显——应用状态轴(随配置失效、零求值零 contracts、永不 503)。
|
|
8
8
|
* GET 永无真值(仅 ref/masked);掩码单源 maskCredentialValues;echoForRef 自
|
|
9
9
|
* service-resolutions 迁入共享(求值单体 instances[].credential 已删净——求值路径零凭据 I/O)。
|
|
@@ -12,7 +12,7 @@ import type { ViewSnapshot } from './context.js';
|
|
|
12
12
|
* app.byInstance = 注册表 ids ∩ 有 ref(无 ref 的注册实例不出现;未注册 ref 跳过不虚报)
|
|
13
13
|
* services[s].byInstance = 节点 instances map 全键(含 '*',无 ref 亦在场 → null)
|
|
14
14
|
* null 语义:credential/byInstance 值 = 「未就绪」(ref 缺席或文件缺失)——缺失诊断归谓词 #1
|
|
15
|
-
* (CREDENTIAL_FILE_MISSING),echo = 状态回显、issues =
|
|
15
|
+
* (CREDENTIAL_FILE_MISSING),echo = 状态回显、issues = 诊断定位(分工)。
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
/** 凭据文件掩码回显(ref 非 secret:// 或文件缺席 → undefined——调用方映射 null) */
|
|
@@ -5,26 +5,26 @@ import { moduleOwnershipWritable, providerFootprint, resolveModuleBinding } from
|
|
|
5
5
|
import { isControlledInlineProvider } from '../integrations/predicate.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* 层级/服务级 config schema 计算视图(v4.4
|
|
9
|
-
* config
|
|
8
|
+
* 层级/服务级 config schema 计算视图(v4.4——静态轴富化,零 contracts 求值;v4.7 服务级)。
|
|
9
|
+
* config 表单结构四形态同源:槽级组合单体(providers.ts)/ 层级内嵌(本文件——
|
|
10
10
|
* /app、/modules/:m include)/ 供给轴批量(providers.ts include——切换态)/ 服务级生效绑定
|
|
11
11
|
* (本文件 loadServiceIntegrationSchemas——/services/:s include)。
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* 计算规则(裁决):禁交集——config 五层浅合并下「部分服务认识的字段」合法(谓词 #7
|
|
14
14
|
* 并集键集同依据);禁合成单一 schema——required/title 冲突的有损代数;产物 = 扁平映射,
|
|
15
|
-
* 分组归客户端纯呈现。层级 schema =
|
|
15
|
+
* 分组归客户端纯呈现。层级 schema = 表单引导**非写入门禁**(——写路径校验权威恒在谓词
|
|
16
16
|
* #7 键集 + ajv 凭据链;root 级口径差:#7 = 引用厂商并集,表单 = 层生效厂商单厂商作用域)。
|
|
17
17
|
*
|
|
18
|
-
* v4.6(
|
|
18
|
+
* v4.6(additive 精化):**原始投影**(loadApp/loadModuleIntegrationSchemas)原样保留
|
|
19
19
|
* 为诊断面 / registry 输入;**消费投影** = buildIntegrationFieldRegistry(字段级合并代数
|
|
20
|
-
*
|
|
20
|
+
* ——服务端单源,conflict 折叠 schema:null);**轴向假想绑定** = formProviderOf
|
|
21
21
|
* (override ?? 实际解析——双投影同源同口径,formViews 装配层一次计算两投影)。
|
|
22
22
|
* 单源三锚:层级 schema 计算 = resolveLayerIntegrationSchemas / 生效厂商解析 = formProviderOf /
|
|
23
23
|
* 合并代数 = buildIntegrationFieldRegistry。
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
/** 核心纯函数:显式作用域(provider null → 整字段 null;services 逐项 resolveServiceConfigSchema
|
|
27
|
-
* 复合解析——v4.7
|
|
27
|
+
* 复合解析——v4.7 收口,零新读取路径;供给在场未声明 = null,mock 合法) */
|
|
28
28
|
export function resolveLayerIntegrationSchemas(snapshot: ViewSnapshot, provider: string, services: readonly string[]): LayerIntegrationSchemas;
|
|
29
29
|
export function resolveLayerIntegrationSchemas(snapshot: ViewSnapshot, provider: string | null, services: readonly string[]): LayerIntegrationSchemas | null;
|
|
30
30
|
export function resolveLayerIntegrationSchemas(
|
|
@@ -40,9 +40,9 @@ export function resolveLayerIntegrationSchemas(
|
|
|
40
40
|
return { provider, services: out };
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
// ── v4.6
|
|
43
|
+
// ── v4.6/合并代数助手(内联——深相等判定基)──
|
|
44
44
|
|
|
45
|
-
/** 稳定序列化(键序归一——
|
|
45
|
+
/** 稳定序列化(键序归一—— 深相等 / 签名比较统一基;数组保序、对象键 sort) */
|
|
46
46
|
function stableSerialize(v: unknown): string {
|
|
47
47
|
if (v === null || typeof v !== 'object') return JSON.stringify(v ?? null) as string;
|
|
48
48
|
if (Array.isArray(v)) return `[${v.map(stableSerialize).join(',')}]`;
|
|
@@ -60,31 +60,31 @@ function enumSig(sub: Record<string, unknown>): string {
|
|
|
60
60
|
return `[${[...new Set(e.map(stableSerialize))].sort().join(',')}]`;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
/** 顶层 type 签名(数组形态序敏感——严格全等);非对象(含布尔子 schema)/ type 缺席 → null
|
|
63
|
+
/** 顶层 type 签名(数组形态序敏感——严格全等);非对象(含布尔子 schema)/ type 缺席 → null */
|
|
64
64
|
function typeSig(sub: unknown): string | null {
|
|
65
65
|
if (!sub || typeof sub !== 'object' || Array.isArray(sub)) return null;
|
|
66
66
|
const t = (sub as Record<string, unknown>).type;
|
|
67
67
|
return t === undefined ? null : stableSerialize(t);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
/**
|
|
70
|
+
/** 合并代数单点(/——唯一扩展点;保守降级:不可调和 → null,客户端 RawJson 保真) */
|
|
71
71
|
function mergeFieldSources(sources: ReadonlyArray<{ subschema: unknown }>): object | null {
|
|
72
72
|
const sigs = sources.map((s) => typeSig(s.subschema));
|
|
73
|
-
if (sigs.some((s) => s === null) || new Set(sigs).size > 1) return null; //
|
|
73
|
+
if (sigs.some((s) => s === null) || new Set(sigs).size > 1) return null; // 非对象/type 缺席/type 不等
|
|
74
74
|
if (sigs[0] === '"object"') {
|
|
75
|
-
//
|
|
75
|
+
// 全源稳定序列化深相等 → 首源;异构 → null
|
|
76
76
|
const first = stableSerialize(sources[0].subschema);
|
|
77
77
|
return sources.every((s) => stableSerialize(s.subschema) === first) ? (sources[0].subschema as object) : null;
|
|
78
78
|
}
|
|
79
|
-
//
|
|
79
|
+
// 标量型——enum 集全等(含双无哨兵)→ 首源;不等/混布 → null
|
|
80
80
|
const es = new Set(sources.map((s) => enumSig(s.subschema as Record<string, unknown>)));
|
|
81
81
|
return es.size === 1 ? (sources[0].subschema as object) : null;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/**
|
|
85
|
-
* fields 收集零过滤(布尔/非对象子 schema 入列,判定全权归 mergeFieldSources——
|
|
84
|
+
/** registry 构造(纯函数——消费 resolveLayerIntegrationSchemas 产物,禁旁路直取 serviceSchemas)。
|
|
85
|
+
* fields 收集零过滤(布尔/非对象子 schema 入列,判定全权归 mergeFieldSources—— 互证等式由
|
|
86
86
|
* 收集定义结构性闭合);schemaless 仅 configSchema === null(布尔/畸形整 schema 防御跳过——
|
|
87
|
-
* 不入 schemaless、零参与聚合;
|
|
87
|
+
* 不入 schemaless、零参与聚合; 运行时畸形,非契约面)。 */
|
|
88
88
|
export function buildIntegrationFieldRegistry(
|
|
89
89
|
layer: LayerIntegrationSchemas,
|
|
90
90
|
o?: { unsupplied?: string[] },
|
|
@@ -134,7 +134,7 @@ export function buildIntegrationFieldRegistry(
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
/**
|
|
137
|
+
/** 生效厂商解析单源(实际/假想同径):override(非空串)?? 实际解析。
|
|
138
138
|
* 空串归一(I3)单点;module 轴 v6 零归属 → null(override 不豁免——预览服务于保存)。 */
|
|
139
139
|
export function formProviderOf(
|
|
140
140
|
axis: 'app' | 'module',
|
|
@@ -156,24 +156,24 @@ export function formProviderOf(
|
|
|
156
156
|
return resolveModuleBinding(snapshot.integrations, mod.id).provider;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
/**
|
|
159
|
+
/** 表单层双投影(I1:同源同口径一次计算——双取单算 by construction) */
|
|
160
160
|
export interface LayerFormViews {
|
|
161
161
|
integrationSchemas: LayerIntegrationSchemas | null;
|
|
162
162
|
integrationFieldRegistry: IntegrationFieldRegistryView | null;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
/** 防御双 null(module 不在册/不可写/未绑定、app
|
|
165
|
+
/** 防御双 null(module 不在册/不可写/未绑定、app 未绑定——) */
|
|
166
166
|
const NULL_FORM_VIEWS: LayerFormViews = { integrationSchemas: null, integrationFieldRegistry: null };
|
|
167
167
|
|
|
168
168
|
/** G 批表单收窄(消费投影单点):app/module 轴 registry.fields 只留 global===true——
|
|
169
|
-
* 未声明键落 ExtraFields
|
|
169
|
+
* 未声明键落 ExtraFields 语义(复合可见面:layer.properties 仍全量,字段级代数不受扰)。
|
|
170
170
|
* schemaless/unsupplied/additionalPropertiesAllowed 描述服务/Schema 面,不随字段过滤。 */
|
|
171
171
|
function narrowToGlobal(registry: IntegrationFieldRegistryView): IntegrationFieldRegistryView {
|
|
172
172
|
return { ...registry, fields: registry.fields.filter((f) => f.global) };
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
/** app 轴装配:scope = 供给足迹全量(≠ AppView.services——root.config 流向包括模块服务在内的所有服务);
|
|
176
|
-
* unsupplied 恒 [](结构性:足迹 ⊆ 供给)。未知厂商/零足迹 → 非 null 空集(镜像
|
|
176
|
+
* unsupplied 恒 [](结构性:足迹 ⊆ 供给)。未知厂商/零足迹 → 非 null 空集(镜像 mock 语义)。 */
|
|
177
177
|
export function loadAppFormViews(snapshot: ViewSnapshot, appProvider?: string): LayerFormViews {
|
|
178
178
|
const provider = formProviderOf('app', snapshot, undefined, appProvider);
|
|
179
179
|
if (provider === null) return NULL_FORM_VIEWS;
|
|
@@ -222,7 +222,7 @@ function serviceLevelBindingProvider(snapshot: ViewSnapshot, service: string): s
|
|
|
222
222
|
return typeof p === 'string' && p.length > 0 ? p : null;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
/** 服务级 loader(v4.7
|
|
225
|
+
/** 服务级 loader(v4.7):四分支穷举(node.provider = 文件 services[s].provider 逐字原值;
|
|
226
226
|
* 实例层无条件排除——node 级口径);非空三分支归约一次复合解析。
|
|
227
227
|
* ① undefined/'' → 模块级联(v6:modules[ownerOf[s]] → root 双缺 → 整字段 null)
|
|
228
228
|
* ② 非空 string → bare:catalog miss(未知厂商/未供给)→ configSchema:null 不 404(富化非门控)
|
|
@@ -230,10 +230,10 @@ function serviceLevelBindingProvider(snapshot: ViewSnapshot, service: string): s
|
|
|
230
230
|
* (H9 逃逸 400 照抛——readInlineSchema 共享路径)
|
|
231
231
|
* ④ 其余(null/数组/原始值/坏对象)→ 整字段 null(≡ 谓词 #5 INLINE_PROVIDER_INVALID 同判——
|
|
232
232
|
* 不放行域级联,防错误 schema 污染坏节点)
|
|
233
|
-
* v5.1
|
|
233
|
+
* v5.1 serviceProvider = 服务轴向假想绑定(缺席/空串 ≡ 按实际解析——I3 归一单点在此头部,
|
|
234
234
|
* registry 侧不重复归一);非空轴参 → 短路 bare 解析(镜像 formProviderOf「输入替换非分支复制」先例:
|
|
235
235
|
* 任一原分支改写 provider 为 X 后实读都进 bare 分支,同构承诺 by construction)。短路在节点读取之前——
|
|
236
|
-
*
|
|
236
|
+
* 豁免链三分支(与 四分支的有意分歧:预览与坏文件解耦):malformed(分支④)不污染假想 /
|
|
237
237
|
* 内联 ref 不读取(假想态无 H9 逃逸 400;catalog 命中的 manifest 声明路径照读,与节点声明的
|
|
238
238
|
* 用户可控路径不同性)/ 全链未绑定时假想仍非 null(服务轴恒可写,无 module 轴零归属对应物)。 */
|
|
239
239
|
export function loadServiceIntegrationSchemas(
|
|
@@ -263,11 +263,11 @@ export function loadServiceIntegrationSchemas(
|
|
|
263
263
|
return null;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
/** G
|
|
266
|
+
/** G 批:服务轴字段注册表(四分支链复用——消费 loadServiceIntegrationSchemas 单源;
|
|
267
267
|
* 伪层 {provider, services: {[s]: {configSchema}}} → buildIntegrationFieldRegistry——
|
|
268
268
|
* fields = 该 schema 全部字段带 global 旗标;configSchema null → schemaless=[service]
|
|
269
|
-
* 非 null 空集;schemas 整体 null(全链未绑定/坏节点)→ registry null——镜像
|
|
270
|
-
* v5.1
|
|
269
|
+
* 非 null 空集;schemas 整体 null(全链未绑定/坏节点)→ registry null——镜像 语义)。
|
|
270
|
+
* v5.1 serviceProvider = 服务轴向假想绑定,纯透传(I1 单源——归一与短路都在链函数头部;
|
|
271
271
|
* 轴参仅重定向表单层投影,global 旗标全量透传语义不变)。 */
|
|
272
272
|
export function loadServiceFieldRegistry(
|
|
273
273
|
snapshot: ViewSnapshot,
|
package/src/views/modules.ts
CHANGED
|
@@ -131,7 +131,7 @@ export function loadModuleDetailView(snapshot: ViewSnapshot, moduleId: string):
|
|
|
131
131
|
...[...new Set(w.ownedServices)].filter((service) => !consumed.has(service)).map((service) => toDemand(service, false)),
|
|
132
132
|
];
|
|
133
133
|
const modulesNode = (snapshot.integrations as { modules?: Record<string, unknown> } | null)?.modules ?? {};
|
|
134
|
-
// integration = modules[install id]
|
|
134
|
+
// integration = modules[install id] 集成位投影(编辑预填源;provider/config 两键——
|
|
135
135
|
// resources 不投影不写,N2);未配置 = null
|
|
136
136
|
const rawNode = modulesNode[moduleId] as Record<string, unknown> | undefined;
|
|
137
137
|
const integration: ModuleDetailView['integration'] = rawNode
|
package/src/views/providers.ts
CHANGED
|
@@ -5,9 +5,9 @@ import { isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
|
5
5
|
import { resolveServiceDisplay, type ViewSnapshot } from './context.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* 供给轴投影(views/providers;C4
|
|
8
|
+
* 供给轴投影(views/providers;C4)。供给关系三切片:
|
|
9
9
|
* 名单 = /providers(基本信息)· 足迹 = /providers/:p(implementations[] 保真)·
|
|
10
|
-
* 表单 = /providers/:p/services/:s(组合单体——schema
|
|
10
|
+
* 表单 = /providers/:p/services/:s(组合单体——schema 唯一暴露面)。
|
|
11
11
|
* 静态端点零求值(铁律 #3)。
|
|
12
12
|
*/
|
|
13
13
|
|
|
@@ -30,7 +30,7 @@ export function loadProvidersView(snapshot: ViewSnapshot): ProvidersView {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/** GET /providers/:provider:供给足迹(implementations 恒数组——H1 多实现钉版数据源;
|
|
33
|
-
* v4.4
|
|
33
|
+
* v4.4 include=integrationSchemas 切换态批量——services[s] += { configSchema }(纯 config)) */
|
|
34
34
|
export function loadProviderDetailView(snapshot: ViewSnapshot, provider: string, include?: ReadonlySet<string>): ProviderDetail {
|
|
35
35
|
const impls = snapshot.catalog.providers[provider];
|
|
36
36
|
if (!impls) {
|
|
@@ -66,7 +66,7 @@ export function loadProviderDetailView(snapshot: ViewSnapshot, provider: string,
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
/** 组合单体(GET /providers/:p/services/:s):catalog
|
|
69
|
+
/** 组合单体(GET /providers/:p/services/:s):catalog 供给与槽级内联声明统一解析(/) */
|
|
70
70
|
export function loadProviderServiceDetailView(
|
|
71
71
|
snapshot: ViewSnapshot,
|
|
72
72
|
provider: string,
|
|
@@ -77,7 +77,7 @@ export function loadProviderServiceDetailView(
|
|
|
77
77
|
services?: Record<string, { provider?: unknown; implementation?: string }>;
|
|
78
78
|
} | null)?.services ?? {};
|
|
79
79
|
|
|
80
|
-
//
|
|
80
|
+
// 供给解析(判据 = 供给存在):catalog 槽供给 → implementations[] 数组装配(声明序)
|
|
81
81
|
const implementations: Array<{ implementation: string; credentialType: string }> = [];
|
|
82
82
|
if (impls) {
|
|
83
83
|
for (const entry of Object.values(impls)) {
|
|
@@ -104,7 +104,7 @@ export function loadProviderServiceDetailView(
|
|
|
104
104
|
implementations.push({ implementation: configured[service]?.implementation ?? `${provider}-inline@1`, credentialType: inlineDeclaration.credentialType });
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
// integrationSchemas:schema 解析收口 resolveServiceConfigSchema 单源(v4.7
|
|
107
|
+
// integrationSchemas:schema 解析收口 resolveServiceConfigSchema 单源(v4.7——catalog 复合键 >
|
|
108
108
|
// 内联 ref,等价重构 O6/O7/O15 零改动即证);内联 ref 来源 = 节点声明(provider.configSchema,
|
|
109
109
|
// 仅受控内联声明匹配本厂商名时);路径约束 H9——resolve 落 config/schemas/ 内 + realpath 复核,违例 400
|
|
110
110
|
const configSchema = resolveServiceConfigSchema(
|
|
@@ -122,10 +122,10 @@ export function loadProviderServiceDetailView(
|
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
/** per-(provider, service) schema 复合解析单源(v4.7
|
|
125
|
+
/** per-(provider, service) schema 复合解析单源(v4.7):catalog 复合键(多 impl 声明序首个)
|
|
126
126
|
* > 内联 ref(readInlineSchema 保持私有——H9 双钉子不扩暴露);miss / 未声明 / 文件缺失 → null。
|
|
127
127
|
* views 层 \u0000 复合键唯一消费点(组合单体 / 供给轴批量 / 层级核心 / 服务级 include 同源)。
|
|
128
|
-
* (
|
|
128
|
+
* (registry 批若需跨包消费再升 index 导出——additive 零成本) */
|
|
129
129
|
export function resolveServiceConfigSchema(
|
|
130
130
|
snapshot: ViewSnapshot,
|
|
131
131
|
provider: string,
|
|
@@ -5,18 +5,18 @@ import { resolveServiceDisplay, suppliedByVendors, type ViewSnapshot } from './c
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* 服务静态单体投影(views/service-detail;C4)。求值数据不在此(→ /service-resolutions/:service)。
|
|
8
|
-
* SERVICE_NOT_FOUND 判据 = 服务词汇 ∪
|
|
8
|
+
* SERVICE_NOT_FOUND 判据 = 服务词汇 ∪ 已配置(——词汇成员零 demand/供给/config 仍 200)。
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export function loadServiceDetailView(snapshot: ViewSnapshot, service: string): ServiceDetail {
|
|
12
12
|
const configured = (snapshot.integrations as { services?: Record<string, unknown> } | null)?.services ?? {};
|
|
13
13
|
const demand = snapshot.catalog.services[service];
|
|
14
|
-
// 404
|
|
14
|
+
// 404 判据与写路径单源(——A2 isKnownService;词汇成员零 demand/供给/config 仍 200;
|
|
15
15
|
// v6.1 += 归属键——owned ∖ 词汇服务静态单体可达,与求值/写轴同批接入)
|
|
16
16
|
if (!isKnownService(snapshot.walk.vocabulary, Object.keys(configured), service, Object.keys(snapshot.walk.ownership))) {
|
|
17
17
|
throw new AppToolkitError('SERVICE_NOT_FOUND', 404, `服务 ${service} 不在服务词汇(已装契约包 ∪ 已配置 ∪ 归属)`);
|
|
18
18
|
}
|
|
19
|
-
// integration = 文件 services[s]
|
|
19
|
+
// integration = 文件 services[s] 逐字原值(编辑预填源);无声明 = null
|
|
20
20
|
const integration = (configured[service] as ServiceDetail['integration'] | undefined) ?? null;
|
|
21
21
|
// 展示名单源走链(B1):词汇 meta > demand meta > id——替换 demand 直拼(恒有值)
|
|
22
22
|
const display = resolveServiceDisplay(snapshot.walk, service);
|
|
@@ -17,8 +17,8 @@ import type { WalkCatalog } from '../assembly/walk-manifests.js';
|
|
|
17
17
|
import { isSupplied, type ViewSnapshot } from './context.js';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* 求值轴投影(views/service-resolutions;C4;FX-2c——B6 effective 填充 +
|
|
21
|
-
* v4.4——
|
|
20
|
+
* 求值轴投影(views/service-resolutions;C4;FX-2c——B6 effective 填充 + layer 推导;
|
|
21
|
+
* v4.4—— Entry.layer 双缺席语义 + 凭据内嵌删净(求值路径零凭据文件 I/O))。
|
|
22
22
|
*
|
|
23
23
|
* status(service, instanceId) = contracts.resolveEffectiveService(integrations, service, instanceId,
|
|
24
24
|
* supplies).status——动态(应用自身 contracts 求值单源)。
|
|
@@ -26,10 +26,10 @@ import { isSupplied, type ViewSnapshot } from './context.js';
|
|
|
26
26
|
* null → '*' 通配口径求值——显式键集无通配 → instance-not-found 如实暴露;不自造 instances[0])。
|
|
27
27
|
* required(service) = 任一需求方 required(OR 聚合——demandedServices.optional AND 合并的补语义;
|
|
28
28
|
* 平台/孤儿恒 false)——集成就绪判定单源:pending = Σ (required && status !== 'ok')。
|
|
29
|
-
* **
|
|
29
|
+
* ** 单一形状(结构保证)**:resolveServiceSummary() 单源函数——/service-resolutions map 值 ≡
|
|
30
30
|
* /service-resolutions/:s 的 resolution 摘要基(ServiceResolution extends ServiceResolutionEntry)
|
|
31
31
|
* ≡ /app 内嵌 map 值 ≡ /modules/:m 内嵌 map 值(v4.4 等价面四处)。
|
|
32
|
-
* **实例条目**:effective(合并绑定投影 + layer 推导——contracts EffectiveService 无 layer
|
|
32
|
+
* **实例条目**:effective(合并绑定投影 + layer 推导——contracts EffectiveService 无 layer,)。
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
35
|
function toContractsResolution(contracts: ResolvedContracts): ContractsResolution {
|
|
@@ -50,10 +50,10 @@ interface InstanceEvaluation {
|
|
|
50
50
|
effective?: EffectiveBinding;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
/**
|
|
53
|
+
/** 最特异声明层推导:inst 位 provider 在场 → 'instance';槽级 → 'service';模块级 → 'module';
|
|
54
54
|
* root → 'app'。实例位查找复刻 TIER0 语义(精确键优先、'*' 通配兜底——与 resolveEffectiveService
|
|
55
55
|
* 的 instances 查找层同轴)。v6:模块级段消费 resolveModuleBinding 单源(ownerOf=walk.ownership);
|
|
56
|
-
* 返回扩 null(四层全无 provider 声明 → null——Entry.layer
|
|
56
|
+
* 返回扩 null(四层全无 provider 声明 → null——Entry.layer「未配置双缺席」口径,)。 */
|
|
57
57
|
function deriveBindingLayer(snapshot: ViewSnapshot, service: string, instanceId: string): BindingLayer | null {
|
|
58
58
|
const integrations = snapshot.integrations as {
|
|
59
59
|
provider?: unknown;
|
|
@@ -147,7 +147,7 @@ interface EffectiveResolutionShape {
|
|
|
147
147
|
message?: string;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
/**
|
|
150
|
+
/** 单源摘要函数:/service-resolutions map 值 ≡ /service-resolutions/:s 的 resolution 摘要基 */
|
|
151
151
|
export function resolveServiceSummary(
|
|
152
152
|
service: string,
|
|
153
153
|
snapshot: ViewSnapshot,
|
|
@@ -169,8 +169,8 @@ export function resolveServiceSummary(
|
|
|
169
169
|
// 跨实例求值异常聚合(statusMessage 直投)
|
|
170
170
|
const evaluation = evaluateInstance(snapshot, contracts, service, defaultInstanceId, supplies);
|
|
171
171
|
|
|
172
|
-
// v4.4
|
|
173
|
-
// 未配置(provider 缺席)→ 双缺席——layer 单独在场即「无 provider 的孤儿层」,违
|
|
172
|
+
// v4.4 layer = provider 字段来源声明层(默认实例口径,与 status 同轴);
|
|
173
|
+
// 未配置(provider 缺席)→ 双缺席——layer 单独在场即「无 provider 的孤儿层」,违 口径
|
|
174
174
|
const layer = deriveBindingLayer(snapshot, service, defaultInstanceId);
|
|
175
175
|
|
|
176
176
|
// provider:effective 求值厂商(最特异声明层——跨层事实);缺席 = 未配置/未解析
|
|
@@ -239,7 +239,7 @@ export function loadServiceResolutionsView(
|
|
|
239
239
|
return { contracts: toContractsResolution(snapshot.contracts), resolutions, issues };
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
/** 求值单体(完整结构 instances + inheritance + 过滤 issues;
|
|
242
|
+
/** 求值单体(完整结构 instances + inheritance + 过滤 issues; extends 结构保证) */
|
|
243
243
|
export function loadServiceResolutionDetail(
|
|
244
244
|
service: string,
|
|
245
245
|
snapshot: ViewSnapshot,
|
|
@@ -253,7 +253,7 @@ export function loadServiceResolutionDetail(
|
|
|
253
253
|
defaultInstanceId: cfg?.defaultInstanceId,
|
|
254
254
|
});
|
|
255
255
|
|
|
256
|
-
//
|
|
256
|
+
// 枚举规则:root 注册表 id 逐一 + 显式 '*' 条目(若在);无注册表且节点通配激活 → 单 '*' 合成;
|
|
257
257
|
// 无注册表无节点 → [](枚举单源 = enumerateInstanceIds——降级轴声明实例投影共用)
|
|
258
258
|
const declaredIds = normalized.instances.map((i) => i.id);
|
|
259
259
|
const slot = (snapshot.integrations as { services?: Record<string, { instances?: Record<string, unknown> }> } | null)
|
|
@@ -265,7 +265,7 @@ export function loadServiceResolutionDetail(
|
|
|
265
265
|
|
|
266
266
|
const instances: ResolvedInstance[] = instanceIds.map((id) => {
|
|
267
267
|
const evalResult = evaluateInstance(snapshot, contracts, service, id, supplies);
|
|
268
|
-
// v4.4
|
|
268
|
+
// v4.4 instances[].credential 删净(凭据掩码回显归 GET /credentials——求值路径零凭据文件 I/O)
|
|
269
269
|
return {
|
|
270
270
|
instanceId: id,
|
|
271
271
|
status: evalResult.status,
|
|
@@ -291,7 +291,7 @@ export function loadServiceResolutionDetail(
|
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
/**
|
|
294
|
+
/** 实例枚举单源(求值轴/降级轴共用):root 注册表 id 逐一 + 显式 '*' 条目(若在);
|
|
295
295
|
* 无注册表且节点通配激活 → 单 '*' 合成;无注册表无节点 → []。 */
|
|
296
296
|
function enumerateInstanceIds(slotKeys: string[] | undefined, declaredIds: string[]): string[] {
|
|
297
297
|
if (declaredIds.length > 0) {
|
|
@@ -347,7 +347,7 @@ export type { IntegrationIssue };
|
|
|
347
347
|
// ── 降级轴(v7——policy-at-edge 读求值轴退役)──
|
|
348
348
|
// contracts 不可用(未安装 / 无严格面 / 求值面缺席 / v6 标记缺席)时,读求值轴不再 503,
|
|
349
349
|
// 改投静态骨架(walk + integrations 纯文件投影,零 contracts 依赖)+ evaluation-unavailable 标记。
|
|
350
|
-
// 依据链:doctor 分级先例(未安装 = warning 正常态)+
|
|
350
|
+
// 依据链:doctor 分级先例(未安装 = warning 正常态)+ include→null 先例;fail-visible 语义
|
|
351
351
|
// 保留在数据内(status + statusMessage N1 分支文案),写路径与 internals 门控不变。
|
|
352
352
|
|
|
353
353
|
/** 读求值轴可用判据(三条件与——降级门单源;写路径 assertContractsUsable 另有 503 语义,不复用) */
|
|
@@ -356,7 +356,7 @@ export function contractsEvaluable(contracts: ResolvedContracts): boolean {
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
/** 降级单条目(静态可算字段:module = walk.ownership(v6 归属单源,install id 轴)/
|
|
359
|
-
* required = OR 聚合;provider/layer 不投——保持「求值产物」语义纯净,layer 单独在场违
|
|
359
|
+
* required = OR 聚合;provider/layer 不投——保持「求值产物」语义纯净,layer 单独在场违 孤儿层口径) */
|
|
360
360
|
function degradeEntry(snapshot: ViewSnapshot, service: string, message: string): ServiceResolutionEntry {
|
|
361
361
|
const demand = snapshot.catalog.services[service];
|
|
362
362
|
const owner = snapshot.walk.ownership[service];
|
|
@@ -384,7 +384,7 @@ export function loadServiceResolutionsDegradeView(
|
|
|
384
384
|
return { contracts: toContractsResolution(contracts), resolutions, issues: [] };
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
-
/** 单体降级视图(
|
|
387
|
+
/** 单体降级视图(extends 结构保证——摘要基 + instances 声明枚举 + inheritance 四层静态投影) */
|
|
388
388
|
export function loadServiceResolutionDegradeDetail(
|
|
389
389
|
service: string,
|
|
390
390
|
snapshot: ViewSnapshot,
|
|
@@ -399,7 +399,7 @@ export function loadServiceResolutionDegradeDetail(
|
|
|
399
399
|
return { contracts: toContractsResolution(contracts), resolution, issues: [] };
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
-
/** 声明实例投影(原始数据——root instances[].id ∪ slot 实例键,
|
|
402
|
+
/** 声明实例投影(原始数据——root instances[].id ∪ slot 实例键, 枚举单源共用;
|
|
403
403
|
* 非 normalizeInstances 派生语义,单源不破)。逐实例同标记,statusMessage 不重复携带
|
|
404
404
|
* (resolution 顶层已携带)。 */
|
|
405
405
|
function degradeInstances(snapshot: ViewSnapshot, service: string): ResolvedInstance[] {
|