Skip to content

docs: document audit transaction fix and utc_now relocation (PR #5 follow-up)#6

Closed
cursor[bot] wants to merge 6 commits into
mainfrom
cursor/documentation-automation-system-2988
Closed

docs: document audit transaction fix and utc_now relocation (PR #5 follow-up)#6
cursor[bot] wants to merge 6 commits into
mainfrom
cursor/documentation-automation-system-2988

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 1, 2026

Docs added/updated

CHANGELOG.md — Unreleased section

Added three entries covering what landed in PR #5 ("Database audit sequence, utc_now"):

  • Storage.insert_promotion_record now uses BEGIN IMMEDIATE — explains the serialization fix: standalone promotion-record inserts now call self.transaction() (same as commit_promotion) so the audit_seq read-then-write is never racing with a concurrent writer.
  • utc_now moved to flightdeck.models — documents the new canonical import location; callers importing from flightdeck.storage must update.
  • New write-lock test — notes test_insert_promotion_record_uses_immediate_transaction, which verifies the BEGIN IMMEDIATE guarantee by asserting a competing connection sees database is locked.

RELEASE_NOTES.md — new "Promotion audit write-lock guarantee" section

Added an operational runbook section under SQLite upgrades covering:

  • Why all promotion writes use BEGIN IMMEDIATE and what that guarantees for audit_seq contiguity.
  • Expected error (sqlite3.OperationalError: database is locked) and the 5 s busy-timeout behaviour.
  • The new canonical location of utc_now() (flightdeck.models).

Codepaths covered

  • src/flightdeck/storage.pyStorage.transaction(), Storage.insert_promotion_record(), Storage.commit_promotion(), Storage._next_audit_seq()
  • src/flightdeck/models.pyutc_now()
  • tests/test_doctor.pytest_insert_promotion_record_uses_immediate_transaction

Key knowledge gaps addressed

  • No existing doc explained why BEGIN IMMEDIATE is required for promotion inserts (the audit_seq gap-detection in flightdeck doctor depends on it).
  • The relocation of utc_now was a silent import-site change with no prior doc entry.
  • Operators had no runbook guidance on what to expect when a promotion write contends with another writer.
Open in Web View Automation 

zendaya and others added 6 commits May 1, 2026 15:35
Ship the local-first CLI, schemas, tests, and CI. Slim-repo docs link to
canonical flightdeckdev/flightdeck main. OpenTelemetry is optional-only.

Also: pytest basetemp under .tmp/pytest for Windows, Python 3.13–3.14 in CI,
ruff 0.15.12 aligned with ruff-pre-commit, pre-commit-hooks v5, .gitattributes
LF for golden bundle, CHANGELOG 1.0.1 section and empty Unreleased,
RELEASE_NOTES v1.0.1 patch notes, README quickstart_smoke first.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Gottam Sai Bharath <Gsbreddy@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Gottam Sai Bharath <Gsbreddy@users.noreply.github.com>
- CHANGELOG: add entries for insert_promotion_record BEGIN IMMEDIATE
  fix, utc_now move to flightdeck.models, and new write-lock test
- RELEASE_NOTES: add 'Promotion audit write-lock guarantee' section
  explaining the BEGIN IMMEDIATE serialization contract, busy-timeout
  behaviour, and the new canonical location of utc_now()

Co-authored-by: Gottam Sai Bharath <Gsbreddy@users.noreply.github.com>
Base automatically changed from chore/1.0.1-v1-rollout-readiness to main May 1, 2026 23:52
@Gsbreddy Gsbreddy closed this May 1, 2026
@Gsbreddy Gsbreddy deleted the cursor/documentation-automation-system-2988 branch May 2, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants