@fnndsc/cumin 3.8.0 → 3.9.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.
Files changed (60) hide show
  1. package/README.md +2 -2
  2. package/dist/cache/index.d.ts +5 -1
  3. package/dist/cache/index.js +9 -1
  4. package/dist/cache/index.js.map +1 -1
  5. package/dist/cache/listCache.d.ts +11 -0
  6. package/dist/cache/listCache.js +19 -0
  7. package/dist/cache/listCache.js.map +1 -1
  8. package/dist/cache/procCache.d.ts +156 -6
  9. package/dist/cache/procCache.js +244 -7
  10. package/dist/cache/procCache.js.map +1 -1
  11. package/dist/cache/procCheckpoint.d.ts +47 -0
  12. package/dist/cache/procCheckpoint.js +217 -0
  13. package/dist/cache/procCheckpoint.js.map +1 -0
  14. package/dist/cache/procPrompt.d.ts +34 -0
  15. package/dist/cache/procPrompt.js +25 -0
  16. package/dist/cache/procPrompt.js.map +1 -0
  17. package/dist/chrisapi/adapter.d.ts +12 -1
  18. package/dist/chrisapi/adapter.js +25 -0
  19. package/dist/chrisapi/adapter.js.map +1 -1
  20. package/dist/connect/chrisConnection.d.ts +20 -0
  21. package/dist/connect/chrisConnection.js +33 -0
  22. package/dist/connect/chrisConnection.js.map +1 -1
  23. package/dist/feeds/chrisFeed.js +2 -1
  24. package/dist/feeds/chrisFeed.js.map +1 -1
  25. package/dist/groups/chrisGroups.d.ts +67 -1
  26. package/dist/groups/chrisGroups.js +171 -1
  27. package/dist/groups/chrisGroups.js.map +1 -1
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.js +2 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/io/chrisIO.d.ts +14 -0
  32. package/dist/io/chrisIO.js +32 -2
  33. package/dist/io/chrisIO.js.map +1 -1
  34. package/dist/jobs/chrisJob.js +4 -0
  35. package/dist/jobs/chrisJob.js.map +1 -1
  36. package/dist/output/runtimeOutput.d.ts +49 -0
  37. package/dist/output/runtimeOutput.js +51 -0
  38. package/dist/output/runtimeOutput.js.map +1 -0
  39. package/dist/pacs/chrisPACS.d.ts +28 -0
  40. package/dist/pacs/chrisPACS.js +40 -21
  41. package/dist/pacs/chrisPACS.js.map +1 -1
  42. package/dist/path/chrisPath.js +3 -3
  43. package/dist/path/chrisPath.js.map +1 -1
  44. package/dist/pipelines/chrisPipeline.d.ts +4 -0
  45. package/dist/pipelines/chrisPipeline.js.map +1 -1
  46. package/dist/plugins/chrisPlugins.d.ts +8 -1
  47. package/dist/plugins/chrisPlugins.js +8 -1
  48. package/dist/plugins/chrisPlugins.js.map +1 -1
  49. package/dist/resources/chrisObjContext.d.ts +11 -0
  50. package/dist/resources/chrisObjContext.js +38 -2
  51. package/dist/resources/chrisObjContext.js.map +1 -1
  52. package/dist/resources/chrisResources.js +4 -0
  53. package/dist/resources/chrisResources.js.map +1 -1
  54. package/dist/users/chrisUsers.d.ts +56 -10
  55. package/dist/users/chrisUsers.js +149 -20
  56. package/dist/users/chrisUsers.js.map +1 -1
  57. package/dist/utils/retry.d.ts +29 -0
  58. package/dist/utils/retry.js +44 -0
  59. package/dist/utils/retry.js.map +1 -0
  60. package/package.json +19 -8
package/README.md CHANGED
@@ -54,7 +54,7 @@ In the "Sandwich Model" architecture, `cumin` is the bottom layer (just above th
54
54
  - **`ChrisIO`**: High-level IO operations, including recursive directory uploading (`uploadLocalPath`).
55
55
  - **`ChRISResource.resources_getAll()`**: Generic pagination handler.
56
56
  - **`ListCache`** (`listCache_get()`): Session-scoped directory listing cache for the VFS.
57
- - **`ProcCache`** (`procCache_get()`): Session-scoped job monitoring cache. Stores all visible plugin instances as a DAG (two flat maps: `instances` keyed by ID, `children`/`feedRoots` for tree traversal). Structure is permanent once built; only non-terminal instance statuses are refreshed on read. Powers the `/proc/feeds/` VFS provider in salsa.
57
+ - **`ProcCache`** (`procCache_get()`): Session-scoped job monitoring DAG with versioned, identity-scoped daemon checkpoints. Restored topology remains usable while CUBE reconciliation runs; terminal status persists and active status refreshes on read. Powers the `/proc/jobs/` VFS provider in salsa.
58
58
 
59
59
  ## Developer Setup
60
60
 
@@ -75,4 +75,4 @@ To build the `cumin` library from source:
75
75
  MIT — part of the [ChRIS Project](https://chrisproject.org).
76
76
 
77
77
  ---
78
- _-30-_
78
+ _-30-_
@@ -6,4 +6,8 @@
6
6
  export { ListCache, listCache_get } from './listCache.js';
7
7
  export type { CacheStats, CacheResult, CacheOptions } from './listCache.js';
8
8
  export { ProcCache, procCache_get, status_isTerminal, PROC_TERMINAL_STATUSES } from './procCache.js';
9
- export type { ProcInstance, ProcFeed, ProcWarmupProgress } from './procCache.js';
9
+ export type { ProcInstance, ProcFeed, ProcFeedScopeCounts, ProcWarmupProgress, ProcCacheState, ProcCacheLifecycle, ProcCacheSnapshot, } from './procCache.js';
10
+ export { procPromptState_get, PROC_PROMPT_STATES } from './procPrompt.js';
11
+ export type { ProcPromptState, ProcPromptProgress } from './procPrompt.js';
12
+ export { procCheckpointPath_get, procCheckpoint_restore, procCheckpoint_save, procCheckpoint_watch, } from './procCheckpoint.js';
13
+ export type { ProcCheckpointRestoreResult } from './procCheckpoint.js';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PROC_TERMINAL_STATUSES = exports.status_isTerminal = exports.procCache_get = exports.ProcCache = exports.listCache_get = exports.ListCache = void 0;
3
+ exports.procCheckpoint_watch = exports.procCheckpoint_save = exports.procCheckpoint_restore = exports.procCheckpointPath_get = exports.PROC_PROMPT_STATES = exports.procPromptState_get = exports.PROC_TERMINAL_STATUSES = exports.status_isTerminal = exports.procCache_get = exports.ProcCache = exports.listCache_get = exports.ListCache = void 0;
4
4
  /**
5
5
  * @file Cache module exports.
6
6
  *
@@ -14,4 +14,12 @@ Object.defineProperty(exports, "ProcCache", { enumerable: true, get: function ()
14
14
  Object.defineProperty(exports, "procCache_get", { enumerable: true, get: function () { return procCache_js_1.procCache_get; } });
15
15
  Object.defineProperty(exports, "status_isTerminal", { enumerable: true, get: function () { return procCache_js_1.status_isTerminal; } });
16
16
  Object.defineProperty(exports, "PROC_TERMINAL_STATUSES", { enumerable: true, get: function () { return procCache_js_1.PROC_TERMINAL_STATUSES; } });
17
+ var procPrompt_js_1 = require("./procPrompt.js");
18
+ Object.defineProperty(exports, "procPromptState_get", { enumerable: true, get: function () { return procPrompt_js_1.procPromptState_get; } });
19
+ Object.defineProperty(exports, "PROC_PROMPT_STATES", { enumerable: true, get: function () { return procPrompt_js_1.PROC_PROMPT_STATES; } });
20
+ var procCheckpoint_js_1 = require("./procCheckpoint.js");
21
+ Object.defineProperty(exports, "procCheckpointPath_get", { enumerable: true, get: function () { return procCheckpoint_js_1.procCheckpointPath_get; } });
22
+ Object.defineProperty(exports, "procCheckpoint_restore", { enumerable: true, get: function () { return procCheckpoint_js_1.procCheckpoint_restore; } });
23
+ Object.defineProperty(exports, "procCheckpoint_save", { enumerable: true, get: function () { return procCheckpoint_js_1.procCheckpoint_save; } });
24
+ Object.defineProperty(exports, "procCheckpoint_watch", { enumerable: true, get: function () { return procCheckpoint_js_1.procCheckpoint_watch; } });
17
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,+CAA0D;AAAjD,yGAAA,SAAS,OAAA;AAAE,6GAAA,aAAa,OAAA;AAEjC,+CAAqG;AAA5F,yGAAA,SAAS,OAAA;AAAE,6GAAA,aAAa,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AAAE,sHAAA,sBAAsB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,+CAA0D;AAAjD,yGAAA,SAAS,OAAA;AAAE,6GAAA,aAAa,OAAA;AAEjC,+CAAqG;AAA5F,yGAAA,SAAS,OAAA;AAAE,6GAAA,aAAa,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AAAE,sHAAA,sBAAsB,OAAA;AAU5E,iDAA0E;AAAjE,oHAAA,mBAAmB,OAAA;AAAE,mHAAA,kBAAkB,OAAA;AAEhD,yDAK6B;AAJ3B,2HAAA,sBAAsB,OAAA;AACtB,2HAAA,sBAAsB,OAAA;AACtB,wHAAA,mBAAmB,OAAA;AACnB,yHAAA,oBAAoB,OAAA"}
@@ -144,6 +144,17 @@ export declare class ListCache {
144
144
  * @param path - Optional specific path to invalidate. If omitted, clears entire cache.
145
145
  */
146
146
  cache_invalidate(path?: string): void;
147
+ /**
148
+ * Invalidates a path and every cached listing beneath it.
149
+ * Called by operations that remove or replace an entire directory tree
150
+ * (rm -r, a directory re-upload): nested listings cached before the
151
+ * mutation would otherwise serve the old tree's contents until their TTL
152
+ * expires, with no refresh hint.
153
+ *
154
+ * @param path - Root of the subtree to invalidate. The entry for the path
155
+ * itself is removed along with all entries under `path + '/'`.
156
+ */
157
+ cache_invalidateTree(path: string): void;
147
158
  /**
148
159
  * @deprecated Use cache without cwd tracking. Cache persists across navigation.
149
160
  * This method is kept for backward compatibility but does nothing.
@@ -178,6 +178,25 @@ class ListCache {
178
178
  this.cache.clear();
179
179
  }
180
180
  }
181
+ /**
182
+ * Invalidates a path and every cached listing beneath it.
183
+ * Called by operations that remove or replace an entire directory tree
184
+ * (rm -r, a directory re-upload): nested listings cached before the
185
+ * mutation would otherwise serve the old tree's contents until their TTL
186
+ * expires, with no refresh hint.
187
+ *
188
+ * @param path - Root of the subtree to invalidate. The entry for the path
189
+ * itself is removed along with all entries under `path + '/'`.
190
+ */
191
+ cache_invalidateTree(path) {
192
+ this.cache.delete(path);
193
+ const prefix = path.endsWith("/") ? path : `${path}/`;
194
+ for (const key of this.cache.keys()) {
195
+ if (key.startsWith(prefix)) {
196
+ this.cache.delete(key);
197
+ }
198
+ }
199
+ }
181
200
  /**
182
201
  * @deprecated Use cache without cwd tracking. Cache persists across navigation.
183
202
  * This method is kept for backward compatibility but does nothing.
@@ -1 +1 @@
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IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC;IAC3B,CAAC;CACF;AAtPD,8BAsPC;AAED;;;;GAIG;AACH,SAAgB,aAAa;IAC3B,OAAO,SAAS,CAAC,YAAY,EAAE,CAAC;AAClC,CAAC"}
@@ -2,11 +2,11 @@
2
2
  * @file Process Cache
3
3
  *
4
4
  * Session-scoped cache of ChRIS feed topology. Separates permanent data
5
- * (instance DAG structure) from volatile data (status — never stored).
5
+ * (instance DAG structure and terminal status) from volatile active status.
6
6
  *
7
7
  * Design decisions:
8
8
  * - Topology (id, feedID, parentID, pluginName) is permanent once written.
9
- * - Status is always fetched live from the API — never stored here.
9
+ * - Terminal status is immutable and checkpointed; active status refreshes live.
10
10
  * - Feed job counters (finishedJobs etc.) give aggregate feed status
11
11
  * without per-instance API calls.
12
12
  * - topologyLoaded distinguishes "loaded but 0 instances" from "not yet loaded".
@@ -18,10 +18,15 @@
18
18
  */
19
19
  /**
20
20
  * Feed-level metadata including job count fields for aggregate status.
21
+ *
22
+ * @property ownerUsername - Username that owns the feed.
23
+ * @property public - Whether the feed is publicly visible.
21
24
  */
22
25
  export interface ProcFeed {
23
26
  id: number;
24
27
  title: string;
28
+ ownerUsername: string;
29
+ public: boolean;
25
30
  creationDate: string;
26
31
  finishedJobs: number;
27
32
  erroredJobs: number;
@@ -30,6 +35,20 @@ export interface ProcFeed {
30
35
  cancelledJobs: number;
31
36
  createdJobs: number;
32
37
  }
38
+ /**
39
+ * Exclusive feed counts by how the current identity can see each feed.
40
+ *
41
+ * @property user - Feeds owned by the current identity.
42
+ * @property public - Public feeds owned by another identity.
43
+ * @property shared - Non-public feeds shared by another identity.
44
+ * @property total - Unique visible feeds across all three buckets.
45
+ */
46
+ export interface ProcFeedScopeCounts {
47
+ user: number;
48
+ public: number;
49
+ shared: number;
50
+ total: number;
51
+ }
33
52
  /**
34
53
  * Instance entry. Topology (id/feedID/parentID/pluginName) is permanent.
35
54
  * Status is cached only once terminal (settled); active status is refreshed live.
@@ -48,6 +67,12 @@ export interface ProcInstance {
48
67
  pluginType?: string;
49
68
  /** null until first cat — immutable once populated. */
50
69
  params: Record<string, unknown> | null;
70
+ /**
71
+ * Authoritative CUBE output directory, resolved lazily for the `/proc` data
72
+ * link. `undefined` means not looked up; `null` means CUBE reported none.
73
+ * This navigation convenience is deliberately excluded from checkpoints.
74
+ */
75
+ outputPath?: string | null;
51
76
  /**
52
77
  * Last known job status. Terminal statuses (see {@link PROC_TERMINAL_STATUSES})
53
78
  * are immutable and kept permanently; active statuses are refreshed live.
@@ -76,17 +101,42 @@ export declare const PROC_TERMINAL_STATUSES: ReadonlySet<string>;
76
101
  export declare function status_isTerminal(status: string | null | undefined): boolean;
77
102
  /**
78
103
  * Warm-up progress counters for the prompt indicator.
79
- * total is always 0 during global sweep (unknown upfront).
80
- * active transitions false→true when sweep starts, true→false when done.
104
+ * total is zero until the server reports the visible plugin-instance count.
105
+ * active becomes true when observable page progress begins, and false when the
106
+ * sweep completes or aborts. Use the topology lifecycle to detect an earlier
107
+ * running state before the first page arrives.
81
108
  */
82
109
  export interface ProcWarmupProgress {
83
110
  loaded: number;
84
111
  total: number;
85
112
  active: boolean;
86
113
  }
114
+ /** Availability and freshness states for the persistent process cache. */
115
+ export type ProcCacheState = 'empty' | 'restored' | 'reconciling' | 'current' | 'failed';
87
116
  /**
88
- * Session-scoped cache of feed and instance topology.
89
- * Status is never stored — always fetched live from the API.
117
+ * Persistent process-cache freshness metadata.
118
+ *
119
+ * @property state - Current availability and reconciliation state.
120
+ * @property checkpointAt - ISO timestamp of the latest durable checkpoint.
121
+ */
122
+ export interface ProcCacheLifecycle {
123
+ state: ProcCacheState;
124
+ checkpointAt?: string;
125
+ }
126
+ /**
127
+ * Serializable topology retained across daemon restarts.
128
+ *
129
+ * @property feeds - Visible feed metadata.
130
+ * @property instances - Normalized plugin-instance topology.
131
+ * @property topologyLoaded - Feed IDs whose instance topology is complete.
132
+ */
133
+ export interface ProcCacheSnapshot {
134
+ feeds: ProcFeed[];
135
+ instances: ProcInstance[];
136
+ topologyLoaded: number[];
137
+ }
138
+ /**
139
+ * Session-scoped cache of feed and instance topology with restorable terminal state.
90
140
  */
91
141
  export declare class ProcCache {
92
142
  private static _instance;
@@ -103,21 +153,62 @@ export declare class ProcCache {
103
153
  private _warmupProgress;
104
154
  /** Whether initial feed index has been built. */
105
155
  private _built;
156
+ private lifecycle;
157
+ private listeners;
106
158
  private constructor();
107
159
  static instance_get(): ProcCache;
108
160
  get built(): boolean;
109
161
  get warmupComplete(): boolean;
162
+ /**
163
+ * Returns a copy of the current cache lifecycle metadata.
164
+ *
165
+ * @returns Current cache state and checkpoint timestamp.
166
+ */
167
+ lifecycle_get(): ProcCacheLifecycle;
168
+ /**
169
+ * Changes the cache freshness state.
170
+ *
171
+ * @param state - New lifecycle state.
172
+ * @returns Nothing.
173
+ */
174
+ lifecycle_set(state: ProcCacheState): void;
175
+ /**
176
+ * Registers a callback for checkpoint-worthy cache mutations.
177
+ *
178
+ * @param listener - Callback invoked after a cache mutation.
179
+ * @returns Function that unregisters the callback.
180
+ */
181
+ changeListener_add(listener: () => void): () => void;
182
+ private change_emit;
110
183
  /**
111
184
  * Adds or updates a feed entry.
112
185
  */
113
186
  feed_add(feed: ProcFeed): void;
114
187
  feed_get(feedID: number): ProcFeed | undefined;
115
188
  feedIDs_get(): number[];
189
+ /**
190
+ * Counts visible feeds in exclusive ownership, sharing, and public buckets.
191
+ *
192
+ * Ownership takes precedence over public visibility so the buckets sum to
193
+ * the unique feed total.
194
+ *
195
+ * @param username - Authenticated username whose owned feeds form `user`.
196
+ * @returns Exclusive scope counts whose components sum to `total`.
197
+ */
198
+ feedScopeCounts_get(username: string): ProcFeedScopeCounts;
116
199
  feedRoots_get(feedID: number): number[];
117
200
  /**
118
201
  * Removes a feed and all its instances from the cache.
119
202
  */
120
203
  feed_remove(feedID: number): void;
204
+ /**
205
+ * Replaces the visible feed set while preserving topology for retained feeds.
206
+ *
207
+ * @param feeds - Authoritative feeds visible to the current identity.
208
+ * @returns IDs requiring topology reconciliation because they are new, their
209
+ * aggregate job counts changed, or they still have active work.
210
+ */
211
+ feeds_reconcile(feeds: ProcFeed[]): number[];
121
212
  /**
122
213
  * Adds a plugin instance to the topology cache.
123
214
  */
@@ -138,10 +229,36 @@ export declare class ProcCache {
138
229
  * Removes an instance from the topology cache.
139
230
  */
140
231
  instance_remove(id: number): void;
232
+ /**
233
+ * Removes instances absent from an authoritative topology sweep.
234
+ *
235
+ * @param instanceIDs - Instance IDs returned by the completed CUBE sweep.
236
+ * @returns Nothing.
237
+ */
238
+ topology_reconcile(instanceIDs: Set<number>): void;
141
239
  /**
142
240
  * Updates cached params for an instance (on first cat).
143
241
  */
144
242
  params_update(id: number, params: Record<string, unknown>): void;
243
+ /**
244
+ * Stores the lazily resolved CUBE output path for one instance.
245
+ *
246
+ * @param id - Plugin-instance ID whose output location was resolved.
247
+ * @param outputPath - Absolute CFS output directory, or null when absent.
248
+ * @returns Nothing.
249
+ */
250
+ outputPath_update(id: number, outputPath: string | null): void;
251
+ /**
252
+ * Finds the closest cached job output containing a CFS path.
253
+ *
254
+ * An output path is a directory boundary: `/home/alice/run` contains
255
+ * `/home/alice/run/result.txt`, but not `/home/alice/run-old`.
256
+ *
257
+ * @param cfsPath - Absolute CFS path to resolve against live-session outputs.
258
+ * @returns The closest producing instance, or undefined when no output path
259
+ * known in this session contains the path.
260
+ */
261
+ outputPath_match(cfsPath: string): ProcInstance | undefined;
145
262
  /**
146
263
  * Updates the cached status for an instance. Terminal (settled) statuses are
147
264
  * never overwritten — once finished, a job's status is immutable.
@@ -172,8 +289,20 @@ export declare class ProcCache {
172
289
  loading_get(feedID: number): Promise<void> | undefined;
173
290
  loading_clear(feedID: number): void;
174
291
  warmup_complete(): void;
292
+ /**
293
+ * Stops an unsuccessful warm-up without marking its topology complete.
294
+ *
295
+ * @returns Nothing.
296
+ */
297
+ warmup_abort(): void;
175
298
  warmup_progress(loaded: number, total: number): void;
176
299
  warmupProgress_get(): ProcWarmupProgress;
300
+ /**
301
+ * Resets reconciliation progress while retaining restored topology.
302
+ *
303
+ * @returns Nothing.
304
+ */
305
+ warmup_reset(): void;
177
306
  /**
178
307
  * Reconstructs the full /proc/jobs path for a given instance ID.
179
308
  *
@@ -196,6 +325,27 @@ export declare class ProcCache {
196
325
  */
197
326
  instances_find(term: string): ProcInstance[];
198
327
  built_set(): void;
328
+ /**
329
+ * Creates a persistence-safe snapshot without parameters or active statuses.
330
+ *
331
+ * @returns Serializable feed and terminal-topology state.
332
+ */
333
+ snapshot_create(): ProcCacheSnapshot;
334
+ /**
335
+ * Replaces in-memory topology with a validated persistent snapshot.
336
+ *
337
+ * @param snapshot - Previously validated snapshot data.
338
+ * @param checkpointAt - ISO timestamp when the checkpoint was written.
339
+ * @returns Nothing.
340
+ */
341
+ snapshot_restore(snapshot: ProcCacheSnapshot, checkpointAt: string): void;
342
+ /**
343
+ * Records the timestamp of a successful durable save.
344
+ *
345
+ * @param checkpointAt - ISO timestamp written into the checkpoint.
346
+ * @returns Nothing.
347
+ */
348
+ checkpoint_mark(checkpointAt: string): void;
199
349
  /**
200
350
  * Clears all cache data. Called before a full rebuild.
201
351
  */