hikoutei 0.8.39 → 0.8.40
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/dist/api/Hikoutei.d.ts.map +1 -1
- package/dist/api/Hikoutei.js +206 -13
- package/dist/api/Hikoutei.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hikoutei.d.ts","sourceRoot":"","sources":["../../src/api/Hikoutei.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAEL,cAAc,EACd,KAAK,gCAAgC,EACtC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Hikoutei.d.ts","sourceRoot":"","sources":["../../src/api/Hikoutei.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAEL,cAAc,EACd,KAAK,gCAAgC,EACtC,MAAM,aAAa,CAAC;AAuBrB,sDAAsD;AACtD,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;CAC/C;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,EAAE,aAAa,CAAC;IAC3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AA+QD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,+BAA+B,EACzC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,gCAAgC,CAAC,EAClE,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAChC,QAAQ,CAEV;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAe,GAC9D,MAAM,CAMR;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAmBlF;AAED;;;;;;;;GAQG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,QAAQ,CAAC,CAkBnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,QAAQ,CAAC,CA8BnB"}
|
package/dist/api/Hikoutei.js
CHANGED
|
@@ -11,16 +11,36 @@ import { createEntityManager } from "./internalEntityManager.js";
|
|
|
11
11
|
import { HIKOUTEI_ERROR_CODES, HikouteiError } from "./errors.js";
|
|
12
12
|
import { getRegisteredEntityTokens, } from "./entity.js";
|
|
13
13
|
import { resolveEntityDescriptors, } from "./internalEntityRegistry.js";
|
|
14
|
+
import { describeErrorForInternalLog, getHikouteiInternalLogger, logHikouteiInternalEvent, } from "../shared/observability/internalLog.js";
|
|
15
|
+
import { HIKOUTEI_LOG_COMPONENTS, HIKOUTEI_LOG_EVENTS, } from "../shared/observability/logEvents.js";
|
|
16
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
14
17
|
/** Environment variable that supplies the default SQLite path. */
|
|
15
18
|
const HIKOUTEI_DB_PATH_ENV = "HIKOUTEI_DB_PATH";
|
|
16
19
|
/** SQLite path used when neither `dbName` nor the env var is set. */
|
|
17
20
|
const DEFAULT_DB_PATH = "./hikoutei.sqlite";
|
|
21
|
+
const beforeCloseHookContext = new AsyncLocalStorage();
|
|
18
22
|
class HikouteiImpl {
|
|
19
23
|
provider;
|
|
20
24
|
beforeClose;
|
|
21
25
|
/** Root entity manager; call `fork()` before request or job-local work. */
|
|
22
26
|
em;
|
|
23
|
-
|
|
27
|
+
closeState = "open";
|
|
28
|
+
/**
|
|
29
|
+
* The single in-flight close attempt. Concurrent close() calls OUTSIDE
|
|
30
|
+
* the active beforeClose hook await this same promise, so cleanup runs
|
|
31
|
+
* exactly once per attempt and every caller observes the same outcome
|
|
32
|
+
* (single-flight). The shared promise represents the FULL close +
|
|
33
|
+
* process-logger-drain operation and settles only AFTER the drain
|
|
34
|
+
* completes (final safe step), so a close() that lands while the first
|
|
35
|
+
* attempt is still draining — including one arriving after
|
|
36
|
+
* performClose() succeeded but before the drain finished — awaits the
|
|
37
|
+
* SAME attempt until the drain is done instead of resolving early on
|
|
38
|
+
* the terminal marker or starting a second cleanup. A close() called
|
|
39
|
+
* from WITHIN the hook resolves immediately instead (MEDIUM 5:
|
|
40
|
+
* awaiting the pending attempt from the hook would self-deadlock). A
|
|
41
|
+
* failed attempt leaves the runtime retryable after the slot release.
|
|
42
|
+
*/
|
|
43
|
+
closeAttempt;
|
|
24
44
|
constructor(provider, descriptors, beforeClose) {
|
|
25
45
|
this.provider = provider;
|
|
26
46
|
this.beforeClose = beforeClose;
|
|
@@ -28,27 +48,200 @@ class HikouteiImpl {
|
|
|
28
48
|
}
|
|
29
49
|
/** Stops internal service work, then releases the local SQLite connection. */
|
|
30
50
|
async close() {
|
|
31
|
-
|
|
51
|
+
// Concurrent callers share the single in-flight attempt. This check
|
|
52
|
+
// comes BEFORE the terminal fast path so a caller that arrives after
|
|
53
|
+
// performClose() succeeded but while the final logger drain is still
|
|
54
|
+
// running awaits the SAME attempt (which settles only after drain)
|
|
55
|
+
// instead of resolving early on the closed marker — the shared
|
|
56
|
+
// promise represents the full close + drain operation.
|
|
57
|
+
if (this.closeAttempt !== undefined) {
|
|
58
|
+
// MEDIUM 5: a close awaited from within the ACTIVE beforeClose hook
|
|
59
|
+
// of THIS runtime must not await the pending attempt — the attempt
|
|
60
|
+
// cannot settle until the hook returns, so awaiting it would
|
|
61
|
+
// self-deadlock. The call resolves immediately: the close is already
|
|
62
|
+
// in progress and owned by the outer caller, so the hook must not
|
|
63
|
+
// rely on the reentrant promise for completion. The exemption is
|
|
64
|
+
// scoped to the OWNING runtime (runtime identity in the context) AND
|
|
65
|
+
// to the hook's execution window (`active`): a close() on a
|
|
66
|
+
// DIFFERENT runtime made from inside the hook, or a close() from a
|
|
67
|
+
// DETACHED callback (setImmediate/promise continuation) that runs
|
|
68
|
+
// AFTER the hook's execution window ended, is an ordinary concurrent
|
|
69
|
+
// call and shares that runtime's in-flight attempt, observing its
|
|
70
|
+
// exact outcome (Luna: the flag is cleared in `finally`, so the
|
|
71
|
+
// detached callback cannot bypass the close/drain attempt). Callers
|
|
72
|
+
// OUTSIDE any hook (no context store) keep sharing the attempt too.
|
|
73
|
+
const marker = beforeCloseHookContext.getStore();
|
|
74
|
+
if (marker !== undefined && marker.runtime === this && marker.active) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
return this.closeAttempt;
|
|
78
|
+
}
|
|
79
|
+
// A successful close is terminal and idempotent: later calls resolve
|
|
80
|
+
// immediately without touching the provider again.
|
|
81
|
+
if (this.closeState === "closed")
|
|
32
82
|
return;
|
|
33
|
-
|
|
34
|
-
|
|
83
|
+
let settleAttempt = () => { };
|
|
84
|
+
const attempt = new Promise((resolve, reject) => {
|
|
85
|
+
settleAttempt = (outcome) => {
|
|
86
|
+
if (outcome.ok)
|
|
87
|
+
resolve();
|
|
88
|
+
else
|
|
89
|
+
reject(outcome.error);
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
this.closeAttempt = attempt;
|
|
93
|
+
// The shared attempt is observed by concurrent callers outside the
|
|
94
|
+
// hook; when none exists, a failed attempt must not surface as an
|
|
95
|
+
// unhandled rejection. The no-op side handler marks the rejection
|
|
96
|
+
// handled for the runtime while those callers still receive the
|
|
97
|
+
// original rejection.
|
|
98
|
+
attempt.catch(() => undefined);
|
|
99
|
+
// The attempt's outcome is decided ONLY after the process logger
|
|
100
|
+
// drain completes (final safe step): the shared promise represents
|
|
101
|
+
// the full close + drain operation, so a concurrent caller awaiting
|
|
102
|
+
// it (including one that arrived while the drain was running) cannot
|
|
103
|
+
// proceed before every final event is on disk.
|
|
104
|
+
let failed = false;
|
|
105
|
+
let failure;
|
|
35
106
|
try {
|
|
36
|
-
await this.
|
|
107
|
+
await this.performClose();
|
|
37
108
|
}
|
|
38
109
|
catch (error) {
|
|
39
|
-
|
|
110
|
+
// Boolean flag, never `error !== undefined`: a hook or provider
|
|
111
|
+
// that throws `undefined` is still a FAILED attempt and the shared
|
|
112
|
+
// promise must reject, never resolve.
|
|
113
|
+
failed = true;
|
|
114
|
+
failure = error;
|
|
40
115
|
}
|
|
41
116
|
try {
|
|
42
|
-
|
|
117
|
+
// The soak collector reads the log file immediately after close();
|
|
118
|
+
// drain the process logger queue so every final event (including
|
|
119
|
+
// RUNTIME_CLOSED and any close-failure line) is on disk before the
|
|
120
|
+
// attempt settles. Drain is fail-open by contract, and even a
|
|
121
|
+
// throwing drain must never mask the close outcome — it is
|
|
122
|
+
// swallowed, never propagated.
|
|
123
|
+
await getHikouteiInternalLogger().drain();
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
// Fail-open: the drain exists to flush diagnostics, so its failure
|
|
127
|
+
// must not change the close outcome decided above.
|
|
128
|
+
}
|
|
129
|
+
// Settle the shared attempt with the ORIGINAL outcome so every
|
|
130
|
+
// concurrent caller observes exactly the same success or failure.
|
|
131
|
+
if (failed) {
|
|
132
|
+
settleAttempt({ ok: false, error: failure });
|
|
43
133
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
134
|
+
else {
|
|
135
|
+
settleAttempt({ ok: true });
|
|
136
|
+
}
|
|
137
|
+
// Release the shared slot only after the attempt settled (final safe
|
|
138
|
+
// step). On success performClose() made the close terminal; on
|
|
139
|
+
// failure performClose() already returned the state to retryable
|
|
140
|
+
// "open", so the NEXT close() call after the slot release genuinely
|
|
141
|
+
// re-runs the cleanup. The original failure is rethrown unchanged to
|
|
142
|
+
// THIS caller after the slot release; concurrent callers already
|
|
143
|
+
// received it through the shared attempt.
|
|
144
|
+
this.closeAttempt = undefined;
|
|
145
|
+
if (failed)
|
|
146
|
+
throw failure;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Runs one full cleanup attempt (beforeClose + provider close).
|
|
150
|
+
*
|
|
151
|
+
* Marks the runtime terminally closed ONLY after the provider close
|
|
152
|
+
* succeeded. EVERY failure — a throwing beforeClose hook, a throwing
|
|
153
|
+
* provider close, or the aggregate of both — explicitly returns the
|
|
154
|
+
* state to retryable `open` before the original error is rethrown
|
|
155
|
+
* unchanged, so the next close() call genuinely re-runs the full
|
|
156
|
+
* cleanup instead of no-oping on a half-closed runtime.
|
|
157
|
+
*/
|
|
158
|
+
async performClose() {
|
|
159
|
+
this.closeState = "closing";
|
|
160
|
+
try {
|
|
161
|
+
let beforeCloseFailed = false;
|
|
162
|
+
let beforeCloseError;
|
|
163
|
+
try {
|
|
164
|
+
const beforeClose = this.beforeClose;
|
|
165
|
+
if (beforeClose !== undefined) {
|
|
166
|
+
// MEDIUM 5: the hook runs inside the marked async context so a
|
|
167
|
+
// close() called from within it is recognized as reentrant for
|
|
168
|
+
// THIS runtime (and never awaits its own pending attempt). The
|
|
169
|
+
// stored runtime identity scopes the exemption: a cross-runtime
|
|
170
|
+
// close() made from the hook is not reentrant.
|
|
171
|
+
//
|
|
172
|
+
// Luna: the exemption is scoped to the hook's EXECUTION WINDOW.
|
|
173
|
+
// Detached setImmediate/promise callbacks scheduled by the hook
|
|
174
|
+
// retain the AsyncLocalStorage store after run() returns, so the
|
|
175
|
+
// active flag is cleared in `finally` once the hook's execution
|
|
176
|
+
// has ended — those callbacks' close() then awaits the same
|
|
177
|
+
// close/drain attempt instead of bypassing it. The flag is
|
|
178
|
+
// cleared even when the hook throws.
|
|
179
|
+
const marker = { runtime: this, active: true };
|
|
180
|
+
try {
|
|
181
|
+
await beforeCloseHookContext.run(marker, () => beforeClose());
|
|
182
|
+
}
|
|
183
|
+
finally {
|
|
184
|
+
marker.active = false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
47
187
|
}
|
|
48
|
-
|
|
188
|
+
catch (error) {
|
|
189
|
+
// Boolean flag, never `error !== undefined`: a hook that throws
|
|
190
|
+
// `undefined` is still a FAILED hook and must keep the attempt
|
|
191
|
+
// failed and retryable instead of being treated as success.
|
|
192
|
+
beforeCloseFailed = true;
|
|
193
|
+
beforeCloseError = error;
|
|
194
|
+
}
|
|
195
|
+
try {
|
|
196
|
+
await this.provider.close();
|
|
197
|
+
}
|
|
198
|
+
catch (providerError) {
|
|
199
|
+
logHikouteiInternalEvent({
|
|
200
|
+
event: HIKOUTEI_LOG_EVENTS.RUNTIME_CLOSE_FAILED,
|
|
201
|
+
level: "error",
|
|
202
|
+
component: HIKOUTEI_LOG_COMPONENTS.RUNTIME,
|
|
203
|
+
...describeErrorForInternalLog(providerError),
|
|
204
|
+
});
|
|
205
|
+
if (beforeCloseFailed) {
|
|
206
|
+
// Luna: the AggregateError preserves BOTH original failure
|
|
207
|
+
// values as-thrown — including a hook that throws `undefined`
|
|
208
|
+
// or `null`, which are legitimate thrown values. The errors
|
|
209
|
+
// array must never replace the original hook failure with a
|
|
210
|
+
// synthetic Error, so diagnostics can always inspect exactly
|
|
211
|
+
// what each stage threw.
|
|
212
|
+
throw new AggregateError([beforeCloseError, providerError], "Hikoutei failed to stop internal work and close SQLite.");
|
|
213
|
+
}
|
|
214
|
+
throw providerError;
|
|
215
|
+
}
|
|
216
|
+
if (beforeCloseFailed) {
|
|
217
|
+
logHikouteiInternalEvent({
|
|
218
|
+
event: HIKOUTEI_LOG_EVENTS.RUNTIME_CLOSE_FAILED,
|
|
219
|
+
level: "error",
|
|
220
|
+
component: HIKOUTEI_LOG_COMPONENTS.RUNTIME,
|
|
221
|
+
...describeErrorForInternalLog(beforeCloseError),
|
|
222
|
+
});
|
|
223
|
+
// `throw beforeCloseError` is intentional: `undefined` is a
|
|
224
|
+
// legitimate thrown value and the rejection still marks the
|
|
225
|
+
// attempt failed (the caller's catch below returns the state to
|
|
226
|
+
// retryable open).
|
|
227
|
+
throw beforeCloseError;
|
|
228
|
+
}
|
|
229
|
+
this.closeState = "closed";
|
|
230
|
+
logHikouteiInternalEvent({
|
|
231
|
+
event: HIKOUTEI_LOG_EVENTS.RUNTIME_CLOSED,
|
|
232
|
+
level: "info",
|
|
233
|
+
component: HIKOUTEI_LOG_COMPONENTS.RUNTIME,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
// Explicit state transition for EVERY failure path (beforeClose or
|
|
238
|
+
// provider): the runtime returns to retryable `open` so the next
|
|
239
|
+
// close() re-runs the cleanup. The original error is rethrown
|
|
240
|
+
// unchanged; the shared-attempt slot was already released by the
|
|
241
|
+
// caller's finally block.
|
|
242
|
+
this.closeState = "open";
|
|
243
|
+
throw error;
|
|
49
244
|
}
|
|
50
|
-
if (beforeCloseError !== undefined)
|
|
51
|
-
throw beforeCloseError;
|
|
52
245
|
}
|
|
53
246
|
}
|
|
54
247
|
/**
|
package/dist/api/Hikoutei.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hikoutei.js","sourceRoot":"","sources":["../../src/api/Hikoutei.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EACL,yBAAyB,GAG1B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,wBAAwB,GAEzB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"Hikoutei.js","sourceRoot":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C,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,eAAe;YAClB,MAAM,IAAI,aAAa,CACrB,oBAAoB,CAAC,yBAAyB,EAC9C,gFAAgF,CACjF,CAAC;QACJ,KAAK,gBAAgB;YACnB,MAAM,IAAI,aAAa,CACrB,oBAAoB,CAAC,gBAAgB,EACrC,gBAAgB,OAAO,CAAC,UAAU,iCAAiC,CACpE,CAAC;QACJ,KAAK,iBAAiB;YACpB,MAAM,IAAI,aAAa,CACrB,oBAAoB,CAAC,gBAAgB,EACrC,UAAU,OAAO,CAAC,SAAS,4BAA4B,OAAO,CAAC,eAAe,UAAU,OAAO,CAAC,gBAAgB,IAAI,CACrH,CAAC;IACN,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hikoutei",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.40",
|
|
4
4
|
"description": "Typed repository and safe write layer for Google Sheets-backed MVPs. SQLite-authoritative entity lifecycle with asynchronous Google Sheets projection.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|