Opens (creating if needed) the project log at path for the scope, in
WAL mode with busy_timeout set to busyTimeoutMillis on every
connection it makes, and closes it when the scope ends. That is how it
meets Domain's busy-wait contract (ProjectLog): an append that
meets another writer's lock waits up to busyTimeoutMillis, as SQLite
documents for busy_timeout (sqlite.org/pragma.html#pragma_busy_timeout,
sqlite.org/c3ref/busy_timeout.html), and then fails with
ProjectLogError ("project log busy") and writes nothing. SQLite's
documented behaviour is the evidence for the wait; no test observes it.
The open takes the write lock briefly, so it can wait up to
busyTimeoutMillis and then fail with "project log busy". A log at
format version 0 (written by v0.1.0) is stamped 1 and a new one is
created at 1; the open never writes 2. A log stamped above
knownLogVersion (2) by a newer release fails with
StoreVersionNewer, and one stamped below 0 with ProjectLogError;
either is left as it was, read and written by nothing. An append raises
a log at 1 to 2 when it holds an event that needs the newer format, and
fails with ProjectLogError, writing nothing, when its transaction
reads a version newer than 2 or below 0.
Opens (creating if needed) the project log at
pathfor the scope, in WAL mode withbusy_timeoutset tobusyTimeoutMillison every connection it makes, and closes it when the scope ends. That is how it meets Domain's busy-wait contract (ProjectLog): an append that meets another writer's lock waits up tobusyTimeoutMillis, as SQLite documents forbusy_timeout(sqlite.org/pragma.html#pragma_busy_timeout, sqlite.org/c3ref/busy_timeout.html), and then fails withProjectLogError("project log busy") and writes nothing. SQLite's documented behaviour is the evidence for the wait; no test observes it. The open takes the write lock briefly, so it can wait up tobusyTimeoutMillisand then fail with "project log busy". A log at format version 0 (written by v0.1.0) is stamped 1 and a new one is created at 1; the open never writes 2. A log stamped aboveknownLogVersion(2) by a newer release fails withStoreVersionNewer, and one stamped below 0 withProjectLogError; either is left as it was, read and written by nothing. An append raises a log at 1 to 2 when it holds an event that needs the newer format, and fails withProjectLogError, writing nothing, when its transaction reads a version newer than 2 or below 0.