hikoutei 0.4.2 → 0.4.3

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 (140) hide show
  1. package/dist/application/sync/outbound/SheetsEffectDispatcher.d.ts +64 -0
  2. package/dist/application/sync/outbound/SheetsEffectDispatcher.d.ts.map +1 -0
  3. package/dist/application/sync/outbound/SheetsEffectDispatcher.js +440 -0
  4. package/dist/application/sync/outbound/SheetsEffectDispatcher.js.map +1 -0
  5. package/dist/application/sync/service/SyncServiceBootstrap.d.ts +3 -4
  6. package/dist/application/sync/service/SyncServiceBootstrap.d.ts.map +1 -1
  7. package/dist/application/sync/service/SyncServiceBootstrap.js +7 -4
  8. package/dist/application/sync/service/SyncServiceBootstrap.js.map +1 -1
  9. package/dist/application/sync/telemetry/syncTiming.d.ts +20 -33
  10. package/dist/application/sync/telemetry/syncTiming.d.ts.map +1 -1
  11. package/dist/application/sync/telemetry/syncTiming.js +14 -12
  12. package/dist/application/sync/telemetry/syncTiming.js.map +1 -1
  13. package/dist/infrastructure/storage/errors.d.ts +10 -5
  14. package/dist/infrastructure/storage/errors.d.ts.map +1 -1
  15. package/dist/infrastructure/storage/errors.js +10 -7
  16. package/dist/infrastructure/storage/errors.js.map +1 -1
  17. package/dist/infrastructure/storage/index.d.ts +6 -4
  18. package/dist/infrastructure/storage/index.d.ts.map +1 -1
  19. package/dist/infrastructure/storage/index.js +3 -2
  20. package/dist/infrastructure/storage/index.js.map +1 -1
  21. package/dist/infrastructure/storage/sqlite/schema.d.ts +12 -11
  22. package/dist/infrastructure/storage/sqlite/schema.d.ts.map +1 -1
  23. package/dist/infrastructure/storage/sqlite/schema.js +17 -109
  24. package/dist/infrastructure/storage/sqlite/schema.js.map +1 -1
  25. package/dist/infrastructure/storage/state/canonical/canonicalCommit.d.ts +2 -2
  26. package/dist/infrastructure/storage/state/canonical/canonicalCommit.d.ts.map +1 -1
  27. package/dist/infrastructure/storage/state/canonical/canonicalCommit.js +2 -2
  28. package/dist/infrastructure/storage/state/canonical/canonicalCommit.js.map +1 -1
  29. package/dist/infrastructure/storage/state/mapped/mappedPersistenceContext.d.ts +1 -2
  30. package/dist/infrastructure/storage/state/mapped/mappedPersistenceContext.d.ts.map +1 -1
  31. package/dist/infrastructure/storage/state/mapped/mappedPersistenceContext.js +1 -2
  32. package/dist/infrastructure/storage/state/mapped/mappedPersistenceContext.js.map +1 -1
  33. package/dist/infrastructure/storage/state/observation/observationCanonical.d.ts +1 -1
  34. package/dist/infrastructure/storage/state/observation/observationCanonical.d.ts.map +1 -1
  35. package/dist/infrastructure/storage/state/observation/observationQuarantine.d.ts +1 -1
  36. package/dist/infrastructure/storage/state/observation/observationQuarantine.d.ts.map +1 -1
  37. package/dist/infrastructure/storage/state/observation/observationQuarantine.js +1 -1
  38. package/dist/infrastructure/storage/state/observation/observationQuarantine.js.map +1 -1
  39. package/dist/infrastructure/storage/state/observation/observationTypes.d.ts +1 -1
  40. package/dist/infrastructure/storage/state/observation/observationTypes.d.ts.map +1 -1
  41. package/dist/infrastructure/storage/state/observation/observationValidation.d.ts +1 -1
  42. package/dist/infrastructure/storage/state/observation/observationValidation.d.ts.map +1 -1
  43. package/dist/infrastructure/storage/state/observation/observationWriter.d.ts +1 -1
  44. package/dist/infrastructure/storage/state/observation/observationWriter.d.ts.map +1 -1
  45. package/dist/infrastructure/storage/state/observation/observationWriter.js +1 -2
  46. package/dist/infrastructure/storage/state/observation/observationWriter.js.map +1 -1
  47. package/dist/infrastructure/storage/state/resolution/resolutionWriter.d.ts +1 -2
  48. package/dist/infrastructure/storage/state/resolution/resolutionWriter.d.ts.map +1 -1
  49. package/dist/infrastructure/storage/state/resolution/resolutionWriter.js +1 -2
  50. package/dist/infrastructure/storage/state/resolution/resolutionWriter.js.map +1 -1
  51. package/dist/infrastructure/storage/state/resolution/resolutionWriterContracts.d.ts +1 -1
  52. package/dist/infrastructure/storage/state/resolution/resolutionWriterContracts.d.ts.map +1 -1
  53. package/dist/infrastructure/storage/state/resolution/resolutionWriterHelpers.d.ts +1 -1
  54. package/dist/infrastructure/storage/state/resolution/resolutionWriterHelpers.d.ts.map +1 -1
  55. package/dist/infrastructure/storage/state/resolution/resolutionWriterHelpers.js +1 -1
  56. package/dist/infrastructure/storage/state/resolution/resolutionWriterHelpers.js.map +1 -1
  57. package/dist/infrastructure/storage/state/resolution/resolutionWriterSql.d.ts +1 -1
  58. package/dist/infrastructure/storage/state/resolution/resolutionWriterSql.d.ts.map +1 -1
  59. package/dist/infrastructure/storage/state/resolution/resolutionWriterSql.js +2 -2
  60. package/dist/infrastructure/storage/state/resolution/resolutionWriterSql.js.map +1 -1
  61. package/dist/infrastructure/storage/sync/shared/spreadsheetAuthority.d.ts +1 -1
  62. package/dist/infrastructure/storage/sync/shared/spreadsheetAuthority.d.ts.map +1 -1
  63. package/dist/infrastructure/storage/sync/shared/spreadsheetAuthority.js +1 -1
  64. package/dist/infrastructure/storage/sync/shared/spreadsheetAuthority.js.map +1 -1
  65. package/dist/infrastructure/storage/sync/shared/syncRegistry.d.ts +1 -1
  66. package/dist/infrastructure/storage/sync/shared/syncRegistry.js +1 -1
  67. package/package.json +13 -7
  68. package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.d.ts +0 -66
  69. package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.d.ts.map +0 -1
  70. package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.js +0 -123
  71. package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.js.map +0 -1
  72. package/dist/application/sync/outbound/effects/SyncEffectSupervisor.d.ts +0 -111
  73. package/dist/application/sync/outbound/effects/SyncEffectSupervisor.d.ts.map +0 -1
  74. package/dist/application/sync/outbound/effects/SyncEffectSupervisor.js +0 -369
  75. package/dist/application/sync/outbound/effects/SyncEffectSupervisor.js.map +0 -1
  76. package/dist/application/sync/outbound/effects/SyncEffectWorker.d.ts +0 -127
  77. package/dist/application/sync/outbound/effects/SyncEffectWorker.d.ts.map +0 -1
  78. package/dist/application/sync/outbound/effects/SyncEffectWorker.js +0 -552
  79. package/dist/application/sync/outbound/effects/SyncEffectWorker.js.map +0 -1
  80. package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.d.ts +0 -85
  81. package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.d.ts.map +0 -1
  82. package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.js +0 -74
  83. package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.js.map +0 -1
  84. package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.d.ts +0 -31
  85. package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.d.ts.map +0 -1
  86. package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.js +0 -222
  87. package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.js.map +0 -1
  88. package/dist/application/sync/outbound/effects/SyncEffectWorkerHelpers.d.ts +0 -14
  89. package/dist/application/sync/outbound/effects/SyncEffectWorkerHelpers.d.ts.map +0 -1
  90. package/dist/application/sync/outbound/effects/SyncEffectWorkerHelpers.js +0 -25
  91. package/dist/application/sync/outbound/effects/SyncEffectWorkerHelpers.js.map +0 -1
  92. package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.d.ts +0 -61
  93. package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.d.ts.map +0 -1
  94. package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.js +0 -296
  95. package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.js.map +0 -1
  96. package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.d.ts +0 -17
  97. package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.d.ts.map +0 -1
  98. package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.js +0 -80
  99. package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.js.map +0 -1
  100. package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.d.ts +0 -13
  101. package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.d.ts.map +0 -1
  102. package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.js +0 -248
  103. package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.js.map +0 -1
  104. package/dist/infrastructure/storage/sync/outbound/effectOutbox.d.ts +0 -141
  105. package/dist/infrastructure/storage/sync/outbound/effectOutbox.d.ts.map +0 -1
  106. package/dist/infrastructure/storage/sync/outbound/effectOutbox.js +0 -318
  107. package/dist/infrastructure/storage/sync/outbound/effectOutbox.js.map +0 -1
  108. package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.d.ts +0 -143
  109. package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.d.ts.map +0 -1
  110. package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.js +0 -16
  111. package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.js.map +0 -1
  112. package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.d.ts +0 -33
  113. package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.d.ts.map +0 -1
  114. package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.js +0 -259
  115. package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.js.map +0 -1
  116. package/dist/infrastructure/storage/sync/outbound/effectOutboxSupport.d.ts +0 -27
  117. package/dist/infrastructure/storage/sync/outbound/effectOutboxSupport.d.ts.map +0 -1
  118. package/dist/infrastructure/storage/sync/outbound/effectOutboxSupport.js +0 -316
  119. package/dist/infrastructure/storage/sync/outbound/effectOutboxSupport.js.map +0 -1
  120. package/dist/infrastructure/storage/sync/shared/writerLease.d.ts +0 -76
  121. package/dist/infrastructure/storage/sync/shared/writerLease.d.ts.map +0 -1
  122. package/dist/infrastructure/storage/sync/shared/writerLease.js +0 -189
  123. package/dist/infrastructure/storage/sync/shared/writerLease.js.map +0 -1
  124. package/docs/advanced-sheets-gateway-concurrency-problem.md +0 -434
  125. package/docs/architecture.md +0 -224
  126. package/docs/ci.md +0 -293
  127. package/docs/code-guidelines.md +0 -248
  128. package/docs/development.md +0 -74
  129. package/docs/gateway-removal-inventory.md +0 -147
  130. package/docs/git-workflow.md +0 -224
  131. package/docs/google-sheets-sync-scaling-strategy.md +0 -459
  132. package/docs/mikro-orm-adapter-spike.md +0 -89
  133. package/docs/quick-start.md +0 -137
  134. package/docs/sql-layer-plan.md +0 -59
  135. package/docs/sync-bulk-write-benchmark.md +0 -2117
  136. package/docs/sync-observability.md +0 -100
  137. package/docs/task-queue-write-model.md +0 -640
  138. package/docs/typed-sheets-mvp-scope-2026-06-29.md +0 -490
  139. package/docs/typed-sheets-plan.md +0 -417
  140. package/docs/write-and-synchronization-flow.md +0 -179
@@ -1,85 +0,0 @@
1
- /** Constants and durable status contracts shared by the effect worker modules. */
2
- export declare const DEFAULT_WORKER_ROLE = "sync-effect-worker";
3
- /** Outbound writer lease must outlive the longest remote effect request. */
4
- export declare const DEFAULT_WRITER_LEASE_DURATION_MS = 180000;
5
- /** Minimum headroom between the remote timeout and the effect lease. */
6
- export declare const EFFECT_LEASE_PROVIDER_HEADROOM_MS = 30000;
7
- /** Must exceed the 60-second provider transport timeout plus recovery margin. */
8
- export declare const DEFAULT_EFFECT_LEASE_DURATION_MS = 120000;
9
- /**
10
- * Maximum effects one provider `applyEffects` call will acknowledge.
11
- *
12
- * The remote provider caps a single bounded effect batch (see
13
- * `MAX_EFFECTS_PER_REQUEST` in the Google Sheets API provider defaults).
14
- * Chunking each physical route's dispatch to this limit keeps every request
15
- * inside that batch, so an oversized configured worker limit (`maxEffects`)
16
- * does not turn one route into repeated partial (`hasMore`) responses and the
17
- * deferred/requeue churn they cause.
18
- */
19
- export declare const EFFECT_BATCH_LIMIT = 20;
20
- /**
21
- * Maximum number of effects leased before dispatch starts. Selection may use a
22
- * larger SQLite upper bound, but a worker pass must not lease an unbounded
23
- * backlog while a remote batch is in flight.
24
- */
25
- export declare const MAX_IN_FLIGHT_EFFECTS = 20;
26
- /**
27
- * Maximum eligible fast-append rows one worker pass may select/claim in the
28
- * real provider runtime. The bulk append operation writes the whole reserved
29
- * target range in one `spreadsheets.batchUpdate` request (an atomic
30
- * target-plus-receipt batch), so a bulk pass can claim this many append
31
- * candidates while regular and recovery effects keep the bounded 20-effect
32
- * window below.
33
- */
34
- export declare const FAST_APPEND_BATCH_CANDIDATE_LIMIT = 1000;
35
- /**
36
- * Minimum interval between fast-append request starts in the real provider
37
- * runtime. The adaptive batch controller remembers the last append request
38
- * start across supervisor passes and waits only the remaining time before the
39
- * next append request; regular applyEffects calls never wait on this throttle.
40
- */
41
- export declare const APPEND_DISPATCH_THROTTLE_INTERVAL_MS = 1100;
42
- export declare const SYNC_EFFECT_KINDS: {
43
- readonly SYSTEM_PROJECTION: "system_projection";
44
- readonly CANDIDATE_RECONCILE: "candidate_reconcile";
45
- readonly SYSTEM_REPAIR: "system_repair";
46
- readonly RESOLUTION_PROJECTION: "resolution_projection";
47
- readonly RESOLUTION_DELETE: "resolution_delete";
48
- readonly USER_INPUT_DELETE: "user_input_delete";
49
- };
50
- export declare const EFFECT_TARGET_KINDS: {
51
- readonly ENTITY: "entity";
52
- readonly ROW_BINDING: "row_binding";
53
- readonly PROJECTION_ROW: "projection_row";
54
- readonly CONFLICT: "conflict";
55
- };
56
- export declare const OUTBOX_EFFECT_STATUSES: {
57
- readonly DELIVERY_UNCERTAIN: "delivery_uncertain";
58
- readonly FAILED: "failed";
59
- readonly APPLIED: "applied";
60
- readonly BLOCKED_CANDIDATE: "blocked_candidate";
61
- readonly SUPERSEDED: "superseded";
62
- readonly CONFLICT: "conflict";
63
- };
64
- export declare const WORKER_ERROR_CODES: {
65
- readonly INVALID_EFFECT_PAYLOAD: "invalid_effect_payload";
66
- readonly ACTIVE_CANDIDATE_PRESERVED: "active_candidate_preserved";
67
- readonly PROVIDER_SUPERSEDED: "provider_superseded";
68
- readonly CANDIDATE_GUARD_MISMATCH: "candidate_guard_mismatch";
69
- readonly VISIBLE_GUARD_MISMATCH: "visible_guard_mismatch";
70
- readonly PROVIDER_SCHEMA_ERROR: "provider_schema_error";
71
- readonly PROVIDER_REMOTE_ERROR: "provider_remote_error";
72
- readonly PROVIDER_RETRYABLE_ERROR: "provider_retryable_error";
73
- readonly DELIVERY_UNCERTAIN_REQUIRES_PROBE: "delivery_uncertain_requires_probe";
74
- readonly POSTCONDITION_READ_FAILED: "postcondition_read_failed";
75
- readonly POSTCONDITION_APPLIED_WITHOUT_VISIBLE_STATE: "postcondition_applied_without_visible_state";
76
- readonly POSTCONDITION_UNAVAILABLE: "postcondition_unavailable";
77
- readonly POSTCONDITION_CHANGED: "postcondition_changed";
78
- readonly POSTCONDITION_UNAPPLIED_REQUIRES_REDRIVE: "postcondition_unapplied_requires_redrive";
79
- readonly REPAIR_REOBSERVE_REQUIRES_WRITER_REPLAN: "repair_reobserve_requires_writer_replan";
80
- readonly REPAIR_REPLAN_FAILED: "repair_replan_failed";
81
- readonly REPAIR_REPLAN_DEFERRED: "repair_replan_deferred";
82
- readonly PROVIDER_CAPABILITY_MISSING: "provider_capability_missing";
83
- };
84
- export type SyncEffectWorkerErrorCode = (typeof WORKER_ERROR_CODES)[keyof typeof WORKER_ERROR_CODES];
85
- //# sourceMappingURL=SyncEffectWorkerConstants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SyncEffectWorkerConstants.d.ts","sourceRoot":"","sources":["../../../../../src/application/sync/outbound/effects/SyncEffectWorkerConstants.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAUlF,eAAO,MAAM,mBAAmB,uBAAuB,CAAC;AACxD,4EAA4E;AAC5E,eAAO,MAAM,gCAAgC,SAAU,CAAC;AACxD,wEAAwE;AACxE,eAAO,MAAM,iCAAiC,QAAS,CAAC;AACxD,iFAAiF;AACjF,eAAO,MAAM,gCAAgC,SAAU,CAAC;AAExD;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,KAAqB,CAAC;AACxD;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,OAAQ,CAAC;AACvD;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,OAAQ,CAAC;AAE1D,eAAO,MAAM,iBAAiB;;;;;;;CAA8D,CAAC;AAE7F,eAAO,MAAM,mBAAmB;;;;;CAA2E,CAAC;AAE5G,eAAO,MAAM,sBAAsB;;;;;;;CAOc,CAAC;AAElD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;CAqBrB,CAAC;AAEX,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC"}
@@ -1,74 +0,0 @@
1
- /** Constants and durable status contracts shared by the effect worker modules. */
2
- import { EFFECT_KINDS as CANONICAL_EFFECT_KINDS, EFFECT_STATUSES as CANONICAL_EFFECT_STATUSES, EFFECT_TARGET_KINDS as CANONICAL_EFFECT_TARGET_KINDS, } from "../../../../domain/model/constants.js";
3
- import { SYNC_EFFECT_RECOVERY_ERROR_CODES } from "../../../../infrastructure/storage/sync/outbound/effectOutbox.js";
4
- export const DEFAULT_WORKER_ROLE = "sync-effect-worker";
5
- /** Outbound writer lease must outlive the longest remote effect request. */
6
- export const DEFAULT_WRITER_LEASE_DURATION_MS = 180_000;
7
- /** Minimum headroom between the remote timeout and the effect lease. */
8
- export const EFFECT_LEASE_PROVIDER_HEADROOM_MS = 30_000;
9
- /** Must exceed the 60-second provider transport timeout plus recovery margin. */
10
- export const DEFAULT_EFFECT_LEASE_DURATION_MS = 120_000;
11
- /**
12
- * Maximum effects one provider `applyEffects` call will acknowledge.
13
- *
14
- * The remote provider caps a single bounded effect batch (see
15
- * `MAX_EFFECTS_PER_REQUEST` in the Google Sheets API provider defaults).
16
- * Chunking each physical route's dispatch to this limit keeps every request
17
- * inside that batch, so an oversized configured worker limit (`maxEffects`)
18
- * does not turn one route into repeated partial (`hasMore`) responses and the
19
- * deferred/requeue churn they cause.
20
- */
21
- export const EFFECT_BATCH_LIMIT = 20;
22
- /**
23
- * Maximum number of effects leased before dispatch starts. Selection may use a
24
- * larger SQLite upper bound, but a worker pass must not lease an unbounded
25
- * backlog while a remote batch is in flight.
26
- */
27
- export const MAX_IN_FLIGHT_EFFECTS = EFFECT_BATCH_LIMIT;
28
- /**
29
- * Maximum eligible fast-append rows one worker pass may select/claim in the
30
- * real provider runtime. The bulk append operation writes the whole reserved
31
- * target range in one `spreadsheets.batchUpdate` request (an atomic
32
- * target-plus-receipt batch), so a bulk pass can claim this many append
33
- * candidates while regular and recovery effects keep the bounded 20-effect
34
- * window below.
35
- */
36
- export const FAST_APPEND_BATCH_CANDIDATE_LIMIT = 1_000;
37
- /**
38
- * Minimum interval between fast-append request starts in the real provider
39
- * runtime. The adaptive batch controller remembers the last append request
40
- * start across supervisor passes and waits only the remaining time before the
41
- * next append request; regular applyEffects calls never wait on this throttle.
42
- */
43
- export const APPEND_DISPATCH_THROTTLE_INTERVAL_MS = 1_100;
44
- export const SYNC_EFFECT_KINDS = CANONICAL_EFFECT_KINDS;
45
- export const EFFECT_TARGET_KINDS = CANONICAL_EFFECT_TARGET_KINDS;
46
- export const OUTBOX_EFFECT_STATUSES = {
47
- DELIVERY_UNCERTAIN: CANONICAL_EFFECT_STATUSES.DELIVERY_UNCERTAIN,
48
- FAILED: CANONICAL_EFFECT_STATUSES.FAILED,
49
- APPLIED: CANONICAL_EFFECT_STATUSES.APPLIED,
50
- BLOCKED_CANDIDATE: CANONICAL_EFFECT_STATUSES.BLOCKED_CANDIDATE,
51
- SUPERSEDED: CANONICAL_EFFECT_STATUSES.SUPERSEDED,
52
- CONFLICT: CANONICAL_EFFECT_STATUSES.CONFLICT,
53
- };
54
- export const WORKER_ERROR_CODES = {
55
- INVALID_EFFECT_PAYLOAD: "invalid_effect_payload",
56
- ACTIVE_CANDIDATE_PRESERVED: "active_candidate_preserved",
57
- PROVIDER_SUPERSEDED: "provider_superseded",
58
- CANDIDATE_GUARD_MISMATCH: "candidate_guard_mismatch",
59
- VISIBLE_GUARD_MISMATCH: "visible_guard_mismatch",
60
- PROVIDER_SCHEMA_ERROR: "provider_schema_error",
61
- PROVIDER_REMOTE_ERROR: "provider_remote_error",
62
- PROVIDER_RETRYABLE_ERROR: SYNC_EFFECT_RECOVERY_ERROR_CODES.PROVIDER_RETRYABLE_ERROR,
63
- DELIVERY_UNCERTAIN_REQUIRES_PROBE: SYNC_EFFECT_RECOVERY_ERROR_CODES.DELIVERY_UNCERTAIN_REQUIRES_PROBE,
64
- POSTCONDITION_READ_FAILED: SYNC_EFFECT_RECOVERY_ERROR_CODES.POSTCONDITION_READ_FAILED,
65
- POSTCONDITION_APPLIED_WITHOUT_VISIBLE_STATE: "postcondition_applied_without_visible_state",
66
- POSTCONDITION_UNAVAILABLE: SYNC_EFFECT_RECOVERY_ERROR_CODES.POSTCONDITION_UNAVAILABLE,
67
- POSTCONDITION_CHANGED: "postcondition_changed",
68
- POSTCONDITION_UNAPPLIED_REQUIRES_REDRIVE: SYNC_EFFECT_RECOVERY_ERROR_CODES.POSTCONDITION_UNAPPLIED_REQUIRES_REDRIVE,
69
- REPAIR_REOBSERVE_REQUIRES_WRITER_REPLAN: "repair_reobserve_requires_writer_replan",
70
- REPAIR_REPLAN_FAILED: "repair_replan_failed",
71
- REPAIR_REPLAN_DEFERRED: "repair_replan_deferred",
72
- PROVIDER_CAPABILITY_MISSING: "provider_capability_missing",
73
- };
74
- //# sourceMappingURL=SyncEffectWorkerConstants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SyncEffectWorkerConstants.js","sourceRoot":"","sources":["../../../../../src/application/sync/outbound/effects/SyncEffectWorkerConstants.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAGlF,OAAO,EACL,YAAY,IAAI,sBAAsB,EACtC,eAAe,IAAI,yBAAyB,EAC5C,mBAAmB,IAAI,6BAA6B,GACrD,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,gCAAgC,EAAE,MAAM,kEAAkE,CAAC;AAEpH,MA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C,CAAC,iCAAiC;IACpE,yBAAyB,EAAE,gCAAgC,CAAC,yBAAyB;IACrF,2CAA2C,EAAE,6CAA6C;IAC1F,yBAAyB,EAAE,gCAAgC,CAAC,yBAAyB;IACrF,qBAAqB,EAAE,uBAAuB;IAC9C,wCAAwC,EACtC,gCAAgC,CAAC,wCAAwC;IAC3E,uCAAuC,EAAE,yCAAyC;IAClF,oBAAoB,EAAE,sBAAsB;IAC5C,sBAAsB,EAAE,wBAAwB;IAChD,2BAA2B,EAAE,6BAA6B;CAClD,CAAC"}
@@ -1,31 +0,0 @@
1
- /** Fast-append and unsupported-capability dispatch paths for the effect worker. */
2
- import type { FencingContext } from "../../../../infrastructure/storage/sync/shared/writerLease.js";
3
- import type { FastAppendRowsRequest, SyncEffectWorkerProvider } from "../../sheets/syncSheets.js";
4
- import { type TransportOutcome } from "../../sheets/transportOutcome.js";
5
- import type { ClaimedEffect, EffectWorkerStorage, MutableReport, SyncEffectWorkerBaseOptions } from "./SyncEffectWorker.js";
6
- /** Fails regular effects explicitly when the configured provider is fast-only. */
7
- export declare function rejectUnsupportedProviderEffects(storage: EffectWorkerStorage, fence: FencingContext, items: readonly ClaimedEffect[], report: MutableReport): Promise<void>;
8
- /**
9
- * Handles a failed remote dispatch at the transport boundary.
10
- *
11
- * A thrown batch-level dispatch error is not per-effect rejection evidence for
12
- * an uncertain transport. Explicit structured remote failures are different:
13
- * the provider has returned a verified rejection, so they close the effects in
14
- * the terminal failure path rather than entering recovery.
15
- */
16
- export declare function handleProviderDispatchError(options: SyncEffectWorkerBaseOptions, storage: EffectWorkerStorage, fence: FencingContext, items: readonly ClaimedEffect[], report: MutableReport, outcome: TransportOutcome, fullProvider?: SyncEffectWorkerProvider, beforeRecovery?: () => Promise<boolean>, onUncertainWithoutRecovery?: () => Promise<void>): Promise<void>;
17
- /**
18
- * Dispatches append-only rows through the idempotent provider batch operation.
19
- * A lost response is still returned to recovery; the provider receipt batch lets
20
- * the next attempt classify an already committed write without appending again.
21
- *
22
- * When the full provider runtime configured the append throttle, the request
23
- * waits only the time remaining since the previous append request started;
24
- * regular applyEffects dispatch never waits on this throttle.
25
- */
26
- export declare function dispatchFastAppendGroup(options: SyncEffectWorkerBaseOptions, storage: EffectWorkerStorage, fence: FencingContext, group: {
27
- readonly request: FastAppendRowsRequest;
28
- readonly items: readonly ClaimedEffect[];
29
- }, report: MutableReport, fullProvider?: SyncEffectWorkerProvider, beforeRecovery?: () => Promise<boolean>): Promise<void>;
30
- export declare function requeueFastAppendItems(storage: EffectWorkerStorage, fence: FencingContext, items: readonly ClaimedEffect[], report: MutableReport): Promise<void>;
31
- //# sourceMappingURL=SyncEffectWorkerDispatch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SyncEffectWorkerDispatch.d.ts","sourceRoot":"","sources":["../../../../../src/application/sync/outbound/effects/SyncEffectWorkerDispatch.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAEnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+DAA+D,CAAC;AAEpG,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AAoBpC,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAE/B,kFAAkF;AAClF,wBAAsB,gCAAgC,CACpD,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,IAAI,CAAC,CAkCf;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,gBAAgB,EACzB,YAAY,CAAC,EAAE,wBAAwB,EACvC,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EACvC,0BAA0B,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAC/C,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAED;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE;IACL,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;CAC1C,EACD,MAAM,EAAE,aAAa,EACrB,YAAY,CAAC,EAAE,wBAAwB,EACvC,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC,CAqJf;AA2CD,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,IAAI,CAAC,CAaf"}
@@ -1,222 +0,0 @@
1
- /** Fast-append and unsupported-capability dispatch paths for the effect worker. */
2
- import { LOOKUP_RESULT_KINDS, presentValue } from "../../../../shared/state/index.js";
3
- import { SYNC_TIMING_OPERATION_KINDS, SYNC_TIMING_SCOPES, } from "../../telemetry/syncTiming.js";
4
- import { WORKER_ERROR_CODES } from "./SyncEffectWorkerConstants.js";
5
- import { isPresent, lookupResult, } from "./SyncEffectWorkerHelpers.js";
6
- import { completeApplied, completeFailure, recoverUnknownResults, } from "./SyncEffectWorkerTransitions.js";
7
- import { emitProviderTiming, emitWorkerTiming, } from "./SyncEffectWorkerTiming.js";
8
- import { routeKey } from "./SyncEffectWorkerRouting.js";
9
- import { classifyTransportOutcome, TRANSPORT_OUTCOME_KINDS, } from "../../sheets/transportOutcome.js";
10
- /** Fails regular effects explicitly when the configured provider is fast-only. */
11
- export async function rejectUnsupportedProviderEffects(storage, fence, items, report) {
12
- for (const item of items) {
13
- if (item.pending.status === "delivery_uncertain") {
14
- await markUncertainWithoutRecovery(storage, fence, [item], report, "The configured provider cannot probe an uncertain delivery yet.");
15
- continue;
16
- }
17
- if (!isPresent(item.providerEffect)) {
18
- await completeFailure(storage, fence, item, WORKER_ERROR_CODES.INVALID_EFFECT_PAYLOAD, item.invalidPayloadError, report);
19
- continue;
20
- }
21
- await completeFailure(storage, fence, item, WORKER_ERROR_CODES.PROVIDER_CAPABILITY_MISSING, presentValue("The configured provider supports fast append only; regular effect dispatch or recovery is unavailable."), report);
22
- }
23
- }
24
- /**
25
- * Handles a failed remote dispatch at the transport boundary.
26
- *
27
- * A thrown batch-level dispatch error is not per-effect rejection evidence for
28
- * an uncertain transport. Explicit structured remote failures are different:
29
- * the provider has returned a verified rejection, so they close the effects in
30
- * the terminal failure path rather than entering recovery.
31
- */
32
- export async function handleProviderDispatchError(options, storage, fence, items, report, outcome, fullProvider, beforeRecovery, onUncertainWithoutRecovery) {
33
- if (outcome.kind === TRANSPORT_OUTCOME_KINDS.EXPLICIT_REMOTE_FAILURE) {
34
- for (const item of items) {
35
- await completeFailure(storage, fence, item, WORKER_ERROR_CODES.PROVIDER_REMOTE_ERROR, presentValue(outcome.message), report);
36
- }
37
- return;
38
- }
39
- if (fullProvider === undefined) {
40
- if (onUncertainWithoutRecovery !== undefined) {
41
- await onUncertainWithoutRecovery();
42
- return;
43
- }
44
- await markUncertainWithoutRecovery(storage, fence, items, report, outcome.message);
45
- return;
46
- }
47
- if (beforeRecovery === undefined || await beforeRecovery()) {
48
- await recoverUnknownResults({ ...options, provider: fullProvider }, storage, fence, items, report);
49
- }
50
- }
51
- /**
52
- * Dispatches append-only rows through the idempotent provider batch operation.
53
- * A lost response is still returned to recovery; the provider receipt batch lets
54
- * the next attempt classify an already committed write without appending again.
55
- *
56
- * When the full provider runtime configured the append throttle, the request
57
- * waits only the time remaining since the previous append request started;
58
- * regular applyEffects dispatch never waits on this throttle.
59
- */
60
- export async function dispatchFastAppendGroup(options, storage, fence, group, report, fullProvider, beforeRecovery) {
61
- const throttleStartedAt = Date.now();
62
- const throttledMs = await options.batchController?.waitForAppendThrottle(throttleStartedAt) ?? 0;
63
- if (throttledMs > 0) {
64
- emitWorkerTiming(options, {
65
- scope: SYNC_TIMING_SCOPES.WORKER,
66
- phase: "append_throttle_wait",
67
- durationMs: Date.now() - throttleStartedAt,
68
- operationKinds: [SYNC_TIMING_OPERATION_KINDS.APPEND],
69
- operationCounts: { append: group.items.length, update: 0, delete: 0 },
70
- });
71
- }
72
- let response;
73
- const providerStartedAt = Date.now();
74
- options.batchController?.beginAppendDispatch(providerStartedAt);
75
- const requestRouteKey = routeKey(group.request);
76
- const batchLimit = options.batchController?.beginDispatch(requestRouteKey, providerStartedAt) ?? group.items.length;
77
- try {
78
- response = await options.provider.fastAppendRows(group.request);
79
- }
80
- catch (error) {
81
- const outcome = classifyTransportOutcome(error);
82
- options.batchController?.observe(requestRouteKey, {
83
- durationMs: Date.now() - providerStartedAt,
84
- responseSucceeded: false,
85
- responseLoss: outcome.kind === TRANSPORT_OUTCOME_KINDS.DELIVERY_UNCERTAIN,
86
- });
87
- const failedDurationMs = Date.now() - providerStartedAt;
88
- emitWorkerTiming(options, {
89
- scope: SYNC_TIMING_SCOPES.WORKER,
90
- phase: "append_provider_dispatch",
91
- durationMs: failedDurationMs,
92
- operationKinds: [SYNC_TIMING_OPERATION_KINDS.APPEND],
93
- operationCounts: { append: group.items.length, update: 0, delete: 0 },
94
- routeKey: requestRouteKey,
95
- batchLimit,
96
- responseSucceeded: false,
97
- });
98
- const resultFence = {
99
- ...fence,
100
- now: options.clock?.() ?? fence.now + Math.max(0, Date.now() - providerStartedAt),
101
- };
102
- await handleProviderDispatchError(options, storage, resultFence, group.items, report, outcome, fullProvider, beforeRecovery, () => markFastAppendUncertain(storage, resultFence, group.items, report, outcome.message));
103
- return;
104
- }
105
- const durationMs = Date.now() - providerStartedAt;
106
- const resultFence = {
107
- ...fence,
108
- now: options.clock?.() ?? fence.now + Math.max(0, Date.now() - providerStartedAt),
109
- };
110
- options.batchController?.observe(requestRouteKey, {
111
- durationMs,
112
- responseSucceeded: response.results.length === group.items.length && !response.hasMore,
113
- responseLoss: response.results.length !== group.items.length || response.hasMore,
114
- });
115
- emitProviderTiming(options, response.timing);
116
- emitWorkerTiming(options, {
117
- scope: SYNC_TIMING_SCOPES.WORKER,
118
- phase: "append_provider_dispatch",
119
- durationMs,
120
- operationKinds: [SYNC_TIMING_OPERATION_KINDS.APPEND],
121
- operationCounts: { append: group.items.length, update: 0, delete: 0 },
122
- routeKey: requestRouteKey,
123
- batchLimit,
124
- responseSucceeded: response.results.length === group.items.length && !response.hasMore,
125
- });
126
- const resultPersistenceStartedAt = Date.now();
127
- const byEffectId = new Map(response.results.map((result) => [result.effectId, result]));
128
- const deferredEffectIds = new Set();
129
- const recoveryItems = [];
130
- for (const item of group.items) {
131
- if (byEffectId.has(item.pending.effect_id) || !response.hasMore)
132
- continue;
133
- if (await storage.releaseUnprocessedEffect({
134
- ...resultFence,
135
- effectId: item.pending.effect_id,
136
- claimToken: item.claimToken,
137
- })) {
138
- deferredEffectIds.add(item.pending.effect_id);
139
- report.deferred += 1;
140
- }
141
- }
142
- for (const item of group.items) {
143
- if (deferredEffectIds.has(item.pending.effect_id))
144
- continue;
145
- const result = lookupResult(byEffectId.get(item.pending.effect_id));
146
- if (result.kind === LOOKUP_RESULT_KINDS.NOT_FOUND) {
147
- await requeueFastAppendItems(storage, resultFence, [item], report);
148
- continue;
149
- }
150
- if (!isPresent(item.providerEffect)) {
151
- await requeueFastAppendItems(storage, resultFence, [item], report);
152
- continue;
153
- }
154
- if (!hasReceiptBackedVisibleEvidence(result.value)) {
155
- // A fast-append status is not enough to close a worker-owned effect. The
156
- // append receipt must provide the remote visible revision and hash; do
157
- // not synthesize either value from local expectations or payload data.
158
- recoveryItems.push(item);
159
- continue;
160
- }
161
- await completeApplied(storage, resultFence, item, presentValue(result.value.visibleRevision), presentValue(result.value.visibleHash), report);
162
- }
163
- if (recoveryItems.length > 0) {
164
- const recoveryFence = {
165
- ...resultFence,
166
- now: options.clock?.() ?? resultFence.now,
167
- };
168
- if (fullProvider !== undefined && (beforeRecovery === undefined || await beforeRecovery())) {
169
- await recoverUnknownResults({ ...options, provider: fullProvider }, storage, recoveryFence, recoveryItems, report);
170
- }
171
- else {
172
- await markFastAppendUncertain(storage, recoveryFence, recoveryItems, report, "Fast append did not return receipt-backed visible evidence.");
173
- }
174
- }
175
- emitWorkerTiming(options, {
176
- scope: SYNC_TIMING_SCOPES.WORKER,
177
- phase: "append_result_persistence",
178
- durationMs: Date.now() - resultPersistenceStartedAt,
179
- operationKinds: [SYNC_TIMING_OPERATION_KINDS.APPEND],
180
- operationCounts: { append: group.items.length, update: 0, delete: 0 },
181
- });
182
- }
183
- function hasReceiptBackedVisibleEvidence(result) {
184
- return typeof result.visibleRevision === "number" &&
185
- Number.isSafeInteger(result.visibleRevision) &&
186
- result.visibleRevision >= 1 &&
187
- typeof result.visibleHash === "string" &&
188
- result.visibleHash.length > 0;
189
- }
190
- /** Returns a response-lost fast append to pending for reconciliation-backed retry. */
191
- async function markFastAppendUncertain(storage, fence, items, report, message) {
192
- await markUncertainWithoutRecovery(storage, fence, items, report, message);
193
- }
194
- async function markUncertainWithoutRecovery(storage, fence, items, report, message) {
195
- for (const item of items) {
196
- if (await storage.markDeliveryUncertain({
197
- ...fence,
198
- effectId: item.pending.effect_id,
199
- claimToken: item.claimToken,
200
- uncertainSince: item.pending.uncertain_since ?? fence.now,
201
- nextProbeAt: fence.now + 1_000,
202
- lastErrorCode: WORKER_ERROR_CODES.DELIVERY_UNCERTAIN_REQUIRES_PROBE,
203
- lastErrorMessage: message,
204
- }))
205
- report.deferred += 1;
206
- }
207
- }
208
- export async function requeueFastAppendItems(storage, fence, items, report) {
209
- for (const item of items) {
210
- if (await storage.retryClaimedEffect({
211
- ...fence,
212
- effectId: item.pending.effect_id,
213
- claimToken: item.claimToken,
214
- lastErrorCode: WORKER_ERROR_CODES.PROVIDER_RETRYABLE_ERROR,
215
- lastErrorMessage: "Fast append response was not observed; the row will be retried and reconciled later.",
216
- })) {
217
- report.deferred += 1;
218
- report.requeued += 1;
219
- }
220
- }
221
- }
222
- //# sourceMappingURL=SyncEffectWorkerDispatch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SyncEffectWorkerDispatch.js","sourceRoot":"","sources":["../../../../../src/application/sync/outbound/effects/SyncEffectWorkerDispatch.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAGnF,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAKtF,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACL,SAAS,EACT,YAAY,GACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,eAAe,EACf,eAAe,EACf,qBAAqB,GACtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GAExB,MAAM,kCAAkC,CAAC;AAQ1C,kFAAkF;AAClF,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,OAA4B,EAC5B,KAAqB,EACrB,KAA+B,EAC/B,MAAqB;IAErB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,oBAAoB,EAAE,CAAC;YACjD,MAAM,4BAA4B,CAChC,OAAO,EACP,KAAK,EACL,C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AO;SAC1B,CAAC;YAAE,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAA4B,EAC5B,KAAqB,EACrB,KAA+B,EAC/B,MAAqB;IAErB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,MAAM,OAAO,CAAC,kBAAkB,CAAC;YACnC,GAAG,KAAK;YACR,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YAChC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,aAAa,EAAE,kBAAkB,CAAC,wBAAwB;YAC1D,gBAAgB,EAAE,sFAAsF;SACzG,CAAC,EAAE,CAAC;YACH,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC;YACrB,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,14 +0,0 @@
1
- /** Small value and error helpers shared by effect-worker modules. */
2
- import type { Applicability, LookupResult, Presence } from "../../../../domain/index.js";
3
- import { PRESENCE_KINDS } from "../../../../shared/state/constants.js";
4
- export declare function safeErrorMessage(error: unknown): string;
5
- export type PresentValue<T> = {
6
- readonly kind: typeof PRESENCE_KINDS.PRESENT;
7
- readonly value: T;
8
- };
9
- export declare function isPresent<T>(value: Presence<T>): value is PresentValue<T>;
10
- export declare function isAbsent<T>(value: Presence<T>): boolean;
11
- export declare function lookupResult<T>(value: T | undefined): LookupResult<T>;
12
- export declare function applicabilityFromSqlNullable<T>(value: T | null): Applicability<T>;
13
- export declare function throwWorkerError(message: string): never;
14
- //# sourceMappingURL=SyncEffectWorkerHelpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SyncEffectWorkerHelpers.d.ts","sourceRoot":"","sources":["../../../../../src/application/sync/outbound/effects/SyncEffectWorkerHelpers.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAEL,cAAc,EACf,MAAM,uCAAuC,CAAC;AAU/C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEvD;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC5B,QAAQ,CAAC,IAAI,EAAE,OAAO,cAAc,CAAC,OAAO,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;CACnB,CAAC;AAEF,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,YAAY,CAAC,CAAC,CAAC,CAEzE;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAEvD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,CAIrE;AAED,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,CAEjF;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAEvD"}
@@ -1,25 +0,0 @@
1
- /** Small value and error helpers shared by effect-worker modules. */
2
- import { LOOKUP_RESULT_KINDS, PRESENCE_KINDS, } from "../../../../shared/state/constants.js";
3
- import { applicableValue, notApplicableValue, } from "../../../../shared/state/index.js";
4
- import { STORAGE_ERROR_CODES, StorageError, } from "../../../../infrastructure/storage/errors.js";
5
- export function safeErrorMessage(error) {
6
- return error instanceof Error ? error.message.slice(0, 500) : "unknown sync provider failure";
7
- }
8
- export function isPresent(value) {
9
- return value.kind === PRESENCE_KINDS.PRESENT;
10
- }
11
- export function isAbsent(value) {
12
- return value.kind === PRESENCE_KINDS.ABSENT;
13
- }
14
- export function lookupResult(value) {
15
- return value === undefined
16
- ? { kind: LOOKUP_RESULT_KINDS.NOT_FOUND }
17
- : { kind: LOOKUP_RESULT_KINDS.FOUND, value };
18
- }
19
- export function applicabilityFromSqlNullable(value) {
20
- return value === null ? notApplicableValue() : applicableValue(value);
21
- }
22
- export function throwWorkerError(message) {
23
- throw new StorageError(STORAGE_ERROR_CODES.INVALID_PENDING_EFFECT, message);
24
- }
25
- //# sourceMappingURL=SyncEffectWorkerHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SyncEffectWorkerHelpers.js","sourceRoot":"","sources":["../../../../../src/application/sync/outbound/effects/SyncEffectWorkerHelpers.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAGrE,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,eAAe,EACf,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,mBAAmB,EACnB,YAAY,GACb,MAAM,8CAA8C,CAAC;AAEtD,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,+BAA+B,CAAC;AAChG,CAAC;AAOD,MAAM,UAAU,SAAS,CAAI,KAAkB;IAC7C,OAAO,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC,OAAO,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,QAAQ,CAAI,KAAkB;IAC5C,OAAO,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC,MAAM,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,YAAY,CAAI,KAAoB;IAClD,OAAO,KAAK,KAAK,SAAS;QACxB,CAAC,CAAC,EAAE,IAAI,EAAE,mBAAmB,CAAC,SAAS,EAAE;QACzC,CAAC,CAAC,EAAE,IAAI,EAAE,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAI,KAAe;IAC7D,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,MAAM,IAAI,YAAY,CAAC,mBAAmB,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;AAC9E,CAAC"}
@@ -1,61 +0,0 @@
1
- /** Effect conversion, request grouping, and routing predicates. */
2
- import type { EffectTargetKind } from "../../../../domain/index.js";
3
- import type { PendingEffect, WriterLease, FencingContext } from "../../../../infrastructure/storage/index.js";
4
- import type { ApplySyncEffectsRequest, FastAppendRowsRequest, ReadSyncEffectPostconditionsRequest, SyncProjectionEffect, SyncEffectResult, SyncProjection } from "../../sheets/syncSheets.js";
5
- import type { ClaimedEffect } from "./SyncEffectWorker.js";
6
- /** Accepts either inline read-back or a flushed-write acknowledgement. */
7
- export declare function isSuccessfulPostcondition(status: SyncEffectResult["postcondition"]): boolean;
8
- export declare function toProviderEffect(effect: PendingEffect): SyncProjectionEffect;
9
- export declare function groupByProviderRequest(items: readonly ClaimedEffect[]): readonly ProviderEffectGroup[];
10
- /** One append-only route paired with the claimed effects it represents. */
11
- export interface FastAppendProviderGroup {
12
- readonly request: FastAppendRowsRequest;
13
- readonly items: readonly ClaimedEffect[];
14
- }
15
- /** Groups append-only effects into one fast provider request per route. */
16
- export declare function groupByFastAppendRequest(items: readonly ClaimedEffect[]): readonly FastAppendProviderGroup[];
17
- /** Splits append groups using the same adaptive route limit as regular effects. */
18
- export declare function chunkFastAppendGroups(groups: readonly FastAppendProviderGroup[], limit: number | ((group: FastAppendProviderGroup) => number)): readonly FastAppendProviderGroup[];
19
- /** Groups postcondition reads so each group performs one remote Sheet scan. */
20
- export declare function groupByPostconditionRequest(items: readonly ClaimedEffect[]): readonly {
21
- readonly request: ReadSyncEffectPostconditionsRequest;
22
- readonly items: readonly ClaimedEffect[];
23
- }[];
24
- /** Builds the stable grouping key shared by all provider operations on one route. */
25
- export declare function routeKey(route: SyncProjectionEffect | ApplySyncEffectsRequest | FastAppendRowsRequest): string;
26
- /**
27
- * Splits each physical-route group into sub-batches no larger than the
28
- * provider's bounded effect batch (`EFFECT_BATCH_LIMIT` in the worker
29
- * constants, matching `MAX_EFFECTS_PER_REQUEST` in the Google Sheets API
30
- * provider constants) so one `applyEffects` call returns a complete result
31
- * set instead of a `hasMore` partial prefix.
32
- *
33
- * The physical-route grouping and the per-target predecessor ordering of the
34
- * supplied items are preserved: every effect stays on its original route, and
35
- * each sub-batch keeps the order of the ready selection. Effects in one ready
36
- * selection target distinct logical targets (the outbox only marks the
37
- * earliest non-applied effect per target ready), so sub-batching never
38
- * reorders effects that depend on one another.
39
- */
40
- export declare function chunkProviderEffectGroups(groups: readonly ProviderEffectGroup[], limit?: number | ((group: ProviderEffectGroup) => number)): readonly ProviderEffectGroup[];
41
- /** One physical route's effects paired with their provider request. */
42
- export interface ProviderEffectGroup {
43
- readonly request: ApplySyncEffectsRequest;
44
- readonly items: readonly ClaimedEffect[];
45
- }
46
- export declare function isSyncEffectKind(value: string): value is SyncProjectionEffect["effectKind"];
47
- export declare function isCandidateProtectingUserInputEffect(effect: SyncProjectionEffect): boolean;
48
- /** Selects only new System_State entity rows for the append-only fast path. */
49
- export declare function isFastAppendCandidate(item: ClaimedEffect): boolean;
50
- /** Classifies one converted provider effect as an append-only fast candidate. */
51
- export declare function isFastAppendEffect(effect: SyncProjectionEffect): boolean;
52
- /**
53
- * Pending-level fast-append classification used to bound a bulk claim window
54
- * before conversion. Recovery-status effects are excluded because the claim
55
- * loop diverts them to recovery regardless of their append shape.
56
- */
57
- export declare function isFastAppendPendingEffect(pending: PendingEffect): boolean;
58
- export declare function isSyncProjection(value: string): value is SyncProjection;
59
- export declare function isEffectTargetKind(value: string): value is EffectTargetKind;
60
- export declare function fenceFromLease(lease: WriterLease, now: number): FencingContext;
61
- //# sourceMappingURL=SyncEffectWorkerRouting.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SyncEffectWorkerRouting.d.ts","sourceRoot":"","sources":["../../../../../src/application/sync/outbound/effects/SyncEffectWorkerRouting.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAMnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,cAAc,EACf,MAAM,6CAA6C,CAAC;AAErD,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACrB,mCAAmC,EACnC,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACf,MAAM,4BAA4B,CAAC;AAkBpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,0EAA0E;AAC1E,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,gBAAgB,CAAC,eAAe,CAAC,GACxC,OAAO,CAGT;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,oBAAoB,CAyB5E;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,SAAS,aAAa,EAAE,GAC9B,SAAS,mBAAmB,EAAE,CA8BhC;AAED,2EAA2E;AAC3E,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;CAC1C;AAED,2EAA2E;AAC3E,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,aAAa,EAAE,GAC9B,SAAS,uBAAuB,EAAE,CAkCpC;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,uBAAuB,EAAE,EAC1C,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,uBAAuB,KAAK,M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