@jterrats/open-orchestra 0.5.5 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +9 -8
- package/CLAUDE.md +13 -11
- package/README.md +78 -11
- package/dist/assets/web-console.js +203 -36
- package/dist/automation-evidence.d.ts +23 -0
- package/dist/automation-evidence.js +97 -0
- package/dist/automation-evidence.js.map +1 -0
- package/dist/autonomous-run-state.d.ts +4 -1
- package/dist/autonomous-run-state.js +8 -2
- package/dist/autonomous-run-state.js.map +1 -1
- package/dist/autonomous-run-store.d.ts +3 -1
- package/dist/autonomous-run-store.js +9 -3
- package/dist/autonomous-run-store.js.map +1 -1
- package/dist/autonomous-workflow-constants.js +5 -1
- package/dist/autonomous-workflow-constants.js.map +1 -1
- package/dist/benchmark.d.ts +4 -1
- package/dist/benchmark.js +140 -19
- package/dist/benchmark.js.map +1 -1
- package/dist/cli.js +88 -2
- package/dist/cli.js.map +1 -1
- package/dist/collaboration-flows.js +5 -19
- package/dist/collaboration-flows.js.map +1 -1
- package/dist/collection-utils.d.ts +3 -0
- package/dist/collection-utils.js +10 -0
- package/dist/collection-utils.js.map +1 -0
- package/dist/command-manifest.d.ts +12 -1
- package/dist/command-manifest.js +218 -10
- package/dist/command-manifest.js.map +1 -1
- package/dist/commands.d.ts +14 -6
- package/dist/commands.js +78 -28
- package/dist/commands.js.map +1 -1
- package/dist/config-migrations.d.ts +24 -0
- package/dist/config-migrations.js +102 -0
- package/dist/config-migrations.js.map +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.js +26 -0
- package/dist/constants.js.map +1 -1
- package/dist/cursor-canvas.d.ts +20 -0
- package/dist/cursor-canvas.js +119 -0
- package/dist/cursor-canvas.js.map +1 -0
- package/dist/dashboard-commands.d.ts +2 -0
- package/dist/dashboard-commands.js +14 -0
- package/dist/dashboard-commands.js.map +1 -0
- package/dist/defaults.d.ts +13 -0
- package/dist/defaults.js +13 -0
- package/dist/defaults.js.map +1 -1
- package/dist/delegation-decision.js +23 -8
- package/dist/delegation-decision.js.map +1 -1
- package/dist/delivery-commands.js +5 -0
- package/dist/delivery-commands.js.map +1 -1
- package/dist/delivery-dashboard-charts.d.ts +4 -0
- package/dist/delivery-dashboard-charts.js +156 -0
- package/dist/delivery-dashboard-charts.js.map +1 -0
- package/dist/delivery-dashboard-html.d.ts +2 -0
- package/dist/delivery-dashboard-html.js +115 -0
- package/dist/delivery-dashboard-html.js.map +1 -0
- package/dist/delivery-dashboard-types.d.ts +78 -0
- package/dist/delivery-dashboard-types.js +2 -0
- package/dist/delivery-dashboard-types.js.map +1 -0
- package/dist/delivery-dashboard.d.ts +8 -0
- package/dist/delivery-dashboard.js +124 -0
- package/dist/delivery-dashboard.js.map +1 -0
- package/dist/doc-sync.d.ts +25 -0
- package/dist/doc-sync.js +79 -0
- package/dist/doc-sync.js.map +1 -0
- package/dist/effort-classification.d.ts +7 -0
- package/dist/effort-classification.js +72 -0
- package/dist/effort-classification.js.map +1 -0
- package/dist/extension-commands.d.ts +3 -0
- package/dist/extension-commands.js +40 -0
- package/dist/extension-commands.js.map +1 -0
- package/dist/extensions.d.ts +22 -0
- package/dist/extensions.js +126 -0
- package/dist/extensions.js.map +1 -0
- package/dist/gemini-provider.d.ts +3 -6
- package/dist/gemini-provider.js +8 -17
- package/dist/gemini-provider.js.map +1 -1
- package/dist/github.d.ts +2 -0
- package/dist/github.js +15 -3
- package/dist/github.js.map +1 -1
- package/dist/health-checks.js +51 -0
- package/dist/health-checks.js.map +1 -1
- package/dist/lucid-story-map.d.ts +73 -0
- package/dist/lucid-story-map.js +112 -0
- package/dist/lucid-story-map.js.map +1 -0
- package/dist/mcp-integrations.d.ts +19 -0
- package/dist/mcp-integrations.js +58 -0
- package/dist/mcp-integrations.js.map +1 -0
- package/dist/mcp-tool-adapter.d.ts +21 -0
- package/dist/mcp-tool-adapter.js +56 -0
- package/dist/mcp-tool-adapter.js.map +1 -0
- package/dist/metrics-commands.js +47 -13
- package/dist/metrics-commands.js.map +1 -1
- package/dist/model-commands.d.ts +5 -0
- package/dist/model-commands.js +95 -1
- package/dist/model-commands.js.map +1 -1
- package/dist/model-providers.d.ts +5 -12
- package/dist/model-providers.js +30 -43
- package/dist/model-providers.js.map +1 -1
- package/dist/network-policy.d.ts +2 -0
- package/dist/network-policy.js +6 -0
- package/dist/network-policy.js.map +1 -0
- package/dist/ollama-provider.d.ts +3 -6
- package/dist/ollama-provider.js +7 -16
- package/dist/ollama-provider.js.map +1 -1
- package/dist/package-update-check.d.ts +19 -0
- package/dist/package-update-check.js +24 -0
- package/dist/package-update-check.js.map +1 -1
- package/dist/phase-executor.d.ts +1 -0
- package/dist/phase-executor.js +401 -9
- package/dist/phase-executor.js.map +1 -1
- package/dist/phase-playbooks.d.ts +18 -1
- package/dist/phase-playbooks.js +146 -2
- package/dist/phase-playbooks.js.map +1 -1
- package/dist/planning-commands.d.ts +1 -0
- package/dist/planning-commands.js +36 -36
- package/dist/planning-commands.js.map +1 -1
- package/dist/policy-commands.d.ts +2 -0
- package/dist/policy-commands.js +29 -0
- package/dist/policy-commands.js.map +1 -0
- package/dist/policy-defaults.d.ts +2 -0
- package/dist/policy-defaults.js +42 -0
- package/dist/policy-defaults.js.map +1 -0
- package/dist/policy.d.ts +20 -0
- package/dist/policy.js +155 -0
- package/dist/policy.js.map +1 -0
- package/dist/project-detection.js +9 -7
- package/dist/project-detection.js.map +1 -1
- package/dist/prompt-registry-update.d.ts +2 -0
- package/dist/prompt-registry-update.js +5 -1
- package/dist/prompt-registry-update.js.map +1 -1
- package/dist/prompt-registry-validation.d.ts +3 -0
- package/dist/prompt-registry-validation.js +61 -21
- package/dist/prompt-registry-validation.js.map +1 -1
- package/dist/provider-utils.d.ts +11 -0
- package/dist/provider-utils.js +14 -0
- package/dist/provider-utils.js.map +1 -1
- package/dist/qa-commands.d.ts +2 -0
- package/dist/qa-commands.js +18 -0
- package/dist/qa-commands.js.map +1 -0
- package/dist/qa-coverage.d.ts +24 -0
- package/dist/qa-coverage.js +189 -0
- package/dist/qa-coverage.js.map +1 -0
- package/dist/qa-readiness.d.ts +5 -0
- package/dist/qa-readiness.js +26 -0
- package/dist/qa-readiness.js.map +1 -0
- package/dist/refresh-generated.d.ts +32 -0
- package/dist/refresh-generated.js +180 -0
- package/dist/refresh-generated.js.map +1 -0
- package/dist/release-candidate.d.ts +9 -1
- package/dist/release-candidate.js +52 -1
- package/dist/release-candidate.js.map +1 -1
- package/dist/release-commands.js +161 -8
- package/dist/release-commands.js.map +1 -1
- package/dist/release-readiness.d.ts +33 -0
- package/dist/release-readiness.js +187 -3
- package/dist/release-readiness.js.map +1 -1
- package/dist/runtime-adapters.d.ts +2 -1
- package/dist/runtime-adapters.js +16 -0
- package/dist/runtime-adapters.js.map +1 -1
- package/dist/runtime-bootstrap.js +1 -1
- package/dist/runtime-bootstrap.js.map +1 -1
- package/dist/runtime-commands.d.ts +2 -0
- package/dist/runtime-commands.js +85 -3
- package/dist/runtime-commands.js.map +1 -1
- package/dist/runtime-execution-adapters.js +40 -0
- package/dist/runtime-execution-adapters.js.map +1 -1
- package/dist/runtime-execution-renderer.d.ts +3 -2
- package/dist/runtime-execution-renderer.js +46 -8
- package/dist/runtime-execution-renderer.js.map +1 -1
- package/dist/runtime-execution.d.ts +8 -2
- package/dist/runtime-execution.js +109 -11
- package/dist/runtime-execution.js.map +1 -1
- package/dist/runtime-guardrails.d.ts +26 -0
- package/dist/runtime-guardrails.js +168 -0
- package/dist/runtime-guardrails.js.map +1 -0
- package/dist/setup-agents-import.js +5 -3
- package/dist/setup-agents-import.js.map +1 -1
- package/dist/skills-catalog.js +1 -0
- package/dist/skills-catalog.js.map +1 -1
- package/dist/skills-commands.d.ts +5 -0
- package/dist/skills-commands.js +79 -2
- package/dist/skills-commands.js.map +1 -1
- package/dist/skills-memory.d.ts +36 -2
- package/dist/skills-memory.js +165 -6
- package/dist/skills-memory.js.map +1 -1
- package/dist/skills-planning.js +9 -22
- package/dist/skills-planning.js.map +1 -1
- package/dist/skills-render.js +2 -4
- package/dist/skills-render.js.map +1 -1
- package/dist/skills.d.ts +1 -1
- package/dist/skills.js +1 -1
- package/dist/skills.js.map +1 -1
- package/dist/sprint-commands.js +2 -1
- package/dist/sprint-commands.js.map +1 -1
- package/dist/subagent-protocol.js +3 -5
- package/dist/subagent-protocol.js.map +1 -1
- package/dist/support-commands.d.ts +2 -0
- package/dist/support-commands.js +18 -0
- package/dist/support-commands.js.map +1 -0
- package/dist/support-diagnostics.d.ts +49 -0
- package/dist/support-diagnostics.js +86 -0
- package/dist/support-diagnostics.js.map +1 -0
- package/dist/task-graph-commands.js +6 -14
- package/dist/task-graph-commands.js.map +1 -1
- package/dist/task-text.d.ts +8 -0
- package/dist/task-text.js +18 -0
- package/dist/task-text.js.map +1 -0
- package/dist/telemetry-redaction.js +8 -1
- package/dist/telemetry-redaction.js.map +1 -1
- package/dist/tool-commands.d.ts +3 -0
- package/dist/tool-commands.js +62 -0
- package/dist/tool-commands.js.map +1 -1
- package/dist/tracker-adapters.d.ts +71 -0
- package/dist/tracker-adapters.js +186 -0
- package/dist/tracker-adapters.js.map +1 -0
- package/dist/tracker-commands.d.ts +2 -0
- package/dist/tracker-commands.js +119 -0
- package/dist/tracker-commands.js.map +1 -0
- package/dist/types/metrics.d.ts +25 -1
- package/dist/types/model-config.d.ts +51 -4
- package/dist/types/runtime.d.ts +83 -0
- package/dist/types/skills.d.ts +2 -0
- package/dist/types/tasks.d.ts +10 -0
- package/dist/types/workflow-run.d.ts +35 -0
- package/dist/types.d.ts +12 -4
- package/dist/types.js.map +1 -1
- package/dist/upgrade-commands.js +13 -4
- package/dist/upgrade-commands.js.map +1 -1
- package/dist/validation.js +2 -2
- package/dist/validation.js.map +1 -1
- package/dist/visual-validation.d.ts +81 -0
- package/dist/visual-validation.js +290 -0
- package/dist/visual-validation.js.map +1 -0
- package/dist/web-action-security.d.ts +11 -0
- package/dist/web-action-security.js +45 -0
- package/dist/web-action-security.js.map +1 -0
- package/dist/web-api-read-routes.js +115 -3
- package/dist/web-api-read-routes.js.map +1 -1
- package/dist/web-api.js +507 -5
- package/dist/web-api.js.map +1 -1
- package/dist/web-artifacts.d.ts +55 -0
- package/dist/web-artifacts.js +222 -0
- package/dist/web-artifacts.js.map +1 -0
- package/dist/web-console/assets/index-C9lx-V42.css +1 -0
- package/dist/web-console/assets/index-M3S0g1GK.js +11 -0
- package/dist/web-console/index.html +13 -0
- package/dist/web-console.js +9 -3
- package/dist/web-console.js.map +1 -1
- package/dist/web-recovery.d.ts +30 -0
- package/dist/web-recovery.js +163 -0
- package/dist/web-recovery.js.map +1 -0
- package/dist/web-workflow-progress.d.ts +41 -0
- package/dist/web-workflow-progress.js +114 -0
- package/dist/web-workflow-progress.js.map +1 -0
- package/dist/workflow-approval-service.d.ts +2 -1
- package/dist/workflow-approval-service.js +83 -4
- package/dist/workflow-approval-service.js.map +1 -1
- package/dist/workflow-approval-utils.js +13 -3
- package/dist/workflow-approval-utils.js.map +1 -1
- package/dist/workflow-event-query.d.ts +2 -0
- package/dist/workflow-event-query.js +6 -0
- package/dist/workflow-event-query.js.map +1 -0
- package/dist/workflow-evidence-service.js +18 -9
- package/dist/workflow-evidence-service.js.map +1 -1
- package/dist/workflow-gates.d.ts +2 -0
- package/dist/workflow-gates.js +103 -0
- package/dist/workflow-gates.js.map +1 -1
- package/dist/workflow-markdown.d.ts +6 -0
- package/dist/workflow-markdown.js +25 -0
- package/dist/workflow-markdown.js.map +1 -0
- package/dist/workflow-phase-planner.d.ts +19 -0
- package/dist/workflow-phase-planner.js +133 -0
- package/dist/workflow-phase-planner.js.map +1 -0
- package/dist/workflow-run-commands.d.ts +1 -0
- package/dist/workflow-run-commands.js +247 -20
- package/dist/workflow-run-commands.js.map +1 -1
- package/dist/workflow-services.d.ts +21 -12
- package/dist/workflow-services.js +376 -260
- package/dist/workflow-services.js.map +1 -1
- package/dist/workflow-task-service.d.ts +11 -0
- package/dist/workflow-task-service.js +242 -0
- package/dist/workflow-task-service.js.map +1 -0
- package/dist/workflow-templates.js +2 -14
- package/dist/workflow-templates.js.map +1 -1
- package/dist/workspace-validator.js +133 -5
- package/dist/workspace-validator.js.map +1 -1
- package/dist/workspace.js +10 -2
- package/dist/workspace.js.map +1 -1
- package/docs/adoption-guide.md +147 -0
- package/docs/autonomous-workflow.md +146 -28
- package/docs/benchmark.md +17 -9
- package/docs/command-contracts.md +18 -1
- package/docs/core-command-surface.md +62 -13
- package/docs/end-to-end-demo.md +1 -0
- package/docs/extension-contracts.md +83 -0
- package/docs/orchestra-mvp.md +86 -3
- package/docs/persona-workflows.md +32 -0
- package/docs/release-test-matrix.md +42 -0
- package/docs/runtime-adapters.md +113 -0
- package/docs/runtime-llm-flow.md +13 -0
- package/docs/setup-agents-applicability-review.md +173 -0
- package/docs/skill-loading-strategy.md +1 -0
- package/docs/source-of-truth-and-agent-learning.md +14 -0
- package/docs/traceability-flow.md +5 -1
- package/docs/tracker-adapter-contract.md +10 -1
- package/docs/web-console-qa.md +35 -0
- package/package.json +12 -6
- package/rules/development-engineering.mdc +66 -0
- package/skills/doc-sync/SKILL.md +2 -0
package/dist/ollama-provider.js
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
import { apiKeyFromEnvFile, joinUrlPath, numberFrom, stringFrom, } from "./provider-utils.js";
|
|
1
|
+
import { apiKeyFromEnvFile, joinUrlPath, modelProviderCapabilities, modelProviderRuntime, numberFrom, stringFrom, } from "./provider-utils.js";
|
|
2
2
|
export class OllamaModelProvider {
|
|
3
3
|
id = "ollama";
|
|
4
|
-
capabilities =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
jsonMode: true,
|
|
9
|
-
maxContextTokens: 0,
|
|
10
|
-
timeoutMs: 30000,
|
|
11
|
-
};
|
|
12
|
-
fetchFn;
|
|
13
|
-
env;
|
|
14
|
-
constructor({ fetchFn = fetch, env = process.env, } = {}) {
|
|
15
|
-
this.fetchFn = fetchFn;
|
|
16
|
-
this.env = env;
|
|
4
|
+
capabilities = modelProviderCapabilities();
|
|
5
|
+
runtime;
|
|
6
|
+
constructor(options = {}) {
|
|
7
|
+
this.runtime = modelProviderRuntime(options);
|
|
17
8
|
}
|
|
18
9
|
async complete(request) {
|
|
19
|
-
const response = await this.fetchFn(ollamaChatCompletionsEndpoint(this.env.OLLAMA_BASE_URL), {
|
|
10
|
+
const response = await this.runtime.fetchFn(ollamaChatCompletionsEndpoint(this.runtime.env.OLLAMA_BASE_URL), {
|
|
20
11
|
method: "POST",
|
|
21
12
|
headers: {
|
|
22
13
|
"content-type": "application/json",
|
|
23
|
-
authorization: `Bearer ${ollamaApiKey(this.env)}`,
|
|
14
|
+
authorization: `Bearer ${ollamaApiKey(this.runtime.env)}`,
|
|
24
15
|
},
|
|
25
16
|
body: JSON.stringify(ollamaRequestBody(request)),
|
|
26
17
|
signal: AbortSignal.timeout(request.timeoutMs ?? this.capabilities.timeoutMs),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ollama-provider.js","sourceRoot":"","sources":["../src/ollama-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,UAAU,
|
|
1
|
+
{"version":3,"file":"ollama-provider.js","sourceRoot":"","sources":["../src/ollama-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,yBAAyB,EACzB,oBAAoB,EACpB,UAAU,EACV,UAAU,GAGX,MAAM,qBAAqB,CAAC;AAQ7B,MAAM,OAAO,mBAAmB;IACrB,EAAE,GAAG,QAAQ,CAAC;IACd,YAAY,GACnB,yBAAyB,EAAE,CAAC;IACb,OAAO,CAAuB;IAE/C,YAAY,UAAuC,EAAE;QACnD,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAqB;QAClC,MAAM,QAAQ,GAAG,MAA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EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,SAAS;YACnC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE;YACtC,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,OAAkC;IAElC,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC;IACnD,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IACzC,IAAI,MAAM,KAAK,YAAY;QAAE,OAAO,WAAW,CAAC;IAChD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -6,6 +6,7 @@ export interface PackageUpdateCheckOptions {
|
|
|
6
6
|
now?: Date;
|
|
7
7
|
fetchLatestVersion?: (packageName: string, distTag: "latest" | "beta") => Promise<string | undefined>;
|
|
8
8
|
cacheTtlMs?: number;
|
|
9
|
+
env?: NodeJS.ProcessEnv;
|
|
9
10
|
}
|
|
10
11
|
export interface PackageUpdateCheckResult {
|
|
11
12
|
packageName: string;
|
|
@@ -16,8 +17,26 @@ export interface PackageUpdateCheckResult {
|
|
|
16
17
|
checkedAt: string;
|
|
17
18
|
updateCommand: string;
|
|
18
19
|
}
|
|
20
|
+
export interface InstalledPackageUpgradePlan {
|
|
21
|
+
packageName: string;
|
|
22
|
+
currentVersion: string;
|
|
23
|
+
targetVersionOrTag: string;
|
|
24
|
+
installCommand: string;
|
|
25
|
+
rollbackCommand: string;
|
|
26
|
+
smokeCommand: string;
|
|
27
|
+
rollbackSmokeCommand: string;
|
|
28
|
+
migrationCheckCommand: string;
|
|
29
|
+
postUpgradeCommands: string[];
|
|
30
|
+
}
|
|
19
31
|
export declare function checkPackageUpdate(options: PackageUpdateCheckOptions): Promise<PackageUpdateCheckResult | undefined>;
|
|
20
32
|
export declare function renderPackageUpdateWarning(result: PackageUpdateCheckResult): string;
|
|
21
33
|
export declare function compareVersions(left: string, right: string): number;
|
|
22
34
|
export declare function canonicalInstallCommand(packageName: string | undefined, versionOrTag: string): string;
|
|
23
35
|
export declare function postInstallSmokeCommand(binaryName?: string): string;
|
|
36
|
+
export declare function configMigrationCheckCommand(binaryName?: string): string;
|
|
37
|
+
export declare function buildInstalledPackageUpgradePlan(options: {
|
|
38
|
+
packageName?: string;
|
|
39
|
+
currentVersion: string;
|
|
40
|
+
targetVersionOrTag: string;
|
|
41
|
+
binaryName?: string;
|
|
42
|
+
}): InstalledPackageUpgradePlan;
|
|
@@ -3,6 +3,7 @@ import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { request } from "node:https";
|
|
6
|
+
import { shouldSkipExternalNetwork } from "./network-policy.js";
|
|
6
7
|
const DEFAULT_CACHE_TTL_MS = 12 * 60 * 60 * 1000;
|
|
7
8
|
const REGISTRY_TIMEOUT_MS = 750;
|
|
8
9
|
export async function checkPackageUpdate(options) {
|
|
@@ -55,7 +56,30 @@ export function canonicalInstallCommand(packageName = "@jterrats/open-orchestra"
|
|
|
55
56
|
export function postInstallSmokeCommand(binaryName = "orchestra") {
|
|
56
57
|
return `${binaryName} version --json && ${binaryName} health --json`;
|
|
57
58
|
}
|
|
59
|
+
export function configMigrationCheckCommand(binaryName = "orchestra") {
|
|
60
|
+
return `${binaryName} config migrate --json`;
|
|
61
|
+
}
|
|
62
|
+
export function buildInstalledPackageUpgradePlan(options) {
|
|
63
|
+
const packageName = options.packageName ?? "@jterrats/open-orchestra";
|
|
64
|
+
const binaryName = options.binaryName ?? "orchestra";
|
|
65
|
+
const smokeCommand = postInstallSmokeCommand(binaryName);
|
|
66
|
+
const migrationCheckCommand = configMigrationCheckCommand(binaryName);
|
|
67
|
+
return {
|
|
68
|
+
packageName,
|
|
69
|
+
currentVersion: options.currentVersion,
|
|
70
|
+
targetVersionOrTag: options.targetVersionOrTag,
|
|
71
|
+
installCommand: canonicalInstallCommand(packageName, options.targetVersionOrTag),
|
|
72
|
+
rollbackCommand: canonicalInstallCommand(packageName, options.currentVersion),
|
|
73
|
+
smokeCommand,
|
|
74
|
+
rollbackSmokeCommand: smokeCommand,
|
|
75
|
+
migrationCheckCommand,
|
|
76
|
+
postUpgradeCommands: [smokeCommand, migrationCheckCommand],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
58
79
|
async function fetchAndCacheLatestVersion(options, cacheDir, now, cacheKey) {
|
|
80
|
+
if (shouldSkipExternalNetwork(options.env)) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
59
83
|
const latestVersion = await (options.fetchLatestVersion ?? fetchNpmLatest)(options.packageName, options.distTag ?? "latest").catch(() => undefined);
|
|
60
84
|
if (!latestVersion) {
|
|
61
85
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-update-check.js","sourceRoot":"","sources":["../src/package-update-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"package-update-check.js","sourceRoot":"","sources":["../src/package-update-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,K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|
17
17
|
}>;
|
|
18
18
|
export declare function parsePhaseOutput(content: string): PhaseStructuredOutput;
|
|
19
|
+
export declare function validatePhaseOutputContract(phase: PhaseExecutorPhase, output: PhaseStructuredOutput): void;
|
package/dist/phase-executor.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
1
|
+
import { chmod, readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { ensureDir, resolveWorkflowPath } from "./fs-utils.js";
|
|
4
4
|
import { loadPhasePlaybook } from "./phase-playbooks.js";
|
|
5
|
+
import { markdownListOrNone } from "./workflow-markdown.js";
|
|
5
6
|
import { renderSkills } from "./skills.js";
|
|
6
7
|
import { appendEvent, readEvents, writeArtifact } from "./workspace.js";
|
|
8
|
+
import { checkArchitectSizing } from "./autonomous-phase-lifecycle.js";
|
|
7
9
|
import { checkUsageBudget, completeWithProviderFallback, getTaskContext, getWorkflowConfig, recordDecision, recordModelProvenance, } from "./workflow-services.js";
|
|
10
|
+
import { generatePlaywrightTestPlan } from "./workflow-summary-service.js";
|
|
8
11
|
const DEFAULT_ARCHITECT_SIZING = "m [3 points]";
|
|
12
|
+
const DEFAULT_ARCHITECT_SIZING_LABEL = "m";
|
|
13
|
+
const DEFAULT_ARCHITECT_POINTS = 3;
|
|
14
|
+
const DEFAULT_DEVELOPER_POINTS = 3;
|
|
9
15
|
export async function phaseExecutionMode(root, role) {
|
|
10
16
|
const routing = await phaseRouting(root, role);
|
|
11
17
|
return routing.provider === "none" ? "deterministic" : "llm";
|
|
@@ -17,6 +23,14 @@ export async function executePhaseWithLlm({ root, run, phase, phaseIndex, }) {
|
|
|
17
23
|
}
|
|
18
24
|
const routing = await phaseRouting(root, phase.role);
|
|
19
25
|
if (routing.provider === "none") {
|
|
26
|
+
const output = defaultStructuredOutput(phase);
|
|
27
|
+
await generateQaE2eArtifactsIfApplicable({ root, run, phase, output });
|
|
28
|
+
if (phase.role === "architect") {
|
|
29
|
+
await recordArchitectSizingIfMissing(root, run.taskId, output);
|
|
30
|
+
}
|
|
31
|
+
if (phase.role === "developer") {
|
|
32
|
+
await recordDeveloperPointsIfMissing(root, run.taskId, output);
|
|
33
|
+
}
|
|
20
34
|
return {
|
|
21
35
|
mode: "deterministic",
|
|
22
36
|
outcome: { kind: "done", notes: phase.summary },
|
|
@@ -32,6 +46,8 @@ export async function executePhaseWithLlm({ root, run, phase, phaseIndex, }) {
|
|
|
32
46
|
});
|
|
33
47
|
const response = result.response;
|
|
34
48
|
const output = parsePhaseOutput(response.content);
|
|
49
|
+
validatePhaseOutputContract(phase, output);
|
|
50
|
+
await generateQaE2eArtifactsIfApplicable({ root, run, phase, output });
|
|
35
51
|
const artifact = await writePhaseArtifact({
|
|
36
52
|
root,
|
|
37
53
|
run,
|
|
@@ -68,13 +84,17 @@ export async function executePhaseWithLlm({ root, run, phase, phaseIndex, }) {
|
|
|
68
84
|
},
|
|
69
85
|
});
|
|
70
86
|
if (phase.role === "architect") {
|
|
71
|
-
await
|
|
87
|
+
await recordArchitectSizingIfMissing(root, run.taskId, output);
|
|
88
|
+
}
|
|
89
|
+
if (phase.role === "developer") {
|
|
90
|
+
await recordDeveloperPointsIfMissing(root, run.taskId, output);
|
|
72
91
|
}
|
|
73
92
|
const outcome = phaseOutcome(phase, output);
|
|
74
93
|
return { mode: "llm", artifact, output, outcome };
|
|
75
94
|
}
|
|
76
95
|
export async function buildPhasePrompt({ root, run, phase, phaseIndex, }) {
|
|
77
96
|
const context = await getTaskContext(run.taskId, root);
|
|
97
|
+
const observations = observationDecisions(context.decisions);
|
|
78
98
|
const skills = await renderSkills({
|
|
79
99
|
target: "generic",
|
|
80
100
|
taskId: run.taskId,
|
|
@@ -88,6 +108,7 @@ export async function buildPhasePrompt({ root, run, phase, phaseIndex, }) {
|
|
|
88
108
|
system: [
|
|
89
109
|
`You are the ${phase.role} phase agent for Open Orchestra.`,
|
|
90
110
|
skills.content,
|
|
111
|
+
workflowRunModeProtocol(run.mode ?? "new", observations),
|
|
91
112
|
"Phase playbook:",
|
|
92
113
|
playbook.content,
|
|
93
114
|
...(playbook.warning ? [`Warning: ${playbook.warning}`] : []),
|
|
@@ -98,6 +119,7 @@ export async function buildPhasePrompt({ root, run, phase, phaseIndex, }) {
|
|
|
98
119
|
`Phase index: ${phaseIndex}`,
|
|
99
120
|
`Phase: ${phase.phase}`,
|
|
100
121
|
`Role: ${phase.role}`,
|
|
122
|
+
`Workflow mode: ${run.mode ?? "new"}`,
|
|
101
123
|
"",
|
|
102
124
|
"Task context JSON:",
|
|
103
125
|
JSON.stringify(context, null, 2),
|
|
@@ -112,9 +134,49 @@ export async function buildPhasePrompt({ root, run, phase, phaseIndex, }) {
|
|
|
112
134
|
].join("\n"),
|
|
113
135
|
};
|
|
114
136
|
}
|
|
137
|
+
function workflowRunModeProtocol(mode, observations) {
|
|
138
|
+
if (mode === "redo") {
|
|
139
|
+
return [
|
|
140
|
+
"Workflow redo protocol:",
|
|
141
|
+
"- Treat every OBSERVATION as mandatory rework input.",
|
|
142
|
+
"- Phase output must address each observation with quote, accept/reject/defer, reasoning, and evidence.",
|
|
143
|
+
"- Accepted observations require corrected output; rejected or deferred observations require explicit rationale.",
|
|
144
|
+
"",
|
|
145
|
+
"Mandatory observations:",
|
|
146
|
+
observations.length > 0
|
|
147
|
+
? observations.map((item) => `- ${item}`).join("\n")
|
|
148
|
+
: "- None recorded.",
|
|
149
|
+
].join("\n");
|
|
150
|
+
}
|
|
151
|
+
if (mode === "sign-off") {
|
|
152
|
+
return [
|
|
153
|
+
"Workflow sign-off protocol:",
|
|
154
|
+
"- Validate prior output without silently clearing unresolved OBSERVATION items.",
|
|
155
|
+
"- If any observation remains unresolved, return verdict fail or include a blocking finding.",
|
|
156
|
+
"",
|
|
157
|
+
"Open observations:",
|
|
158
|
+
observations.length > 0
|
|
159
|
+
? observations.map((item) => `- ${item}`).join("\n")
|
|
160
|
+
: "- None recorded.",
|
|
161
|
+
].join("\n");
|
|
162
|
+
}
|
|
163
|
+
return "Workflow mode: new. Produce first-pass phase output against current context.";
|
|
164
|
+
}
|
|
165
|
+
function observationDecisions(decisions) {
|
|
166
|
+
return decisions
|
|
167
|
+
.map((decision) => ({
|
|
168
|
+
title: String(decision.metadata.title ?? decision.summary),
|
|
169
|
+
decision: String(decision.metadata.decision ?? ""),
|
|
170
|
+
}))
|
|
171
|
+
.filter((decision) => decision.title.startsWith("OBSERVATION:") ||
|
|
172
|
+
decision.decision.startsWith("OBSERVATION:"))
|
|
173
|
+
.map((decision) => decision.decision
|
|
174
|
+
? `${decision.title} — ${decision.decision}`
|
|
175
|
+
: decision.title);
|
|
176
|
+
}
|
|
115
177
|
export function parsePhaseOutput(content) {
|
|
116
178
|
const parsed = JSON.parse(extractJson(content));
|
|
117
|
-
|
|
179
|
+
const output = {
|
|
118
180
|
summary: stringOrDefault(parsed.summary, "Phase completed"),
|
|
119
181
|
notes: stringOrDefault(parsed.notes, parsed.summary ?? "Phase completed"),
|
|
120
182
|
verdict: parsed.verdict === "fail" ? "fail" : "pass",
|
|
@@ -122,17 +184,242 @@ export function parsePhaseOutput(content) {
|
|
|
122
184
|
? parsed.findings.map((finding) => String(finding))
|
|
123
185
|
: [],
|
|
124
186
|
decisions: Array.isArray(parsed.decisions)
|
|
125
|
-
? parsed.decisions
|
|
187
|
+
? parsed.decisions
|
|
188
|
+
.map((decision) => structuredItemToString(decision, "decision"))
|
|
189
|
+
.filter((decision) => decision.length > 0)
|
|
126
190
|
: [],
|
|
127
191
|
evidence: Array.isArray(parsed.evidence)
|
|
128
|
-
? parsed.evidence
|
|
192
|
+
? parsed.evidence
|
|
193
|
+
.map((item) => structuredItemToString(item, "evidence"))
|
|
194
|
+
.filter((item) => item.length > 0)
|
|
129
195
|
: [],
|
|
130
196
|
handoff: stringOrDefault(parsed.handoff, parsed.notes ?? "Phase handoff ready"),
|
|
131
|
-
sizing:
|
|
132
|
-
|
|
133
|
-
|
|
197
|
+
sizing: normalizeArchitectSizing(parsed.sizing),
|
|
198
|
+
};
|
|
199
|
+
const noOpRationale = stringOrUndefined(parsed.noOpRationale);
|
|
200
|
+
if (noOpRationale !== undefined) {
|
|
201
|
+
output.noOpRationale = noOpRationale;
|
|
202
|
+
}
|
|
203
|
+
const architecturalConcerns = normalizeArchitecturalConcerns(parsed.architecturalConcerns);
|
|
204
|
+
if (architecturalConcerns !== undefined) {
|
|
205
|
+
output.architecturalConcerns = architecturalConcerns;
|
|
206
|
+
}
|
|
207
|
+
const developerPoints = normalizeDeveloperPoints(parsed.developerPoints);
|
|
208
|
+
if (developerPoints !== undefined) {
|
|
209
|
+
output.developerPoints = developerPoints;
|
|
210
|
+
}
|
|
211
|
+
return output;
|
|
212
|
+
}
|
|
213
|
+
export function validatePhaseOutputContract(phase, output) {
|
|
214
|
+
if (!isPlaceholderPhaseOutput(phase, output)) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const rationale = output.noOpRationale?.trim();
|
|
218
|
+
if (rationale && rationale.length >= 20) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
throw new Error([
|
|
222
|
+
`phase output failed contract: ${phase.phase} provider returned placeholder output`,
|
|
223
|
+
"include phase-specific summary, findings/decisions/evidence, or an explicit noOpRationale for intentional no-op work",
|
|
224
|
+
].join("; "));
|
|
225
|
+
}
|
|
226
|
+
async function generateQaE2eArtifactsIfApplicable({ root, run, phase, output, }) {
|
|
227
|
+
if (phase.phase !== "qa") {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const context = await getTaskContext(run.taskId, root);
|
|
231
|
+
if (!needsExecutableE2eArtifacts(context)) {
|
|
232
|
+
await recordSkippedQaE2e({
|
|
233
|
+
root,
|
|
234
|
+
run,
|
|
235
|
+
phase,
|
|
236
|
+
output,
|
|
237
|
+
reason: "Task scope does not reference browser, CLI, shell, UI, site, or E2E validation.",
|
|
238
|
+
});
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
const selection = await e2eSelectionForTask(root, context.task);
|
|
242
|
+
if (selection.style === "skipped") {
|
|
243
|
+
await recordSkippedQaE2e({
|
|
244
|
+
root,
|
|
245
|
+
run,
|
|
246
|
+
phase,
|
|
247
|
+
output,
|
|
248
|
+
reason: selection.reason,
|
|
249
|
+
});
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const directory = path.join("runs", run.taskId, phase.phase);
|
|
253
|
+
await ensureDir(resolveWorkflowPath(root, directory));
|
|
254
|
+
const plan = await generatePlaywrightTestPlan(run.taskId, root);
|
|
255
|
+
const planArtifact = await writeArtifact(root, directory, `${run.id}-${phase.phase}-e2e-plan.md`, renderGeneratedE2ePlan(plan, selection));
|
|
256
|
+
const runnerArtifact = await writeArtifact(root, directory, `${run.id}-${phase.phase}-e2e.sh`, renderGeneratedE2eRunner(selection.commands));
|
|
257
|
+
await chmod(path.join(root, runnerArtifact), 0o755);
|
|
258
|
+
output.evidence.push(`Generated ${selection.style} E2E plan: ${planArtifact}`, `Generated executable E2E runner: ${runnerArtifact}`);
|
|
259
|
+
await appendEvent(root, {
|
|
260
|
+
type: "EVIDENCE_ADDED",
|
|
261
|
+
taskId: run.taskId,
|
|
262
|
+
actor: phase.role,
|
|
263
|
+
summary: "QA generated executable E2E artifacts",
|
|
264
|
+
artifacts: [planArtifact, runnerArtifact],
|
|
265
|
+
metadata: {
|
|
266
|
+
runId: run.id,
|
|
267
|
+
phase: phase.phase,
|
|
268
|
+
style: selection.style,
|
|
269
|
+
commands: selection.commands,
|
|
270
|
+
reason: selection.reason,
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
async function recordSkippedQaE2e({ root, run, phase, output, reason, }) {
|
|
275
|
+
output.evidence.push(`E2E generation skipped: ${reason}`);
|
|
276
|
+
await appendEvent(root, {
|
|
277
|
+
type: "EVIDENCE_ADDED",
|
|
278
|
+
taskId: run.taskId,
|
|
279
|
+
actor: phase.role,
|
|
280
|
+
summary: "QA skipped E2E artifact generation",
|
|
281
|
+
artifacts: [],
|
|
282
|
+
metadata: {
|
|
283
|
+
runId: run.id,
|
|
284
|
+
phase: phase.phase,
|
|
285
|
+
style: "skipped",
|
|
286
|
+
reason,
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
function needsExecutableE2eArtifacts(context) {
|
|
291
|
+
const taskText = [
|
|
292
|
+
context.task.title,
|
|
293
|
+
context.task.goal,
|
|
294
|
+
...(context.task.acceptanceCriteria ?? []),
|
|
295
|
+
...(context.task.risks ?? []),
|
|
296
|
+
...(context.task.paths ?? []),
|
|
297
|
+
]
|
|
298
|
+
.join(" ")
|
|
299
|
+
.toLowerCase();
|
|
300
|
+
return /\b(e2e|end-to-end|playwright|browser|web|ui|site|cli)\b/.test(taskText);
|
|
301
|
+
}
|
|
302
|
+
async function e2eSelectionForTask(root, task) {
|
|
303
|
+
const scripts = await packageScripts(root);
|
|
304
|
+
const taskText = [
|
|
305
|
+
task.title,
|
|
306
|
+
task.goal,
|
|
307
|
+
...(task.acceptanceCriteria ?? []),
|
|
308
|
+
...(task.paths ?? []),
|
|
309
|
+
]
|
|
310
|
+
.join(" ")
|
|
311
|
+
.toLowerCase();
|
|
312
|
+
const commands = [];
|
|
313
|
+
const styles = new Set();
|
|
314
|
+
if (scripts.has("test:e2e:init") &&
|
|
315
|
+
/\b(cli|init|onboarding)\b/.test(taskText)) {
|
|
316
|
+
commands.push("npm run test:e2e:init");
|
|
317
|
+
styles.add("cli");
|
|
318
|
+
}
|
|
319
|
+
if (scripts.has("test:cli") && /\b(cli|command|terminal)\b/.test(taskText)) {
|
|
320
|
+
commands.push("npm run test:cli");
|
|
321
|
+
styles.add("cli");
|
|
322
|
+
}
|
|
323
|
+
if (scripts.has("test:e2e") &&
|
|
324
|
+
/\b(e2e|end-to-end|playwright|browser|web|ui|site)\b/.test(taskText)) {
|
|
325
|
+
commands.push("npm run test:e2e");
|
|
326
|
+
styles.add("browser");
|
|
327
|
+
}
|
|
328
|
+
if (scripts.has("test:shell") &&
|
|
329
|
+
/\b(shell|sh|bash|script|deployment|deploy)\b/.test(taskText)) {
|
|
330
|
+
commands.push("npm run test:shell");
|
|
331
|
+
styles.add("shell");
|
|
332
|
+
}
|
|
333
|
+
if (scripts.has("test:smoke") &&
|
|
334
|
+
/\b(shell|sh|bash|script|deployment|deploy|smoke)\b/.test(taskText)) {
|
|
335
|
+
commands.push("npm run test:smoke");
|
|
336
|
+
styles.add("shell");
|
|
337
|
+
}
|
|
338
|
+
if (commands.length === 0 && /\b(e2e|end-to-end)\b/.test(taskText)) {
|
|
339
|
+
for (const script of [...scripts].filter((name) => name.startsWith("test:e2e"))) {
|
|
340
|
+
commands.push(`npm run ${script}`);
|
|
341
|
+
styles.add(script === "test:e2e:init" ? "cli" : "browser");
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
const uniqueCommands = [...new Set(commands)];
|
|
345
|
+
if (uniqueCommands.length === 0) {
|
|
346
|
+
return {
|
|
347
|
+
style: "skipped",
|
|
348
|
+
commands: [],
|
|
349
|
+
reason: "Task appears to need E2E validation, but no matching test:e2e, test:cli, test:shell, or test:smoke script was found.",
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
style: styles.size === 1 ? [...styles][0] : "mixed",
|
|
354
|
+
commands: uniqueCommands,
|
|
355
|
+
reason: "Matched QA E2E scripts from task scope and package scripts.",
|
|
134
356
|
};
|
|
135
357
|
}
|
|
358
|
+
async function packageScripts(root) {
|
|
359
|
+
try {
|
|
360
|
+
const pkg = JSON.parse(await readFile(path.join(root, "package.json"), "utf8"));
|
|
361
|
+
return new Set(Object.entries(pkg.scripts ?? {})
|
|
362
|
+
.filter(([, value]) => typeof value === "string")
|
|
363
|
+
.map(([name]) => name));
|
|
364
|
+
}
|
|
365
|
+
catch {
|
|
366
|
+
return new Set();
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function renderGeneratedE2ePlan(plan, selection) {
|
|
370
|
+
return [
|
|
371
|
+
`# Generated E2E Plan: ${plan.taskId}`,
|
|
372
|
+
"",
|
|
373
|
+
`- Title: ${plan.title}`,
|
|
374
|
+
`- Target user: ${plan.targetUser}`,
|
|
375
|
+
`- Style: ${selection.style}`,
|
|
376
|
+
`- Reason: ${selection.reason}`,
|
|
377
|
+
`- Executable runner: ./${plan.taskId}-qa-e2e.sh`,
|
|
378
|
+
"",
|
|
379
|
+
"## Commands",
|
|
380
|
+
...selection.commands.map((command) => `- ${command}`),
|
|
381
|
+
"",
|
|
382
|
+
"## Scenarios",
|
|
383
|
+
...plan.scenarios.flatMap((scenario) => [
|
|
384
|
+
`### ${scenario.name}`,
|
|
385
|
+
`- Source: ${scenario.source}`,
|
|
386
|
+
`- Page object: ${scenario.pageObject}`,
|
|
387
|
+
`- Selectors: ${scenario.selectors.join("; ")}`,
|
|
388
|
+
`- Assertions: ${scenario.assertions.join("; ")}`,
|
|
389
|
+
`- Evidence: ${scenario.evidence.join(", ")}`,
|
|
390
|
+
"",
|
|
391
|
+
]),
|
|
392
|
+
"## Fixtures",
|
|
393
|
+
...markdownListOrNone(plan.fixtures),
|
|
394
|
+
"",
|
|
395
|
+
"## Notes",
|
|
396
|
+
...markdownListOrNone(plan.notes),
|
|
397
|
+
"",
|
|
398
|
+
].join("\n");
|
|
399
|
+
}
|
|
400
|
+
function renderGeneratedE2eRunner(commands) {
|
|
401
|
+
return [
|
|
402
|
+
"#!/usr/bin/env sh",
|
|
403
|
+
"set -eu",
|
|
404
|
+
"",
|
|
405
|
+
...commands.flatMap((command) => [`echo "+ ${command}"`, command, ""]),
|
|
406
|
+
].join("\n");
|
|
407
|
+
}
|
|
408
|
+
function structuredItemToString(value, fallbackKind) {
|
|
409
|
+
if (typeof value === "string") {
|
|
410
|
+
return value.trim();
|
|
411
|
+
}
|
|
412
|
+
if (isRecord(value)) {
|
|
413
|
+
const summary = stringOrDefault(value.summary, "");
|
|
414
|
+
const pathValue = stringOrDefault(value.path, "");
|
|
415
|
+
const kind = stringOrDefault(value.kind, fallbackKind);
|
|
416
|
+
if (summary || pathValue) {
|
|
417
|
+
return [kind, summary, pathValue].filter(Boolean).join(": ");
|
|
418
|
+
}
|
|
419
|
+
return JSON.stringify(value);
|
|
420
|
+
}
|
|
421
|
+
return String(value).trim();
|
|
422
|
+
}
|
|
136
423
|
async function phaseRouting(root, role) {
|
|
137
424
|
const config = await getWorkflowConfig(root);
|
|
138
425
|
return config.providers.byRole?.[role] ?? config.providers.defaults;
|
|
@@ -146,7 +433,31 @@ function phaseOutcome(phase, output) {
|
|
|
146
433
|
}
|
|
147
434
|
return { kind: "done", notes: output.notes };
|
|
148
435
|
}
|
|
149
|
-
|
|
436
|
+
function isPlaceholderPhaseOutput(phase, output) {
|
|
437
|
+
const defaultOutput = defaultStructuredOutput(phase);
|
|
438
|
+
return (output.verdict === "pass" &&
|
|
439
|
+
output.summary.trim() === defaultOutput.summary &&
|
|
440
|
+
output.notes.trim() === defaultOutput.notes &&
|
|
441
|
+
output.handoff.trim() === defaultOutput.handoff &&
|
|
442
|
+
sameStringArray(output.findings, defaultOutput.findings) &&
|
|
443
|
+
sameStringArray(output.decisions, defaultOutput.decisions) &&
|
|
444
|
+
sameStringArray(output.evidence, defaultOutput.evidence) &&
|
|
445
|
+
(phase.role !== "architect" || output.sizing === defaultOutput.sizing) &&
|
|
446
|
+
(phase.role !== "developer" ||
|
|
447
|
+
(output.developerPoints === defaultOutput.developerPoints &&
|
|
448
|
+
sameArchitecturalConcerns(output.architecturalConcerns, defaultOutput.architecturalConcerns))));
|
|
449
|
+
}
|
|
450
|
+
function sameStringArray(left, right) {
|
|
451
|
+
return JSON.stringify(left) === JSON.stringify(right);
|
|
452
|
+
}
|
|
453
|
+
function sameArchitecturalConcerns(left, right) {
|
|
454
|
+
return JSON.stringify(left ?? {}) === JSON.stringify(right ?? {});
|
|
455
|
+
}
|
|
456
|
+
async function recordArchitectSizingIfMissing(root, taskId, output) {
|
|
457
|
+
const existingSizing = await checkArchitectSizing(root, taskId);
|
|
458
|
+
if (existingSizing.found) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
150
461
|
await recordDecision({
|
|
151
462
|
task: taskId,
|
|
152
463
|
owner: "architect",
|
|
@@ -157,6 +468,74 @@ async function recordArchitectSizing(root, taskId, output) {
|
|
|
157
468
|
status: "accepted",
|
|
158
469
|
}, root);
|
|
159
470
|
}
|
|
471
|
+
function normalizeArchitectSizing(value) {
|
|
472
|
+
if (typeof value !== "string") {
|
|
473
|
+
return DEFAULT_ARCHITECT_SIZING;
|
|
474
|
+
}
|
|
475
|
+
const match = /^\s*(xs|s|m|l|xl)\b/i.exec(value);
|
|
476
|
+
if (!match) {
|
|
477
|
+
return DEFAULT_ARCHITECT_SIZING;
|
|
478
|
+
}
|
|
479
|
+
const label = match[1]?.toLowerCase();
|
|
480
|
+
const pointsMatch = /\[(\d+)\s*points?\]/i.exec(value);
|
|
481
|
+
const points = pointsMatch && Number.isFinite(Number(pointsMatch[1]))
|
|
482
|
+
? Number(pointsMatch[1])
|
|
483
|
+
: label === DEFAULT_ARCHITECT_SIZING_LABEL
|
|
484
|
+
? DEFAULT_ARCHITECT_POINTS
|
|
485
|
+
: undefined;
|
|
486
|
+
return points === undefined ? label : `${label} [${points} points]`;
|
|
487
|
+
}
|
|
488
|
+
async function recordDeveloperPointsIfMissing(root, taskId, output) {
|
|
489
|
+
const existingPoints = await checkDeveloperPoints(root, taskId);
|
|
490
|
+
if (existingPoints !== undefined) {
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
const architectSizing = await checkArchitectSizing(root, taskId);
|
|
494
|
+
const points = output.developerPoints ??
|
|
495
|
+
(architectSizing.found ? architectSizing.points : undefined) ??
|
|
496
|
+
DEFAULT_DEVELOPER_POINTS;
|
|
497
|
+
await recordDecision({
|
|
498
|
+
task: taskId,
|
|
499
|
+
owner: "developer",
|
|
500
|
+
title: "Implementation story points",
|
|
501
|
+
context: output.summary,
|
|
502
|
+
decision: `${points} points`,
|
|
503
|
+
consequences: output.handoff,
|
|
504
|
+
status: "accepted",
|
|
505
|
+
}, root);
|
|
506
|
+
}
|
|
507
|
+
async function checkDeveloperPoints(root, taskId) {
|
|
508
|
+
const events = await readEvents(root);
|
|
509
|
+
for (const event of events) {
|
|
510
|
+
if (event.type === "DECISION_RECORDED" &&
|
|
511
|
+
event.taskId === taskId &&
|
|
512
|
+
event.actor === "developer" &&
|
|
513
|
+
typeof event.metadata.points === "number") {
|
|
514
|
+
return event.metadata.points;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
return undefined;
|
|
518
|
+
}
|
|
519
|
+
function normalizeDeveloperPoints(value) {
|
|
520
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
|
|
521
|
+
return undefined;
|
|
522
|
+
}
|
|
523
|
+
return Math.round(value);
|
|
524
|
+
}
|
|
525
|
+
function normalizeArchitecturalConcerns(value) {
|
|
526
|
+
if (!isRecord(value)) {
|
|
527
|
+
return undefined;
|
|
528
|
+
}
|
|
529
|
+
return {
|
|
530
|
+
inherited: stringArray(value.inherited),
|
|
531
|
+
selfImposed: stringArray(value.selfImposed),
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
function stringArray(value) {
|
|
535
|
+
return Array.isArray(value)
|
|
536
|
+
? value.map((item) => String(item).trim()).filter((item) => item.length > 0)
|
|
537
|
+
: [];
|
|
538
|
+
}
|
|
160
539
|
async function writePhaseArtifact({ root, run, phase, response, output, fallbackUsed, }) {
|
|
161
540
|
const directory = path.join("runs", run.taskId, phase.phase);
|
|
162
541
|
await ensureDir(resolveWorkflowPath(root, directory));
|
|
@@ -205,6 +584,13 @@ function defaultStructuredOutput(phase) {
|
|
|
205
584
|
if (phase.role === "architect") {
|
|
206
585
|
output.sizing = DEFAULT_ARCHITECT_SIZING;
|
|
207
586
|
}
|
|
587
|
+
if (phase.role === "developer") {
|
|
588
|
+
output.developerPoints = DEFAULT_DEVELOPER_POINTS;
|
|
589
|
+
output.architecturalConcerns = {
|
|
590
|
+
inherited: [],
|
|
591
|
+
selfImposed: [],
|
|
592
|
+
};
|
|
593
|
+
}
|
|
208
594
|
return output;
|
|
209
595
|
}
|
|
210
596
|
function extractJson(content) {
|
|
@@ -220,4 +606,10 @@ function extractJson(content) {
|
|
|
220
606
|
function stringOrDefault(value, fallback) {
|
|
221
607
|
return typeof value === "string" && value.trim() ? value : fallback;
|
|
222
608
|
}
|
|
609
|
+
function stringOrUndefined(value) {
|
|
610
|
+
return typeof value === "string" && value.trim() ? value : undefined;
|
|
611
|
+
}
|
|
612
|
+
function isRecord(value) {
|
|
613
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
614
|
+
}
|
|
223
615
|
//# sourceMappingURL=phase-executor.js.map
|