@guanlin4924/devflow-pi 0.1.53 → 0.1.54
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/package.json
CHANGED
|
@@ -1361,6 +1361,31 @@ export default function devflowCore(pi: ExtensionAPI) {
|
|
|
1361
1361
|
return stateRevision === contract.stateRevision && graphRevision === contract.graphRevision;
|
|
1362
1362
|
}
|
|
1363
1363
|
|
|
1364
|
+
// A successful graph mutation is already constrained by the active contract's
|
|
1365
|
+
// allowed kinds and the graph's compare-and-swap revision. Re-freeze the
|
|
1366
|
+
// Core-derived contract at that new revision so the next candidate remains in
|
|
1367
|
+
// the same approved step instead of being rejected as stale.
|
|
1368
|
+
async function rebaseActiveContractAfterGraphWrite(ctx: { cwd: string }, feature: string, graphRevision?: number): Promise<string | undefined> {
|
|
1369
|
+
const previous = activeContract;
|
|
1370
|
+
if (!previous || previous.feature !== feature) return undefined;
|
|
1371
|
+
const written = await runRuby(ctx.cwd, "workflow-orchestrator/scripts/execution_contract.rb", [
|
|
1372
|
+
"create", "--feature", previous.feature, "--step", previous.step, "--write", "--json",
|
|
1373
|
+
...(previous.stateRevision === undefined ? [] : ["--expected-state-revision", String(previous.stateRevision)]),
|
|
1374
|
+
...(graphRevision === undefined ? [] : ["--expected-graph-revision", String(graphRevision)]),
|
|
1375
|
+
]);
|
|
1376
|
+
const payload = parseJsonResult(written);
|
|
1377
|
+
const refreshed = payload?.contract && typeof payload.contract === "object"
|
|
1378
|
+
? contractFromRecord(payload.contract as Record<string, unknown>)
|
|
1379
|
+
: null;
|
|
1380
|
+
if (!controlPlaneSucceeded(written) || !refreshed) {
|
|
1381
|
+
return written.stderr || written.stdout || "Core could not refresh the execution contract after graph write.";
|
|
1382
|
+
}
|
|
1383
|
+
refreshed.contractPath = typeof payload?.path === "string" ? payload.path : undefined;
|
|
1384
|
+
activeContract = refreshed;
|
|
1385
|
+
contractAgentCalls = 0;
|
|
1386
|
+
return undefined;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1364
1389
|
async function restoreActiveContract(cwd: string): Promise<ActiveExecutionContract | undefined> {
|
|
1365
1390
|
try {
|
|
1366
1391
|
const state = parseJsonResult(await runRuby(cwd, "workflow-orchestrator/scripts/inspect_state.rb", ["--json"]));
|
|
@@ -2975,10 +3000,17 @@ export default function devflowCore(pi: ExtensionAPI) {
|
|
|
2975
3000
|
args.push("--confirmed-interactively");
|
|
2976
3001
|
}
|
|
2977
3002
|
}
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
3003
|
+
const result = await runRuby(ctx.cwd, "workflow-orchestrator/scripts/requirement_graph.rb", args);
|
|
3004
|
+
if (graphWrite && controlPlaneSucceeded(result)) {
|
|
3005
|
+
const revision = parseJsonResult(result)?.revision;
|
|
3006
|
+
const rebaseError = await rebaseActiveContractAfterGraphWrite(
|
|
3007
|
+
ctx,
|
|
3008
|
+
params.feature,
|
|
3009
|
+
typeof revision === "number" ? revision : undefined,
|
|
3010
|
+
);
|
|
3011
|
+
if (rebaseError) ctx.ui.notify(`图谱候选已写入,但执行合同未能刷新;后续写入将保持阻塞:${rebaseError}`, "error");
|
|
3012
|
+
}
|
|
3013
|
+
return renderResult(result, { action: params.action, feature: params.feature });
|
|
2982
3014
|
},
|
|
2983
3015
|
});
|
|
2984
3016
|
|
|
@@ -11,6 +11,7 @@ require_relative "control_io"
|
|
|
11
11
|
require_relative "requirement_graph"
|
|
12
12
|
|
|
13
13
|
POLICY = {
|
|
14
|
+
"domain-modeling" => { "checkers" => %w[requirement-graph-check], "agents" => [], "budget" => 0, "allowed_graph_delta" => %w[term object behavior rule boundary] },
|
|
14
15
|
"requirement-baseline" => { "checkers" => %w[requirement-graph-check business-closure-check slice-independence-check acceptance-coverage-check change-impact-check], "agents" => [], "budget" => 0, "allowed_graph_delta" => %w[requirement rule boundary slice acceptance] },
|
|
15
16
|
"api-contract" => { "checkers" => %w[requirement-graph-check contract-coverage-check api-test-schema-check change-impact-check], "agents" => [], "budget" => 0, "allowed_graph_delta" => %w[api] },
|
|
16
17
|
"architecture-feasibility" => { "checkers" => %w[requirement-graph-check change-impact-check], "agents" => [], "budget" => 0, "allowed_graph_delta" => %w[workload_shape workload_constraint decision risk metric read_model] },
|
package/src/constants.ts
CHANGED