test(web): add Vitest CI, ADRs, and PR Definition of Done

FE unit-тесты селекторов/api-client в CI; ADR по durable jobs, OpenAPI codegen и legacy Svelte; PR template WEB-19; процесс KPI cross-app sync.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-07-31 12:27:13 +07:00
co-authored by Cursor
parent 8fe74c1d3b
commit 26f5172f88
8 changed files with 161 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
# ADR-001: Durable job queue via PostgreSQL job_audit
## Status
Accepted (2026-07)
## Context
`jobs.Registry` is in-process. ARCH-04 notes workers do not share memory across API replicas. Jobs were already audited to `job_audit`, but orphans after restart were not reclaimed.
## Decision
Keep in-process execution for latency; add durable reclaim:
1. Persist lifecycle via existing `SetPersistHooks``job_audit`.
2. Periodically `ReclaimStaleRunning` + `ClaimQueued` with `FOR UPDATE SKIP LOCKED`.
3. `Registry.Adopt` injects claimed rows into the local worker pool.
4. Claim grace (`EVOBGP_JOB_CLAIM_GRACE`, default 30s) avoids double-run of fresh local enqueues.
NATS JetStream remains optional (`EVOBGP_BROKER_URL` logged only).
## Consequences
Two `evobgp-api` processes can reclaim orphaned work. Fresh jobs still run on the enqueueing process. Full broker-based fan-out is out of scope for this ADR.