Skip to content

docs: document promotion audit sequencing fix and Storage transaction model#7

Closed
cursor[bot] wants to merge 7 commits into
mainfrom
cursor/documentation-automation-system-1e8a
Closed

docs: document promotion audit sequencing fix and Storage transaction model#7
cursor[bot] wants to merge 7 commits into
mainfrom
cursor/documentation-automation-system-1e8a

Conversation

@cursor

@cursor cursor Bot commented May 1, 2026

Copy link
Copy Markdown

Docs added/updated

CHANGELOG.md

Added a Fixed entry under Unreleased for PR #5 (promotion audit sequencing):

  • Storage.insert_promotion_record previously used connect() (autocommit) instead of transaction() (BEGIN IMMEDIATE), allowing concurrent writers to interleave and produce non-contiguous audit_seq values on the policy-fail path.
  • Also notes the utc_now consolidation (removed duplicate in storage.py, now sourced from models).

src/flightdeck/storage.py

Three targeted docstrings added; no behavior changes:

  1. Storage class docstring — explains the connect() vs transaction() split, the two promotion write paths (insert_promotion_record for policy-fail, commit_promotion for policy-pass), and the audit_seq monotonicity contract checked by flightdeck doctor.

  2. transaction() context manager docstring — explains BEGIN IMMEDIATE semantics, when to use it over a bare connect(), and why it matters for audit_seq correctness.

  3. insert_promotion_record() docstring — clarifies this is the policy-fail path (audit record only, no pointer update) vs commit_promotion (atomic audit + pointer update on policy-pass).

Codepaths covered

  • Storage.insert_promotion_record / Storage.commit_promotion / Storage.transaction (src/flightdeck/storage.py)
  • Promotion and rollback CLI paths (src/flightdeck/cli/main.py — context only)
  • flightdeck doctor audit-seq check (referenced in class docstring)

Key knowledge gaps addressed

  • Why blocked promotions still appear in the audit trail (and the transaction fix that makes this safe)
  • The distinction between connect() (read queries, autocommit) and transaction() (all writes)
  • The audit_seq monotonicity invariant and how it is maintained under concurrent access
  • PR Database audit sequence, utc_now #5 was previously undocumented in CHANGELOG despite being a correctness fix to the audit ledger
Open in Web View Automation 

zendaya and others added 7 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>
…cstrings (#4)

- CHANGELOG.md: add Fixed entry under Unreleased for PR #3 (zero policy
  sample thresholds were silently ignored due to falsy 'or' fallback;
  now uses 'is not None' checks)
- ledger.py: add docstrings to confidence_label, evaluate_policy, and
  diff_releases explaining threshold semantics (None vs 0 vs config default),
  confidence label tiers, constraint fields, and agent-id invariant
- models.py: add Policy class docstring explaining the None/0 distinction
  for min_* threshold fields versus constraint (max_*) fields
- schemas/v1/policy.schema.json: regenerated to pick up Policy docstring

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Gottam Sai Bharath <Gsbreddy@users.noreply.github.com>
… model

- CHANGELOG.md: add Fixed entry under Unreleased for PR #5 (insert_promotion_record
  was using connect()/autocommit instead of transaction()/BEGIN IMMEDIATE;
  concurrent writers could interleave and produce non-contiguous audit_seq;
  also notes utc_now consolidation into models)
- storage.py: add Storage class docstring explaining connect() vs transaction()
  semantics, the two promotion write paths (insert_promotion_record for policy-fail,
  commit_promotion for policy-pass), and the audit_seq monotonicity contract
- storage.py: add transaction() docstring explaining BEGIN IMMEDIATE semantics
  and when to use it over bare connect()
- storage.py: add insert_promotion_record() docstring distinguishing policy-fail
  audit-only path from the commit_promotion atomic pointer-update path

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-1e8a 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