@guanlin4924/devflow-pi 0.1.28 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -288,7 +288,7 @@ export type NaturalControlAction = "approve" | "reject";
|
|
|
288
288
|
|
|
289
289
|
export function classifyNaturalControlAction(input: string): NaturalControlAction | null {
|
|
290
290
|
const text = input.trim();
|
|
291
|
-
if (/^(?:批准|确认|同意|通过)(?:\s*(?:(?:full|完整|全量)?\s
|
|
291
|
+
if (/^(?:批准|确认|同意|通过)(?:\s*(?:(?:full|完整|全量)?\s*初始化|执行|完成|继续|推进|当前(?:方案|步骤|计划)))?[。!!]?$/i.test(text)) return "approve";
|
|
292
292
|
if (/^(?:拒绝|不同意|暂不|需要修改|退回)(?:执行|继续|推进|当前(?:方案|步骤|计划))?[。!!]?$/.test(text)) return "reject";
|
|
293
293
|
return null;
|
|
294
294
|
}
|
|
@@ -1605,7 +1605,12 @@ export default function devflowCore(pi: ExtensionAPI) {
|
|
|
1605
1605
|
// artifact metadata and never advances STATE, checkpoints, or ownership.
|
|
1606
1606
|
const isRegistryReconciliation =
|
|
1607
1607
|
toolName === "devflow_artifact" && toolInput?.action === "sync" && toolInput?.preserve === false;
|
|
1608
|
-
|
|
1608
|
+
const isUserConfirmedStepTransition =
|
|
1609
|
+
toolName === "devflow_transition" &&
|
|
1610
|
+
toolInput?.action === "complete-step" &&
|
|
1611
|
+
toolInput?.confirm === true &&
|
|
1612
|
+
["waiting-user", "awaiting-approval"].includes(controlState.phase);
|
|
1613
|
+
if (isStateMutationTool(toolName) && !isRegistryReconciliation && !isUserConfirmedStepTransition) {
|
|
1609
1614
|
return {
|
|
1610
1615
|
block: true,
|
|
1611
1616
|
reason:
|
|
@@ -2427,7 +2432,21 @@ export default function devflowCore(pi: ExtensionAPI) {
|
|
|
2427
2432
|
if (!params.step) {
|
|
2428
2433
|
return renderResult({ ok: false, exitCode: 2, stdout: "", stderr: "step is required" });
|
|
2429
2434
|
}
|
|
2435
|
+
if (params.confirm !== true) {
|
|
2436
|
+
return renderResult({ ok: false, exitCode: 2, stdout: "", stderr: "complete-step requires explicit user confirmation (confirm=true)" });
|
|
2437
|
+
}
|
|
2430
2438
|
const snapshot = parseJsonResult(await runRuby(ctx.cwd, "workflow-orchestrator/scripts/inspect_state.rb", ["--json"]));
|
|
2439
|
+
const currentStep = snapshot?.current_step && typeof snapshot.current_step === "object"
|
|
2440
|
+
? (snapshot.current_step as Record<string, unknown>).id
|
|
2441
|
+
: undefined;
|
|
2442
|
+
if (snapshot?.revision !== params.expectedRevision || currentStep !== params.step) {
|
|
2443
|
+
return renderResult({
|
|
2444
|
+
ok: false,
|
|
2445
|
+
exitCode: 2,
|
|
2446
|
+
stdout: "",
|
|
2447
|
+
stderr: `confirmed transition is stale or targets a different step (expected revision ${params.expectedRevision}, current revision ${String(snapshot?.revision)}, current step ${String(currentStep)})`,
|
|
2448
|
+
});
|
|
2449
|
+
}
|
|
2431
2450
|
const feature = snapshot?.snapshot && typeof snapshot.snapshot === "object" ? (snapshot.snapshot as Record<string, unknown>).feature : undefined;
|
|
2432
2451
|
if (typeof feature === "string" && feature) {
|
|
2433
2452
|
const evidenceArgs = ["--feature", feature, "--step", params.step, "--write"];
|
package/src/constants.ts
CHANGED