@hasna/mementos 0.14.88 → 0.15.2

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 (77) hide show
  1. package/README.md +44 -9
  2. package/bun.lock +4 -65
  3. package/dist/cli/commands/info-history.d.ts.map +1 -1
  4. package/dist/cli/commands/info-stale.d.ts.map +1 -1
  5. package/dist/cli/commands/io-export.d.ts.map +1 -1
  6. package/dist/cli/commands/memory-cmd-chain.d.ts.map +1 -1
  7. package/dist/cli/commands/memory-cmd-crud.d.ts.map +1 -1
  8. package/dist/cli/commands/memory-cmd-recall.d.ts.map +1 -1
  9. package/dist/cli/commands/memory-cmd-search.d.ts.map +1 -1
  10. package/dist/cli/commands/memory-cmd-tail.d.ts.map +1 -1
  11. package/dist/cli/commands/memory-cmd-view.d.ts.map +1 -1
  12. package/dist/cli/commands/memory-cmd-when-to-use.d.ts.map +1 -1
  13. package/dist/cli/commands/storage.d.ts.map +1 -1
  14. package/dist/cli/commands/system-doctor.d.ts.map +1 -1
  15. package/dist/cli/commands/system-status.d.ts +43 -0
  16. package/dist/cli/commands/system-status.d.ts.map +1 -0
  17. package/dist/cli/commands/system.d.ts.map +1 -1
  18. package/dist/cli/helpers.d.ts.map +1 -1
  19. package/dist/cli/index.js +3397 -1954
  20. package/dist/cli/register-all.d.ts +1 -1
  21. package/dist/cli/register-all.d.ts.map +1 -1
  22. package/dist/db/api-mode.d.ts +135 -37
  23. package/dist/db/api-mode.d.ts.map +1 -1
  24. package/dist/db/database.d.ts.map +1 -1
  25. package/dist/db/memories.d.ts.map +1 -1
  26. package/dist/db/store-backend.d.ts +8 -2
  27. package/dist/db/store-backend.d.ts.map +1 -1
  28. package/dist/diagnostics/historical-project-registration-receipt.js +85 -50
  29. package/dist/generated/storage-kit/backend.d.ts +12 -2
  30. package/dist/generated/storage-kit/backend.d.ts.map +1 -1
  31. package/dist/generated/storage-kit/index.d.ts +1 -1
  32. package/dist/generated/storage-kit/index.d.ts.map +1 -1
  33. package/dist/generated/storage-kit/migrations.d.ts +21 -0
  34. package/dist/generated/storage-kit/migrations.d.ts.map +1 -1
  35. package/dist/generated/storage-kit/pool.d.ts +2 -5
  36. package/dist/generated/storage-kit/pool.d.ts.map +1 -1
  37. package/dist/generated/storage-kit/query.d.ts +1 -1
  38. package/dist/generated/storage-kit/query.d.ts.map +1 -1
  39. package/dist/index.d.ts +0 -1
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +2811 -1285
  42. package/dist/lib/config.d.ts.map +1 -1
  43. package/dist/lib/env.d.ts +10 -0
  44. package/dist/lib/env.d.ts.map +1 -0
  45. package/dist/lib/gatherer.d.ts.map +1 -1
  46. package/dist/lib/local-opt-in.d.ts +114 -0
  47. package/dist/lib/local-opt-in.d.ts.map +1 -0
  48. package/dist/lib/paths.d.ts +9 -0
  49. package/dist/lib/paths.d.ts.map +1 -1
  50. package/dist/lib/redact.d.ts +70 -10
  51. package/dist/lib/redact.d.ts.map +1 -1
  52. package/dist/lib/reflection.d.ts.map +1 -1
  53. package/dist/mcp/index.d.ts.map +1 -1
  54. package/dist/mcp/index.js +2856 -1291
  55. package/dist/project-registration.js +273 -185
  56. package/dist/sdk/index.d.ts +173 -8
  57. package/dist/sdk/index.d.ts.map +1 -1
  58. package/dist/sdk/index.js +953 -12
  59. package/dist/server/auth.d.ts +2 -0
  60. package/dist/server/auth.d.ts.map +1 -1
  61. package/dist/server/helpers.d.ts +21 -7
  62. package/dist/server/helpers.d.ts.map +1 -1
  63. package/dist/server/index.d.ts.map +1 -1
  64. package/dist/server/index.js +2855 -1351
  65. package/dist/storage.d.ts.map +1 -1
  66. package/dist/storage.js +78 -129
  67. package/dist/test-support/store-isolation.d.ts +50 -11
  68. package/dist/test-support/store-isolation.d.ts.map +1 -1
  69. package/docker-entrypoint.sh +7 -0
  70. package/hasna.contract.json +17 -5
  71. package/package.json +5 -7
  72. package/postinstall.mjs +52 -1
  73. package/dashboard/bun.lock +0 -519
  74. package/dist/cli/brains.d.ts +0 -3
  75. package/dist/cli/brains.d.ts.map +0 -1
  76. package/dist/lib/retired-storage-mode.d.ts +0 -11
  77. package/dist/lib/retired-storage-mode.d.ts.map +0 -1
@@ -8,7 +8,7 @@ import type { Command } from "commander";
8
8
  * one that ships.
9
9
  *
10
10
  * That drift was real: the guard originally re-listed 11 groups by hand while
11
- * the CLI wired 15 sources, leaving `init`, `project-panel`, `brains` and the
11
+ * the CLI wired 15 sources, leaving `init`, `project-panel` and the
12
12
  * `@hasna/events` groups (`events`, `webhooks`) unwalked. Seven live `-j`
13
13
  * collisions sat in that blind spot while the guard reported clean. Adding a
14
14
  * command group here is now the only step required for it to be covered.
@@ -1 +1 @@
1
- {"version":3,"file":"register-all.d.ts","sourceRoot":"","sources":["../../src/cli/register-all.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAiB7D"}
1
+ {"version":3,"file":"register-all.d.ts","sourceRoot":"","sources":["../../src/cli/register-all.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAgB7D"}
@@ -2,15 +2,26 @@ export interface ApiConfig {
2
2
  baseUrl: string;
3
3
  apiKey: string;
4
4
  }
5
- export declare const API_URL_ENV_KEYS: readonly ["HASNA_MEMENTOS_API_URL", "MEMENTOS_API_URL"];
6
- export declare const API_KEY_ENV_KEYS: readonly ["HASNA_MEMENTOS_API_KEY", "MEMENTOS_API_KEY"];
5
+ /** Tier-1 credential inputs (explicit key/profile, keychain runner for tests). */
6
+ export interface MementosClientResolveOptions {
7
+ credentials?: import("@hasna/contracts/client").CredentialChainOptions;
8
+ }
9
+ /** The env keys that select the API transport, resolver-derived, canonical first. */
10
+ export declare const API_URL_ENV_KEYS: readonly [string, string];
11
+ export declare const API_KEY_ENV_KEYS: readonly [string, string];
12
+ /** The env keys that select the server postgresql backend (and disable client API mode). */
7
13
  export declare const DATABASE_URL_ENV_KEYS: readonly ["HASNA_MEMENTOS_DATABASE_URL", "MEMENTOS_DATABASE_URL"];
14
+ /** The explicit local SQLite path — the precedence-1 local opt-in. */
15
+ export declare const DB_PATH_ENV_KEYS: readonly ["HASNA_MEMENTOS_DB_PATH", "MEMENTOS_DB_PATH"];
16
+ type Env = Record<string, string | undefined>;
8
17
  /**
9
18
  * Which env keys currently select API mode, by name only — never the values.
10
19
  * Used by the operator-facing mode report so a human can see *why* the client
11
- * is pointed at the cloud without reading source or echoing a credential.
20
+ * is pointed at the cloud without reading source or echoing a credential. The
21
+ * API key is read from the resolver's own key list, so a tier that moves
22
+ * cannot drift out of this report.
12
23
  */
13
- export declare function getApiModeEnvSources(): {
24
+ export declare function getApiModeEnvSources(env?: Env): {
14
25
  urlKey: string | null;
15
26
  keyKey: string | null;
16
27
  databaseUrlKey: string | null;
@@ -25,9 +36,16 @@ export declare function getApiModeEnvSources(): {
25
36
  * merely outranked, which points them at a credential problem they do not have.
26
37
  *
27
38
  * Never returns a credential value — the endpoint is not secret, the key is
28
- * reported only as a boolean.
39
+ * reported only as a boolean. `apiKeyPresent` is answered through the resolver
40
+ * chain (any tier: env, Keychain, credentials file), because the Keychain and
41
+ * disk tiers are ambient and an env-only read would report "absent" on the
42
+ * very stations the resolver serves most.
43
+ *
44
+ * A malformed configured base THROWS (fail closed: a misconfigured endpoint
45
+ * must fail closed, exactly like a half-configured credential pair does), with
46
+ * the resolver's own message and never the raw value.
29
47
  */
30
- export declare function getConfiguredApiEnv(): {
48
+ export declare function getConfiguredApiEnv(env?: Env, options?: MementosClientResolveOptions): {
31
49
  baseUrl: string | null;
32
50
  apiKeyPresent: boolean;
33
51
  dbPathKey: string | null;
@@ -38,14 +56,61 @@ export declare function getConfiguredApiEnv(): {
38
56
  * is silent and lands in a shared store.
39
57
  */
40
58
  export declare const ALLOW_REMOTE_API_IN_TESTS_ENV = "MEMENTOS_ALLOW_REMOTE_API_IN_TESTS";
41
- /** Resolve the API client config from env, or `null` when not configured. */
42
- /** The env keys that explicitly select the local SQLite store. */
43
- export declare const DB_PATH_ENV_KEYS: readonly ["HASNA_MEMENTOS_DB_PATH", "MEMENTOS_DB_PATH"];
44
59
  /** Raised when the environment does not unambiguously select one store. */
45
60
  export declare class MementosStoreConfigError extends Error {
46
61
  readonly code = "MEMENTOS_STORE_CONFIG";
47
62
  constructor(message: string);
48
63
  }
64
+ /**
65
+ * Resolve the API client configuration through the @hasna/contracts chain, or
66
+ * return `null` when the environment selects the on-box store or configures
67
+ * nothing at all.
68
+ *
69
+ * EVERY CALL RESOLVES FRESH: the Keychain and the credentials file are
70
+ * re-read per request, so a key rotation heals a long-lived shell or MCP
71
+ * server without a restart. Deliberately a single pass down the chain (one
72
+ * credential resolution, once), with the resolved value handed back to the
73
+ * transport as its tier-1 argument so the authority pass never re-reads the
74
+ * tiers — and so the key that validated the authority is the key the request
75
+ * sends (no TOCTOU between two reads).
76
+ *
77
+ * Refusals — a URL without a credential, blank or disagreeing aliases, an
78
+ * unusable credential file, an invalid authority — THROW as
79
+ * {@link MementosStoreConfigError}. Only "nothing configured anywhere" (no
80
+ * env pointer, no Keychain item, no credentials file) returns null, and the
81
+ * fail-closed gate {@link assertClientStoreConfigured} refuses THAT at every
82
+ * store entry point: a null here is never permission to open the on-box
83
+ * default file.
84
+ */
85
+ export declare function getApiConfig(env?: Env, options?: MementosClientResolveOptions): ApiConfig | null;
86
+ /**
87
+ * True when the client should route memory operations to the cloud API.
88
+ * Fail-closed against a client-side DSN: if DATABASE_URL is present, API mode
89
+ * refuses to engage so the two transports never mix.
90
+ */
91
+ export declare function isApiMode(): boolean;
92
+ /** WHERE the API transport came from, for operator reports. Never a value. */
93
+ export interface ResolvedApiModeReport {
94
+ /** The resolved `<origin>/v1` authority this client would send to. */
95
+ baseUrl: string;
96
+ /** An env key NAME, a Keychain item reference, a file PATH, or `"default"`. */
97
+ apiUrlSource: string | null;
98
+ /** An env key NAME, a Keychain item reference, or a file PATH. Never a value. */
99
+ apiKeySource: string | null;
100
+ /** The tier of the credential chain that supplied the key. */
101
+ apiKeyTier: string | null;
102
+ }
103
+ /**
104
+ * Resolve WHERE the client transport came from, without exposing the key.
105
+ *
106
+ * One pass down the @hasna/contracts chain, used by the operator-facing mode
107
+ * report (`storage mode`) so a human can see *why* the client is pointed at
108
+ * the cloud — an env key name, a Keychain item reference, a credentials-file
109
+ * path, or the fleet gateway default. `null` when the environment selects the
110
+ * on-box store or configures nothing at all; refusals throw exactly as
111
+ * {@link getApiConfig} does.
112
+ */
113
+ export declare function getResolvedApiModeReport(env?: Env, options?: MementosClientResolveOptions): ResolvedApiModeReport | null;
49
114
  /**
50
115
  * Throw unless the environment unambiguously selects one store.
51
116
  *
@@ -58,41 +123,73 @@ export declare class MementosStoreConfigError extends Error {
58
123
  * THIS FUNCTION ONLY ASSERTS. It returns `void`, so it cannot select anything —
59
124
  * the precedence table below describes the RESOLVER, which is `getApiConfig()`
60
125
  * immediately after it, and each early `return` here only suppresses the
61
- * ambiguity error for a case that is already unambiguous. Steps 1 and 2 are
62
- * therefore implemented in `getApiConfig()` and `isApiMode()` respectively, and
63
- * the table is documented here because this is where the error text lives.
64
- *
65
- * Keeping the table honest about that is not cosmetic. Until 2026-08-03 step 1
66
- * was implemented NOWHERE: the `return` below reads as a selection, and an
67
- * operator who read it concluded that a scratch DB_PATH made them safe while a
68
- * fully-configured environment still routed every read and write to the shared
69
- * production store.
126
+ * ambiguity error for a case that is already unambiguous. The SELECTION is
127
+ * implemented in `getApiConfig()` / `isApiMode()`; the table is documented here
128
+ * because this is where the error text lives.
70
129
  *
71
130
  * Precedence, highest first:
72
- * 0. A retired storage-mode variable (HASNA_MEMENTOS_STORAGE_MODE or any of
73
- * its aliases) throws via `assertNoLegacyStorageMode`, even when blank.
74
- * Deployment modes no longer exist; a stale variable is an error, never a
75
- * selector. ENFORCED HERE, before anything else.
76
131
  * 1. An explicit SQLite path (`HASNA_MEMENTOS_DB_PATH` / `MEMENTOS_DB_PATH`) is
77
- * the narrowest, most specific signal and selects LOCAL, so local dev,
78
- * tooling and import/export keep working when a stray credential is exported
79
- * globally. ENFORCED in `getApiConfig()`, which returns null for it.
80
- * 2. A client DSN present disables API mode. ENFORCED in `isApiMode()`. A DSN
81
- * on a client is forbidden and is tracked separately in database.ts.
82
- * 3. Both API URL and API key present -> API mode.
83
- * 4. Exactly ONE of them present -> ERROR naming the missing variable.
84
- * 5. Neither present -> LOCAL. The documented single-operator default.
132
+ * the narrowest, most specific signal and selects LOCAL before the resolver
133
+ * is even consulted, so local dev, tooling and import/export keep working
134
+ * when a credential is exported globally. (`MEMENTOS_DB_PATH`'s precedence
135
+ * over a COMPLETE API pair is the package's documented precedence-1 rule
136
+ * since 2026-08-03.)
137
+ * 2. A client DSN present disables API mode. A DSN on a client is forbidden
138
+ * and is tracked separately in database.ts.
139
+ * 3. The @hasna/contracts resolve — everything else. A URL without a
140
+ * resolvable credential, a blank or disagreeing pair, an unusable
141
+ * credential file, or an invalid authority THROWS here; a credential with
142
+ * no URL resolves to the fleet gateway (complete configuration).
143
+ * 4. Nothing configured anywhere -> no transport selected. This used to
144
+ * resolve to LOCAL (the "documented single-operator default"); since the
145
+ * 2026-09-04 fail-closed ruling a client that needs the store REFUSES
146
+ * instead — an explicit opt-in (`HASNA_MEMENTOS_DB_PATH` or
147
+ * `HASNA_MEMENTOS_LOCAL=1`) is now the only way into the on-box SQLite
148
+ * store, and `assertClientStoreConfigured()` (below) enforces that at
149
+ * every entry point that would otherwise open the default local file.
85
150
  *
86
- * Never reads, logs, or embeds a credential value — only variable NAMES.
151
+ * Never reads, logs, or embeds a credential value — only variable NAMES and
152
+ * tier descriptions.
87
153
  */
88
- export declare function assertUnambiguousStoreEnv(env?: NodeJS.ProcessEnv): void;
89
- export declare function getApiConfig(): ApiConfig | null;
154
+ export declare function assertUnambiguousStoreEnv(env?: Env, options?: MementosClientResolveOptions): void;
90
155
  /**
91
- * True when the client should route memory operations to the cloud API.
92
- * Fail-closed against a client-side DSN: if DATABASE_URL is present, API mode
93
- * refuses to engage so the two transports never mix.
156
+ * FAIL-CLOSED store gate (owner ruling 2026-09-04, fleet fail-closed wave).
157
+ *
158
+ * The transport rules above answer "which store is configured?" and treat
159
+ * "none" as a question, not an answer: `isApiMode()` returns false and
160
+ * `getApiConfig()` returns null, and every domain call site reads that as
161
+ * "open the local store". That was the defect: a fleet CLI run WITHOUT a
162
+ * credential silently opened the default on-box SQLite store
163
+ * (~/.hasna/mementos/mementos.db), served it as if it were the memory store,
164
+ * and exited 0 — a false green against a different dataset.
165
+ *
166
+ * This function is the guard every store-access entry point calls BEFORE it
167
+ * may open the default local file (CLI command startup, `getDatabase()`
168
+ * default-path fallthrough, ...). It throws unless one of these is true:
169
+ *
170
+ * - an explicit SQLite path is set (`HASNA_MEMENTOS_DB_PATH` /
171
+ * `MEMENTOS_DB_PATH`) — the documented EXPLICIT LOCAL OPT-IN, or
172
+ * - the deliberate flag opt-in (`HASNA_MEMENTOS_LOCAL=1` / `MEMENTOS_LOCAL=1`)
173
+ * with no authority or credential configured — answered BEFORE the
174
+ * resolver runs, so a local run reads no Keychain item and no credential
175
+ * file, or
176
+ * - a client DSN is present (its own server-only guard already fails closed
177
+ * in getDatabase; the DSN tier is untouched here), or
178
+ * - the @hasna/contracts chain resolves a credential (fleet API mode —
179
+ * authority included, defaulting to the fleet gateway).
180
+ *
181
+ * Anything else — no credential, no opt-in — is a REFUSAL, never a local
182
+ * default. Never reads, logs, or embeds a credential value — only variable
183
+ * NAMES and tier descriptions.
94
184
  */
95
- export declare function isApiMode(): boolean;
185
+ export declare function assertClientStoreConfigured(env?: Env, options?: MementosClientResolveOptions): void;
186
+ /**
187
+ * The one-line refusal every surface prints when NOTHING resolves — the tiers
188
+ * consulted and the explicit opt-ins, names only, never a value. Shared with
189
+ * the `storage mode` probe so its `unconfigured` answer and the data verbs'
190
+ * refusal read as one message.
191
+ */
192
+ export declare function unconfiguredStoreMessage(): string;
96
193
  export declare class ApiRequestError extends Error {
97
194
  readonly status: number;
98
195
  readonly body: string;
@@ -124,4 +221,5 @@ export declare function apiJson<T = unknown>(method: string, path: string, body?
124
221
  };
125
222
  /** Build a query string from a filter object (skips undefined/null/empty). */
126
223
  export declare function toQuery(params: Record<string, unknown>): string;
224
+ export {};
127
225
  //# sourceMappingURL=api-mode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-mode.d.ts","sourceRoot":"","sources":["../../src/db/api-mode.ts"],"names":[],"mappings":"AA2CA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AASD,eAAO,MAAM,gBAAgB,yDAA0D,CAAC;AACxF,eAAO,MAAM,gBAAgB,yDAA0D,CAAC;AACxF,eAAO,MAAM,qBAAqB,mEAAoE,CAAC;AAsBvG;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAMtH;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,IAAI;IACrC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAOA;AAED;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,uCAAuC,CAAC;AAyDlF,6EAA6E;AAC7E,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,yDAA0D,CAAC;AAExF,2EAA2E;AAC3E,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,QAAQ,CAAC,IAAI,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1 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,IAAI,QAAQ,EAK1B,MAAM,eAAe,CAAC;AAuDvB,wBAAgB,SAAS,IAAI,MAAM,CA6BlC;AAqDD,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAoGrD;AAgDD,wBAAgB,aAAa,IAAI,IAAI,CASpC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED,wBAAgB,GAAG,IAAI,MAAM,CAE5B;AAED,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AASD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,IAAI,CAuBf"}
1
+ {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,IAAI,QAAQ,EAK1B,MAAM,eAAe,CAAC;AAiEvB,wBAAgB,SAAS,IAAI,MAAM,CA6BlC;AAqDD,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CA+GrD;AAgDD,wBAAgB,aAAa,IAAI,IAAI,CASpC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED,wBAAgB,GAAG,IAAI,MAAM,CAE5B;AAED,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AASD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE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B,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CAuBpE;AAMD,wBAAgB,oBAAoB,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CAqB1D;AAMD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,aAAa,EAAE,CA4BlF;AAMD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAcvG;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACpB,EACN,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAAC,oBAAoB,EAAE,CAAC,CA4DjC"}
@@ -1,11 +1,17 @@
1
1
  /**
2
2
  * The transport that reads and writes will actually use.
3
3
  *
4
- * - `local-sqlite` — the on-disk SQLite file at `db_path` is authoritative.
4
+ * - `local-sqlite` — the on-disk SQLite file at `db_path` is authoritative
5
+ * (reached ONLY through the explicit local opt-in).
5
6
  * - `cloud-api` — authed HTTPS to the server (the shared store).
6
7
  * - `cloud-postgres` — a direct Postgres DSN; server-only, never a client.
8
+ * - `unconfigured` — nothing resolves and nothing opted in: every data verb
9
+ * REFUSES (fail closed, owner ruling 2026-09-04). Reported
10
+ * as its own answer so the probe an operator runs to find
11
+ * out which store they are on never claims the on-box
12
+ * file "by default" while every read and write refuses it.
7
13
  */
8
- export type StoreBackend = "local-sqlite" | "cloud-api" | "cloud-postgres";
14
+ export type StoreBackend = "local-sqlite" | "cloud-api" | "cloud-postgres" | "unconfigured";
9
15
  export interface StoreBackendReport {
10
16
  /** Machine-readable contract for scripts and test guards. */
11
17
  schema: "mementos.store_backend.v1";
@@ -1 +1 @@
1
- {"version":3,"file":"store-backend.d.ts","sourceRoot":"","sources":["../../src/db/store-backend.ts"],"names":[],"mappings":"AAiCA;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IACjC,6DAA6D;IAC7D,MAAM,EAAE,2BAA2B,CAAC;IACpC,OAAO,EAAE,YAAY,CAAC;IACtB,iFAAiF;IACjF,QAAQ,EAAE,OAAO,CAAC;IAClB,qGAAqG;IACrG,cAAc,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,kBAAkB,CAiDxD"}
1
+ {"version":3,"file":"store-backend.d.ts","sourceRoot":"","sources":["../../src/db/store-backend.ts"],"names":[],"mappings":"AA2CA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,WAAW,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAE5F,MAAM,WAAW,kBAAkB;IACjC,6DAA6D;IAC7D,MAAM,EAAE,2BAA2B,CAAC;IACpC,OAAO,EAAE,YAAY,CAAC;IACtB,iFAAiF;IACjF,QAAQ,EAAE,OAAO,CAAC;IAClB,qGAAqG;IACrG,cAAc,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,kBAAkB,CAiExD"}
@@ -8,87 +8,76 @@ import { createHash } from "crypto";
8
8
 
9
9
  // src/storage.ts
10
10
  import { existsSync as existsSync2, mkdirSync, readFileSync, writeFileSync } from "fs";
11
- import { join as join3 } from "path";
11
+ import { join as join2 } from "path";
12
12
  import { fileURLToPath } from "url";
13
13
  import { Worker } from "worker_threads";
14
14
  import pg from "pg";
15
15
 
16
16
  // src/lib/paths.ts
17
17
  import { existsSync } from "fs";
18
- import { homedir as homedir2 } from "os";
19
- import { join as join2, resolve } from "path";
20
-
21
- // ../../node_modules/.bun/@hasna+paths@0.1.0/node_modules/@hasna/paths/dist/index.js
22
18
  import { homedir } from "os";
23
- import { join } from "path";
24
- var KIND_ENV = {
25
- config: "HASNA_CONFIG_HOME",
19
+ import { join, resolve } from "path";
20
+ import { homedir as pathsResolverHomedir } from "os";
21
+ import { join as pathsResolverJoin } from "path";
22
+ var PATHS_RESOLVER_KIND_ENV = {
26
23
  data: "HASNA_DATA_HOME",
27
24
  state: "HASNA_STATE_HOME",
28
25
  cache: "HASNA_CACHE_HOME"
29
26
  };
30
- var APP_SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
31
- function assertApp(app) {
27
+ var PATHS_RESOLVER_APP_SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
28
+ function pathsResolverAssertApp(app) {
32
29
  if (typeof app !== "string" || app.length === 0) {
33
30
  throw new TypeError("paths: app must be a non-empty string");
34
31
  }
35
- if (!APP_SLUG_RE.test(app)) {
32
+ if (!PATHS_RESOLVER_APP_SLUG_RE.test(app)) {
36
33
  throw new TypeError(`paths: invalid app slug "${app}" \u2014 expected lowercase kebab-case ([a-z0-9]+(-[a-z0-9]+)*)`);
37
34
  }
38
35
  }
39
- function envOf(options) {
40
- return options.env ?? process.env;
41
- }
42
- function envValue(options, kind) {
43
- const value = envOf(options)[KIND_ENV[kind]];
44
- return typeof value === "string" && value.length > 0 ? value : undefined;
45
- }
46
- function isMacOS(platform) {
47
- return platform === "darwin";
36
+ function pathsResolverAssertKind(kind) {
37
+ if (!Object.keys(PATHS_RESOLVER_KIND_ENV).includes(kind)) {
38
+ throw new TypeError(`paths: invalid path kind "${kind}" \u2014 expected one of ${Object.keys(PATHS_RESOLVER_KIND_ENV).join(", ")}`);
39
+ }
48
40
  }
49
- function baseDir(kind, options) {
50
- const override = envValue(options, kind);
51
- if (override)
41
+ function pathsResolverBaseDir(kind, options) {
42
+ pathsResolverAssertKind(kind);
43
+ const env = options.env ?? process.env;
44
+ const override = env[PATHS_RESOLVER_KIND_ENV[kind]];
45
+ if (typeof override === "string" && override.length > 0)
52
46
  return override;
53
- const home = options.home ?? homedir();
47
+ const home = options.home ?? pathsResolverHomedir();
54
48
  const platform = options.platform ?? process.platform;
55
- if (isMacOS(platform)) {
49
+ if (platform === "darwin") {
56
50
  switch (kind) {
57
- case "config":
58
51
  case "data":
59
- return join(home, "Library", "Application Support", "Hasna");
52
+ return pathsResolverJoin(home, "Library", "Application Support", "Hasna");
60
53
  case "cache":
61
- return join(home, "Library", "Caches", "Hasna");
54
+ return pathsResolverJoin(home, "Library", "Caches", "Hasna");
62
55
  case "state":
63
- return join(home, "Library", "Logs", "Hasna");
56
+ return pathsResolverJoin(home, "Library", "Logs", "Hasna");
64
57
  }
65
58
  }
66
59
  switch (kind) {
67
- case "config":
68
- return join(home, ".config", "hasna");
69
60
  case "data":
70
- return join(home, ".local", "share", "hasna");
61
+ return pathsResolverJoin(home, ".local", "share", "hasna");
71
62
  case "state":
72
- return join(home, ".local", "state", "hasna");
63
+ return pathsResolverJoin(home, ".local", "state", "hasna");
73
64
  case "cache":
74
- return join(home, ".cache", "hasna");
65
+ return pathsResolverJoin(home, ".cache", "hasna");
75
66
  }
76
67
  }
77
- function resolvePath(kind, options) {
78
- assertApp(options.app);
79
- const appSegment = options.internal === true ? join("internal", options.app) : options.app;
80
- return join(baseDir(kind, options), appSegment);
68
+ function pathsResolverResolve(kind, options) {
69
+ pathsResolverAssertApp(options.app);
70
+ const appSegment = options.internal === true ? pathsResolverJoin("internal", options.app) : options.app;
71
+ return pathsResolverJoin(pathsResolverBaseDir(kind, options), appSegment);
81
72
  }
82
73
  function dataDir(options) {
83
- return resolvePath("data", options);
74
+ return pathsResolverResolve("data", options);
84
75
  }
85
-
86
- // src/lib/paths.ts
87
76
  function effectiveHome() {
88
- return process.env["HOME"] || process.env["USERPROFILE"] || homedir2() || "/tmp";
77
+ return process.env["HOME"] || process.env["USERPROFILE"] || homedir() || "/tmp";
89
78
  }
90
79
  function legacyDataRoot() {
91
- return join2(effectiveHome(), ".hasna", "mementos");
80
+ return join(effectiveHome(), ".hasna", "mementos");
92
81
  }
93
82
  function resolverDataRoot() {
94
83
  return dataDir({
@@ -100,7 +89,7 @@ function adoptResolverDataRoot(resolved, env = process.env) {
100
89
  const dataOverride = env.HASNA_DATA_HOME;
101
90
  if (typeof dataOverride === "string" && dataOverride.trim().length > 0)
102
91
  return true;
103
- return existsSync(join2(resolved, "mementos.db"));
92
+ return existsSync(join(resolved, "mementos.db"));
104
93
  }
105
94
  function exactDataRoot() {
106
95
  for (const key of ["HASNA_MEMENTOS_HOME", "MEMENTOS_HOME"]) {
@@ -118,6 +107,18 @@ function getDataRoot() {
118
107
  return adoptResolverDataRoot(resolved) ? resolve(resolved) : resolve(legacyDataRoot());
119
108
  }
120
109
 
110
+ // src/lib/env.ts
111
+ var alias = (canonical, legacy) => process.env[canonical] ?? process.env[legacy];
112
+ var env = {
113
+ apiKey: () => alias("HASNA_MEMENTOS_API_KEY", "MEMENTOS_API_KEY"),
114
+ defaultScope: () => alias("HASNA_MEMENTOS_DEFAULT_SCOPE", "MEMENTOS_DEFAULT_SCOPE"),
115
+ defaultCategory: () => alias("HASNA_MEMENTOS_DEFAULT_CATEGORY", "MEMENTOS_DEFAULT_CATEGORY"),
116
+ defaultImportance: () => alias("HASNA_MEMENTOS_DEFAULT_IMPORTANCE", "MEMENTOS_DEFAULT_IMPORTANCE"),
117
+ pgsyncQueryTimeoutMs: () => alias("HASNA_MEMENTOS_PGSYNC_QUERY_TIMEOUT_MS", "MEMENTOS_PGSYNC_QUERY_TIMEOUT_MS"),
118
+ reflectProvider: () => alias("HASNA_MEMENTOS_REFLECT_PROVIDER", "MEMENTOS_REFLECT_PROVIDER"),
119
+ reflectModel: () => alias("HASNA_MEMENTOS_REFLECT_MODEL", "MEMENTOS_REFLECT_MODEL")
120
+ };
121
+
121
122
  // src/storage.ts
122
123
  function shouldUsePgSsl(connectionString) {
123
124
  let params;
@@ -163,7 +164,7 @@ class PgSyncPool {
163
164
  generation = 0;
164
165
  static DATA_BYTES = 128 * 1024 * 1024;
165
166
  static queryTimeoutMs() {
166
- const raw = process.env["MEMENTOS_PGSYNC_QUERY_TIMEOUT_MS"]?.trim();
167
+ const raw = env.pgsyncQueryTimeoutMs()?.trim();
167
168
  const parsed = raw ? Number(raw) : Number.NaN;
168
169
  return Number.isFinite(parsed) && parsed > 0 ? parsed : 60000;
169
170
  }
@@ -171,9 +172,9 @@ class PgSyncPool {
171
172
  const ext = import.meta.url.endsWith(".ts") ? ".ts" : ".js";
172
173
  const here = fileURLToPath(new URL(".", import.meta.url));
173
174
  const candidates = [
174
- join3(here, `pg-sync-worker${ext}`),
175
- join3(here, "..", `pg-sync-worker${ext}`),
176
- join3(here, "..", "..", `pg-sync-worker${ext}`)
175
+ join2(here, `pg-sync-worker${ext}`),
176
+ join2(here, "..", `pg-sync-worker${ext}`),
177
+ join2(here, "..", "..", `pg-sync-worker${ext}`)
177
178
  ];
178
179
  for (const candidate of candidates) {
179
180
  if (existsSync2(candidate))
@@ -248,8 +249,8 @@ var MEMENTOS_STORAGE_FALLBACK_ENV = {
248
249
  databaseUrl: "MEMENTOS_DATABASE_URL"
249
250
  };
250
251
  var LOCAL_DATA_DIR = getDataRoot();
251
- var STORAGE_CONFIG_DIR = join3(LOCAL_DATA_DIR, "storage");
252
- var STORAGE_CONFIG_PATH = join3(STORAGE_CONFIG_DIR, "config.json");
252
+ var STORAGE_CONFIG_DIR = join2(LOCAL_DATA_DIR, "storage");
253
+ var STORAGE_CONFIG_PATH = join2(STORAGE_CONFIG_DIR, "config.json");
253
254
  var DATABASE_ENV_NAMES = [
254
255
  { name: MEMENTOS_STORAGE_ENV.databaseUrl, deprecated: false },
255
256
  { name: MEMENTOS_STORAGE_FALLBACK_ENV.databaseUrl, deprecated: false }
@@ -264,6 +265,40 @@ var SECRET_QUERY_PARAMS = new Set([
264
265
  "apikey"
265
266
  ]);
266
267
 
268
+ // ../contracts/dist/client/transport.js
269
+ import { createRequire } from "module";
270
+ function envToken(name) {
271
+ return name.toUpperCase().replace(/-/g, "_");
272
+ }
273
+ function clientTransportEnvKeys(name) {
274
+ const envSegment = envToken(name);
275
+ return {
276
+ apiUrlKeys: [`HASNA_${envSegment}_API_URL`, `${envSegment}_API_URL`],
277
+ apiKeyKeys: [`HASNA_${envSegment}_API_KEY`, `${envSegment}_API_KEY`]
278
+ };
279
+ }
280
+ var MAX_CREDENTIAL_FILE_BYTES = 64 * 1024;
281
+ var INSPECT_CUSTOM = Symbol.for("nodejs.util.inspect.custom");
282
+ var CREDENTIAL_SEAL = Symbol.for("hasna:contracts:sealedCredential");
283
+ var AMBIENT_ENVIRONMENT = Symbol.for("hasna:contracts:ambientClientEnvironment");
284
+ var SECRETS_PACKAGE_SPECIFIER = "@hasna/" + "secrets";
285
+ var requireSecretsSdk = createRequire(import.meta.url);
286
+ var IDEMPOTENT_METHODS = new Set(["GET", "HEAD", "PUT", "DELETE", "OPTIONS"]);
287
+ var AUTHORITY_OVERRIDE_HEADERS = new Set([
288
+ "host",
289
+ ":authority",
290
+ "forwarded",
291
+ "x-forwarded-host",
292
+ "x-original-host"
293
+ ]);
294
+
295
+ // src/lib/local-opt-in.ts
296
+ var CONTRACTS_AMBIENT_ENVIRONMENT = Symbol.for("hasna:contracts:ambientClientEnvironment");
297
+
298
+ // src/db/api-mode.ts
299
+ var API_URL_ENV_KEYS = clientTransportEnvKeys("mementos").apiUrlKeys;
300
+ var API_KEY_ENV_KEYS = clientTransportEnvKeys("mementos").apiKeyKeys;
301
+
267
302
  // src/project-registration/schema.ts
268
303
  function sqliteMementosProjectRegistrationSchemaSql() {
269
304
  return `
@@ -7,14 +7,24 @@ export interface ServerDataBackendEnvKeys {
7
7
  databaseUrlKeys: string[];
8
8
  }
9
9
  export declare function serverDataBackendEnvKeys(name: string): ServerDataBackendEnvKeys;
10
- export declare function assertNoLegacyStorageMode(name: string, env?: Env): void;
11
10
  export interface ServerDataBackendResolution {
12
11
  backend: ServerDataBackend;
13
12
  source: string;
14
13
  databaseUrlPresent: boolean;
15
14
  databaseUrlSource: string | null;
16
15
  }
16
+ /**
17
+ * Resolve the server data backend: `postgresql` when a (canonical-first, see
18
+ * `serverDataBackendEnvKeys`) DSN is configured, `sqlite` otherwise.
19
+ *
20
+ * LOCAL DEVIATION (see the header): the stock 1.0.2 generator requires a
21
+ * validated DSN in every case; mementos's server contract pairs `sqlite` with
22
+ * the ABSENCE of a DSN, so that absence resolves to `sqlite` (source
23
+ * "default"). Validation of the DSN's shape is mementos's own storage-status
24
+ * layer (src/storage.ts), which reports a fail-closed issue list instead of
25
+ * throwing. Retired mode variables are inert and never select anything.
26
+ */
17
27
  export declare function resolveServerDataBackend(name: string, env?: Env): ServerDataBackendResolution;
18
- /** Resolve the database URL without logging it. Returns `null` when unset. */
28
+ /** Resolve the configured database URL without logging it. Returns `null` when unset. */
19
29
  export declare function resolveDatabaseUrl(name: string, env?: Env): string | null;
20
30
  //# sourceMappingURL=backend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/backend.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB,mCAAoC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAErD,sEAAsE;AACtE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAK/E;AA+BD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,GAAiB,GAAG,IAAI,CASpF;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,GAAG,GAAE,GAAiB,GACrB,2BAA2B,CAiB7B;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,GAAiB,GAAG,MAAM,GAAG,IAAI,CAItF"}
1
+ {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/backend.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,oBAAoB,mCAAoC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAErD,sEAAsE;AACtE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAK/E;AAmBD,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,GAAG,GAAE,GAAiB,GACrB,2BAA2B,CAgB7B;AAED,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,GAAiB,GAAG,MAAM,GAAG,IAAI,CAEtF"}
@@ -1,4 +1,4 @@
1
- export declare const KIT_VERSION = "0.10.6";
1
+ export declare const KIT_VERSION = "1.0.2";
2
2
  export * from "./backend.js";
3
3
  export * from "./tls.js";
4
4
  export * from "./query.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
@@ -27,11 +27,32 @@ export declare function checksumSql(sql: string): string;
27
27
  export declare function defineMigration(id: string, sql: string): Migration;
28
28
  export interface MigrationRunnerOptions {
29
29
  ledgerTable?: string;
30
+ /**
31
+ * Applied-ledger rows whose ids the build ACKNOWLEDGES as non-reproducible
32
+ * history: a migration that was applied to the ledger by an out-of-band
33
+ * operation or by a build whose id scheme no longer exists, so no current
34
+ * source can reproduce its id or its SQL.
35
+ *
36
+ * An acknowledged id:
37
+ * - passes the downgrade guard (it IS recognized — as history),
38
+ * - is never checksum-compared (its SQL is gone, so no checksum can be
39
+ * computed for it; storing an arbitrary placeholder in `checksum` is
40
+ * what the prod ledger already holds for such rows),
41
+ * - is never re-applied and never re-inserted (it is already in the
42
+ * ledger; the plan covers declared migrations only).
43
+ *
44
+ * The list is EXPLICIT and OPT-IN: an acknowledged id may not also be a
45
+ * declared migration (enforced at construction), and any OTHER applied row
46
+ * unknown to the build still fails the downgrade guard. Every declared
47
+ * migration keeps its checksum bind unchanged.
48
+ */
49
+ acknowledgedLegacyIds?: readonly string[];
30
50
  }
31
51
  export declare class MigrationLedger {
32
52
  private readonly client;
33
53
  private readonly migrations;
34
54
  private readonly ledgerTable;
55
+ private readonly acknowledgedLegacyIds;
35
56
  constructor(client: TypedQueryClient, migrations: readonly Migration[], options?: MigrationRunnerOptions);
36
57
  ensureLedger(): Promise<void>;
37
58
  listApplied(): Promise<AppliedMigration[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/migrations.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,2EAA2E;AAC3E,eAAO,MAAM,8BAA8B,sBA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