verify-sync-session
БесплатноБез исполняемых скриптовНе проверенModel-checks, with TLA+ and TLC, which account each sync write lands in across sign-in, sign-out, switching accounts, Reset Everything, Sign out of all…
от vscarpenter★ 41 звезда на GitHubОб этом скилле
Verify the sync session
A TLA+ model of the web app's sync session lives in docs/formal/sync-session/. TLC checks every order of the steps in the model. One tab runs a fullSync. Either tab can sign in, sign out, run Reset Everything, edit a task, or change Settings, and a realtime event can arrive. Each await in the code is a point where another step can run. A pass covers the model, not the whole app, so read "Bounds and what's left out" before you trust one.
The promise comes from the header of lib/sync/sync-session.ts. A sync belongs to the account that was signed in when it started. Once sync is off or sync_config names another account, that sync writes nothing more. The model checks the harm that promise exists to prevent.
The rules
Each rule is an INVARIANT in SyncSession.tla.
| Rule | What the app promises | The harm when it breaks |
|---|---|---|
NoRecordInAnotherAccount |
No account's server copy ever holds a task or queued edit from another account. | One person's tasks show up in someone else's account, on every device that account uses. |
DeviceHoldsOnlyTheSignedInAccount |
While sync is on for an account, this device holds only that account's tasks and queued edits. | The next push or sign-in uploads the other account's tasks into this one. |
TypeOK keeps each variable in its range. It guards the model, not the app.
What the model found (2026-11-08)
The code broke both rules on that date. Every path below was replayed against the real code, and the replay showed the task in the wrong account. All four findings were fixed on 2026-11-11, and no finding is open. Each fix has a Broken value and a Broken*.cfg that undo it. The paths below are how each one broke before its fix.
push-reads-queue-unfenced(fixed 2026-11-11).pushLocalChangeschecked the SDK principal once, then read the queue with noassertSyncSessionCurrent. The fix:readPendingForSessionreads the queue inside a transaction that makes that check, and the push repeats it before each row and inside each queue write.BrokenPushQueueFence.cfgremoves the queue check and breaks the rule again. The paths below are how it broke before the fix. TLC's path: you sign in as A, and a sync for A starts. You sign in as B in a dialog left open in another tab.persistSyncConfigswitches to B, since the device holds no tasks yet. B's task arrives and you edit it. A second sign-in as A saves A's token before its own save refuses it.resolvePushPrincipalnow passes for A, the push reads B's edit, andupsertRemoteTaskcreates it withowner: Aunder A's token. The server accepts it. A second replay found a way in with no stale dialog. The sync tab'sauthRefreshwas in flight while the other tab signed out and signed in as B. Its late response then saved A's token over B's, becauseclearPocketBaseonly detaches the tab that calls it. The refresh runs on every sync in a token's last seven days.sign-out-reads-config-early(fixed 2026-11-11).disableSynccalledgetSyncConfig()beforeresetSyncConfigStateopened its transaction, then wrote the signed-out row from that copy. If A's sign-in saved in between, the row it wrote kept nolocalTaskOwnerUserId. A's task stayed on the device with no owner recorded, so B could sign in. ThenpopulateFromExistingTasksqueued A's task, and B's push uploaded it to B. It needed a Sign out click in a dialog that still showed an older session, within the moment A's sign-in took to save. The fix:disableSyncreads nothing first, andresetSyncConfigStatereads the row inside its transaction.BrokenSignOutRead.cfgmoves the read back before the transaction and breaks the rule again.settings-writes-stale-config(fixed 2026-11-11).updateAutoSyncConfigcalledupdateSyncConfig, which read the row and put{...current, ...updates}with no transaction. One path matched finding 2. The shortest break ran the other way. Settings read A's row while B's sign-in saved, then wrote A's row back. B's task then sat on a device whosesync_confignamed A. The toggle showed only while that tab believed sync was on, and the window was one IndexedDB round trip. The fix:updateSyncConfigreads and writes the row in onerwtransaction oversyncMetadata.BrokenSettingsWrite.cfgsplits the read from the write and breaks the rule again.populate-after-sign-in(fixed 2026-11-11).persistSyncConfigcommitted its transaction, thenpopulateFromExistingTasksreaddb.tasksand enqueued each task with no session check. If Reset Everything erased local data between that read and the enqueues, A's task was queued into an empty device. B could then sign in, since the guard counts tasks and not queue rows, and B's push uploaded A's task. The reset had to fit between a few IndexedDB round trips. The fix: the sign-in transaction also scopessyncQueueand callspopulateFromExistingTasksitself. The config and the queue rows commit t
Установить verify-sync-session в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл verify-sync-session?
Model-checks, with TLA+ and TLC, which account each sync write lands in across sign-in, sign-out, switching accounts, Reset Everything, Sign out of all devices, and a second open tab, so a change can't upload one account's tasks into another account. Use when a change touches lib/sync/sync-session.ts, pb-sync-engine.ts (fullSync, runSyncPasses, applyRemoteChange), pb-push.ts (pushLocalChanges, resolvePushPrincipal), pb-pull.ts (pullRemoteChanges, applyRemoteRecords), pb-realtime.ts, pb-auth.ts (ensureValidAuth, refreshAuthOutcome), pocketbase-client.ts, sign-out-everywhere.ts, sync-coordinator.ts, queue.ts (getPending, populateFromExistingTasks), lib/sync/config/ (disableSync, updateSyncConfig), lib/reset-everything.ts, lib/reset-local-data.ts, lib/tasks/crud/helpers.ts (runTaskSyncTransaction), components/sync/use-sync-auth-dialog.ts (persistSyncConfig), the tasks API rules in scripts/setup-pocketbase-collections.sh, or any code that writes sync_config, the sync queue, or local task rows on behalf of a sync. Also use when adding a new sync write path.
Как установить скилл verify-sync-session?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл verify-sync-session запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic