@guanlin4924/devflow-pi 0.1.103 → 0.1.105
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 +1 -1
- package/package.json +1 -1
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/inspect_state.rb +9 -1
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/review_preflight.py +3 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/startup_preflight.py +7 -1
- package/src/constants.ts +1 -1
- package/src/workflow-diagnosis.ts +21 -1
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -563,6 +563,7 @@ result =
|
|
|
563
563
|
next_step = next_id && step_by_id[next_id]
|
|
564
564
|
checkpoint_id = state["checkpoint"] || current_step["checkpoint"]
|
|
565
565
|
checkpoint = checkpoint_id && workflow.fetch("checkpoints", {})[checkpoint_id]
|
|
566
|
+
checkpoint = checkpoint.merge("id" => checkpoint_id) if checkpoint.is_a?(Hash)
|
|
566
567
|
parallel_window = active_parallel_window(workflow, state, root, step_by_id, completed_ids, pending_ids, artifact_by_path)
|
|
567
568
|
failure_branch = active_failure_branch(workflow, state, current_step, current_outputs, root)
|
|
568
569
|
|
|
@@ -636,7 +637,14 @@ result =
|
|
|
636
637
|
missing_outputs = current_outputs
|
|
637
638
|
.select { |output| output["required"] && !output["exists"] }
|
|
638
639
|
.map { |output| output["resolved_path"] }
|
|
639
|
-
|
|
640
|
+
# Approval-path outputs are written by Core only after the user
|
|
641
|
+
# confirms; they must not block entry into the waiting checkpoint.
|
|
642
|
+
meta_path = checkpoint.is_a?(Hash) && checkpoint["required_meta_output"]
|
|
643
|
+
checkpoint_meta_errors = if CheckpointMeta.approval_output?(checkpoint, meta_path)
|
|
644
|
+
[]
|
|
645
|
+
else
|
|
646
|
+
CheckpointMeta.validate(root: root, state: state, checkpoint: checkpoint)
|
|
647
|
+
end
|
|
640
648
|
missing_outputs.concat(checkpoint_meta_errors.map { |entry| entry["path"] }.compact)
|
|
641
649
|
base.merge(
|
|
642
650
|
action: missing_outputs.empty? ? "await_user_confirmation" : "blocked",
|
|
@@ -176,6 +176,9 @@ def preflight(root: Path, feature: str, step: str, contract_path: str,
|
|
|
176
176
|
elif producer == "existing":
|
|
177
177
|
if not input_present(path):
|
|
178
178
|
issues.append({"code": "MISSING_INPUT_FACT", "index": index, "path": relative})
|
|
179
|
+
elif path.is_dir():
|
|
180
|
+
# A rendered directory has no single-file fingerprint.
|
|
181
|
+
evidence.append({"kind": "input_collection", "path": relative})
|
|
179
182
|
elif obligation.get("sha256") is not None and obligation.get("sha256") != sha256(path):
|
|
180
183
|
issues.append({"code": "STALE_INPUT_FACT", "index": index, "path": relative})
|
|
181
184
|
else:
|
|
@@ -40,7 +40,13 @@ def read_handoff(root: Path, relative: str, evidence: list[dict], issues: list[d
|
|
|
40
40
|
except ValueError:
|
|
41
41
|
issues.append({"code": "PREVIOUS_OUTPUT_MISSING", "path": output_relative})
|
|
42
42
|
continue
|
|
43
|
-
if
|
|
43
|
+
if output_path.is_dir() and item.get("sha256") is None:
|
|
44
|
+
# Directory outputs (e.g. wireframes/screens) are recorded without a hash.
|
|
45
|
+
if review_preflight.input_present(output_path):
|
|
46
|
+
evidence.append({"kind": "previous_output_collection", "path": output_relative})
|
|
47
|
+
else:
|
|
48
|
+
issues.append({"code": "PREVIOUS_OUTPUT_MISSING", "path": output_relative})
|
|
49
|
+
elif not output_path.is_file():
|
|
44
50
|
issues.append({"code": "PREVIOUS_OUTPUT_MISSING", "path": output_relative})
|
|
45
51
|
elif item.get("sha256") != review_preflight.sha256(output_path):
|
|
46
52
|
issues.append({"code": "PREVIOUS_OUTPUT_CHANGED", "path": output_relative})
|
package/src/constants.ts
CHANGED
|
@@ -114,6 +114,26 @@ function validationEvidence(snapshot: Record<string, unknown>): string[] {
|
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
/**
|
|
118
|
+
* The blocking step may declare no required outputs of its own while the
|
|
119
|
+
* checkpoint meta output is what is actually missing. Surface the inspector's
|
|
120
|
+
* own missing list so the diagnosis never renders with empty evidence.
|
|
121
|
+
*/
|
|
122
|
+
function missingOutputEvidence(snapshot: Record<string, unknown>): string[] {
|
|
123
|
+
const missing = Array.isArray(snapshot.missing_outputs) ? snapshot.missing_outputs : [];
|
|
124
|
+
const metaErrors = Array.isArray(snapshot.checkpoint_meta_errors) ? snapshot.checkpoint_meta_errors : [];
|
|
125
|
+
const missingPaths = missing.filter((item): item is string => typeof item === "string");
|
|
126
|
+
const missingItems = missingPaths.map(item => `${item}(缺失)`);
|
|
127
|
+
const metaItems = metaErrors.slice(0, 5).flatMap(error => {
|
|
128
|
+
const item = record(error);
|
|
129
|
+
const path = text(item?.path);
|
|
130
|
+
if (!path || missingPaths.includes(path)) return [];
|
|
131
|
+
const field = text(item?.field);
|
|
132
|
+
return [`${path}${field ? `(缺少字段 ${field})` : "(缺失或不合法)"}`];
|
|
133
|
+
});
|
|
134
|
+
return [...missingItems, ...metaItems];
|
|
135
|
+
}
|
|
136
|
+
|
|
117
137
|
function progressOf(snapshot: Record<string, unknown>, stepId: string | undefined): WorkflowDiagnosis["progress"] {
|
|
118
138
|
const steps = Array.isArray(snapshot.workflow_steps) ? snapshot.workflow_steps : [];
|
|
119
139
|
const index = steps.findIndex(step => record(step)?.id === stepId);
|
|
@@ -215,7 +235,7 @@ export function diagnoseWorkflow(input: DiagnosisInput): WorkflowDiagnosis {
|
|
|
215
235
|
const evidence = [
|
|
216
236
|
...(text(snapshot.message) ? [String(snapshot.message)] : []),
|
|
217
237
|
...validationEvidence(snapshot),
|
|
218
|
-
...(code === "CHECKPOINT_OUTPUTS_MISSING" ? outputPaths(step) : []),
|
|
238
|
+
...(code === "CHECKPOINT_OUTPUTS_MISSING" ? [...missingOutputEvidence(snapshot), ...outputPaths(step)] : []),
|
|
219
239
|
];
|
|
220
240
|
return {
|
|
221
241
|
...base,
|