@harperfast/harper 5.2.9 → 5.3.0-alpha.1

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 (668) hide show
  1. package/agent/mcpTools.ts +1 -1
  2. package/agent/session.ts +25 -14
  3. package/bin/cliOperations.ts +46 -9
  4. package/bin/copyDb.ts +282 -59
  5. package/bin/deploySetup.ts +16 -5
  6. package/bin/harper.ts +1 -1
  7. package/bin/help.ts +4 -1
  8. package/bin/lite.ts +4 -1
  9. package/bin/restart.ts +59 -3
  10. package/bin/run.ts +6 -11
  11. package/bin/upgrade.js +7 -3
  12. package/bin/workloadIdentity.ts +119 -0
  13. package/components/Application.ts +2414 -242
  14. package/components/ApplicationScope.ts +8 -0
  15. package/components/EntryHandler.ts +59 -39
  16. package/components/OptionsWatcher.ts +150 -74
  17. package/components/RuntimeModuleTracker.ts +38 -7
  18. package/components/Scope.ts +37 -15
  19. package/components/awaitRestart.ts +84 -0
  20. package/components/componentLoader.ts +340 -30
  21. package/components/componentPreparationLock.ts +16 -5
  22. package/components/mcp/adapters/harperHttp.ts +4 -0
  23. package/components/mcp/listChanged.ts +4 -0
  24. package/components/mcp/toolRegistry.ts +2 -0
  25. package/components/mcp/tools/operations.ts +9 -0
  26. package/components/mcp/tools/schemas/operationDescriptions.ts +2 -2
  27. package/components/operations.js +270 -78
  28. package/components/operationsValidation.js +49 -1
  29. package/components/status/ComponentStatusRegistry.ts +59 -0
  30. package/config/RootConfigWatcher.ts +80 -34
  31. package/config/configUtils.ts +291 -34
  32. package/config/harperConfigEnvVars.ts +170 -27
  33. package/config-root.schema.json +29 -0
  34. package/dataLayer/blobBackup.ts +160 -50
  35. package/dataLayer/delete.ts +6 -1
  36. package/dataLayer/harperBridge/ResourceBridge.ts +52 -8
  37. package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.js +3 -1
  38. package/dataLayer/hdbInfoController.ts +34 -1
  39. package/dataLayer/insert.ts +44 -1
  40. package/dataLayer/rocksdbBackup.ts +53 -10
  41. package/dataLayer/schema.ts +11 -1
  42. package/dataLayer/schemaDescribe.ts +8 -1
  43. package/dist/agent/mcpTools.js +1 -1
  44. package/dist/agent/mcpTools.js.map +1 -1
  45. package/dist/agent/session.d.ts +22 -0
  46. package/dist/agent/session.js +26 -15
  47. package/dist/agent/session.js.map +1 -1
  48. package/dist/bin/cliOperations.js +48 -9
  49. package/dist/bin/cliOperations.js.map +1 -1
  50. package/dist/bin/copyDb.d.ts +12 -1
  51. package/dist/bin/copyDb.js +248 -60
  52. package/dist/bin/copyDb.js.map +1 -1
  53. package/dist/bin/deploySetup.d.ts +2 -0
  54. package/dist/bin/deploySetup.js +11 -3
  55. package/dist/bin/deploySetup.js.map +1 -1
  56. package/dist/bin/harper.js +1 -1
  57. package/dist/bin/harper.js.map +1 -1
  58. package/dist/bin/help.js +4 -1
  59. package/dist/bin/help.js.map +1 -1
  60. package/dist/bin/lite.js +4 -1
  61. package/dist/bin/lite.js.map +1 -1
  62. package/dist/bin/restart.js +54 -5
  63. package/dist/bin/restart.js.map +1 -1
  64. package/dist/bin/run.js +4 -10
  65. package/dist/bin/run.js.map +1 -1
  66. package/dist/bin/upgrade.js +4 -3
  67. package/dist/bin/upgrade.js.map +1 -1
  68. package/dist/bin/workloadIdentity.d.ts +18 -0
  69. package/dist/bin/workloadIdentity.js +100 -0
  70. package/dist/bin/workloadIdentity.js.map +1 -0
  71. package/dist/components/Application.d.ts +139 -16
  72. package/dist/components/Application.js +2215 -267
  73. package/dist/components/Application.js.map +1 -1
  74. package/dist/components/ApplicationScope.d.ts +8 -0
  75. package/dist/components/ApplicationScope.js +7 -0
  76. package/dist/components/ApplicationScope.js.map +1 -1
  77. package/dist/components/EntryHandler.js +26 -10
  78. package/dist/components/EntryHandler.js.map +1 -1
  79. package/dist/components/OptionsWatcher.d.ts +1 -0
  80. package/dist/components/OptionsWatcher.js +141 -74
  81. package/dist/components/OptionsWatcher.js.map +1 -1
  82. package/dist/components/RuntimeModuleTracker.js +40 -6
  83. package/dist/components/RuntimeModuleTracker.js.map +1 -1
  84. package/dist/components/Scope.js +38 -13
  85. package/dist/components/Scope.js.map +1 -1
  86. package/dist/components/awaitRestart.d.ts +33 -0
  87. package/dist/components/awaitRestart.js +61 -0
  88. package/dist/components/awaitRestart.js.map +1 -0
  89. package/dist/components/componentLoader.d.ts +38 -1
  90. package/dist/components/componentLoader.js +279 -22
  91. package/dist/components/componentLoader.js.map +1 -1
  92. package/dist/components/componentPreparationLock.d.ts +5 -0
  93. package/dist/components/componentPreparationLock.js +14 -6
  94. package/dist/components/componentPreparationLock.js.map +1 -1
  95. package/dist/components/mcp/adapters/harperHttp.js +4 -0
  96. package/dist/components/mcp/adapters/harperHttp.js.map +1 -1
  97. package/dist/components/mcp/listChanged.js +5 -0
  98. package/dist/components/mcp/listChanged.js.map +1 -1
  99. package/dist/components/mcp/toolRegistry.d.ts +1 -0
  100. package/dist/components/mcp/toolRegistry.js.map +1 -1
  101. package/dist/components/mcp/tools/operations.d.ts +5 -0
  102. package/dist/components/mcp/tools/operations.js +9 -0
  103. package/dist/components/mcp/tools/operations.js.map +1 -1
  104. package/dist/components/mcp/tools/schemas/operationDescriptions.js +2 -2
  105. package/dist/components/mcp/tools/schemas/operationDescriptions.js.map +1 -1
  106. package/dist/components/operations.js +231 -77
  107. package/dist/components/operations.js.map +1 -1
  108. package/dist/components/operationsValidation.js +49 -1
  109. package/dist/components/operationsValidation.js.map +1 -1
  110. package/dist/components/status/ComponentStatusRegistry.d.ts +0 -4
  111. package/dist/components/status/ComponentStatusRegistry.js +63 -0
  112. package/dist/components/status/ComponentStatusRegistry.js.map +1 -1
  113. package/dist/config/RootConfigWatcher.d.ts +7 -1
  114. package/dist/config/RootConfigWatcher.js +64 -27
  115. package/dist/config/RootConfigWatcher.js.map +1 -1
  116. package/dist/config/configUtils.d.ts +9 -1
  117. package/dist/config/configUtils.js +254 -33
  118. package/dist/config/configUtils.js.map +1 -1
  119. package/dist/config/harperConfigEnvVars.d.ts +16 -0
  120. package/dist/config/harperConfigEnvVars.js +162 -25
  121. package/dist/config/harperConfigEnvVars.js.map +1 -1
  122. package/dist/dataLayer/blobBackup.d.ts +49 -20
  123. package/dist/dataLayer/blobBackup.js +139 -50
  124. package/dist/dataLayer/blobBackup.js.map +1 -1
  125. package/dist/dataLayer/delete.js +1 -1
  126. package/dist/dataLayer/delete.js.map +1 -1
  127. package/dist/dataLayer/harperBridge/ResourceBridge.d.ts +14 -1
  128. package/dist/dataLayer/harperBridge/ResourceBridge.js +51 -10
  129. package/dist/dataLayer/harperBridge/ResourceBridge.js.map +1 -1
  130. package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.d.ts +3 -1
  131. package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.js +3 -1
  132. package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.js.map +1 -1
  133. package/dist/dataLayer/hdbInfoController.d.ts +10 -0
  134. package/dist/dataLayer/hdbInfoController.js +30 -1
  135. package/dist/dataLayer/hdbInfoController.js.map +1 -1
  136. package/dist/dataLayer/insert.d.ts +9 -1
  137. package/dist/dataLayer/insert.js +30 -0
  138. package/dist/dataLayer/insert.js.map +1 -1
  139. package/dist/dataLayer/rocksdbBackup.d.ts +2 -2
  140. package/dist/dataLayer/rocksdbBackup.js +45 -8
  141. package/dist/dataLayer/rocksdbBackup.js.map +1 -1
  142. package/dist/dataLayer/schema.js +8 -0
  143. package/dist/dataLayer/schema.js.map +1 -1
  144. package/dist/dataLayer/schemaDescribe.js +8 -1
  145. package/dist/dataLayer/schemaDescribe.js.map +1 -1
  146. package/dist/index.d.ts +1 -1
  147. package/dist/index.js.map +1 -1
  148. package/dist/json/systemSchema.json +52 -0
  149. package/dist/resources/DatabaseTransaction.d.ts +55 -0
  150. package/dist/resources/DatabaseTransaction.js +459 -45
  151. package/dist/resources/DatabaseTransaction.js.map +1 -1
  152. package/dist/resources/LMDBTransaction.js +22 -4
  153. package/dist/resources/LMDBTransaction.js.map +1 -1
  154. package/dist/resources/PrimaryRocksDatabase.d.ts +1 -0
  155. package/dist/resources/PrimaryRocksDatabase.js +29 -0
  156. package/dist/resources/PrimaryRocksDatabase.js.map +1 -1
  157. package/dist/resources/RecordEncoder.d.ts +20 -0
  158. package/dist/resources/RecordEncoder.js +94 -9
  159. package/dist/resources/RecordEncoder.js.map +1 -1
  160. package/dist/resources/RequestTarget.d.ts +2 -0
  161. package/dist/resources/RequestTarget.js.map +1 -1
  162. package/dist/resources/Resource.js +20 -11
  163. package/dist/resources/Resource.js.map +1 -1
  164. package/dist/resources/ResourceInterface.d.ts +20 -1
  165. package/dist/resources/ResourceInterface.js.map +1 -1
  166. package/dist/resources/RocksIndexStore.d.ts +6 -1
  167. package/dist/resources/RocksIndexStore.js +24 -9
  168. package/dist/resources/RocksIndexStore.js.map +1 -1
  169. package/dist/resources/RocksTransactionLogStore.d.ts +14 -1
  170. package/dist/resources/RocksTransactionLogStore.js +57 -17
  171. package/dist/resources/RocksTransactionLogStore.js.map +1 -1
  172. package/dist/resources/Table.d.ts +112 -8
  173. package/dist/resources/Table.js +1073 -191
  174. package/dist/resources/Table.js.map +1 -1
  175. package/dist/resources/auditStore.d.ts +11 -2
  176. package/dist/resources/auditStore.js +325 -71
  177. package/dist/resources/auditStore.js.map +1 -1
  178. package/dist/resources/blob.d.ts +129 -9
  179. package/dist/resources/blob.js +992 -114
  180. package/dist/resources/blob.js.map +1 -1
  181. package/dist/resources/branchDatabase.d.ts +48 -0
  182. package/dist/resources/branchDatabase.js +892 -0
  183. package/dist/resources/branchDatabase.js.map +1 -0
  184. package/dist/resources/crdt.js +50 -12
  185. package/dist/resources/crdt.js.map +1 -1
  186. package/dist/resources/databases.d.ts +150 -0
  187. package/dist/resources/databases.js +1200 -239
  188. package/dist/resources/databases.js.map +1 -1
  189. package/dist/resources/defineTable.d.ts +10 -2
  190. package/dist/resources/defineTable.js +9 -1
  191. package/dist/resources/defineTable.js.map +1 -1
  192. package/dist/resources/graphql.d.ts +1 -1
  193. package/dist/resources/graphql.js +50 -15
  194. package/dist/resources/graphql.js.map +1 -1
  195. package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +1 -0
  196. package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +6 -2
  197. package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
  198. package/dist/resources/longLivedTransactions.d.ts +71 -0
  199. package/dist/resources/longLivedTransactions.js +358 -0
  200. package/dist/resources/longLivedTransactions.js.map +1 -0
  201. package/dist/resources/models/backendRegistry.d.ts +26 -0
  202. package/dist/resources/models/backendRegistry.js +60 -2
  203. package/dist/resources/models/backendRegistry.js.map +1 -1
  204. package/dist/resources/models/bootstrap.d.ts +33 -1
  205. package/dist/resources/models/bootstrap.js +416 -31
  206. package/dist/resources/models/bootstrap.js.map +1 -1
  207. package/dist/resources/recordLock.d.ts +80 -0
  208. package/dist/resources/recordLock.js +184 -0
  209. package/dist/resources/recordLock.js.map +1 -0
  210. package/dist/resources/replayLogs.d.ts +14 -1
  211. package/dist/resources/replayLogs.js +152 -24
  212. package/dist/resources/replayLogs.js.map +1 -1
  213. package/dist/resources/replayLogsGuards.d.ts +94 -7
  214. package/dist/resources/replayLogsGuards.js +111 -7
  215. package/dist/resources/replayLogsGuards.js.map +1 -1
  216. package/dist/resources/search.js +158 -6
  217. package/dist/resources/search.js.map +1 -1
  218. package/dist/resources/transactionBroadcast.d.ts +1 -1
  219. package/dist/resources/transactionBroadcast.js +2 -2
  220. package/dist/resources/transactionBroadcast.js.map +1 -1
  221. package/dist/security/auth.js +61 -30
  222. package/dist/security/auth.js.map +1 -1
  223. package/dist/security/authn/oidc/claims.d.ts +22 -0
  224. package/dist/security/authn/oidc/claims.js +71 -0
  225. package/dist/security/authn/oidc/claims.js.map +1 -0
  226. package/dist/security/authn/oidc/identityToken.d.ts +27 -0
  227. package/dist/security/authn/oidc/identityToken.js +111 -0
  228. package/dist/security/authn/oidc/identityToken.js.map +1 -0
  229. package/dist/security/authn/oidc/jwks.d.ts +25 -0
  230. package/dist/security/authn/oidc/jwks.js +261 -0
  231. package/dist/security/authn/oidc/jwks.js.map +1 -0
  232. package/dist/security/authn/oidc/providers/generic.d.ts +13 -0
  233. package/dist/security/authn/oidc/providers/generic.js +34 -0
  234. package/dist/security/authn/oidc/providers/generic.js.map +1 -0
  235. package/dist/security/authn/oidc/providers/githubActions.d.ts +11 -0
  236. package/dist/security/authn/oidc/providers/githubActions.js +129 -0
  237. package/dist/security/authn/oidc/providers/githubActions.js.map +1 -0
  238. package/dist/security/authn/oidc/providers/index.d.ts +37 -0
  239. package/dist/security/authn/oidc/providers/index.js +24 -0
  240. package/dist/security/authn/oidc/providers/index.js.map +1 -0
  241. package/dist/security/authn/oidc/tokenExchange.d.ts +12 -0
  242. package/dist/security/authn/oidc/tokenExchange.js +306 -0
  243. package/dist/security/authn/oidc/tokenExchange.js.map +1 -0
  244. package/dist/security/authn/oidc/trustPolicyOperations.d.ts +49 -0
  245. package/dist/security/authn/oidc/trustPolicyOperations.js +358 -0
  246. package/dist/security/authn/oidc/trustPolicyOperations.js.map +1 -0
  247. package/dist/security/authn/oidc/types.d.ts +38 -0
  248. package/dist/security/authn/oidc/types.js +6 -0
  249. package/dist/security/authn/oidc/types.js.map +1 -0
  250. package/dist/security/certificateVerification/index.js +40 -11
  251. package/dist/security/certificateVerification/index.js.map +1 -1
  252. package/dist/security/certificateVerification/trustedIssuers.d.ts +24 -0
  253. package/dist/security/certificateVerification/trustedIssuers.js +79 -0
  254. package/dist/security/certificateVerification/trustedIssuers.js.map +1 -0
  255. package/dist/security/certificateVerification/types.d.ts +1 -0
  256. package/dist/security/credentialProvenance.d.ts +35 -0
  257. package/dist/security/credentialProvenance.js +51 -0
  258. package/dist/security/credentialProvenance.js.map +1 -0
  259. package/dist/security/credentialRejection.d.ts +4 -0
  260. package/dist/security/credentialRejection.js +24 -0
  261. package/dist/security/credentialRejection.js.map +1 -0
  262. package/dist/security/deferredAuthentication.d.ts +36 -0
  263. package/dist/security/deferredAuthentication.js +70 -0
  264. package/dist/security/deferredAuthentication.js.map +1 -0
  265. package/dist/security/impersonation.d.ts +21 -0
  266. package/dist/security/impersonation.js +108 -9
  267. package/dist/security/impersonation.js.map +1 -1
  268. package/dist/security/jsLoader.d.ts +6 -0
  269. package/dist/security/jsLoader.js +75 -15
  270. package/dist/security/jsLoader.js.map +1 -1
  271. package/dist/security/keys.js +301 -71
  272. package/dist/security/keys.js.map +1 -1
  273. package/dist/security/operationScope.d.ts +21 -0
  274. package/dist/security/operationScope.js +36 -0
  275. package/dist/security/operationScope.js.map +1 -0
  276. package/dist/security/permissionsTranslator.js +21 -0
  277. package/dist/security/permissionsTranslator.js.map +1 -1
  278. package/dist/security/tokenAuthentication.d.ts +19 -1
  279. package/dist/security/tokenAuthentication.js +191 -10
  280. package/dist/security/tokenAuthentication.js.map +1 -1
  281. package/dist/security/user.js +4 -3
  282. package/dist/security/user.js.map +1 -1
  283. package/dist/server/DurableSubscriptionsSession.d.ts +2 -2
  284. package/dist/server/DurableSubscriptionsSession.js +67 -10
  285. package/dist/server/DurableSubscriptionsSession.js.map +1 -1
  286. package/dist/server/REST.js +73 -0
  287. package/dist/server/REST.js.map +1 -1
  288. package/dist/server/graphqlQuerying.js +4 -0
  289. package/dist/server/graphqlQuerying.js.map +1 -1
  290. package/dist/server/http.d.ts +11 -0
  291. package/dist/server/http.js +88 -15
  292. package/dist/server/http.js.map +1 -1
  293. package/dist/server/itc/serverHandlers.js +8 -1
  294. package/dist/server/itc/serverHandlers.js.map +1 -1
  295. package/dist/server/jobs/jobProcess.js +6 -2
  296. package/dist/server/jobs/jobProcess.js.map +1 -1
  297. package/dist/server/jobs/jobs.js +4 -1
  298. package/dist/server/jobs/jobs.js.map +1 -1
  299. package/dist/server/liveSubscriptionAuth.d.ts +26 -4
  300. package/dist/server/liveSubscriptionAuth.js +105 -39
  301. package/dist/server/liveSubscriptionAuth.js.map +1 -1
  302. package/dist/server/loadRootComponents.js +49 -10
  303. package/dist/server/loadRootComponents.js.map +1 -1
  304. package/dist/server/mqtt.d.ts +2 -0
  305. package/dist/server/mqtt.js +165 -30
  306. package/dist/server/mqtt.js.map +1 -1
  307. package/dist/server/nodeName.d.ts +2 -0
  308. package/dist/server/nodeName.js +107 -23
  309. package/dist/server/nodeName.js.map +1 -1
  310. package/dist/server/serverHelpers/Headers.d.ts +25 -0
  311. package/dist/server/serverHelpers/Headers.js +139 -1
  312. package/dist/server/serverHelpers/Headers.js.map +1 -1
  313. package/dist/server/serverHelpers/contentTypes.d.ts +9 -0
  314. package/dist/server/serverHelpers/contentTypes.js +32 -25
  315. package/dist/server/serverHelpers/contentTypes.js.map +1 -1
  316. package/dist/server/serverHelpers/deployValidationState.d.ts +3 -0
  317. package/dist/server/serverHelpers/deployValidationState.js +9 -19
  318. package/dist/server/serverHelpers/deployValidationState.js.map +1 -1
  319. package/dist/server/serverHelpers/operationAuthorizationState.d.ts +12 -0
  320. package/dist/server/serverHelpers/operationAuthorizationState.js +24 -2
  321. package/dist/server/serverHelpers/operationAuthorizationState.js.map +1 -1
  322. package/dist/server/serverHelpers/registeredOperations.d.ts +5 -4
  323. package/dist/server/serverHelpers/registeredOperations.js +74 -21
  324. package/dist/server/serverHelpers/registeredOperations.js.map +1 -1
  325. package/dist/server/serverHelpers/requestSanitization.d.ts +11 -0
  326. package/dist/server/serverHelpers/requestSanitization.js +20 -0
  327. package/dist/server/serverHelpers/requestSanitization.js.map +1 -0
  328. package/dist/server/serverHelpers/serverHandlers.js +6 -3
  329. package/dist/server/serverHelpers/serverHandlers.js.map +1 -1
  330. package/dist/server/serverHelpers/serverUtilities.d.ts +18 -0
  331. package/dist/server/serverHelpers/serverUtilities.js +90 -20
  332. package/dist/server/serverHelpers/serverUtilities.js.map +1 -1
  333. package/dist/server/serverHelpers/sharedMessageEncoding.d.ts +67 -0
  334. package/dist/server/serverHelpers/sharedMessageEncoding.js +280 -0
  335. package/dist/server/serverHelpers/sharedMessageEncoding.js.map +1 -0
  336. package/dist/server/serverHelpers/uwsServer.js +19 -1
  337. package/dist/server/serverHelpers/uwsServer.js.map +1 -1
  338. package/dist/server/static.js +24 -28
  339. package/dist/server/static.js.map +1 -1
  340. package/dist/server/storageReclamation.d.ts +12 -0
  341. package/dist/server/storageReclamation.js +26 -0
  342. package/dist/server/storageReclamation.js.map +1 -1
  343. package/dist/server/threads/itc.d.ts +7 -2
  344. package/dist/server/threads/itc.js +5 -1
  345. package/dist/server/threads/itc.js.map +1 -1
  346. package/dist/server/threads/manageThreads.d.ts +26 -3
  347. package/dist/server/threads/manageThreads.js +517 -65
  348. package/dist/server/threads/manageThreads.js.map +1 -1
  349. package/dist/server/threads/socketRouter.js +89 -26
  350. package/dist/server/threads/socketRouter.js.map +1 -1
  351. package/dist/server/threads/threadHeapMemory.d.ts +2 -0
  352. package/dist/server/threads/threadHeapMemory.js +31 -0
  353. package/dist/server/threads/threadHeapMemory.js.map +1 -0
  354. package/dist/server/threads/threadServer.js +46 -15
  355. package/dist/server/threads/threadServer.js.map +1 -1
  356. package/dist/sqlEngine/config.d.ts +1 -3
  357. package/dist/sqlEngine/config.js +19 -16
  358. package/dist/sqlEngine/config.js.map +1 -1
  359. package/dist/sqlTranslator/index.d.ts +1 -1
  360. package/dist/sqlTranslator/index.js +30 -7
  361. package/dist/sqlTranslator/index.js.map +1 -1
  362. package/dist/upgrade/directives/5-3-0.d.ts +7 -0
  363. package/dist/upgrade/directives/5-3-0.js +148 -0
  364. package/dist/upgrade/directives/5-3-0.js.map +1 -0
  365. package/dist/upgrade/directives/directivesController.js +2 -1
  366. package/dist/upgrade/directives/directivesController.js.map +1 -1
  367. package/dist/utility/OperationFunctionCaller.js +2 -1
  368. package/dist/utility/OperationFunctionCaller.js.map +1 -1
  369. package/dist/utility/common_utils.d.ts +16 -0
  370. package/dist/utility/common_utils.js +32 -6
  371. package/dist/utility/common_utils.js.map +1 -1
  372. package/dist/utility/componentNames.d.ts +8 -0
  373. package/dist/utility/componentNames.js +12 -1
  374. package/dist/utility/componentNames.js.map +1 -1
  375. package/dist/utility/environment/environmentManager.js +3 -6
  376. package/dist/utility/environment/environmentManager.js.map +1 -1
  377. package/dist/utility/environment/systemInformation.d.ts +1 -0
  378. package/dist/utility/environment/systemInformation.js +1 -0
  379. package/dist/utility/environment/systemInformation.js.map +1 -1
  380. package/dist/utility/errors/commonErrors.d.ts +2 -0
  381. package/dist/utility/errors/commonErrors.js +2 -0
  382. package/dist/utility/errors/commonErrors.js.map +1 -1
  383. package/dist/utility/errors/hdbError.d.ts +17 -0
  384. package/dist/utility/errors/hdbError.js +30 -1
  385. package/dist/utility/errors/hdbError.js.map +1 -1
  386. package/dist/utility/globalSchema.d.ts +18 -0
  387. package/dist/utility/hdbTerms.d.ts +16 -0
  388. package/dist/utility/hdbTerms.js +18 -2
  389. package/dist/utility/hdbTerms.js.map +1 -1
  390. package/dist/utility/logging/harper_logger.d.ts +2 -0
  391. package/dist/utility/logging/harper_logger.js +91 -14
  392. package/dist/utility/logging/harper_logger.js.map +1 -1
  393. package/dist/utility/logging/logRotator.js +76 -49
  394. package/dist/utility/logging/logRotator.js.map +1 -1
  395. package/dist/utility/nodeIdentity.d.ts +9 -0
  396. package/dist/utility/nodeIdentity.js +58 -0
  397. package/dist/utility/nodeIdentity.js.map +1 -0
  398. package/dist/utility/npmUtilities.js +9 -7
  399. package/dist/utility/npmUtilities.js.map +1 -1
  400. package/dist/utility/operationPermissions.d.ts +3 -1
  401. package/dist/utility/operationPermissions.js +16 -1
  402. package/dist/utility/operationPermissions.js.map +1 -1
  403. package/dist/utility/operation_authorization.d.ts +10 -7
  404. package/dist/utility/operation_authorization.js +212 -41
  405. package/dist/utility/operation_authorization.js.map +1 -1
  406. package/dist/utility/watchPath.d.ts +29 -0
  407. package/dist/utility/watchPath.js +68 -0
  408. package/dist/utility/watchPath.js.map +1 -0
  409. package/dist/utility/watcherFallback.d.ts +86 -0
  410. package/dist/utility/watcherFallback.js +278 -1
  411. package/dist/utility/watcherFallback.js.map +1 -1
  412. package/dist/validation/configValidator.d.ts +12 -0
  413. package/dist/validation/configValidator.js +199 -72
  414. package/dist/validation/configValidator.js.map +1 -1
  415. package/dist/validation/installValidator.js +12 -0
  416. package/dist/validation/installValidator.js.map +1 -1
  417. package/dist/validation/validationWrapper.d.ts +11 -0
  418. package/dist/validation/validationWrapper.js +16 -3
  419. package/dist/validation/validationWrapper.js.map +1 -1
  420. package/index.ts +2 -0
  421. package/json/systemSchema.json +52 -0
  422. package/npm-shrinkwrap.json +196 -194
  423. package/package.json +7 -6
  424. package/resources/DESIGN.md +114 -52
  425. package/resources/DatabaseTransaction.ts +521 -43
  426. package/resources/LMDBTransaction.ts +26 -4
  427. package/resources/PrimaryRocksDatabase.ts +28 -1
  428. package/resources/RecordEncoder.ts +103 -8
  429. package/resources/RequestTarget.ts +2 -0
  430. package/resources/Resource.ts +17 -9
  431. package/resources/ResourceInterface.ts +23 -0
  432. package/resources/RocksIndexStore.ts +30 -9
  433. package/resources/RocksTransactionLogStore.ts +78 -21
  434. package/resources/Table.ts +1110 -159
  435. package/resources/auditStore.ts +331 -73
  436. package/resources/blob.ts +1029 -110
  437. package/resources/branchDatabase.ts +941 -0
  438. package/resources/crdt.ts +76 -12
  439. package/resources/databases.ts +1310 -252
  440. package/resources/defineTable.ts +18 -2
  441. package/resources/graphql.ts +70 -16
  442. package/resources/indexes/HierarchicalNavigableSmallWorld.ts +6 -2
  443. package/resources/longLivedTransactions.ts +360 -0
  444. package/resources/models/backendRegistry.ts +84 -2
  445. package/resources/models/bootstrap.ts +473 -28
  446. package/resources/recordLock.ts +253 -0
  447. package/resources/replayLogs.ts +147 -26
  448. package/resources/replayLogsGuards.ts +171 -8
  449. package/resources/search.ts +154 -7
  450. package/resources/transactionBroadcast.ts +3 -3
  451. package/security/auth.ts +68 -29
  452. package/security/authn/oidc/claims.ts +72 -0
  453. package/security/authn/oidc/identityToken.ts +129 -0
  454. package/security/authn/oidc/jwks.ts +260 -0
  455. package/security/authn/oidc/providers/generic.ts +40 -0
  456. package/security/authn/oidc/providers/githubActions.ts +137 -0
  457. package/security/authn/oidc/providers/index.ts +52 -0
  458. package/security/authn/oidc/tokenExchange.ts +300 -0
  459. package/security/authn/oidc/trustPolicyOperations.ts +343 -0
  460. package/security/authn/oidc/types.ts +41 -0
  461. package/security/certificateVerification/index.ts +54 -13
  462. package/security/certificateVerification/trustedIssuers.ts +76 -0
  463. package/security/certificateVerification/types.ts +1 -0
  464. package/security/credentialProvenance.ts +47 -0
  465. package/security/credentialRejection.ts +22 -0
  466. package/security/deferredAuthentication.ts +71 -0
  467. package/security/impersonation.ts +117 -12
  468. package/security/jsLoader.ts +81 -18
  469. package/security/keys.ts +298 -72
  470. package/security/operationScope.ts +33 -0
  471. package/security/permissionsTranslator.js +23 -0
  472. package/security/tokenAuthentication.ts +233 -12
  473. package/security/user.ts +4 -3
  474. package/server/DESIGN.md +183 -16
  475. package/server/DurableSubscriptionsSession.ts +71 -11
  476. package/server/REST.ts +79 -1
  477. package/server/graphqlQuerying.ts +4 -0
  478. package/server/http.ts +99 -18
  479. package/server/itc/serverHandlers.js +8 -1
  480. package/server/jobs/jobProcess.ts +8 -2
  481. package/server/jobs/jobs.ts +4 -1
  482. package/server/liveSubscriptionAuth.ts +129 -46
  483. package/server/loadRootComponents.js +50 -8
  484. package/server/mqtt.ts +179 -38
  485. package/server/nodeName.ts +103 -21
  486. package/server/serverHelpers/Headers.ts +131 -0
  487. package/server/serverHelpers/contentTypes.ts +29 -21
  488. package/server/serverHelpers/deployValidationState.ts +24 -13
  489. package/server/serverHelpers/operationAuthorizationState.ts +34 -3
  490. package/server/serverHelpers/registeredOperations.ts +79 -22
  491. package/server/serverHelpers/requestSanitization.ts +15 -0
  492. package/server/serverHelpers/serverHandlers.js +6 -3
  493. package/server/serverHelpers/serverUtilities.ts +104 -31
  494. package/server/serverHelpers/sharedMessageEncoding.ts +307 -0
  495. package/server/serverHelpers/uwsServer.ts +17 -2
  496. package/server/static.ts +23 -29
  497. package/server/storageReclamation.ts +23 -0
  498. package/server/threads/itc.js +11 -1
  499. package/server/threads/manageThreads.js +526 -56
  500. package/server/threads/socketRouter.ts +81 -26
  501. package/server/threads/threadHeapMemory.ts +26 -0
  502. package/server/threads/threadServer.js +43 -15
  503. package/sqlTranslator/index.ts +31 -8
  504. package/studio/web/assets/Chat-BnCBegQz.js +2267 -0
  505. package/studio/web/assets/FloatingChat-CoDW1ySS.js +23 -0
  506. package/studio/web/assets/{abnfDiagram-VCTEODGH-C0_BAZyO.js → abnfDiagram-VCTEODGH-B0BebmD2.js} +1 -1
  507. package/studio/web/assets/{alertDialog-DIHt7Z0r.js → alertDialog-CQyAJJhl.js} +1 -1
  508. package/studio/web/assets/{apiToken-c3Rd-w6g.js → apiToken-Bwk5BLXW.js} +1 -1
  509. package/studio/web/assets/applications-DHxGi7JH.js +296 -0
  510. package/studio/web/assets/architecture-7GRP2DOG-LB-MLAAb.js +1 -0
  511. package/studio/web/assets/{architectureDiagram-5GKGNRK7-BWzrASgm.js → architectureDiagram-5GKGNRK7-7SW3GD-K.js} +1 -1
  512. package/studio/web/assets/authStore-C3Nfubqr.js +3 -0
  513. package/studio/web/assets/{blockDiagram-NRAW4CY4-BdJX9Khj.js → blockDiagram-I7D4REHJ-BqguiadH.js} +2 -2
  514. package/studio/web/assets/{button-DhiX-njv.js → button-BIsUKRZq.js} +2 -2
  515. package/studio/web/assets/{c4Diagram-UCG6FXSJ-CI6MzGmQ.js → c4Diagram-7LVT6UL2-LBNf8t_X.js} +1 -1
  516. package/studio/web/assets/channel-yictG-U-.js +1 -0
  517. package/studio/web/assets/{chevron-up-Df2c8uoU.js → chevron-up-DtKGqDn3.js} +1 -1
  518. package/studio/web/assets/{chunk-TEH6E4GO-P87k5mNi.js → chunk-4HAMMTFA-DWtTut21.js} +1 -1
  519. package/studio/web/assets/{chunk-75Z2AOVW-BT8tVmks.js → chunk-75Z2AOVW-QGQD6th2.js} +1 -1
  520. package/studio/web/assets/{chunk-DU6HZSFF-9kAOOmI6.js → chunk-DU6HZSFF-Chq20Ba5.js} +1 -1
  521. package/studio/web/assets/{chunk-F27PBJKO-BW7ao8AY.js → chunk-F27PBJKO-BVA5EPhV.js} +1 -1
  522. package/studio/web/assets/{chunk-GMAD6QVW-BNyXpoQO.js → chunk-GMAD6QVW-BeS7S07A.js} +1 -1
  523. package/studio/web/assets/{chunk-OBVCFTLP-D4wWOqDQ.js → chunk-GVQU2GXP-sbwVIQ8i.js} +1 -1
  524. package/studio/web/assets/{chunk-G27WJ6UU-COyLMcgK.js → chunk-IMKFNOWR-Bnh3tAVd.js} +1 -1
  525. package/studio/web/assets/{chunk-JQ64N6SF-Cyz1IeLf.js → chunk-L3NEJ4N5-COfUyKII.js} +1 -1
  526. package/studio/web/assets/chunk-OSK3NFVY-ByciRftO.js +10 -0
  527. package/studio/web/assets/{chunk-P2QGCYS3-DmIFY4d7.js → chunk-P2QGCYS3-CP1VhG_c.js} +1 -1
  528. package/studio/web/assets/{chunk-POPQ4Y6H-BPrvMyKz.js → chunk-POPQ4Y6H-ClWhhkwW.js} +1 -1
  529. package/studio/web/assets/{chunk-PWAF6VOD-2zB6IW9i.js → chunk-PWAF6VOD-1z1THyS5.js} +1 -1
  530. package/studio/web/assets/{chunk-RHFEMEQ7-2FgyI8YU.js → chunk-SHT3W25Y-LpQkMsah.js} +2 -2
  531. package/studio/web/assets/{chunk-SVP7TREG-FwtbH2QC.js → chunk-SVP7TREG-jtdAHw0S.js} +1 -1
  532. package/studio/web/assets/{chunk-LCL6LL3I-HOzK_ppE.js → chunk-TICWLB2K-VOwzetX-.js} +1 -1
  533. package/studio/web/assets/classDiagram-ZZMXUADV-VaEwSy_g.js +1 -0
  534. package/studio/web/assets/classDiagram-v2-VYDZK3BY-VaEwSy_g.js +1 -0
  535. package/studio/web/assets/{createLucideIcon-BKGPfjm2.js → createLucideIcon-CzW9508A.js} +1 -1
  536. package/studio/web/assets/{cssMode-CEN2mzSA.js → cssMode-s0cWI-_M.js} +1 -1
  537. package/studio/web/assets/{cynefin-OW5HDTMX-BRkpLFQV.js → cynefin-OW5HDTMX-BbdbCvub.js} +1 -1
  538. package/studio/web/assets/{cynefinDiagram-5FMLGOSQ-CHT1DaX6.js → cynefinDiagram-5FMLGOSQ-TP-aIqbt.js} +1 -1
  539. package/studio/web/assets/{dagre-3AP2YEHR-DpUXBh63.js → dagre-GXQ25YYZ-DShnGpGo.js} +1 -1
  540. package/studio/web/assets/{diagram-S7CK7UJ4-BuymVFZT.js → diagram-S7CK7UJ4-aoCVTtcy.js} +1 -1
  541. package/studio/web/assets/{diagram-UQ7AKVKN-CyP148RM.js → diagram-UQ7AKVKN-DglXtQ6x.js} +1 -1
  542. package/studio/web/assets/{diagram-VSXAHHWV-CoCAg3M9.js → diagram-VSXAHHWV-fhEdmkwM.js} +1 -1
  543. package/studio/web/assets/{diagram-VX7I27RA-BpOqCFca.js → diagram-VX7I27RA-DccVJet6.js} +1 -1
  544. package/studio/web/assets/{diagram-Z3DM3KII-Bfpw7Vbj.js → diagram-Z3DM3KII-D-RyJJb7.js} +1 -1
  545. package/studio/web/assets/{dialog-CBf0Mr1d.js → dialog-Cn2uWgD4.js} +1 -1
  546. package/studio/web/assets/{dist-lkA3O3eM.js → dist-DP8UjMB_.js} +1 -1
  547. package/studio/web/assets/{download-BtTOBem-.js → download-B5T5r7ss.js} +1 -1
  548. package/studio/web/assets/{ebnfDiagram-PWID7BFC-DS_6aWqL.js → ebnfDiagram-PWID7BFC-DJGpIpz_.js} +1 -1
  549. package/studio/web/assets/{editor-D8oDeCTL.js → editor-DNcRHK54.js} +1 -1
  550. package/studio/web/assets/{erDiagram-SSCWMZ5O-DJNk6Fgw.js → erDiagram-RLTQ6QDP-CIfNlgkC.js} +1 -1
  551. package/studio/web/assets/eventmodeling-NTZA5JFV-CLxnp2CR.js +1 -0
  552. package/studio/web/assets/flowDiagram-HODETNUW-BIbhmz9f.js +1 -0
  553. package/studio/web/assets/{ganttDiagram-EL5Y4UJY-2pOExxMY.js → ganttDiagram-EL5Y4UJY-BxToTzzD.js} +1 -1
  554. package/studio/web/assets/{getAnalytics-D4LKGeVy.js → getAnalytics-GHK8ORfM.js} +1 -1
  555. package/studio/web/assets/{gitGraph-4MIJSDKK-CH5ZxwzF.js → gitGraph-4MIJSDKK-D2s2w8lE.js} +1 -1
  556. package/studio/web/assets/{gitGraphDiagram-WWUBYQGX-DVIsIhbO.js → gitGraphDiagram-WWUBYQGX-Dwntd4-x.js} +1 -1
  557. package/studio/web/assets/{html-u3vOg7LJ.js → html-Bdssedlg.js} +1 -1
  558. package/studio/web/assets/{htmlMode-DyO31v-P.js → htmlMode-CoDlJ3fw.js} +1 -1
  559. package/studio/web/assets/{index-Cxj2_wsl.css → index-7RMEgVG1.css} +1 -1
  560. package/studio/web/assets/index-D6sxmFLR.js +824 -0
  561. package/studio/web/assets/index.lazy-tmU5BS8s.js +2 -0
  562. package/studio/web/assets/{info-A6RAGUB7-CPQfTnaG.js → info-A6RAGUB7-DYjkvb0C.js} +1 -1
  563. package/studio/web/assets/{infoDiagram-RXCK75RN-DlwLYlwm.js → infoDiagram-27XIBGKW-Bnp1FJE5.js} +1 -1
  564. package/studio/web/assets/{ishikawaDiagram-5VMMS53U-BRXRp29U.js → ishikawaDiagram-5VMMS53U-D9Xh2r6X.js} +1 -1
  565. package/studio/web/assets/{javascript-CUvxOyTC.js → javascript-B8meVSTH.js} +1 -1
  566. package/studio/web/assets/{journeyDiagram-EYS64GPL-B0ou8k0n.js → journeyDiagram-3NMN7TZE-CokIi6ll.js} +2 -2
  567. package/studio/web/assets/{jsonMode-f_IwbF3D.js → jsonMode-DpIPd35T.js} +1 -1
  568. package/studio/web/assets/{kanban-definition-3QL26DDD-uYg7iYzp.js → kanban-definition-UXKFOSKX-CukSFJfX.js} +1 -1
  569. package/studio/web/assets/{languageServices-DXtZ6rEF.js → languageServices-C_5FMJzQ.js} +1 -1
  570. package/studio/web/assets/{lspLanguageFeatures-B4pCF1zO.js → lspLanguageFeatures-BIzNBzPK.js} +1 -1
  571. package/studio/web/assets/{mermaid-parser.core-Ck-fC8b7.js → mermaid-parser.core-BlEsOWNO.js} +3 -3
  572. package/studio/web/assets/{mermaid.core-CP8aNNYm.js → mermaid.core-BlkGaMIH.js} +5 -5
  573. package/studio/web/assets/{mindmap-definition-FBJOCRG2-CgTZ-rit.js → mindmap-definition-YA3MSWOX-IprMc_0j.js} +1 -1
  574. package/studio/web/assets/{notifications-D3tIQ4sg.js → notifications-CQf18QKb.js} +1 -1
  575. package/studio/web/assets/notifications-CvZivSbh.js +1 -0
  576. package/studio/web/assets/{packet-AYTQ26CC-DEyoPtPb.js → packet-AYTQ26CC-Bi3V04Zi.js} +1 -1
  577. package/studio/web/assets/{pegDiagram-XKGWAZYB-DrD-7sD9.js → pegDiagram-XKGWAZYB-BNuPDLZY.js} +1 -1
  578. package/studio/web/assets/{pie-WAS4IAKB-wjj-EI1d.js → pie-WAS4IAKB-_6DoDbng.js} +1 -1
  579. package/studio/web/assets/{pieDiagram-E7YTZNPT-GntqDCzv.js → pieDiagram-E7YTZNPT-DqNb6Ht2.js} +1 -1
  580. package/studio/web/assets/{profile-DZWU7MgT.js → profile-DdOwtntb.js} +1 -1
  581. package/studio/web/assets/{quadrantDiagram-AXDQQJYC-0UeqXQGd.js → quadrantDiagram-AXDQQJYC-BGH9E2YR.js} +1 -1
  582. package/studio/web/assets/{radar-RG4KPBEZ-DFSA5h7k.js → radar-RG4KPBEZ-DDdVczcL.js} +1 -1
  583. package/studio/web/assets/{railroad-74A4TZTK-CaOUG9wR.js → railroad-74A4TZTK-BJUP4Jds.js} +1 -1
  584. package/studio/web/assets/railroad-abnf-HS5TGJTU-Bm3L1L0h.js +1 -0
  585. package/studio/web/assets/railroad-ebnf-LZEXJU2U-CKzLGlkw.js +1 -0
  586. package/studio/web/assets/railroad-peg-WCYAUIDC-S8xLjslx.js +1 -0
  587. package/studio/web/assets/{railroadDiagram-O6MQD6OU-yHUELZaV.js → railroadDiagram-O6MQD6OU-DGTPh2KZ.js} +1 -1
  588. package/studio/web/assets/{regions-CkyurXzE.js → regions-n69fwagr.js} +1 -1
  589. package/studio/web/assets/{register-BUyhWjBO.js → register-PfWTCXWB.js} +3 -3
  590. package/studio/web/assets/{requirementDiagram-EFPCY7ZU-DNEGFjuW.js → requirementDiagram-BXWQKSXE-BJnO6uLz.js} +1 -1
  591. package/studio/web/assets/{sankeyDiagram-P5KCCOFB-DpyAmSVR.js → sankeyDiagram-P5KCCOFB-0vSOdymH.js} +1 -1
  592. package/studio/web/assets/{sequenceDiagram-WJ2MYXX4-TyaT7xNk.js → sequenceDiagram-WJ2MYXX4-hETizDWE.js} +1 -1
  593. package/studio/web/assets/{setComponentFile-CeyKSZAa.js → setComponentFile-Bg6O7X0S.js} +1 -1
  594. package/studio/web/assets/{setup-D2kn7cAA.js → setup-CUx_aUDl.js} +2 -2
  595. package/studio/web/assets/{stateDiagram-HBIQ2CUA-CeEdTArZ.js → stateDiagram-D77RDMKH-CdYQ_KtC.js} +1 -1
  596. package/studio/web/assets/stateDiagram-v2-MP3YSRHH-CdKuzQMT.js +1 -0
  597. package/studio/web/assets/status-D7BVKqX9.js +61 -0
  598. package/studio/web/assets/{swimlanes-XN3QIQJK-B54FmF46.js → swimlanes-42K2YHIH-B8cHIpU4.js} +1 -1
  599. package/studio/web/assets/swimlanesDiagram-VR7AAH4N-DmOSJwaH.js +8 -0
  600. package/studio/web/assets/{tabs-B_G5zscN.js → tabs-BrHu7gJi.js} +1 -1
  601. package/studio/web/assets/{timeline-definition-24CTP7MA-D-a9ujbo.js → timeline-definition-24CTP7MA-BJWYSXqF.js} +1 -1
  602. package/studio/web/assets/{toggleHighContrast-C0UW6rI2.js → toggleHighContrast-DBSyXzMr.js} +1 -1
  603. package/studio/web/assets/{treeView-Q6P3EWNA-CrW_6JnS.js → treeView-Q6P3EWNA-qxe_v6CQ.js} +1 -1
  604. package/studio/web/assets/{treemap-WGGIJYW6-BxyYLdP_.js → treemap-WGGIJYW6-dDo97XXF.js} +1 -1
  605. package/studio/web/assets/{tsMode-DBC0zmDx.js → tsMode-BByKCjBS.js} +1 -1
  606. package/studio/web/assets/{typescript-DApRQir3.js → typescript-DDLnLpw9.js} +1 -1
  607. package/studio/web/assets/{useEntityRestURL-DB6JStU1.js → useEntityRestURL-31CHGaHk.js} +1 -1
  608. package/studio/web/assets/{useLocalStorage-Dtj1QS8_.js → useLocalStorage-BqMR3D8_.js} +1 -1
  609. package/studio/web/assets/vendor-core-c2JRRJpV.js +58 -0
  610. package/studio/web/assets/vendor-datadog-CLUcJXOo.js +6 -0
  611. package/studio/web/assets/{vendor-react-Dyj4O3HE.js → vendor-react-CJV_K1u4.js} +1 -1
  612. package/studio/web/assets/vendor-tanstack-DxzraizX.js +1 -0
  613. package/studio/web/assets/{vendor-ui-vhu-UHhF.js → vendor-ui-BUjK0h8a.js} +2 -2
  614. package/studio/web/assets/{vennDiagram-4TSXK5OY-Cy7s7Mpy.js → vennDiagram-4TSXK5OY-A3i-lCdl.js} +1 -1
  615. package/studio/web/assets/{wardley-WFR3VGLG-BeBL35g2.js → wardley-WFR3VGLG-B0ik-_6g.js} +1 -1
  616. package/studio/web/assets/{wardleyDiagram-VM6X3IG4-BylmIGSg.js → wardleyDiagram-VM6X3IG4-CjrkKWUR.js} +1 -1
  617. package/studio/web/assets/{workers-C0bFIedw.js → workers-pR3jRY9D.js} +1 -1
  618. package/studio/web/assets/x-DIzaLEdK.js +1 -0
  619. package/studio/web/assets/{xml-HWd01lU-.js → xml-2iRnMhQO.js} +1 -1
  620. package/studio/web/assets/{xychartDiagram-S5SC5T6Z-CoKALMXr.js → xychartDiagram-S5SC5T6Z-Biok4GYV.js} +1 -1
  621. package/studio/web/assets/{yaml-CIH0Nt-h.js → yaml-Bf92gJpd.js} +1 -1
  622. package/studio/web/index.html +14 -14
  623. package/upgrade/directives/5-3-0.ts +132 -0
  624. package/upgrade/directives/directivesController.ts +2 -1
  625. package/utility/OperationFunctionCaller.ts +2 -1
  626. package/utility/common_utils.ts +30 -5
  627. package/utility/componentNames.ts +12 -0
  628. package/utility/environment/environmentManager.ts +3 -7
  629. package/utility/environment/systemInformation.ts +7 -0
  630. package/utility/errors/commonErrors.ts +4 -0
  631. package/utility/errors/hdbError.ts +29 -0
  632. package/utility/hdbTerms.ts +17 -0
  633. package/utility/logging/harper_logger.ts +87 -14
  634. package/utility/logging/logRotator.ts +72 -45
  635. package/utility/nodeIdentity.ts +45 -0
  636. package/utility/npmUtilities.ts +10 -8
  637. package/utility/operationPermissions.ts +18 -1
  638. package/utility/operation_authorization.ts +231 -42
  639. package/utility/watchPath.ts +63 -0
  640. package/utility/watcherFallback.ts +270 -0
  641. package/validation/configValidator.ts +209 -72
  642. package/validation/installValidator.ts +15 -0
  643. package/validation/validationWrapper.ts +18 -4
  644. package/studio/web/assets/Chat-JpO8EtUu.js +0 -2067
  645. package/studio/web/assets/FloatingChat-Bcj3xSZu.js +0 -23
  646. package/studio/web/assets/applications-ByqLRKyZ.js +0 -296
  647. package/studio/web/assets/architecture-7GRP2DOG-DNdx5tEU.js +0 -1
  648. package/studio/web/assets/authStore-qKmCZcaf.js +0 -3
  649. package/studio/web/assets/channel-DtCV8PTL.js +0 -1
  650. package/studio/web/assets/chunk-R7TYR2AO-Irip67yr.js +0 -10
  651. package/studio/web/assets/classDiagram-DTDB5LWJ-DbO_dCNE.js +0 -1
  652. package/studio/web/assets/classDiagram-v2-JRS7N3AN-DbO_dCNE.js +0 -1
  653. package/studio/web/assets/eventmodeling-NTZA5JFV-5jbe4A5P.js +0 -1
  654. package/studio/web/assets/flowDiagram-A5DVABFB-Dp9Ezlow.js +0 -1
  655. package/studio/web/assets/index-aSt5tY-L.js +0 -824
  656. package/studio/web/assets/index.lazy-B9jiPwT8.js +0 -2
  657. package/studio/web/assets/notifications-CUoYgU98.js +0 -1
  658. package/studio/web/assets/railroad-abnf-HS5TGJTU-Bc0Qi0WH.js +0 -1
  659. package/studio/web/assets/railroad-ebnf-LZEXJU2U-G8rVVZ2C.js +0 -1
  660. package/studio/web/assets/railroad-peg-WCYAUIDC-CrehKBhC.js +0 -1
  661. package/studio/web/assets/stateDiagram-v2-4QOOHH4V-D4tuw9Su.js +0 -1
  662. package/studio/web/assets/status-D7Xn5ePA.js +0 -61
  663. package/studio/web/assets/swimlanesDiagram-VK2B7HYN-XOhmNEvq.js +0 -8
  664. package/studio/web/assets/vendor-core-RCcadM3e.js +0 -73
  665. package/studio/web/assets/vendor-datadog-BRv-mOv1.js +0 -6
  666. package/studio/web/assets/vendor-tanstack-BiFWSB3W.js +0 -1
  667. package/studio/web/assets/x-B9o9hsep.js +0 -1
  668. /package/studio/web/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
@@ -0,0 +1,184 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MAX_LOCK_TIMEOUT_MS = exports.DEFAULT_LOCK_TIMEOUT_MS = exports.MAX_LOCK_LEASE_MS = exports.MIN_LOCK_LEASE_MS = exports.DEFAULT_LOCK_LEASE_MS = void 0;
7
+ exports.resolveLockOptions = resolveLockOptions;
8
+ exports.lockNotHeldError = lockNotHeldError;
9
+ exports.lockAttemptKey = lockAttemptKey;
10
+ exports.makeKeyLockHandle = makeKeyLockHandle;
11
+ exports.acquireRecordKey = acquireRecordKey;
12
+ const harper_logger_ts_1 = __importDefault(require("../utility/logging/harper_logger.js"));
13
+ const hdbError_ts_1 = require("../utility/errors/hdbError.js");
14
+ /**
15
+ * Exclusive per-record locks (harper#483, Phase 0: one node, every worker thread).
16
+ *
17
+ * The sole authority is the rocksdb-js process-wide key lock: one `locks` map per DBDescriptor
18
+ * shared by every worker thread's handle. Nothing is written to the store or audit log. Lock and
19
+ * unlock are pure in-memory operations; the record's version and bytes are unchanged.
20
+ */
21
+ exports.DEFAULT_LOCK_LEASE_MS = 30_000;
22
+ /** Below this a generation can expire before the caller's work completes, handing back a lock already lost. */
23
+ exports.MIN_LOCK_LEASE_MS = 100;
24
+ exports.MAX_LOCK_LEASE_MS = 300_000;
25
+ exports.DEFAULT_LOCK_TIMEOUT_MS = 30_000;
26
+ exports.MAX_LOCK_TIMEOUT_MS = 300_000;
27
+ const LOCK_KEY_PREFIX = Symbol.for('record-lock');
28
+ function requireDuration(name, value, fallback, min, max) {
29
+ if (value === undefined)
30
+ return fallback;
31
+ if (typeof value !== 'number' || !Number.isFinite(value) || value < min)
32
+ throw new hdbError_ts_1.ClientError(`Lock option ${name} must be a number of milliseconds of at least ${min}, but received ${value}`);
33
+ if (value > max)
34
+ throw new hdbError_ts_1.ClientError(`Lock option ${name} must not exceed ${max}ms, but received ${value}`);
35
+ return value;
36
+ }
37
+ function resolveLockOptions(options) {
38
+ if (options != null && typeof options !== 'object')
39
+ throw new hdbError_ts_1.ClientError(`Lock options must be an object, but received ${typeof options}`);
40
+ const hold = options?.hold ?? false;
41
+ if (typeof hold !== 'boolean')
42
+ throw new hdbError_ts_1.ClientError(`Lock option hold must be a boolean, but received ${hold}`);
43
+ return {
44
+ lease: requireDuration('lease', options?.lease, exports.DEFAULT_LOCK_LEASE_MS, exports.MIN_LOCK_LEASE_MS, exports.MAX_LOCK_LEASE_MS),
45
+ timeout: requireDuration('timeout', options?.timeout, exports.DEFAULT_LOCK_TIMEOUT_MS, 1, exports.MAX_LOCK_TIMEOUT_MS),
46
+ hold,
47
+ };
48
+ }
49
+ /**
50
+ * The 409 for a write staged through a handle that is no longer live. A lease that ran out and a
51
+ * lock that was handed back are different causes, and a caller told the wrong one debugs the wrong
52
+ * thing — a commit-released scoped handle is not a timeout.
53
+ */
54
+ function lockNotHeldError(handle) {
55
+ return new hdbError_ts_1.ClientError(handle.expired ? 'Record lock lease expired' : 'Record lock already released', 409);
56
+ }
57
+ /** The advisory key for this (table, record) pair, distinct from getFromSource's bare-id single-flight lock. */
58
+ function lockAttemptKey(tableId, id) {
59
+ return Array.isArray(id) ? [LOCK_KEY_PREFIX, tableId, ...id] : [LOCK_KEY_PREFIX, tableId, id];
60
+ }
61
+ const warnedLeaseTimerStores = new WeakSet();
62
+ class KeyLockHandle {
63
+ store;
64
+ key;
65
+ keyId;
66
+ expiresAt;
67
+ hold;
68
+ released = false;
69
+ expired = false;
70
+ acquiredAt;
71
+ #lastHolderVersion;
72
+ #candidateFloor;
73
+ #timer;
74
+ constructor(store, key, keyId, lease, hold = false, acquiredAt) {
75
+ this.store = store;
76
+ this.key = key;
77
+ this.keyId = keyId;
78
+ this.expiresAt = lease != null ? Date.now() + lease : Infinity;
79
+ this.hold = hold;
80
+ this.acquiredAt = acquiredAt ?? store.getMonotonicTimestamp();
81
+ if (lease != null) {
82
+ this.#timer = setTimeout(() => this.#onLeaseExpire(), lease).unref();
83
+ }
84
+ }
85
+ noteHolderVersion(version) {
86
+ this.#lastHolderVersion = Math.max(this.#lastHolderVersion ?? version, version);
87
+ }
88
+ noteCandidateFloor(version) {
89
+ this.#candidateFloor = Math.max(this.#candidateFloor ?? version, version);
90
+ }
91
+ holderVersionCandidate(floor) {
92
+ // A small nonzero step prevents exact LWW ties without materially moving past the observed floor.
93
+ const MIN_STEP = 0.000488;
94
+ return Math.max(this.#lastHolderVersion != null ? this.#lastHolderVersion + MIN_STEP : this.acquiredAt, this.acquiredAt, this.#candidateFloor ?? -Infinity, floor ?? -Infinity);
95
+ }
96
+ nextHolderVersion() {
97
+ const next = this.holderVersionCandidate();
98
+ this.#lastHolderVersion = next;
99
+ return next;
100
+ }
101
+ #onLeaseExpire() {
102
+ if (this.released)
103
+ return;
104
+ this.released = true;
105
+ this.expired = true;
106
+ try {
107
+ this.store.unlock(this.key);
108
+ }
109
+ catch (err) {
110
+ if (!warnedLeaseTimerStores.has(this.store)) {
111
+ warnedLeaseTimerStores.add(this.store);
112
+ harper_logger_ts_1.default.warn?.('record lock lease timer failed (store may have been dropped)', err);
113
+ }
114
+ }
115
+ }
116
+ release() {
117
+ if (this.released)
118
+ return false;
119
+ this.released = true;
120
+ clearTimeout(this.#timer);
121
+ try {
122
+ this.store.unlock(this.key);
123
+ }
124
+ catch (err) {
125
+ if (!warnedLeaseTimerStores.has(this.store)) {
126
+ warnedLeaseTimerStores.add(this.store);
127
+ harper_logger_ts_1.default.warn?.('record lock release failed (store may have been dropped)', err);
128
+ }
129
+ }
130
+ return true;
131
+ }
132
+ upgradeToHold(lease) {
133
+ this.hold = true;
134
+ clearTimeout(this.#timer);
135
+ this.expiresAt = Date.now() + lease;
136
+ this.#timer = setTimeout(() => this.#onLeaseExpire(), lease).unref();
137
+ }
138
+ }
139
+ function makeKeyLockHandle(store, key, keyId, lease, hold = false, acquiredAt) {
140
+ return new KeyLockHandle(store, key, keyId, lease, hold, acquiredAt);
141
+ }
142
+ /**
143
+ * Acquire the native key lock for a record, looping until acquired or deadline passes. Re-entrant
144
+ * within a transaction: if the transaction already holds this key (non-expired handle in its
145
+ * recordLocks map) the existing handle is returned without a second tryLock.
146
+ */
147
+ async function acquireRecordKey(txn, store, key, keyId, waitMs, lease, hold = false) {
148
+ const existing = txn.recordLockFor(store, keyId);
149
+ if (existing && !existing.released && !existing.expired)
150
+ return existing;
151
+ const deadline = Date.now() + waitMs;
152
+ // One persistent wake slot: at most one onUnlocked callback is registered per waiter at any
153
+ // time. After the callback fires (holder released), hasCallback is cleared so the next
154
+ // tryLock can register a fresh callback for the new holder. When the timeout fires instead
155
+ // (the holder has not released yet), hasCallback stays true and subsequent retries skip the
156
+ // callback registration, preventing unbounded accumulation on a hot key.
157
+ let wakeResolve;
158
+ let hasCallback = false;
159
+ while (true) {
160
+ const onUnlocked = hasCallback
161
+ ? undefined
162
+ : () => {
163
+ hasCallback = false;
164
+ wakeResolve?.();
165
+ };
166
+ const acquired = store.tryLock(key, onUnlocked);
167
+ if (acquired)
168
+ return makeKeyLockHandle(store, key, keyId, lease, hold, store.getMonotonicTimestamp());
169
+ if (onUnlocked)
170
+ hasCallback = true; // callback now registered; do not register another until it fires
171
+ const remaining = deadline - Date.now();
172
+ if (remaining <= 0)
173
+ throw new hdbError_ts_1.ClientError(`Record is locked and was not released in time`, 423);
174
+ await new Promise((resolve) => {
175
+ const t = setTimeout(resolve, remaining).unref();
176
+ wakeResolve = () => {
177
+ clearTimeout(t);
178
+ resolve();
179
+ };
180
+ });
181
+ wakeResolve = undefined;
182
+ }
183
+ }
184
+ //# sourceMappingURL=recordLock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recordLock.js","sourceRoot":"","sources":["../../resources/recordLock.ts"],"names":[],"mappings":";;;;;;AAgFA,gDAUC;AAOD,4CAEC;AAGD,wCAEC;AA2FD,8CASC;AAOD,4CAyCC;AA5PD,2FAA+D;AAC/D,+DAA4D;AAE5D;;;;;;GAMG;AAEU,QAAA,qBAAqB,GAAG,MAAM,CAAC;AAC5C,+GAA+G;AAClG,QAAA,iBAAiB,GAAG,GAAG,CAAC;AACxB,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAC5B,QAAA,uBAAuB,GAAG,MAAM,CAAC;AACjC,QAAA,mBAAmB,GAAG,OAAO,CAAC;AAC3C,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAqDlD,SAAS,eAAe,CAAC,IAAY,EAAE,KAAc,EAAE,QAAgB,EAAE,GAAW,EAAE,GAAW;IAChG,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,GAAG;QACtE,MAAM,IAAI,yBAAW,CACpB,eAAe,IAAI,iDAAiD,GAAG,kBAAkB,KAAK,EAAE,CAChG,CAAC;IACH,I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AAC,GAAG,EAAE,GAAG,MAAM,CAAC;IACrC,4FAA4F;IAC5F,wFAAwF;IACxF,4FAA4F;IAC5F,4FAA4F;IAC5F,yEAAyE;IACzE,IAAI,WAAqC,CAAC;IAC1C,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,OAAO,IAAI,EAAE,CAAC;QACb,MAAM,UAAU,GAAG,WAAW;YAC7B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,GAAG,EAAE;gBACL,WAAW,GAAG,KAAK,CAAC;gBACpB,WAAW,EAAE,EAAE,CAAC;YACjB,CAAC,CAAC;QACJ,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAChD,IAAI,QAAQ;YAAE,OAAO,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC;QACtG,IAAI,UAAU;YAAE,WAAW,GAAG,IAAI,CAAC,CAAC,kEAAkE;QACtG,MAAM,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACxC,IAAI,SAAS,IAAI,CAAC;YAAE,MAAM,IAAI,yBAAW,CAAC,+CAA+C,EAAE,GAAG,CAAC,CAAC;QAChG,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACnC,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACjD,WAAW,GAAG,GAAG,EAAE;gBAClB,YAAY,CAAC,CAAC,CAAC,CAAC;gBAChB,OAAO,EAAE,CAAC;YACX,CAAC,CAAC;QACH,CAAC,CAAC,CAAC;QACH,WAAW,GAAG,SAAS,CAAC;IACzB,CAAC;AACF,CAAC"}
@@ -1,3 +1,16 @@
1
1
  import { RocksDatabase } from '@harperfast/rocksdb-js';
2
2
  export declare function structuresWouldShrink(existing: any, updated: any): boolean;
3
- export declare function replayLogs(rootStore: RocksDatabase, tables: any): Promise<void>;
3
+ /** The total wall-clock budget (ms) a replay may spend, as configured for this process. */
4
+ export declare function replayTimeBudgetMs(): number;
5
+ /**
6
+ * `electedReplayer` marks a caller that has already won a cross-thread election for this store —
7
+ * the branch claim (branchDatabase.ts) — and so may replay off the main thread. It also makes the
8
+ * replay strict: the promise settles (never hangs), and a failure to apply the tail — a commit or
9
+ * write error, a stall or wall-clock abort — rejects instead of quietly serving a rewound store.
10
+ * Undecodable entries and a torn tail stay tolerated in both modes: a crash tears the last frame of
11
+ * a log by construction, and end-of-log is the designed reading of it (see replayLogsGuards.ts). A
12
+ * **mid-log** break is different — entries behind it were acknowledged and are now quarantined — so
13
+ * an elected replay rejects on one rather than publish a branch as a trustworthy point-in-time copy
14
+ * over known lost writes; boot replay still logs it and continues (harper#2016, harper#2063).
15
+ */
16
+ export declare function replayLogs(rootStore: RocksDatabase, tables: any, electedReplayer?: boolean): Promise<void>;
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.structuresWouldShrink = structuresWouldShrink;
37
+ exports.replayTimeBudgetMs = replayTimeBudgetMs;
37
38
  exports.replayLogs = replayLogs;
38
39
  const logger = __importStar(require("../utility/logging/harper_logger.js"));
39
40
  const DatabaseTransaction_ts_1 = require("./DatabaseTransaction.js");
@@ -63,15 +64,37 @@ function structuresWouldShrink(existing, updated) {
63
64
  }
64
65
  return false;
65
66
  }
66
- function replayLogs(rootStore, tables) {
67
- if (!node_worker_threads_1.isMainThread)
68
- return; // ideally we don't do it like this, but for now this is predictable
69
- return new Promise((resolve) => {
67
+ /** The total wall-clock budget (ms) a replay may spend, as configured for this process. */
68
+ function replayTimeBudgetMs() {
69
+ const configuredReplayTimeout = Number((0, environmentManager_ts_1.get)(hdbTerms_ts_1.CONFIG_PARAMS.REPLICATION_REPLAYTIMEOUT));
70
+ return configuredReplayTimeout > 0 ? configuredReplayTimeout : replayLogsGuards_ts_1.REPLAY_WALL_CLOCK_LIMIT_MS;
71
+ }
72
+ /**
73
+ * `electedReplayer` marks a caller that has already won a cross-thread election for this store —
74
+ * the branch claim (branchDatabase.ts) — and so may replay off the main thread. It also makes the
75
+ * replay strict: the promise settles (never hangs), and a failure to apply the tail — a commit or
76
+ * write error, a stall or wall-clock abort — rejects instead of quietly serving a rewound store.
77
+ * Undecodable entries and a torn tail stay tolerated in both modes: a crash tears the last frame of
78
+ * a log by construction, and end-of-log is the designed reading of it (see replayLogsGuards.ts). A
79
+ * **mid-log** break is different — entries behind it were acknowledged and are now quarantined — so
80
+ * an elected replay rejects on one rather than publish a branch as a trustworthy point-in-time copy
81
+ * over known lost writes; boot replay still logs it and continues (harper#2016, harper#2063).
82
+ */
83
+ function replayLogs(rootStore, tables, electedReplayer) {
84
+ if (!node_worker_threads_1.isMainThread && !electedReplayer)
85
+ return Promise.resolve(); // ideally we don't do it like this, but for now this is predictable
86
+ return new Promise((resolve, reject) => {
70
87
  const acquired = rootStore.tryLock('replayLogs', async () => {
71
88
  resolve();
72
89
  });
73
- if (!acquired)
90
+ if (!acquired) {
91
+ // An elected replayer is the store's sole opener, so a held lock is a protocol violation;
92
+ // hanging its awaited promise would wedge the branch claim in CREATING. The boot-scan
93
+ // caller keeps the settle-on-unlock semantics (nothing awaits it).
94
+ if (electedReplayer)
95
+ reject(new Error(`The replay lock for ${rootStore.databaseName} is already held`));
74
96
  return;
97
+ }
75
98
  // Shed transaction-log files already older than the audit retention window before
76
99
  // replaying. A node that crash-loops during recovery never reaches the steady-state
77
100
  // cleanup loop, so without this its aged backlog only grows and enlarges each subsequent
@@ -99,6 +122,10 @@ function replayLogs(rootStore, tables) {
99
122
  let transaction;
100
123
  let lastTimestamp = 0;
101
124
  let writes = 0;
125
+ // Writes staged on the currently-open transaction, so a discard can be taken back out of `writes`.
126
+ let stagedWrites = 0;
127
+ // Records dropped because a corrupt frame truncated the transaction they belong to.
128
+ let discardedWrites = 0;
102
129
  let skipped = 0;
103
130
  // Track forward progress so a backlog of unwritable entries can't grind the boot thread
104
131
  // forever (harper#1266). `noProgressRun` counts every entry processed without a successful
@@ -110,15 +137,36 @@ function replayLogs(rootStore, tables) {
110
137
  let lastProgressTime = replayStartTime;
111
138
  // Total wall-clock budget (ms) for replay, configurable via `replication.replayTimeout`;
112
139
  // falls back to the 10-minute default (harper#1316).
113
- const configuredReplayTimeout = Number((0, environmentManager_ts_1.get)(hdbTerms_ts_1.CONFIG_PARAMS.REPLICATION_REPLAYTIMEOUT));
114
- const replayTimeoutMs = configuredReplayTimeout > 0 ? configuredReplayTimeout : replayLogsGuards_ts_1.REPLAY_WALL_CLOCK_LIMIT_MS;
140
+ const replayTimeoutMs = replayTimeBudgetMs();
141
+ // Set on the first unrecoverable failure in elected mode; rejects below instead of publishing
142
+ // a store the replay knows is incomplete.
143
+ let strictFailure;
144
+ const strictAbort = (error, staged) => {
145
+ try {
146
+ staged?.abort();
147
+ }
148
+ catch (abortError) {
149
+ logger.warn('Error aborting a strict replay transaction', abortError);
150
+ }
151
+ strictFailure = error;
152
+ };
115
153
  const txnLog = rootStore.auditStore;
116
- for (const auditRecord of txnLog.getRange({ startFromLastFlushed: true, readUncommitted: true })) {
154
+ const entries = txnLog.getRange({
155
+ startFromLastFlushed: true,
156
+ readUncommitted: true,
157
+ trackCorruptTransactions: true,
158
+ });
159
+ for (const auditRecord of entries) {
117
160
  if (noProgressRun > 0 && (0, replayLogsGuards_ts_1.shouldAbortStalledReplay)(noProgressRun, performance.now() - lastProgressTime)) {
118
- logger.fatal(`Aborting transaction-log replay in ${rootStore.databaseName} database: ${noProgressRun} consecutive audit entries with no successful write (${skipped} skipped as unrecoverable, ${writes} replayed so far). This backlog is making no forward progress and was blocking startup (harper#1266) — typically a peer transaction log whose values reference unresolvable shared structures (harper#1163), or a backlog for a dropped table. Continuing boot without replaying the remainder; shed or relocate the oversized/undecodable peer transaction log(s), or re-clone this node, to recover the unreplayed data.`);
161
+ const stallDiagnostic = `Aborting transaction-log replay in ${rootStore.databaseName} database: ${noProgressRun} consecutive audit entries with no successful write (${skipped} skipped as unrecoverable, ${writes} replayed so far). This backlog is making no forward progress and was blocking startup (harper#1266) — typically a peer transaction log whose values reference unresolvable shared structures (harper#1163), or a backlog for a dropped table.`;
162
+ if (electedReplayer) {
163
+ strictAbort(new Error(stallDiagnostic), transaction);
164
+ break;
165
+ }
166
+ logger.fatal(`${stallDiagnostic} Continuing boot without replaying the remainder; shed or relocate the oversized/undecodable peer transaction log(s), or re-clone this node, to recover the unreplayed data.`);
119
167
  break;
120
168
  }
121
- const { type, tableId, nodeId, recordId, version, residencyId, expiresAt, originatingOperation, username, extendedType, } = auditRecord;
169
+ const { type, tableId, nodeId, recordId, version, txnLogKey, residencyId, expiresAt, originatingOperation, username, extendedType, } = auditRecord;
122
170
  try {
123
171
  if ((0, replayLogsGuards_ts_1.classifyAuditEntryForReplay)(extendedType, tableId, true) === 'corrupt-header') {
124
172
  skipped++;
@@ -172,15 +220,39 @@ function replayLogs(rootStore, tables) {
172
220
  warnedReplayHappening = true;
173
221
  console.warn('Harper was not properly shutdown, replaying transaction logs to synchronize database');
174
222
  }
175
- if (lastTimestamp !== version) {
176
- lastTimestamp = version;
223
+ // Transactions are delimited by the log key — which is also what `truncatedVersions` records —
224
+ // and each write is replayed at its own stored record version. The two differ for a source
225
+ // fill, and stamping such a record at the log key would move its version forward and make a
226
+ // later legitimate write in between look stale (harper#2411).
227
+ if (lastTimestamp !== txnLogKey) {
228
+ const torn = entries.corruptFrameStop.truncatedVersions.has(lastTimestamp);
229
+ lastTimestamp = txnLogKey;
177
230
  try {
178
- // commit the last transaction since we are starting a new one
179
- transaction?.directCommitSync();
231
+ // commit the last transaction since we are starting a new one, unless a corrupt
232
+ // frame swallowed the rest of it — half of a source transaction must never become
233
+ // durable, so it is dropped whole and stays in the log for a repaired retry
234
+ if (torn) {
235
+ writes -= stagedWrites;
236
+ discardedWrites += stagedWrites;
237
+ transaction?.abort();
238
+ }
239
+ else
240
+ transaction?.directCommitSync();
180
241
  }
181
242
  catch (error) {
182
- logger.error('Error committing replay transaction', error);
243
+ // directCommitSync aborts and detaches its transaction on failure; no cleanup here.
244
+ // The torn branch already backed stagedWrites out of writes before this try, so
245
+ // only a failed COMMIT (never applied) needs it backed out here too — otherwise a
246
+ // commit failure left `writes` counting records that never actually landed.
247
+ if (!torn)
248
+ writes -= stagedWrites;
249
+ if (electedReplayer) {
250
+ strictFailure = error;
251
+ break;
252
+ }
253
+ logger.error(`Error ${torn ? 'discarding a torn' : 'committing'} replay transaction`, error);
183
254
  }
255
+ stagedWrites = 0;
184
256
  // Abort if replay has exceeded the total wall-clock budget even while making progress
185
257
  // (harper#1316, facet a). shouldAbortStalledReplay resets its counters on every write,
186
258
  // so a slow-but-progressing replay (deep out-of-order audit chain walk per entry) can
@@ -189,13 +261,18 @@ function replayLogs(rootStore, tables) {
189
261
  // is not yet staged, so aborting never tears a same-version (same source-transaction)
190
262
  // write batch in half. Re-clone to recover the unreplayed remainder.
191
263
  if ((0, replayLogsGuards_ts_1.shouldAbortSlowReplay)(performance.now() - replayStartTime, replayTimeoutMs)) {
192
- logger.fatal(`Aborting transaction-log replay in ${rootStore.databaseName} database: replay has exceeded the wall-clock time limit (${writes} written, ${skipped} skipped). The transaction log contains a pathologically deep out-of-order write history that is too expensive to reconcile during boot (harper#1316). Re-clone this node from a healthy leader to recover the unreplayed data.`);
264
+ const slowMessage = `Aborting transaction-log replay in ${rootStore.databaseName} database: replay has exceeded the wall-clock time limit (${writes} written, ${skipped} skipped). The transaction log contains a pathologically deep out-of-order write history that is too expensive to reconcile during boot (harper#1316). Re-clone this node from a healthy leader to recover the unreplayed data.`;
193
265
  transaction = undefined; // already committed above; nothing staged for the new version
266
+ if (electedReplayer) {
267
+ strictFailure = new Error(slowMessage);
268
+ break;
269
+ }
270
+ logger.fatal(slowMessage);
194
271
  break;
195
272
  }
196
273
  transaction = new DatabaseTransaction_ts_1.DatabaseTransaction();
197
274
  transaction.db = primaryStore;
198
- transaction.timestamp = version;
275
+ transaction.timestamp = txnLogKey;
199
276
  // retries=1 routes operation.commit() through its retry path (no duplicate audit staging)
200
277
  transaction.retries = 1;
201
278
  // Explicit replay marker: skips schema validation (harper#1316) and makes save() stamp
@@ -204,8 +281,9 @@ function replayLogs(rootStore, tables) {
204
281
  transaction.isReplay = true;
205
282
  }
206
283
  context.transaction = transaction;
207
- const options = { context, residencyId, nodeId, originatingOperation };
284
+ const options = { context, residencyId, nodeId, originatingOperation, version };
208
285
  writes++;
286
+ stagedWrites++;
209
287
  switch (type) {
210
288
  case 'put':
211
289
  tableInstance._writeUpdate(recordId, record, true, options);
@@ -274,6 +352,10 @@ function replayLogs(rootStore, tables) {
274
352
  lastProgressTime = performance.now();
275
353
  }
276
354
  catch (err) {
355
+ if (electedReplayer) {
356
+ strictAbort(err, transaction);
357
+ break;
358
+ }
277
359
  // A write that threw made no forward progress either — count it toward the stall
278
360
  // bound so a continuous stream of throwing writes can't grind the boot thread
279
361
  // indefinitely (and the per-entry error log below can't spam unboundedly). harper#1266
@@ -283,18 +365,64 @@ function replayLogs(rootStore, tables) {
283
365
  });
284
366
  }
285
367
  }
286
- try {
287
- transaction?.directCommitSync();
368
+ const finalTorn = entries.corruptFrameStop.truncatedVersions.has(lastTimestamp);
369
+ if (!strictFailure) {
370
+ try {
371
+ if (finalTorn) {
372
+ writes -= stagedWrites;
373
+ discardedWrites += stagedWrites;
374
+ transaction?.abort();
375
+ }
376
+ else
377
+ transaction?.directCommitSync();
378
+ }
379
+ catch (error) {
380
+ // directCommitSync aborts and detaches its transaction on failure; no cleanup here.
381
+ // Mirrors the interior version-boundary catch above: a failed commit never applied, so
382
+ // it must not stay counted in `writes`.
383
+ if (!finalTorn)
384
+ writes -= stagedWrites;
385
+ if (electedReplayer)
386
+ strictFailure = error;
387
+ logger.error(`Error ${finalTorn ? 'discarding a torn' : 'committing'} replay transaction`, error);
388
+ }
288
389
  }
289
- catch (error) {
290
- logger.error('Error committing replay transaction', error);
390
+ // `breaks` also counts a torn tail — the designed, benign reading of a crash's last frame, and
391
+ // the reporter already logged it at `warn`. Only a mid-log break lost entries, so it alone earns
392
+ // this quarantine/repair summary; duplicating it for a torn tail would tell an operator to
393
+ // repair or re-clone the node on every ordinary unclean shutdown.
394
+ if (entries.corruptFrameStop.midLogBreak) {
395
+ logger.error(`Transaction-log replay in ${rootStore.databaseName} database stopped at a corrupt entry after replaying ${writes} records. Every entry after the break is quarantined — neither replayed nor replicated — and ${discardedWrites} record(s) of the transaction the break truncated were discarded rather than applied in part. Repair the transaction log or re-clone this node to recover them.`);
396
+ // electedReplayer must not resolve past known loss — see the doc comment above. Only set
397
+ // strictFailure if nothing has already failed the replay for an unrelated reason, so this
398
+ // diagnostic never shadows a more specific commit/write error.
399
+ if (electedReplayer && !strictFailure) {
400
+ strictFailure = new Error(`Elected replay in ${rootStore.databaseName} database stopped at a mid-log corrupt transaction-log frame; entries behind the break were acknowledged and are now quarantined. Refusing to publish a branch over known lost writes — repair the transaction log or re-clone this node.`);
401
+ }
291
402
  }
292
403
  if (writes > 0)
293
404
  logger.warn(`Replayed ${writes} records in ${rootStore.databaseName} database`);
294
405
  if (skipped > 0)
295
406
  logger.warn(`Skipped ${skipped} unrecoverable audit entries in ${rootStore.databaseName} database during replay`);
296
- // we never actually release the lock because we only want to ever run one time
297
- // rootStore.unlock('replayLogs');
407
+ if (strictFailure) {
408
+ // A failed strict replay must be re-runnable: the branch claim resets for a retry, so the
409
+ // lock must not be what survives to wedge it. Only a COMPLETED replay keeps the lock
410
+ // forever (the once-per-boot guarantee). Reject BEFORE unlocking: unlock wakes tryLock
411
+ // callbacks — including this holder's own resolve() — and the first settle must be the
412
+ // rejection, or a failed replay reads as success.
413
+ reject(strictFailure);
414
+ try {
415
+ rootStore.unlock('replayLogs');
416
+ }
417
+ catch (unlockError) {
418
+ logger.warn('Error releasing the replay lock after a failed replay', unlockError);
419
+ }
420
+ }
421
+ else {
422
+ // we never actually release the lock because we only want to ever run one time
423
+ // rootStore.unlock('replayLogs');
424
+ resolve();
425
+ }
298
426
  });
299
427
  }
300
428
  function asBinary(buffer) {
@@ -1 +1 @@
1
- {"version":3,"file":"replayLogs.js","sourceRoot":"","sources":["../../resources/replayLogs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,sDAYC;AAED,gCAgQC;AAvSD,4EAA8D;AAC9D,qEAA+D;AAE/D,6DAAmD;AACnD,yDAAmD;AACnD,+DAM+B;AAC/B,mDAAgD;AAChD,wFAA6E;AAC7E,wDAAuD;AAEvD,IAAI,qBAAqB,GAAG,KAAK,CAAC;AAElC,mGAAmG;AACnG,2FAA2F;AAC3F,gGAAgG;AAChG,oGAAoG;AACpG,kGAAkG;AAClG,mGAAmG;AACnG,uFAAuF;AACvF,SAAgB,qBAAqB,CAAC,QAAa,EAAE,OAAY;IAChE,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IACpE,CAAC;IACD,IAAI,QAAQ,IAAI,OAAO,QAAQ,CAAC,GAAG,KAAK,UAAU,EAAE,CAAC;QACpD,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,UAAU;YAAE,OAAO,IAAI,CAAC;QAC/D,OAAO,CACN,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;YAC1E,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,E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,IAAI,CAAC,aAAa,EAAE,CAAC;gBACvC,aAAa,GAAG,IAAI,KAAK,CACxB,qBAAsB,SAAiB,CAAC,YAAY,2OAA2O,CAC/R,CAAC;YACH,CAAC;QACF,CAAC;QACD,IAAI,MAAM,GAAG,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,YAAY,MAAM,eAAgB,SAAiB,CAAC,YAAY,WAAW,CAAC,CAAC;QACzG,IAAI,OAAO,GAAG,CAAC;YACd,MAAM,CAAC,IAAI,CACV,WAAW,OAAO,mCAAoC,SAAiB,CAAC,YAAY,yBAAyB,CAC7G,CAAC;QACH,IAAI,aAAa,EAAE,CAAC;YACnB,0FAA0F;YAC1F,qFAAqF;YACrF,uFAAuF;YACvF,uFAAuF;YACvF,kDAAkD;YAClD,MAAM,CAAC,aAAa,CAAC,CAAC;YACtB,IAAI,CAAC;gBACJ,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YAChC,CAAC;YAAC,OAAO,WAAW,EAAE,CAAC;gBACtB,MAAM,CAAC,IAAI,CAAC,uDAAuD,EAAE,WAAW,CAAC,CAAC;YACnF,CAAC;QACF,CAAC;aAAM,CAAC;YACP,+EAA+E;YAC/E,kCAAkC;YAClC,OAAO,EAAE,CAAC;QACX,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AACD,SAAS,QAAQ,CAAC,MAAM;IACvB,OAAO,EAAE,CAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;AAC5C,CAAC"}
@@ -60,11 +60,98 @@ export declare const REPLAY_WALL_CLOCK_LIMIT_MS: number;
60
60
  */
61
61
  export declare function shouldAbortSlowReplay(totalElapsedMs: number, timeLimitMs?: number): boolean;
62
62
  /**
63
- * Wraps a transaction-log query iterator so a corrupt/torn frame ends that log's iteration
64
- * cleanly instead of escaping as an uncaughtException. rocksdb-js throws a bounded RangeError
65
- * when an entry's framing is broken; framing loss means the next entry can't be located, so the
66
- * frame marks end-of-log (entries before it were already yielded) and startup replay /
67
- * replication broadcast continue. `onCorruptFrame` fires once, latched — kept a callback (not a
68
- * direct log) so this module stays out of the Harper module graph and is unit-testable.
63
+ * A corrupt transaction-log frame from rocksdb-js. `resyncPosition` is set only when intact entries
64
+ * follow the break, which is what distinguishes lost entries from a merely truncated tail; its
65
+ * absence is also all that any rocksdb-js predating that field can report.
69
66
  */
70
- export declare function endIteratorOnCorruptFrame<T>(iterator: Iterator<T>, onCorruptFrame: (error: RangeError) => void): IterableIterator<T>;
67
+ export type CorruptFrameError = RangeError & {
68
+ logId?: number | null;
69
+ position?: number | null;
70
+ resyncPosition?: number | null;
71
+ unreadableBytes?: number | null;
72
+ };
73
+ /**
74
+ * Corrupt frames hit by one `getRange` call, shared by its per-log iterators.
75
+ *
76
+ * `truncatedVersions` is what a consumer has to act on: a break destroys the framing after the last
77
+ * entry the broken log yielded, and whether the entries it swallowed continued that entry's version
78
+ * is exactly what can no longer be read — UNLESS that last entry's own `endTxn` already closed its
79
+ * transaction, in which case nothing of it was left open to swallow. That version's transaction is
80
+ * therefore incomplete only when it wasn't already known-closed, and replay must discard it rather
81
+ * than commit the part of it that was still readable. A log that broke before yielding anything
82
+ * truncates no transaction.
83
+ *
84
+ * `midLogBreak` is coarser: true once any break in this range left intact entries unreadable behind
85
+ * it (see {@link isMidLogBreak}), regardless of which version they belonged to. A consumer that must
86
+ * never serve a range with lost entries — an elected branch replay publishing itself as a trustworthy
87
+ * point-in-time copy — rejects on this rather than on `truncatedVersions`, since a mid-log break can
88
+ * strand entries whose version this range never even attributes to one log (harper#2016, #2063).
89
+ */
90
+ export interface CorruptFrameStop {
91
+ breaks: number;
92
+ truncatedVersions: Set<number>;
93
+ midLogBreak: boolean;
94
+ }
95
+ /**
96
+ * Whether a corrupt frame is a mid-log break — intact entries followed it, so entries were lost
97
+ * rather than the log merely being torn at its tail. Shared by the reporter below and by
98
+ * `RocksTransactionLogStore.getRange`'s `CorruptFrameStop.midLogBreak`, so the two can't drift on
99
+ * what counts as a mid-log break.
100
+ */
101
+ export declare function isMidLogBreak(error: CorruptFrameError): boolean;
102
+ /**
103
+ * Wraps a transaction-log query iterator so a corrupt/torn frame ends that log's iteration cleanly
104
+ * instead of escaping as an uncaughtException.
105
+ *
106
+ * Iteration stops at the break whether or not intact entries follow it. Resuming past a mid-log
107
+ * break would recover those entries, but a transaction log carries no frame-level transaction
108
+ * boundaries: replay groups equal-version entries into one source transaction, so skipping a frame
109
+ * inside such a group applies and checkpoints the surviving subset of a transaction that never
110
+ * committed that way at the source. Availability loss is visible and recoverable; a silently torn
111
+ * transaction is neither. Recovery is deferred until the engine can resume at a proven boundary
112
+ * (harper#2016, harper#2063); `resyncPosition` is used only to report the break as lost entries
113
+ * rather than as a truncated tail.
114
+ */
115
+ export declare function endIteratorOnCorruptFrame<T>(iterator: Iterator<T>, onCorruptFrame: (error: CorruptFrameError) => void): IterableIterator<T>;
116
+ /**
117
+ * A corrupt frame, accumulated for the life of the process. The same frame is re-encountered by
118
+ * every reader until each consumer's resume cursor has passed it, so this is deduplicated by
119
+ * location and the repeats become a count.
120
+ */
121
+ export interface CorruptFrameReport {
122
+ log: string;
123
+ logId?: number;
124
+ position?: number;
125
+ /** Intact entries followed the break, so entries were lost rather than merely truncated. */
126
+ midLog: boolean;
127
+ /** Extent of the unreadable region, when the engine reports it; 0 when nothing valid follows it. */
128
+ unreadableBytes: number;
129
+ firstSeen: number;
130
+ lastSeen: number;
131
+ occurrences: number;
132
+ }
133
+ /** Distinct break sites retained. One physical corruption yields one site, so this is generous. */
134
+ export declare const MAX_CORRUPT_FRAME_REPORTS = 256;
135
+ /**
136
+ * Every corrupt frame seen by this worker. This is not yet consumed by cluster/health status;
137
+ * callers must aggregate it across worker threads before exposing a node-wide signal.
138
+ *
139
+ * Mid-log breaks are immediately logged at error level even without that consumer.
140
+ */
141
+ export declare function getCorruptFrameReports(): CorruptFrameReport[];
142
+ /** Break sites evicted because {@link MAX_CORRUPT_FRAME_REPORTS} was reached. */
143
+ export declare function getEvictedCorruptFrameReportCount(): number;
144
+ export declare function clearCorruptFrameReports(): void;
145
+ /**
146
+ * Records a corrupt frame and logs it once per distinct break.
147
+ *
148
+ * A mid-log break is an `error`, not a `warn`: entries after it were acknowledged and are now
149
+ * quarantined behind it. Severity follows the break's own shape, never this pass's outcome — every
150
+ * pass stops, so keying on that would report the #2063 signature with the benign torn-tail `warn`.
151
+ * A site first seen as a torn tail can escalate later, since only a rocksdb-js that reports
152
+ * `resyncPosition` can tell the two apart.
153
+ */
154
+ export declare function createCorruptFrameReporter(logger: {
155
+ warn: (message: string, error?: unknown) => void;
156
+ error: (message: string, error?: unknown) => void;
157
+ }): (logName: string) => (error: CorruptFrameError) => void;