@lmzhen/dsh-evolution-curator 0.1.0-rc.41 → 0.1.0-rc.43

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
@@ -109,6 +109,33 @@ var EvolutionCurator = class extends Service {
109
109
  this.bootCheck = void 0;
110
110
  }
111
111
  /**
112
+ * Pause or resume automatic curation (B-line G2, Hermes `set_paused`
113
+ * parity): the flag is persisted on the curator state record and the
114
+ * `run()` paused gate skips automatic passes while it holds. Manual runs
115
+ * (`ignoreGates`) are unaffected — pause is a soft stop for the scheduler,
116
+ * not a lock on the operator.
117
+ *
118
+ * Pausing on a state-less curator state seeds the record with `lastRunAt:
119
+ * now`, so a later resume re-enters through the interval gate and defers a
120
+ * full cycle instead of firing immediately (first-run defer interaction,
121
+ * kept deliberately: an unattended resume must not auto-run mid-boot).
122
+ */
123
+ async setPaused(paused) {
124
+ const stateService = this.curatorStateService();
125
+ const persisted = await stateService?.loadCuratorState() ?? null;
126
+ await stateService?.saveCuratorState({
127
+ schemaVersion: 1,
128
+ lastRunAt: persisted?.lastRunAt ?? Date.now(),
129
+ runCount: persisted?.runCount ?? 0,
130
+ lastSummary: persisted?.lastSummary ?? (paused ? "paused" : "resumed"),
131
+ paused
132
+ });
133
+ }
134
+ /** Current persisted curator state (read-only view for /evolution curator status). */
135
+ async status() {
136
+ return await this.curatorStateService()?.loadCuratorState() ?? null;
137
+ }
138
+ /**
112
139
  * One automatic schedule check: run a pass when the persisted curator state
113
140
  * (falling back to the in-memory clock for state-less compositions) is at
114
141
  * least one interval old. All gates — interval, idle, first-run defer,
@@ -254,7 +281,14 @@ var EvolutionCurator = class extends Service {
254
281
  const runId = randomUUID();
255
282
  const stateService = this.curatorStateService();
256
283
  const lifecycle = this.lifecycle();
257
- const persisted = await stateService?.loadCuratorState();
284
+ const persisted = await stateService?.loadCuratorState() ?? null;
285
+ if (!ignoreGates && persisted?.paused === true) return {
286
+ stale: [],
287
+ archived: [],
288
+ errors: [],
289
+ report: this.skippedReport(runId, startedAt),
290
+ skipped: "paused"
291
+ };
258
292
  if (!ignoreGates && persisted && Date.now() - persisted.lastRunAt < lifecycle.intervalHours * 36e5) return {
259
293
  stale: [],
260
294
  archived: [],
@@ -291,6 +325,7 @@ var EvolutionCurator = class extends Service {
291
325
  const snapshotPath = dryRun ? void 0 : await this.snapshotFull("pre-curator-run");
292
326
  const suppressedNames = new Set(await loadSuppressedNames(root, this.io));
293
327
  const { bundledNames, treeNames } = await this.seedBaseline(usage);
328
+ await this.scoreTree(usage, treeNames);
294
329
  const result = computeLifecycleTransitions(usage, {
295
330
  staleAfterDays: lifecycle.staleAfterDays,
296
331
  archiveAfterDays: lifecycle.archiveAfterDays,
@@ -302,7 +337,6 @@ var EvolutionCurator = class extends Service {
302
337
  suppressedNames,
303
338
  referencedSkillNames: this.referencedSkillNames
304
339
  });
305
- await this.scoreTree(usage, treeNames);
306
340
  const nominations = this.llmReview ? await this.recommend(result.markStale, { dryRun }) : {
307
341
  prunings: [],
308
342
  consolidations: []
@@ -94,6 +94,21 @@ export declare class EvolutionCurator extends Service {
94
94
  private lifecycle;
95
95
  start(): void;
96
96
  stop(): void;
97
+ /**
98
+ * Pause or resume automatic curation (B-line G2, Hermes `set_paused`
99
+ * parity): the flag is persisted on the curator state record and the
100
+ * `run()` paused gate skips automatic passes while it holds. Manual runs
101
+ * (`ignoreGates`) are unaffected — pause is a soft stop for the scheduler,
102
+ * not a lock on the operator.
103
+ *
104
+ * Pausing on a state-less curator state seeds the record with `lastRunAt:
105
+ * now`, so a later resume re-enters through the interval gate and defers a
106
+ * full cycle instead of firing immediately (first-run defer interaction,
107
+ * kept deliberately: an unattended resume must not auto-run mid-boot).
108
+ */
109
+ setPaused(paused: boolean): Promise<void>;
110
+ /** Current persisted curator state (read-only view for /evolution curator status). */
111
+ status(): Promise<CuratorStateRecordShape | null>;
97
112
  /**
98
113
  * One automatic schedule check: run a pass when the persisted curator state
99
114
  * (falling back to the in-memory clock for state-less compositions) is at
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-curator",
3
3
  "description": "Deterministic skill lifecycle and recovery (community build)",
4
- "version": "0.1.0-rc.41",
4
+ "version": "0.1.0-rc.43",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -33,20 +33,20 @@
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
35
  "@deepseek-ai/schemastery": "^3.18.1",
36
- "@lmzhen/dsh-evolution-core": "^0.1.0-rc.41"
36
+ "@lmzhen/dsh-evolution-core": "^0.1.0-rc.43"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@deepseek-ai/cordis": "^4.0.1",
40
40
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
41
41
  "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
42
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.41",
43
- "@lmzhen/dsh-evolution-state": "^0.1.0-rc.41"
42
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.43",
43
+ "@lmzhen/dsh-evolution-state": "^0.1.0-rc.43"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
47
47
  "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
48
- "@lmzhen/dsh-evolution-core": "^0.1.0-rc.41",
49
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.41",
50
- "@lmzhen/dsh-evolution-state": "^0.1.0-rc.41"
48
+ "@lmzhen/dsh-evolution-core": "^0.1.0-rc.43",
49
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.43",
50
+ "@lmzhen/dsh-evolution-state": "^0.1.0-rc.43"
51
51
  }
52
52
  }