feat(FN-4083): add WAL enforcement, immediate write transactions, and concu

Hardened SQLite concurrent-write safety in `@fusion/core` by auditing WAL enforcement and adding immediate write transactions to prevent stale reads under load, with executor semaphore limit tests in `@fusion/engine` validating the concurrency bounds; added a new `store-concurrent-writes.test.ts` in

Fusion-Task-Id: FN-4083

Fusion-Task-Lineage: adabe51a-a9c4-481a-850d-985c373df51a
This commit is contained in:
Fusion
2026-05-12 03:23:06 -07:00
committed by gsxdsm
parent b1a0464d68
commit 06feb61686
14 changed files with 384 additions and 30 deletions

View File

@@ -1740,7 +1740,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
task: Task,
auditInput?: RunAuditEventInput,
): Promise<void> {
this.db.transaction(() => {
this.db.transactionImmediate(() => {
// Upsert the task
this.upsertTaskWithFtsRecovery(task);
@@ -4137,7 +4137,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
metadata: input.metadata,
};
this.db.transaction(() => {
this.db.transactionImmediate(() => {
this.db.prepare(`
INSERT INTO runAuditEvents (
id, timestamp, taskId, agentId, runId, domain, mutationType, target, metadata