Skip to content

fix(db): do not report success when the database did not save the change (AURORA-3) - #20

Merged
evg-g merged 7 commits into
mainfrom
story/AURORA-3
Oct 4, 2026
Merged

evg-g merged 7 commits into
mainfrom
story/AURORA-3

Conversation

@evg-g

@evg-g evg-g commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

ADLC proof report — AURORA-3 — appointments-api

Built by adlc-report.sh from the proof log, not from agent summaries.
Final tree: 725000806498c28fb552d7351fa46d156b8934fe. Proven: 4. Flagged: 0.

criterion surface assertion proof test verdict evidence
AC1.api [api] test_ac1_api_failed_commit_returns_problem_not_success proven red at 1fec86cbfa76 → green at 725000806498; red because: get_session commits after the response is sent (default request scope), so a cancel whose COMMIT fails still returns 200 with a CANCELLED body; there is no catch-all problem+json handler
AC2.api [api] test_ac2_api_failed_commit_frees_the_idempotency_key proven red at 2accfe521dfe → green at 725000806498; red because: complete() runs before COMMIT, so after a failed commit the retry with K replays a stored 201 for an appointment that was never saved (GET 404)
AC3.data [data] test_ac3_data_failed_commit_saves_nothing proven red at b126bfeef938 → green at 725000806498; red because: SessionDep made use_cache=False, so each repository gets its own session/transaction: the cancel's audit row commits in a separate transaction even though the cancel's COMMIT is refused (breaks the cancel example: expect 1 audit row instead of 0)
AC4.data [data] test_ac4_data_failed_commit_publishes_no_webhook_event proven red at 955016c0dbc5 → green at 725000806498; red because: _emit still publishes to the Redis event queue during the request, before the COMMIT, so a failed cancel leaves an appointment.cancelled event

Proof log: /home/evgenig/.adlc/home__evgenig__aurora__appointments-api/proof-log.jsonl

Review notes — advisory, not confirmed defects

  • code-review: a catch-all 500 response carries no X-Request-ID, because Starlette's ServerErrorMiddleware sits outside the request-id middleware.
  • code-review: if session.rollback() itself raises in get_session, the on_rollback hooks do not run, so a booking's idempotency pending marker stays until its TTL.
  • AC3.data held before this change (Postgres rolls the transaction back); its red came from a deliberate break (SessionDep with use_cache=False), which only the cancel/audit example can show. test-review rated it OK.
  • standards-review added the internal-error row to docs/ERROR_CATALOG.md and marked the timing parts of ADR 0007 and ADR 0010 as superseded by ADR 0017.

🤖 Generated with Claude Code

evg-g and others added 7 commits October 4, 2026 08:45
ADR 0017 records the fix for success responses on failed commits: commit
before the response (dependency scope "function"), a catch-all 500
problem+json handler, and request-scoped transaction hooks so webhooks and
booking idempotency act only after the commit. CONTEXT.md gains the terms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e booking commit fails

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uperseded by ADR 0017

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The random-looking hex secret tripped gitleaks generic-api-key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…leaks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@evg-g
evg-g merged commit 7863408 into main Oct 4, 2026
13 checks passed
evg-g added a commit that referenced this pull request Oct 6, 2026
The rebase merge of #20 rewrote 52380ec as 103c04e, so the reviewed fake
webhook test secret no longer matched its .gitleaksignore fingerprint and
the secret scan failed on main (the README's api ci badge read failing).
Both fingerprints are now listed.

The README's localhost addresses for a locally running API (health,
Swagger UI, ReDoc) were clickable links that fail for any reader; they
are now code text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant