hikoutei 0.9.26 → 0.9.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/contracts/sheets/googleSheetsApi.d.ts +27 -4
- package/dist/contracts/sheets/googleSheetsApi.d.ts.map +1 -1
- package/dist/contracts/sheets/googleSheetsApi.js +8 -4
- package/dist/contracts/sheets/googleSheetsApi.js.map +1 -1
- package/dist/contracts/sheets/mutationCoordinator/CoordinatedSheetsProvider.d.ts +9 -1
- package/dist/contracts/sheets/mutationCoordinator/CoordinatedSheetsProvider.d.ts.map +1 -1
- package/dist/contracts/sheets/mutationCoordinator/CoordinatedSheetsProvider.js +13 -1
- package/dist/contracts/sheets/mutationCoordinator/CoordinatedSheetsProvider.js.map +1 -1
- package/dist/contracts/sheets/rowCheck.d.ts +103 -0
- package/dist/contracts/sheets/rowCheck.d.ts.map +1 -0
- package/dist/contracts/sheets/rowCheck.js +134 -0
- package/dist/contracts/sheets/rowCheck.js.map +1 -0
- package/dist/contracts/sheets/syncSheets.d.ts +105 -0
- package/dist/contracts/sheets/syncSheets.d.ts.map +1 -1
- package/dist/contracts/sheets/syncSheets.js +5 -0
- package/dist/contracts/sheets/syncSheets.js.map +1 -1
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.d.ts +2 -0
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.d.ts.map +1 -1
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.js +124 -2
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.js.map +1 -1
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingChecks.d.ts +83 -0
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingChecks.d.ts.map +1 -0
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingChecks.js +213 -0
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingChecks.js.map +1 -0
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingSql.d.ts +9 -0
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingSql.d.ts.map +1 -1
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingSql.js +19 -1
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingSql.js.map +1 -1
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingState.d.ts +10 -2
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingState.d.ts.map +1 -1
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingState.js +2 -1
- package/dist/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingState.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.d.ts +10 -2
- package/dist/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.js +16 -0
- package/dist/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/constants.d.ts +14 -0
- package/dist/sheets/providers/google-sheets-api/constants.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/constants.js +14 -0
- package/dist/sheets/providers/google-sheets-api/constants.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/batchBuilder.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/batchBuilder.js +25 -0
- package/dist/sheets/providers/google-sheets-api/model/batchBuilder.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/observation.d.ts +29 -11
- package/dist/sheets/providers/google-sheets-api/model/observation.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/observation.js +140 -35
- package/dist/sheets/providers/google-sheets-api/model/observation.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/postcondition.d.ts +9 -0
- package/dist/sheets/providers/google-sheets-api/model/postcondition.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/postcondition.js +12 -0
- package/dist/sheets/providers/google-sheets-api/model/postcondition.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightContext.d.ts +156 -21
- package/dist/sheets/providers/google-sheets-api/model/preflightContext.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightContext.js +452 -88
- package/dist/sheets/providers/google-sheets-api/model/preflightContext.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightFields.d.ts +35 -2
- package/dist/sheets/providers/google-sheets-api/model/preflightFields.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightFields.js +45 -6
- package/dist/sheets/providers/google-sheets-api/model/preflightFields.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightParsing.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightParsing.js +26 -3
- package/dist/sheets/providers/google-sheets-api/model/preflightParsing.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightRows.d.ts +71 -2
- package/dist/sheets/providers/google-sheets-api/model/preflightRows.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightRows.js +134 -8
- package/dist/sheets/providers/google-sheets-api/model/preflightRows.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightVerify.d.ts +99 -0
- package/dist/sheets/providers/google-sheets-api/model/preflightVerify.d.ts.map +1 -0
- package/dist/sheets/providers/google-sheets-api/model/preflightVerify.js +301 -0
- package/dist/sheets/providers/google-sheets-api/model/preflightVerify.js.map +1 -0
- package/dist/sheets/providers/google-sheets-api/model/readPlan.d.ts +168 -0
- package/dist/sheets/providers/google-sheets-api/model/readPlan.d.ts.map +1 -0
- package/dist/sheets/providers/google-sheets-api/model/readPlan.js +184 -0
- package/dist/sheets/providers/google-sheets-api/model/readPlan.js.map +1 -0
- package/dist/sheets/providers/google-sheets-api/model/receiptCursor.d.ts +102 -0
- package/dist/sheets/providers/google-sheets-api/model/receiptCursor.d.ts.map +1 -0
- package/dist/sheets/providers/google-sheets-api/model/receiptCursor.js +132 -0
- package/dist/sheets/providers/google-sheets-api/model/receiptCursor.js.map +1 -0
- package/dist/sheets/providers/google-sheets-api/model/rowCheckFormula.d.ts +35 -0
- package/dist/sheets/providers/google-sheets-api/model/rowCheckFormula.d.ts.map +1 -0
- package/dist/sheets/providers/google-sheets-api/model/rowCheckFormula.js +57 -0
- package/dist/sheets/providers/google-sheets-api/model/rowCheckFormula.js.map +1 -0
- package/dist/sheets/providers/google-sheets-api/operations/applyEffects.d.ts +130 -4
- package/dist/sheets/providers/google-sheets-api/operations/applyEffects.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/applyEffects.js +285 -29
- package/dist/sheets/providers/google-sheets-api/operations/applyEffects.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/fastAppend.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/fastAppend.js +177 -17
- package/dist/sheets/providers/google-sheets-api/operations/fastAppend.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/preflightOp.d.ts +97 -14
- package/dist/sheets/providers/google-sheets-api/operations/preflightOp.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/preflightOp.js +173 -34
- package/dist/sheets/providers/google-sheets-api/operations/preflightOp.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/provisioning.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/provisioning.js +86 -8
- package/dist/sheets/providers/google-sheets-api/operations/provisioning.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/readEngine.d.ts +50 -0
- package/dist/sheets/providers/google-sheets-api/operations/readEngine.d.ts.map +1 -0
- package/dist/sheets/providers/google-sheets-api/operations/readEngine.js +123 -0
- package/dist/sheets/providers/google-sheets-api/operations/readEngine.js.map +1 -0
- package/dist/sheets/providers/google-sheets-api/operations/readRows.d.ts +1 -0
- package/dist/sheets/providers/google-sheets-api/operations/readRows.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/readRows.js +18 -16
- package/dist/sheets/providers/google-sheets-api/operations/readRows.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/rowChecks.d.ts +44 -0
- package/dist/sheets/providers/google-sheets-api/operations/rowChecks.d.ts.map +1 -0
- package/dist/sheets/providers/google-sheets-api/operations/rowChecks.js +202 -0
- package/dist/sheets/providers/google-sheets-api/operations/rowChecks.js.map +1 -0
- package/dist/sheets/providers/google-sheets-api/operations/shared.d.ts +27 -0
- package/dist/sheets/providers/google-sheets-api/operations/shared.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/shared.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.js +11 -0
- package/dist/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.js.map +1 -1
- package/dist/sync-engine/sync/outbound/SheetsEffectDispatcher.d.ts +3 -1
- package/dist/sync-engine/sync/outbound/SheetsEffectDispatcher.d.ts.map +1 -1
- package/dist/sync-engine/sync/outbound/SheetsEffectDispatcher.js +119 -38
- package/dist/sync-engine/sync/outbound/SheetsEffectDispatcher.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -253,7 +253,12 @@ shared on the spreadsheet (the error tells you which email to share).
|
|
|
253
253
|
> **Legacy spreadsheet note.** Spreadsheets provisioned by the old Apps Script
|
|
254
254
|
> provider with developer-metadata row anchors are not migrated: `User_Input`
|
|
255
255
|
> tabs now require the `__hikoutei_row_id` system column, so legacy tabs must
|
|
256
|
-
> be re-provisioned.
|
|
256
|
+
> be re-provisioned. Current provisioning also adds one internal formula
|
|
257
|
+
> column, `__hikoutei_row_check`, directly after each `User_Input` tab's
|
|
258
|
+
> registered range: Hikoutei writes a change-detection formula per row, and
|
|
259
|
+
> polling reads only that column to spot human edits (rows without it fall
|
|
260
|
+
> back to full reads). Do not edit, sort, or delete the column or its
|
|
261
|
+
> formulas.
|
|
257
262
|
|
|
258
263
|
Hikoutei uses a durable local outbox, idempotent delivery, and conflict-aware
|
|
259
264
|
updates so temporary API failures do not lose committed application writes. The
|
|
@@ -23,10 +23,14 @@ export declare const GOOGLE_SHEETS_API_DEFAULTS: {
|
|
|
23
23
|
readonly MIN_REQUEST_TIMEOUT_MS: 1000;
|
|
24
24
|
readonly MAX_REQUEST_TIMEOUT_MS: 120000;
|
|
25
25
|
/**
|
|
26
|
-
* Default per-READ-request timeout (every getSpreadsheet call).
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
26
|
+
* Default per-READ-request timeout (every getSpreadsheet call). Since the
|
|
27
|
+
* unified read engine this bounds ONE BAND, not one logical read: a large
|
|
28
|
+
* tab is streamed as sequential size-capped band requests, so a timeout
|
|
29
|
+
* fails one bounded band (durable retry) instead of an all-or-nothing
|
|
30
|
+
* multi-megabyte single request. Reads stay much shorter than writes so a
|
|
31
|
+
* slow-but-working effect dispatch cannot outlive its effect lease; the
|
|
32
|
+
* per-request 3 MB/5 MB estimate caps keep each band's expected stream
|
|
33
|
+
* time far below this bound.
|
|
30
34
|
*/
|
|
31
35
|
readonly READ_TIMEOUT_MS: 10000;
|
|
32
36
|
/** Upper bound for read timeouts; reads must stay well under the lease. */
|
|
@@ -97,6 +101,12 @@ export interface GoogleSheetsApiCell {
|
|
|
97
101
|
readonly stringValue?: string;
|
|
98
102
|
readonly numberValue?: number;
|
|
99
103
|
readonly boolValue?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Formula text with the leading `=` (exactly what the UI shows; the
|
|
106
|
+
* real API echoes it back in `userEnteredValue`). Used only by the
|
|
107
|
+
* row-check column formula cells; every other write stays literal.
|
|
108
|
+
*/
|
|
109
|
+
readonly formulaValue?: string;
|
|
100
110
|
};
|
|
101
111
|
readonly userEnteredFormat?: {
|
|
102
112
|
readonly numberFormat?: GoogleSheetsApiNumberFormat;
|
|
@@ -141,6 +151,19 @@ export type GoogleSheetsApiWriteRequest = {
|
|
|
141
151
|
readonly startIndex: number;
|
|
142
152
|
/** Exclusive end index; exactly one row is deleted by the provider. */
|
|
143
153
|
readonly endIndex: number;
|
|
154
|
+
} | {
|
|
155
|
+
/**
|
|
156
|
+
* Grows the tab's grid. `updateCells` never expands the grid (a proven
|
|
157
|
+
* 400 for out-of-bounds ranges), so provisioning emits this BEFORE the
|
|
158
|
+
* header write whenever the row-check column sits outside the current
|
|
159
|
+
* grid width. 0-based exclusive end index, like the other dimension
|
|
160
|
+
* requests.
|
|
161
|
+
*/
|
|
162
|
+
readonly kind: "addDimension";
|
|
163
|
+
readonly sheetId: number;
|
|
164
|
+
readonly dimension: "COLUMNS";
|
|
165
|
+
readonly startIndex: number;
|
|
166
|
+
readonly endIndex: number;
|
|
144
167
|
} | {
|
|
145
168
|
readonly kind: "setDataValidation";
|
|
146
169
|
readonly sheetId: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"googleSheetsApi.d.ts","sourceRoot":"","sources":["../../src/sheets/googleSheetsApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,2DAE3B,CAAC;AAEX,wEAAwE;AACxE,eAAO,MAAM,0BAA0B;IACrC,gFAAgF;;;;IAIhF
|
|
1
|
+
{"version":3,"file":"googleSheetsApi.d.ts","sourceRoot":"","sources":["../../src/sheets/googleSheetsApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,2DAE3B,CAAC;AAEX,wEAAwE;AACxE,eAAO,MAAM,0BAA0B;IACrC,gFAAgF;;;;IAIhF;;;;;;;;;OASG;;IAEH,2EAA2E;;IAE3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AAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IACxC,6DAA6D;IAC7D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,mDAAmD;IACnD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,uCAAuC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,CAAC;CACnE;AAED,0EAA0E;AAE1E,6DAA6D;AAC7D,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMpD;AAED,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CASpD;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE1D"}
|
|
@@ -24,10 +24,14 @@ export const GOOGLE_SHEETS_API_DEFAULTS = {
|
|
|
24
24
|
MIN_REQUEST_TIMEOUT_MS: 1_000,
|
|
25
25
|
MAX_REQUEST_TIMEOUT_MS: 120_000,
|
|
26
26
|
/**
|
|
27
|
-
* Default per-READ-request timeout (every getSpreadsheet call).
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* Default per-READ-request timeout (every getSpreadsheet call). Since the
|
|
28
|
+
* unified read engine this bounds ONE BAND, not one logical read: a large
|
|
29
|
+
* tab is streamed as sequential size-capped band requests, so a timeout
|
|
30
|
+
* fails one bounded band (durable retry) instead of an all-or-nothing
|
|
31
|
+
* multi-megabyte single request. Reads stay much shorter than writes so a
|
|
32
|
+
* slow-but-working effect dispatch cannot outlive its effect lease; the
|
|
33
|
+
* per-request 3 MB/5 MB estimate caps keep each band's expected stream
|
|
34
|
+
* time far below this bound.
|
|
31
35
|
*/
|
|
32
36
|
READ_TIMEOUT_MS: 10_000,
|
|
33
37
|
/** Upper bound for read timeouts; reads must stay well under the lease. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"googleSheetsApi.js","sourceRoot":"","sources":["../../src/sheets/googleSheetsApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,8CAA8C;CACtC,CAAC;AAEX,wEAAwE;AACxE,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,gFAAgF;IAChF,kBAAkB,EAAE,MAAM;IAC1B,sBAAsB,EAAE,KAAK;IAC7B,sBAAsB,EAAE,OAAO;IAC/B
|
|
1
|
+
{"version":3,"file":"googleSheetsApi.js","sourceRoot":"","sources":["../../src/sheets/googleSheetsApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,8CAA8C;CACtC,CAAC;AAEX,wEAAwE;AACxE,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,gFAAgF;IAChF,kBAAkB,EAAE,MAAM;IAC1B,sBAAsB,EAAE,KAAK;IAC7B,sBAAsB,EAAE,OAAO;IAC/B;;;;;;;;;OASG;IACH,eAAe,EAAE,MAAM;IACvB,2EAA2E;IAC3E,mBAAmB,EAAE,MAAM;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,yBAAyB,EAAE,GAAG;IAC9B;;;;;;;;;OASG;IACH,mCAAmC,EAAE,KAAK;IAC1C;;;;;OAKG;IACH,uBAAuB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACxC;;;;;OAKG;IACH,uBAAuB,EAAE,KAAK;IAC9B,2EAA2E;IAC3E,2BAA2B,EAAE,KAAK;CAC1B,CAAC;AA8NX,0EAA0E;AAE1E,6DAA6D;AAC7D,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,GAAG,MAAM,GAAG,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACnD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,KAAK,GAAG,MAAM,CAAC;IACnB,OAAO,KAAK,GAAG,CAAC,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QACnC,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC;QACxD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC;AAC9C,CAAC"}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* lease renewal) after the lane is acquired and before the inner provider
|
|
34
34
|
* call, so queue time plus limiter waits cannot outlive the lease.
|
|
35
35
|
*/
|
|
36
|
-
import type { ApplySyncEffectsRequest, ApplySyncEffectsResult, EnsureSyncRowAnchorsRequest, EnsureSyncRowAnchorsResult, FastAppendRowsRequest, FastAppendRowsResult, PreparedApplyEffects, ReadSyncEffectPostconditionsRequest, ReadSyncSnapshotRequest, ReadSyncTableRowsRequest, SyncEffectPostcondition, SyncProjectionEffect, SyncEffectPostconditionResult, SyncSheetsSnapshot, SyncObservedSnapshot, SyncSheetsProvider, SyncSheetsObservationBatchProvider, SyncSheetsTableReader, SyncTableRowsResult, SyncEffectWorkerProvider } from "../syncSheets.js";
|
|
36
|
+
import type { ApplySyncEffectsRequest, ApplySyncEffectsResult, EnsureSyncRowAnchorsRequest, EnsureSyncRowAnchorsResult, FastAppendRowsRequest, FastAppendRowsResult, PreparedApplyEffects, ReadSyncEffectPostconditionsRequest, ReadSyncRowChecksRequest, ReadSyncSnapshotRequest, ReadSyncTableRowsRequest, SyncEffectPostcondition, SyncProjectionEffect, SyncEffectPostconditionResult, SyncRowChecksResult, SyncSheetsSnapshot, SyncObservedSnapshot, SyncSheetsProvider, SyncSheetsObservationBatchProvider, SyncSheetsTableReader, SyncTableRowsResult, SyncEffectWorkerProvider } from "../syncSheets.js";
|
|
37
37
|
import { AsyncMutex } from "./asyncMutex.js";
|
|
38
38
|
import { type CoordinatorLaneEvent } from "./laneTelemetry.js";
|
|
39
39
|
/** Provider boundary the coordinator wraps (effect + observation + table read). */
|
|
@@ -82,6 +82,14 @@ export declare class CoordinatedSheetsProvider<TInner extends CoordinatedSheetsI
|
|
|
82
82
|
private readonly onLaneEvent;
|
|
83
83
|
private readonly now;
|
|
84
84
|
private readonly lanes;
|
|
85
|
+
/**
|
|
86
|
+
* Narrow row-check read (the formula check-column polling gate), exposed
|
|
87
|
+
* ONLY when the inner provider supports it. Lock-free like every value
|
|
88
|
+
* read (never waits on a mutation lane). `isSyncSheetsRowChecksReader`
|
|
89
|
+
* against the coordinator therefore reports the INNER's capability, which
|
|
90
|
+
* is what polling's feature detection needs.
|
|
91
|
+
*/
|
|
92
|
+
readonly readRowChecksBatch?: (requests: readonly ReadSyncRowChecksRequest[]) => Promise<readonly SyncRowChecksResult[]>;
|
|
85
93
|
constructor(options: CoordinatedSheetsProviderOptions<TInner>);
|
|
86
94
|
/** Returns a snapshot of all known lane metrics; diagnostic only. */
|
|
87
95
|
laneMetrics(): ReadonlyMap<string, ReturnType<AsyncMutex["metrics"]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoordinatedSheetsProvider.d.ts","sourceRoot":"","sources":["../../../src/sheets/mutationCoordinator/CoordinatedSheetsProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;
|
|
1
|
+
{"version":3,"file":"CoordinatedSheetsProvider.d.ts","sourceRoot":"","sources":["../../../src/sheets/mutationCoordinator/CoordinatedSheetsProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAMH,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,mCAAmC,EACnC,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,6BAA6B,EAC7B,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,kCAAkC,EAClC,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAG5B,mFAAmF;AACnF,MAAM,MAAM,sBAAsB,GAChC,kBAAkB,GAClB,qBAAqB,CAAC;AAWxB;;;GAGG;AACH,qBAAa,gCAAiC,SAAQ,KAAK;;CAK1D;AAED;;;;GAIG;AACH,qBAAa,qCAAsC,SAAQ,KAAK;;CAK/D;AAMD,8DAA8D;AAC9D,MAAM,WAAW,gCAAgC,CAAC,MAAM,SAAS,sBAAsB;IACrF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CAAC,eAAe,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CAAC;IAItF,4EAA4E;IAC/D,aAAa,CACxB,QAAQ,EAAE,SAAS,wBAAwB,EAAE,GAC5C,OAAO,CAAC,SAAS,mBAAmB,EAAE,CAAC;IAI1C;;;;;OAKG;YACW,eAAe;IAS7B,OAAO,CAAC,OAAO;YASD,WAAW;YAUX,UAAU;IAmDxB,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,IAAI;CAOb;AAID,mFAAmF;AACnF,MAAM,MAAM,kCAAkC,GAAG,IAAI,CACnD,yBAAyB,CAAC,sBAAsB,CAAC,EACjD,oBAAoB,CACrB,GAAG;IACF,0EAA0E;IAC1E,2BAA2B,CAAC,EAAE,yBAAyB,CAAC,sBAAsB,CAAC,CAAC,6BAA6B,CAAC,CAAC;CAChH,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,wBAAwB,GACjC,QAAQ,IAAI,wBAAwB,GAAG,kCAAkC,CAE3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,wBAAwB,GACjC,QAAQ,IAAI,wBAAwB,GACrC,IAAI,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,EAAE,6BAA6B,CAAC,CAEvF;AAOD;;;;;;;GAOG;AACH,eAAO,MAAM,sCAAsC;;;CAGzC,CAAC;AAEX,+EAA+E;AAC/E,MAAM,MAAM,iCAAiC,GAC3C,CAAC,OAAO,sCAAsC,CAAC,CAAC,MAAM,OAAO,sCAAsC,CAAC,CAAC;AAEvG,+EAA+E;AAC/E,qBAAa,6BAA8B,SAAQ,SAAS;IAC1D,SAAgB,IAAI,EAAE,iCAAiC,CAAC;gBAErC,IAAI,EAAE,iCAAiC;CAK3D"}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* lease renewal) after the lane is acquired and before the inner provider
|
|
34
34
|
* call, so queue time plus limiter waits cannot outlive the lease.
|
|
35
35
|
*/
|
|
36
|
-
import { isSyncSheetsObservationBatchProvider, } from "../syncSheets.js";
|
|
36
|
+
import { isSyncSheetsObservationBatchProvider, isSyncSheetsRowChecksReader, } from "../syncSheets.js";
|
|
37
37
|
import { AsyncMutex } from "./asyncMutex.js";
|
|
38
38
|
import { TRANSPORT_OUTCOME_KINDS, } from "./laneTelemetry.js";
|
|
39
39
|
import { classifyTransportOutcome } from "../transportOutcome.js";
|
|
@@ -79,11 +79,23 @@ export class CoordinatedSheetsProvider {
|
|
|
79
79
|
onLaneEvent;
|
|
80
80
|
now;
|
|
81
81
|
lanes = new Map();
|
|
82
|
+
/**
|
|
83
|
+
* Narrow row-check read (the formula check-column polling gate), exposed
|
|
84
|
+
* ONLY when the inner provider supports it. Lock-free like every value
|
|
85
|
+
* read (never waits on a mutation lane). `isSyncSheetsRowChecksReader`
|
|
86
|
+
* against the coordinator therefore reports the INNER's capability, which
|
|
87
|
+
* is what polling's feature detection needs.
|
|
88
|
+
*/
|
|
89
|
+
readRowChecksBatch;
|
|
82
90
|
constructor(options) {
|
|
83
91
|
this.inner = options.inner;
|
|
84
92
|
this.resolveKey = options.mutationKeyForPhysicalSheet ?? (() => DEFAULT_LANE_KEY);
|
|
85
93
|
this.onLaneEvent = options.onLaneEvent;
|
|
86
94
|
this.now = options.clock ?? Date.now;
|
|
95
|
+
const inner = options.inner;
|
|
96
|
+
if (isSyncSheetsRowChecksReader(inner)) {
|
|
97
|
+
this.readRowChecksBatch = (requests) => inner.readRowChecksBatch(requests);
|
|
98
|
+
}
|
|
87
99
|
}
|
|
88
100
|
/** Returns a snapshot of all known lane metrics; diagnostic only. */
|
|
89
101
|
laneMetrics() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoordinatedSheetsProvider.js","sourceRoot":"","sources":["../../../src/sheets/mutationCoordinator/CoordinatedSheetsProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACL,oCAAoC,
|
|
1
|
+
{"version":3,"file":"CoordinatedSheetsProvider.js","sourceRoot":"","sources":["../../../src/sheets/mutationCoordinator/CoordinatedSheetsProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACL,oCAAoC,EACpC,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC;AAyB1B,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AACrE,OAAO,EACL,uBAAuB,GAExB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAOlE;;;;;GAKG;AACH,MAAM,qCAAqC,GACzC,qFAAqF,CAAC;AAExF;;;GAGG;AACH,MAAM,OAAO,gCAAiC,SAAQ,KAAK;IACzD;QACE,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAC7C,IAAI,CAAC,IAAI,GAAG,kCAAkC,CAAC;IACjD,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,qCAAsC,SAAQ,KAAK;IAC9D;QACE,KAAK,CAAC,2DAA2D,CAAC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,uCAAuC,CAAC;IACtD,CAAC;CACF;AAsBD;;;;;;;GAOG;AACH,MAAM,OAAO,yBAAyB;IAEnB,KAAK,CAAS;IACd,UAAU,CAAsC;IAChD,WAAW,CAAsD;IACjE,GAAG,CAAe;IAClB,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;IACvD;;;;;;OAMG;IACa,kBAAkB,CAEW;IAE7C,YAAmB,OAAiD;QAClE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,2BAA2B,IAAI,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,CAAC;QAClF,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,GAAG,G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I,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,6BAA6B,CAAC,sCAAsC,CAAC,8BAA8B,CAAC,CAAC;IACjH,CAAC;IACD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,eAAe,GAAI,MAA2C,EAAE,eAAe,CAAC;QACtF,IAAI,OAAO,eAAe,KAAK,QAAQ,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxE,MAAM,IAAI,6BAA6B,CAAC,sCAAsC,CAAC,uCAAuC,CAAC,CAAC;QAC1H,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Row-level change-detection check column (shared semantics leaf).
|
|
3
|
+
*
|
|
4
|
+
* The User_Input projection carries one extra column IMMEDIATELY AFTER the
|
|
5
|
+
* registered range holding a deterministic formula the system writes at row
|
|
6
|
+
* creation: a `&`-concatenation of one LENGTH-PREFIXED, TYPE-TAGGED token
|
|
7
|
+
* per user data column of the row (see {@link renderRowCheckCell}). The
|
|
8
|
+
* Sheet's recalculation engine maintains the cell, so a human edit to any
|
|
9
|
+
* data column changes the visible check string without any system
|
|
10
|
+
* involvement. Inbound polling then reads ONLY that column (plus the
|
|
11
|
+
* identity and system row-id bands for row mapping), compares each row's
|
|
12
|
+
* observed check string against the value SQLite derives deterministically
|
|
13
|
+
* from the canonical field state, and escalates only mismatched rows to a
|
|
14
|
+
* targeted full-field read. A match therefore skips the row's data columns
|
|
15
|
+
* entirely.
|
|
16
|
+
*
|
|
17
|
+
* This module is the SINGLE source for the token semantics both sides must
|
|
18
|
+
* share: the provider builds the formula from the same delimiter/tag
|
|
19
|
+
* constants, and the polling side renders the expected string with
|
|
20
|
+
* {@link computeRowCheckValue}. The encoding is INJECTIVE (collision-free)
|
|
21
|
+
* and type-aware by construction:
|
|
22
|
+
*
|
|
23
|
+
* - every column contributes EXACTLY ONE positional token
|
|
24
|
+
* `<typeTag><charLength>:<renderedValue>`, so the length prefix (not the
|
|
25
|
+
* delimiter) defines token boundaries: a delimiter INSIDE a value
|
|
26
|
+
* (["a|b", "c"] vs ["a", "b|c"]) can never fake a boundary;
|
|
27
|
+
* - blank permutations cannot collapse: a value moved across a blank
|
|
28
|
+
* boundary changes which POSITION carries the text (`"z"|""` vs
|
|
29
|
+
* `""|"z"` render `s1:z|s0:`, never the same string);
|
|
30
|
+
* - the first character of every token is its type tag (`s` text — also
|
|
31
|
+
* blank/empty string, which are visually identical in a Sheet; `n`
|
|
32
|
+
* number or date serial; `b` boolean), so the string "12" (`s2:12`)
|
|
33
|
+
* never equals the number 12 (`n2:12`).
|
|
34
|
+
*
|
|
35
|
+
* Safety direction: every renderer disagreement (a Sheet locale that
|
|
36
|
+
* renders a decimal with a comma, an emoji whose Sheet LEN counts code
|
|
37
|
+
* points while JavaScript counts UTF-16 units, scientific-notation
|
|
38
|
+
* ceilings) produces a MISMATCH, which degrades to the historical
|
|
39
|
+
* targeted full-field read — a false-dirty row can never hide a real
|
|
40
|
+
* human edit. Known ceilings of the design itself: a human who replaces
|
|
41
|
+
* the check cell with a literal, a foreign formula, or a same-result copy
|
|
42
|
+
* of the system formula (the provider verifies the cell still holds the
|
|
43
|
+
* EXACT generated formula and reports no check evidence otherwise), and a
|
|
44
|
+
* hidden row below the last visible row; the periodic forceFull safety
|
|
45
|
+
* scan is the backstop, exactly like the scoped-preflight gaps documented
|
|
46
|
+
* in `preflightRows.ts`.
|
|
47
|
+
*/
|
|
48
|
+
import type { NormalizedCell } from "../encoding/types.js";
|
|
49
|
+
/**
|
|
50
|
+
* Header of the system-owned row-check column, written by provisioning
|
|
51
|
+
* directly after the registered range's last column of a User_Input tab.
|
|
52
|
+
* The cell is outside every registered range, so no existing read, hash,
|
|
53
|
+
* or blank-row rule ever sees it; only the check-column reader and the
|
|
54
|
+
* append formula writer touch it.
|
|
55
|
+
*/
|
|
56
|
+
export declare const SYNC_ROW_CHECK_HEADER = "__hikoutei_row_check";
|
|
57
|
+
/** Separator between positional tokens (never part of a token body). */
|
|
58
|
+
export declare const SYNC_ROW_CHECK_DELIMITER = "|";
|
|
59
|
+
/** Separator between a token's `<tag><length>` header and its body. */
|
|
60
|
+
export declare const SYNC_ROW_CHECK_LENGTH_SEPARATOR = ":";
|
|
61
|
+
/** Token type tags. A token is exactly `tag + charLength + ":" + body`. */
|
|
62
|
+
export declare const SYNC_ROW_CHECK_TOKEN_TAGS: {
|
|
63
|
+
/** Text — a blank or empty-string cell renders as the zero-length body. */
|
|
64
|
+
readonly STRING: "s";
|
|
65
|
+
/** Number — or date cell rendered as its numeric serial. */
|
|
66
|
+
readonly NUMBER: "n";
|
|
67
|
+
/** Boolean; body is `TRUE`/`FALSE` (what the Sheet concatenates). */
|
|
68
|
+
readonly BOOLEAN: "b";
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Builds one length-prefixed token. The length is the BODY's character
|
|
72
|
+
* count, so decoding (and any collision analysis) skips exactly that many
|
|
73
|
+
* characters after the `:` — the body may contain the delimiter, the tag
|
|
74
|
+
* characters, or digits without ever faking a boundary.
|
|
75
|
+
*/
|
|
76
|
+
export declare function rowCheckToken(tag: string, body: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Renders one normalized cell as its positional check TOKEN. Every column
|
|
79
|
+
* always contributes exactly one token (a blank or empty string renders as
|
|
80
|
+
* the zero-length `s` token), so the joined string is injective over the
|
|
81
|
+
* column vector. Numbers (and date serials) render in JavaScript standard
|
|
82
|
+
* form and booleans as `TRUE`/`FALSE`; the live experiment proved the
|
|
83
|
+
* Sheet's `&`-concatenation renders the tested int/decimal/bool values
|
|
84
|
+
* byte-for-byte identically, and any untested shape that disagrees renders
|
|
85
|
+
* as a MISMATCH — the safe direction (per-row targeted full-field read).
|
|
86
|
+
*/
|
|
87
|
+
export declare function renderRowCheckCell(cell: NormalizedCell): string;
|
|
88
|
+
/**
|
|
89
|
+
* Computes the expected row-check string from canonical field values in
|
|
90
|
+
* COLUMN ORDER. Returns `null` when any header's canonical value is not
|
|
91
|
+
* available — callers must treat a null expectation as "not derivable" and
|
|
92
|
+
* route the row through the historical full-field read instead of guessing.
|
|
93
|
+
* The result always carries one delimiter-separated token per header.
|
|
94
|
+
*/
|
|
95
|
+
export declare function computeRowCheckValue(headers: readonly string[], cellOf: (header: string) => NormalizedCell | undefined): string | null;
|
|
96
|
+
/**
|
|
97
|
+
* Excel/Sheets 1900-system serial for a canonical UTC ISO date: whole (or
|
|
98
|
+
* fractional) days since 1899-12-30 UTC. Same formula as the provider's
|
|
99
|
+
* `dateSerialFromIso`; the provider delegates here so the write-side cell
|
|
100
|
+
* value and the polling-side expected rendering can never drift.
|
|
101
|
+
*/
|
|
102
|
+
export declare function rowCheckDateSerialFromIso(iso: string): number;
|
|
103
|
+
//# sourceMappingURL=rowCheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rowCheck.d.ts","sourceRoot":"","sources":["../../src/sheets/rowCheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,yBAAyB,CAAC;AAE5D,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,uEAAuE;AACvE,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD,2EAA2E;AAC3E,eAAO,MAAM,yBAAyB;IACpC,2EAA2E;;IAE3E,4DAA4D;;IAE5D,qEAAqE;;CAE7D,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAwB/D;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,GACrD,MAAM,GAAG,IAAI,CAQf;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7D"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Row-level change-detection check column (shared semantics leaf).
|
|
3
|
+
*
|
|
4
|
+
* The User_Input projection carries one extra column IMMEDIATELY AFTER the
|
|
5
|
+
* registered range holding a deterministic formula the system writes at row
|
|
6
|
+
* creation: a `&`-concatenation of one LENGTH-PREFIXED, TYPE-TAGGED token
|
|
7
|
+
* per user data column of the row (see {@link renderRowCheckCell}). The
|
|
8
|
+
* Sheet's recalculation engine maintains the cell, so a human edit to any
|
|
9
|
+
* data column changes the visible check string without any system
|
|
10
|
+
* involvement. Inbound polling then reads ONLY that column (plus the
|
|
11
|
+
* identity and system row-id bands for row mapping), compares each row's
|
|
12
|
+
* observed check string against the value SQLite derives deterministically
|
|
13
|
+
* from the canonical field state, and escalates only mismatched rows to a
|
|
14
|
+
* targeted full-field read. A match therefore skips the row's data columns
|
|
15
|
+
* entirely.
|
|
16
|
+
*
|
|
17
|
+
* This module is the SINGLE source for the token semantics both sides must
|
|
18
|
+
* share: the provider builds the formula from the same delimiter/tag
|
|
19
|
+
* constants, and the polling side renders the expected string with
|
|
20
|
+
* {@link computeRowCheckValue}. The encoding is INJECTIVE (collision-free)
|
|
21
|
+
* and type-aware by construction:
|
|
22
|
+
*
|
|
23
|
+
* - every column contributes EXACTLY ONE positional token
|
|
24
|
+
* `<typeTag><charLength>:<renderedValue>`, so the length prefix (not the
|
|
25
|
+
* delimiter) defines token boundaries: a delimiter INSIDE a value
|
|
26
|
+
* (["a|b", "c"] vs ["a", "b|c"]) can never fake a boundary;
|
|
27
|
+
* - blank permutations cannot collapse: a value moved across a blank
|
|
28
|
+
* boundary changes which POSITION carries the text (`"z"|""` vs
|
|
29
|
+
* `""|"z"` render `s1:z|s0:`, never the same string);
|
|
30
|
+
* - the first character of every token is its type tag (`s` text — also
|
|
31
|
+
* blank/empty string, which are visually identical in a Sheet; `n`
|
|
32
|
+
* number or date serial; `b` boolean), so the string "12" (`s2:12`)
|
|
33
|
+
* never equals the number 12 (`n2:12`).
|
|
34
|
+
*
|
|
35
|
+
* Safety direction: every renderer disagreement (a Sheet locale that
|
|
36
|
+
* renders a decimal with a comma, an emoji whose Sheet LEN counts code
|
|
37
|
+
* points while JavaScript counts UTF-16 units, scientific-notation
|
|
38
|
+
* ceilings) produces a MISMATCH, which degrades to the historical
|
|
39
|
+
* targeted full-field read — a false-dirty row can never hide a real
|
|
40
|
+
* human edit. Known ceilings of the design itself: a human who replaces
|
|
41
|
+
* the check cell with a literal, a foreign formula, or a same-result copy
|
|
42
|
+
* of the system formula (the provider verifies the cell still holds the
|
|
43
|
+
* EXACT generated formula and reports no check evidence otherwise), and a
|
|
44
|
+
* hidden row below the last visible row; the periodic forceFull safety
|
|
45
|
+
* scan is the backstop, exactly like the scoped-preflight gaps documented
|
|
46
|
+
* in `preflightRows.ts`.
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* Header of the system-owned row-check column, written by provisioning
|
|
50
|
+
* directly after the registered range's last column of a User_Input tab.
|
|
51
|
+
* The cell is outside every registered range, so no existing read, hash,
|
|
52
|
+
* or blank-row rule ever sees it; only the check-column reader and the
|
|
53
|
+
* append formula writer touch it.
|
|
54
|
+
*/
|
|
55
|
+
export const SYNC_ROW_CHECK_HEADER = "__hikoutei_row_check";
|
|
56
|
+
/** Separator between positional tokens (never part of a token body). */
|
|
57
|
+
export const SYNC_ROW_CHECK_DELIMITER = "|";
|
|
58
|
+
/** Separator between a token's `<tag><length>` header and its body. */
|
|
59
|
+
export const SYNC_ROW_CHECK_LENGTH_SEPARATOR = ":";
|
|
60
|
+
/** Token type tags. A token is exactly `tag + charLength + ":" + body`. */
|
|
61
|
+
export const SYNC_ROW_CHECK_TOKEN_TAGS = {
|
|
62
|
+
/** Text — a blank or empty-string cell renders as the zero-length body. */
|
|
63
|
+
STRING: "s",
|
|
64
|
+
/** Number — or date cell rendered as its numeric serial. */
|
|
65
|
+
NUMBER: "n",
|
|
66
|
+
/** Boolean; body is `TRUE`/`FALSE` (what the Sheet concatenates). */
|
|
67
|
+
BOOLEAN: "b",
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Builds one length-prefixed token. The length is the BODY's character
|
|
71
|
+
* count, so decoding (and any collision analysis) skips exactly that many
|
|
72
|
+
* characters after the `:` — the body may contain the delimiter, the tag
|
|
73
|
+
* characters, or digits without ever faking a boundary.
|
|
74
|
+
*/
|
|
75
|
+
export function rowCheckToken(tag, body) {
|
|
76
|
+
return `${tag}${body.length}${SYNC_ROW_CHECK_LENGTH_SEPARATOR}${body}`;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Renders one normalized cell as its positional check TOKEN. Every column
|
|
80
|
+
* always contributes exactly one token (a blank or empty string renders as
|
|
81
|
+
* the zero-length `s` token), so the joined string is injective over the
|
|
82
|
+
* column vector. Numbers (and date serials) render in JavaScript standard
|
|
83
|
+
* form and booleans as `TRUE`/`FALSE`; the live experiment proved the
|
|
84
|
+
* Sheet's `&`-concatenation renders the tested int/decimal/bool values
|
|
85
|
+
* byte-for-byte identically, and any untested shape that disagrees renders
|
|
86
|
+
* as a MISMATCH — the safe direction (per-row targeted full-field read).
|
|
87
|
+
*/
|
|
88
|
+
export function renderRowCheckCell(cell) {
|
|
89
|
+
if (cell === null)
|
|
90
|
+
return rowCheckToken(SYNC_ROW_CHECK_TOKEN_TAGS.STRING, "");
|
|
91
|
+
switch (cell.kind) {
|
|
92
|
+
case "string":
|
|
93
|
+
// A stored empty string and a blank cell are visually identical in a
|
|
94
|
+
// Sheet (both concatenate to "" and count as length 0); the Sheet-side
|
|
95
|
+
// formula agrees with this equivalence.
|
|
96
|
+
return rowCheckToken(SYNC_ROW_CHECK_TOKEN_TAGS.STRING, cell.value);
|
|
97
|
+
case "number":
|
|
98
|
+
return rowCheckToken(SYNC_ROW_CHECK_TOKEN_TAGS.NUMBER, String(cell.value));
|
|
99
|
+
case "boolean":
|
|
100
|
+
return rowCheckToken(SYNC_ROW_CHECK_TOKEN_TAGS.BOOLEAN, cell.value ? "TRUE" : "FALSE");
|
|
101
|
+
case "date": {
|
|
102
|
+
// A date cell holds a numeric serial (with a display format); the
|
|
103
|
+
// Sheet formula sees ISNUMBER and concatenates the bare serial.
|
|
104
|
+
return rowCheckToken(SYNC_ROW_CHECK_TOKEN_TAGS.NUMBER, String(rowCheckDateSerialFromIso(cell.value)));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Computes the expected row-check string from canonical field values in
|
|
110
|
+
* COLUMN ORDER. Returns `null` when any header's canonical value is not
|
|
111
|
+
* available — callers must treat a null expectation as "not derivable" and
|
|
112
|
+
* route the row through the historical full-field read instead of guessing.
|
|
113
|
+
* The result always carries one delimiter-separated token per header.
|
|
114
|
+
*/
|
|
115
|
+
export function computeRowCheckValue(headers, cellOf) {
|
|
116
|
+
const parts = [];
|
|
117
|
+
for (const header of headers) {
|
|
118
|
+
const cell = cellOf(header);
|
|
119
|
+
if (cell === undefined)
|
|
120
|
+
return null;
|
|
121
|
+
parts.push(renderRowCheckCell(cell));
|
|
122
|
+
}
|
|
123
|
+
return parts.join(SYNC_ROW_CHECK_DELIMITER);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Excel/Sheets 1900-system serial for a canonical UTC ISO date: whole (or
|
|
127
|
+
* fractional) days since 1899-12-30 UTC. Same formula as the provider's
|
|
128
|
+
* `dateSerialFromIso`; the provider delegates here so the write-side cell
|
|
129
|
+
* value and the polling-side expected rendering can never drift.
|
|
130
|
+
*/
|
|
131
|
+
export function rowCheckDateSerialFromIso(iso) {
|
|
132
|
+
return (Date.parse(iso) - Date.UTC(1899, 11, 30)) / 86_400_000;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=rowCheck.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rowCheck.js","sourceRoot":"","sources":["../../src/sheets/rowCheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAE5D,wEAAwE;AACxE,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C,uEAAuE;AACvE,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAEnD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,2EAA2E;IAC3E,MAAM,EAAE,GAAG;IACX,4DAA4D;IAC5D,MAAM,EAAE,GAAG;IACX,qEAAqE;IACrE,OAAO,EAAE,GAAG;CACJ,CAAC;AAEX;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,IAAY;IACrD,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,+BAA+B,GAAG,IAAI,EAAE,CAAC;AACzE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAoB;IACrD,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,aAAa,CAAC,yBAAyB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC9E,QAAQ,IAAI,CAAC,IAAI,E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