@lucern/pack-host 1.0.28 → 1.0.30
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/contracts.d.ts +35 -35
- package/dist/contracts.js.map +1 -1
- package/dist/dependencyResolution.d.ts +3 -3
- package/dist/dependencyResolution.js +83 -59
- package/dist/dependencyResolution.js.map +1 -1
- package/dist/domain-pack/authoring.core.d.ts +82 -82
- package/dist/domain-pack/authoring.core.js +7 -6
- package/dist/domain-pack/authoring.core.js.map +1 -1
- package/dist/domain-pack/authoring.js +400 -281
- package/dist/domain-pack/authoring.js.map +1 -1
- package/dist/domain-pack/authoring.validation.js +400 -281
- package/dist/domain-pack/authoring.validation.js.map +1 -1
- package/dist/domain-pack/contracts.d.ts +95 -95
- package/dist/domain-pack/contracts.js.map +1 -1
- package/dist/domain-pack/index.js +416 -285
- package/dist/domain-pack/index.js.map +1 -1
- package/dist/domain-pack/ontology/software-entities-v1.d.ts +7 -7
- package/dist/domain-pack/ontology/software-entities-v1.js.map +1 -1
- package/dist/domain-pack/packs/developer-reasoning.js +7 -1
- package/dist/domain-pack/packs/developer-reasoning.js.map +1 -1
- package/dist/domain-pack/packs/engineering-accelerator.js.map +1 -1
- package/dist/domain-pack/packs/index.js +333 -239
- package/dist/domain-pack/packs/index.js.map +1 -1
- package/dist/domain-pack/shaping.d.ts +15 -15
- package/dist/domain-pack/shaping.js +326 -238
- package/dist/domain-pack/shaping.js.map +1 -1
- package/dist/domain-pack/validation.d.ts +6 -6
- package/dist/domain-pack/validation.js +318 -236
- package/dist/domain-pack/validation.js.map +1 -1
- package/dist/domain-pack.js +416 -285
- package/dist/domain-pack.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3793 -3643
- package/dist/index.js.map +1 -1
- package/dist/lifecycle.d.ts +9 -9
- package/dist/lifecycle.js.map +1 -1
- package/dist/manifestValidation.d.ts +9 -9
- package/dist/manifestValidation.js.map +1 -1
- package/dist/manifests/chat-v1.js.map +1 -1
- package/dist/manifests/deals-v1.js +1 -6
- package/dist/manifests/deals-v1.js.map +1 -1
- package/dist/manifests/decisions-v1.js.map +1 -1
- package/dist/manifests/documents-v1.js.map +1 -1
- package/dist/manifests/epistemic-algorithms-v1.js.map +1 -1
- package/dist/manifests/graph-visualization-v1.js.map +1 -1
- package/dist/manifests/index.js +1 -6
- package/dist/manifests/index.js.map +1 -1
- package/dist/manifests/news-v1.js.map +1 -1
- package/dist/manifests/philosophy-mode-v1.js.map +1 -1
- package/dist/manifests/sprints-v1.js.map +1 -1
- package/dist/manifests/task-management-v1.js.map +1 -1
- package/dist/manifests/team-analysis-v1.js.map +1 -1
- package/dist/manifests/themes-v1.js.map +1 -1
- package/dist/manifests/user-profiles-v1.js.map +1 -1
- package/dist/manifests.js +1 -6
- package/dist/manifests.js.map +1 -1
- package/dist/namespacePolicy.d.ts +6 -6
- package/dist/namespacePolicy.js.map +1 -1
- package/dist/proof-attestation.json +1 -1
- package/dist/registry.js +84 -65
- package/dist/registry.js.map +1 -1
- package/dist/runtime.d.ts +6 -6
- package/dist/runtime.js +83 -59
- package/dist/runtime.js.map +1 -1
- package/dist/serviceContracts.d.ts +4 -4
- package/dist/serviceContracts.js.map +1 -1
- package/package.json +1 -1
|
@@ -405,9 +405,14 @@ function checkDuplicateIds(items, idField, path) {
|
|
|
405
405
|
}
|
|
406
406
|
return issues;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
|
|
410
|
-
|
|
408
|
+
function checkOptionalDuplicateIds(items, idField, path) {
|
|
409
|
+
if (!items) {
|
|
410
|
+
return [];
|
|
411
|
+
}
|
|
412
|
+
return checkDuplicateIds(items, idField, path);
|
|
413
|
+
}
|
|
414
|
+
function validatePackIdentity(pack, issues) {
|
|
415
|
+
if (typeof pack.packId !== "string" || pack.packId.trim().length === 0) {
|
|
411
416
|
issues.push(issue("MISSING_PACK_ID", "packId is required", "packId"));
|
|
412
417
|
} else if (!KEBAB_CASE.test(pack.packId)) {
|
|
413
418
|
issues.push(
|
|
@@ -418,10 +423,10 @@ function validateDomainPack(pack) {
|
|
|
418
423
|
)
|
|
419
424
|
);
|
|
420
425
|
}
|
|
421
|
-
if (
|
|
426
|
+
if (typeof pack.name !== "string" || pack.name.trim().length === 0) {
|
|
422
427
|
issues.push(issue("MISSING_NAME", "name is required", "name"));
|
|
423
428
|
}
|
|
424
|
-
if (
|
|
429
|
+
if (typeof pack.version !== "string" || pack.version.trim().length === 0) {
|
|
425
430
|
issues.push(issue("MISSING_VERSION", "version is required", "version"));
|
|
426
431
|
} else if (!SEMVER.test(pack.version)) {
|
|
427
432
|
issues.push(
|
|
@@ -432,6 +437,8 @@ function validateDomainPack(pack) {
|
|
|
432
437
|
)
|
|
433
438
|
);
|
|
434
439
|
}
|
|
440
|
+
}
|
|
441
|
+
function validateOntologyBindings(pack, issues) {
|
|
435
442
|
if (!pack.ontologyBindings || pack.ontologyBindings.length === 0) {
|
|
436
443
|
issues.push(
|
|
437
444
|
issue(
|
|
@@ -492,6 +499,8 @@ function validateDomainPack(pack) {
|
|
|
492
499
|
);
|
|
493
500
|
}
|
|
494
501
|
}
|
|
502
|
+
}
|
|
503
|
+
function validateTopicRoots(pack, issues) {
|
|
495
504
|
if (!pack.topicRoots || pack.topicRoots.length === 0) {
|
|
496
505
|
issues.push(
|
|
497
506
|
issue(
|
|
@@ -500,270 +509,343 @@ function validateDomainPack(pack) {
|
|
|
500
509
|
"topicRoots"
|
|
501
510
|
)
|
|
502
511
|
);
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
issues.push(
|
|
515
|
+
...checkOptionalDuplicateIds(pack.topicRoots, "slug", "topicRoots")
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
function validateOperatingSystemPrompts(operatingSystem, issues) {
|
|
519
|
+
if (!operatingSystem.prompts) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
issues.push(
|
|
523
|
+
...checkOptionalDuplicateIds(
|
|
524
|
+
operatingSystem.prompts,
|
|
525
|
+
"promptId",
|
|
526
|
+
"operatingSystem.prompts"
|
|
527
|
+
)
|
|
528
|
+
);
|
|
529
|
+
for (const [index, prompt] of operatingSystem.prompts.entries()) {
|
|
530
|
+
issues.push(...validatePromptBinding(prompt, index));
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
function validateOperatingSystemTools(operatingSystem, issues) {
|
|
534
|
+
if (!operatingSystem.tools) {
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
issues.push(
|
|
538
|
+
...checkOptionalDuplicateIds(
|
|
539
|
+
operatingSystem.tools,
|
|
540
|
+
"toolId",
|
|
541
|
+
"operatingSystem.tools"
|
|
542
|
+
)
|
|
543
|
+
);
|
|
544
|
+
for (const [index, tool] of operatingSystem.tools.entries()) {
|
|
545
|
+
issues.push(...validateToolBinding(tool, index));
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
function validateOperatingSystemSetupAssets(operatingSystem, issues) {
|
|
549
|
+
if (!operatingSystem.setupAssets) {
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
issues.push(
|
|
553
|
+
...checkOptionalDuplicateIds(
|
|
554
|
+
operatingSystem.setupAssets,
|
|
555
|
+
"assetId",
|
|
556
|
+
"operatingSystem.setupAssets"
|
|
557
|
+
)
|
|
558
|
+
);
|
|
559
|
+
for (const [index, asset] of operatingSystem.setupAssets.entries()) {
|
|
560
|
+
issues.push(...validateSetupAsset(asset, index));
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
function validateOperatingSystemTopicTemplates(operatingSystem, knownRootSlugs, issues) {
|
|
564
|
+
const templateSlugs = /* @__PURE__ */ new Set();
|
|
565
|
+
if (!operatingSystem.topicTemplates) {
|
|
566
|
+
return templateSlugs;
|
|
567
|
+
}
|
|
568
|
+
issues.push(
|
|
569
|
+
...checkOptionalDuplicateIds(
|
|
570
|
+
operatingSystem.topicTemplates,
|
|
571
|
+
"slug",
|
|
572
|
+
"operatingSystem.topicTemplates"
|
|
573
|
+
)
|
|
574
|
+
);
|
|
575
|
+
for (const template of operatingSystem.topicTemplates) {
|
|
576
|
+
if (template.slug) {
|
|
577
|
+
templateSlugs.add(template.slug);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
const knownTopicSlugs = /* @__PURE__ */ new Set([...knownRootSlugs, ...templateSlugs]);
|
|
581
|
+
for (const [index, template] of operatingSystem.topicTemplates.entries()) {
|
|
582
|
+
issues.push(...validateTopicTemplate(template, index, knownTopicSlugs));
|
|
583
|
+
}
|
|
584
|
+
return templateSlugs;
|
|
585
|
+
}
|
|
586
|
+
function validateOperatingSystemInstallProfiles(operatingSystem, knownRootSlugs, templateSlugs, issues) {
|
|
587
|
+
if (!operatingSystem.installProfiles) {
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
issues.push(
|
|
591
|
+
...checkOptionalDuplicateIds(
|
|
592
|
+
operatingSystem.installProfiles,
|
|
593
|
+
"profileId",
|
|
594
|
+
"operatingSystem.installProfiles"
|
|
595
|
+
)
|
|
596
|
+
);
|
|
597
|
+
const knownPromptIds = new Set(
|
|
598
|
+
operatingSystem.prompts?.map((prompt) => prompt.promptId) ?? []
|
|
599
|
+
);
|
|
600
|
+
const knownToolIds = new Set(
|
|
601
|
+
operatingSystem.tools?.map((tool) => tool.toolId) ?? []
|
|
602
|
+
);
|
|
603
|
+
const knownAssetIds = new Set(
|
|
604
|
+
operatingSystem.setupAssets?.map((asset) => asset.assetId) ?? []
|
|
605
|
+
);
|
|
606
|
+
const knownTopicSlugs = /* @__PURE__ */ new Set([...knownRootSlugs, ...templateSlugs]);
|
|
607
|
+
for (const [index, profile] of operatingSystem.installProfiles.entries()) {
|
|
608
|
+
issues.push(
|
|
609
|
+
...validateInstallProfile(
|
|
610
|
+
profile,
|
|
611
|
+
index,
|
|
612
|
+
knownPromptIds,
|
|
613
|
+
knownToolIds,
|
|
614
|
+
knownAssetIds,
|
|
615
|
+
knownTopicSlugs
|
|
509
616
|
)
|
|
510
617
|
);
|
|
511
618
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
if (pack.operatingSystem.prompts) {
|
|
517
|
-
issues.push(
|
|
518
|
-
...checkDuplicateIds(
|
|
519
|
-
pack.operatingSystem.prompts,
|
|
520
|
-
"promptId",
|
|
521
|
-
"operatingSystem.prompts"
|
|
522
|
-
)
|
|
523
|
-
);
|
|
524
|
-
pack.operatingSystem.prompts.forEach((prompt, index) => {
|
|
525
|
-
issues.push(...validatePromptBinding(prompt, index));
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
if (pack.operatingSystem.tools) {
|
|
529
|
-
issues.push(
|
|
530
|
-
...checkDuplicateIds(
|
|
531
|
-
pack.operatingSystem.tools,
|
|
532
|
-
"toolId",
|
|
533
|
-
"operatingSystem.tools"
|
|
534
|
-
)
|
|
535
|
-
);
|
|
536
|
-
pack.operatingSystem.tools.forEach((tool, index) => {
|
|
537
|
-
issues.push(...validateToolBinding(tool, index));
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
if (pack.operatingSystem.setupAssets) {
|
|
541
|
-
issues.push(
|
|
542
|
-
...checkDuplicateIds(
|
|
543
|
-
pack.operatingSystem.setupAssets,
|
|
544
|
-
"assetId",
|
|
545
|
-
"operatingSystem.setupAssets"
|
|
546
|
-
)
|
|
547
|
-
);
|
|
548
|
-
pack.operatingSystem.setupAssets.forEach((asset, index) => {
|
|
549
|
-
issues.push(...validateSetupAsset(asset, index));
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
const templateSlugs = /* @__PURE__ */ new Set();
|
|
553
|
-
if (pack.operatingSystem.topicTemplates) {
|
|
554
|
-
issues.push(
|
|
555
|
-
...checkDuplicateIds(
|
|
556
|
-
pack.operatingSystem.topicTemplates,
|
|
557
|
-
"slug",
|
|
558
|
-
"operatingSystem.topicTemplates"
|
|
559
|
-
)
|
|
560
|
-
);
|
|
561
|
-
pack.operatingSystem.topicTemplates.forEach((template) => {
|
|
562
|
-
if (template.slug) {
|
|
563
|
-
templateSlugs.add(template.slug);
|
|
564
|
-
}
|
|
565
|
-
});
|
|
566
|
-
const knownTopicSlugs = /* @__PURE__ */ new Set([...knownRootSlugs, ...templateSlugs]);
|
|
567
|
-
pack.operatingSystem.topicTemplates.forEach((template, index) => {
|
|
568
|
-
issues.push(...validateTopicTemplate(template, index, knownTopicSlugs));
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
|
-
if (pack.operatingSystem.installProfiles) {
|
|
572
|
-
issues.push(
|
|
573
|
-
...checkDuplicateIds(
|
|
574
|
-
pack.operatingSystem.installProfiles,
|
|
575
|
-
"profileId",
|
|
576
|
-
"operatingSystem.installProfiles"
|
|
577
|
-
)
|
|
578
|
-
);
|
|
579
|
-
const knownPromptIds = new Set(
|
|
580
|
-
pack.operatingSystem.prompts?.map((prompt) => prompt.promptId) ?? []
|
|
581
|
-
);
|
|
582
|
-
const knownToolIds = new Set(
|
|
583
|
-
pack.operatingSystem.tools?.map((tool) => tool.toolId) ?? []
|
|
584
|
-
);
|
|
585
|
-
const knownAssetIds = new Set(
|
|
586
|
-
pack.operatingSystem.setupAssets?.map((asset) => asset.assetId) ?? []
|
|
587
|
-
);
|
|
588
|
-
const knownTopicSlugs = /* @__PURE__ */ new Set([...knownRootSlugs, ...templateSlugs]);
|
|
589
|
-
pack.operatingSystem.installProfiles.forEach((profile, index) => {
|
|
590
|
-
issues.push(
|
|
591
|
-
...validateInstallProfile(
|
|
592
|
-
profile,
|
|
593
|
-
index,
|
|
594
|
-
knownPromptIds,
|
|
595
|
-
knownToolIds,
|
|
596
|
-
knownAssetIds,
|
|
597
|
-
knownTopicSlugs
|
|
598
|
-
)
|
|
599
|
-
);
|
|
600
|
-
});
|
|
601
|
-
}
|
|
619
|
+
}
|
|
620
|
+
function validateOperatingSystem(pack, issues) {
|
|
621
|
+
if (!pack.operatingSystem) {
|
|
622
|
+
return;
|
|
602
623
|
}
|
|
624
|
+
const knownRootSlugs = new Set(
|
|
625
|
+
pack.topicRoots?.map((topic) => topic.slug) ?? []
|
|
626
|
+
);
|
|
627
|
+
validateOperatingSystemPrompts(pack.operatingSystem, issues);
|
|
628
|
+
validateOperatingSystemTools(pack.operatingSystem, issues);
|
|
629
|
+
validateOperatingSystemSetupAssets(pack.operatingSystem, issues);
|
|
630
|
+
const templateSlugs = validateOperatingSystemTopicTemplates(
|
|
631
|
+
pack.operatingSystem,
|
|
632
|
+
knownRootSlugs,
|
|
633
|
+
issues
|
|
634
|
+
);
|
|
635
|
+
validateOperatingSystemInstallProfiles(
|
|
636
|
+
pack.operatingSystem,
|
|
637
|
+
knownRootSlugs,
|
|
638
|
+
templateSlugs,
|
|
639
|
+
issues
|
|
640
|
+
);
|
|
641
|
+
}
|
|
642
|
+
function validateRoles(pack, issues) {
|
|
603
643
|
if (!pack.roles || pack.roles.length === 0) {
|
|
604
644
|
issues.push(
|
|
605
645
|
issue("MISSING_ROLES", "At least one reasoning role is required", "roles")
|
|
606
646
|
);
|
|
607
647
|
} else {
|
|
608
|
-
issues.push(
|
|
609
|
-
...checkDuplicateIds(
|
|
610
|
-
pack.roles,
|
|
611
|
-
"roleId",
|
|
612
|
-
"roles"
|
|
613
|
-
)
|
|
614
|
-
);
|
|
648
|
+
issues.push(...checkOptionalDuplicateIds(pack.roles, "roleId", "roles"));
|
|
615
649
|
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
650
|
+
}
|
|
651
|
+
function validateGates(pack, issues) {
|
|
652
|
+
if (!pack.gates) {
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
issues.push(...checkOptionalDuplicateIds(pack.gates, "gateId", "gates"));
|
|
656
|
+
for (const [index, gate] of pack.gates.entries()) {
|
|
657
|
+
if (!gate.criteria || gate.criteria.length === 0) {
|
|
658
|
+
issues.push(
|
|
659
|
+
issue(
|
|
660
|
+
"EMPTY_GATE_CRITERIA",
|
|
661
|
+
`Gate "${gate.gateId}" has no criteria`,
|
|
662
|
+
`gates[${index}].criteria`,
|
|
663
|
+
"warning"
|
|
664
|
+
)
|
|
665
|
+
);
|
|
666
|
+
continue;
|
|
667
|
+
}
|
|
622
668
|
issues.push(
|
|
623
|
-
...
|
|
624
|
-
|
|
625
|
-
"
|
|
626
|
-
|
|
669
|
+
...checkOptionalDuplicateIds(
|
|
670
|
+
gate.criteria,
|
|
671
|
+
"criterionId",
|
|
672
|
+
`gates[${index}].criteria`
|
|
627
673
|
)
|
|
628
674
|
);
|
|
629
|
-
for (const [i, gate] of pack.gates.entries()) {
|
|
630
|
-
if (!gate.criteria || gate.criteria.length === 0) {
|
|
631
|
-
issues.push(
|
|
632
|
-
issue(
|
|
633
|
-
"EMPTY_GATE_CRITERIA",
|
|
634
|
-
`Gate "${gate.gateId}" has no criteria`,
|
|
635
|
-
`gates[${i}].criteria`,
|
|
636
|
-
"warning"
|
|
637
|
-
)
|
|
638
|
-
);
|
|
639
|
-
} else {
|
|
640
|
-
issues.push(
|
|
641
|
-
...checkDuplicateIds(
|
|
642
|
-
gate.criteria,
|
|
643
|
-
"criterionId",
|
|
644
|
-
`gates[${i}].criteria`
|
|
645
|
-
)
|
|
646
|
-
);
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
675
|
}
|
|
676
|
+
}
|
|
677
|
+
function validateArtifacts(pack, issues) {
|
|
650
678
|
if (pack.artifacts) {
|
|
651
679
|
issues.push(
|
|
652
|
-
...
|
|
653
|
-
pack.artifacts,
|
|
654
|
-
"artifactId",
|
|
655
|
-
"artifacts"
|
|
656
|
-
)
|
|
680
|
+
...checkOptionalDuplicateIds(pack.artifacts, "artifactId", "artifacts")
|
|
657
681
|
);
|
|
658
682
|
}
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
)
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
for (const artifactId of workflow.requiredArtifacts) {
|
|
680
|
-
if (!knownArtifactIds.has(artifactId)) {
|
|
681
|
-
issues.push(
|
|
682
|
-
issue(
|
|
683
|
-
"UNKNOWN_ARTIFACT_REF",
|
|
684
|
-
`Workflow "${workflow.workflowId}" references unknown artifact "${artifactId}"`,
|
|
685
|
-
`workflows[${wi}].requiredArtifacts`
|
|
686
|
-
)
|
|
687
|
-
);
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
for (const [si, step] of workflow.steps.entries()) {
|
|
691
|
-
for (const roleId of step.requiredRoles) {
|
|
692
|
-
if (!knownRoleIds.has(roleId)) {
|
|
693
|
-
issues.push(
|
|
694
|
-
issue(
|
|
695
|
-
"UNKNOWN_ROLE_REF",
|
|
696
|
-
`Step "${step.stepId}" references unknown role "${roleId}"`,
|
|
697
|
-
`workflows[${wi}].steps[${si}].requiredRoles`
|
|
698
|
-
)
|
|
699
|
-
);
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
if (step.gateId && !knownGateIds.has(step.gateId)) {
|
|
703
|
-
issues.push(
|
|
704
|
-
issue(
|
|
705
|
-
"UNKNOWN_GATE_REF",
|
|
706
|
-
`Step "${step.stepId}" references unknown gate "${step.gateId}"`,
|
|
707
|
-
`workflows[${wi}].steps[${si}].gateId`
|
|
708
|
-
)
|
|
709
|
-
);
|
|
710
|
-
}
|
|
711
|
-
if (step.produces) {
|
|
712
|
-
for (const artifactId of step.produces) {
|
|
713
|
-
if (!knownArtifactIds.has(artifactId)) {
|
|
714
|
-
issues.push(
|
|
715
|
-
issue(
|
|
716
|
-
"UNKNOWN_ARTIFACT_REF",
|
|
717
|
-
`Step "${step.stepId}" references unknown artifact "${artifactId}"`,
|
|
718
|
-
`workflows[${wi}].steps[${si}].produces`
|
|
719
|
-
)
|
|
720
|
-
);
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
}
|
|
683
|
+
}
|
|
684
|
+
function domainPackReferenceSets(pack) {
|
|
685
|
+
return {
|
|
686
|
+
knownGateIds: new Set(pack.gates?.map((gate) => gate.gateId) ?? []),
|
|
687
|
+
knownArtifactIds: new Set(
|
|
688
|
+
pack.artifacts?.map((artifact) => artifact.artifactId) ?? []
|
|
689
|
+
),
|
|
690
|
+
knownRoleIds: new Set(pack.roles?.map((role) => role.roleId) ?? [])
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
function validateWorkflowGateReferences(workflow, workflowIndex, knownGateIds, issues) {
|
|
694
|
+
for (const gateId of workflow.gateCheckpoints) {
|
|
695
|
+
if (!knownGateIds.has(gateId)) {
|
|
696
|
+
issues.push(
|
|
697
|
+
issue(
|
|
698
|
+
"UNKNOWN_GATE_REF",
|
|
699
|
+
`Workflow "${workflow.workflowId}" references unknown gate "${gateId}"`,
|
|
700
|
+
`workflows[${workflowIndex}].gateCheckpoints`
|
|
701
|
+
)
|
|
702
|
+
);
|
|
725
703
|
}
|
|
726
704
|
}
|
|
727
|
-
|
|
728
|
-
|
|
705
|
+
}
|
|
706
|
+
function validateWorkflowArtifactReferences(workflow, workflowIndex, knownArtifactIds, issues) {
|
|
707
|
+
for (const artifactId of workflow.requiredArtifacts) {
|
|
708
|
+
if (!knownArtifactIds.has(artifactId)) {
|
|
729
709
|
issues.push(
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
"
|
|
733
|
-
|
|
710
|
+
issue(
|
|
711
|
+
"UNKNOWN_ARTIFACT_REF",
|
|
712
|
+
`Workflow "${workflow.workflowId}" references unknown artifact "${artifactId}"`,
|
|
713
|
+
`workflows[${workflowIndex}].requiredArtifacts`
|
|
734
714
|
)
|
|
735
715
|
);
|
|
736
|
-
pack.inquiryShaping.questionTemplates.forEach((template, index) => {
|
|
737
|
-
issues.push(...validateQuestionTemplate(template, index));
|
|
738
|
-
});
|
|
739
716
|
}
|
|
740
|
-
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
function validateWorkflowStepReferences(step, workflowIndex, stepIndex, refs, issues) {
|
|
720
|
+
for (const roleId of step.requiredRoles) {
|
|
721
|
+
if (!refs.knownRoleIds.has(roleId)) {
|
|
741
722
|
issues.push(
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
"
|
|
745
|
-
|
|
723
|
+
issue(
|
|
724
|
+
"UNKNOWN_ROLE_REF",
|
|
725
|
+
`Step "${step.stepId}" references unknown role "${roleId}"`,
|
|
726
|
+
`workflows[${workflowIndex}].steps[${stepIndex}].requiredRoles`
|
|
746
727
|
)
|
|
747
728
|
);
|
|
748
|
-
pack.inquiryShaping.taskTemplates.forEach((template, index) => {
|
|
749
|
-
issues.push(...validateTaskTemplate(template, index));
|
|
750
|
-
});
|
|
751
729
|
}
|
|
752
|
-
|
|
730
|
+
}
|
|
731
|
+
if (step.gateId && !refs.knownGateIds.has(step.gateId)) {
|
|
732
|
+
issues.push(
|
|
733
|
+
issue(
|
|
734
|
+
"UNKNOWN_GATE_REF",
|
|
735
|
+
`Step "${step.stepId}" references unknown gate "${step.gateId}"`,
|
|
736
|
+
`workflows[${workflowIndex}].steps[${stepIndex}].gateId`
|
|
737
|
+
)
|
|
738
|
+
);
|
|
739
|
+
}
|
|
740
|
+
for (const artifactId of step.produces ?? []) {
|
|
741
|
+
if (!refs.knownArtifactIds.has(artifactId)) {
|
|
753
742
|
issues.push(
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
}
|
|
758
|
-
"frameworkName",
|
|
759
|
-
"inquiryShaping.frameworkHints"
|
|
743
|
+
issue(
|
|
744
|
+
"UNKNOWN_ARTIFACT_REF",
|
|
745
|
+
`Step "${step.stepId}" references unknown artifact "${artifactId}"`,
|
|
746
|
+
`workflows[${workflowIndex}].steps[${stepIndex}].produces`
|
|
760
747
|
)
|
|
761
748
|
);
|
|
762
|
-
pack.inquiryShaping.frameworkHints.forEach((hint, index) => {
|
|
763
|
-
issues.push(...validateFrameworkHint(hint, index));
|
|
764
|
-
});
|
|
765
749
|
}
|
|
766
750
|
}
|
|
751
|
+
}
|
|
752
|
+
function validateWorkflows(pack, refs, issues) {
|
|
753
|
+
if (!pack.workflows) {
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
issues.push(
|
|
757
|
+
...checkOptionalDuplicateIds(pack.workflows, "workflowId", "workflows")
|
|
758
|
+
);
|
|
759
|
+
for (const [workflowIndex, workflow] of pack.workflows.entries()) {
|
|
760
|
+
validateWorkflowGateReferences(
|
|
761
|
+
workflow,
|
|
762
|
+
workflowIndex,
|
|
763
|
+
refs.knownGateIds,
|
|
764
|
+
issues
|
|
765
|
+
);
|
|
766
|
+
validateWorkflowArtifactReferences(
|
|
767
|
+
workflow,
|
|
768
|
+
workflowIndex,
|
|
769
|
+
refs.knownArtifactIds,
|
|
770
|
+
issues
|
|
771
|
+
);
|
|
772
|
+
for (const [stepIndex, step] of workflow.steps.entries()) {
|
|
773
|
+
validateWorkflowStepReferences(
|
|
774
|
+
step,
|
|
775
|
+
workflowIndex,
|
|
776
|
+
stepIndex,
|
|
777
|
+
refs,
|
|
778
|
+
issues
|
|
779
|
+
);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
function validateInquiryQuestionTemplates(pack, issues) {
|
|
784
|
+
if (!pack.inquiryShaping?.questionTemplates) {
|
|
785
|
+
return;
|
|
786
|
+
}
|
|
787
|
+
issues.push(
|
|
788
|
+
...checkOptionalDuplicateIds(
|
|
789
|
+
pack.inquiryShaping.questionTemplates,
|
|
790
|
+
"templateId",
|
|
791
|
+
"inquiryShaping.questionTemplates"
|
|
792
|
+
)
|
|
793
|
+
);
|
|
794
|
+
for (const [
|
|
795
|
+
index,
|
|
796
|
+
template
|
|
797
|
+
] of pack.inquiryShaping.questionTemplates.entries()) {
|
|
798
|
+
issues.push(...validateQuestionTemplate(template, index));
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
function validateInquiryTaskTemplates(pack, issues) {
|
|
802
|
+
if (!pack.inquiryShaping?.taskTemplates) {
|
|
803
|
+
return;
|
|
804
|
+
}
|
|
805
|
+
issues.push(
|
|
806
|
+
...checkOptionalDuplicateIds(
|
|
807
|
+
pack.inquiryShaping.taskTemplates,
|
|
808
|
+
"templateId",
|
|
809
|
+
"inquiryShaping.taskTemplates"
|
|
810
|
+
)
|
|
811
|
+
);
|
|
812
|
+
for (const [index, template] of pack.inquiryShaping.taskTemplates.entries()) {
|
|
813
|
+
issues.push(...validateTaskTemplate(template, index));
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
function validateInquiryFrameworkHints(pack, issues) {
|
|
817
|
+
if (!pack.inquiryShaping?.frameworkHints) {
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
issues.push(
|
|
821
|
+
...checkDuplicateIds(
|
|
822
|
+
pack.inquiryShaping.frameworkHints.map((hint) => ({
|
|
823
|
+
frameworkName: hint.frameworkName
|
|
824
|
+
})),
|
|
825
|
+
"frameworkName",
|
|
826
|
+
"inquiryShaping.frameworkHints"
|
|
827
|
+
)
|
|
828
|
+
);
|
|
829
|
+
for (const [index, hint] of pack.inquiryShaping.frameworkHints.entries()) {
|
|
830
|
+
issues.push(...validateFrameworkHint(hint, index));
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
function validateInquiryShaping(pack, issues) {
|
|
834
|
+
validateInquiryQuestionTemplates(pack, issues);
|
|
835
|
+
validateInquiryTaskTemplates(pack, issues);
|
|
836
|
+
validateInquiryFrameworkHints(pack, issues);
|
|
837
|
+
}
|
|
838
|
+
function validateDomainPack(pack) {
|
|
839
|
+
const issues = [];
|
|
840
|
+
validatePackIdentity(pack, issues);
|
|
841
|
+
validateOntologyBindings(pack, issues);
|
|
842
|
+
validateTopicRoots(pack, issues);
|
|
843
|
+
validateOperatingSystem(pack, issues);
|
|
844
|
+
validateRoles(pack, issues);
|
|
845
|
+
validateGates(pack, issues);
|
|
846
|
+
validateArtifacts(pack, issues);
|
|
847
|
+
validateWorkflows(pack, domainPackReferenceSets(pack), issues);
|
|
848
|
+
validateInquiryShaping(pack, issues);
|
|
767
849
|
return {
|
|
768
850
|
valid: issues.filter((i) => i.severity === "error").length === 0,
|
|
769
851
|
issues
|