@kontourai/flow-agents 3.6.0 → 3.7.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/CHANGELOG.md +7 -0
- package/build/src/builder-flow-run-adapter.d.ts +22 -2
- package/build/src/builder-flow-run-adapter.js +93 -28
- package/build/src/builder-flow-runtime.d.ts +8 -3
- package/build/src/builder-flow-runtime.js +308 -47
- package/build/src/cli/assignment-provider.d.ts +4 -7
- package/build/src/cli/assignment-provider.js +67 -13
- package/build/src/cli/builder-run.js +14 -18
- package/build/src/cli/workflow-sidecar.d.ts +28 -4
- package/build/src/cli/workflow-sidecar.js +801 -97
- package/build/src/cli/workflow.js +290 -42
- package/build/src/flow-kit/validate.d.ts +17 -0
- package/build/src/flow-kit/validate.js +340 -2
- package/build/src/index.js +5 -5
- package/build/src/lib/observed-command.d.ts +7 -0
- package/build/src/lib/observed-command.js +100 -0
- package/build/src/tools/generate-context-map.js +5 -3
- package/context/scripts/hooks/lib/kit-catalog.js +1 -1
- package/context/scripts/hooks/stop-goal-fit.js +78 -9
- package/docs/context-map.md +22 -20
- package/docs/developer-architecture.md +1 -1
- package/docs/public-workflow-cli.md +76 -7
- package/docs/skills-map.md +51 -27
- package/docs/spec/builder-flow-runtime.md +41 -40
- package/docs/workflow-usage-guide.md +109 -42
- package/evals/fixtures/hook-influence/cases.json +2 -2
- package/evals/integration/test_builder_entry_enforcement.sh +52 -41
- package/evals/integration/test_builder_step_producers.sh +297 -6
- package/evals/integration/test_bundle_install.sh +212 -63
- package/evals/integration/test_critique_supersession_roundtrip.sh +21 -8
- package/evals/integration/test_current_json_per_actor.sh +12 -0
- package/evals/integration/test_dual_emit_flow_step.sh +62 -43
- package/evals/integration/test_flowdef_session_activation.sh +145 -25
- package/evals/integration/test_flowdef_session_history_preservation.sh +23 -21
- package/evals/integration/test_gate_lockdown.sh +3 -5
- package/evals/integration/test_goal_fit_hook.sh +60 -2
- package/evals/integration/test_liveness_verdict.sh +14 -17
- package/evals/integration/test_phase_map_and_gate_claim.sh +63 -38
- package/evals/integration/test_public_workflow_cli.sh +325 -11
- package/evals/integration/test_pull_work_liveness_preflight.sh +22 -66
- package/evals/integration/test_sidecar_field_preservation.sh +36 -11
- package/evals/integration/test_workflow_sidecar_writer.sh +277 -44
- package/evals/integration/test_workflow_steering_hook.sh +15 -38
- package/evals/run.sh +2 -0
- package/evals/static/test_builder_skill_coherence.sh +247 -0
- package/evals/static/test_library_exports.sh +5 -2
- package/evals/static/test_workflow_skills.sh +13 -325
- package/kits/builder/flows/build.flow.json +22 -0
- package/kits/builder/flows/shape.flow.json +9 -9
- package/kits/builder/kit.json +70 -16
- package/kits/builder/skills/builder-shape/SKILL.md +75 -75
- package/kits/builder/skills/continue-work/SKILL.md +45 -106
- package/kits/builder/skills/deliver/SKILL.md +96 -442
- package/kits/builder/skills/design-probe/SKILL.md +40 -139
- package/kits/builder/skills/evidence-gate/SKILL.md +59 -201
- package/kits/builder/skills/execute-plan/SKILL.md +54 -125
- package/kits/builder/skills/fix-bug/SKILL.md +42 -132
- package/kits/builder/skills/gate-review/SKILL.md +60 -211
- package/kits/builder/skills/idea-to-backlog/SKILL.md +63 -244
- package/kits/builder/skills/learning-review/SKILL.md +63 -170
- package/kits/builder/skills/pickup-probe/SKILL.md +54 -111
- package/kits/builder/skills/plan-work/SKILL.md +51 -185
- package/kits/builder/skills/pull-work/SKILL.md +136 -485
- package/kits/builder/skills/release-readiness/SKILL.md +66 -107
- package/kits/builder/skills/review-work/SKILL.md +89 -176
- package/kits/builder/skills/tdd-workflow/SKILL.md +53 -147
- package/kits/builder/skills/verify-work/SKILL.md +101 -113
- package/package.json +2 -2
- package/scripts/hooks/lib/kit-catalog.js +1 -1
- package/scripts/hooks/stop-goal-fit.js +78 -9
- package/src/builder-flow-run-adapter.ts +118 -32
- package/src/builder-flow-runtime.ts +331 -61
- package/src/cli/assignment-provider-lock.test.mjs +83 -0
- package/src/cli/assignment-provider.ts +62 -13
- package/src/cli/builder-flow-run-adapter.test.mjs +4 -2
- package/src/cli/builder-flow-runtime.test.mjs +194 -8
- package/src/cli/builder-run.ts +3 -9
- package/src/cli/kit-metadata-security.test.mjs +232 -6
- package/src/cli/public-api.test.mjs +15 -0
- package/src/cli/workflow-sidecar-execution-proof.test.mjs +90 -0
- package/src/cli/workflow-sidecar.ts +724 -97
- package/src/cli/workflow.ts +277 -40
- package/src/flow-kit/validate.ts +320 -2
- package/src/index.ts +6 -5
- package/src/lib/observed-command.ts +96 -0
- package/src/tools/generate-context-map.ts +5 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { flagString, parseArgs } from "../lib/args.js";
|
|
2
|
-
import { cancelBuilderFlowSession, archiveBuilderFlowSession, pauseBuilderFlowSession, recoverBuilderFlowSession, releaseBuilderFlowAssignment, resumeBuilderFlowSession,
|
|
3
|
-
const USAGE = "Usage: flow-agents builder-run <
|
|
2
|
+
import { cancelBuilderFlowSession, archiveBuilderFlowSession, pauseBuilderFlowSession, recoverBuilderFlowSession, releaseBuilderFlowAssignment, resumeBuilderFlowSession, } from "../builder-flow-runtime.js";
|
|
3
|
+
const USAGE = "Usage: flow-agents builder-run <recover|pause|resume|cancel|release-assignment|archive> --session-dir <path> [--reason <text> | --authorization-file <path>]";
|
|
4
4
|
export async function main(argv) {
|
|
5
5
|
const parsed = parseArgs(argv);
|
|
6
6
|
const action = parsed.positionals[0];
|
|
@@ -18,7 +18,7 @@ export async function main(argv) {
|
|
|
18
18
|
console.error("builder-run requires --session-dir .kontourai/flow-agents/<slug>");
|
|
19
19
|
return 64;
|
|
20
20
|
}
|
|
21
|
-
if (!action || !["
|
|
21
|
+
if (!action || !["recover", "pause", "resume", "cancel", "release-assignment", "archive"].includes(action)) {
|
|
22
22
|
console.error(USAGE);
|
|
23
23
|
return 64;
|
|
24
24
|
}
|
|
@@ -42,21 +42,17 @@ export async function main(argv) {
|
|
|
42
42
|
console.error(USAGE);
|
|
43
43
|
return 64;
|
|
44
44
|
}
|
|
45
|
-
const result = action === "
|
|
46
|
-
? await
|
|
47
|
-
: action === "
|
|
48
|
-
? await
|
|
49
|
-
: action === "
|
|
50
|
-
? await
|
|
51
|
-
: action === "
|
|
52
|
-
? await
|
|
53
|
-
: action === "
|
|
54
|
-
? await
|
|
55
|
-
:
|
|
56
|
-
? await cancelBuilderFlowSession({ sessionDir, authorizationFile: authorizationFile })
|
|
57
|
-
: action === "release-assignment"
|
|
58
|
-
? await releaseBuilderFlowAssignment({ sessionDir, reason: reason })
|
|
59
|
-
: await archiveBuilderFlowSession({ sessionDir, authorizationFile: authorizationFile });
|
|
45
|
+
const result = action === "recover"
|
|
46
|
+
? await recoverBuilderFlowSession({ sessionDir })
|
|
47
|
+
: action === "pause"
|
|
48
|
+
? await pauseBuilderFlowSession({ sessionDir, reason: reason })
|
|
49
|
+
: action === "resume"
|
|
50
|
+
? await resumeBuilderFlowSession({ sessionDir, reason: reason })
|
|
51
|
+
: action === "cancel"
|
|
52
|
+
? await cancelBuilderFlowSession({ sessionDir, authorizationFile: authorizationFile })
|
|
53
|
+
: action === "release-assignment"
|
|
54
|
+
? await releaseBuilderFlowAssignment({ sessionDir, reason: reason })
|
|
55
|
+
: await archiveBuilderFlowSession({ sessionDir, authorizationFile: authorizationFile });
|
|
60
56
|
console.log(JSON.stringify({
|
|
61
57
|
run_id: result.run.runId,
|
|
62
58
|
definition_id: result.run.definitionId,
|
|
@@ -174,10 +174,13 @@ export declare function reduceCaptureLogByCommand(commandLog: AnyObj[] | undefin
|
|
|
174
174
|
* @param timestamp ISO-8601 timestamp for createdAt / updatedAt / observedAt
|
|
175
175
|
* @param checks Normalized check objects (from record-evidence --check-json / --surface-trust-json)
|
|
176
176
|
* @param criteria Acceptance criteria objects (from acceptance.json .criteria array)
|
|
177
|
-
* @param critiques Critique objects
|
|
177
|
+
* @param critiques Critique objects reconstructed from trust.bundle claims
|
|
178
178
|
* @param commandLog Optional parsed command-log.jsonl entries (capture-authoritative fold)
|
|
179
179
|
*/
|
|
180
|
-
export declare function buildTrustBundle(slug: string, timestamp: string, checks: AnyObj[], criteria: AnyObj[], critiques: AnyObj[], commandLog?: AnyObj[], flowAgentsDir?: string, actorKey?: string
|
|
180
|
+
export declare function buildTrustBundle(slug: string, timestamp: string, checks: AnyObj[], criteria: AnyObj[], critiques: AnyObj[], commandLog?: AnyObj[], flowAgentsDir?: string, actorKey?: string, exactFlowContext?: {
|
|
181
|
+
flowId: string;
|
|
182
|
+
stepId: string;
|
|
183
|
+
}): Promise<AnyObj | null>;
|
|
181
184
|
/**
|
|
182
185
|
* Fail-open wrapper: builds (via Surface), validates, and writes a trust.bundle.
|
|
183
186
|
* Accepts raw check/criterion/critique inputs directly (ADR 0010 Phase 4a).
|
|
@@ -191,7 +194,10 @@ export declare function buildTrustBundle(slug: string, timestamp: string, checks
|
|
|
191
194
|
* @param criteria Acceptance criteria objects (same as buildTrustBundle)
|
|
192
195
|
* @param critiques Critique objects (same as buildTrustBundle)
|
|
193
196
|
*/
|
|
194
|
-
export declare function writeTrustBundle(dir: string, slug: string, timestamp: string, checks: AnyObj[], criteria: AnyObj[], critiques: AnyObj[], actorKey?: string
|
|
197
|
+
export declare function writeTrustBundle(dir: string, slug: string, timestamp: string, checks: AnyObj[], criteria: AnyObj[], critiques: AnyObj[], actorKey?: string, exactFlowContext?: {
|
|
198
|
+
flowId: string;
|
|
199
|
+
stepId: string;
|
|
200
|
+
}): Promise<{
|
|
195
201
|
written: boolean;
|
|
196
202
|
errors: string[];
|
|
197
203
|
}>;
|
|
@@ -199,6 +205,23 @@ export declare function sidecarBase(slug: string): AnyObj;
|
|
|
199
205
|
export declare function currentWorkflowSessionDir(root: string): string | null;
|
|
200
206
|
export declare function validateEvidenceRef(ref: AnyObj, label: string): AnyObj;
|
|
201
207
|
export declare function normalizeEvidenceRefs(raw: unknown, label: string): AnyObj[];
|
|
208
|
+
/** Validate test-evidence command shape without executing it. */
|
|
209
|
+
type TestExecutionProof = {
|
|
210
|
+
kind: "local-process-exit";
|
|
211
|
+
runner: string;
|
|
212
|
+
static_test_units: number;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Produce evidence from the locally executed command and statically reviewable
|
|
216
|
+
* test units. Runner stdout is deliberately excluded: any executable can print
|
|
217
|
+
* a Vitest/Jest-looking success summary, but it cannot turn a non-test script
|
|
218
|
+
* into a supported test workflow or supply this locally-created proof.
|
|
219
|
+
*/
|
|
220
|
+
export declare function testExecutionProof(command: string, projectRoot: string, seenScripts?: Set<string>, packageScriptBody?: boolean): TestExecutionProof | null;
|
|
221
|
+
/** Validate test-evidence command shape without executing it. */
|
|
222
|
+
export declare function isMeaningfulTestCommand(command: string, projectRoot: string, seenScripts?: Set<string>, packageScriptBody?: boolean): boolean;
|
|
223
|
+
export declare function observedExecutedTestCount(output: string): number;
|
|
224
|
+
export declare function inferExecutedTestCount(command: string, projectRoot: string, output: string, seenScripts?: Set<string>): number;
|
|
202
225
|
export declare function normalizeCheck(raw: AnyObj, allowGateClaimPrefix?: boolean, existingCheckStampById?: ReadonlyMap<string, boolean>): AnyObj;
|
|
203
226
|
/**
|
|
204
227
|
* Derive kit identity from a parsed trust.bundle by structurally reading the
|
|
@@ -624,4 +647,5 @@ export declare function buildGateInquiryRecords(bundle: BundleFile, blockSignal:
|
|
|
624
647
|
export declare const LIVENESS_TERMINAL: Set<string>;
|
|
625
648
|
export { buildClaimExplanation } from "./sidecar-claim-explain.js";
|
|
626
649
|
export type { ClaimEvidenceItem, ClaimExplanation } from "./sidecar-claim-explain.js";
|
|
627
|
-
export declare function
|
|
650
|
+
export declare function mainFromPublicWorkflow(argv: string[]): Promise<number>;
|
|
651
|
+
export declare function main(argv?: string[], authority?: symbol): Promise<number>;
|