@lmzhen/dsh-evolution-approval 0.3.68 → 0.3.69

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.
Files changed (2) hide show
  1. package/lib/index.js +10 -2
  2. package/package.json +8 -8
package/lib/index.js CHANGED
@@ -233,7 +233,7 @@ var EvolutionApproval = class extends Service {
233
233
  await this.state().releasePendingClaim(id, claimId);
234
234
  return {
235
235
  ok: false,
236
- message: result.message
236
+ message: /changed since this plan|no entry matching|not found|no longer exists/i.test(result.message) ? `${result.message} — a sibling write from the same plan may have already changed this target, so repeated approves will keep failing. Reject this record unless the target changed again.` : result.message
237
237
  };
238
238
  }
239
239
  } catch (error) {
@@ -244,7 +244,15 @@ var EvolutionApproval = class extends Service {
244
244
  message: "Replay runner failed; the pending write remains pending."
245
245
  };
246
246
  }
247
- if (!(await this.state().tryResolvePending(id, "approved", claimId)).applied) {
247
+ const resolution = await this.state().tryResolvePending(id, "approved", claimId).catch((error) => {
248
+ this.ctx.logger.warn(error);
249
+ return `failed: ${error instanceof Error ? error.message : String(error)}`;
250
+ });
251
+ if (typeof resolution === "string") return {
252
+ ok: false,
253
+ message: `Approved write "${id}" was replayed, but resolving the record failed (${resolution.slice(8)}) — the effect has LANDED while the audit row stays "executing". Verify the write manually; approve will not re-run it.`
254
+ };
255
+ if (!resolution.applied) {
248
256
  if ((await this.state().listPending("rejected")).find((item) => item.id === id)) return {
249
257
  ok: false,
250
258
  message: `Approved write "${id}" was replayed, but the record was resolved to "rejected" concurrently — the effect has landed while the audit reads rejected. Verify the write and do NOT replay it.`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-approval",
3
3
  "description": "Stage/pending approval service for Hermes-style self-evolution writes (community build)",
4
- "version": "0.3.68",
4
+ "version": "0.3.69",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -35,15 +35,15 @@
35
35
  "peerDependencies": {
36
36
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
37
37
  "@deepseek-ai/cordis": "^4.0.1",
38
- "@lmzhen/dsh-evolution-state-storage": "^0.3.68",
39
- "@lmzhen/dsh-evolution-state": "^0.3.68"
38
+ "@lmzhen/dsh-evolution-state-storage": "^0.3.69",
39
+ "@lmzhen/dsh-evolution-state": "^0.3.69"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
43
- "@lmzhen/dsh-evolution-state-storage": "^0.3.68",
44
- "@lmzhen/dsh-evolution-state": "^0.3.68",
45
- "@lmzhen/dsh-evolution-io": "^0.3.68",
46
- "@lmzhen/dsh-evolution-io-node": "^0.3.68",
47
- "@lmzhen/dsh-evolution-state-json": "^0.3.68"
43
+ "@lmzhen/dsh-evolution-state-storage": "^0.3.69",
44
+ "@lmzhen/dsh-evolution-state": "^0.3.69",
45
+ "@lmzhen/dsh-evolution-io": "^0.3.69",
46
+ "@lmzhen/dsh-evolution-io-node": "^0.3.69",
47
+ "@lmzhen/dsh-evolution-state-json": "^0.3.69"
48
48
  }
49
49
  }