@jterrats/open-orchestra 1.0.15 → 1.0.17

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 (191) hide show
  1. package/AGENTS.md +3 -3
  2. package/CLAUDE.md +26 -4
  3. package/README.md +32 -9
  4. package/dist/benchmark.js +65 -27
  5. package/dist/benchmark.js.map +1 -1
  6. package/dist/command-manifest.js +6 -1
  7. package/dist/command-manifest.js.map +1 -1
  8. package/dist/command-routes.js +8 -1
  9. package/dist/command-routes.js.map +1 -1
  10. package/dist/commands.d.ts +2 -1
  11. package/dist/commands.js +2 -1
  12. package/dist/commands.js.map +1 -1
  13. package/dist/context-vault-commands.d.ts +5 -0
  14. package/dist/context-vault-commands.js +79 -0
  15. package/dist/context-vault-commands.js.map +1 -0
  16. package/dist/context-vault-file-metadata.d.ts +3 -0
  17. package/dist/context-vault-file-metadata.js +25 -0
  18. package/dist/context-vault-file-metadata.js.map +1 -0
  19. package/dist/context-vault-model.d.ts +79 -0
  20. package/dist/context-vault-model.js +2 -0
  21. package/dist/context-vault-model.js.map +1 -0
  22. package/dist/context-vault-redaction.d.ts +5 -0
  23. package/dist/context-vault-redaction.js +22 -0
  24. package/dist/context-vault-redaction.js.map +1 -0
  25. package/dist/context-vault-renderer.d.ts +3 -0
  26. package/dist/context-vault-renderer.js +30 -0
  27. package/dist/context-vault-renderer.js.map +1 -0
  28. package/dist/context-vault-service.d.ts +17 -0
  29. package/dist/context-vault-service.js +183 -0
  30. package/dist/context-vault-service.js.map +1 -0
  31. package/dist/delivery-commands.d.ts +1 -0
  32. package/dist/delivery-commands.js +19 -1
  33. package/dist/delivery-commands.js.map +1 -1
  34. package/dist/diagram-schema.d.ts +2 -0
  35. package/dist/diagram-schema.js +148 -0
  36. package/dist/diagram-schema.js.map +1 -0
  37. package/dist/diagrams/index.d.ts +2 -0
  38. package/dist/diagrams/index.js +2 -0
  39. package/dist/diagrams/index.js.map +1 -1
  40. package/dist/diagrams/pipeline.js +7 -5
  41. package/dist/diagrams/pipeline.js.map +1 -1
  42. package/dist/evidence-compaction-model.d.ts +62 -0
  43. package/dist/evidence-compaction-model.js +2 -0
  44. package/dist/evidence-compaction-model.js.map +1 -0
  45. package/dist/evidence-compaction-renderer.d.ts +2 -0
  46. package/dist/evidence-compaction-renderer.js +35 -0
  47. package/dist/evidence-compaction-renderer.js.map +1 -0
  48. package/dist/evidence-compaction-service.d.ts +11 -0
  49. package/dist/evidence-compaction-service.js +94 -0
  50. package/dist/evidence-compaction-service.js.map +1 -0
  51. package/dist/evidence-compaction-summary.d.ts +4 -0
  52. package/dist/evidence-compaction-summary.js +160 -0
  53. package/dist/evidence-compaction-summary.js.map +1 -0
  54. package/dist/knowledge-base.js +7 -1
  55. package/dist/knowledge-base.js.map +1 -1
  56. package/dist/metrics-commands.js +3 -0
  57. package/dist/metrics-commands.js.map +1 -1
  58. package/dist/planning-commands.js +23 -1
  59. package/dist/planning-commands.js.map +1 -1
  60. package/dist/quality-contracts.js +12 -6
  61. package/dist/quality-contracts.js.map +1 -1
  62. package/dist/report-index.d.ts +3 -0
  63. package/dist/report-index.js +3 -0
  64. package/dist/report-index.js.map +1 -0
  65. package/dist/report-model.d.ts +22 -0
  66. package/dist/report-model.js +2 -0
  67. package/dist/report-model.js.map +1 -0
  68. package/dist/report-render-markdown.d.ts +1 -0
  69. package/dist/report-render-markdown.js +40 -0
  70. package/dist/report-render-markdown.js.map +1 -0
  71. package/dist/report-schema.d.ts +2 -0
  72. package/dist/report-schema.js +109 -0
  73. package/dist/report-schema.js.map +1 -0
  74. package/dist/rule-catalog.d.ts +33 -0
  75. package/dist/rule-catalog.js +215 -0
  76. package/dist/rule-catalog.js.map +1 -0
  77. package/dist/runtime-bootstrap.js +33 -8
  78. package/dist/runtime-bootstrap.js.map +1 -1
  79. package/dist/runtime-capacity-policy.d.ts +38 -0
  80. package/dist/runtime-capacity-policy.js +117 -0
  81. package/dist/runtime-capacity-policy.js.map +1 -0
  82. package/dist/runtime-capacity-scheduler-helpers.d.ts +40 -0
  83. package/dist/runtime-capacity-scheduler-helpers.js +111 -0
  84. package/dist/runtime-capacity-scheduler-helpers.js.map +1 -0
  85. package/dist/runtime-capacity-scheduler-state.d.ts +44 -0
  86. package/dist/runtime-capacity-scheduler-state.js +128 -0
  87. package/dist/runtime-capacity-scheduler-state.js.map +1 -0
  88. package/dist/runtime-capacity-scheduler.d.ts +34 -0
  89. package/dist/runtime-capacity-scheduler.js +193 -0
  90. package/dist/runtime-capacity-scheduler.js.map +1 -0
  91. package/dist/runtime-capacity-snapshot.d.ts +14 -0
  92. package/dist/runtime-capacity-snapshot.js +87 -0
  93. package/dist/runtime-capacity-snapshot.js.map +1 -0
  94. package/dist/runtime-child-prompt.d.ts +2 -1
  95. package/dist/runtime-child-prompt.js +4 -1
  96. package/dist/runtime-child-prompt.js.map +1 -1
  97. package/dist/runtime-claude-native-bridge.js +2 -1
  98. package/dist/runtime-claude-native-bridge.js.map +1 -1
  99. package/dist/runtime-commands.js +6 -0
  100. package/dist/runtime-commands.js.map +1 -1
  101. package/dist/runtime-context-manifest.js +3 -24
  102. package/dist/runtime-context-manifest.js.map +1 -1
  103. package/dist/runtime-lifecycle-watch.d.ts +5 -2
  104. package/dist/runtime-lifecycle-watch.js +19 -3
  105. package/dist/runtime-lifecycle-watch.js.map +1 -1
  106. package/dist/runtime-load-balancer.d.ts +12 -0
  107. package/dist/runtime-load-balancer.js +106 -0
  108. package/dist/runtime-load-balancer.js.map +1 -0
  109. package/dist/runtime-spawn-bridge.js +23 -0
  110. package/dist/runtime-spawn-bridge.js.map +1 -1
  111. package/dist/runtime-spawn-guidance.js +15 -0
  112. package/dist/runtime-spawn-guidance.js.map +1 -1
  113. package/dist/runtime-worker-registry.d.ts +19 -0
  114. package/dist/runtime-worker-registry.js +84 -0
  115. package/dist/runtime-worker-registry.js.map +1 -0
  116. package/dist/security/content-classifier.d.ts +2 -0
  117. package/dist/security/content-classifier.js +147 -0
  118. package/dist/security/content-classifier.js.map +1 -0
  119. package/dist/security/operation-contract-types.d.ts +28 -0
  120. package/dist/security/operation-contract-types.js +2 -0
  121. package/dist/security/operation-contract-types.js.map +1 -0
  122. package/dist/security/operation-contract.d.ts +2 -0
  123. package/dist/security/operation-contract.js +169 -0
  124. package/dist/security/operation-contract.js.map +1 -0
  125. package/dist/security/policy-engine.d.ts +2 -0
  126. package/dist/security/policy-engine.js +142 -0
  127. package/dist/security/policy-engine.js.map +1 -0
  128. package/dist/security/policy-types.d.ts +79 -0
  129. package/dist/security/policy-types.js +7 -0
  130. package/dist/security/policy-types.js.map +1 -0
  131. package/dist/security/prompt-intake.d.ts +13 -0
  132. package/dist/security/prompt-intake.js +33 -0
  133. package/dist/security/prompt-intake.js.map +1 -0
  134. package/dist/security/redaction.d.ts +3 -0
  135. package/dist/security/redaction.js +64 -0
  136. package/dist/security/redaction.js.map +1 -0
  137. package/dist/security/sink-encoding.d.ts +6 -0
  138. package/dist/security/sink-encoding.js +40 -0
  139. package/dist/security/sink-encoding.js.map +1 -0
  140. package/dist/sprint-commands.js +33 -22
  141. package/dist/sprint-commands.js.map +1 -1
  142. package/dist/structured-output-validation.d.ts +9 -0
  143. package/dist/structured-output-validation.js +20 -0
  144. package/dist/structured-output-validation.js.map +1 -0
  145. package/dist/transcription-failures.d.ts +2 -0
  146. package/dist/transcription-failures.js +4 -0
  147. package/dist/transcription-failures.js.map +1 -0
  148. package/dist/transcription-media-preflight.d.ts +9 -0
  149. package/dist/transcription-media-preflight.js +147 -0
  150. package/dist/transcription-media-preflight.js.map +1 -0
  151. package/dist/transcription-request.d.ts +13 -0
  152. package/dist/transcription-request.js +150 -0
  153. package/dist/transcription-request.js.map +1 -0
  154. package/dist/transcription-source-policy.d.ts +4 -0
  155. package/dist/transcription-source-policy.js +43 -0
  156. package/dist/transcription-source-policy.js.map +1 -0
  157. package/dist/transcription-types.d.ts +161 -0
  158. package/dist/transcription-types.js +2 -0
  159. package/dist/transcription-types.js.map +1 -0
  160. package/dist/types/runtime.d.ts +147 -0
  161. package/dist/types.d.ts +3 -1
  162. package/dist/types.js +1 -0
  163. package/dist/types.js.map +1 -1
  164. package/dist/web-api-read-routes.js +2 -0
  165. package/dist/web-api-read-routes.js.map +1 -1
  166. package/dist/web-console/assets/index-BJuVTqfQ.js +11 -0
  167. package/dist/web-console/index.html +1 -1
  168. package/dist/workflow-evidence-service.js +16 -0
  169. package/dist/workflow-evidence-service.js.map +1 -1
  170. package/dist/workflow-phase-planner.js +5 -3
  171. package/dist/workflow-phase-planner.js.map +1 -1
  172. package/dist/workflow-phases.js +5 -0
  173. package/dist/workflow-phases.js.map +1 -1
  174. package/dist/workflow-run-commands.js +89 -10
  175. package/dist/workflow-run-commands.js.map +1 -1
  176. package/dist/workflow-services.d.ts +1 -0
  177. package/dist/workflow-services.js +8 -1
  178. package/dist/workflow-services.js.map +1 -1
  179. package/docs/audio-video-transcription-skill.md +102 -70
  180. package/docs/autonomous-workflow.md +3 -3
  181. package/docs/context-vault.md +34 -11
  182. package/docs/diagrams/deterministic-pipeline/README.md +35 -1
  183. package/docs/evidence-compaction.md +25 -0
  184. package/docs/rule-loading-strategy.md +37 -0
  185. package/docs/runtime-adapters.md +7 -0
  186. package/docs/runtime-capacity.md +57 -0
  187. package/docs/security-saas-orchestrator.md +368 -0
  188. package/docs/sonar-quality-gates.md +1 -1
  189. package/package.json +1 -1
  190. package/rules/development/semantic-code.md +28 -0
  191. package/dist/web-console/assets/index-Bis4CecA.js +0 -11
@@ -0,0 +1,22 @@
1
+ export type ReportSectionKind = "summary" | "findings" | "decisions" | "risks" | "evidence" | "nextSteps";
2
+ export type ReportItemSeverity = "info" | "low" | "medium" | "high" | "critical";
3
+ export interface ReportItem {
4
+ id: string;
5
+ text: string;
6
+ severity?: ReportItemSeverity;
7
+ owner?: string;
8
+ status?: string;
9
+ }
10
+ export interface ReportSection {
11
+ id: string;
12
+ kind: ReportSectionKind;
13
+ title: string;
14
+ body?: string;
15
+ items?: ReportItem[];
16
+ }
17
+ export interface ReportDocument {
18
+ id: string;
19
+ title: string;
20
+ summary: string;
21
+ sections: ReportSection[];
22
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=report-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-model.js","sourceRoot":"","sources":["../src/report-model.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export declare function renderReportMarkdown(payload: unknown): string;
@@ -0,0 +1,40 @@
1
+ import { validateReportDocumentPayload } from "./report-schema.js";
2
+ export function renderReportMarkdown(payload) {
3
+ const report = validateReportDocumentPayload(payload);
4
+ return [
5
+ `# ${escapeMarkdown(report.title)}`,
6
+ "",
7
+ escapeMarkdown(report.summary),
8
+ "",
9
+ ...report.sections.flatMap(renderSection),
10
+ ]
11
+ .join("\n")
12
+ .trimEnd()
13
+ .concat("\n");
14
+ }
15
+ function renderSection(section) {
16
+ return [
17
+ `## ${escapeMarkdown(section.title)}`,
18
+ "",
19
+ ...(section.body ? [escapeMarkdown(section.body), ""] : []),
20
+ ...renderItems(section.items ?? []),
21
+ ];
22
+ }
23
+ function renderItems(items) {
24
+ if (items.length === 0)
25
+ return [];
26
+ return [...items.map(renderItem), ""];
27
+ }
28
+ function renderItem(item) {
29
+ const metadata = [
30
+ item.severity ? `severity: ${item.severity}` : "",
31
+ item.status ? `status: ${item.status}` : "",
32
+ item.owner ? `owner: ${item.owner}` : "",
33
+ ].filter(Boolean);
34
+ const suffix = metadata.length > 0 ? ` (${metadata.join(", ")})` : "";
35
+ return `- ${escapeMarkdown(item.text)}${suffix}`;
36
+ }
37
+ function escapeMarkdown(value) {
38
+ return value.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
39
+ }
40
+ //# sourceMappingURL=report-render-markdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-render-markdown.js","sourceRoot":"","sources":["../src/report-render-markdown.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAA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CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE;KACzC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClB,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,OAAO,KAAK,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC;AACnD,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ReportDocument } from "./report-model.js";
2
+ export declare function validateReportDocumentPayload(payload: unknown): ReportDocument;
@@ -0,0 +1,109 @@
1
+ import { assertNoStructuredOutputIssues, } from "./structured-output-validation.js";
2
+ const SECTION_KINDS = [
3
+ "summary",
4
+ "findings",
5
+ "decisions",
6
+ "risks",
7
+ "evidence",
8
+ "nextSteps",
9
+ ];
10
+ const ITEM_SEVERITIES = [
11
+ "info",
12
+ "low",
13
+ "medium",
14
+ "high",
15
+ "critical",
16
+ ];
17
+ export function validateReportDocumentPayload(payload) {
18
+ const issues = [];
19
+ if (!isObjectMap(payload)) {
20
+ fail(issues, "$", "must be a report object");
21
+ assertNoStructuredOutputIssues("report", issues);
22
+ throw new Error("unreachable report validation state");
23
+ }
24
+ validateReportRoot(payload, issues);
25
+ assertNoStructuredOutputIssues("report", issues);
26
+ return payload;
27
+ }
28
+ function validateReportRoot(value, issues) {
29
+ requireString(value, "id", "$", issues);
30
+ requireString(value, "title", "$", issues);
31
+ requireString(value, "summary", "$", issues);
32
+ validateSections(value.sections, issues);
33
+ }
34
+ function validateSections(value, issues) {
35
+ if (!Array.isArray(value) || value.length === 0) {
36
+ fail(issues, "$.sections", "must be a non-empty array");
37
+ return;
38
+ }
39
+ const ids = new Set();
40
+ value.forEach((section, index) => validateSection(section, index, ids, issues));
41
+ }
42
+ function validateSection(value, index, ids, issues) {
43
+ const path = `$.sections[${index}]`;
44
+ if (!isObjectMap(value))
45
+ return fail(issues, path, "must be an object");
46
+ const id = requireString(value, "id", path, issues);
47
+ if (id && ids.has(id))
48
+ fail(issues, `${path}.id`, "must be unique");
49
+ if (id)
50
+ ids.add(id);
51
+ requireEnum(value, "kind", path, SECTION_KINDS, issues);
52
+ requireString(value, "title", path, issues);
53
+ optionalString(value, "body", path, issues);
54
+ validateItems(value.items, `${path}.items`, issues);
55
+ }
56
+ function validateItems(value, path, issues) {
57
+ if (value === undefined)
58
+ return;
59
+ if (!Array.isArray(value))
60
+ return fail(issues, path, "must be an array when provided");
61
+ const ids = new Set();
62
+ value.forEach((item, index) => validateItem(item, `${path}[${index}]`, ids, issues));
63
+ }
64
+ function validateItem(value, path, ids, issues) {
65
+ if (!isObjectMap(value))
66
+ return fail(issues, path, "must be an object");
67
+ const id = requireString(value, "id", path, issues);
68
+ if (id && ids.has(id))
69
+ fail(issues, `${path}.id`, "must be unique within section");
70
+ if (id)
71
+ ids.add(id);
72
+ requireString(value, "text", path, issues);
73
+ optionalString(value, "owner", path, issues);
74
+ optionalString(value, "status", path, issues);
75
+ optionalEnum(value, "severity", path, ITEM_SEVERITIES, issues);
76
+ }
77
+ function isObjectMap(value) {
78
+ return typeof value === "object" && value !== null && !Array.isArray(value);
79
+ }
80
+ function requireString(value, key, path, issues) {
81
+ const field = value[key];
82
+ if (typeof field === "string" && field.trim() !== "")
83
+ return field;
84
+ fail(issues, `${path}.${key}`, "must be a non-empty string");
85
+ return undefined;
86
+ }
87
+ function optionalString(value, key, path, issues) {
88
+ if (value[key] !== undefined && typeof value[key] !== "string") {
89
+ fail(issues, `${path}.${key}`, "must be a string when provided");
90
+ }
91
+ }
92
+ function requireEnum(value, key, path, allowed, issues) {
93
+ const field = value[key];
94
+ if (typeof field === "string" && allowed.includes(field))
95
+ return;
96
+ fail(issues, `${path}.${key}`, `must be one of: ${allowed.join(", ")}`);
97
+ }
98
+ function optionalEnum(value, key, path, allowed, issues) {
99
+ const field = value[key];
100
+ if (field === undefined)
101
+ return;
102
+ if (typeof field === "string" && allowed.includes(field))
103
+ return;
104
+ fail(issues, `${path}.${key}`, `must be one of: ${allowed.join(", ")}`);
105
+ }
106
+ function fail(issues, path, message) {
107
+ issues.push({ path, message });
108
+ }
109
+ //# sourceMappingURL=report-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-schema.js","sourceRoot":"","sources":["../src/report-schema.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,8BAA8B,GAE/B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,aAAa,GAAiC;IAClD,SAAS;IACT,UAAU;IACV,WAAW;IACX,OAAO;IACP,UAAU;IACV,WAAW;CACZ,CAAC;AACF,MAAM,eAAe,GAAkC;IACrD,MAAM;IACN,KAAK;IACL,QAAQ;IACR,MAAM;IACN,UAAU;CACX,CAAC;AAEF,MAAM,UAAU,6BAA6B,CAC3C,OAAgB;IAEhB,MAAM,MAAM,GAAsC,EAAE,CAAC;IACrD,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,yBAAyB,CAAC,CAAC;QAC7C,8BAA8B,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACjD,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IACD,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACpC,8BAA8B,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjD,OAAO,OAAoC,CAAC;AAC9C,CAAC;AAED,SAAS,kBAAkB,CACzB,KAAgB,EAChB,MAAyC;IAEzC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC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AAO,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAU,CAAC;QAAE,OAAO;IACtE,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,IAAI,GAAG,EAAE,EAAE,mBAAmB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,YAAY,CACnB,KAAgB,EAChB,GAAW,EACX,IAAY,EACZ,OAAqB,EACrB,MAAyC;IAEzC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAU,CAAC;QAAE,OAAO;IACtE,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,IAAI,GAAG,EAAE,EAAE,mBAAmB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,IAAI,CACX,MAAyC,EACzC,IAAY,EACZ,OAAe;IAEf,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { SkillRenderTarget } from "./types.js";
2
+ export interface RuleDefinition {
3
+ id: string;
4
+ title: string;
5
+ summary: string;
6
+ canonicalPath: string;
7
+ renderedPaths?: Partial<Record<SkillRenderTarget, string>>;
8
+ roles: string[];
9
+ capabilities: string[];
10
+ triggers: string[];
11
+ riskAreas: string[];
12
+ }
13
+ export interface RuleSelectionInput {
14
+ role: string;
15
+ capabilities?: string[];
16
+ signals?: string[];
17
+ target?: SkillRenderTarget;
18
+ }
19
+ export interface RuleSelection {
20
+ rule: RuleDefinition;
21
+ path: string;
22
+ score: number;
23
+ rationale: string[];
24
+ }
25
+ export declare const DEFAULT_RULE_TARGET: SkillRenderTarget;
26
+ export declare const defaultRuleCatalog: RuleDefinition[];
27
+ export declare const ROLE_RULE_IDS: Record<string, string[]>;
28
+ export declare function listRuleDefinitions(): RuleDefinition[];
29
+ export declare function getRuleDefinition(id: string): RuleDefinition | undefined;
30
+ export declare function rulePathForTarget(rule: RuleDefinition, target?: SkillRenderTarget): string;
31
+ export declare function rulePathsForIds(ids: string[], target?: SkillRenderTarget): string[];
32
+ export declare function rulePathsForRole(role: string, target?: SkillRenderTarget): string[];
33
+ export declare function selectRulesForRuntime(input: RuleSelectionInput): RuleSelection[];
@@ -0,0 +1,215 @@
1
+ export const DEFAULT_RULE_TARGET = "generic";
2
+ export const defaultRuleCatalog = [
3
+ {
4
+ id: "semantic-code",
5
+ title: "Semantic Code",
6
+ summary: "Code should be readable by intent through domain names, narrow types, and clear module boundaries.",
7
+ canonicalPath: "rules/development/semantic-code.md",
8
+ roles: ["developer", "qa", "sdet", "devops", "architect"],
9
+ capabilities: ["implementation", "code", "automation", "review"],
10
+ triggers: [
11
+ "code",
12
+ "implementation",
13
+ "refactor",
14
+ "script",
15
+ "test",
16
+ "automation",
17
+ ],
18
+ riskAreas: ["maintainability", "quality"],
19
+ },
20
+ {
21
+ id: "development-engineering",
22
+ title: "Development Engineering",
23
+ summary: "Stack-agnostic implementation standards for service, integration, async, and testable code.",
24
+ canonicalPath: "rules/development-engineering.mdc",
25
+ renderedPaths: { cursor: "rules/development-engineering.mdc" },
26
+ roles: ["developer", "architect"],
27
+ capabilities: ["implementation", "code", "architecture-review"],
28
+ triggers: [
29
+ "service",
30
+ "integration",
31
+ "entry point",
32
+ "async",
33
+ "implementation",
34
+ ],
35
+ riskAreas: ["maintainability", "integration", "performance"],
36
+ },
37
+ {
38
+ id: "dry-clean-code",
39
+ title: "DRY Clean Code",
40
+ summary: "Duplication, naming, hardcoded data, and readability standards.",
41
+ canonicalPath: "rules/dry-clean-code.mdc",
42
+ renderedPaths: { cursor: "rules/dry-clean-code.mdc" },
43
+ roles: ["developer"],
44
+ capabilities: ["implementation", "code"],
45
+ triggers: ["duplication", "hardcoded", "helper", "refactor"],
46
+ riskAreas: ["maintainability"],
47
+ },
48
+ {
49
+ id: "module-boundaries",
50
+ title: "Module Boundaries",
51
+ summary: "Domain, service, adapter, and entry-point boundary rules.",
52
+ canonicalPath: "rules/module-boundaries.mdc",
53
+ renderedPaths: { cursor: "rules/module-boundaries.mdc" },
54
+ roles: ["developer", "architect"],
55
+ capabilities: ["implementation", "architecture-review"],
56
+ triggers: ["domain", "service", "adapter", "boundary", "god file"],
57
+ riskAreas: ["architecture", "maintainability"],
58
+ },
59
+ {
60
+ id: "testing-discipline",
61
+ title: "Testing Discipline",
62
+ summary: "Unit, integration, E2E, and evidence expectations.",
63
+ canonicalPath: "rules/testing-discipline.mdc",
64
+ renderedPaths: { cursor: "rules/testing-discipline.mdc" },
65
+ roles: ["developer", "qa", "sdet"],
66
+ capabilities: ["test", "testing", "automation", "qa-evidence"],
67
+ triggers: ["test", "unit", "e2e", "playwright", "coverage", "qa"],
68
+ riskAreas: ["quality"],
69
+ },
70
+ {
71
+ id: "delivery-quality-gates",
72
+ title: "Delivery Quality Gates",
73
+ summary: "Definition of ready, definition of done, evidence, and release gate rules.",
74
+ canonicalPath: "rules/delivery-quality-gates.mdc",
75
+ renderedPaths: { cursor: "rules/delivery-quality-gates.mdc" },
76
+ roles: ["qa", "sdet", "release_manager"],
77
+ capabilities: ["qa-evidence", "release"],
78
+ triggers: ["gate", "release", "evidence", "handoff", "go no-go"],
79
+ riskAreas: ["quality", "release", "governance"],
80
+ },
81
+ {
82
+ id: "agent-collaboration",
83
+ title: "Agent Collaboration",
84
+ summary: "Handoff, review, and cross-role collaboration rules.",
85
+ canonicalPath: "rules/agent-collaboration.mdc",
86
+ renderedPaths: { cursor: "rules/agent-collaboration.mdc" },
87
+ roles: ["qa", "product_owner", "architect", "developer"],
88
+ capabilities: ["workflow-discipline", "auditability"],
89
+ triggers: ["handoff", "review", "phase", "collaboration"],
90
+ riskAreas: ["governance"],
91
+ },
92
+ {
93
+ id: "architecture-decisions",
94
+ title: "Architecture Decisions",
95
+ summary: "Architecture decision, ADR, trade-off, and technical boundary rules.",
96
+ canonicalPath: "rules/architecture-decisions.mdc",
97
+ renderedPaths: { cursor: "rules/architecture-decisions.mdc" },
98
+ roles: ["architect"],
99
+ capabilities: ["architecture-review"],
100
+ triggers: ["architecture", "adr", "decision", "trade off"],
101
+ riskAreas: ["architecture", "maintainability"],
102
+ },
103
+ {
104
+ id: "release-rollback",
105
+ title: "Release Rollback",
106
+ summary: "Release, rollback, monitoring, and go/no-go rules.",
107
+ canonicalPath: "rules/release-rollback.mdc",
108
+ renderedPaths: { cursor: "rules/release-rollback.mdc" },
109
+ roles: ["release_manager"],
110
+ capabilities: ["release", "deployment", "rollback"],
111
+ triggers: ["release", "rollback", "deploy", "publish"],
112
+ riskAreas: ["release"],
113
+ },
114
+ ];
115
+ export const ROLE_RULE_IDS = {
116
+ developer: [
117
+ "semantic-code",
118
+ "development-engineering",
119
+ "dry-clean-code",
120
+ "module-boundaries",
121
+ "testing-discipline",
122
+ ],
123
+ qa: [
124
+ "semantic-code",
125
+ "testing-discipline",
126
+ "delivery-quality-gates",
127
+ "agent-collaboration",
128
+ ],
129
+ sdet: [
130
+ "semantic-code",
131
+ "testing-discipline",
132
+ "delivery-quality-gates",
133
+ "agent-collaboration",
134
+ ],
135
+ architect: [
136
+ "semantic-code",
137
+ "architecture-decisions",
138
+ "module-boundaries",
139
+ "development-engineering",
140
+ ],
141
+ devops: ["semantic-code", "development-engineering"],
142
+ release_manager: ["release-rollback", "delivery-quality-gates"],
143
+ };
144
+ export function listRuleDefinitions() {
145
+ return defaultRuleCatalog.map(cloneRule);
146
+ }
147
+ export function getRuleDefinition(id) {
148
+ const rule = defaultRuleCatalog.find((candidate) => candidate.id === id);
149
+ return rule ? cloneRule(rule) : undefined;
150
+ }
151
+ export function rulePathForTarget(rule, target = DEFAULT_RULE_TARGET) {
152
+ return rule.renderedPaths?.[target] ?? rule.canonicalPath;
153
+ }
154
+ export function rulePathsForIds(ids, target = DEFAULT_RULE_TARGET) {
155
+ return ids
156
+ .map((id) => getRuleDefinition(id))
157
+ .filter((rule) => Boolean(rule))
158
+ .map((rule) => rulePathForTarget(rule, target));
159
+ }
160
+ export function rulePathsForRole(role, target = DEFAULT_RULE_TARGET) {
161
+ return rulePathsForIds(ROLE_RULE_IDS[role] ?? [], target);
162
+ }
163
+ export function selectRulesForRuntime(input) {
164
+ const role = input.role;
165
+ const capabilities = new Set((input.capabilities ?? []).map(normalize));
166
+ const signalText = normalize((input.signals ?? []).join(" "));
167
+ const roleRuleIds = new Set(ROLE_RULE_IDS[role] ?? []);
168
+ return defaultRuleCatalog
169
+ .map((rule) => {
170
+ const rationale = [];
171
+ let score = 0;
172
+ if (roleRuleIds.has(rule.id) || rule.roles.includes(role)) {
173
+ score += 3;
174
+ rationale.push(`role match: ${role}`);
175
+ }
176
+ const matchedCapabilities = rule.capabilities.filter((capability) => capabilities.has(normalize(capability)));
177
+ if (matchedCapabilities.length > 0) {
178
+ score += matchedCapabilities.length;
179
+ rationale.push(`capability match: ${matchedCapabilities.join(", ")}`);
180
+ }
181
+ const matchedTriggers = rule.triggers.filter((trigger) => signalText.includes(normalize(trigger)));
182
+ if (matchedTriggers.length > 0) {
183
+ score += matchedTriggers.length * 2;
184
+ rationale.push(`signal match: ${matchedTriggers.join(", ")}`);
185
+ }
186
+ return {
187
+ rule: cloneRule(rule),
188
+ path: rulePathForTarget(rule, input.target),
189
+ score,
190
+ rationale,
191
+ };
192
+ })
193
+ .filter((selection) => selection.score > 0)
194
+ .sort((left, right) => right.score - left.score || left.rule.id.localeCompare(right.rule.id));
195
+ }
196
+ function cloneRule(rule) {
197
+ const clone = {
198
+ ...rule,
199
+ roles: rule.roles.slice(),
200
+ capabilities: rule.capabilities.slice(),
201
+ triggers: rule.triggers.slice(),
202
+ riskAreas: rule.riskAreas.slice(),
203
+ };
204
+ if (rule.renderedPaths) {
205
+ clone.renderedPaths = { ...rule.renderedPaths };
206
+ }
207
+ return clone;
208
+ }
209
+ function normalize(value) {
210
+ return value
211
+ .toLowerCase()
212
+ .replace(/[^a-z0-9]+/g, " ")
213
+ .trim();
214
+ }
215
+ //# sourceMappingURL=rule-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-catalog.js","sourceRoot":"","sources":["../src/rule-catalog.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAC,MAAM,mBAAmB,GAAsB,SAAS,CAAC;AAEhE,MAAM,CAAC,MAAM,kBAAkB,GAAqB;IAClD;QACE,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,eAAe;QACtB,OAAO,EACL,oGAAoG;QACtG,aAAa,EAAE,oCAAoC;QACnD,KAAK,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC;QACzD,YAAY,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC;QAChE,QAAQ,EAAE;YACR,MAAM;YACN,gBAAgB;YAChB,UAAU;YACV,QAAQ;YACR,MAAM;YACN,YAAY;SACb;QACD,SAAS,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC;KAC1C;IACD;QACE,EAAE,EAAE,yBAAyB;QAC7B,KAAK,EAAE,yBAAyB;QAChC,OAAO,EACL,6FAA6F;QAC/F,aAAa,EAAE,mCAAmC;QAClD,aAAa,EAAE,EAAE,MAAM,EAAE,mCAAmC,EAAE;QAC9D,KAAK,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;QACjC,YAAY,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,qBAAqB,CAAC;QAC/D,QAAQ,EAAE;YACR,SAAS;YACT,aAAa;YACb,aAAa;YACb,OAAO;YACP,gBAAgB;SACjB;QACD,SAAS,EAAE,CAAC,iBAAiB,EAAE,aAAa,EAAE,aAAa,CAAC;KAC7D;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,KAAK,EAAE,gBAAg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,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CACxE,CAAC;AACN,CAAC;AAED,SAAS,SAAS,CAAC,IAAoB;IACrC,MAAM,KAAK,GAAmB;QAC5B,GAAG,IAAI;QACP,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;QACzB,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE;QACvC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE;QAC/B,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;KAClC,CAAC;IACF,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,KAAK,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IAClD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,KAAK;SACT,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,IAAI,EAAE,CAAC;AACZ,CAAC"}
@@ -37,12 +37,20 @@ export function renderRuntimeBootstrap(target = "generic") {
37
37
  "```",
38
38
  "orchestra estimate --task <ID> --sizing <xs|s|m|l|xl> --solo-days <N> --ai-unguided-days <N> --ai-guided-days <N>",
39
39
  "```",
40
+ "Do not run `orchestra workflow run` until this estimate is recorded; an unestimated task signals incomplete planning.",
40
41
  "",
41
42
  "### Step 3 — Run the autonomous workflow",
42
43
  "```",
43
44
  "orchestra workflow run --task <ID> --gates phase",
44
45
  "```",
45
46
  "The workflow sequences PM → PO → Architect → Developer → QA → Release.",
47
+ "Execution mode is selected from sizing when no explicit `--phase-execution` is provided:",
48
+ "- `xs` (1 point): `single-agent` so all phases run inline without spawn overhead.",
49
+ "- `s` (2–3 points): `single-agent` by default; use `subagents` when the work is separable.",
50
+ "- `m`, `l`, `xl`: `subagents` so phase work is isolated and reviewable.",
51
+ "For xs/s tasks, prefer `orchestra workflow run --task <ID> --gates phase --phase-execution single-agent` when you need to be explicit. The parent agent still produces handoffs, evidence, and reviews for every phase.",
52
+ "The agent (Claude Code) is responsible for executing every phase in sequence — acting as PM, then PO, then Architect, then Developer, then QA, then Release — before marking work complete.",
53
+ 'Never pass `--from-phase`, `--skip-phases`, or any phase-shortcut flag. If a phase seems irrelevant, record a bypass rationale with `orchestra validate --pre-run --task <ID> --bypass --bypass-rationale "..."` instead.',
46
54
  "Gates pause at `po→architect` and `qa→release` for human review.",
47
55
  "The architect phase requires a sizing decision before proceeding:",
48
56
  "```",
@@ -61,6 +69,7 @@ export function renderRuntimeBootstrap(target = "generic") {
61
69
  "```",
62
70
  "orchestra workflow run --task <ID> --resume <run-id>",
63
71
  "```",
72
+ "At a `po→architect` or `qa→release` gate, stop work, surface the handoff artifact to the user, and wait for explicit approval before resuming — do not self-approve or continue autonomously.",
64
73
  "Gate approval is not automatic. Before approving `po→architect`, verify the GitHub issue or Orchestra task has user-validated acceptance criteria, non-goals, assumptions, priority, and sizing context.",
65
74
  "Before approving `qa→release`, verify real implementation evidence exists: changed files, exact validation commands, test results, QA findings, BA/PO acceptance, and Architect review when technical contracts changed.",
66
75
  "If a generated handoff says `Acceptance Criteria: none`, treat it as incomplete. Pull criteria from the linked issue/task, record a review finding, and do not approve release until the gap is fixed or explicitly risk-accepted.",
@@ -69,6 +78,7 @@ export function renderRuntimeBootstrap(target = "generic") {
69
78
  "```",
70
79
  "orchestra benchmark --task <ID>",
71
80
  "```",
81
+ "A task is not complete until `orchestra benchmark` has run. Do not close the task or mark it done beforehand.",
72
82
  "",
73
83
  "## Active Work",
74
84
  "- At session start, run `orchestra health --json` before implementation or file edits.",
@@ -76,12 +86,13 @@ export function renderRuntimeBootstrap(target = "generic") {
76
86
  "- For the active task, run context, delegation, plan, skills, protocol, and workflow render commands.",
77
87
  "- Run `orchestra validate --pre-run --task <ID> --json` before implementation; resolve missing estimate, workflow run, evidence, or review checks.",
78
88
  '- If a user accepts a smaller/advisory path, record it with `orchestra validate --pre-run --task <ID> --bypass --bypass-rationale "..."`.',
89
+ "- After `orchestra workflow run` completes a phase or reports a pending action, immediately run `orchestra runtime parent-actions --task <ID> --json` and dispatch any actionable `claude-agent-request` items before continuing.",
79
90
  ...recurringPreflightLines(target),
80
91
  "",
81
92
  "## Runtime-Native Background Spawn",
82
93
  "- When a workflow phase returns `completionMode=detached`, keep the parent conversation available and do not block on the child unless the user explicitly asks to wait.",
83
94
  "- After `orchestra workflow run` reports a pending parent runtime action, immediately inspect `orchestra runtime parent-actions --task <ID> --json` and consume safe actions supported by the active runtime.",
84
- "- Codex parent runtimes should call `spawn_agent` for `codex-spawn-agent` actions using the `promptArtifact`, then record `spawned` with the returned agent id.",
95
+ ...codexSpawnHint(target),
85
96
  "- Do not auto-consume actions when the user explicitly asked to pause, when the action is queued, or when the runtime/tool is unavailable or unsafe.",
86
97
  "- Use `orchestra runtime spawn-request --task <ID> --role <role> --phase <phase> --run-id <run-id>` to render the assignment packet.",
87
98
  "- Record child state with `orchestra runtime spawn-lifecycle --session <session-id> --status <spawned|active|completed|failed> --agent-id <id>`.",
@@ -154,15 +165,29 @@ function bootstrapCommandIds() {
154
165
  "summary",
155
166
  ]);
156
167
  }
168
+ function codexSpawnHint(target) {
169
+ if (target === "codex") {
170
+ return [
171
+ "- Codex parent runtimes should call `spawn_agent` for `codex-spawn-agent` actions using the `promptArtifact`, then record `spawned` with the returned agent id.",
172
+ ];
173
+ }
174
+ return [];
175
+ }
157
176
  function recurringPreflightLines(target) {
158
- if (target !== "codex") {
159
- return [];
177
+ if (target === "codex") {
178
+ return [
179
+ "- Codex recurring preflight: before each new work block and after any context shift, compaction, resume, interruption, or role handoff, rerun `orchestra health --json`, `orchestra task list --json --status pending,blocked,in_progress`, and `orchestra validate --pre-run --task <ID> --json`.",
180
+ "- Treat `activeOrchestraContext: false` or non-empty `missingActiveContext` from pre-run validation as a drift warning; reload the task context and resume/register the workflow before editing files.",
181
+ "- Codex has no native recurring hook in this project, so this managed guidance and validation command are the fallback enforcement mechanism.",
182
+ ];
183
+ }
184
+ if (target === "claude") {
185
+ return [
186
+ "- Claude recurring preflight: after each phase completes, after a subagent returns, and after any context compaction or session resume, rerun `orchestra health --json` and `orchestra validate --pre-run --task <ID> --json` before continuing.",
187
+ "- Treat a non-empty `missingActiveContext` or missing workflow run as a signal to re-register or resume the workflow before editing files.",
188
+ ];
160
189
  }
161
- return [
162
- "- Codex recurring preflight: before each new work block and after any context shift, compaction, resume, interruption, or role handoff, rerun `orchestra health --json`, `orchestra task list --json --status pending,blocked,in_progress`, and `orchestra validate --pre-run --task <ID> --json`.",
163
- "- Treat `activeOrchestraContext: false` or non-empty `missingActiveContext` from pre-run validation as a drift warning; reload the task context and resume/register the workflow before editing files.",
164
- "- Codex has no native recurring hook in this project, so this managed guidance and validation command are the fallback enforcement mechanism.",
165
- ];
190
+ return [];
166
191
  }
167
192
  function targetNote(target) {
168
193
  const adapter = getRuntimeAdapter(target);
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-bootstrap.js","sourceRoot":"","sources":["../src/runtime-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAUzE,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,gBAAgB,GAAG,mDAAmD,CAAC;AAE7E,MAAM,UAAU,sBAAsB,CACpC,SAA4B,SAAS;IAErC,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;IACvC,MAAM,OAAO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AAC;QACxB,OAAO;YACL,kPAAkP;YAClP,4IAA4I;SAC7I,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,UAAU,CAAC,MAAyB;IAC3C,MAAM,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1C,OAAO,kBAAkB,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC;AACtE,CAAC;AAED,SAAS,wBAAwB,CAC/B,MAAyB,EACzB,OAAe;IAEf,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,yBAAyB,CAAC,OAAO,EAAE;QACxC,WAAW,EAAE,wDAAwD;QACrE,KAAK,EAAE,QAAQ;QACf,gBAAgB,EAAE,iBAAiB;KACpC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { RuntimeCapacityScope, RuntimeCapacityUnit, RuntimeQuotaPolicy, RuntimeScheduleReasonCode, RuntimeScheduleRequest } from "./types.js";
2
+ export type RuntimeCapacityMode = "local" | "saas";
3
+ export declare const LOCAL_RUNTIME_CAPACITY_SCOPE: RuntimeCapacityScope;
4
+ export declare const DEFAULT_RUNTIME_CAPACITY_UNIT: RuntimeCapacityUnit;
5
+ export declare const DEFAULT_RUNTIME_QUOTA_POLICY: RuntimeQuotaPolicy;
6
+ export interface RuntimeCapacityCounters {
7
+ active: RuntimeScheduleRequest[];
8
+ queued: RuntimeScheduleRequest[];
9
+ }
10
+ export interface RuntimeCapacityValidation {
11
+ valid: boolean;
12
+ scope: RuntimeCapacityScope;
13
+ reasonCode?: RuntimeScheduleReasonCode;
14
+ userSafeReason?: string;
15
+ }
16
+ export interface RuntimeCapacityLimitEvaluation {
17
+ allowed: boolean;
18
+ reasonCode?: RuntimeScheduleReasonCode;
19
+ userSafeReason?: string;
20
+ }
21
+ export declare function normalizeRuntimeScheduleRequest(request: RuntimeScheduleRequest, mode: RuntimeCapacityMode, defaultScope?: RuntimeCapacityScope): RuntimeCapacityValidation;
22
+ export declare function evaluateRuntimeCapacityLimits({ request, scope, counters, platformPolicy, tenantPolicy, workspacePolicy, }: {
23
+ request: RuntimeScheduleRequest;
24
+ scope: RuntimeCapacityScope;
25
+ counters: RuntimeCapacityCounters;
26
+ platformPolicy: RuntimeQuotaPolicy;
27
+ tenantPolicy: RuntimeQuotaPolicy;
28
+ workspacePolicy: RuntimeQuotaPolicy;
29
+ }): RuntimeCapacityLimitEvaluation;
30
+ export declare function canQueueRuntimeCapacity({ request, scope, counters, platformPolicy, tenantPolicy, workspacePolicy, }: {
31
+ request: RuntimeScheduleRequest;
32
+ scope: RuntimeCapacityScope;
33
+ counters: RuntimeCapacityCounters;
34
+ platformPolicy: RuntimeQuotaPolicy;
35
+ tenantPolicy: RuntimeQuotaPolicy;
36
+ workspacePolicy: RuntimeQuotaPolicy;
37
+ }): RuntimeCapacityLimitEvaluation;
38
+ export declare function queueReasonForLimit(reasonCode: RuntimeScheduleReasonCode): RuntimeScheduleReasonCode;