@lmzhen/dsh-evolution-merge 0.32.6 → 0.33.0

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/lib/index.js CHANGED
@@ -3700,6 +3700,10 @@ function runView(run, readAt, includeResultRef = false) {
3700
3700
  const record = run.record;
3701
3701
  const state = run.meta?.phase === "undone" ? "undone" : run.meta?.stopReason === "interrupted" ? "interrupted" : run.meta?.approval === "pending" ? "awaiting-approval" : record.state;
3702
3702
  const stopReason = run.meta?.stopReason ?? (record.state === "cancelled" ? "cancelled" : record.state === "failed" ? "failed" : record.state === "succeeded" ? "completed" : void 0);
3703
+ const progress = record.progress === void 0 ? null : {
3704
+ done: state === "succeeded" || state === "undone" ? Math.max(record.progress.done, run.pairs.length) : record.progress.done,
3705
+ total: record.progress.total
3706
+ };
3703
3707
  return {
3704
3708
  wireVersion: 1,
3705
3709
  readAt,
@@ -3707,10 +3711,7 @@ function runView(run, readAt, includeResultRef = false) {
3707
3711
  state,
3708
3712
  command: record.command ?? "scan",
3709
3713
  ...record.stage === void 0 ? {} : { stage: record.stage },
3710
- progress: record.progress === void 0 ? null : {
3711
- done: record.progress.done,
3712
- total: record.progress.total
3713
- },
3714
+ progress,
3714
3715
  startedAt: record.startedAt,
3715
3716
  ...record.endedAt === void 0 ? {} : { endedAt: record.endedAt },
3716
3717
  ...stopReason === void 0 ? {} : { stopReason },
@@ -86,7 +86,13 @@ function runView(run, readAt, includeResultRef = false) {
86
86
  : run.meta?.approval === 'pending' ? 'awaiting-approval'
87
87
  : record.state;
88
88
  const stopReason = run.meta?.stopReason ?? (record.state === 'cancelled' ? 'cancelled' : record.state === 'failed' ? 'failed' : record.state === 'succeeded' ? 'completed' : undefined);
89
- return { wireVersion: 1, readAt, id: record.id, state, command: record.command ?? 'scan', ...(record.stage === undefined ? {} : { stage: record.stage }), progress: record.progress === undefined ? null : { done: record.progress.done, total: record.progress.total }, startedAt: record.startedAt, ...(record.endedAt === undefined ? {} : { endedAt: record.endedAt }), ...(stopReason === undefined ? {} : { stopReason }), ...(record.failure === undefined ? {} : { failure: { stage: 'settle', code: 'run-failed', retryable: false, retryFrom: 'none', detail: record.failure } }), ...(record.parentRunId === undefined ? {} : { parentRunId: record.parentRunId }), ...(run.pairs[0]?.pairKey === undefined ? {} : { currentPairKey: run.pairs[0].pairKey }), ...(record.resultRef === undefined ? {} : { resultRef: record.resultRef }), actions: [{ id: 'status', command: base + 'status ' + record.id, confirm: false, enabled: true }, { id: 'report', command: base + 'report ' + record.id, confirm: false, enabled: record.resultRef !== undefined }, { id: 'cancel', command: base + 'cancel ' + record.id, confirm: false, enabled: record.state === 'running' }] };
89
+ // The maker records progress while running; a terminal run that actually produced pairs
90
+ // must not keep the last in-flight 0/N. The UI shows what happened, not the last tick.
91
+ const progress = record.progress === undefined ? null : {
92
+ done: state === 'succeeded' || state === 'undone' ? Math.max(record.progress.done, run.pairs.length) : record.progress.done,
93
+ total: record.progress.total,
94
+ };
95
+ return { wireVersion: 1, readAt, id: record.id, state, command: record.command ?? 'scan', ...(record.stage === undefined ? {} : { stage: record.stage }), progress, startedAt: record.startedAt, ...(record.endedAt === undefined ? {} : { endedAt: record.endedAt }), ...(stopReason === undefined ? {} : { stopReason }), ...(record.failure === undefined ? {} : { failure: { stage: 'settle', code: 'run-failed', retryable: false, retryFrom: 'none', detail: record.failure } }), ...(record.parentRunId === undefined ? {} : { parentRunId: record.parentRunId }), ...(run.pairs[0]?.pairKey === undefined ? {} : { currentPairKey: run.pairs[0].pairKey }), ...(record.resultRef === undefined ? {} : { resultRef: record.resultRef }), actions: [{ id: 'status', command: base + 'status ' + record.id, confirm: false, enabled: true }, { id: 'report', command: base + 'report ' + record.id, confirm: false, enabled: record.resultRef !== undefined }, { id: 'cancel', command: base + 'cancel ' + record.id, confirm: false, enabled: record.state === 'running' }] };
90
96
  }
91
97
  export function buildFacts(snapshot) {
92
98
  const ordered = [...snapshot.runs].sort((a, b) => b.record.startedAt - a.record.startedAt);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-merge",
3
3
  "description": "Skill auto-merge domain: screening, two-round authoring, queues and commit orchestration (community build)",
4
- "version": "0.32.6",
4
+ "version": "0.33.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -32,9 +32,9 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@deepseek-ai/schemastery": "^3.18.5",
35
- "@lmzhen/dsh-evolution-core": "^0.32.6",
36
- "@lmzhen/dsh-evolution-commands": "^0.32.6",
37
- "@lmzhen/dsh-evolution-merge-engine": "0.32.6"
35
+ "@lmzhen/dsh-evolution-core": "^0.33.0",
36
+ "@lmzhen/dsh-evolution-commands": "^0.33.0",
37
+ "@lmzhen/dsh-evolution-merge-engine": "0.33.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@deepseek-ai/cordis": "^4.0.5"