
> claimmanager-enterprise-pilot@2.0.0 test:enterprise
> tsx --test --test-concurrency=1 tests/enterprise/*.test.ts

[llm-keys] key "primary" on cooldown for 360min — اتمام اعتبار (402)
(node:5003) ExperimentalWarning: SQLite is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4981) ExperimentalWarning: SQLite is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
✔ scrypt: correct password, wrong password, unique salts (272.204833ms)
✔ protected API requires a valid server-side session (146.133435ms)
✔ mutations reject cross-origin requests including login (1.298053ms)
✔ login establishes HttpOnly, Strict, Secure cookie without exposing password (67.279283ms)
✔ bad password fails; session cannot be forged (38.412605ms)
✔ creates project and project-scoped document, deduplicates content (14.748215ms)
✔ offline answer has verbatim source and correct line; no network (7.08826ms)
✔ selection cannot silently include a different project (0.794905ms)
✔ unknown question produces no invented evidence (1.426412ms)
✔ Persian and Arabic letter variants are normalized only for matching (0.278528ms)
✔ offline report is durable, draft, source-hashed, no cloud required (42.285201ms)
✔ 402 on cloud falls through to local extractive answer (54.757936ms)
✔ auto mode uses configured local LLM when cloud is absent (18.437271ms)
✔ reader role can query but cannot create/delete docs or review (121.908216ms)
✔ analyst cannot approve report; reviewer can review with audit event (150.21891ms)
✔ audit/users are not exposed to reader; admin cannot disable self (1.355211ms)
✔ invalid UUIDs and malicious input are rejected, never interpreted as file paths (2.528703ms)
✔ security headers present; no cache of protected data (0.486855ms)
✔ database survives a fresh process and backup integrity is verified (280.529451ms)
✔ logout revokes current session (1.437717ms)
ℹ tests 20
ℹ suites 0
ℹ pass 20
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1908.272799
