@vibe-engineer/adapter-pi 0.1.0 → 0.2.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/dist/capabilities/index.d.ts +180 -2
- package/dist/capabilities/index.js +30 -2
- package/dist/chunk-BUGDS7N5.js +1591 -0
- package/dist/{chunk-PJHJYGIJ.js → chunk-IEE5KD5L.js} +371 -207
- package/dist/{chunk-VXZJPOEE.js → chunk-QEXU5LD2.js} +692 -119
- package/dist/create-consumption/index.js +3 -3
- package/dist/generated-file-manifest/index.js +3 -3
- package/dist/schema/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-RC3EILIE.js +0 -243
|
@@ -10,9 +10,21 @@ var GENERATED_FILE_FAMILY_IDS = [
|
|
|
10
10
|
"context-files",
|
|
11
11
|
"harness-config"
|
|
12
12
|
];
|
|
13
|
-
var SANDBOX_CAPABILITY_STATES = [
|
|
13
|
+
var SANDBOX_CAPABILITY_STATES = [
|
|
14
|
+
"proven",
|
|
15
|
+
"not_provided",
|
|
16
|
+
"unknown",
|
|
17
|
+
"blocked",
|
|
18
|
+
"pending-live"
|
|
19
|
+
];
|
|
14
20
|
var I14A_RUNTIME_EXECUTION_CLAIMS = ["not-claimed", "pending-live", "blocked"];
|
|
15
|
-
var I14A_OUT_OF_SCOPE_RUNTIME_EXECUTION_CLAIMS = [
|
|
21
|
+
var I14A_OUT_OF_SCOPE_RUNTIME_EXECUTION_CLAIMS = [
|
|
22
|
+
"proven",
|
|
23
|
+
"live-proven",
|
|
24
|
+
"runtime-proven",
|
|
25
|
+
"loaded",
|
|
26
|
+
"executed"
|
|
27
|
+
];
|
|
16
28
|
var GENERATED_FILE_PRODUCER_LANE_IDS = [
|
|
17
29
|
"I-14B-pi-adapter-runtime-skill-consumption",
|
|
18
30
|
"I-15A-create-import-cli-ux-selected-harness"
|
|
@@ -108,8 +120,15 @@ var checkExactStringSet = (value, expected, path, code, issues, message) => {
|
|
|
108
120
|
return true;
|
|
109
121
|
};
|
|
110
122
|
var validateI14ARuntimeExecutionClaim = (value, path, issues) => {
|
|
111
|
-
if (typeof value === "string" && I14A_OUT_OF_SCOPE_RUNTIME_EXECUTION_CLAIMS.includes(
|
|
112
|
-
|
|
123
|
+
if (typeof value === "string" && I14A_OUT_OF_SCOPE_RUNTIME_EXECUTION_CLAIMS.includes(
|
|
124
|
+
value
|
|
125
|
+
)) {
|
|
126
|
+
addIssue(
|
|
127
|
+
issues,
|
|
128
|
+
path,
|
|
129
|
+
"i14a_runtime_claim_out_of_scope",
|
|
130
|
+
"I-14A cannot claim live pi runtime execution; live-runtime proof belongs to I-14B."
|
|
131
|
+
);
|
|
113
132
|
return false;
|
|
114
133
|
}
|
|
115
134
|
return checkLiteral(value, I14A_RUNTIME_EXECUTION_CLAIMS, path, issues);
|
|
@@ -118,7 +137,11 @@ var GENERATED_FILE_FAMILY_CONTRACTS = {
|
|
|
118
137
|
"pi-skill-files": {
|
|
119
138
|
pathPatterns: [".pi/skills/<skill>/SKILL.md", ".agents/skills/<skill>/SKILL.md"],
|
|
120
139
|
producerLane: "I-14B-pi-adapter-runtime-skill-consumption",
|
|
121
|
-
consumedByLanes: [
|
|
140
|
+
consumedByLanes: [
|
|
141
|
+
"I-14B-pi-adapter-runtime-skill-consumption",
|
|
142
|
+
"I-15A-create-import-cli-ux-selected-harness",
|
|
143
|
+
"I-21-build-skill-orchestration"
|
|
144
|
+
],
|
|
122
145
|
ownerKind: "lane",
|
|
123
146
|
allowedOperations: ["generate-in-later-lane", "validate"],
|
|
124
147
|
trustClassification: "project-instruction",
|
|
@@ -136,7 +159,10 @@ var GENERATED_FILE_FAMILY_CONTRACTS = {
|
|
|
136
159
|
"pi-prompt-templates": {
|
|
137
160
|
pathPatterns: [".pi/prompts/<name>.md"],
|
|
138
161
|
producerLane: "I-14B-pi-adapter-runtime-skill-consumption",
|
|
139
|
-
consumedByLanes: [
|
|
162
|
+
consumedByLanes: [
|
|
163
|
+
"I-14B-pi-adapter-runtime-skill-consumption",
|
|
164
|
+
"I-15A-create-import-cli-ux-selected-harness"
|
|
165
|
+
],
|
|
140
166
|
ownerKind: "lane",
|
|
141
167
|
allowedOperations: ["generate-in-later-lane", "validate"],
|
|
142
168
|
trustClassification: "project-instruction",
|
|
@@ -154,7 +180,11 @@ var GENERATED_FILE_FAMILY_CONTRACTS = {
|
|
|
154
180
|
"pi-extensions": {
|
|
155
181
|
pathPatterns: [".pi/extensions/<name>.ts", ".pi/extensions/<name>/index.ts"],
|
|
156
182
|
producerLane: "I-14B-pi-adapter-runtime-skill-consumption",
|
|
157
|
-
consumedByLanes: [
|
|
183
|
+
consumedByLanes: [
|
|
184
|
+
"I-14B-pi-adapter-runtime-skill-consumption",
|
|
185
|
+
"I-18-security-safety-hooks-policy",
|
|
186
|
+
"I-21-build-skill-orchestration"
|
|
187
|
+
],
|
|
158
188
|
ownerKind: "lane",
|
|
159
189
|
allowedOperations: ["generate-in-later-lane", "validate"],
|
|
160
190
|
trustClassification: "executable-extension",
|
|
@@ -172,7 +202,10 @@ var GENERATED_FILE_FAMILY_CONTRACTS = {
|
|
|
172
202
|
"pi-package-manifest": {
|
|
173
203
|
pathPatterns: ["package.json#pi"],
|
|
174
204
|
producerLane: "I-14B-pi-adapter-runtime-skill-consumption",
|
|
175
|
-
consumedByLanes: [
|
|
205
|
+
consumedByLanes: [
|
|
206
|
+
"I-14B-pi-adapter-runtime-skill-consumption",
|
|
207
|
+
"I-15B-starter-template-harness-consumption"
|
|
208
|
+
],
|
|
176
209
|
ownerKind: "lane",
|
|
177
210
|
allowedOperations: ["generate-in-later-lane", "validate"],
|
|
178
211
|
trustClassification: "package-manifest",
|
|
@@ -190,7 +223,11 @@ var GENERATED_FILE_FAMILY_CONTRACTS = {
|
|
|
190
223
|
"context-files": {
|
|
191
224
|
pathPatterns: ["AGENTS.md", "CLAUDE.md"],
|
|
192
225
|
producerLane: "I-15A-create-import-cli-ux-selected-harness",
|
|
193
|
-
consumedByLanes: [
|
|
226
|
+
consumedByLanes: [
|
|
227
|
+
"I-15A-create-import-cli-ux-selected-harness",
|
|
228
|
+
"I-08-context-graph-index-drift",
|
|
229
|
+
"I-21-build-skill-orchestration"
|
|
230
|
+
],
|
|
194
231
|
ownerKind: "lane",
|
|
195
232
|
allowedOperations: ["generate-in-later-lane", "validate"],
|
|
196
233
|
trustClassification: "project-instruction",
|
|
@@ -206,9 +243,17 @@ var GENERATED_FILE_FAMILY_CONTRACTS = {
|
|
|
206
243
|
readinessState: "ready"
|
|
207
244
|
},
|
|
208
245
|
"harness-config": {
|
|
209
|
-
pathPatterns: [
|
|
246
|
+
pathPatterns: [
|
|
247
|
+
"generated harness config field: agenticHarness=pi",
|
|
248
|
+
"generated harness config field: adapterCapabilityVersion",
|
|
249
|
+
"generated harness config field: generatedFileManifestVersion"
|
|
250
|
+
],
|
|
210
251
|
producerLane: "I-15A-create-import-cli-ux-selected-harness",
|
|
211
|
-
consumedByLanes: [
|
|
252
|
+
consumedByLanes: [
|
|
253
|
+
"I-15A-create-import-cli-ux-selected-harness",
|
|
254
|
+
"I-15B-starter-template-harness-consumption",
|
|
255
|
+
"I-21-build-skill-orchestration"
|
|
256
|
+
],
|
|
212
257
|
ownerKind: "lane",
|
|
213
258
|
allowedOperations: ["generate-in-later-lane", "validate"],
|
|
214
259
|
trustClassification: "configuration",
|
|
@@ -233,7 +278,12 @@ var validateEvidenceRecord = (value, path, issues) => {
|
|
|
233
278
|
checkString(value.notes, `${path}.notes`, issues);
|
|
234
279
|
};
|
|
235
280
|
var validateCapabilitySurface = (value, path, issues) => {
|
|
236
|
-
if (!checkExactObject(
|
|
281
|
+
if (!checkExactObject(
|
|
282
|
+
value,
|
|
283
|
+
path,
|
|
284
|
+
["evidence", "support", "details", "downstreamConsequence"],
|
|
285
|
+
issues
|
|
286
|
+
)) {
|
|
237
287
|
return;
|
|
238
288
|
}
|
|
239
289
|
validateEvidenceRecord(value.evidence, `${path}.evidence`, issues);
|
|
@@ -242,7 +292,18 @@ var validateCapabilitySurface = (value, path, issues) => {
|
|
|
242
292
|
checkString(value.downstreamConsequence, `${path}.downstreamConsequence`, issues);
|
|
243
293
|
};
|
|
244
294
|
var validateVersionCompatibility = (value, path, issues) => {
|
|
245
|
-
if (!checkExactObject(
|
|
295
|
+
if (!checkExactObject(
|
|
296
|
+
value,
|
|
297
|
+
path,
|
|
298
|
+
[
|
|
299
|
+
"harnessName",
|
|
300
|
+
"harnessVersionRange",
|
|
301
|
+
"resourceFormatVersion",
|
|
302
|
+
"runtimeRequirements",
|
|
303
|
+
"compatibilityEvidence"
|
|
304
|
+
],
|
|
305
|
+
issues
|
|
306
|
+
)) {
|
|
246
307
|
return;
|
|
247
308
|
}
|
|
248
309
|
checkString(value.harnessName, `${path}.harnessName`, issues);
|
|
@@ -252,7 +313,12 @@ var validateVersionCompatibility = (value, path, issues) => {
|
|
|
252
313
|
validateEvidenceRecord(value.compatibilityEvidence, `${path}.compatibilityEvidence`, issues);
|
|
253
314
|
};
|
|
254
315
|
var validateSkillCapability = (value, path, issues) => {
|
|
255
|
-
if (!checkExactObject(
|
|
316
|
+
if (!checkExactObject(
|
|
317
|
+
value,
|
|
318
|
+
path,
|
|
319
|
+
["skillId", "nativeCommand", "resourceFamily", "evidence", "readiness", "protocolSource"],
|
|
320
|
+
issues
|
|
321
|
+
)) {
|
|
256
322
|
return;
|
|
257
323
|
}
|
|
258
324
|
checkLiteral(value.skillId, SKILL_IDS, `${path}.skillId`, issues);
|
|
@@ -263,7 +329,20 @@ var validateSkillCapability = (value, path, issues) => {
|
|
|
263
329
|
checkString(value.protocolSource, `${path}.protocolSource`, issues);
|
|
264
330
|
};
|
|
265
331
|
var validateSkillsCommandsSurface = (value, path, issues) => {
|
|
266
|
-
if (!checkExactObject(
|
|
332
|
+
if (!checkExactObject(
|
|
333
|
+
value,
|
|
334
|
+
path,
|
|
335
|
+
[
|
|
336
|
+
"evidence",
|
|
337
|
+
"support",
|
|
338
|
+
"details",
|
|
339
|
+
"downstreamConsequence",
|
|
340
|
+
"nativeFormat",
|
|
341
|
+
"autoloadDiscovery",
|
|
342
|
+
"skills"
|
|
343
|
+
],
|
|
344
|
+
issues
|
|
345
|
+
)) {
|
|
267
346
|
return;
|
|
268
347
|
}
|
|
269
348
|
validateEvidenceRecord(value.evidence, `${path}.evidence`, issues);
|
|
@@ -279,18 +358,40 @@ var validateSkillsCommandsSurface = (value, path, issues) => {
|
|
|
279
358
|
}
|
|
280
359
|
};
|
|
281
360
|
var validateSubagentOrPlanCapability = (value, path, issues) => {
|
|
282
|
-
if (!checkExactObject(
|
|
361
|
+
if (!checkExactObject(
|
|
362
|
+
value,
|
|
363
|
+
path,
|
|
364
|
+
[
|
|
365
|
+
"evidence",
|
|
366
|
+
"support",
|
|
367
|
+
"details",
|
|
368
|
+
"downstreamConsequence",
|
|
369
|
+
"implementationKind",
|
|
370
|
+
"requiresGeneratedExtension"
|
|
371
|
+
],
|
|
372
|
+
issues
|
|
373
|
+
)) {
|
|
283
374
|
return;
|
|
284
375
|
}
|
|
285
376
|
validateEvidenceRecord(value.evidence, `${path}.evidence`, issues);
|
|
286
377
|
checkLiteral(value.support, READINESS_STATES, `${path}.support`, issues);
|
|
287
378
|
checkString(value.details, `${path}.details`, issues);
|
|
288
379
|
checkString(value.downstreamConsequence, `${path}.downstreamConsequence`, issues);
|
|
289
|
-
checkLiteral(
|
|
380
|
+
checkLiteral(
|
|
381
|
+
value.implementationKind,
|
|
382
|
+
["built-in", "extension-built", "external", "unsupported"],
|
|
383
|
+
`${path}.implementationKind`,
|
|
384
|
+
issues
|
|
385
|
+
);
|
|
290
386
|
checkBoolean(value.requiresGeneratedExtension, `${path}.requiresGeneratedExtension`, issues);
|
|
291
387
|
};
|
|
292
388
|
var validateCommandInvocationModel = (value, path, issues) => {
|
|
293
|
-
if (!checkExactObject(
|
|
389
|
+
if (!checkExactObject(
|
|
390
|
+
value,
|
|
391
|
+
path,
|
|
392
|
+
["interactive", "printMode", "jsonMode", "rpcMode", "sdk", "shellCommandPolicy"],
|
|
393
|
+
issues
|
|
394
|
+
)) {
|
|
294
395
|
return;
|
|
295
396
|
}
|
|
296
397
|
validateCapabilitySurface(value.interactive, `${path}.interactive`, issues);
|
|
@@ -298,23 +399,50 @@ var validateCommandInvocationModel = (value, path, issues) => {
|
|
|
298
399
|
validateCapabilitySurface(value.jsonMode, `${path}.jsonMode`, issues);
|
|
299
400
|
validateCapabilitySurface(value.rpcMode, `${path}.rpcMode`, issues);
|
|
300
401
|
validateCapabilitySurface(value.sdk, `${path}.sdk`, issues);
|
|
301
|
-
checkLiteral(
|
|
402
|
+
checkLiteral(
|
|
403
|
+
value.shellCommandPolicy,
|
|
404
|
+
["not-required", "default-deny", "blocked"],
|
|
405
|
+
`${path}.shellCommandPolicy`,
|
|
406
|
+
issues
|
|
407
|
+
);
|
|
302
408
|
};
|
|
303
409
|
var validateGeneratedFilesCapability = (value, path, issues) => {
|
|
304
|
-
if (!checkExactObject(
|
|
410
|
+
if (!checkExactObject(
|
|
411
|
+
value,
|
|
412
|
+
path,
|
|
413
|
+
["evidence", "manifestSchemaVersion", "families", "downstreamConsequence"],
|
|
414
|
+
issues
|
|
415
|
+
)) {
|
|
305
416
|
return;
|
|
306
417
|
}
|
|
307
418
|
validateEvidenceRecord(value.evidence, `${path}.evidence`, issues);
|
|
308
419
|
checkString(value.manifestSchemaVersion, `${path}.manifestSchemaVersion`, issues);
|
|
309
420
|
if (checkArray(value.families, `${path}.families`, issues)) {
|
|
310
421
|
for (let index = 0; index < value.families.length; index += 1) {
|
|
311
|
-
checkLiteral(
|
|
422
|
+
checkLiteral(
|
|
423
|
+
value.families[index],
|
|
424
|
+
GENERATED_FILE_FAMILY_IDS,
|
|
425
|
+
`${path}.families[${index}]`,
|
|
426
|
+
issues
|
|
427
|
+
);
|
|
312
428
|
}
|
|
313
429
|
}
|
|
314
430
|
checkString(value.downstreamConsequence, `${path}.downstreamConsequence`, issues);
|
|
315
431
|
};
|
|
316
432
|
var validatePackageDistributionCapability = (value, path, issues) => {
|
|
317
|
-
if (!checkExactObject(
|
|
433
|
+
if (!checkExactObject(
|
|
434
|
+
value,
|
|
435
|
+
path,
|
|
436
|
+
[
|
|
437
|
+
"evidence",
|
|
438
|
+
"support",
|
|
439
|
+
"details",
|
|
440
|
+
"downstreamConsequence",
|
|
441
|
+
"distributionKinds",
|
|
442
|
+
"trustUpdatePolicy"
|
|
443
|
+
],
|
|
444
|
+
issues
|
|
445
|
+
)) {
|
|
318
446
|
return;
|
|
319
447
|
}
|
|
320
448
|
validateEvidenceRecord(value.evidence, `${path}.evidence`, issues);
|
|
@@ -323,48 +451,162 @@ var validatePackageDistributionCapability = (value, path, issues) => {
|
|
|
323
451
|
checkString(value.downstreamConsequence, `${path}.downstreamConsequence`, issues);
|
|
324
452
|
if (checkArray(value.distributionKinds, `${path}.distributionKinds`, issues)) {
|
|
325
453
|
for (let index = 0; index < value.distributionKinds.length; index += 1) {
|
|
326
|
-
checkLiteral(
|
|
454
|
+
checkLiteral(
|
|
455
|
+
value.distributionKinds[index],
|
|
456
|
+
["project-local-files", "pi-package", "npm-package", "global-install"],
|
|
457
|
+
`${path}.distributionKinds[${index}]`,
|
|
458
|
+
issues
|
|
459
|
+
);
|
|
327
460
|
}
|
|
328
461
|
}
|
|
329
462
|
checkString(value.trustUpdatePolicy, `${path}.trustUpdatePolicy`, issues);
|
|
330
463
|
};
|
|
331
464
|
var validateSecurityTrustCapability = (value, path, issues) => {
|
|
332
|
-
if (!checkExactObject(
|
|
465
|
+
if (!checkExactObject(
|
|
466
|
+
value,
|
|
467
|
+
path,
|
|
468
|
+
[
|
|
469
|
+
"evidence",
|
|
470
|
+
"projectTrustRequired",
|
|
471
|
+
"extensionExecution",
|
|
472
|
+
"commandPolicy",
|
|
473
|
+
"sandboxCapability",
|
|
474
|
+
"credentialPolicy",
|
|
475
|
+
"destructiveOperations",
|
|
476
|
+
"externalIntegration",
|
|
477
|
+
"trustBoundary"
|
|
478
|
+
],
|
|
479
|
+
issues
|
|
480
|
+
)) {
|
|
333
481
|
return;
|
|
334
482
|
}
|
|
335
483
|
validateEvidenceRecord(value.evidence, `${path}.evidence`, issues);
|
|
336
484
|
checkBoolean(value.projectTrustRequired, `${path}.projectTrustRequired`, issues);
|
|
337
|
-
checkLiteral(
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
485
|
+
checkLiteral(
|
|
486
|
+
value.extensionExecution,
|
|
487
|
+
["none", "typescript-extension", "package-extension"],
|
|
488
|
+
`${path}.extensionExecution`,
|
|
489
|
+
issues
|
|
490
|
+
);
|
|
491
|
+
checkLiteral(
|
|
492
|
+
value.commandPolicy,
|
|
493
|
+
["default-deny", "not-applicable"],
|
|
494
|
+
`${path}.commandPolicy`,
|
|
495
|
+
issues
|
|
496
|
+
);
|
|
497
|
+
checkLiteral(
|
|
498
|
+
value.sandboxCapability,
|
|
499
|
+
SANDBOX_CAPABILITY_STATES,
|
|
500
|
+
`${path}.sandboxCapability`,
|
|
501
|
+
issues
|
|
502
|
+
);
|
|
503
|
+
checkLiteral(
|
|
504
|
+
value.credentialPolicy,
|
|
505
|
+
["no-credentials-required", "operator-supplied-only", "unknown-blocked"],
|
|
506
|
+
`${path}.credentialPolicy`,
|
|
507
|
+
issues
|
|
508
|
+
);
|
|
509
|
+
checkLiteral(
|
|
510
|
+
value.destructiveOperations,
|
|
511
|
+
["forbidden", "approval-required", "not-applicable"],
|
|
512
|
+
`${path}.destructiveOperations`,
|
|
513
|
+
issues
|
|
514
|
+
);
|
|
515
|
+
checkLiteral(
|
|
516
|
+
value.externalIntegration,
|
|
517
|
+
["disabled-by-default", "read-only", "unknown-blocked"],
|
|
518
|
+
`${path}.externalIntegration`,
|
|
519
|
+
issues
|
|
520
|
+
);
|
|
343
521
|
checkString(value.trustBoundary, `${path}.trustBoundary`, issues);
|
|
344
522
|
};
|
|
345
523
|
var validateCapabilityFlags = (value, path, issues) => {
|
|
346
|
-
if (!checkExactObject(
|
|
524
|
+
if (!checkExactObject(
|
|
525
|
+
value,
|
|
526
|
+
path,
|
|
527
|
+
[
|
|
528
|
+
"skills",
|
|
529
|
+
"prompts",
|
|
530
|
+
"hooks",
|
|
531
|
+
"extensions",
|
|
532
|
+
"subagents",
|
|
533
|
+
"planMode",
|
|
534
|
+
"contextFiles",
|
|
535
|
+
"rpc",
|
|
536
|
+
"sdk",
|
|
537
|
+
"jsonMode",
|
|
538
|
+
"packages",
|
|
539
|
+
"ui",
|
|
540
|
+
"unsupportedFeaturePolicy"
|
|
541
|
+
],
|
|
542
|
+
issues
|
|
543
|
+
)) {
|
|
347
544
|
return;
|
|
348
545
|
}
|
|
349
|
-
for (const key of [
|
|
546
|
+
for (const key of [
|
|
547
|
+
"skills",
|
|
548
|
+
"prompts",
|
|
549
|
+
"hooks",
|
|
550
|
+
"extensions",
|
|
551
|
+
"subagents",
|
|
552
|
+
"planMode",
|
|
553
|
+
"contextFiles",
|
|
554
|
+
"rpc",
|
|
555
|
+
"sdk",
|
|
556
|
+
"jsonMode",
|
|
557
|
+
"packages",
|
|
558
|
+
"ui"
|
|
559
|
+
]) {
|
|
350
560
|
checkBoolean(value[key], `${path}.${key}`, issues);
|
|
351
561
|
}
|
|
352
|
-
checkLiteral(
|
|
562
|
+
checkLiteral(
|
|
563
|
+
value.unsupportedFeaturePolicy,
|
|
564
|
+
["block", "defer", "unknown-block"],
|
|
565
|
+
`${path}.unsupportedFeaturePolicy`,
|
|
566
|
+
issues
|
|
567
|
+
);
|
|
353
568
|
};
|
|
354
569
|
var validateRealBoundaryWitness = (value, path, issues) => {
|
|
355
|
-
if (!checkExactObject(
|
|
570
|
+
if (!checkExactObject(
|
|
571
|
+
value,
|
|
572
|
+
path,
|
|
573
|
+
[
|
|
574
|
+
"evidence",
|
|
575
|
+
"boundaryStatus",
|
|
576
|
+
"producer",
|
|
577
|
+
"carrier",
|
|
578
|
+
"consumer",
|
|
579
|
+
"evidencePath",
|
|
580
|
+
"runtimeExecutionClaim"
|
|
581
|
+
],
|
|
582
|
+
issues
|
|
583
|
+
)) {
|
|
356
584
|
return;
|
|
357
585
|
}
|
|
358
586
|
validateEvidenceRecord(value.evidence, `${path}.evidence`, issues);
|
|
359
|
-
checkLiteral(
|
|
587
|
+
checkLiteral(
|
|
588
|
+
value.boundaryStatus,
|
|
589
|
+
["implemented", "pending-live", "blocked", "deferred", "unknown"],
|
|
590
|
+
`${path}.boundaryStatus`,
|
|
591
|
+
issues
|
|
592
|
+
);
|
|
360
593
|
checkString(value.producer, `${path}.producer`, issues);
|
|
361
594
|
checkString(value.carrier, `${path}.carrier`, issues);
|
|
362
595
|
checkString(value.consumer, `${path}.consumer`, issues);
|
|
363
596
|
checkString(value.evidencePath, `${path}.evidencePath`, issues);
|
|
364
|
-
validateI14ARuntimeExecutionClaim(
|
|
597
|
+
validateI14ARuntimeExecutionClaim(
|
|
598
|
+
value.runtimeExecutionClaim,
|
|
599
|
+
`${path}.runtimeExecutionClaim`,
|
|
600
|
+
issues
|
|
601
|
+
);
|
|
365
602
|
};
|
|
366
603
|
var validateSelection = (value, path, issues) => {
|
|
367
|
-
if (!checkExactObject(
|
|
604
|
+
if (!checkExactObject(
|
|
605
|
+
value,
|
|
606
|
+
path,
|
|
607
|
+
["manifestSelectable", "createImportSelectable", "readiness", "reason"],
|
|
608
|
+
issues
|
|
609
|
+
)) {
|
|
368
610
|
return;
|
|
369
611
|
}
|
|
370
612
|
checkBoolean(value.manifestSelectable, `${path}.manifestSelectable`, issues);
|
|
@@ -373,47 +615,69 @@ var validateSelection = (value, path, issues) => {
|
|
|
373
615
|
checkString(value.reason, `${path}.reason`, issues);
|
|
374
616
|
};
|
|
375
617
|
var validateAdapterCapability = (value, path, issues) => {
|
|
376
|
-
if (!checkExactObject(
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
618
|
+
if (!checkExactObject(
|
|
619
|
+
value,
|
|
620
|
+
path,
|
|
621
|
+
[
|
|
622
|
+
"adapterId",
|
|
623
|
+
"displayName",
|
|
624
|
+
"evidenceStatus",
|
|
625
|
+
"versionCompatibility",
|
|
626
|
+
"skillsCommandsSurface",
|
|
627
|
+
"promptTemplateSurface",
|
|
628
|
+
"hookEventSupport",
|
|
629
|
+
"subagentCapability",
|
|
630
|
+
"planModeCapability",
|
|
631
|
+
"contextFileConventions",
|
|
632
|
+
"commandInvocationModel",
|
|
633
|
+
"generatedFiles",
|
|
634
|
+
"packageDistribution",
|
|
635
|
+
"securityTrust",
|
|
636
|
+
"capabilityFlags",
|
|
637
|
+
"realBoundaryWitness",
|
|
638
|
+
"selection"
|
|
639
|
+
],
|
|
640
|
+
issues
|
|
641
|
+
)) {
|
|
395
642
|
return;
|
|
396
643
|
}
|
|
397
644
|
checkString(value.adapterId, `${path}.adapterId`, issues);
|
|
398
645
|
checkString(value.displayName, `${path}.displayName`, issues);
|
|
399
646
|
validateEvidenceRecord(value.evidenceStatus, `${path}.evidenceStatus`, issues);
|
|
400
647
|
validateVersionCompatibility(value.versionCompatibility, `${path}.versionCompatibility`, issues);
|
|
401
|
-
validateSkillsCommandsSurface(
|
|
648
|
+
validateSkillsCommandsSurface(
|
|
649
|
+
value.skillsCommandsSurface,
|
|
650
|
+
`${path}.skillsCommandsSurface`,
|
|
651
|
+
issues
|
|
652
|
+
);
|
|
402
653
|
validateCapabilitySurface(value.promptTemplateSurface, `${path}.promptTemplateSurface`, issues);
|
|
403
654
|
validateCapabilitySurface(value.hookEventSupport, `${path}.hookEventSupport`, issues);
|
|
404
655
|
validateSubagentOrPlanCapability(value.subagentCapability, `${path}.subagentCapability`, issues);
|
|
405
656
|
validateSubagentOrPlanCapability(value.planModeCapability, `${path}.planModeCapability`, issues);
|
|
406
657
|
validateCapabilitySurface(value.contextFileConventions, `${path}.contextFileConventions`, issues);
|
|
407
|
-
validateCommandInvocationModel(
|
|
658
|
+
validateCommandInvocationModel(
|
|
659
|
+
value.commandInvocationModel,
|
|
660
|
+
`${path}.commandInvocationModel`,
|
|
661
|
+
issues
|
|
662
|
+
);
|
|
408
663
|
validateGeneratedFilesCapability(value.generatedFiles, `${path}.generatedFiles`, issues);
|
|
409
|
-
validatePackageDistributionCapability(
|
|
664
|
+
validatePackageDistributionCapability(
|
|
665
|
+
value.packageDistribution,
|
|
666
|
+
`${path}.packageDistribution`,
|
|
667
|
+
issues
|
|
668
|
+
);
|
|
410
669
|
validateSecurityTrustCapability(value.securityTrust, `${path}.securityTrust`, issues);
|
|
411
670
|
validateCapabilityFlags(value.capabilityFlags, `${path}.capabilityFlags`, issues);
|
|
412
671
|
validateRealBoundaryWitness(value.realBoundaryWitness, `${path}.realBoundaryWitness`, issues);
|
|
413
672
|
validateSelection(value.selection, `${path}.selection`, issues);
|
|
414
673
|
};
|
|
415
674
|
var validateGeneratedFileOwner = (value, path, issues) => {
|
|
416
|
-
if (!checkExactObject(
|
|
675
|
+
if (!checkExactObject(
|
|
676
|
+
value,
|
|
677
|
+
path,
|
|
678
|
+
["ownerKind", "ownerId", "writePathScope", "allowedOperations"],
|
|
679
|
+
issues
|
|
680
|
+
)) {
|
|
417
681
|
return;
|
|
418
682
|
}
|
|
419
683
|
checkLiteral(value.ownerKind, ["lane", "package"], `${path}.ownerKind`, issues);
|
|
@@ -421,33 +685,99 @@ var validateGeneratedFileOwner = (value, path, issues) => {
|
|
|
421
685
|
checkStringArray(value.writePathScope, `${path}.writePathScope`, issues, true);
|
|
422
686
|
if (checkArray(value.allowedOperations, `${path}.allowedOperations`, issues)) {
|
|
423
687
|
for (let index = 0; index < value.allowedOperations.length; index += 1) {
|
|
424
|
-
checkLiteral(
|
|
688
|
+
checkLiteral(
|
|
689
|
+
value.allowedOperations[index],
|
|
690
|
+
["declare", "validate", "generate-in-later-lane"],
|
|
691
|
+
`${path}.allowedOperations[${index}]`,
|
|
692
|
+
issues
|
|
693
|
+
);
|
|
425
694
|
}
|
|
426
695
|
}
|
|
427
696
|
};
|
|
428
697
|
var validateGeneratedFileTrustSecurity = (value, path, issues) => {
|
|
429
|
-
if (!checkExactObject(
|
|
698
|
+
if (!checkExactObject(
|
|
699
|
+
value,
|
|
700
|
+
path,
|
|
701
|
+
[
|
|
702
|
+
"classification",
|
|
703
|
+
"trustBoundary",
|
|
704
|
+
"projectTrustRequired",
|
|
705
|
+
"executesCode",
|
|
706
|
+
"commandPolicy",
|
|
707
|
+
"sandboxCapability",
|
|
708
|
+
"credentialPolicy",
|
|
709
|
+
"externalIntegration",
|
|
710
|
+
"destructiveOperationPolicy",
|
|
711
|
+
"evidence"
|
|
712
|
+
],
|
|
713
|
+
issues
|
|
714
|
+
)) {
|
|
430
715
|
return;
|
|
431
716
|
}
|
|
432
|
-
checkLiteral(
|
|
717
|
+
checkLiteral(
|
|
718
|
+
value.classification,
|
|
719
|
+
["project-instruction", "executable-extension", "package-manifest", "configuration"],
|
|
720
|
+
`${path}.classification`,
|
|
721
|
+
issues
|
|
722
|
+
);
|
|
433
723
|
checkString(value.trustBoundary, `${path}.trustBoundary`, issues);
|
|
434
724
|
checkBoolean(value.projectTrustRequired, `${path}.projectTrustRequired`, issues);
|
|
435
725
|
checkBoolean(value.executesCode, `${path}.executesCode`, issues);
|
|
436
|
-
checkLiteral(
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
726
|
+
checkLiteral(
|
|
727
|
+
value.commandPolicy,
|
|
728
|
+
["default-deny", "not-applicable"],
|
|
729
|
+
`${path}.commandPolicy`,
|
|
730
|
+
issues
|
|
731
|
+
);
|
|
732
|
+
checkLiteral(
|
|
733
|
+
value.sandboxCapability,
|
|
734
|
+
SANDBOX_CAPABILITY_STATES,
|
|
735
|
+
`${path}.sandboxCapability`,
|
|
736
|
+
issues
|
|
737
|
+
);
|
|
738
|
+
checkLiteral(
|
|
739
|
+
value.credentialPolicy,
|
|
740
|
+
["no-credentials-required", "operator-supplied-only", "unknown-blocked"],
|
|
741
|
+
`${path}.credentialPolicy`,
|
|
742
|
+
issues
|
|
743
|
+
);
|
|
744
|
+
checkLiteral(
|
|
745
|
+
value.externalIntegration,
|
|
746
|
+
["disabled-by-default", "read-only", "unknown-blocked"],
|
|
747
|
+
`${path}.externalIntegration`,
|
|
748
|
+
issues
|
|
749
|
+
);
|
|
750
|
+
checkLiteral(
|
|
751
|
+
value.destructiveOperationPolicy,
|
|
752
|
+
["forbidden", "approval-required", "not-applicable"],
|
|
753
|
+
`${path}.destructiveOperationPolicy`,
|
|
754
|
+
issues
|
|
755
|
+
);
|
|
441
756
|
validateEvidenceRecord(value.evidence, `${path}.evidence`, issues);
|
|
442
757
|
};
|
|
443
758
|
var validateGeneratedFileVersion = (value, path, issues) => {
|
|
444
|
-
if (!checkExactObject(
|
|
759
|
+
if (!checkExactObject(
|
|
760
|
+
value,
|
|
761
|
+
path,
|
|
762
|
+
["formatName", "formatVersion", "schemaVersion", "adapterCapabilityVersion"],
|
|
763
|
+
issues
|
|
764
|
+
)) {
|
|
445
765
|
return;
|
|
446
766
|
}
|
|
447
767
|
checkString(value.formatName, `${path}.formatName`, issues);
|
|
448
768
|
checkString(value.formatVersion, `${path}.formatVersion`, issues);
|
|
449
|
-
checkLiteral(
|
|
450
|
-
|
|
769
|
+
checkLiteral(
|
|
770
|
+
value.schemaVersion,
|
|
771
|
+
["pi-generated-file-manifest/v1"],
|
|
772
|
+
`${path}.schemaVersion`,
|
|
773
|
+
issues
|
|
774
|
+
);
|
|
775
|
+
checkLiteral(
|
|
776
|
+
value.adapterCapabilityVersion,
|
|
777
|
+
["pi-adapter-capability-matrix/v1"],
|
|
778
|
+
`${path}.adapterCapabilityVersion`,
|
|
779
|
+
issues
|
|
780
|
+
);
|
|
451
781
|
};
|
|
452
782
|
var validateGeneratedFileReadiness = (value, path, issues) => {
|
|
453
783
|
if (!checkExactObject(value, path, ["state", "reason"], issues)) {
|
|
@@ -457,20 +787,45 @@ var validateGeneratedFileReadiness = (value, path, issues) => {
|
|
|
457
787
|
checkString(value.reason, `${path}.reason`, issues);
|
|
458
788
|
};
|
|
459
789
|
var validateGeneratedFileFamily = (value, path, issues) => {
|
|
460
|
-
if (!checkExactObject(
|
|
790
|
+
if (!checkExactObject(
|
|
791
|
+
value,
|
|
792
|
+
path,
|
|
793
|
+
[
|
|
794
|
+
"familyId",
|
|
795
|
+
"description",
|
|
796
|
+
"pathPatterns",
|
|
797
|
+
"owner",
|
|
798
|
+
"producedByLane",
|
|
799
|
+
"consumedByLanes",
|
|
800
|
+
"trustSecurity",
|
|
801
|
+
"version",
|
|
802
|
+
"readiness"
|
|
803
|
+
],
|
|
804
|
+
issues
|
|
805
|
+
)) {
|
|
461
806
|
return;
|
|
462
807
|
}
|
|
463
808
|
checkLiteral(value.familyId, GENERATED_FILE_FAMILY_IDS, `${path}.familyId`, issues);
|
|
464
809
|
checkString(value.description, `${path}.description`, issues);
|
|
465
810
|
checkStringArray(value.pathPatterns, `${path}.pathPatterns`, issues, true);
|
|
466
811
|
validateGeneratedFileOwner(value.owner, `${path}.owner`, issues);
|
|
467
|
-
checkLiteral(
|
|
812
|
+
checkLiteral(
|
|
813
|
+
value.producedByLane,
|
|
814
|
+
GENERATED_FILE_PRODUCER_LANE_IDS,
|
|
815
|
+
`${path}.producedByLane`,
|
|
816
|
+
issues
|
|
817
|
+
);
|
|
468
818
|
if (checkArray(value.consumedByLanes, `${path}.consumedByLanes`, issues)) {
|
|
469
819
|
if (value.consumedByLanes.length === 0) {
|
|
470
820
|
addIssue(issues, `${path}.consumedByLanes`, "empty_array", "Array must not be empty.");
|
|
471
821
|
}
|
|
472
822
|
for (let index = 0; index < value.consumedByLanes.length; index += 1) {
|
|
473
|
-
checkLiteral(
|
|
823
|
+
checkLiteral(
|
|
824
|
+
value.consumedByLanes[index],
|
|
825
|
+
GENERATED_FILE_CONSUMER_LANE_IDS,
|
|
826
|
+
`${path}.consumedByLanes[${index}]`,
|
|
827
|
+
issues
|
|
828
|
+
);
|
|
474
829
|
}
|
|
475
830
|
}
|
|
476
831
|
validateGeneratedFileTrustSecurity(value.trustSecurity, `${path}.trustSecurity`, issues);
|
|
@@ -496,28 +851,50 @@ var getRecordArray = (value) => {
|
|
|
496
851
|
};
|
|
497
852
|
var validateCapabilityMatrix = (value) => {
|
|
498
853
|
const issues = [];
|
|
499
|
-
if (!checkExactObject(
|
|
854
|
+
if (!checkExactObject(
|
|
855
|
+
value,
|
|
856
|
+
"$",
|
|
857
|
+
["schemaVersion", "producedByLane", "adapterPackage", "adapters"],
|
|
858
|
+
issues
|
|
859
|
+
)) {
|
|
500
860
|
return { valid: false, issues };
|
|
501
861
|
}
|
|
502
862
|
checkLiteral(value.schemaVersion, ["pi-adapter-capability-matrix/v1"], "$.schemaVersion", issues);
|
|
503
|
-
checkLiteral(
|
|
863
|
+
checkLiteral(
|
|
864
|
+
value.producedByLane,
|
|
865
|
+
["I-14A-pi-adapter-capability-generated-file-manifest"],
|
|
866
|
+
"$.producedByLane",
|
|
867
|
+
issues
|
|
868
|
+
);
|
|
504
869
|
checkLiteral(value.adapterPackage, ["@vibe-engineer/adapter-pi"], "$.adapterPackage", issues);
|
|
505
870
|
if (checkArray(value.adapters, "$.adapters", issues)) {
|
|
506
871
|
if (value.adapters.length === 0) {
|
|
507
|
-
addIssue(
|
|
872
|
+
addIssue(
|
|
873
|
+
issues,
|
|
874
|
+
"$.adapters",
|
|
875
|
+
"empty_adapters",
|
|
876
|
+
"Capability matrix must contain adapter rows."
|
|
877
|
+
);
|
|
508
878
|
}
|
|
509
879
|
for (let index = 0; index < value.adapters.length; index += 1) {
|
|
510
880
|
validateAdapterCapability(value.adapters[index], `$.adapters[${index}]`, issues);
|
|
511
881
|
}
|
|
512
882
|
}
|
|
513
883
|
const adapters = getRecordArray(value.adapters);
|
|
514
|
-
const ids = adapters.map(
|
|
884
|
+
const ids = adapters.map(
|
|
885
|
+
(adapter) => typeof adapter.adapterId === "string" ? adapter.adapterId : ""
|
|
886
|
+
);
|
|
515
887
|
for (const duplicate of collectDuplicateStrings(ids.filter((id) => id.length > 0))) {
|
|
516
888
|
addIssue(issues, "$.adapters", "duplicate_adapter_id", `Duplicate adapter id '${duplicate}'.`);
|
|
517
889
|
}
|
|
518
890
|
const piAdapter = adapters.find((adapter) => adapter.adapterId === "pi");
|
|
519
891
|
if (piAdapter === void 0) {
|
|
520
|
-
addIssue(
|
|
892
|
+
addIssue(
|
|
893
|
+
issues,
|
|
894
|
+
"$.adapters",
|
|
895
|
+
"missing_pi_adapter",
|
|
896
|
+
"Capability matrix must include stable adapter id 'pi'."
|
|
897
|
+
);
|
|
521
898
|
}
|
|
522
899
|
for (const [index, adapter] of adapters.entries()) {
|
|
523
900
|
const adapterPath = `$.adapters[${index}]`;
|
|
@@ -527,50 +904,125 @@ var validateCapabilityMatrix = (value) => {
|
|
|
527
904
|
const skillsSurface = isRecord(adapter.skillsCommandsSurface) ? adapter.skillsCommandsSurface : void 0;
|
|
528
905
|
const adapterId = typeof adapter.adapterId === "string" ? adapter.adapterId : "";
|
|
529
906
|
if (flags?.unsupportedFeaturePolicy !== "block") {
|
|
530
|
-
addIssue(
|
|
907
|
+
addIssue(
|
|
908
|
+
issues,
|
|
909
|
+
`${adapterPath}.capabilityFlags.unsupportedFeaturePolicy`,
|
|
910
|
+
"unsupported_feature_policy_not_blocking",
|
|
911
|
+
"Unsupported features must block instead of silently no-oping."
|
|
912
|
+
);
|
|
531
913
|
}
|
|
532
914
|
if (adapterId !== "pi") {
|
|
533
915
|
if (selection?.manifestSelectable === true || selection?.createImportSelectable === true || selection?.readiness === "ready") {
|
|
534
|
-
addIssue(
|
|
916
|
+
addIssue(
|
|
917
|
+
issues,
|
|
918
|
+
`${adapterPath}.selection`,
|
|
919
|
+
"non_pi_selectable",
|
|
920
|
+
"Non-pi adapter rows must never be selectable or ready."
|
|
921
|
+
);
|
|
535
922
|
}
|
|
536
923
|
if (evidenceStatus?.state === "known") {
|
|
537
|
-
addIssue(
|
|
924
|
+
addIssue(
|
|
925
|
+
issues,
|
|
926
|
+
`${adapterPath}.evidenceStatus.state`,
|
|
927
|
+
"non_pi_known_claim",
|
|
928
|
+
"Non-pi adapter rows must remain explicit unknown/deferred/blocked until future evidence-backed decisions."
|
|
929
|
+
);
|
|
538
930
|
}
|
|
539
|
-
for (const flagKey of [
|
|
931
|
+
for (const flagKey of [
|
|
932
|
+
"skills",
|
|
933
|
+
"prompts",
|
|
934
|
+
"hooks",
|
|
935
|
+
"extensions",
|
|
936
|
+
"subagents",
|
|
937
|
+
"planMode",
|
|
938
|
+
"contextFiles",
|
|
939
|
+
"rpc",
|
|
940
|
+
"sdk",
|
|
941
|
+
"jsonMode",
|
|
942
|
+
"packages",
|
|
943
|
+
"ui"
|
|
944
|
+
]) {
|
|
540
945
|
if (flags?.[flagKey] === true) {
|
|
541
|
-
addIssue(
|
|
946
|
+
addIssue(
|
|
947
|
+
issues,
|
|
948
|
+
`${adapterPath}.capabilityFlags.${flagKey}`,
|
|
949
|
+
"non_pi_enabled_flag",
|
|
950
|
+
"Non-pi capability flags cannot be enabled in v1."
|
|
951
|
+
);
|
|
542
952
|
}
|
|
543
953
|
}
|
|
544
954
|
}
|
|
545
955
|
if (adapterId === "pi") {
|
|
546
956
|
if (selection?.manifestSelectable !== true) {
|
|
547
|
-
addIssue(
|
|
957
|
+
addIssue(
|
|
958
|
+
issues,
|
|
959
|
+
`${adapterPath}.selection.manifestSelectable`,
|
|
960
|
+
"pi_manifest_not_selectable",
|
|
961
|
+
"The pi manifest contract must be selectable for downstream manifest consumers."
|
|
962
|
+
);
|
|
548
963
|
}
|
|
549
964
|
if (selection?.createImportSelectable !== false) {
|
|
550
|
-
addIssue(
|
|
965
|
+
addIssue(
|
|
966
|
+
issues,
|
|
967
|
+
`${adapterPath}.selection.createImportSelectable`,
|
|
968
|
+
"create_import_claim_out_of_scope",
|
|
969
|
+
"I-14A must not claim create/import selectable behavior."
|
|
970
|
+
);
|
|
551
971
|
}
|
|
552
972
|
if (evidenceStatus?.state !== "known") {
|
|
553
|
-
addIssue(
|
|
973
|
+
addIssue(
|
|
974
|
+
issues,
|
|
975
|
+
`${adapterPath}.evidenceStatus.state`,
|
|
976
|
+
"pi_evidence_not_known",
|
|
977
|
+
"The pi adapter row must carry known design evidence for this contract."
|
|
978
|
+
);
|
|
554
979
|
}
|
|
555
980
|
const skills = Array.isArray(skillsSurface?.skills) ? skillsSurface.skills : [];
|
|
556
|
-
const skillIds = skills.map(
|
|
981
|
+
const skillIds = skills.map(
|
|
982
|
+
(skill) => isRecord(skill) && typeof skill.skillId === "string" ? skill.skillId : ""
|
|
983
|
+
);
|
|
557
984
|
for (const expectedSkill of SKILL_IDS) {
|
|
558
985
|
if (!skillIds.includes(expectedSkill)) {
|
|
559
|
-
addIssue(
|
|
986
|
+
addIssue(
|
|
987
|
+
issues,
|
|
988
|
+
`${adapterPath}.skillsCommandsSurface.skills`,
|
|
989
|
+
"missing_skill_mapping",
|
|
990
|
+
`Missing required six-skill mapping '${expectedSkill}'.`
|
|
991
|
+
);
|
|
560
992
|
}
|
|
561
993
|
}
|
|
562
994
|
for (const duplicate of collectDuplicateStrings(skillIds.filter((id) => id.length > 0))) {
|
|
563
|
-
addIssue(
|
|
995
|
+
addIssue(
|
|
996
|
+
issues,
|
|
997
|
+
`${adapterPath}.skillsCommandsSurface.skills`,
|
|
998
|
+
"duplicate_skill_mapping",
|
|
999
|
+
`Duplicate skill mapping '${duplicate}'.`
|
|
1000
|
+
);
|
|
564
1001
|
}
|
|
565
1002
|
}
|
|
566
1003
|
if (flags?.skills === true && skillsSurface?.evidence !== void 0 && isRecord(skillsSurface.evidence) && skillsSurface.evidence.state !== "known") {
|
|
567
|
-
addIssue(
|
|
1004
|
+
addIssue(
|
|
1005
|
+
issues,
|
|
1006
|
+
`${adapterPath}.capabilityFlags.skills`,
|
|
1007
|
+
"flag_without_known_evidence",
|
|
1008
|
+
"Enabled skill capability requires known evidence."
|
|
1009
|
+
);
|
|
568
1010
|
}
|
|
569
1011
|
if (flags?.prompts === true && isRecord(adapter.promptTemplateSurface) && isRecord(adapter.promptTemplateSurface.evidence) && adapter.promptTemplateSurface.evidence.state !== "known") {
|
|
570
|
-
addIssue(
|
|
1012
|
+
addIssue(
|
|
1013
|
+
issues,
|
|
1014
|
+
`${adapterPath}.capabilityFlags.prompts`,
|
|
1015
|
+
"flag_without_known_evidence",
|
|
1016
|
+
"Enabled prompt capability requires known evidence."
|
|
1017
|
+
);
|
|
571
1018
|
}
|
|
572
1019
|
if (flags?.hooks === true && isRecord(adapter.hookEventSupport) && isRecord(adapter.hookEventSupport.evidence) && adapter.hookEventSupport.evidence.state !== "known") {
|
|
573
|
-
addIssue(
|
|
1020
|
+
addIssue(
|
|
1021
|
+
issues,
|
|
1022
|
+
`${adapterPath}.capabilityFlags.hooks`,
|
|
1023
|
+
"flag_without_known_evidence",
|
|
1024
|
+
"Enabled hook capability requires known evidence."
|
|
1025
|
+
);
|
|
574
1026
|
}
|
|
575
1027
|
}
|
|
576
1028
|
if (issues.length > 0) {
|
|
@@ -580,30 +1032,62 @@ var validateCapabilityMatrix = (value) => {
|
|
|
580
1032
|
};
|
|
581
1033
|
var validateGeneratedFileManifest = (value) => {
|
|
582
1034
|
const issues = [];
|
|
583
|
-
if (!checkExactObject(
|
|
1035
|
+
if (!checkExactObject(
|
|
1036
|
+
value,
|
|
1037
|
+
"$",
|
|
1038
|
+
["schemaVersion", "adapterId", "adapterCapabilityVersion", "producedByLane", "families"],
|
|
1039
|
+
issues
|
|
1040
|
+
)) {
|
|
584
1041
|
return { valid: false, issues };
|
|
585
1042
|
}
|
|
586
1043
|
checkLiteral(value.schemaVersion, ["pi-generated-file-manifest/v1"], "$.schemaVersion", issues);
|
|
587
1044
|
checkLiteral(value.adapterId, ["pi"], "$.adapterId", issues);
|
|
588
|
-
checkLiteral(
|
|
589
|
-
|
|
1045
|
+
checkLiteral(
|
|
1046
|
+
value.adapterCapabilityVersion,
|
|
1047
|
+
["pi-adapter-capability-matrix/v1"],
|
|
1048
|
+
"$.adapterCapabilityVersion",
|
|
1049
|
+
issues
|
|
1050
|
+
);
|
|
1051
|
+
checkLiteral(
|
|
1052
|
+
value.producedByLane,
|
|
1053
|
+
["I-14A-pi-adapter-capability-generated-file-manifest"],
|
|
1054
|
+
"$.producedByLane",
|
|
1055
|
+
issues
|
|
1056
|
+
);
|
|
590
1057
|
if (checkArray(value.families, "$.families", issues)) {
|
|
591
1058
|
if (value.families.length === 0) {
|
|
592
|
-
addIssue(
|
|
1059
|
+
addIssue(
|
|
1060
|
+
issues,
|
|
1061
|
+
"$.families",
|
|
1062
|
+
"empty_families",
|
|
1063
|
+
"Generated-file manifest must enumerate file families."
|
|
1064
|
+
);
|
|
593
1065
|
}
|
|
594
1066
|
for (let index = 0; index < value.families.length; index += 1) {
|
|
595
1067
|
validateGeneratedFileFamily(value.families[index], `$.families[${index}]`, issues);
|
|
596
1068
|
}
|
|
597
1069
|
}
|
|
598
1070
|
const families = getRecordArray(value.families);
|
|
599
|
-
const familyIds = families.map(
|
|
1071
|
+
const familyIds = families.map(
|
|
1072
|
+
(family) => typeof family.familyId === "string" ? family.familyId : ""
|
|
1073
|
+
);
|
|
600
1074
|
for (const expectedFamily of GENERATED_FILE_FAMILY_IDS) {
|
|
601
1075
|
if (!familyIds.includes(expectedFamily)) {
|
|
602
|
-
addIssue(
|
|
1076
|
+
addIssue(
|
|
1077
|
+
issues,
|
|
1078
|
+
"$.families",
|
|
1079
|
+
"missing_generated_file_family",
|
|
1080
|
+
`Missing generated-file family '${expectedFamily}'.`
|
|
1081
|
+
);
|
|
603
1082
|
}
|
|
604
1083
|
}
|
|
605
1084
|
for (const duplicate of collectDuplicateStrings(familyIds.filter((id) => id.length > 0))) {
|
|
606
|
-
addIssue(
|
|
1085
|
+
addIssue(
|
|
1086
|
+
issues,
|
|
1087
|
+
"$.families",
|
|
1088
|
+
"duplicate_generated_file_family",
|
|
1089
|
+
`Duplicate generated-file family '${duplicate}'.`
|
|
1090
|
+
);
|
|
607
1091
|
}
|
|
608
1092
|
for (const [index, family] of families.entries()) {
|
|
609
1093
|
const familyPath = `$.families[${index}]`;
|
|
@@ -613,7 +1097,12 @@ var validateGeneratedFileManifest = (value) => {
|
|
|
613
1097
|
const readiness = isRecord(family.readiness) ? family.readiness : void 0;
|
|
614
1098
|
const consumedByLanes = Array.isArray(family.consumedByLanes) ? family.consumedByLanes : [];
|
|
615
1099
|
if (!owner || !trustSecurity || !version || !readiness || consumedByLanes.length === 0) {
|
|
616
|
-
addIssue(
|
|
1100
|
+
addIssue(
|
|
1101
|
+
issues,
|
|
1102
|
+
familyPath,
|
|
1103
|
+
"missing_fail_closed_metadata",
|
|
1104
|
+
"Owner, security/trust, version, readiness, and consumer data are mandatory."
|
|
1105
|
+
);
|
|
617
1106
|
}
|
|
618
1107
|
if (typeof family.familyId === "string" && GENERATED_FILE_FAMILY_IDS.includes(family.familyId)) {
|
|
619
1108
|
const contract = GENERATED_FILE_FAMILY_CONTRACTS[family.familyId];
|
|
@@ -626,7 +1115,12 @@ var validateGeneratedFileManifest = (value) => {
|
|
|
626
1115
|
`Generated-file family '${family.familyId}' must declare exactly the required path patterns: ${contract.pathPatterns.join(", ")}.`
|
|
627
1116
|
);
|
|
628
1117
|
if (family.producedByLane !== contract.producerLane) {
|
|
629
|
-
addIssue(
|
|
1118
|
+
addIssue(
|
|
1119
|
+
issues,
|
|
1120
|
+
`${familyPath}.producedByLane`,
|
|
1121
|
+
"unsupported_value",
|
|
1122
|
+
`Generated-file family '${family.familyId}' must be produced by '${contract.producerLane}'.`
|
|
1123
|
+
);
|
|
630
1124
|
}
|
|
631
1125
|
checkExactStringSet(
|
|
632
1126
|
family.consumedByLanes,
|
|
@@ -638,10 +1132,20 @@ var validateGeneratedFileManifest = (value) => {
|
|
|
638
1132
|
);
|
|
639
1133
|
if (owner !== void 0) {
|
|
640
1134
|
if (owner.ownerKind !== contract.ownerKind) {
|
|
641
|
-
addIssue(
|
|
1135
|
+
addIssue(
|
|
1136
|
+
issues,
|
|
1137
|
+
`${familyPath}.owner.ownerKind`,
|
|
1138
|
+
"unsupported_value",
|
|
1139
|
+
`Generated-file family '${family.familyId}' must be owned by a lane.`
|
|
1140
|
+
);
|
|
642
1141
|
}
|
|
643
1142
|
if (owner.ownerId !== contract.producerLane) {
|
|
644
|
-
addIssue(
|
|
1143
|
+
addIssue(
|
|
1144
|
+
issues,
|
|
1145
|
+
`${familyPath}.owner.ownerId`,
|
|
1146
|
+
"unsupported_value",
|
|
1147
|
+
`Generated-file family '${family.familyId}' owner lane must be '${contract.producerLane}'.`
|
|
1148
|
+
);
|
|
645
1149
|
}
|
|
646
1150
|
checkExactStringSet(
|
|
647
1151
|
owner.writePathScope,
|
|
@@ -662,47 +1166,112 @@ var validateGeneratedFileManifest = (value) => {
|
|
|
662
1166
|
}
|
|
663
1167
|
if (trustSecurity !== void 0) {
|
|
664
1168
|
if (trustSecurity.classification !== contract.trustClassification) {
|
|
665
|
-
addIssue(
|
|
1169
|
+
addIssue(
|
|
1170
|
+
issues,
|
|
1171
|
+
`${familyPath}.trustSecurity.classification`,
|
|
1172
|
+
"unsupported_value",
|
|
1173
|
+
`Generated-file family '${family.familyId}' must use trust classification '${contract.trustClassification}'.`
|
|
1174
|
+
);
|
|
666
1175
|
}
|
|
667
1176
|
if (trustSecurity.projectTrustRequired !== contract.projectTrustRequired) {
|
|
668
|
-
addIssue(
|
|
1177
|
+
addIssue(
|
|
1178
|
+
issues,
|
|
1179
|
+
`${familyPath}.trustSecurity.projectTrustRequired`,
|
|
1180
|
+
"unsupported_value",
|
|
1181
|
+
`Generated-file family '${family.familyId}' project-trust metadata must be exact.`
|
|
1182
|
+
);
|
|
669
1183
|
}
|
|
670
1184
|
if (trustSecurity.executesCode !== contract.executesCode) {
|
|
671
|
-
addIssue(
|
|
1185
|
+
addIssue(
|
|
1186
|
+
issues,
|
|
1187
|
+
`${familyPath}.trustSecurity.executesCode`,
|
|
1188
|
+
"unsupported_value",
|
|
1189
|
+
`Generated-file family '${family.familyId}' executable-code metadata must be exact.`
|
|
1190
|
+
);
|
|
672
1191
|
}
|
|
673
1192
|
if (trustSecurity.commandPolicy !== contract.commandPolicy) {
|
|
674
|
-
addIssue(
|
|
1193
|
+
addIssue(
|
|
1194
|
+
issues,
|
|
1195
|
+
`${familyPath}.trustSecurity.commandPolicy`,
|
|
1196
|
+
"unsupported_value",
|
|
1197
|
+
`Generated-file family '${family.familyId}' command policy must be '${contract.commandPolicy}'.`
|
|
1198
|
+
);
|
|
675
1199
|
}
|
|
676
1200
|
if (trustSecurity.sandboxCapability !== contract.sandboxCapability) {
|
|
677
|
-
addIssue(
|
|
1201
|
+
addIssue(
|
|
1202
|
+
issues,
|
|
1203
|
+
`${familyPath}.trustSecurity.sandboxCapability`,
|
|
1204
|
+
"unsupported_value",
|
|
1205
|
+
`Generated-file family '${family.familyId}' sandbox metadata must be '${contract.sandboxCapability}'.`
|
|
1206
|
+
);
|
|
678
1207
|
}
|
|
679
1208
|
if (trustSecurity.credentialPolicy !== contract.credentialPolicy) {
|
|
680
|
-
addIssue(
|
|
1209
|
+
addIssue(
|
|
1210
|
+
issues,
|
|
1211
|
+
`${familyPath}.trustSecurity.credentialPolicy`,
|
|
1212
|
+
"unsupported_value",
|
|
1213
|
+
`Generated-file family '${family.familyId}' credential policy must be '${contract.credentialPolicy}'.`
|
|
1214
|
+
);
|
|
681
1215
|
}
|
|
682
1216
|
if (trustSecurity.externalIntegration !== contract.externalIntegration) {
|
|
683
|
-
addIssue(
|
|
1217
|
+
addIssue(
|
|
1218
|
+
issues,
|
|
1219
|
+
`${familyPath}.trustSecurity.externalIntegration`,
|
|
1220
|
+
"unsupported_value",
|
|
1221
|
+
`Generated-file family '${family.familyId}' external-integration policy must be '${contract.externalIntegration}'.`
|
|
1222
|
+
);
|
|
684
1223
|
}
|
|
685
1224
|
if (trustSecurity.destructiveOperationPolicy !== contract.destructiveOperationPolicy) {
|
|
686
|
-
addIssue(
|
|
1225
|
+
addIssue(
|
|
1226
|
+
issues,
|
|
1227
|
+
`${familyPath}.trustSecurity.destructiveOperationPolicy`,
|
|
1228
|
+
"unsupported_value",
|
|
1229
|
+
`Generated-file family '${family.familyId}' destructive-operation policy must be '${contract.destructiveOperationPolicy}'.`
|
|
1230
|
+
);
|
|
687
1231
|
}
|
|
688
1232
|
}
|
|
689
1233
|
if (version !== void 0) {
|
|
690
1234
|
if (version.formatName !== contract.formatName) {
|
|
691
|
-
addIssue(
|
|
1235
|
+
addIssue(
|
|
1236
|
+
issues,
|
|
1237
|
+
`${familyPath}.version.formatName`,
|
|
1238
|
+
"unsupported_value",
|
|
1239
|
+
`Generated-file family '${family.familyId}' format name must be '${contract.formatName}'.`
|
|
1240
|
+
);
|
|
692
1241
|
}
|
|
693
1242
|
if (version.formatVersion !== contract.formatVersion) {
|
|
694
|
-
addIssue(
|
|
1243
|
+
addIssue(
|
|
1244
|
+
issues,
|
|
1245
|
+
`${familyPath}.version.formatVersion`,
|
|
1246
|
+
"unsupported_value",
|
|
1247
|
+
`Generated-file family '${family.familyId}' format version must be '${contract.formatVersion}'.`
|
|
1248
|
+
);
|
|
695
1249
|
}
|
|
696
1250
|
}
|
|
697
1251
|
if (readiness !== void 0 && readiness.state !== contract.readinessState) {
|
|
698
|
-
addIssue(
|
|
1252
|
+
addIssue(
|
|
1253
|
+
issues,
|
|
1254
|
+
`${familyPath}.readiness.state`,
|
|
1255
|
+
"unsupported_value",
|
|
1256
|
+
`Generated-file family '${family.familyId}' readiness state must be '${contract.readinessState}'.`
|
|
1257
|
+
);
|
|
699
1258
|
}
|
|
700
1259
|
}
|
|
701
1260
|
if (family.familyId === "pi-extensions" && trustSecurity?.executesCode !== true) {
|
|
702
|
-
addIssue(
|
|
1261
|
+
addIssue(
|
|
1262
|
+
issues,
|
|
1263
|
+
`${familyPath}.trustSecurity.executesCode`,
|
|
1264
|
+
"extension_execution_not_declared",
|
|
1265
|
+
"Pi extensions execute TypeScript and must declare executable trust/security implications."
|
|
1266
|
+
);
|
|
703
1267
|
}
|
|
704
1268
|
if (family.familyId !== "pi-extensions" && trustSecurity?.executesCode === true && trustSecurity.classification !== "package-manifest") {
|
|
705
|
-
addIssue(
|
|
1269
|
+
addIssue(
|
|
1270
|
+
issues,
|
|
1271
|
+
`${familyPath}.trustSecurity.executesCode`,
|
|
1272
|
+
"unexpected_executable_family",
|
|
1273
|
+
"Only extension/package manifest families may declare executable behavior in this manifest."
|
|
1274
|
+
);
|
|
706
1275
|
}
|
|
707
1276
|
}
|
|
708
1277
|
if (issues.length > 0) {
|
|
@@ -713,11 +1282,15 @@ var validateGeneratedFileManifest = (value) => {
|
|
|
713
1282
|
var createDownstreamManifestSummary = (capabilityMatrix, generatedFileManifest) => {
|
|
714
1283
|
const capabilityValidation = validateCapabilityMatrix(capabilityMatrix);
|
|
715
1284
|
if (!capabilityValidation.valid) {
|
|
716
|
-
throw new Error(
|
|
1285
|
+
throw new Error(
|
|
1286
|
+
`Capability matrix failed validation: ${capabilityValidation.issues.map((issue) => issue.code).join(",")}`
|
|
1287
|
+
);
|
|
717
1288
|
}
|
|
718
1289
|
const manifestValidation = validateGeneratedFileManifest(generatedFileManifest);
|
|
719
1290
|
if (!manifestValidation.valid) {
|
|
720
|
-
throw new Error(
|
|
1291
|
+
throw new Error(
|
|
1292
|
+
`Generated-file manifest failed validation: ${manifestValidation.issues.map((issue) => issue.code).join(",")}`
|
|
1293
|
+
);
|
|
721
1294
|
}
|
|
722
1295
|
const piAdapter = capabilityMatrix.adapters.find((adapter) => adapter.adapterId === "pi");
|
|
723
1296
|
if (piAdapter === void 0) {
|