@guanlin4924/devflow-pi 0.1.104 → 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 CHANGED
@@ -11,7 +11,7 @@ Devflow Pi 是一个面向项目研发交付的独立 OMP 产品入口,内置
11
11
  安装与启动:
12
12
 
13
13
  ```bash
14
- npm install -g @guanlin4924/devflow-pi@0.1.104
14
+ npm install -g @guanlin4924/devflow-pi@0.1.105
15
15
  cd /path/to/your-project
16
16
  devflow-pi init
17
17
  devflow-pi doctor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guanlin4924/devflow-pi",
3
- "version": "0.1.104",
3
+ "version": "0.1.105",
4
4
  "type": "module",
5
5
  "description": "Devflow 专项研发 Pi,基于固定版本 OMP Runtime 组装研发状态机、代码智能、设计、实现与质量门禁。",
6
6
  "license": "UNLICENSED",
@@ -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
- checkpoint_meta_errors = CheckpointMeta.validate(root: root, state: state, checkpoint: checkpoint)
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",
package/src/constants.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export const PRODUCT_NAME = "Devflow Pi";
2
- export const PRODUCT_VERSION = "0.1.104";
2
+ export const PRODUCT_VERSION = "0.1.105";
3
3
  export const PROJECT_SCHEMA_VERSION = 1;
4
4
  export const OMP_RUNTIME_VERSION = "17.2.7";
5
5
 
@@ -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,