@oscharko-dev/keiko-workflows 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -0
- package/dist/bug-investigation/context.d.ts +7 -0
- package/dist/bug-investigation/context.d.ts.map +1 -0
- package/dist/bug-investigation/context.js +119 -0
- package/dist/bug-investigation/descriptor.d.ts +4 -0
- package/dist/bug-investigation/descriptor.d.ts.map +1 -0
- package/dist/bug-investigation/descriptor.js +46 -0
- package/dist/bug-investigation/emit.d.ts +13 -0
- package/dist/bug-investigation/emit.d.ts.map +1 -0
- package/dist/bug-investigation/emit.js +35 -0
- package/dist/bug-investigation/events.d.ts +2 -0
- package/dist/bug-investigation/events.d.ts.map +1 -0
- package/dist/bug-investigation/events.js +6 -0
- package/dist/bug-investigation/failure-parse.d.ts +4 -0
- package/dist/bug-investigation/failure-parse.d.ts.map +1 -0
- package/dist/bug-investigation/failure-parse.js +154 -0
- package/dist/bug-investigation/guard.d.ts +3 -0
- package/dist/bug-investigation/guard.d.ts.map +1 -0
- package/dist/bug-investigation/guard.js +69 -0
- package/dist/bug-investigation/index.d.ts +8 -0
- package/dist/bug-investigation/index.d.ts.map +1 -0
- package/dist/bug-investigation/index.js +13 -0
- package/dist/bug-investigation/internal.d.ts +39 -0
- package/dist/bug-investigation/internal.d.ts.map +1 -0
- package/dist/bug-investigation/internal.js +65 -0
- package/dist/bug-investigation/memory.d.ts +5 -0
- package/dist/bug-investigation/memory.d.ts.map +1 -0
- package/dist/bug-investigation/memory.js +91 -0
- package/dist/bug-investigation/model-loop.d.ts +5 -0
- package/dist/bug-investigation/model-loop.d.ts.map +1 -0
- package/dist/bug-investigation/model-loop.js +225 -0
- package/dist/bug-investigation/parse.d.ts +4 -0
- package/dist/bug-investigation/parse.d.ts.map +1 -0
- package/dist/bug-investigation/parse.js +125 -0
- package/dist/bug-investigation/prompt.d.ts +5 -0
- package/dist/bug-investigation/prompt.d.ts.map +1 -0
- package/dist/bug-investigation/prompt.js +122 -0
- package/dist/bug-investigation/report.d.ts +24 -0
- package/dist/bug-investigation/report.d.ts.map +1 -0
- package/dist/bug-investigation/report.js +151 -0
- package/dist/bug-investigation/stages.d.ts +14 -0
- package/dist/bug-investigation/stages.d.ts.map +1 -0
- package/dist/bug-investigation/stages.js +247 -0
- package/dist/bug-investigation/types.d.ts +88 -0
- package/dist/bug-investigation/types.d.ts.map +1 -0
- package/dist/bug-investigation/types.js +6 -0
- package/dist/bug-investigation/verify-stage.d.ts +11 -0
- package/dist/bug-investigation/verify-stage.d.ts.map +1 -0
- package/dist/bug-investigation/verify-stage.js +91 -0
- package/dist/bug-investigation/workflow.d.ts +3 -0
- package/dist/bug-investigation/workflow.d.ts.map +1 -0
- package/dist/bug-investigation/workflow.js +85 -0
- package/dist/contextpack/assemble.d.ts +35 -0
- package/dist/contextpack/assemble.d.ts.map +1 -0
- package/dist/contextpack/assemble.js +431 -0
- package/dist/contextpack/compaction.d.ts +23 -0
- package/dist/contextpack/compaction.d.ts.map +1 -0
- package/dist/contextpack/compaction.js +68 -0
- package/dist/contextpack/index.d.ts +9 -0
- package/dist/contextpack/index.d.ts.map +1 -0
- package/dist/contextpack/index.js +8 -0
- package/dist/contextpack/microIndex.d.ts +29 -0
- package/dist/contextpack/microIndex.d.ts.map +1 -0
- package/dist/contextpack/microIndex.js +98 -0
- package/dist/contextpack/reranker.d.ts +15 -0
- package/dist/contextpack/reranker.d.ts.map +1 -0
- package/dist/contextpack/reranker.js +31 -0
- package/dist/descriptor.d.ts +2 -0
- package/dist/descriptor.d.ts.map +1 -0
- package/dist/descriptor.js +1 -0
- package/dist/governed-handoff.d.ts +6 -0
- package/dist/governed-handoff.d.ts.map +1 -0
- package/dist/governed-handoff.js +86 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/planner/anchors.d.ts +17 -0
- package/dist/planner/anchors.d.ts.map +1 -0
- package/dist/planner/anchors.js +291 -0
- package/dist/planner/explorationPlanner.d.ts +9 -0
- package/dist/planner/explorationPlanner.d.ts.map +1 -0
- package/dist/planner/explorationPlanner.js +15 -0
- package/dist/planner/governor.d.ts +16 -0
- package/dist/planner/governor.d.ts.map +1 -0
- package/dist/planner/governor.js +106 -0
- package/dist/planner/index.d.ts +11 -0
- package/dist/planner/index.d.ts.map +1 -0
- package/dist/planner/index.js +8 -0
- package/dist/planner/intent.d.ts +8 -0
- package/dist/planner/intent.d.ts.map +1 -0
- package/dist/planner/intent.js +140 -0
- package/dist/planner/plan.d.ts +43 -0
- package/dist/planner/plan.d.ts.map +1 -0
- package/dist/planner/plan.js +237 -0
- package/dist/promptEnhancer/index.d.ts +23 -0
- package/dist/promptEnhancer/index.d.ts.map +1 -0
- package/dist/promptEnhancer/index.js +282 -0
- package/dist/qualityIntelligence/__tests__/fixtures/runEntryFixtures.d.ts +30 -0
- package/dist/qualityIntelligence/__tests__/fixtures/runEntryFixtures.d.ts.map +1 -0
- package/dist/qualityIntelligence/__tests__/fixtures/runEntryFixtures.js +114 -0
- package/dist/qualityIntelligence/cancellation.d.ts +20 -0
- package/dist/qualityIntelligence/cancellation.d.ts.map +1 -0
- package/dist/qualityIntelligence/cancellation.js +55 -0
- package/dist/qualityIntelligence/descriptors.d.ts +41 -0
- package/dist/qualityIntelligence/descriptors.d.ts.map +1 -0
- package/dist/qualityIntelligence/descriptors.js +105 -0
- package/dist/qualityIntelligence/index.d.ts +11 -0
- package/dist/qualityIntelligence/index.d.ts.map +1 -0
- package/dist/qualityIntelligence/index.js +11 -0
- package/dist/qualityIntelligence/modelRoutedTestDesign.d.ts +100 -0
- package/dist/qualityIntelligence/modelRoutedTestDesign.d.ts.map +1 -0
- package/dist/qualityIntelligence/modelRoutedTestDesign.js +620 -0
- package/dist/qualityIntelligence/runEntries.d.ts +60 -0
- package/dist/qualityIntelligence/runEntries.d.ts.map +1 -0
- package/dist/qualityIntelligence/runEntries.js +243 -0
- package/dist/qualityIntelligence/runtimeCommon.d.ts +106 -0
- package/dist/qualityIntelligence/runtimeCommon.d.ts.map +1 -0
- package/dist/qualityIntelligence/runtimeCommon.js +258 -0
- package/dist/qualityIntelligence/scopedRegeneration.d.ts +26 -0
- package/dist/qualityIntelligence/scopedRegeneration.d.ts.map +1 -0
- package/dist/qualityIntelligence/scopedRegeneration.js +35 -0
- package/dist/ranking/filter.d.ts +20 -0
- package/dist/ranking/filter.d.ts.map +1 -0
- package/dist/ranking/filter.js +99 -0
- package/dist/ranking/index.d.ts +9 -0
- package/dist/ranking/index.d.ts.map +1 -0
- package/dist/ranking/index.js +8 -0
- package/dist/ranking/rank.d.ts +21 -0
- package/dist/ranking/rank.d.ts.map +1 -0
- package/dist/ranking/rank.js +160 -0
- package/dist/ranking/scoring.d.ts +13 -0
- package/dist/ranking/scoring.d.ts.map +1 -0
- package/dist/ranking/scoring.js +39 -0
- package/dist/ranking/signals.d.ts +20 -0
- package/dist/ranking/signals.d.ts.map +1 -0
- package/dist/ranking/signals.js +145 -0
- package/dist/unit-tests/context.d.ts +7 -0
- package/dist/unit-tests/context.d.ts.map +1 -0
- package/dist/unit-tests/context.js +129 -0
- package/dist/unit-tests/conventions.d.ts +5 -0
- package/dist/unit-tests/conventions.d.ts.map +1 -0
- package/dist/unit-tests/conventions.js +87 -0
- package/dist/unit-tests/descriptor.d.ts +5 -0
- package/dist/unit-tests/descriptor.d.ts.map +1 -0
- package/dist/unit-tests/descriptor.js +43 -0
- package/dist/unit-tests/emit.d.ts +13 -0
- package/dist/unit-tests/emit.d.ts.map +1 -0
- package/dist/unit-tests/emit.js +35 -0
- package/dist/unit-tests/events.d.ts +2 -0
- package/dist/unit-tests/events.d.ts.map +1 -0
- package/dist/unit-tests/events.js +6 -0
- package/dist/unit-tests/frontend.d.ts +42 -0
- package/dist/unit-tests/frontend.d.ts.map +1 -0
- package/dist/unit-tests/frontend.js +281 -0
- package/dist/unit-tests/index.d.ts +9 -0
- package/dist/unit-tests/index.d.ts.map +1 -0
- package/dist/unit-tests/index.js +15 -0
- package/dist/unit-tests/internal.d.ts +36 -0
- package/dist/unit-tests/internal.d.ts.map +1 -0
- package/dist/unit-tests/internal.js +43 -0
- package/dist/unit-tests/model-loop.d.ts +6 -0
- package/dist/unit-tests/model-loop.d.ts.map +1 -0
- package/dist/unit-tests/model-loop.js +98 -0
- package/dist/unit-tests/parse.d.ts +7 -0
- package/dist/unit-tests/parse.d.ts.map +1 -0
- package/dist/unit-tests/parse.js +68 -0
- package/dist/unit-tests/prompt.d.ts +6 -0
- package/dist/unit-tests/prompt.d.ts.map +1 -0
- package/dist/unit-tests/prompt.js +139 -0
- package/dist/unit-tests/report.d.ts +26 -0
- package/dist/unit-tests/report.d.ts.map +1 -0
- package/dist/unit-tests/report.js +104 -0
- package/dist/unit-tests/stages.d.ts +12 -0
- package/dist/unit-tests/stages.d.ts.map +1 -0
- package/dist/unit-tests/stages.js +202 -0
- package/dist/unit-tests/strategy.d.ts +6 -0
- package/dist/unit-tests/strategy.d.ts.map +1 -0
- package/dist/unit-tests/strategy.js +36 -0
- package/dist/unit-tests/target-guard.d.ts +5 -0
- package/dist/unit-tests/target-guard.d.ts.map +1 -0
- package/dist/unit-tests/target-guard.js +29 -0
- package/dist/unit-tests/types.d.ts +74 -0
- package/dist/unit-tests/types.d.ts.map +1 -0
- package/dist/unit-tests/types.js +6 -0
- package/dist/unit-tests/verify-stage.d.ts +10 -0
- package/dist/unit-tests/verify-stage.d.ts.map +1 -0
- package/dist/unit-tests/verify-stage.js +56 -0
- package/dist/unit-tests/workflow.d.ts +3 -0
- package/dist/unit-tests/workflow.d.ts.map +1 -0
- package/dist/unit-tests/workflow.js +69 -0
- package/package.json +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/unit-tests/types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAA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0008 D2/D3/D7). No runtime logic lives here beyond the frozen tables the type
|
|
3
|
+
// layer exposes as values, mirroring the ADR-0003/0004/0005/0006/0007 `types.ts` precedent.
|
|
4
|
+
// `readonly` everywhere; optional props are `| undefined` because exactOptionalPropertyTypes
|
|
5
|
+
// is on. Every report shape is plain JSON-serializable so the #10 audit ledger can persist it.
|
|
6
|
+
export { DEFAULT_WORKFLOW_LIMITS } from "@oscharko-dev/keiko-contracts";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type WorkspaceFs, type WorkspaceInfo } from "@oscharko-dev/keiko-workspace";
|
|
2
|
+
import { type VerificationAuditSummary } from "@oscharko-dev/keiko-verification";
|
|
3
|
+
import type { RunState } from "./internal.js";
|
|
4
|
+
export declare const SKIP_UNRESOLVED = "verification skipped: framework unknown or no test files resolved";
|
|
5
|
+
export interface VerificationOutcome {
|
|
6
|
+
readonly summary: VerificationAuditSummary | undefined;
|
|
7
|
+
readonly skipReason: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function runWorkflowVerification(state: RunState, workspace: WorkspaceInfo, fs: WorkspaceFs): Promise<VerificationOutcome>;
|
|
10
|
+
//# sourceMappingURL=verify-stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-stage.d.ts","sourceRoot":"","sources":["../../src/unit-tests/verify-stage.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAOL,KAAK,wBAAwB,EAE9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,eAAO,MAAM,eAAe,sEAAsE,CAAC;AAsCnG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,wBAAwB,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AAED,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,aAAa,EACxB,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,mBAAmB,CAAC,CAsB9B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// The verification stage (ADR-0008 D5, steering note C). Runs ONLY after a successful apply: it
|
|
2
|
+
// resolves a verification plan by deriving the just-created test from the target SOURCE file(s) via
|
|
3
|
+
// #7 resolveTargetedTests, falling back to the full `test` script, and records an explicit skip
|
|
4
|
+
// reason when neither resolves or the framework is unknown. Verification reuses the #7 orchestrator
|
|
5
|
+
// unchanged; this stage only wires the plan and projects an output-text-free audit summary.
|
|
6
|
+
import { nodeSpawnFn } from "@oscharko-dev/keiko-tools/internal/exec";
|
|
7
|
+
import {} from "@oscharko-dev/keiko-workspace";
|
|
8
|
+
import { buildVerificationPlan, detectScripts, resolveTargetedTests, runVerification, summarizeForAudit, DEFAULT_VERIFICATION_LIMITS, } from "@oscharko-dev/keiko-verification";
|
|
9
|
+
export const SKIP_UNRESOLVED = "verification skipped: framework unknown or no test files resolved";
|
|
10
|
+
// The source files the target points at — passed to resolveTargetedTests so it can find the
|
|
11
|
+
// just-created sibling/mirrored test (steering note C). Test files are NOT passed here.
|
|
12
|
+
function targetSourceFiles(target) {
|
|
13
|
+
if (target.kind === "file") {
|
|
14
|
+
return [target.filePath];
|
|
15
|
+
}
|
|
16
|
+
if (target.kind === "changedFiles") {
|
|
17
|
+
return target.filePaths;
|
|
18
|
+
}
|
|
19
|
+
return [target.moduleDir];
|
|
20
|
+
}
|
|
21
|
+
function buildPlanFallback(workspace, fs) {
|
|
22
|
+
const catalog = detectScripts(workspace, fs);
|
|
23
|
+
return buildVerificationPlan(workspace, catalog, { only: ["test"] }, fs);
|
|
24
|
+
}
|
|
25
|
+
function resolveVerificationPlan(workspace, target, fs) {
|
|
26
|
+
const targeted = resolveTargetedTests(workspace, targetSourceFiles(target), fs, DEFAULT_VERIFICATION_LIMITS);
|
|
27
|
+
if (targeted.length > 0) {
|
|
28
|
+
return { workspaceRoot: workspace.root, steps: targeted };
|
|
29
|
+
}
|
|
30
|
+
const fallback = buildPlanFallback(workspace, fs);
|
|
31
|
+
const runnable = fallback.steps.filter((step) => step.skipReason === undefined);
|
|
32
|
+
return runnable.length > 0 ? { workspaceRoot: workspace.root, steps: runnable } : undefined;
|
|
33
|
+
}
|
|
34
|
+
export async function runWorkflowVerification(state, workspace, fs) {
|
|
35
|
+
const plan = resolveVerificationPlan(workspace, state.input.target, fs);
|
|
36
|
+
if (plan === undefined) {
|
|
37
|
+
return { summary: undefined, skipReason: SKIP_UNRESOLVED };
|
|
38
|
+
}
|
|
39
|
+
const report = await runVerification(plan, {
|
|
40
|
+
workspace,
|
|
41
|
+
signal: state.signal,
|
|
42
|
+
spawn: state.deps.spawn ?? nodeSpawnFn,
|
|
43
|
+
processEnv: state.deps.processEnv ?? process.env,
|
|
44
|
+
now: state.now,
|
|
45
|
+
fs,
|
|
46
|
+
});
|
|
47
|
+
const summary = summarizeForAudit(report);
|
|
48
|
+
state.emitter.emit({
|
|
49
|
+
type: "workflow:verification:result",
|
|
50
|
+
overallStatus: summary.overallStatus,
|
|
51
|
+
stepCount: summary.results.length,
|
|
52
|
+
passedCount: summary.results.filter((r) => r.status === "passed").length,
|
|
53
|
+
durationMs: summary.durationMs,
|
|
54
|
+
});
|
|
55
|
+
return { summary, skipReason: undefined };
|
|
56
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { UnitTestWorkflowDeps, UnitTestWorkflowInput, UnitTestWorkflowReport } from "./types.js";
|
|
2
|
+
export declare function generateUnitTests(input: UnitTestWorkflowInput, deps: UnitTestWorkflowDeps): Promise<UnitTestWorkflowReport>;
|
|
3
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/unit-tests/workflow.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAwCpB,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,qBAAqB,EAC5B,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAYjC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// The single public entry: generateUnitTests (ADR-0008 D2/D5/D6). A deterministic linear pipeline
|
|
2
|
+
// (NOT the harness loop): intake -> detect -> context -> conventions -> [prompt -> model -> parse ->
|
|
3
|
+
// validate -> production-guard] (bounded retries) -> [dry-run | apply -> verify] -> report. It
|
|
4
|
+
// composes #3-#7 UNCHANGED and emits redacted progress events. The model loop, verify stage, and
|
|
5
|
+
// report stages live in sibling files to keep each under the LOC limit; this file owns only the
|
|
6
|
+
// stage sequencing and the single top-level catch boundary that maps an unexpected IO failure to a
|
|
7
|
+
// redacted "failed" report (and a CancelledError to a "cancelled" report).
|
|
8
|
+
import { CancelledError } from "@oscharko-dev/keiko-model-gateway";
|
|
9
|
+
import { detectWorkspace } from "@oscharko-dev/keiko-workspace";
|
|
10
|
+
import { nodeWorkspaceFs } from "@oscharko-dev/keiko-workspace/internal/fs";
|
|
11
|
+
import { buildTestGenContext } from "./context.js";
|
|
12
|
+
import { detectConventions } from "./conventions.js";
|
|
13
|
+
import { computeFingerprint } from "./emit.js";
|
|
14
|
+
import { runModelLoop } from "./model-loop.js";
|
|
15
|
+
import { resolveTestStrategy } from "./strategy.js";
|
|
16
|
+
import { cancelledReport, emitCompleted, failedReport, finishPipeline, unsupportedReport, } from "./stages.js";
|
|
17
|
+
import { buildRunState, EMPTY_LOOP } from "./internal.js";
|
|
18
|
+
import { assertTargetWithinWorkspace } from "./target-guard.js";
|
|
19
|
+
async function runPipeline(state) {
|
|
20
|
+
const fs = state.deps.fs ?? nodeWorkspaceFs;
|
|
21
|
+
const workspace = detectWorkspace(state.input.workspaceRoot, fs);
|
|
22
|
+
state.emitter.emit({
|
|
23
|
+
type: "workflow:started",
|
|
24
|
+
workflowId: "unit-test-generation",
|
|
25
|
+
modelId: state.input.modelId,
|
|
26
|
+
applyEnabled: state.input.apply === true,
|
|
27
|
+
limits: state.limits,
|
|
28
|
+
});
|
|
29
|
+
// Issue #641: enforce workspace containment on the input target before context selection so
|
|
30
|
+
// escaped, denied, or symlink-escape paths fail closed with modelCallCount=0 and no model call.
|
|
31
|
+
assertTargetWithinWorkspace(workspace, state.input.target, fs);
|
|
32
|
+
const pack = buildTestGenContext(workspace, state.input, state.limits, { fs });
|
|
33
|
+
const conventions = detectConventions(workspace, pack);
|
|
34
|
+
state.emitter.emit({
|
|
35
|
+
type: "conventions:detected",
|
|
36
|
+
framework: conventions.framework,
|
|
37
|
+
testDirs: conventions.testDirs,
|
|
38
|
+
fileNamingStyle: conventions.fileNamingStyle,
|
|
39
|
+
});
|
|
40
|
+
state.emitter.emit({
|
|
41
|
+
type: "context:selected",
|
|
42
|
+
entryCount: pack.selected.length,
|
|
43
|
+
usedBytes: pack.usedBytes,
|
|
44
|
+
budgetBytes: pack.budgetBytes,
|
|
45
|
+
droppedForBudget: pack.droppedForBudget,
|
|
46
|
+
});
|
|
47
|
+
// Convention-driven test-style selection (Issue #1203). An unsupported frontend stack short-circuits
|
|
48
|
+
// here with a reviewable limitation and NO model call (AC5: no fabricated test).
|
|
49
|
+
const strategy = resolveTestStrategy(workspace, state.input.target, conventions, pack, fs);
|
|
50
|
+
if (strategy.style === "unsupported") {
|
|
51
|
+
return unsupportedReport(state, strategy);
|
|
52
|
+
}
|
|
53
|
+
const loop = await runModelLoop(state, workspace, conventions, strategy, pack);
|
|
54
|
+
return finishPipeline(state, workspace, loop, strategy);
|
|
55
|
+
}
|
|
56
|
+
export async function generateUnitTests(input, deps) {
|
|
57
|
+
const state = buildRunState(input, deps, computeFingerprint(input.target, input.modelId));
|
|
58
|
+
let report;
|
|
59
|
+
try {
|
|
60
|
+
report = await runPipeline(state);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
report =
|
|
64
|
+
error instanceof CancelledError
|
|
65
|
+
? cancelledReport(state, EMPTY_LOOP, undefined)
|
|
66
|
+
: failedReport(state, error);
|
|
67
|
+
}
|
|
68
|
+
return emitCompleted(state, report);
|
|
69
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oscharko-dev/keiko-workflows",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"description": "Internal workflows package: reviewable developer-assist workflows (unit-test generation, bug investigation), prompts/parsers/guards/report rendering, apply-mode verification gating, and UI descriptors (ADR-0008 + ADR-0009 + ADR-0019). Not published independently.",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc -b tsconfig.json",
|
|
17
|
+
"typecheck": "tsc -b tsconfig.json",
|
|
18
|
+
"test": "vitest run"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=22"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@oscharko-dev/keiko-contracts": "0.2.0",
|
|
29
|
+
"@oscharko-dev/keiko-security": "0.2.0",
|
|
30
|
+
"@oscharko-dev/keiko-model-gateway": "0.2.0",
|
|
31
|
+
"@oscharko-dev/keiko-workspace": "0.2.0",
|
|
32
|
+
"@oscharko-dev/keiko-tools": "0.2.0",
|
|
33
|
+
"@oscharko-dev/keiko-evidence": "0.2.0",
|
|
34
|
+
"@oscharko-dev/keiko-verification": "0.2.0",
|
|
35
|
+
"@oscharko-dev/keiko-harness": "0.2.0",
|
|
36
|
+
"@oscharko-dev/keiko-quality-intelligence": "0.2.0"
|
|
37
|
+
}
|
|
38
|
+
}
|