RFC: AnkiConnect Write Concurrency & SQLite Locking Over Loopback

1. System Topology & Infrastructure Context

I am designing a local-first, air-gapped personal knowledge loop deployed natively on an isolated Ubuntu environment. Before running this setup in production, I want to validate the core database behavior and locking mechanisms of Anki’s SQLite backend when subjected to high-volume programmatic writes over loopback.

[Host Machine: Ryzen 9 3900X (12C/24T) | 64GB RAM | Samsung 970 EVO NVMe]
 
 [Obsidian Vault] ◄───(Filesystem Watcher)───► [Transcription Engine]
        ▲                                             │
        │ (Bidirectional Syncthing Target)            ▼ (Local Loopback 127.0.0.1)
 [Isolated Directory] ◄───(AnkiConnect API)───────► [Anki Desktop / Core SQLite]

2. Primary Engineering Question: SQLite Write Concurrency
To loop missed or flagged cards back into our Markdown repository for structural review, we utilize a local reverse-synchronization daemon running alongside the active desktop user interface. This daemon interfaces via the AnkiConnect loopback API to query, update, and modify note fields programmatically.

Lacking a centralized network timestamp coordinator in this air-gapped state, our primary concern is avoiding database write collisions, race conditions, or unhandled database-locked errors.

The Failure Mode: If an automated background process triggers a series of dense programmatic card updates or note modifications via the AnkiConnect socket loop at the exact millisecond a user executes a manual text edit or card suspension inside the native Anki Browser graphical interface, how does the underlying engine serialize the transactions?

Core Questions:

How robustly does the Anki core handle concurrent automated and manual SQLite write operations?

Are there known write-lock or transaction-collision edge cases within the desktop application lifecycle that a script developer must explicitly construct an application-side validation or retry queue for?

I want to ensure absolute database integrity over extended offline operational periods. Technical critique regarding SQLite concurrency limits or write-locking behaviors within the Anki core lifecycle is highly welcome.