@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.
Files changed (67) 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.map +1 -1
  40. package/dist/manifests/deals-v1.js +1 -6
  41. package/dist/manifests/deals-v1.js.map +1 -1
  42. package/dist/manifests/decisions-v1.js.map +1 -1
  43. package/dist/manifests/documents-v1.js.map +1 -1
  44. package/dist/manifests/epistemic-algorithms-v1.js.map +1 -1
  45. package/dist/manifests/graph-visualization-v1.js.map +1 -1
  46. package/dist/manifests/index.js +1 -6
  47. package/dist/manifests/index.js.map +1 -1
  48. package/dist/manifests/news-v1.js.map +1 -1
  49. package/dist/manifests/philosophy-mode-v1.js.map +1 -1
  50. package/dist/manifests/sprints-v1.js.map +1 -1
  51. package/dist/manifests/task-management-v1.js.map +1 -1
  52. package/dist/manifests/team-analysis-v1.js.map +1 -1
  53. package/dist/manifests/themes-v1.js.map +1 -1
  54. package/dist/manifests/user-profiles-v1.js.map +1 -1
  55. package/dist/manifests.js +1 -6
  56. package/dist/manifests.js.map +1 -1
  57. package/dist/namespacePolicy.d.ts +6 -6
  58. package/dist/namespacePolicy.js.map +1 -1
  59. package/dist/proof-attestation.json +1 -1
  60. package/dist/registry.js +84 -65
  61. package/dist/registry.js.map +1 -1
  62. package/dist/runtime.d.ts +6 -6
  63. package/dist/runtime.js +83 -59
  64. package/dist/runtime.js.map +1 -1
  65. package/dist/serviceContracts.d.ts +4 -4
  66. package/dist/serviceContracts.js.map +1 -1
  67. package/package.json +1 -1
@@ -4,18 +4,18 @@
4
4
  * Reference ontology snapshot for turnkey engineering packs. This gives
5
5
  * engineering-focused domain packs a real typed bundle to bind and seed.
6
6
  */
7
- type OntologyEntityTypeSnapshot = {
8
- value: string;
9
- label: string;
7
+ interface OntologyEntityTypeSnapshot {
10
8
  description: string;
11
- };
12
- type OntologyEdgeTypeSnapshot = {
13
- value: string;
14
9
  label: string;
10
+ value: string;
11
+ }
12
+ interface OntologyEdgeTypeSnapshot {
15
13
  description: string;
14
+ label: string;
16
15
  sourceTypes?: string[];
17
16
  targetTypes?: string[];
18
- };
17
+ value: string;
18
+ }
19
19
  declare const SOFTWARE_ENTITIES_V1: {
20
20
  readonly ontologyId: "software-entities";
21
21
  readonly version: "1.0.0";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/domain-pack/ontology/software-entities-v1.ts"],"names":[],"mappings":";AAqBO,IAAM,oBAAA,GAAuB;AAAA,EAClC,UAAA,EAAY,mBAAA;AAAA,EACZ,OAAA,EAAS,OAAA;AAAA,EACT,IAAA,EAAM,mBAAA;AAAA,EACN,WAAA,EACE,oIAAA;AAAA,EACF,WAAA,EAAa;AAAA,IACX;AAAA,MACE,KAAA,EAAO,YAAA;AAAA,MACP,KAAA,EAAO,YAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,SAAA;AAAA,MACP,KAAA,EAAO,SAAA;AAAA,MACP,WAAA,EAAa;AAAA,KACf;AAAA,IACA;AAAA,MACE,KAAA,EAAO,QAAA;AAAA,MACP,KAAA,EAAO,QAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,UAAA;AAAA,MACP,KAAA,EAAO,UAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,WAAA;AAAA,MACP,KAAA,EAAO,WAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,UAAA;AAAA,MACP,KAAA,EAAO,UAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,iBAAA;AAAA,MACP,KAAA,EAAO,iBAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,OAAA;AAAA,MACP,KAAA,EAAO,OAAA;AAAA,MACP,WA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,IACA;AAAA,MACE,KAAA,EAAO,WAAA;AAAA,MACP,KAAA,EAAO,WAAA;AAAA,MACP,WAAA,EACE,gEAAA;AAAA,MACF,WAAA,EAAa,CAAC,UAAA,EAAY,WAAW,CAAA;AAAA,MACrC,WAAA,EAAa,CAAC,UAAA,EAAY,SAAA,EAAW,QAAQ;AAAA,KAC/C;AAAA,IACA;AAAA,MACE,KAAA,EAAO,YAAA;AAAA,MACP,KAAA,EAAO,YAAA;AAAA,MACP,WAAA,EACE,0EAAA;AAAA,MACF,WAAA,EAAa,CAAC,iBAAA,EAAmB,WAAA,EAAa,UAAU,CAAA;AAAA,MACxD,WAAA,EAAa,CAAC,iBAAA,EAAmB,WAAA,EAAa,UAAU;AAAA;AAC1D;AAEJ","file":"software-entities-v1.js","sourcesContent":["/**\n * Software Entities Ontology Snapshot v1.0.0\n *\n * Reference ontology snapshot for turnkey engineering packs. This gives\n * engineering-focused domain packs a real typed bundle to bind and seed.\n */\n\nexport type OntologyEntityTypeSnapshot = {\n value: string;\n label: string;\n description: string;\n};\n\nexport type OntologyEdgeTypeSnapshot = {\n value: string;\n label: string;\n description: string;\n sourceTypes?: string[];\n targetTypes?: string[];\n};\n\nexport const SOFTWARE_ENTITIES_V1 = {\n ontologyId: \"software-entities\",\n version: \"1.0.0\",\n name: \"Software Entities\",\n description:\n \"Core software-delivery ontology for repositories, services, modules, changes, incidents, and agent-assisted engineering workflows.\",\n entityTypes: [\n {\n value: \"repository\",\n label: \"Repository\",\n description:\n \"Source repository or monorepo boundary under active ownership.\",\n },\n {\n value: \"service\",\n label: \"Service\",\n description: \"Deployable service, application, or runtime surface.\",\n },\n {\n value: \"module\",\n label: \"Module\",\n description:\n \"Logical code module, package, or subsystem within a service.\",\n },\n {\n value: \"workflow\",\n label: \"Workflow\",\n description:\n \"Repeatable engineering workflow such as review, migration, or incident response.\",\n },\n {\n value: \"migration\",\n label: \"Migration\",\n description:\n \"Schema, API, or rollout change with sequencing and rollback concerns.\",\n },\n {\n value: \"incident\",\n label: \"Incident\",\n description:\n \"Operational incident, outage, or regression requiring triage and mitigation.\",\n },\n {\n value: \"decision_record\",\n label: \"Decision Record\",\n description:\n \"Architecture decision, rationale record, or precedent artifact.\",\n },\n {\n value: \"agent\",\n label: \"Agent\",\n description:\n \"Configured AI worker or assistant participating in engineering workflows.\",\n },\n ] as const satisfies readonly OntologyEntityTypeSnapshot[],\n edgeTypes: [\n {\n value: \"depends_on\",\n label: \"Depends On\",\n description:\n \"A repository, service, module, or workflow depends on another surface.\",\n sourceTypes: [\"repository\", \"service\", \"module\", \"workflow\", \"migration\"],\n targetTypes: [\"repository\", \"service\", \"module\", \"workflow\", \"migration\"],\n },\n {\n value: \"owns\",\n label: \"Owns\",\n description:\n \"An agent or service owns a module, workflow, or decision record.\",\n sourceTypes: [\"agent\", \"service\"],\n targetTypes: [\"module\", \"workflow\", \"decision_record\"],\n },\n {\n value: \"calls\",\n label: \"Calls\",\n description:\n \"A repository, service, or module invokes another service or module.\",\n sourceTypes: [\"repository\", \"service\", \"module\"],\n targetTypes: [\"service\", \"module\"],\n },\n {\n value: \"blocks\",\n label: \"Blocks\",\n description:\n \"An incident, migration, or workflow blocks another engineering surface.\",\n sourceTypes: [\"incident\", \"migration\", \"workflow\"],\n targetTypes: [\"migration\", \"workflow\", \"service\", \"decision_record\"],\n },\n {\n value: \"reviews\",\n label: \"Reviews\",\n description:\n \"An agent or workflow reviews a change, module, or migration.\",\n sourceTypes: [\"agent\", \"workflow\"],\n targetTypes: [\"module\", \"migration\", \"decision_record\"],\n },\n {\n value: \"mitigates\",\n label: \"Mitigates\",\n description:\n \"A workflow or migration mitigates an incident or risky change.\",\n sourceTypes: [\"workflow\", \"migration\"],\n targetTypes: [\"incident\", \"service\", \"module\"],\n },\n {\n value: \"supersedes\",\n label: \"Supersedes\",\n description:\n \"A newer decision record, migration, or workflow replaces an earlier one.\",\n sourceTypes: [\"decision_record\", \"migration\", \"workflow\"],\n targetTypes: [\"decision_record\", \"migration\", \"workflow\"],\n },\n ] as const satisfies readonly OntologyEdgeTypeSnapshot[],\n} as const;\n"]}
1
+ {"version":3,"sources":["../../../src/domain-pack/ontology/software-entities-v1.ts"],"names":[],"mappings":";AAqBO,IAAM,oBAAA,GAAuB;AAAA,EAClC,UAAA,EAAY,mBAAA;AAAA,EACZ,OAAA,EAAS,OAAA;AAAA,EACT,IAAA,EAAM,mBAAA;AAAA,EACN,WAAA,EACE,oIAAA;AAAA,EACF,WAAA,EAAa;AAAA,IACX;AAAA,MACE,KAAA,EAAO,YAAA;AAAA,MACP,KAAA,EAAO,YAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,SAAA;AAAA,MACP,KAAA,EAAO,SAAA;AAAA,MACP,WAAA,EAAa;AAAA,KACf;AAAA,IACA;AAAA,MACE,KAAA,EAAO,QAAA;AAAA,MACP,KAAA,EAAO,QAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,UAAA;AAAA,MACP,KAAA,EAAO,UAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,WAAA;AAAA,MACP,KAAA,EAAO,WAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,UAAA;AAAA,MACP,KAAA,EAAO,UAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,iBAAA;AAAA,MACP,KAAA,EAAO,iBAAA;AAAA,MACP,WAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,EAAO,OAAA;AAAA,MACP,KAAA,EAAO,OAAA;AAAA,MACP,WAAA,EACE;AAAA;AACJ,GACF;AAAA,EACA,SAAA,EAAW;AAAA,IACT;AAAA,MACE,KAAA,EAAO,YAAA;AAAA,MACP,KAAA,EAAO,YAAA;AAAA,MACP,WAAA,E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AAW,CAAA;AAAA,MACrC,WAAA,EAAa,CAAC,UAAA,EAAY,SAAA,EAAW,QAAQ;AAAA,KAC/C;AAAA,IACA;AAAA,MACE,KAAA,EAAO,YAAA;AAAA,MACP,KAAA,EAAO,YAAA;AAAA,MACP,WAAA,EACE,0EAAA;AAAA,MACF,WAAA,EAAa,CAAC,iBAAA,EAAmB,WAAA,EAAa,UAAU,CAAA;AAAA,MACxD,WAAA,EAAa,CAAC,iBAAA,EAAmB,WAAA,EAAa,UAAU;AAAA;AAC1D;AAEJ","file":"software-entities-v1.js","sourcesContent":["/**\n * Software Entities Ontology Snapshot v1.0.0\n *\n * Reference ontology snapshot for turnkey engineering packs. This gives\n * engineering-focused domain packs a real typed bundle to bind and seed.\n */\n\nexport interface OntologyEntityTypeSnapshot {\n description: string;\n label: string;\n value: string;\n}\n\nexport interface OntologyEdgeTypeSnapshot {\n description: string;\n label: string;\n sourceTypes?: string[];\n targetTypes?: string[];\n value: string;\n}\n\nexport const SOFTWARE_ENTITIES_V1 = {\n ontologyId: \"software-entities\",\n version: \"1.0.0\",\n name: \"Software Entities\",\n description:\n \"Core software-delivery ontology for repositories, services, modules, changes, incidents, and agent-assisted engineering workflows.\",\n entityTypes: [\n {\n value: \"repository\",\n label: \"Repository\",\n description:\n \"Source repository or monorepo boundary under active ownership.\",\n },\n {\n value: \"service\",\n label: \"Service\",\n description: \"Deployable service, application, or runtime surface.\",\n },\n {\n value: \"module\",\n label: \"Module\",\n description:\n \"Logical code module, package, or subsystem within a service.\",\n },\n {\n value: \"workflow\",\n label: \"Workflow\",\n description:\n \"Repeatable engineering workflow such as review, migration, or incident response.\",\n },\n {\n value: \"migration\",\n label: \"Migration\",\n description:\n \"Schema, API, or rollout change with sequencing and rollback concerns.\",\n },\n {\n value: \"incident\",\n label: \"Incident\",\n description:\n \"Operational incident, outage, or regression requiring triage and mitigation.\",\n },\n {\n value: \"decision_record\",\n label: \"Decision Record\",\n description:\n \"Architecture decision, rationale record, or precedent artifact.\",\n },\n {\n value: \"agent\",\n label: \"Agent\",\n description:\n \"Configured AI worker or assistant participating in engineering workflows.\",\n },\n ] as const satisfies readonly OntologyEntityTypeSnapshot[],\n edgeTypes: [\n {\n value: \"depends_on\",\n label: \"Depends On\",\n description:\n \"A repository, service, module, or workflow depends on another surface.\",\n sourceTypes: [\"repository\", \"service\", \"module\", \"workflow\", \"migration\"],\n targetTypes: [\"repository\", \"service\", \"module\", \"workflow\", \"migration\"],\n },\n {\n value: \"owns\",\n label: \"Owns\",\n description:\n \"An agent or service owns a module, workflow, or decision record.\",\n sourceTypes: [\"agent\", \"service\"],\n targetTypes: [\"module\", \"workflow\", \"decision_record\"],\n },\n {\n value: \"calls\",\n label: \"Calls\",\n description:\n \"A repository, service, or module invokes another service or module.\",\n sourceTypes: [\"repository\", \"service\", \"module\"],\n targetTypes: [\"service\", \"module\"],\n },\n {\n value: \"blocks\",\n label: \"Blocks\",\n description:\n \"An incident, migration, or workflow blocks another engineering surface.\",\n sourceTypes: [\"incident\", \"migration\", \"workflow\"],\n targetTypes: [\"migration\", \"workflow\", \"service\", \"decision_record\"],\n },\n {\n value: \"reviews\",\n label: \"Reviews\",\n description:\n \"An agent or workflow reviews a change, module, or migration.\",\n sourceTypes: [\"agent\", \"workflow\"],\n targetTypes: [\"module\", \"migration\", \"decision_record\"],\n },\n {\n value: \"mitigates\",\n label: \"Mitigates\",\n description:\n \"A workflow or migration mitigates an incident or risky change.\",\n sourceTypes: [\"workflow\", \"migration\"],\n targetTypes: [\"incident\", \"service\", \"module\"],\n },\n {\n value: \"supersedes\",\n label: \"Supersedes\",\n description:\n \"A newer decision record, migration, or workflow replaces an earlier one.\",\n sourceTypes: [\"decision_record\", \"migration\", \"workflow\"],\n targetTypes: [\"decision_record\", \"migration\", \"workflow\"],\n },\n ] as const satisfies readonly OntologyEdgeTypeSnapshot[],\n} as const;\n"]}
@@ -294,7 +294,13 @@ var DEVELOPER_REASONING_PACK = defineDomainPack({
294
294
  questionType: "counterfactual",
295
295
  priority: "high",
296
296
  template: "What existing behavior or verification path would regress if {{hypothesis}} is false?",
297
- whenObjectiveIncludes: ["build", "implement", "add", "extend", "support"]
297
+ whenObjectiveIncludes: [
298
+ "build",
299
+ "implement",
300
+ "add",
301
+ "extend",
302
+ "support"
303
+ ]
298
304
  }
299
305
  ],
300
306
  taskTemplates: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/domain-pack/contracts.ts","../../../src/domain-pack/packs/developer-reasoning.ts"],"names":[],"mappings":";AAoSA,SAAS,cAAc,MAAA,EAA4B;AACjD,EAAA,OAAO,KAAA,CAAM,IAAA;AAAA,IACX,IAAI,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,CAAC,MAAM,CAAA,CAAE,IAAA,EAAM,CAAA,CAAE,OAAO,CAAC,CAAA,KAAM,CAAA,CAAE,MAAA,GAAS,CAAC,CAAC;AAAA,GACjE;AACF;AAMA,SAAS,wBACP,MAAA,EAC6B;AAC7B,EAAA,OAAO,MAAA,GAAU,aAAA,CAAc,MAAM,CAAA,GAAwB,MAAA;AAC/D;AAEA,SAAS,yBAAyB,OAAA,EAA2C;AAC3E,EAAA,OAAO;AAAA,IACL,GAAG,OAAA;AAAA,IACH,qBAAqB,OAAA,CAAQ,mBAAA,GACzB,aAAA,CAAc,OAAA,CAAQ,mBAAmB,CAAA,GACzC,MAAA;AAAA,IACJ,mBAAmB,OAAA,CAAQ,iBAAA,GACvB,aAAA,CAAc,OAAA,CAAQ,iBAAiB,CAAA,GACvC;AAAA,GACN;AACF;AAEA,SAAS,yBACP,KAAA,EACkC;AAClC,EAAA,IAAI,CAAC,KAAA,EAAO;AACV,IAAA;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,KAAA,CAAM,OAAA,EAAS,GAAA,CAAI,CAAC,MAAA,MAAY;AAAA,MACvC,GAAG,MAAA;AAAA,MACH,cAAA,EAAgB,uBAAA,CAAwB,MAAA,CAAO,cAAc;AAAA,KAC/D,CAAE,C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AAA;AAAA,QACf,qBAAA,EAAuB,CAAC,SAAA,EAAW,UAAA,EAAY,OAAO,UAAU,CAAA;AAAA,QAChE,KAAA,EAAO,IAAA;AAAA,QACP,MAAA,EAAQ;AAAA,OACV;AAAA,MACA;AAAA,QACE,aAAA,EAAe,YAAA;AAAA,QACf,iBAAA,EAAmB,CAAC,eAAA,EAAiB,gBAAgB,CAAA;AAAA,QACrD,KAAA,EAAO,GAAA;AAAA,QACP,MAAA,EAAQ;AAAA;AACV;AACF,GACF;AAAA,EAEA,iBAAA,EAAmB;AACrB,CAAC","file":"developer-reasoning.js","sourcesContent":["/**\n * Domain Pack Contracts\n *\n * A DomainPack is a self-contained reasoning context bundle that defines\n * how reasoning works in a specific domain. It binds ontology versions,\n * defines topic structure, declares workflow templates, gate schemas,\n * artifact schemas, and reasoning roles.\n *\n * This is the THIRD pack type in Lucern's architecture:\n * - AppPackManifest: UI routes, surfaces, policy profiles (app-level)\n * - MethodologyPack: Agent workflow phases, gates, enforcement (process-level)\n * - DomainPack: Reasoning domain context (domain-level)\n *\n * All fields are internal until RS-5+ external authoring certification.\n */\n\n// ---------------------------------------------------------------------------\n// Ontology Binding — ties a pack to specific ontology versions\n// ---------------------------------------------------------------------------\n\nexport type OntologyProvisionMode = \"bind\" | \"seed\" | \"extend\";\n\nexport type OntologyBinding = {\n ontologyId: string;\n versionConstraint: string; // semver range, e.g., \"^1.0.0\"\n required: boolean;\n provisionMode?: OntologyProvisionMode;\n seedRef?: string;\n requiredEntityTypes?: string[];\n requiredEdgeTypes?: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Topic Root — defines the domain's top-level topic tree structure\n// ---------------------------------------------------------------------------\n\nexport type TopicRoot = {\n slug: string;\n name: string;\n description: string;\n ontologyId?: string; // which ontology governs this root\n};\n\n// ---------------------------------------------------------------------------\n// Workflow Template — shape of a workflow (not execution logic)\n// ---------------------------------------------------------------------------\n\nexport type WorkflowStep = {\n stepId: string;\n name: string;\n description: string;\n requiredRoles: string[]; // roleId references\n produces?: string[]; // artifactId references\n gateId?: string; // gate checked after this step\n};\n\nexport type WorkflowTemplate = {\n workflowId: string;\n name: string;\n description: string;\n steps: WorkflowStep[];\n requiredArtifacts: string[]; // artifactId references\n gateCheckpoints: string[]; // gateId references\n};\n\n// ---------------------------------------------------------------------------\n// Gate Schema — declarative description of what must be true\n// ---------------------------------------------------------------------------\n\nexport type GateCriterionOperator = \"gte\" | \"lte\" | \"eq\" | \"gt\" | \"lt\";\n\nexport type GateCriterion = {\n criterionId: string;\n description: string;\n metric: string;\n threshold?: number;\n operator?: GateCriterionOperator;\n};\n\nexport type GateSeverity = \"blocking\" | \"warning\" | \"informational\";\n\nexport type GateSchema = {\n gateId: string;\n name: string;\n description: string;\n criteria: GateCriterion[];\n severity: GateSeverity;\n};\n\n// ---------------------------------------------------------------------------\n// Artifact Schema — what artifacts workflows produce\n// ---------------------------------------------------------------------------\n\nexport type ArtifactSchema = {\n artifactId: string;\n name: string;\n description: string;\n stage: string; // workflow step that produces this\n contentSchema: Record<string, unknown>; // JSON Schema for content\n requiredFields: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Reasoning Role — epistemic actors in the domain\n// ---------------------------------------------------------------------------\n\nexport type ReasoningRole = {\n roleId: string;\n name: string;\n description: string;\n perspective: string;\n optimizesFor: string;\n mayBlock: boolean; // Epistemic Invariant #13: agents may block progress\n};\n\n// ---------------------------------------------------------------------------\n// Inquiry Shaping — pack-level hooks for RS-3 auto-shaping\n// ---------------------------------------------------------------------------\n\nexport type InquiryShapingQuestionTemplate = {\n templateId: string;\n questionType:\n | \"validation\"\n | \"falsification\"\n | \"assumption_probe\"\n | \"counterfactual\"\n | \"scope\"\n | \"comparison\"\n | \"mechanism\"\n | \"general\";\n priority?: \"critical\" | \"high\" | \"medium\" | \"low\";\n template: string; // Supports {{objective}} and {{hypothesis}}\n whenObjectiveIncludes?: string[];\n};\n\nexport type InquiryShapingTaskTemplate = {\n templateId: string;\n title: string; // Supports {{objective}} and {{hypothesis}}\n description?: string; // Supports {{objective}} and {{hypothesis}}\n taskType?:\n | \"general\"\n | \"find_evidence\"\n | \"verify_claim\"\n | \"research\"\n | \"review\"\n | \"interview\"\n | \"analysis\"\n | \"track_metrics\";\n priority?: \"urgent\" | \"high\" | \"medium\" | \"low\";\n whenObjectiveIncludes?: string[];\n whenQuestionTypes?: string[];\n};\n\nexport type InquiryShapingFrameworkHint = {\n frameworkName: string;\n whenObjectiveIncludes?: string[];\n whenQuestionTypes?: string[];\n boost?: number;\n reason?: string;\n};\n\nexport type InquiryShapingConfig = {\n questionTemplates?: InquiryShapingQuestionTemplate[];\n taskTemplates?: InquiryShapingTaskTemplate[];\n frameworkHints?: InquiryShapingFrameworkHint[];\n};\n\n// ---------------------------------------------------------------------------\n// Operating System Layer — prompts, tools, topic bootstrap, install surfaces\n// ---------------------------------------------------------------------------\n\nexport type RuntimeTarget = \"claude-code\" | \"codex\" | \"hybrid\" | \"portable\";\n\nexport type PromptSource = \"langfuse\" | \"file\";\nexport type PromptChannel =\n | \"bootstrap\"\n | \"workflow\"\n | \"analysis\"\n | \"review\"\n | \"tool\";\n\nexport type PromptBinding = {\n promptId: string;\n description: string;\n source: PromptSource;\n ref: string;\n fallbackRef?: string;\n channel: PromptChannel;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n};\n\nexport type ToolKind = \"mcp\" | \"cli\" | \"script\" | \"hook\" | \"ai-tool\";\n\nexport type ToolBinding = {\n toolId: string;\n description: string;\n kind: ToolKind;\n entrypoint: string;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n};\n\nexport type SetupAssetKind =\n | \"instruction\"\n | \"settings\"\n | \"hook\"\n | \"skill\"\n | \"agent\"\n | \"manifest\"\n | \"template\"\n | \"inbox\"\n | \"script\"\n | \"ui\";\n\nexport type SetupAsset = {\n assetId: string;\n kind: SetupAssetKind;\n description: string;\n path: string;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n};\n\nexport type TopicTemplate = {\n slug: string;\n name: string;\n description: string;\n parentSlug?: string;\n ontologyId?: string;\n};\n\nexport type InstallProfile = {\n profileId: string;\n name: string;\n description: string;\n runtimeTarget: RuntimeTarget;\n promptIds: string[];\n toolIds: string[];\n assetIds: string[];\n defaultTopicSlugs: string[];\n};\n\nexport type OperatingSystemLayer = {\n prompts?: PromptBinding[];\n tools?: ToolBinding[];\n setupAssets?: SetupAsset[];\n topicTemplates?: TopicTemplate[];\n installProfiles?: InstallProfile[];\n};\n\n// ---------------------------------------------------------------------------\n// Domain Pack — the top-level contract\n// ---------------------------------------------------------------------------\n\nexport type DomainPack = {\n // Identity\n packId: string;\n name: string;\n version: string; // semver\n\n // Scope\n ontologyBindings: OntologyBinding[];\n topicRoots: TopicRoot[];\n\n // Workflow Templates\n workflows: WorkflowTemplate[];\n\n // Gate Schemas\n gates: GateSchema[];\n\n // Artifact Schemas\n artifacts: ArtifactSchema[];\n\n // Reasoning Roles\n roles: ReasoningRole[];\n\n // Inquiry shaping hooks\n inquiryShaping?: InquiryShapingConfig;\n\n // Runtime/install packaging layer\n operatingSystem?: OperatingSystemLayer;\n\n // Composition — optional references to other pack types\n appPackKeys?: string[]; // AppPackManifest keys this domain uses\n methodologyPackId?: string; // MethodologyPack for agent behavior\n};\n\n// ---------------------------------------------------------------------------\n// Builder helper — normalizes arrays and validates basic structure\n// ---------------------------------------------------------------------------\n\nfunction dedupeStrings(values: string[]): string[] {\n return Array.from(\n new Set(values.map((v) => v.trim()).filter((v) => v.length > 0))\n );\n}\n\nexport type DomainPackInput = Omit<DomainPack, \"appPackKeys\"> & {\n appPackKeys?: string[];\n};\n\nfunction normalizeRuntimeTargets(\n values: RuntimeTarget[] | undefined\n): RuntimeTarget[] | undefined {\n return values ? (dedupeStrings(values) as RuntimeTarget[]) : undefined;\n}\n\nfunction normalizeOntologyBinding(binding: OntologyBinding): OntologyBinding {\n return {\n ...binding,\n requiredEntityTypes: binding.requiredEntityTypes\n ? dedupeStrings(binding.requiredEntityTypes)\n : undefined,\n requiredEdgeTypes: binding.requiredEdgeTypes\n ? dedupeStrings(binding.requiredEdgeTypes)\n : undefined,\n };\n}\n\nfunction normalizeOperatingSystem(\n layer: OperatingSystemLayer | undefined\n): OperatingSystemLayer | undefined {\n if (!layer) {\n return;\n }\n\n return {\n prompts: layer.prompts?.map((prompt) => ({\n ...prompt,\n runtimeTargets: normalizeRuntimeTargets(prompt.runtimeTargets),\n })),\n tools: layer.tools?.map((tool) => ({\n ...tool,\n runtimeTargets: normalizeRuntimeTargets(tool.runtimeTargets),\n })),\n setupAssets: layer.setupAssets?.map((asset) => ({\n ...asset,\n runtimeTargets: normalizeRuntimeTargets(asset.runtimeTargets),\n })),\n topicTemplates: layer.topicTemplates,\n installProfiles: layer.installProfiles?.map((profile) => ({\n ...profile,\n promptIds: dedupeStrings(profile.promptIds),\n toolIds: dedupeStrings(profile.toolIds),\n assetIds: dedupeStrings(profile.assetIds),\n defaultTopicSlugs: dedupeStrings(profile.defaultTopicSlugs),\n })),\n };\n}\n\nexport function defineDomainPack(input: DomainPackInput): DomainPack {\n return {\n ...input,\n ontologyBindings: input.ontologyBindings.map(normalizeOntologyBinding),\n appPackKeys: input.appPackKeys\n ? dedupeStrings(input.appPackKeys)\n : undefined,\n operatingSystem: normalizeOperatingSystem(input.operatingSystem),\n workflows: input.workflows.map((w) => ({\n ...w,\n requiredArtifacts: dedupeStrings(w.requiredArtifacts),\n gateCheckpoints: dedupeStrings(w.gateCheckpoints),\n steps: w.steps.map((s) => ({\n ...s,\n requiredRoles: dedupeStrings(s.requiredRoles),\n produces: s.produces ? dedupeStrings(s.produces) : undefined,\n })),\n })),\n };\n}\n","/**\n * Domain Pack: Developer Reasoning\n *\n * Reference domain pack for AI-assisted software development reasoning.\n * This is the pack Lucern uses internally — a generic reasoning harness\n * for code development with beliefs, evidence, and structured workflows.\n *\n * Domain-neutral: demonstrates the contract without tenant-specific IP.\n */\n\nimport { defineDomainPack } from \"../contracts\";\n\nexport const DEVELOPER_REASONING_PACK = defineDomainPack({\n packId: \"developer-reasoning\",\n name: \"Developer Reasoning\",\n version: \"1.0.0\",\n\n ontologyBindings: [\n {\n ontologyId: \"software-entities\",\n versionConstraint: \"^1.0.0\",\n required: true,\n },\n ],\n\n topicRoots: [\n {\n slug: \"architecture\",\n name: \"Architecture\",\n description: \"System architecture decisions and trade-offs\",\n ontologyId: \"software-entities\",\n },\n {\n slug: \"implementation\",\n name: \"Implementation\",\n description: \"Active implementation work and worktrees\",\n ontologyId: \"software-entities\",\n },\n {\n slug: \"operations\",\n name: \"Operations\",\n description: \"Deployment, observability, and operational concerns\",\n },\n ],\n\n workflows: [\n {\n workflowId: \"worktree-lifecycle\",\n name: \"Worktree Lifecycle\",\n description:\n \"Structured development cycle from scoping through implementation and review\",\n steps: [\n {\n stepId: \"scope\",\n name: \"Scope & Context\",\n description:\n \"Read graph context, identify constraints and prior decisions\",\n requiredRoles: [\"investigator\"],\n produces: [\"scope-artifact\"],\n },\n {\n stepId: \"plan\",\n name: \"Plan\",\n description:\n \"Design implementation approach informed by graph beliefs\",\n requiredRoles: [\"investigator\", \"critic\"],\n produces: [\"plan-artifact\"],\n gateId: \"plan-reviewed\",\n },\n {\n stepId: \"build\",\n name: \"Build\",\n description: \"Implement with in-flight graph writeback\",\n requiredRoles: [\"implementer\"],\n produces: [\"implementation-artifact\"],\n },\n {\n stepId: \"review\",\n name: \"Review\",\n description:\n \"Validate implementation against plan, tests, and type safety\",\n requiredRoles: [\"critic\"],\n produces: [\"review-artifact\"],\n gateId: \"review-passed\",\n },\n ],\n requiredArtifacts: [\"scope-artifact\", \"implementation-artifact\"],\n gateCheckpoints: [\"plan-reviewed\", \"review-passed\"],\n },\n ],\n\n gates: [\n {\n gateId: \"plan-reviewed\",\n name: \"Plan Reviewed\",\n description: \"Implementation plan has been reviewed for feasibility\",\n criteria: [\n {\n criterionId: \"constraints-checked\",\n description:\n \"Plan respects high-credence beliefs (>= 0.90) as constraints\",\n metric: \"constraint_violations\",\n threshold: 0,\n operator: \"eq\",\n },\n {\n criterionId: \"scope-bounded\",\n description: \"Plan stays within declared file and concern scope\",\n metric: \"scope_bounded\",\n threshold: 1,\n operator: \"eq\",\n },\n ],\n severity: \"blocking\",\n },\n {\n gateId: \"review-passed\",\n name: \"Review Passed\",\n description: \"Implementation passes type checks, tests, and review\",\n criteria: [\n {\n criterionId: \"types-clean\",\n description: \"TypeScript check passes (npx tsc --noEmit)\",\n metric: \"tsc_errors\",\n threshold: 0,\n operator: \"eq\",\n },\n {\n criterionId: \"tests-passing\",\n description: \"All relevant tests pass\",\n metric: \"test_pass_ratio\",\n threshold: 1.0,\n operator: \"eq\",\n },\n ],\n severity: \"blocking\",\n },\n ],\n\n artifacts: [\n {\n artifactId: \"scope-artifact\",\n name: \"Scope Context\",\n description:\n \"Graph context summary — beliefs, questions, constraints informing this work\",\n stage: \"scope\",\n contentSchema: {\n type: \"object\",\n properties: {\n beliefs: { type: \"array\", items: { type: \"string\" } },\n questions: { type: \"array\", items: { type: \"string\" } },\n constraints: { type: \"array\", items: { type: \"string\" } },\n },\n required: [\"beliefs\", \"constraints\"],\n },\n requiredFields: [\"beliefs\", \"constraints\"],\n },\n {\n artifactId: \"plan-artifact\",\n name: \"Implementation Plan\",\n description: \"Files to create/modify, approach, and test strategy\",\n stage: \"plan\",\n contentSchema: {\n type: \"object\",\n properties: {\n files: { type: \"array\", items: { type: \"string\" } },\n approach: { type: \"string\" },\n testStrategy: { type: \"string\" },\n },\n required: [\"files\", \"approach\"],\n },\n requiredFields: [\"files\", \"approach\"],\n },\n {\n artifactId: \"implementation-artifact\",\n name: \"Implementation Summary\",\n description: \"What was built, files changed, decisions made\",\n stage: \"build\",\n contentSchema: {\n type: \"object\",\n properties: {\n filesChanged: { type: \"array\", items: { type: \"string\" } },\n decisions: { type: \"array\", items: { type: \"string\" } },\n deferredWork: { type: \"array\", items: { type: \"string\" } },\n },\n required: [\"filesChanged\"],\n },\n requiredFields: [\"filesChanged\"],\n },\n {\n artifactId: \"review-artifact\",\n name: \"Review Summary\",\n description: \"Review findings, type check results, test results\",\n stage: \"review\",\n contentSchema: {\n type: \"object\",\n properties: {\n verdict: { type: \"string\", enum: [\"approve\", \"request-changes\"] },\n findings: { type: \"array\", items: { type: \"string\" } },\n testsPassing: { type: \"boolean\" },\n typesClean: { type: \"boolean\" },\n },\n required: [\"verdict\", \"testsPassing\", \"typesClean\"],\n },\n requiredFields: [\"verdict\", \"testsPassing\", \"typesClean\"],\n },\n ],\n\n roles: [\n {\n roleId: \"investigator\",\n name: \"Investigator\",\n description: \"Reads graph context and identifies relevant prior knowledge\",\n perspective: \"Context-aware, evidence-driven scoping\",\n optimizesFor: \"thoroughness of context retrieval and constraint identification\",\n mayBlock: false,\n },\n {\n roleId: \"implementer\",\n name: \"Implementer\",\n description: \"Writes code and records decisions in the graph\",\n perspective: \"Pragmatic, focused on working code within constraints\",\n optimizesFor: \"correctness and simplicity\",\n mayBlock: false,\n },\n {\n roleId: \"critic\",\n name: \"Critic\",\n description:\n \"Challenges assumptions, finds edge cases, and surfaces risks\",\n perspective: \"Skeptical, detail-oriented, adversarial testing\",\n optimizesFor: \"identifying weaknesses before they reach production\",\n mayBlock: true, // Epistemic Invariant #13\n },\n ],\n\n inquiryShaping: {\n questionTemplates: [\n {\n templateId: \"developer-boundary-falsifier\",\n questionType: \"falsification\",\n priority: \"high\",\n template:\n \"Which interface, contract, or boundary would fail first if {{objective}} is wrong?\",\n whenObjectiveIncludes: [\n \"build\",\n \"implement\",\n \"refactor\",\n \"integrate\",\n \"algorithm\",\n \"handler\",\n \"workflow\",\n ],\n },\n {\n templateId: \"developer-regression-counterfactual\",\n questionType: \"counterfactual\",\n priority: \"high\",\n template:\n \"What existing behavior or verification path would regress if {{hypothesis}} is false?\",\n whenObjectiveIncludes: [\"build\", \"implement\", \"add\", \"extend\", \"support\"],\n },\n ],\n taskTemplates: [\n {\n templateId: \"developer-contract-audit\",\n title: \"Audit adjacent contracts and invariants for {{objective}}\",\n description:\n \"Inspect the existing MCP, schema, and worktree contracts that constrain {{objective}} before changing runtime behavior.\",\n taskType: \"analysis\",\n priority: \"high\",\n whenObjectiveIncludes: [\"build\", \"implement\", \"extend\", \"support\"],\n },\n {\n templateId: \"developer-verification-pass\",\n title: \"Run focused verification for {{objective}}\",\n description:\n \"Add or update targeted tests and type-safety checks that would fail if {{hypothesis}} is wrong.\",\n taskType: \"review\",\n priority: \"medium\",\n whenObjectiveIncludes: [\"build\", \"implement\", \"algorithm\", \"workflow\"],\n whenQuestionTypes: [\"falsification\", \"counterfactual\"],\n },\n ],\n frameworkHints: [\n {\n frameworkName: \"Boundary Audit\",\n whenObjectiveIncludes: [\"handler\", \"contract\", \"api\", \"workflow\"],\n boost: 0.25,\n reason: \"Developer reasoning work benefits from explicit boundary checks.\",\n },\n {\n frameworkName: \"Pre-mortem\",\n whenQuestionTypes: [\"falsification\", \"counterfactual\"],\n boost: 0.2,\n reason: \"Stress-testing likely failure modes improves worktree shaping quality.\",\n },\n ],\n },\n\n methodologyPackId: \"developer\",\n});\n"]}
1
+ {"version":3,"sources":["../../../src/domain-pack/contracts.ts","../../../src/domain-pack/packs/developer-reasoning.ts"],"names":[],"mappings":";AAmSA,SAAS,cAAc,MAAA,EAA4B;AACjD,EAAA,OAAO,KAAA,CAAM,IAAA;AAAA,IACX,IAAI,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,CAAC,MAAM,CAAA,CAAE,IAAA,EAAM,CAAA,CAAE,OAAO,CAAC,CAAA,KAAM,CAAA,CAAE,MAAA,GAAS,CAAC,CAAC;AAAA,GACjE;AACF;AAMA,SAAS,wBACP,MAAA,EAC6B;AAC7B,EAAA,OAAO,MAAA,GAAU,aAAA,CAAc,MAAM,CAAA,GAAwB,MAAA;AAC/D;AAEA,SAAS,yBAAyB,OAAA,EAA2C;AAC3E,EAAA,OAAO;AAAA,IACL,GAAG,OAAA;AAAA,IACH,qBAAqB,OAAA,CAAQ,mBAAA,GACzB,aAAA,CAAc,OAAA,CAAQ,mBAAmB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AAAA,QACV,qBAAA,EAAuB,CAAC,OAAA,EAAS,WAAA,EAAa,UAAU,SAAS;AAAA,OACnE;AAAA,MACA;AAAA,QACE,UAAA,EAAY,6BAAA;AAAA,QACZ,KAAA,EAAO,4CAAA;AAAA,QACP,WAAA,EACE,iGAAA;AAAA,QACF,QAAA,EAAU,QAAA;AAAA,QACV,QAAA,EAAU,QAAA;AAAA,QACV,qBAAA,EAAuB,CAAC,OAAA,EAAS,WAAA,EAAa,aAAa,UAAU,CAAA;AAAA,QACrE,iBAAA,EAAmB,CAAC,eAAA,EAAiB,gBAAgB;AAAA;AACvD,KACF;AAAA,IACA,cAAA,EAAgB;AAAA,MACd;AAAA,QACE,aAAA,EAAe,gBAAA;AAAA,QACf,qBAAA,EAAuB,CAAC,SAAA,EAAW,UAAA,EAAY,OAAO,UAAU,CAAA;AAAA,QAChE,KAAA,EAAO,IAAA;AAAA,QACP,MAAA,EACE;AAAA,OACJ;AAAA,MACA;AAAA,QACE,aAAA,EAAe,YAAA;AAAA,QACf,iBAAA,EAAmB,CAAC,eAAA,EAAiB,gBAAgB,CAAA;AAAA,QACrD,KAAA,EAAO,GAAA;AAAA,QACP,MAAA,EACE;AAAA;AACJ;AACF,GACF;AAAA,EAEA,iBAAA,EAAmB;AACrB,CAAC","file":"developer-reasoning.js","sourcesContent":["/**\n * Domain Pack Contracts\n *\n * A DomainPack is a self-contained reasoning context bundle that defines\n * how reasoning works in a specific domain. It binds ontology versions,\n * defines topic structure, declares workflow templates, gate schemas,\n * artifact schemas, and reasoning roles.\n *\n * This is the THIRD pack type in Lucern's architecture:\n * - AppPackManifest: UI routes, surfaces, policy profiles (app-level)\n * - MethodologyPack: Agent workflow phases, gates, enforcement (process-level)\n * - DomainPack: Reasoning domain context (domain-level)\n *\n * All fields are internal until RS-5+ external authoring certification.\n */\n\n// ---------------------------------------------------------------------------\n// Ontology Binding — ties a pack to specific ontology versions\n// ---------------------------------------------------------------------------\n\nexport type OntologyProvisionMode = \"bind\" | \"seed\" | \"extend\";\n\nexport interface OntologyBinding {\n ontologyId: string;\n provisionMode?: OntologyProvisionMode;\n required: boolean;\n requiredEdgeTypes?: string[];\n requiredEntityTypes?: string[];\n seedRef?: string;\n versionConstraint: string; // semver range, e.g., \"^1.0.0\"\n}\n\n// ---------------------------------------------------------------------------\n// Topic Root — defines the domain's top-level topic tree structure\n// ---------------------------------------------------------------------------\n\nexport interface TopicRoot {\n description: string;\n name: string;\n ontologyId?: string; // which ontology governs this root\n slug: string;\n}\n\n// ---------------------------------------------------------------------------\n// Workflow Template — shape of a workflow (not execution logic)\n// ---------------------------------------------------------------------------\n\nexport interface WorkflowStep {\n description: string;\n gateId?: string; // gate checked after this step\n name: string;\n produces?: string[]; // artifactId references\n requiredRoles: string[]; // roleId references\n stepId: string;\n}\n\nexport interface WorkflowTemplate {\n description: string;\n gateCheckpoints: string[]; // gateId references\n name: string;\n requiredArtifacts: string[]; // artifactId references\n steps: WorkflowStep[];\n workflowId: string;\n}\n\n// ---------------------------------------------------------------------------\n// Gate Schema — declarative description of what must be true\n// ---------------------------------------------------------------------------\n\nexport type GateCriterionOperator = \"gte\" | \"lte\" | \"eq\" | \"gt\" | \"lt\";\n\nexport interface GateCriterion {\n criterionId: string;\n description: string;\n metric: string;\n operator?: GateCriterionOperator;\n threshold?: number;\n}\n\nexport type GateSeverity = \"blocking\" | \"warning\" | \"informational\";\n\nexport interface GateSchema {\n criteria: GateCriterion[];\n description: string;\n gateId: string;\n name: string;\n severity: GateSeverity;\n}\n\n// ---------------------------------------------------------------------------\n// Artifact Schema — what artifacts workflows produce\n// ---------------------------------------------------------------------------\n\nexport interface ArtifactSchema {\n artifactId: string;\n contentSchema: Record<string, unknown>; // JSON Schema for content\n description: string;\n name: string;\n requiredFields: string[];\n stage: string; // workflow step that produces this\n}\n\n// ---------------------------------------------------------------------------\n// Reasoning Role — epistemic actors in the domain\n// ---------------------------------------------------------------------------\n\nexport interface ReasoningRole {\n description: string;\n mayBlock: boolean; // Epistemic Invariant #13: agents may block progress\n name: string;\n optimizesFor: string;\n perspective: string;\n roleId: string;\n}\n\n// ---------------------------------------------------------------------------\n// Inquiry Shaping — pack-level hooks for RS-3 auto-shaping\n// ---------------------------------------------------------------------------\n\nexport interface InquiryShapingQuestionTemplate {\n priority?: \"critical\" | \"high\" | \"medium\" | \"low\";\n questionType:\n | \"validation\"\n | \"falsification\"\n | \"assumption_probe\"\n | \"counterfactual\"\n | \"scope\"\n | \"comparison\"\n | \"mechanism\"\n | \"general\";\n template: string; // Supports {{objective}} and {{hypothesis}}\n templateId: string;\n whenObjectiveIncludes?: string[];\n}\n\nexport interface InquiryShapingTaskTemplate {\n description?: string; // Supports {{objective}} and {{hypothesis}}\n priority?: \"urgent\" | \"high\" | \"medium\" | \"low\";\n taskType?:\n | \"general\"\n | \"find_evidence\"\n | \"verify_claim\"\n | \"research\"\n | \"review\"\n | \"interview\"\n | \"analysis\"\n | \"track_metrics\";\n templateId: string;\n title: string; // Supports {{objective}} and {{hypothesis}}\n whenObjectiveIncludes?: string[];\n whenQuestionTypes?: string[];\n}\n\nexport interface InquiryShapingFrameworkHint {\n boost?: number;\n frameworkName: string;\n reason?: string;\n whenObjectiveIncludes?: string[];\n whenQuestionTypes?: string[];\n}\n\nexport interface InquiryShapingConfig {\n frameworkHints?: InquiryShapingFrameworkHint[];\n questionTemplates?: InquiryShapingQuestionTemplate[];\n taskTemplates?: InquiryShapingTaskTemplate[];\n}\n\n// ---------------------------------------------------------------------------\n// Operating System Layer — prompts, tools, topic bootstrap, install surfaces\n// ---------------------------------------------------------------------------\n\nexport type RuntimeTarget = \"claude-code\" | \"codex\" | \"hybrid\" | \"portable\";\n\nexport type PromptSource = \"langfuse\" | \"file\";\nexport type PromptChannel =\n | \"bootstrap\"\n | \"workflow\"\n | \"analysis\"\n | \"review\"\n | \"tool\";\n\nexport interface PromptBinding {\n channel: PromptChannel;\n description: string;\n fallbackRef?: string;\n promptId: string;\n ref: string;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n source: PromptSource;\n}\n\nexport type ToolKind = \"mcp\" | \"cli\" | \"script\" | \"hook\" | \"ai-tool\";\n\nexport interface ToolBinding {\n description: string;\n entrypoint: string;\n kind: ToolKind;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n toolId: string;\n}\n\nexport type SetupAssetKind =\n | \"instruction\"\n | \"settings\"\n | \"hook\"\n | \"skill\"\n | \"agent\"\n | \"manifest\"\n | \"template\"\n | \"inbox\"\n | \"script\"\n | \"ui\";\n\nexport interface SetupAsset {\n assetId: string;\n description: string;\n kind: SetupAssetKind;\n path: string;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n}\n\nexport interface TopicTemplate {\n description: string;\n name: string;\n ontologyId?: string;\n parentSlug?: string;\n slug: string;\n}\n\nexport interface InstallProfile {\n assetIds: string[];\n defaultTopicSlugs: string[];\n description: string;\n name: string;\n profileId: string;\n promptIds: string[];\n runtimeTarget: RuntimeTarget;\n toolIds: string[];\n}\n\nexport interface OperatingSystemLayer {\n installProfiles?: InstallProfile[];\n prompts?: PromptBinding[];\n setupAssets?: SetupAsset[];\n tools?: ToolBinding[];\n topicTemplates?: TopicTemplate[];\n}\n\n// ---------------------------------------------------------------------------\n// Domain Pack — the top-level contract\n// ---------------------------------------------------------------------------\n\nexport interface DomainPack {\n // Composition — optional references to other pack types\n appPackKeys?: string[]; // AppPackManifest keys this domain uses\n\n // Artifact Schemas\n artifacts: ArtifactSchema[];\n\n // Gate Schemas\n gates: GateSchema[];\n\n // Inquiry shaping hooks\n inquiryShaping?: InquiryShapingConfig;\n methodologyPackId?: string; // MethodologyPack for agent behavior\n name: string;\n\n // Scope\n ontologyBindings: OntologyBinding[];\n\n // Runtime/install packaging layer\n operatingSystem?: OperatingSystemLayer;\n // Identity\n packId: string;\n\n // Reasoning Roles\n roles: ReasoningRole[];\n topicRoots: TopicRoot[];\n version: string; // semver\n\n // Workflow Templates\n workflows: WorkflowTemplate[];\n}\n\n// ---------------------------------------------------------------------------\n// Builder helper — normalizes arrays and validates basic structure\n// ---------------------------------------------------------------------------\n\nfunction dedupeStrings(values: string[]): string[] {\n return Array.from(\n new Set(values.map((v) => v.trim()).filter((v) => v.length > 0))\n );\n}\n\nexport type DomainPackInput = Omit<DomainPack, \"appPackKeys\"> & {\n appPackKeys?: string[];\n};\n\nfunction normalizeRuntimeTargets(\n values: RuntimeTarget[] | undefined\n): RuntimeTarget[] | undefined {\n return values ? (dedupeStrings(values) as RuntimeTarget[]) : undefined;\n}\n\nfunction normalizeOntologyBinding(binding: OntologyBinding): OntologyBinding {\n return {\n ...binding,\n requiredEntityTypes: binding.requiredEntityTypes\n ? dedupeStrings(binding.requiredEntityTypes)\n : undefined,\n requiredEdgeTypes: binding.requiredEdgeTypes\n ? dedupeStrings(binding.requiredEdgeTypes)\n : undefined,\n };\n}\n\nfunction normalizeOperatingSystem(\n layer: OperatingSystemLayer | undefined\n): OperatingSystemLayer | undefined {\n if (!layer) {\n return;\n }\n\n return {\n prompts: layer.prompts?.map((prompt) => ({\n ...prompt,\n runtimeTargets: normalizeRuntimeTargets(prompt.runtimeTargets),\n })),\n tools: layer.tools?.map((tool) => ({\n ...tool,\n runtimeTargets: normalizeRuntimeTargets(tool.runtimeTargets),\n })),\n setupAssets: layer.setupAssets?.map((asset) => ({\n ...asset,\n runtimeTargets: normalizeRuntimeTargets(asset.runtimeTargets),\n })),\n topicTemplates: layer.topicTemplates,\n installProfiles: layer.installProfiles?.map((profile) => ({\n ...profile,\n promptIds: dedupeStrings(profile.promptIds),\n toolIds: dedupeStrings(profile.toolIds),\n assetIds: dedupeStrings(profile.assetIds),\n defaultTopicSlugs: dedupeStrings(profile.defaultTopicSlugs),\n })),\n };\n}\n\nexport function defineDomainPack(input: DomainPackInput): DomainPack {\n return {\n ...input,\n ontologyBindings: input.ontologyBindings.map(normalizeOntologyBinding),\n appPackKeys: input.appPackKeys\n ? dedupeStrings(input.appPackKeys)\n : undefined,\n operatingSystem: normalizeOperatingSystem(input.operatingSystem),\n workflows: input.workflows.map((w) => ({\n ...w,\n requiredArtifacts: dedupeStrings(w.requiredArtifacts),\n gateCheckpoints: dedupeStrings(w.gateCheckpoints),\n steps: w.steps.map((s) => ({\n ...s,\n requiredRoles: dedupeStrings(s.requiredRoles),\n produces: s.produces ? dedupeStrings(s.produces) : undefined,\n })),\n })),\n };\n}\n","/**\n * Domain Pack: Developer Reasoning\n *\n * Reference domain pack for AI-assisted software development reasoning.\n * This is the pack Lucern uses internally — a generic reasoning harness\n * for code development with beliefs, evidence, and structured workflows.\n *\n * Domain-neutral: demonstrates the contract without tenant-specific IP.\n */\n\nimport { defineDomainPack } from \"../contracts\";\n\nexport const DEVELOPER_REASONING_PACK = defineDomainPack({\n packId: \"developer-reasoning\",\n name: \"Developer Reasoning\",\n version: \"1.0.0\",\n\n ontologyBindings: [\n {\n ontologyId: \"software-entities\",\n versionConstraint: \"^1.0.0\",\n required: true,\n },\n ],\n\n topicRoots: [\n {\n slug: \"architecture\",\n name: \"Architecture\",\n description: \"System architecture decisions and trade-offs\",\n ontologyId: \"software-entities\",\n },\n {\n slug: \"implementation\",\n name: \"Implementation\",\n description: \"Active implementation work and worktrees\",\n ontologyId: \"software-entities\",\n },\n {\n slug: \"operations\",\n name: \"Operations\",\n description: \"Deployment, observability, and operational concerns\",\n },\n ],\n\n workflows: [\n {\n workflowId: \"worktree-lifecycle\",\n name: \"Worktree Lifecycle\",\n description:\n \"Structured development cycle from scoping through implementation and review\",\n steps: [\n {\n stepId: \"scope\",\n name: \"Scope & Context\",\n description:\n \"Read graph context, identify constraints and prior decisions\",\n requiredRoles: [\"investigator\"],\n produces: [\"scope-artifact\"],\n },\n {\n stepId: \"plan\",\n name: \"Plan\",\n description:\n \"Design implementation approach informed by graph beliefs\",\n requiredRoles: [\"investigator\", \"critic\"],\n produces: [\"plan-artifact\"],\n gateId: \"plan-reviewed\",\n },\n {\n stepId: \"build\",\n name: \"Build\",\n description: \"Implement with in-flight graph writeback\",\n requiredRoles: [\"implementer\"],\n produces: [\"implementation-artifact\"],\n },\n {\n stepId: \"review\",\n name: \"Review\",\n description:\n \"Validate implementation against plan, tests, and type safety\",\n requiredRoles: [\"critic\"],\n produces: [\"review-artifact\"],\n gateId: \"review-passed\",\n },\n ],\n requiredArtifacts: [\"scope-artifact\", \"implementation-artifact\"],\n gateCheckpoints: [\"plan-reviewed\", \"review-passed\"],\n },\n ],\n\n gates: [\n {\n gateId: \"plan-reviewed\",\n name: \"Plan Reviewed\",\n description: \"Implementation plan has been reviewed for feasibility\",\n criteria: [\n {\n criterionId: \"constraints-checked\",\n description:\n \"Plan respects high-credence beliefs (>= 0.90) as constraints\",\n metric: \"constraint_violations\",\n threshold: 0,\n operator: \"eq\",\n },\n {\n criterionId: \"scope-bounded\",\n description: \"Plan stays within declared file and concern scope\",\n metric: \"scope_bounded\",\n threshold: 1,\n operator: \"eq\",\n },\n ],\n severity: \"blocking\",\n },\n {\n gateId: \"review-passed\",\n name: \"Review Passed\",\n description: \"Implementation passes type checks, tests, and review\",\n criteria: [\n {\n criterionId: \"types-clean\",\n description: \"TypeScript check passes (npx tsc --noEmit)\",\n metric: \"tsc_errors\",\n threshold: 0,\n operator: \"eq\",\n },\n {\n criterionId: \"tests-passing\",\n description: \"All relevant tests pass\",\n metric: \"test_pass_ratio\",\n threshold: 1.0,\n operator: \"eq\",\n },\n ],\n severity: \"blocking\",\n },\n ],\n\n artifacts: [\n {\n artifactId: \"scope-artifact\",\n name: \"Scope Context\",\n description:\n \"Graph context summary — beliefs, questions, constraints informing this work\",\n stage: \"scope\",\n contentSchema: {\n type: \"object\",\n properties: {\n beliefs: { type: \"array\", items: { type: \"string\" } },\n questions: { type: \"array\", items: { type: \"string\" } },\n constraints: { type: \"array\", items: { type: \"string\" } },\n },\n required: [\"beliefs\", \"constraints\"],\n },\n requiredFields: [\"beliefs\", \"constraints\"],\n },\n {\n artifactId: \"plan-artifact\",\n name: \"Implementation Plan\",\n description: \"Files to create/modify, approach, and test strategy\",\n stage: \"plan\",\n contentSchema: {\n type: \"object\",\n properties: {\n files: { type: \"array\", items: { type: \"string\" } },\n approach: { type: \"string\" },\n testStrategy: { type: \"string\" },\n },\n required: [\"files\", \"approach\"],\n },\n requiredFields: [\"files\", \"approach\"],\n },\n {\n artifactId: \"implementation-artifact\",\n name: \"Implementation Summary\",\n description: \"What was built, files changed, decisions made\",\n stage: \"build\",\n contentSchema: {\n type: \"object\",\n properties: {\n filesChanged: { type: \"array\", items: { type: \"string\" } },\n decisions: { type: \"array\", items: { type: \"string\" } },\n deferredWork: { type: \"array\", items: { type: \"string\" } },\n },\n required: [\"filesChanged\"],\n },\n requiredFields: [\"filesChanged\"],\n },\n {\n artifactId: \"review-artifact\",\n name: \"Review Summary\",\n description: \"Review findings, type check results, test results\",\n stage: \"review\",\n contentSchema: {\n type: \"object\",\n properties: {\n verdict: { type: \"string\", enum: [\"approve\", \"request-changes\"] },\n findings: { type: \"array\", items: { type: \"string\" } },\n testsPassing: { type: \"boolean\" },\n typesClean: { type: \"boolean\" },\n },\n required: [\"verdict\", \"testsPassing\", \"typesClean\"],\n },\n requiredFields: [\"verdict\", \"testsPassing\", \"typesClean\"],\n },\n ],\n\n roles: [\n {\n roleId: \"investigator\",\n name: \"Investigator\",\n description:\n \"Reads graph context and identifies relevant prior knowledge\",\n perspective: \"Context-aware, evidence-driven scoping\",\n optimizesFor:\n \"thoroughness of context retrieval and constraint identification\",\n mayBlock: false,\n },\n {\n roleId: \"implementer\",\n name: \"Implementer\",\n description: \"Writes code and records decisions in the graph\",\n perspective: \"Pragmatic, focused on working code within constraints\",\n optimizesFor: \"correctness and simplicity\",\n mayBlock: false,\n },\n {\n roleId: \"critic\",\n name: \"Critic\",\n description:\n \"Challenges assumptions, finds edge cases, and surfaces risks\",\n perspective: \"Skeptical, detail-oriented, adversarial testing\",\n optimizesFor: \"identifying weaknesses before they reach production\",\n mayBlock: true, // Epistemic Invariant #13\n },\n ],\n\n inquiryShaping: {\n questionTemplates: [\n {\n templateId: \"developer-boundary-falsifier\",\n questionType: \"falsification\",\n priority: \"high\",\n template:\n \"Which interface, contract, or boundary would fail first if {{objective}} is wrong?\",\n whenObjectiveIncludes: [\n \"build\",\n \"implement\",\n \"refactor\",\n \"integrate\",\n \"algorithm\",\n \"handler\",\n \"workflow\",\n ],\n },\n {\n templateId: \"developer-regression-counterfactual\",\n questionType: \"counterfactual\",\n priority: \"high\",\n template:\n \"What existing behavior or verification path would regress if {{hypothesis}} is false?\",\n whenObjectiveIncludes: [\n \"build\",\n \"implement\",\n \"add\",\n \"extend\",\n \"support\",\n ],\n },\n ],\n taskTemplates: [\n {\n templateId: \"developer-contract-audit\",\n title: \"Audit adjacent contracts and invariants for {{objective}}\",\n description:\n \"Inspect the existing MCP, schema, and worktree contracts that constrain {{objective}} before changing runtime behavior.\",\n taskType: \"analysis\",\n priority: \"high\",\n whenObjectiveIncludes: [\"build\", \"implement\", \"extend\", \"support\"],\n },\n {\n templateId: \"developer-verification-pass\",\n title: \"Run focused verification for {{objective}}\",\n description:\n \"Add or update targeted tests and type-safety checks that would fail if {{hypothesis}} is wrong.\",\n taskType: \"review\",\n priority: \"medium\",\n whenObjectiveIncludes: [\"build\", \"implement\", \"algorithm\", \"workflow\"],\n whenQuestionTypes: [\"falsification\", \"counterfactual\"],\n },\n ],\n frameworkHints: [\n {\n frameworkName: \"Boundary Audit\",\n whenObjectiveIncludes: [\"handler\", \"contract\", \"api\", \"workflow\"],\n boost: 0.25,\n reason:\n \"Developer reasoning work benefits from explicit boundary checks.\",\n },\n {\n frameworkName: \"Pre-mortem\",\n whenQuestionTypes: [\"falsification\", \"counterfactual\"],\n boost: 0.2,\n reason:\n \"Stress-testing likely failure modes improves worktree shaping quality.\",\n },\n ],\n },\n\n methodologyPackId: \"developer\",\n});\n"]}