@guanlin4924/devflow-pi 0.1.24 → 0.1.26
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 +8 -1
- package/package.json +1 -1
- package/plugins/devflow-core/extensions/devflow-core.ts +252 -33
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/acceptance_test_runner.py +50 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/advance_state.rb +9 -1
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/api_test_matrix.py +2 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/architecture_brief.rb +19 -3
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/architecture_constraints.rb +24 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/architecture_feasibility.rb +25 -1
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/control_io.rb +4 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/execution_contract.rb +1 -1
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/requirement_graph.rb +136 -15
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/session_rollover.rb +159 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/validate_state.rb +36 -0
- package/plugins/devflow-design/skills/workflow-api-contract/SKILL.md +4 -3
- package/plugins/devflow-design/skills/workflow-architecture-feasibility/SKILL.md +4 -0
- package/plugins/devflow-design/skills/workflow-backend-tech-spec/SKILL.md +2 -0
- package/plugins/devflow-quality/skills/workflow-acceptance-test-design/SKILL.md +13 -1
- package/plugins/devflow-quality/skills/workflow-run-acceptance-tests/SKILL.md +2 -0
- package/src/constants.ts +1 -1
- package/src/runtime.ts +36 -1
package/src/constants.ts
CHANGED
package/src/runtime.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mkdir } from "node:fs/promises";
|
|
1
|
+
import { mkdir, readFile, rm } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
import { OMP_RUNTIME_VERSION, PRODUCT_NAME, PRODUCT_VERSION } from "./constants.ts";
|
|
@@ -61,6 +61,10 @@ const MANAGED_SETTINGS: Record<string, unknown> = {
|
|
|
61
61
|
"lsp.enabled": true,
|
|
62
62
|
"lsp.lazy": true,
|
|
63
63
|
"lsp.diagnosticsOnWrite": true,
|
|
64
|
+
// Devflow owns cross-session handoff through STATE.rollover. OMP's LLM-made
|
|
65
|
+
// handoff would create a second, unauditable source of continuation facts.
|
|
66
|
+
"compaction.strategy": "context-full",
|
|
67
|
+
"compaction.handoffSaveToDisk": false,
|
|
64
68
|
};
|
|
65
69
|
|
|
66
70
|
export async function createEmbeddedRuntime(project: ProjectContext, options: RuntimeOptions = {}) {
|
|
@@ -173,8 +177,39 @@ export async function runInteractiveRuntime(project: ProjectContext, options: Ru
|
|
|
173
177
|
mode.showStatus(`Devflow project ${project.manifest.name} · ${project.manifest.projectId.slice(0, 8)}`);
|
|
174
178
|
if (runtime.modelFallbackMessage) mode.showWarning(runtime.modelFallbackMessage);
|
|
175
179
|
if (options.initialPrompt) await runtime.session.prompt(options.initialPrompt);
|
|
180
|
+
// Extensions cannot create a session from lifecycle hooks. The interactive
|
|
181
|
+
// loop, however, owns AgentSession and reaches this point only after the
|
|
182
|
+
// submitted turn has settled. A request is merely a wake-up signal: its
|
|
183
|
+
// authority remains STATE.rollover, which the extension verifies and claims
|
|
184
|
+
// during session_switch before it starts the next workflow turn.
|
|
185
|
+
const consumeControlledRollover = async (): Promise<void> => {
|
|
186
|
+
const requestPath = path.join(project.root, ".planning", "rollover-request.json");
|
|
187
|
+
let request: { schema_version?: number; rollover_id?: string; source_session_id?: string };
|
|
188
|
+
try {
|
|
189
|
+
request = JSON.parse(await readFile(requestPath, "utf8")) as typeof request;
|
|
190
|
+
} catch {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (
|
|
194
|
+
request.schema_version !== 1 ||
|
|
195
|
+
typeof request.rollover_id !== "string" ||
|
|
196
|
+
!/^ROL-[0-9a-f-]+$/i.test(request.rollover_id) ||
|
|
197
|
+
request.source_session_id !== runtime.session.sessionManager.getSessionId()
|
|
198
|
+
) {
|
|
199
|
+
await rm(requestPath, { force: true });
|
|
200
|
+
mode.showWarning("已忽略无效或陈旧的 Devflow 会话轮换请求;STATE 未被修改。");
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const switched = await runtime.session.newSession();
|
|
204
|
+
if (!switched) {
|
|
205
|
+
mode.showWarning("Devflow 会话轮换被运行时取消;当前会话保持不变。请检查控制面状态后重试。");
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
await rm(requestPath, { force: true });
|
|
209
|
+
};
|
|
176
210
|
while (true) {
|
|
177
211
|
const input = await mode.getUserInput();
|
|
178
212
|
await omp.submitInteractiveInput(mode, runtime.session, input);
|
|
213
|
+
await consumeControlledRollover();
|
|
179
214
|
}
|
|
180
215
|
}
|