Repository navigation
feat(audit): record an audit-log entry when an appointment is cancelled (AURORA-2) - #19
Merged
Merged
Conversation
ADR 0016 records the audit-log write on appointment cancel: a small audit service over an AuditWriter Protocol, a typed AuditAction enum, and the write in the same transaction as the cancel. CONTEXT.md starts the domain glossary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cancel Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| entity_id: str, | ||
| before: dict[str, Any] | None, | ||
| after: dict[str, Any] | None, | ||
| ) -> None: ... |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
evg-g
marked this pull request as ready for review
October 3, 2026 17:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADLC proof report — AURORA-2 —
appointments-apiBuilt by
adlc-report.shfrom the proof log, not from agent summaries.Final tree:
eca58022bc72c4392946bdd5813637f902107744. Proven: 3. Flagged: 0.[data]test_ac1_data_failed_cancel_commit_leaves_no_audit_row37fa086ae6cc→ green ateca58022bc72; red because: get_audit_log_repository builds the AuditLogRepository on its own session from app.state.sessionmaker and commits it independently at dependency exit, so the audit row survives when the request's cancel COMMIT fails[api]test_ac2_api_admin_reads_cancel_entry_and_filters_by_entityacd220504a5b→ green ateca58022bc72; red because: deliberate break: AuditLogRepository.list_entries ignores the entity_id filter, so ?entity_id=X also returns Y[data]test_ac3_data_refused_cancel_records_no_audit_row7f791195435c→ green ateca58022bc72; red because: deliberate break: cancel handler records and commits an audit row right after the 404 check, before the 403/428/412/409 refusalsProof log:
/home/evgenig/.adlc/home__evgenig__aurora__appointments-api/proof-log.jsonlNote — older behaviour, outside this ticket
Found while proving AC1.data, not introduced by this PR:
get_session(src/appointments_api/db.py:40-49) commits in the yield-dependency exit, which FastAPI 0.141.1 runs after the response is sent. A request whose COMMIT fails still returns its success response (e.g. 200 with aCANCELLEDbody), while the database keeps the old state. This affects every write endpoint. The audit row stays consistent with the appointment either way (test_ac1_data_failed_cancel_commit_leaves_no_audit_row). Left for a separate ticket.🤖 Generated with Claude Code