@lmzhen/dsh-evolution-state-storage 0.3.66 → 0.3.67
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 +14 -1
- package/lib/types/index.d.ts +12 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -95,6 +95,7 @@ function recordIssue(table, record) {
|
|
|
95
95
|
if (typeof value.kind !== "string" || !PENDING_KINDS.has(value.kind)) return "kind must be memory|skill|capability";
|
|
96
96
|
if (typeof value.summary !== "string") return "summary must be a string";
|
|
97
97
|
if (!Object.prototype.hasOwnProperty.call(value, "args")) return "args key is required (may be any cloneable value)";
|
|
98
|
+
if (value.args === void 0) return "args must be a cloneable value — `undefined` is dropped by the json medium and the record would be unreadable after a restart (pass {} instead)";
|
|
98
99
|
if (typeof value.createdAt !== "string") return "createdAt must be a string";
|
|
99
100
|
if (typeof value.status !== "string" || !PENDING_STATUSES.has(value.status)) return "status must be pending|executing|approved|rejected";
|
|
100
101
|
for (const field of [
|
|
@@ -157,6 +158,18 @@ const releasedStatus = (status) => status === "executing" ? "pending" : status;
|
|
|
157
158
|
* The audit ARCHIVE sidecar that json maintains beyond the cap stays
|
|
158
159
|
* json-specific (domain has no sidecar facility) — declared in both READMEs. */
|
|
159
160
|
const PENDING_RESOLVED_CAP = 200;
|
|
161
|
+
/**
|
|
162
|
+
* V24-08 (v24): session rows in the review-state table, per session id. The
|
|
163
|
+
* review pipeline saves on EVERY turn/end of EVERY session and nothing ever
|
|
164
|
+
* deleted rows, so the file grew (and was fully rewritten) with the deploy's
|
|
165
|
+
* whole session history — the same unbounded-growth class the pending cap
|
|
166
|
+
* above already fixed for approvals. A review row is advisory cadence state:
|
|
167
|
+
* evicting the least-recently-active session merely lets that session's next
|
|
168
|
+
* review fire from a fresh counter, so a generous cap is loss-less in
|
|
169
|
+
* practice. Enforced by BOTH providers inside their save path (no seam
|
|
170
|
+
* interface change, no background sweeper).
|
|
171
|
+
*/
|
|
172
|
+
const REVIEW_STATE_SESSION_CAP = 500;
|
|
160
173
|
var EvolutionStateStorageRegistry = class extends Service {
|
|
161
174
|
providers = /* @__PURE__ */ new Map();
|
|
162
175
|
/** C-7 (v18): per-name dispose, mirroring the evolution-io registry. */
|
|
@@ -203,4 +216,4 @@ var EvolutionStateStorageRegistry = class extends Service {
|
|
|
203
216
|
}
|
|
204
217
|
};
|
|
205
218
|
//#endregion
|
|
206
|
-
export { CURATOR_STATE_FILE, CURATOR_STATE_KEY, CURATOR_STATE_TABLE, EvolutionStateStorageRegistry, EvolutionStateStorageRegistry as default, PENDING_ARCHIVE_BAK_FILE, PENDING_ARCHIVE_FILE, PENDING_LEGACY_FILE, PENDING_RESOLVED_CAP, PENDING_STATE_FILE, PENDING_TABLE, PROVIDER_DOMAIN, PROVIDER_JSON, REVIEW_STATE_FILE, REVIEW_STATE_TABLE, UNKNOWN_FIELD_POLICY, assertCloneable, canClaimPending, canResolvePending, cloneRecord, recordIssue, releasedStatus };
|
|
219
|
+
export { CURATOR_STATE_FILE, CURATOR_STATE_KEY, CURATOR_STATE_TABLE, EvolutionStateStorageRegistry, EvolutionStateStorageRegistry as default, PENDING_ARCHIVE_BAK_FILE, PENDING_ARCHIVE_FILE, PENDING_LEGACY_FILE, PENDING_RESOLVED_CAP, PENDING_STATE_FILE, PENDING_TABLE, PROVIDER_DOMAIN, PROVIDER_JSON, REVIEW_STATE_FILE, REVIEW_STATE_SESSION_CAP, REVIEW_STATE_TABLE, UNKNOWN_FIELD_POLICY, assertCloneable, canClaimPending, canResolvePending, cloneRecord, recordIssue, releasedStatus };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -48,6 +48,18 @@ export declare const releasedStatus: (status: PendingStatus) => PendingStatus;
|
|
|
48
48
|
* The audit ARCHIVE sidecar that json maintains beyond the cap stays
|
|
49
49
|
* json-specific (domain has no sidecar facility) — declared in both READMEs. */
|
|
50
50
|
export declare const PENDING_RESOLVED_CAP = 200;
|
|
51
|
+
/**
|
|
52
|
+
* V24-08 (v24): session rows in the review-state table, per session id. The
|
|
53
|
+
* review pipeline saves on EVERY turn/end of EVERY session and nothing ever
|
|
54
|
+
* deleted rows, so the file grew (and was fully rewritten) with the deploy's
|
|
55
|
+
* whole session history — the same unbounded-growth class the pending cap
|
|
56
|
+
* above already fixed for approvals. A review row is advisory cadence state:
|
|
57
|
+
* evicting the least-recently-active session merely lets that session's next
|
|
58
|
+
* review fire from a fresh counter, so a generous cap is loss-less in
|
|
59
|
+
* practice. Enforced by BOTH providers inside their save path (no seam
|
|
60
|
+
* interface change, no background sweeper).
|
|
61
|
+
*/
|
|
62
|
+
export declare const REVIEW_STATE_SESSION_CAP = 500;
|
|
51
63
|
/**
|
|
52
64
|
* Claim lifecycle (S3.3): pending →(claim)→ executing →(resolve)→ approved/rejected.
|
|
53
65
|
* release() rolls executing back to pending (failure path). A crash between
|