@lucern/pack-host 1.0.29 → 1.0.31

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.
Files changed (68) hide show
  1. package/dist/contracts.d.ts +35 -35
  2. package/dist/contracts.js.map +1 -1
  3. package/dist/dependencyResolution.d.ts +3 -3
  4. package/dist/dependencyResolution.js +83 -59
  5. package/dist/dependencyResolution.js.map +1 -1
  6. package/dist/domain-pack/authoring.core.d.ts +82 -82
  7. package/dist/domain-pack/authoring.core.js +7 -6
  8. package/dist/domain-pack/authoring.core.js.map +1 -1
  9. package/dist/domain-pack/authoring.js +400 -281
  10. package/dist/domain-pack/authoring.js.map +1 -1
  11. package/dist/domain-pack/authoring.validation.js +400 -281
  12. package/dist/domain-pack/authoring.validation.js.map +1 -1
  13. package/dist/domain-pack/contracts.d.ts +95 -95
  14. package/dist/domain-pack/contracts.js.map +1 -1
  15. package/dist/domain-pack/index.js +416 -285
  16. package/dist/domain-pack/index.js.map +1 -1
  17. package/dist/domain-pack/ontology/software-entities-v1.d.ts +7 -7
  18. package/dist/domain-pack/ontology/software-entities-v1.js.map +1 -1
  19. package/dist/domain-pack/packs/developer-reasoning.js +7 -1
  20. package/dist/domain-pack/packs/developer-reasoning.js.map +1 -1
  21. package/dist/domain-pack/packs/engineering-accelerator.js.map +1 -1
  22. package/dist/domain-pack/packs/index.js +333 -239
  23. package/dist/domain-pack/packs/index.js.map +1 -1
  24. package/dist/domain-pack/shaping.d.ts +15 -15
  25. package/dist/domain-pack/shaping.js +326 -238
  26. package/dist/domain-pack/shaping.js.map +1 -1
  27. package/dist/domain-pack/validation.d.ts +6 -6
  28. package/dist/domain-pack/validation.js +318 -236
  29. package/dist/domain-pack/validation.js.map +1 -1
  30. package/dist/domain-pack.js +416 -285
  31. package/dist/domain-pack.js.map +1 -1
  32. package/dist/index.d.ts +6 -6
  33. package/dist/index.js +3793 -3643
  34. package/dist/index.js.map +1 -1
  35. package/dist/lifecycle.d.ts +9 -9
  36. package/dist/lifecycle.js.map +1 -1
  37. package/dist/manifestValidation.d.ts +9 -9
  38. package/dist/manifestValidation.js.map +1 -1
  39. package/dist/manifests/chat-v1.js +1 -1
  40. package/dist/manifests/chat-v1.js.map +1 -1
  41. package/dist/manifests/deals-v1.js +1 -6
  42. package/dist/manifests/deals-v1.js.map +1 -1
  43. package/dist/manifests/decisions-v1.js.map +1 -1
  44. package/dist/manifests/documents-v1.js.map +1 -1
  45. package/dist/manifests/epistemic-algorithms-v1.js.map +1 -1
  46. package/dist/manifests/graph-visualization-v1.js.map +1 -1
  47. package/dist/manifests/index.js +2 -7
  48. package/dist/manifests/index.js.map +1 -1
  49. package/dist/manifests/news-v1.js.map +1 -1
  50. package/dist/manifests/philosophy-mode-v1.js.map +1 -1
  51. package/dist/manifests/sprints-v1.js.map +1 -1
  52. package/dist/manifests/task-management-v1.js.map +1 -1
  53. package/dist/manifests/team-analysis-v1.js.map +1 -1
  54. package/dist/manifests/themes-v1.js.map +1 -1
  55. package/dist/manifests/user-profiles-v1.js.map +1 -1
  56. package/dist/manifests.js +2 -7
  57. package/dist/manifests.js.map +1 -1
  58. package/dist/namespacePolicy.d.ts +6 -6
  59. package/dist/namespacePolicy.js.map +1 -1
  60. package/dist/proof-attestation.json +1 -1
  61. package/dist/registry.js +85 -66
  62. package/dist/registry.js.map +1 -1
  63. package/dist/runtime.d.ts +6 -6
  64. package/dist/runtime.js +83 -59
  65. package/dist/runtime.js.map +1 -1
  66. package/dist/serviceContracts.d.ts +4 -4
  67. package/dist/serviceContracts.js.map +1 -1
  68. package/package.json +1 -1
@@ -405,9 +405,14 @@ function checkDuplicateIds(items, idField, path) {
405
405
  }
406
406
  return issues;
407
407
  }
408
- function validateDomainPack(pack) {
409
- const issues = [];
410
- if (!pack.packId || !pack.packId.trim()) {
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 (!pack.name || !pack.name.trim()) {
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 (!pack.version || !pack.version.trim()) {
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
- } else {
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()) {
504
608
  issues.push(
505
- ...checkDuplicateIds(
506
- pack.topicRoots,
507
- "slug",
508
- "topicRoots"
609
+ ...validateInstallProfile(
610
+ profile,
611
+ index,
612
+ knownPromptIds,
613
+ knownToolIds,
614
+ knownAssetIds,
615
+ knownTopicSlugs
509
616
  )
510
617
  );
511
618
  }
512
- if (pack.operatingSystem) {
513
- const knownRootSlugs = new Set(
514
- pack.topicRoots?.map((topic) => topic.slug) ?? []
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
- const knownGateIds = new Set(pack.gates?.map((g) => g.gateId) ?? []);
617
- const knownArtifactIds = new Set(
618
- pack.artifacts?.map((a) => a.artifactId) ?? []
619
- );
620
- const knownRoleIds = new Set(pack.roles?.map((r) => r.roleId) ?? []);
621
- if (pack.gates) {
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
- ...checkDuplicateIds(
624
- pack.gates,
625
- "gateId",
626
- "gates"
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
- ...checkDuplicateIds(
653
- pack.artifacts,
654
- "artifactId",
655
- "artifacts"
656
- )
680
+ ...checkOptionalDuplicateIds(pack.artifacts, "artifactId", "artifacts")
657
681
  );
658
682
  }
659
- if (pack.workflows) {
660
- issues.push(
661
- ...checkDuplicateIds(
662
- pack.workflows,
663
- "workflowId",
664
- "workflows"
665
- )
666
- );
667
- for (const [wi, workflow] of pack.workflows.entries()) {
668
- for (const gateId of workflow.gateCheckpoints) {
669
- if (!knownGateIds.has(gateId)) {
670
- issues.push(
671
- issue(
672
- "UNKNOWN_GATE_REF",
673
- `Workflow "${workflow.workflowId}" references unknown gate "${gateId}"`,
674
- `workflows[${wi}].gateCheckpoints`
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
- if (pack.inquiryShaping) {
728
- if (pack.inquiryShaping.questionTemplates) {
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
- ...checkDuplicateIds(
731
- pack.inquiryShaping.questionTemplates,
732
- "templateId",
733
- "inquiryShaping.questionTemplates"
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
- if (pack.inquiryShaping.taskTemplates) {
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
- ...checkDuplicateIds(
743
- pack.inquiryShaping.taskTemplates,
744
- "templateId",
745
- "inquiryShaping.taskTemplates"
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
- if (pack.inquiryShaping.frameworkHints) {
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
- ...checkDuplicateIds(
755
- pack.inquiryShaping.frameworkHints.map((hint) => ({
756
- frameworkName: hint.frameworkName
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
@@ -785,7 +867,7 @@ var TASK_PRIORITY_WEIGHT = {
785
867
  };
786
868
  function dedupeStrings(values) {
787
869
  if (!values || values.length === 0) {
788
- return void 0;
870
+ return;
789
871
  }
790
872
  const normalized = values.map((value) => value.trim()).filter(Boolean);
791
873
  return normalized.length > 0 ? Array.from(new Set(normalized)) : void 0;
@@ -858,7 +940,11 @@ function checkDuplicateIds2(items, idField, path) {
858
940
  }
859
941
  if (seen.has(id)) {
860
942
  issues.push(
861
- issue2("DUPLICATE_ID", `Duplicate ${idField} "${id}"`, `${path}.${idField}`)
943
+ issue2(
944
+ "DUPLICATE_ID",
945
+ `Duplicate ${idField} "${id}"`,
946
+ `${path}.${idField}`
947
+ )
862
948
  );
863
949
  }
864
950
  seen.add(id);
@@ -984,7 +1070,9 @@ function createShapingContributionRegistry(packs = []) {
984
1070
  }
985
1071
  const packValidation = validateDomainPack(pack);
986
1072
  if (!packValidation.valid) {
987
- throw new Error(formatRegistrationIssues(pack.packId, packValidation.issues));
1073
+ throw new Error(
1074
+ formatRegistrationIssues(pack.packId, packValidation.issues)
1075
+ );
988
1076
  }
989
1077
  const contribution = buildShapingContribution(pack);
990
1078
  const contributionValidation = validateShapingContribution(contribution);
@@ -1304,7 +1392,13 @@ var DEVELOPER_REASONING_PACK = defineDomainPack({
1304
1392
  questionType: "counterfactual",
1305
1393
  priority: "high",
1306
1394
  template: "What existing behavior or verification path would regress if {{hypothesis}} is false?",
1307
- whenObjectiveIncludes: ["build", "implement", "add", "extend", "support"]
1395
+ whenObjectiveIncludes: [
1396
+ "build",
1397
+ "implement",
1398
+ "add",
1399
+ "extend",
1400
+ "support"
1401
+ ]
1308
1402
  }
1309
1403
  ],
1310
1404
  taskTemplates: [