hikoutei 0.3.4 → 0.3.6

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 (355) hide show
  1. package/README.ja.md +44 -21
  2. package/README.ko.md +43 -23
  3. package/README.md +49 -33
  4. package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmMappedTypedSheets.d.ts +3 -3
  5. package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmMappedTypedSheets.d.ts.map +1 -1
  6. package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmMappedTypedSheets.js +1 -1
  7. package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmScalarEntityRuntime.d.ts +1 -1
  8. package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmScalarEntityRuntime.js +1 -1
  9. package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmScalarRuntime.js +3 -3
  10. package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmScalarRuntime.js.map +1 -1
  11. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.d.ts +3 -3
  12. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.d.ts.map +1 -1
  13. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.js +15 -15
  14. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.js.map +1 -1
  15. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingFastPath.d.ts +1 -1
  16. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingFastPath.d.ts.map +1 -1
  17. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingFastPath.js +3 -3
  18. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingFastPath.js.map +1 -1
  19. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingInspection.d.ts +5 -5
  20. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingInspection.d.ts.map +1 -1
  21. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingInspection.js +5 -5
  22. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingInspection.js.map +1 -1
  23. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingPersistence.d.ts +1 -1
  24. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingPersistence.js +5 -5
  25. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingPersistence.js.map +1 -1
  26. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingSql.js +3 -3
  27. package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingSql.js.map +1 -1
  28. package/dist/adapter/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.d.ts +156 -0
  29. package/dist/adapter/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.d.ts.map +1 -0
  30. package/dist/adapter/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.js +1112 -0
  31. package/dist/adapter/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.js.map +1 -0
  32. package/dist/adapter/sheets/providers/google-sheets-api/constants.d.ts +87 -0
  33. package/dist/adapter/sheets/providers/google-sheets-api/constants.d.ts.map +1 -0
  34. package/dist/adapter/sheets/providers/google-sheets-api/constants.js +97 -0
  35. package/dist/adapter/sheets/providers/google-sheets-api/constants.js.map +1 -0
  36. package/dist/adapter/sheets/providers/google-sheets-api/errors.d.ts +53 -0
  37. package/dist/adapter/sheets/providers/google-sheets-api/errors.d.ts.map +1 -0
  38. package/dist/adapter/sheets/providers/google-sheets-api/errors.js +61 -0
  39. package/dist/adapter/sheets/providers/google-sheets-api/errors.js.map +1 -0
  40. package/dist/adapter/sheets/providers/google-sheets-api/index.d.ts +16 -0
  41. package/dist/adapter/sheets/providers/google-sheets-api/index.d.ts.map +1 -0
  42. package/dist/adapter/sheets/providers/google-sheets-api/index.js +13 -0
  43. package/dist/adapter/sheets/providers/google-sheets-api/index.js.map +1 -0
  44. package/dist/adapter/sheets/providers/google-sheets-api/model/batchBuilder.d.ts +83 -0
  45. package/dist/adapter/sheets/providers/google-sheets-api/model/batchBuilder.d.ts.map +1 -0
  46. package/dist/adapter/sheets/providers/google-sheets-api/model/batchBuilder.js +413 -0
  47. package/dist/adapter/sheets/providers/google-sheets-api/model/batchBuilder.js.map +1 -0
  48. package/dist/adapter/sheets/providers/google-sheets-api/model/observation.d.ts +86 -0
  49. package/dist/adapter/sheets/providers/google-sheets-api/model/observation.d.ts.map +1 -0
  50. package/dist/adapter/sheets/providers/google-sheets-api/model/observation.js +439 -0
  51. package/dist/adapter/sheets/providers/google-sheets-api/model/observation.js.map +1 -0
  52. package/dist/adapter/sheets/providers/google-sheets-api/model/planner.d.ts +115 -0
  53. package/dist/adapter/sheets/providers/google-sheets-api/model/planner.d.ts.map +1 -0
  54. package/dist/adapter/sheets/providers/google-sheets-api/model/planner.js +522 -0
  55. package/dist/adapter/sheets/providers/google-sheets-api/model/planner.js.map +1 -0
  56. package/dist/adapter/sheets/providers/google-sheets-api/model/postcondition.d.ts +17 -0
  57. package/dist/adapter/sheets/providers/google-sheets-api/model/postcondition.d.ts.map +1 -0
  58. package/dist/adapter/sheets/providers/google-sheets-api/model/postcondition.js +99 -0
  59. package/dist/adapter/sheets/providers/google-sheets-api/model/postcondition.js.map +1 -0
  60. package/dist/adapter/sheets/providers/google-sheets-api/model/preflight.d.ts +242 -0
  61. package/dist/adapter/sheets/providers/google-sheets-api/model/preflight.d.ts.map +1 -0
  62. package/dist/adapter/sheets/providers/google-sheets-api/model/preflight.js +707 -0
  63. package/dist/adapter/sheets/providers/google-sheets-api/model/preflight.js.map +1 -0
  64. package/dist/adapter/sheets/providers/google-sheets-api/model/sheetIdAllocator.d.ts +16 -0
  65. package/dist/adapter/sheets/providers/google-sheets-api/model/sheetIdAllocator.d.ts.map +1 -0
  66. package/dist/adapter/sheets/providers/google-sheets-api/model/sheetIdAllocator.js +29 -0
  67. package/dist/adapter/sheets/providers/google-sheets-api/model/sheetIdAllocator.js.map +1 -0
  68. package/dist/adapter/sheets/providers/google-sheets-api/model/tableRead.d.ts +26 -0
  69. package/dist/adapter/sheets/providers/google-sheets-api/model/tableRead.d.ts.map +1 -0
  70. package/dist/adapter/sheets/providers/google-sheets-api/model/tableRead.js +57 -0
  71. package/dist/adapter/sheets/providers/google-sheets-api/model/tableRead.js.map +1 -0
  72. package/dist/adapter/sheets/providers/google-sheets-api/model/valueNormalization.d.ts +102 -0
  73. package/dist/adapter/sheets/providers/google-sheets-api/model/valueNormalization.d.ts.map +1 -0
  74. package/dist/adapter/sheets/providers/google-sheets-api/model/valueNormalization.js +375 -0
  75. package/dist/adapter/sheets/providers/google-sheets-api/model/valueNormalization.js.map +1 -0
  76. package/dist/adapter/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.d.ts +168 -0
  77. package/dist/adapter/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.d.ts.map +1 -0
  78. package/dist/adapter/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.js +247 -0
  79. package/dist/adapter/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.js.map +1 -0
  80. package/dist/adapter/sheets/providers/google-sheets-api/transport/rateLimiter.d.ts +47 -0
  81. package/dist/adapter/sheets/providers/google-sheets-api/transport/rateLimiter.d.ts.map +1 -0
  82. package/dist/adapter/sheets/providers/google-sheets-api/transport/rateLimiter.js +60 -0
  83. package/dist/adapter/sheets/providers/google-sheets-api/transport/rateLimiter.js.map +1 -0
  84. package/dist/api/Hikoutei.d.ts +1 -1
  85. package/dist/api/Hikoutei.js +1 -1
  86. package/dist/api/index.d.ts +2 -2
  87. package/dist/api/index.js +2 -2
  88. package/dist/application/orm/mapping/contracts.d.ts +2 -2
  89. package/dist/application/orm/mapping/contracts.d.ts.map +1 -1
  90. package/dist/application/orm/mapping/definition.js +5 -5
  91. package/dist/application/orm/mapping/definition.js.map +1 -1
  92. package/dist/application/orm/mapping/projection.js +7 -7
  93. package/dist/application/orm/mapping/projection.js.map +1 -1
  94. package/dist/application/orm/persistence/flush/flushCoordinator.d.ts +3 -3
  95. package/dist/application/orm/persistence/flush/flushCoordinator.d.ts.map +1 -1
  96. package/dist/application/orm/persistence/flush/flushCoordinator.js +2 -2
  97. package/dist/application/orm/persistence/flush/flushCoordinator.js.map +1 -1
  98. package/dist/application/orm/persistence/projection/projectionEffects.d.ts +1 -1
  99. package/dist/application/orm/persistence/projection/projectionEffects.js +6 -6
  100. package/dist/application/orm/persistence/projection/projectionEffects.js.map +1 -1
  101. package/dist/application/orm/persistence/support/contracts.d.ts +2 -2
  102. package/dist/application/orm/persistence/support/contracts.d.ts.map +1 -1
  103. package/dist/application/sync/inbound/autoSystemConflictResolution.js +7 -7
  104. package/dist/application/sync/inbound/autoSystemConflictResolution.js.map +1 -1
  105. package/dist/application/sync/inbound/polling/SimpleSheetPolling.d.ts +3 -3
  106. package/dist/application/sync/inbound/polling/SimpleSheetPolling.d.ts.map +1 -1
  107. package/dist/application/sync/inbound/polling/SimpleSheetPolling.js +1 -1
  108. package/dist/application/sync/inbound/polling/SimpleSheetPolling.js.map +1 -1
  109. package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.d.ts +17 -1
  110. package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.d.ts.map +1 -1
  111. package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.js +27 -1
  112. package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.js.map +1 -1
  113. package/dist/application/sync/outbound/effects/SyncEffectSupervisor.d.ts +2 -2
  114. package/dist/application/sync/outbound/effects/SyncEffectSupervisor.d.ts.map +1 -1
  115. package/dist/application/sync/outbound/effects/SyncEffectSupervisor.js +26 -6
  116. package/dist/application/sync/outbound/effects/SyncEffectSupervisor.js.map +1 -1
  117. package/dist/application/sync/outbound/effects/SyncEffectWorker.d.ts +24 -9
  118. package/dist/application/sync/outbound/effects/SyncEffectWorker.d.ts.map +1 -1
  119. package/dist/application/sync/outbound/effects/SyncEffectWorker.js +128 -81
  120. package/dist/application/sync/outbound/effects/SyncEffectWorker.js.map +1 -1
  121. package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.d.ts +31 -14
  122. package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.d.ts.map +1 -1
  123. package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.js +32 -15
  124. package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.js.map +1 -1
  125. package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.d.ts +13 -9
  126. package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.d.ts.map +1 -1
  127. package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.js +53 -37
  128. package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.js.map +1 -1
  129. package/dist/application/sync/outbound/effects/SyncEffectWorkerHelpers.js +1 -1
  130. package/dist/application/sync/outbound/effects/SyncEffectWorkerHelpers.js.map +1 -1
  131. package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.d.ts +29 -19
  132. package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.d.ts.map +1 -1
  133. package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.js +59 -41
  134. package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.js.map +1 -1
  135. package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.d.ts +4 -4
  136. package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.d.ts.map +1 -1
  137. package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.js +3 -3
  138. package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.js.map +1 -1
  139. package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.d.ts +3 -3
  140. package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.d.ts.map +1 -1
  141. package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.js +42 -46
  142. package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.js.map +1 -1
  143. package/dist/application/sync/outbound/projection/ProjectionEffectFactory.d.ts +8 -8
  144. package/dist/application/sync/outbound/projection/ProjectionEffectFactory.d.ts.map +1 -1
  145. package/dist/application/sync/outbound/projection/ProjectionEffectFactory.js +15 -15
  146. package/dist/application/sync/outbound/projection/ProjectionEffectFactory.js.map +1 -1
  147. package/dist/application/sync/outbound/reconciliation/ReconciliationScanner.d.ts +3 -3
  148. package/dist/application/sync/outbound/reconciliation/ReconciliationScanner.d.ts.map +1 -1
  149. package/dist/application/sync/outbound/reconciliation/ReconciliationScanner.js +10 -10
  150. package/dist/application/sync/outbound/reconciliation/ReconciliationScanner.js.map +1 -1
  151. package/dist/application/sync/service/SyncPollingSupervisor.d.ts +1 -1
  152. package/dist/application/sync/service/SyncPollingSupervisor.js +1 -1
  153. package/dist/application/sync/service/SyncServiceBootstrap.d.ts +29 -19
  154. package/dist/application/sync/service/SyncServiceBootstrap.d.ts.map +1 -1
  155. package/dist/application/sync/service/SyncServiceBootstrap.js +103 -78
  156. package/dist/application/sync/service/SyncServiceBootstrap.js.map +1 -1
  157. package/dist/application/sync/service/errors.d.ts +1 -1
  158. package/dist/application/sync/service/errors.js +1 -1
  159. package/dist/application/sync/service/errors.js.map +1 -1
  160. package/dist/application/sync/sheets/conflictProjection.d.ts.map +1 -0
  161. package/dist/application/sync/sheets/conflictProjection.js.map +1 -0
  162. package/dist/application/sync/{gateway → sheets}/conflictProjectionRegistration.d.ts +1 -1
  163. package/dist/application/sync/sheets/conflictProjectionRegistration.d.ts.map +1 -0
  164. package/dist/application/sync/{gateway → sheets}/conflictProjectionRegistration.js +3 -3
  165. package/dist/application/sync/sheets/conflictProjectionRegistration.js.map +1 -0
  166. package/dist/application/sync/sheets/constants.d.ts +66 -0
  167. package/dist/application/sync/sheets/constants.d.ts.map +1 -0
  168. package/dist/application/sync/{gateway → sheets}/constants.js +15 -15
  169. package/dist/application/sync/sheets/constants.js.map +1 -0
  170. package/dist/application/sync/sheets/errors.d.ts +15 -0
  171. package/dist/application/sync/sheets/errors.d.ts.map +1 -0
  172. package/dist/application/sync/sheets/errors.js +16 -0
  173. package/dist/application/sync/sheets/errors.js.map +1 -0
  174. package/dist/application/sync/{gateway/coordinator/CoordinatedSyncGateway.d.ts → sheets/mutationCoordinator/CoordinatedSheetsProvider.d.ts} +29 -28
  175. package/dist/application/sync/sheets/mutationCoordinator/CoordinatedSheetsProvider.d.ts.map +1 -0
  176. package/dist/application/sync/{gateway/coordinator/CoordinatedSyncGateway.js → sheets/mutationCoordinator/CoordinatedSheetsProvider.js} +27 -26
  177. package/dist/application/sync/sheets/mutationCoordinator/CoordinatedSheetsProvider.js.map +1 -0
  178. package/dist/application/sync/{gateway/coordinator → sheets/mutationCoordinator}/asyncMutex.d.ts +2 -3
  179. package/dist/application/sync/sheets/mutationCoordinator/asyncMutex.d.ts.map +1 -0
  180. package/dist/application/sync/sheets/mutationCoordinator/asyncMutex.js.map +1 -0
  181. package/dist/application/sync/{gateway/coordinator/coordinatorTelemetry.d.ts → sheets/mutationCoordinator/laneTelemetry.d.ts} +4 -4
  182. package/dist/application/sync/sheets/mutationCoordinator/laneTelemetry.d.ts.map +1 -0
  183. package/dist/application/sync/{gateway/coordinator/coordinatorTelemetry.js → sheets/mutationCoordinator/laneTelemetry.js} +5 -5
  184. package/dist/application/sync/sheets/mutationCoordinator/laneTelemetry.js.map +1 -0
  185. package/dist/application/sync/{gateway/SyncGatewayBootstrap.d.ts → sheets/sheetsProvisioning.d.ts} +14 -14
  186. package/dist/application/sync/sheets/sheetsProvisioning.d.ts.map +1 -0
  187. package/dist/application/sync/sheets/sheetsProvisioning.js +95 -0
  188. package/dist/application/sync/sheets/sheetsProvisioning.js.map +1 -0
  189. package/dist/application/sync/{gateway/syncGateway.d.ts → sheets/syncSheets.d.ts} +61 -117
  190. package/dist/application/sync/sheets/syncSheets.d.ts.map +1 -0
  191. package/dist/application/sync/sheets/syncSheets.js +144 -0
  192. package/dist/application/sync/sheets/syncSheets.js.map +1 -0
  193. package/dist/application/sync/{gateway/transportClassification.d.ts → sheets/transportOutcome.d.ts} +23 -22
  194. package/dist/application/sync/sheets/transportOutcome.d.ts.map +1 -0
  195. package/dist/application/sync/sheets/transportOutcome.js +97 -0
  196. package/dist/application/sync/sheets/transportOutcome.js.map +1 -0
  197. package/dist/application/sync/sheets/validation.d.ts +22 -0
  198. package/dist/application/sync/sheets/validation.d.ts.map +1 -0
  199. package/dist/application/sync/sheets/validation.js +79 -0
  200. package/dist/application/sync/sheets/validation.js.map +1 -0
  201. package/dist/application/sync/telemetry/syncTiming.d.ts +7 -7
  202. package/dist/application/sync/telemetry/syncTiming.d.ts.map +1 -1
  203. package/dist/application/sync/telemetry/syncTiming.js +2 -2
  204. package/dist/application/sync/telemetry/syncTiming.js.map +1 -1
  205. package/dist/domain/evaluate/contracts.d.ts +1 -1
  206. package/dist/domain/evaluate/contracts.js +1 -1
  207. package/dist/domain/model/constants.d.ts +1 -1
  208. package/dist/domain/model/constants.d.ts.map +1 -1
  209. package/dist/domain/model/types.d.ts +1 -1
  210. package/dist/domain/model/types.d.ts.map +1 -1
  211. package/dist/index.d.ts +3 -2
  212. package/dist/index.d.ts.map +1 -1
  213. package/dist/index.js +3 -2
  214. package/dist/index.js.map +1 -1
  215. package/dist/infrastructure/storage/index.d.ts +1 -1
  216. package/dist/infrastructure/storage/index.d.ts.map +1 -1
  217. package/dist/infrastructure/storage/index.js +1 -1
  218. package/dist/infrastructure/storage/index.js.map +1 -1
  219. package/dist/infrastructure/storage/state/observation/observationAudit.d.ts +1 -1
  220. package/dist/infrastructure/storage/state/observation/observationAudit.js +1 -1
  221. package/dist/infrastructure/storage/state/observation/observationTypes.d.ts +3 -3
  222. package/dist/infrastructure/storage/state/observation/observationTypes.d.ts.map +1 -1
  223. package/dist/infrastructure/storage/sync/outbound/effectOutbox.d.ts +13 -1
  224. package/dist/infrastructure/storage/sync/outbound/effectOutbox.d.ts.map +1 -1
  225. package/dist/infrastructure/storage/sync/outbound/effectOutbox.js +23 -2
  226. package/dist/infrastructure/storage/sync/outbound/effectOutbox.js.map +1 -1
  227. package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.d.ts +9 -3
  228. package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.d.ts.map +1 -1
  229. package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.js +7 -1
  230. package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.js.map +1 -1
  231. package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.d.ts +11 -1
  232. package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.d.ts.map +1 -1
  233. package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.js +44 -3
  234. package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.js.map +1 -1
  235. package/dist/infrastructure/storage/sync/shared/syncRegistry.d.ts +4 -4
  236. package/dist/infrastructure/storage/sync/shared/syncRegistry.d.ts.map +1 -1
  237. package/dist/infrastructure/storage/sync/shared/syncRegistry.js +4 -4
  238. package/dist/infrastructure/storage/sync/shared/syncRegistry.js.map +1 -1
  239. package/dist/shared/encoding/types.d.ts +1 -1
  240. package/docs/architecture.md +52 -23
  241. package/docs/ci.md +31 -23
  242. package/docs/code-guidelines.md +10 -18
  243. package/docs/development.md +37 -11
  244. package/docs/gateway-removal-inventory.md +147 -0
  245. package/docs/quick-start.md +36 -26
  246. package/docs/sync-bulk-write-benchmark.md +561 -0
  247. package/docs/sync-observability.md +38 -45
  248. package/docs/write-and-synchronization-flow.md +56 -39
  249. package/package.json +5 -4
  250. package/apps-script/gateway/Code.gs +0 -447
  251. package/dist/adapter/sheets/providers/apps-script-gateway/errors.d.ts +0 -43
  252. package/dist/adapter/sheets/providers/apps-script-gateway/errors.d.ts.map +0 -1
  253. package/dist/adapter/sheets/providers/apps-script-gateway/errors.js +0 -52
  254. package/dist/adapter/sheets/providers/apps-script-gateway/errors.js.map +0 -1
  255. package/dist/adapter/sheets/providers/apps-script-gateway/index.d.ts +0 -24
  256. package/dist/adapter/sheets/providers/apps-script-gateway/index.d.ts.map +0 -1
  257. package/dist/adapter/sheets/providers/apps-script-gateway/index.js +0 -13
  258. package/dist/adapter/sheets/providers/apps-script-gateway/index.js.map +0 -1
  259. package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperation.d.ts +0 -44
  260. package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperation.d.ts.map +0 -1
  261. package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperation.js +0 -181
  262. package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperation.js.map +0 -1
  263. package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperationScript.d.ts +0 -3
  264. package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperationScript.d.ts.map +0 -1
  265. package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperationScript.js +0 -810
  266. package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperationScript.js.map +0 -1
  267. package/dist/adapter/sheets/providers/apps-script-gateway/operations/observation/observationOperation.d.ts +0 -31
  268. package/dist/adapter/sheets/providers/apps-script-gateway/operations/observation/observationOperation.d.ts.map +0 -1
  269. package/dist/adapter/sheets/providers/apps-script-gateway/operations/observation/observationOperation.js +0 -560
  270. package/dist/adapter/sheets/providers/apps-script-gateway/operations/observation/observationOperation.js.map +0 -1
  271. package/dist/adapter/sheets/providers/apps-script-gateway/operations/read/tableReadOperation.d.ts +0 -12
  272. package/dist/adapter/sheets/providers/apps-script-gateway/operations/read/tableReadOperation.d.ts.map +0 -1
  273. package/dist/adapter/sheets/providers/apps-script-gateway/operations/read/tableReadOperation.js +0 -166
  274. package/dist/adapter/sheets/providers/apps-script-gateway/operations/read/tableReadOperation.js.map +0 -1
  275. package/dist/adapter/sheets/providers/apps-script-gateway/operations/shared/appsScriptStableCodecSource.d.ts +0 -8
  276. package/dist/adapter/sheets/providers/apps-script-gateway/operations/shared/appsScriptStableCodecSource.d.ts.map +0 -1
  277. package/dist/adapter/sheets/providers/apps-script-gateway/operations/shared/appsScriptStableCodecSource.js +0 -122
  278. package/dist/adapter/sheets/providers/apps-script-gateway/operations/shared/appsScriptStableCodecSource.js.map +0 -1
  279. package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/batchAppendOperation.d.ts +0 -31
  280. package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/batchAppendOperation.d.ts.map +0 -1
  281. package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/batchAppendOperation.js +0 -567
  282. package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/batchAppendOperation.js.map +0 -1
  283. package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/fastAppendOperation.d.ts +0 -19
  284. package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/fastAppendOperation.d.ts.map +0 -1
  285. package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/fastAppendOperation.js +0 -37
  286. package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/fastAppendOperation.js.map +0 -1
  287. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/codeGsProtocol.d.ts +0 -51
  288. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/codeGsProtocol.d.ts.map +0 -1
  289. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/codeGsProtocol.js +0 -60
  290. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/codeGsProtocol.js.map +0 -1
  291. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/constants.d.ts +0 -44
  292. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/constants.d.ts.map +0 -1
  293. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/constants.js +0 -40
  294. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/constants.js.map +0 -1
  295. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/syncProtocol.d.ts +0 -12
  296. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/syncProtocol.d.ts.map +0 -1
  297. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/syncProtocol.js +0 -41
  298. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/syncProtocol.js.map +0 -1
  299. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/timing.d.ts +0 -5
  300. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/timing.d.ts.map +0 -1
  301. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/timing.js +0 -53
  302. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/timing.js.map +0 -1
  303. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/types.d.ts +0 -4
  304. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/types.d.ts.map +0 -1
  305. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/types.js +0 -2
  306. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/types.js.map +0 -1
  307. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/validation.d.ts +0 -11
  308. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/validation.d.ts.map +0 -1
  309. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/validation.js +0 -36
  310. package/dist/adapter/sheets/providers/apps-script-gateway/protocol/validation.js.map +0 -1
  311. package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationClient.d.ts +0 -68
  312. package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationClient.d.ts.map +0 -1
  313. package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationClient.js +0 -273
  314. package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationClient.js.map +0 -1
  315. package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationSyncGateway.d.ts +0 -73
  316. package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationSyncGateway.d.ts.map +0 -1
  317. package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationSyncGateway.js +0 -363
  318. package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationSyncGateway.js.map +0 -1
  319. package/dist/adapter/sheets/providers/apps-script-gateway/validation.d.ts +0 -3
  320. package/dist/adapter/sheets/providers/apps-script-gateway/validation.d.ts.map +0 -1
  321. package/dist/adapter/sheets/providers/apps-script-gateway/validation.js +0 -10
  322. package/dist/adapter/sheets/providers/apps-script-gateway/validation.js.map +0 -1
  323. package/dist/application/sync/gateway/SyncGatewayBootstrap.d.ts.map +0 -1
  324. package/dist/application/sync/gateway/SyncGatewayBootstrap.js +0 -95
  325. package/dist/application/sync/gateway/SyncGatewayBootstrap.js.map +0 -1
  326. package/dist/application/sync/gateway/conflictProjection.d.ts.map +0 -1
  327. package/dist/application/sync/gateway/conflictProjection.js.map +0 -1
  328. package/dist/application/sync/gateway/conflictProjectionRegistration.d.ts.map +0 -1
  329. package/dist/application/sync/gateway/conflictProjectionRegistration.js.map +0 -1
  330. package/dist/application/sync/gateway/constants.d.ts +0 -66
  331. package/dist/application/sync/gateway/constants.d.ts.map +0 -1
  332. package/dist/application/sync/gateway/constants.js.map +0 -1
  333. package/dist/application/sync/gateway/coordinator/CoordinatedSyncGateway.d.ts.map +0 -1
  334. package/dist/application/sync/gateway/coordinator/CoordinatedSyncGateway.js.map +0 -1
  335. package/dist/application/sync/gateway/coordinator/asyncMutex.d.ts.map +0 -1
  336. package/dist/application/sync/gateway/coordinator/asyncMutex.js.map +0 -1
  337. package/dist/application/sync/gateway/coordinator/coordinatorTelemetry.d.ts.map +0 -1
  338. package/dist/application/sync/gateway/coordinator/coordinatorTelemetry.js.map +0 -1
  339. package/dist/application/sync/gateway/errors.d.ts +0 -15
  340. package/dist/application/sync/gateway/errors.d.ts.map +0 -1
  341. package/dist/application/sync/gateway/errors.js +0 -16
  342. package/dist/application/sync/gateway/errors.js.map +0 -1
  343. package/dist/application/sync/gateway/syncGateway.d.ts.map +0 -1
  344. package/dist/application/sync/gateway/syncGateway.js +0 -191
  345. package/dist/application/sync/gateway/syncGateway.js.map +0 -1
  346. package/dist/application/sync/gateway/transportClassification.d.ts.map +0 -1
  347. package/dist/application/sync/gateway/transportClassification.js +0 -133
  348. package/dist/application/sync/gateway/transportClassification.js.map +0 -1
  349. package/dist/application/sync/gateway/validation.d.ts +0 -22
  350. package/dist/application/sync/gateway/validation.d.ts.map +0 -1
  351. package/dist/application/sync/gateway/validation.js +0 -79
  352. package/dist/application/sync/gateway/validation.js.map +0 -1
  353. /package/dist/application/sync/{gateway → sheets}/conflictProjection.d.ts +0 -0
  354. /package/dist/application/sync/{gateway → sheets}/conflictProjection.js +0 -0
  355. /package/dist/application/sync/{gateway/coordinator → sheets/mutationCoordinator}/asyncMutex.js +0 -0
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Shared provider contract for the SQLite-authoritative sync runtime.
3
+ *
4
+ * The contract deliberately contains normalized values and stable anchors,
5
+ * never Google SDK objects or physical row numbers. Both the fake provider and
6
+ * the Google Sheets API provider implement this boundary so fault tests
7
+ * exercise the same compare-and-set semantics as a deployed provider.
8
+ */
9
+ import { stableHash, } from "../../../domain/index.js";
10
+ import { JAVASCRIPT_TYPE_NAMES } from "../../../shared/encoding/constants.js";
11
+ import { isJavaScriptType, isNormalizedCell, isRecord, } from "../../../shared/encoding/index.js";
12
+ import { APPLICABILITY_KINDS } from "../../../shared/state/constants.js";
13
+ import { applicableValue, notApplicableValue, } from "../../../shared/state/index.js";
14
+ import { EMPTY_ARRAY_LENGTH_ZERO, EMPTY_STRING_LENGTH_ZERO, } from "../../../shared/constants.js";
15
+ import { SYNC_SHEETS_ERROR_CODES, SyncSheetsContractError, } from "./errors.js";
16
+ import { requireSyncSheetsPositiveSafeInteger, requireSyncSheetsText, } from "./validation.js";
17
+ /** Returns whether a provider supports the one-request observation path. */
18
+ export function isSyncSheetsObservationBatchProvider(provider) {
19
+ return "observeSnapshot" in provider &&
20
+ typeof provider.observeSnapshot === "function" &&
21
+ "observeSnapshots" in provider &&
22
+ typeof provider.observeSnapshots === "function";
23
+ }
24
+ /** Reads one snapshot with one combined request when the provider supports it. */
25
+ export async function observeSyncSnapshot(provider, request) {
26
+ if (isSyncSheetsObservationBatchProvider(provider)) {
27
+ return provider.observeSnapshot(request);
28
+ }
29
+ const anchors = await provider.ensureRowAnchors(request);
30
+ const snapshot = await provider.readSnapshot(request);
31
+ return { anchors, snapshot };
32
+ }
33
+ /** Reads several snapshots through one remote operation when available. */
34
+ export async function observeSyncSnapshots(provider, requests) {
35
+ if (isSyncSheetsObservationBatchProvider(provider)) {
36
+ return provider.observeSnapshots(requests);
37
+ }
38
+ const results = [];
39
+ for (const request of requests) {
40
+ results.push(await observeSyncSnapshot(provider, request));
41
+ }
42
+ return results;
43
+ }
44
+ /** Returns whether a full observation provider also exposes the values-only reader. */
45
+ export function isSyncSheetsTableReader(provider) {
46
+ return "readRows" in provider &&
47
+ typeof provider.readRows === "function" &&
48
+ "readRowsBatch" in provider &&
49
+ typeof provider.readRowsBatch === "function";
50
+ }
51
+ /** Computes the stable visible-state hash shared by fake and real providers. */
52
+ export function computeSyncVisibleHash(fields) {
53
+ const entries = Object.entries(fields)
54
+ // Apps Script's operation sources use the same UTF-16 code-unit order.
55
+ .sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
56
+ .map(([fieldName, value]) => ({ fieldName, value }));
57
+ return stableHash({ fields: entries });
58
+ }
59
+ /** Validates and decodes the projection payload stored in a durable outbox row. */
60
+ export function parseSyncProjectionEffectPayload(value) {
61
+ let parsed;
62
+ try {
63
+ parsed = JSON.parse(value);
64
+ }
65
+ catch {
66
+ throw new SyncSheetsContractError(SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD, "effect payload is not valid JSON");
67
+ }
68
+ if (!isRecord(parsed)) {
69
+ throw new SyncSheetsContractError(SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD, "effect payload must be an object");
70
+ }
71
+ const sheetName = requireSyncSheetsText(parsed.sheetName, "effect payload sheetName", SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD);
72
+ const registeredRange = requireSyncSheetsText(parsed.registeredRange, "effect payload registeredRange", SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD);
73
+ const targetAnchor = requireSyncSheetsText(parsed.targetAnchor, "effect payload targetAnchor", SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD);
74
+ const targetVisibleHash = requireSyncSheetsText(parsed.targetVisibleHash, "effect payload targetVisibleHash", SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD);
75
+ const schemaVersion = requireSyncSheetsPositiveSafeInteger(parsed.schemaVersion, "effect payload schemaVersion", SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD);
76
+ if (!isJavaScriptType(parsed.createIfMissing, JAVASCRIPT_TYPE_NAMES.BOOLEAN)) {
77
+ throw new SyncSheetsContractError(SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD, "effect payload createIfMissing must be boolean");
78
+ }
79
+ const expectedCandidateHash = parseNullableCandidateHash(parsed.expectedCandidateHash);
80
+ if (!isRecord(parsed.fields)) {
81
+ throw new SyncSheetsContractError(SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD, "effect payload fields must be an object");
82
+ }
83
+ const fields = {};
84
+ for (const [fieldName, cell] of Object.entries(parsed.fields)) {
85
+ if (fieldName.length === EMPTY_STRING_LENGTH_ZERO ||
86
+ !isNormalizedCell(cell)) {
87
+ throw new SyncSheetsContractError(SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD, "effect payload contains an invalid normalized field");
88
+ }
89
+ fields[fieldName] = cell;
90
+ }
91
+ if (Object.keys(fields).length === EMPTY_ARRAY_LENGTH_ZERO) {
92
+ throw new SyncSheetsContractError(SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD, "effect payload must contain a field");
93
+ }
94
+ if (computeSyncVisibleHash(fields) !== targetVisibleHash) {
95
+ throw new SyncSheetsContractError(SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD, "effect payload targetVisibleHash does not match its fields");
96
+ }
97
+ return {
98
+ sheetName,
99
+ registeredRange,
100
+ schemaVersion,
101
+ targetAnchor,
102
+ fields,
103
+ targetVisibleHash,
104
+ createIfMissing: parsed.createIfMissing,
105
+ expectedCandidateHash,
106
+ };
107
+ }
108
+ /** Serializes a checked projection payload in a stable key order for outbox use. */
109
+ export function serializeSyncProjectionEffectPayload(payload) {
110
+ // Validate before serialization so worker and provider fail at the same boundary.
111
+ const checked = parseSyncProjectionEffectPayload(JSON.stringify(toWireProjectionEffectPayload(payload)));
112
+ return JSON.stringify({
113
+ sheetName: checked.sheetName,
114
+ registeredRange: checked.registeredRange,
115
+ schemaVersion: checked.schemaVersion,
116
+ targetAnchor: checked.targetAnchor,
117
+ fields: Object.fromEntries(Object.entries(checked.fields).sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))),
118
+ targetVisibleHash: checked.targetVisibleHash,
119
+ createIfMissing: checked.createIfMissing,
120
+ expectedCandidateHash: toNullableCandidateHash(checked.expectedCandidateHash),
121
+ });
122
+ }
123
+ function parseNullableCandidateHash(value) {
124
+ if (value === null) {
125
+ return notApplicableValue();
126
+ }
127
+ return applicableValue(requireSyncSheetsText(value, "effect payload expectedCandidateHash", SYNC_SHEETS_ERROR_CODES.INVALID_EFFECT_PAYLOAD));
128
+ }
129
+ function toWireProjectionEffectPayload(payload) {
130
+ return {
131
+ sheetName: payload.sheetName,
132
+ registeredRange: payload.registeredRange,
133
+ schemaVersion: payload.schemaVersion,
134
+ targetAnchor: payload.targetAnchor,
135
+ fields: payload.fields,
136
+ targetVisibleHash: payload.targetVisibleHash,
137
+ createIfMissing: payload.createIfMissing,
138
+ expectedCandidateHash: toNullableCandidateHash(payload.expectedCandidateHash),
139
+ };
140
+ }
141
+ function toNullableCandidateHash(value) {
142
+ return value.kind === APPLICABILITY_KINDS.APPLICABLE ? value.value : null;
143
+ }
144
+ //# sourceMappingURL=syncSheets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syncSheets.js","sourceRoot":"","sources":["../../../../src/application/sync/sheets/syncSheets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,UAAU,GAKX,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,GACT,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EACL,eAAe,EACf,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AAUtC,OAAO,EACL,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oCAAoC,EACpC,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAkFzB,4EAA4E;AAC5E,MAAM,UAAU,oCAAoC,CAClD,QAAuC;IAEvC,OAAO,iBAAiB,IAAI,QAAQ;QAClC,OAAO,QAAQ,CAAC,eAAe,KAAK,UAAU;QAC9C,kBAAkB,IAAI,QAAQ;QAC9B,OAAO,QAAQ,CAAC,gBAAgB,KAAK,UAAU,CAAC;AACpD,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,QAAuC,EACvC,OAAgC;IAEhC,IAAI,oCAAoC,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnD,OAAO,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAC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QACtB,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,qBAAqB,EAAE,uBAAuB,CAAC,OAAO,CAAC,qBAAqB,CAAC;KAC9E,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,KAA4B;IAC3D,OAAO,KAAK,CAAC,IAAI,KAAK,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5E,CAAC"}
@@ -1,22 +1,20 @@
1
1
  /**
2
- * Structured classification of a Gateway transport outcome.
2
+ * Structured classification of a provider transport outcome.
3
3
  *
4
- * The Apps Script transport can fail for three very different reasons that the
5
- * effect worker must not treat the same way:
4
+ * The direct Sheets transport can fail for three very different reasons that
5
+ * the effect worker must not treat the same way:
6
6
  *
7
7
  * - `success`: a decoded, valid envelope was returned.
8
8
  * - `explicit_remote_failure`: the remote returned a structured rejection that
9
- * proves no operation ran (e.g. a signed-envelope validation failure). The
10
- * remote state is known, so the effect can transition to a terminal failure
11
- * state.
9
+ * proves no operation ran (e.g. a 4xx API validation failure). The remote
10
+ * state is known, so the effect can transition to a terminal failure state.
12
11
  * - `delivery_uncertain`: the transport gave no usable answer (timeout,
13
- * network error, non-JSON/404 response, lost connection), or the Gateway
14
- * failed during/after operation execution (`operation_failed`,
15
- * `internal_error`). The remote may or may not have committed the write, so
16
- * the effect must be recovered through a postcondition probe rather than
17
- * immediately redriven. Per-effect guard/schema/identity rejections are not
18
- * transport errors at all: they arrive as per-effect result statuses in a
19
- * successful envelope and keep their existing terminal handling.
12
+ * network error, non-JSON/404 response, lost connection). The remote may or
13
+ * may not have committed the write, so the effect must be recovered through
14
+ * a postcondition probe rather than immediately redriven. Per-effect
15
+ * guard/schema/identity rejections are not transport errors at all: they
16
+ * arrive as per-effect result statuses in a successful envelope and keep
17
+ * their existing terminal handling.
20
18
  *
21
19
  * This boundary lets future durable `delivery_uncertain` state and recovery
22
20
  * barriers classify a thrown transport error without re-deriving the rules at
@@ -24,7 +22,7 @@
24
22
  * promoted to `success`, and a proven pre-mutation rejection is never
25
23
  * reclassified as a retryable transport error.
26
24
  */
27
- import { AppsScriptSyncGatewayError } from "../../../adapter/sheets/providers/apps-script-gateway/errors.js";
25
+ import { GoogleSheetsApiTransportError } from "../../../adapter/sheets/providers/google-sheets-api/errors.js";
28
26
  import type { Presence } from "../../../shared/state/types.js";
29
27
  export declare const TRANSPORT_OUTCOME_KINDS: {
30
28
  readonly SUCCESS: "success";
@@ -41,7 +39,7 @@ export interface TransportOutcome {
41
39
  readonly message: string;
42
40
  }
43
41
  /**
44
- * Classifies a value thrown by the Gateway transport.
42
+ * Classifies a value thrown by the provider transport.
45
43
  *
46
44
  * `undefined`/`null` means no error was observed and is classified as success;
47
45
  * callers should normally pass a caught error. Any non-transport error is left
@@ -52,11 +50,14 @@ export declare function classifyTransportOutcome(error: unknown): TransportOutco
52
50
  /** Returns true when the remote state cannot be proven either way. */
53
51
  export declare function isDeliveryUncertainOutcome(outcome: TransportOutcome): boolean;
54
52
  /**
55
- * Returns true when the Apps Script transport error implies an ambiguous
56
- * delivery. Non-success HTTP responses are not proof that a mutating batch did
57
- * not begin: Apps Script/proxy failures can be emitted after a partial remote
58
- * write. Only a structured 2xx operation result can provide per-effect
59
- * rejection evidence to the worker.
53
+ * Returns true when the direct Sheets transport error implies an ambiguous
54
+ * delivery.
55
+ *
56
+ * Google API non-2xx responses prove the batch did not execute only for the
57
+ * pre-mutation rejection statuses below; timeouts, network failures, and
58
+ * proxy-emitted 408/429/5xx responses can follow a committed write, and a
59
+ * malformed 2xx reply cannot prove what was applied. Those are recovered
60
+ * through the postcondition probe path, never closed as success.
60
61
  */
61
- export declare function isDeliveryUncertain(error: AppsScriptSyncGatewayError): boolean;
62
- //# sourceMappingURL=transportClassification.d.ts.map
62
+ export declare function isGoogleSheetsApiDeliveryUncertain(error: GoogleSheetsApiTransportError): boolean;
63
+ //# sourceMappingURL=transportOutcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transportOutcome.d.ts","sourceRoot":"","sources":["../../../../src/application/sync/sheets/transportOutcome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,6BAA6B,EAA2C,MAAM,+DAA+D,CAAC;AAEvJ,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE/D,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAC9B,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAEzE,sEAAsE;AACtE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CA2BzE;AAED,sEAAsE;AACtE,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAE7E;AAED;;;;;;;;;GASG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAeT"}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Structured classification of a provider transport outcome.
3
+ *
4
+ * The direct Sheets transport can fail for three very different reasons that
5
+ * the effect worker must not treat the same way:
6
+ *
7
+ * - `success`: a decoded, valid envelope was returned.
8
+ * - `explicit_remote_failure`: the remote returned a structured rejection that
9
+ * proves no operation ran (e.g. a 4xx API validation failure). The remote
10
+ * state is known, so the effect can transition to a terminal failure state.
11
+ * - `delivery_uncertain`: the transport gave no usable answer (timeout,
12
+ * network error, non-JSON/404 response, lost connection). The remote may or
13
+ * may not have committed the write, so the effect must be recovered through
14
+ * a postcondition probe rather than immediately redriven. Per-effect
15
+ * guard/schema/identity rejections are not transport errors at all: they
16
+ * arrive as per-effect result statuses in a successful envelope and keep
17
+ * their existing terminal handling.
18
+ *
19
+ * This boundary lets future durable `delivery_uncertain` state and recovery
20
+ * barriers classify a thrown transport error without re-deriving the rules at
21
+ * every call site. It never weakens correctness: an uncertain outcome is never
22
+ * promoted to `success`, and a proven pre-mutation rejection is never
23
+ * reclassified as a retryable transport error.
24
+ */
25
+ import { GoogleSheetsApiTransportError, GOOGLE_SHEETS_API_TRANSPORT_ERROR_CODES } from "../../../adapter/sheets/providers/google-sheets-api/errors.js";
26
+ import { PRESENCE_KINDS } from "../../../shared/state/index.js";
27
+ export const TRANSPORT_OUTCOME_KINDS = {
28
+ SUCCESS: "success",
29
+ EXPLICIT_REMOTE_FAILURE: "explicit_remote_failure",
30
+ DELIVERY_UNCERTAIN: "delivery_uncertain",
31
+ };
32
+ /**
33
+ * Classifies a value thrown by the provider transport.
34
+ *
35
+ * `undefined`/`null` means no error was observed and is classified as success;
36
+ * callers should normally pass a caught error. Any non-transport error is left
37
+ * as `delivery_uncertain` rather than `success` because the caller cannot prove
38
+ * the remote state either way.
39
+ */
40
+ export function classifyTransportOutcome(error) {
41
+ if (error === undefined || error === null) {
42
+ return {
43
+ kind: TRANSPORT_OUTCOME_KINDS.SUCCESS,
44
+ httpStatus: { kind: PRESENCE_KINDS.ABSENT },
45
+ code: { kind: PRESENCE_KINDS.ABSENT },
46
+ message: "",
47
+ };
48
+ }
49
+ if (error instanceof GoogleSheetsApiTransportError) {
50
+ const kind = isGoogleSheetsApiDeliveryUncertain(error)
51
+ ? TRANSPORT_OUTCOME_KINDS.DELIVERY_UNCERTAIN
52
+ : TRANSPORT_OUTCOME_KINDS.EXPLICIT_REMOTE_FAILURE;
53
+ return {
54
+ kind,
55
+ httpStatus: error.status,
56
+ code: error.remoteCode,
57
+ message: error.message,
58
+ };
59
+ }
60
+ // Unknown transport/Node error: assume the remote state is unverifiable.
61
+ return {
62
+ kind: TRANSPORT_OUTCOME_KINDS.DELIVERY_UNCERTAIN,
63
+ httpStatus: { kind: PRESENCE_KINDS.ABSENT },
64
+ code: { kind: PRESENCE_KINDS.ABSENT },
65
+ message: error instanceof Error ? error.message : "Unexpected transport failure",
66
+ };
67
+ }
68
+ /** Returns true when the remote state cannot be proven either way. */
69
+ export function isDeliveryUncertainOutcome(outcome) {
70
+ return outcome.kind === TRANSPORT_OUTCOME_KINDS.DELIVERY_UNCERTAIN;
71
+ }
72
+ /**
73
+ * Returns true when the direct Sheets transport error implies an ambiguous
74
+ * delivery.
75
+ *
76
+ * Google API non-2xx responses prove the batch did not execute only for the
77
+ * pre-mutation rejection statuses below; timeouts, network failures, and
78
+ * proxy-emitted 408/429/5xx responses can follow a committed write, and a
79
+ * malformed 2xx reply cannot prove what was applied. Those are recovered
80
+ * through the postcondition probe path, never closed as success.
81
+ */
82
+ export function isGoogleSheetsApiDeliveryUncertain(error) {
83
+ if (error.code === GOOGLE_SHEETS_API_TRANSPORT_ERROR_CODES.TIMEOUT ||
84
+ error.code === GOOGLE_SHEETS_API_TRANSPORT_ERROR_CODES.NETWORK_ERROR ||
85
+ error.code === GOOGLE_SHEETS_API_TRANSPORT_ERROR_CODES.INVALID_RESPONSE) {
86
+ return true;
87
+ }
88
+ if (error.status.kind !== PRESENCE_KINDS.PRESENT)
89
+ return true;
90
+ const status = error.status.value;
91
+ if (status === 400 || status === 401 || status === 403 || status === 404) {
92
+ // The API rejected the request before executing any part of the batch.
93
+ return false;
94
+ }
95
+ return true;
96
+ }
97
+ //# sourceMappingURL=transportOutcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transportOutcome.js","sourceRoot":"","sources":["../../../../src/application/sync/sheets/transportOutcome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;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8B;KACjF,CAAC;AACJ,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,0BAA0B,CAAC,OAAyB;IAClE,OAAO,OAAO,CAAC,IAAI,KAAK,uBAAuB,CAAC,kBAAkB,CAAC;AACrE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,kCAAkC,CAChD,KAAoC;IAEpC,IACE,KAAK,CAAC,IAAI,KAAK,uCAAuC,CAAC,OAAO;QAC9D,KAAK,CAAC,IAAI,KAAK,uCAAuC,CAAC,aAAa;QACpE,KAAK,CAAC,IAAI,KAAK,uCAAuC,CAAC,gBAAgB,EACvE,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC9D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IAClC,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACzE,uEAAuE;QACvE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { Presence } from "../../../shared/state/types.js";
2
+ import { type SyncProjectionKind, type SyncProtocolVersion, type SyncSnapshotReadMode } from "./constants.js";
3
+ import { type SyncSheetsErrorCode } from "./errors.js";
4
+ /** Requires a non-empty string at a provider contract boundary. */
5
+ export declare function requireSyncSheetsText(value: unknown, label: string, errorCode: SyncSheetsErrorCode): string;
6
+ /** Requires a positive safe integer at a provider contract boundary. */
7
+ export declare function requireSyncSheetsPositiveSafeInteger(value: unknown, label: string, errorCode: SyncSheetsErrorCode): number;
8
+ /** Requires a non-negative safe integer at a provider contract boundary. */
9
+ export declare function requireSyncSheetsNonNegativeSafeInteger(value: unknown, label: string, errorCode: SyncSheetsErrorCode): number;
10
+ /** Decodes an optional text value returned by the runtime provider. */
11
+ export declare function decodeSyncSheetsPresenceString(value: unknown, label: string, errorCode?: SyncSheetsErrorCode): Presence<string>;
12
+ /** Decodes an optional non-negative revision returned by the runtime provider. */
13
+ export declare function decodeSyncSheetsPresenceNonNegativeSafeInteger(value: unknown, label: string, errorCode?: SyncSheetsErrorCode): Presence<number>;
14
+ /** Requires a protocol version returned by the runtime provider. */
15
+ export declare function requireSyncProtocolVersion(value: unknown, label: string, errorCode: SyncSheetsErrorCode): SyncProtocolVersion;
16
+ /** Requires a projection label returned by the runtime provider. */
17
+ export declare function requireSyncProjectionKind(value: unknown, label: string, errorCode: SyncSheetsErrorCode): SyncProjectionKind;
18
+ /** Requires a supported snapshot detail level at a provider boundary. */
19
+ export declare function requireSyncSnapshotReadMode(value: unknown, label: string, errorCode: SyncSheetsErrorCode): SyncSnapshotReadMode;
20
+ /** Requires a non-empty list at a provider contract boundary. */
21
+ export declare function requireSyncSheetsNonEmptyList<T>(values: readonly T[], label: string, errorCode: SyncSheetsErrorCode): void;
22
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/application/sync/sheets/validation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAQ/D,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAErB,mEAAmE;AACnE,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,mBAAmB,GAC7B,MAAM,CAKR;AAED,wEAAwE;AACxE,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,mBAAmB,GAC7B,MAAM,CAQR;AAED,4EAA4E;AAC5E,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,mBAAmB,GAC7B,MAAM,CAQR;AAED,uEAAuE;AACvE,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,mBAAuE,GACjF,QAAQ,CAAC,MAAM,CAAC,CAGlB;AAED,kFAAkF;AAClF,wBAAgB,8CAA8C,CAC5D,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,mBAAuE,GACjF,QAAQ,CAAC,MAAM,CAAC,CAGlB;AAED,oEAAoE;AACpE,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,mBAAmB,GAC7B,mBAAmB,CAWrB;AAED,oEAAoE;AACpE,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,mBAAmB,GAC7B,kBAAkB,CAWpB;AAED,yEAAyE;AACzE,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,mBAAmB,GAC7B,oBAAoB,CAWtB;AAED,iEAAiE;AACjE,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,mBAAmB,GAC7B,IAAI,CAIN"}
@@ -0,0 +1,79 @@
1
+ import { JAVASCRIPT_TYPE_NAMES } from "../../../shared/encoding/constants.js";
2
+ import { absentValue, presentValue, } from "../../../shared/state/index.js";
3
+ import { isJavaScriptType } from "../../../shared/encoding/typeGuards.js";
4
+ import { isNonEmptyList, isNonEmptyString, isNonNegativeSafeInteger, isPositiveSafeInteger, } from "../../../shared/validation.js";
5
+ import { SYNC_PROJECTIONS, SYNC_PROTOCOL_VERSIONS, SYNC_SNAPSHOT_READ_MODES, } from "./constants.js";
6
+ import { SYNC_SHEETS_ERROR_CODES, SyncSheetsContractError, } from "./errors.js";
7
+ /** Requires a non-empty string at a provider contract boundary. */
8
+ export function requireSyncSheetsText(value, label, errorCode) {
9
+ if (!isNonEmptyString(value)) {
10
+ throw new SyncSheetsContractError(errorCode, `${label} is required`);
11
+ }
12
+ return value;
13
+ }
14
+ /** Requires a positive safe integer at a provider contract boundary. */
15
+ export function requireSyncSheetsPositiveSafeInteger(value, label, errorCode) {
16
+ if (!isPositiveSafeInteger(value)) {
17
+ throw new SyncSheetsContractError(errorCode, `${label} must be a positive safe integer`);
18
+ }
19
+ return value;
20
+ }
21
+ /** Requires a non-negative safe integer at a provider contract boundary. */
22
+ export function requireSyncSheetsNonNegativeSafeInteger(value, label, errorCode) {
23
+ if (!isNonNegativeSafeInteger(value)) {
24
+ throw new SyncSheetsContractError(errorCode, `${label} must be a non-negative safe integer`);
25
+ }
26
+ return value;
27
+ }
28
+ /** Decodes an optional text value returned by the runtime provider. */
29
+ export function decodeSyncSheetsPresenceString(value, label, errorCode = SYNC_SHEETS_ERROR_CODES.INVALID_PROVIDER_RESPONSE) {
30
+ if (value === null)
31
+ return absentValue();
32
+ return presentValue(requireSyncSheetsText(value, label, errorCode));
33
+ }
34
+ /** Decodes an optional non-negative revision returned by the runtime provider. */
35
+ export function decodeSyncSheetsPresenceNonNegativeSafeInteger(value, label, errorCode = SYNC_SHEETS_ERROR_CODES.INVALID_PROVIDER_RESPONSE) {
36
+ if (value === null)
37
+ return absentValue();
38
+ return presentValue(requireSyncSheetsNonNegativeSafeInteger(value, label, errorCode));
39
+ }
40
+ /** Requires a protocol version returned by the runtime provider. */
41
+ export function requireSyncProtocolVersion(value, label, errorCode) {
42
+ if (!isJavaScriptType(value, JAVASCRIPT_TYPE_NAMES.STRING) ||
43
+ value !== SYNC_PROTOCOL_VERSIONS.V1) {
44
+ throw new SyncSheetsContractError(errorCode, `${label} is not supported`);
45
+ }
46
+ return value;
47
+ }
48
+ /** Requires a projection label returned by the runtime provider. */
49
+ export function requireSyncProjectionKind(value, label, errorCode) {
50
+ if (!isJavaScriptType(value, JAVASCRIPT_TYPE_NAMES.STRING) ||
51
+ !isSyncProjectionKind(value)) {
52
+ throw new SyncSheetsContractError(errorCode, `${label} is not supported`);
53
+ }
54
+ return value;
55
+ }
56
+ /** Requires a supported snapshot detail level at a provider boundary. */
57
+ export function requireSyncSnapshotReadMode(value, label, errorCode) {
58
+ if (!isJavaScriptType(value, JAVASCRIPT_TYPE_NAMES.STRING) ||
59
+ !isSyncSnapshotReadMode(value)) {
60
+ throw new SyncSheetsContractError(errorCode, `${label} is not supported`);
61
+ }
62
+ return value;
63
+ }
64
+ /** Requires a non-empty list at a provider contract boundary. */
65
+ export function requireSyncSheetsNonEmptyList(values, label, errorCode) {
66
+ if (!isNonEmptyList(values)) {
67
+ throw new SyncSheetsContractError(errorCode, `${label} requires at least one item`);
68
+ }
69
+ }
70
+ function isSyncProjectionKind(value) {
71
+ return value === SYNC_PROJECTIONS.USER_INPUT ||
72
+ value === SYNC_PROJECTIONS.SYSTEM_STATE ||
73
+ value === SYNC_PROJECTIONS.SYNC_CONFLICTS;
74
+ }
75
+ function isSyncSnapshotReadMode(value) {
76
+ return value === SYNC_SNAPSHOT_READ_MODES.FULL ||
77
+ value === SYNC_SNAPSHOT_READ_MODES.USER_INPUT;
78
+ }
79
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/application/sync/sheets/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EACL,WAAW,EACX,YAAY,GACb,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EACL,cAAc,EACd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E;AACjE,MAAM,UAAU,6BAA6B,CAC3C,MAAoB,EACpB,KAAa,EACb,SAA8B;IAE9B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,uBAAuB,CAAC,SAAS,EAAE,GAAG,KAAK,6BAA6B,CAAC,CAAC;IACtF,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAa;IACzC,OAAO,KAAK,KAAK,gBAAgB,CAAC,UAAU;QAC1C,KAAK,KAAK,gBAAgB,CAAC,YAAY;QACvC,KAAK,KAAK,gBAAgB,CAAC,cAAc,CAAC;AAC9C,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAa;IAC3C,OAAO,KAAK,KAAK,wBAAwB,CAAC,IAAI;QAC5C,KAAK,KAAK,wBAAwB,CAAC,UAAU,CAAC;AAClD,CAAC"}
@@ -2,13 +2,13 @@
2
2
  * Shared timing(소요 시간) contracts for the SQLite-to-Sheets write pipeline.
3
3
  *
4
4
  * Timing is diagnostic only: a sink failure must never change persistence or
5
- * gateway behavior. The operation kinds describe the public lifecycle while
5
+ * provider behavior. The operation kinds describe the public lifecycle while
6
6
  * phases describe implementation boundaries that can be compared in a trace.
7
7
  */
8
8
  export declare const SYNC_TIMING_SCOPES: {
9
9
  readonly ORM_FLUSH: "orm_flush";
10
10
  readonly WORKER: "worker";
11
- readonly GATEWAY: "gateway";
11
+ readonly PROVIDER: "provider";
12
12
  /** Inbound User_Input polling phases; diagnostic only and never root-facing. */
13
13
  readonly POLLING: "polling";
14
14
  };
@@ -25,17 +25,17 @@ export interface SyncTimingOperationCounts {
25
25
  readonly update: number;
26
26
  readonly delete: number;
27
27
  }
28
- /** One measured implementation phase inside a remote gateway operation. */
29
- export interface SyncGatewayTimingPhase {
28
+ /** One measured implementation phase inside a remote provider operation. */
29
+ export interface SyncSheetsTimingPhase {
30
30
  readonly phase: string;
31
31
  readonly durationMs: number;
32
32
  }
33
- /** Timing returned by one dynamically evaluated Apps Script operation. */
34
- export interface SyncGatewayTiming {
33
+ /** Timing returned by one remote provider operation. */
34
+ export interface SyncSheetsTiming {
35
35
  readonly operationKinds: readonly SyncTimingOperationKind[];
36
36
  readonly operationCounts: SyncTimingOperationCounts;
37
37
  readonly durationMs: number;
38
- readonly phases: readonly SyncGatewayTimingPhase[];
38
+ readonly phases: readonly SyncSheetsTimingPhase[];
39
39
  }
40
40
  /** One local or remote phase sent to the application's diagnostics sink. */
41
41
  export interface SyncTimingEvent {
@@ -1 +1 @@
1
- {"version":3,"file":"syncTiming.d.ts","sourceRoot":"","sources":["../../../../src/application/sync/telemetry/syncTiming.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,kBAAkB;;;;IAI7B,gFAAgF;;CAExE,CAAC;AAEX,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE/D,eAAO,MAAM,2BAA2B;;;;CAI9B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,OAAO,2BAA2B,CAAC,CAAC;AAEjF,qEAAqE;AACrE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,2EAA2E;AAC3E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,cAAc,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC5D,QAAQ,CAAC,eAAe,EAAE,yBAAyB,CAAC;IACpD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ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zB;AAED,4EAA4E;AAC5E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,wDAAwD;AACxD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,cAAc,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC5D,QAAQ,CAAC,eAAe,EAAE,yBAAyB,CAAC;IACpD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACnD;AAED,4EAA4E;AAC5E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC5D,QAAQ,CAAC,eAAe,EAAE,yBAAyB,CAAC;IACpD,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED,2EAA2E;AAC3E,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;AAE9D,sEAAsE;AACtE,wBAAgB,8BAA8B,IAAI,yBAAyB,CAE1E"}
@@ -2,13 +2,13 @@
2
2
  * Shared timing(소요 시간) contracts for the SQLite-to-Sheets write pipeline.
3
3
  *
4
4
  * Timing is diagnostic only: a sink failure must never change persistence or
5
- * gateway behavior. The operation kinds describe the public lifecycle while
5
+ * provider behavior. The operation kinds describe the public lifecycle while
6
6
  * phases describe implementation boundaries that can be compared in a trace.
7
7
  */
8
8
  export const SYNC_TIMING_SCOPES = {
9
9
  ORM_FLUSH: "orm_flush",
10
10
  WORKER: "worker",
11
- GATEWAY: "gateway",
11
+ PROVIDER: "provider",
12
12
  /** Inbound User_Input polling phases; diagnostic only and never root-facing. */
13
13
  POLLING: "polling",
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"syncTiming.js","sourceRoot":"","sources":["../../../../src/application/sync/telemetry/syncTiming.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,gFAAgF;IAChF,OAAO,EAAE,SAAS;CACV,CAAC;AAKX,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;CACR,CAAC;AA0CX,sEAAsE;AACtE,MAAM,UAAU,8BAA8B;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAC7C,CAAC"}
1
+ {"version":3,"file":"syncTiming.js","sourceRoot":"","sources":["../../../../src/application/sync/telemetry/syncTiming.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,gFAAgF;IAChF,OAAO,EAAE,SAAS;CACV,CAAC;AAKX,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;CACR,CAAC;AA0CX,sEAAsE;AACtE,MAAM,UAAU,8BAA8B;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAC7C,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Shared contracts for pure batch evaluation.
3
3
  *
4
4
  * These types keep evaluator inputs and outcomes independent from SQLite,
5
- * gateway transport, and any repository implementation.
5
+ * provider transport, and any repository implementation.
6
6
  */
7
7
  import type { NormalizedCell } from "../../shared/encoding/types.js";
8
8
  import type { CanonicalResolution, OwnershipManifest, ObservedRowChange, Projection, QuarantinePlan, QuarantineReason, RepairPlan, RowBindingContext, RowOperation, SyncConflict } from "../model/types.js";
@@ -2,7 +2,7 @@
2
2
  * Shared contracts for pure batch evaluation.
3
3
  *
4
4
  * These types keep evaluator inputs and outcomes independent from SQLite,
5
- * gateway transport, and any repository implementation.
5
+ * provider transport, and any repository implementation.
6
6
  */
7
7
  export {};
8
8
  //# sourceMappingURL=contracts.js.map
@@ -84,7 +84,7 @@ export declare const REGISTERED_PROJECTION_KINDS: {
84
84
  readonly SYSTEM_STATE: "system_state";
85
85
  readonly SYNC_CONFLICTS: "sync_conflicts";
86
86
  };
87
- /** Projection values accepted by registry and gateway routing. */
87
+ /** Projection values accepted by registry and provider routing. */
88
88
  export type RegisteredProjectionKind = (typeof REGISTERED_PROJECTION_KINDS)[keyof typeof REGISTERED_PROJECTION_KINDS];
89
89
  /** Runtime values for durable outbox effect operations. */
90
90
  export declare const EFFECT_KINDS: {
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/domain/model/constants.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,eAAO,MAAM,cAAc;;;;;CAKjB,CAAC;AAEX,8DAA8D;AAC9D,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEhF,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GACxB,CAAC,OAAO,gBAAgB,CAAC,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4C;AAC5C,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,0DAA0D;AAC1D,eAAO,MAAM,eAAe;;;;;;;;;CASlB,CAAC;AAEX,4DAA4D;AAC5D,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
@@ -154,7 +154,7 @@ export interface ObservedEditBatch {
154
154
  readonly baseSnapshotHash: string;
155
155
  /** Authenticated service principal; audit metadata, never a merge input. */
156
156
  readonly ingressActorId: string;
157
- /** Verified editor identity when the gateway can provide one. */
157
+ /** Verified editor identity when the provider can provide one. */
158
158
  readonly editorActorId: Presence<string>;
159
159
  readonly editorActorSource: EditorActorSource;
160
160
  readonly rows: readonly ObservedRowChange[];