Record locks and revisions integration
Verification Boundary
Lock transitions, append-only record revisions, history reads and no-op saves cross the real PostgreSQL transaction and history-capture boundary.
What This Suite Proves
The tests establish retained lock changes, optimistic-version refusals, element unlock auditing, history ordering, cursor behavior and actor-name resolution. Revision table tests constrain the retained stream. No-op save tests compare stored versions and timestamps and distinguish unchanged saves from real writes. Job revision reads identify changes after a job for later rollback analysis.
What It Does Not Prove
The history drawer and deployed user authorization are outside this group. Job revision reads provide evidence for the retained stream, not proof of an entire data-job rollback. Deleting a current record does not imply that its personal revision values are removed; retention remains an existing control gap.
Level and Rationale
Capture must agree with committed record changes, including multi-record transactions. Real trigger and transaction behavior is necessary to prove that a refused write records nothing and an unchanged save does not create history. An isolated mapper cannot establish stable pagination under a later write.
Real Dependencies and Test Doubles
The database, record write services, lock services and revision queries are real. User-name fixtures supply current, deleted and invisible-actor premises. Repository bootstrap prepares the application role and history attribution, so owner fixtures do not silently bypass the required actor context.
Must Not Be Doubled
Keep history capture, lock checks, version comparisons and the revision store real. Cursor tests need actual newly inserted revisions behind a page. Actor reads must preserve visibility restrictions; a prefilled display name would bypass the attribution boundary the test intends to exercise.
Fixtures and Isolation
Tests own the subjects, actors and revisions they create. Cleanup removes subject fixtures and their scoped historical data using the source-declared mechanism. No-op cases retain a baseline read so comparison uses stored versions and timestamps rather than the write response alone.
Determinism and Retries
History expectations use generated fixture references and explicit sequence ordering. Date-filter tests specify inclusive ranges; cursor tests assert no repetition or omission after changes. Run without automatic retries because a retry could make an unstable pagination or capture sequence appear correct.
How It Runs
Run the command in the frontmatter from the service repository after preparing the test database. It selects every file in this aggregate register under the repository Mocha bootstrap and runs serially. This is the aggregate selection of the integration gate; the complete repository integration command includes other modules and is wider than this register.
Coverage Gaps
Locks and revisions are supporting records, not independently archived entities. Their retained stream and release transitions do not prove record archive or delete through the console. Existing exact-reason, concurrent-lock and deleted-subject history findings remain open until their particular assertions exist.