@lmzhen/dsh-evolution-approval 0.47.0 → 0.49.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
@@ -449,9 +449,10 @@ var EvolutionApproval = class extends Service {
449
449
  * is never invoked. NOTHING a human did not approve can execute; the cost of a wrong TTL is a
450
450
  * staged write that must be staged again.
451
451
  *
452
- * A sweep, not a timer: every read of the window converges it (the CLI, the settings card and the
453
- * doctor all read through {@link list}), so the family does not gain a background timer that would
454
- * have to be unref'd, disposed and reasoned about for process liveness.
452
+ * A sweep, not a timer: converging reads go through {@link list} (the CLI and the settings card),
453
+ * while doctor's diagnostics read goes through {@link listReadonly} and does not write; the family
454
+ * still does not gain a background timer that would have to be unref'd, disposed and reasoned
455
+ * about for process liveness.
455
456
  * @returns the ids that were closed by this sweep (empty when the TTL is off or nothing was stale).
456
457
  */
457
458
  async expireStale() {
@@ -485,6 +486,9 @@ var EvolutionApproval = class extends Service {
485
486
  await this.expireStale();
486
487
  return await this.state().listPending(status);
487
488
  }
489
+ async listReadonly(status = "pending") {
490
+ return await this.state().listPending(status);
491
+ }
488
492
  async approve(id, audit) {
489
493
  await this.expireStale();
490
494
  return await this.withApprovalLease(id, () => this.dedupe(`approve:${id}`, () => this.doApprove(id, audit))) ?? {
@@ -126,6 +126,8 @@ export type ApprovalLike = {
126
126
  * read that absence as "expires immediately". */
127
127
  ttlMs?: number;
128
128
  list(status?: PendingStatus): Promise<PendingRecord[]>;
129
+ /** Read-only window for doctor/diagnostics: never runs expireStale (no write on a read path). */
130
+ listReadonly?(status?: PendingStatus): Promise<PendingRecord[]>;
129
131
  approve(id: string): Promise<{
130
132
  ok: boolean;
131
133
  message: string;
@@ -267,13 +269,15 @@ export declare class EvolutionApproval extends Service {
267
269
  * is never invoked. NOTHING a human did not approve can execute; the cost of a wrong TTL is a
268
270
  * staged write that must be staged again.
269
271
  *
270
- * A sweep, not a timer: every read of the window converges it (the CLI, the settings card and the
271
- * doctor all read through {@link list}), so the family does not gain a background timer that would
272
- * have to be unref'd, disposed and reasoned about for process liveness.
272
+ * A sweep, not a timer: converging reads go through {@link list} (the CLI and the settings card),
273
+ * while doctor's diagnostics read goes through {@link listReadonly} and does not write; the family
274
+ * still does not gain a background timer that would have to be unref'd, disposed and reasoned
275
+ * about for process liveness.
273
276
  * @returns the ids that were closed by this sweep (empty when the TTL is off or nothing was stale).
274
277
  */
275
278
  expireStale(): Promise<string[]>;
276
279
  list(status?: PendingStatus): Promise<PendingRecord[]>;
280
+ listReadonly(status?: PendingStatus): Promise<PendingRecord[]>;
277
281
  approve(id: string, audit: DecisionAudit): Promise<{
278
282
  ok: boolean;
279
283
  message: string;
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.47.0",
4
+ "version": "0.49.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -29,16 +29,16 @@
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
31
  "@deepseek-ai/schemastery": "^3.18.5",
32
- "@lmzhen/dsh-evolution-core": "^0.47.0"
32
+ "@lmzhen/dsh-evolution-core": "^0.49.0"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@deepseek-ai/cordis": "^4.0.5",
36
- "@lmzhen/dsh-evolution-core": "^0.47.0",
37
- "@lmzhen/dsh-evolution-state": "^0.47.0"
36
+ "@lmzhen/dsh-evolution-core": "^0.49.0",
37
+ "@lmzhen/dsh-evolution-state": "^0.49.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@lmzhen/dsh-evolution-core": "^0.47.0",
41
- "@lmzhen/dsh-evolution-state": "^0.47.0"
40
+ "@lmzhen/dsh-evolution-core": "^0.49.0",
41
+ "@lmzhen/dsh-evolution-state": "^0.49.0"
42
42
  },
43
43
  "engines": {
44
44
  "dsh": ">=0.2.2-rc.0 <0.2.3-0"