Skip to content

docs(adr): initialize Architecture Decision Records#535

Merged
nanotaboada merged 2 commits intomasterfrom
docs/architecture-decision-records
Mar 22, 2026
Merged

docs(adr): initialize Architecture Decision Records#535
nanotaboada merged 2 commits intomasterfrom
docs/architecture-decision-records

Conversation

@nanotaboada
Copy link
Owner

@nanotaboada nanotaboada commented Mar 22, 2026

Summary

  • Add docs/adr/ with 7 ADRs covering key architectural decisions
  • Add docs/adr/README.md — index table
  • Add docs/adr/template.md — Nygard template for future ADRs
  • Update README.md — Architecture Decisions section + TOC entry
  • Update CONTRIBUTING.md — ADR section with three-part test and
    append-only rule; renumber existing sections
  • Update CHANGELOG.md[Unreleased] entry

ADRs included

# Title Status
0001 SQLite as Database Engine Accepted
0002 No Alembic — Manual Seed Scripts Accepted (pending #2)
0003 UUID Surrogate Primary Key with v4/v5 Split Accepted
0004 Squad Number as the Mutation Key Accepted
0005 Full Replace PUT, No PATCH Accepted (pending #461)
0006 In-Memory Caching with aiocache Accepted
0007 Integration-Only Test Strategy Accepted (pending #490)

Closes #482

🤖 Generated with Claude Code


This change is Reviewable

Summary by CodeRabbit

  • Documentation
    • Added seven Architecture Decision Records summarizing decisions on database, migrations, identifier strategy, mutation semantics, caching, and testing approach.
    • Added ADR index and authoring template; updated contribution guide and README to surface the Architecture Decisions section.

Add docs/adr/ with 7 ADRs covering key decisions: SQLite as database
engine, no Alembic with manual seed scripts, UUID surrogate primary
key with v4/v5 split, squad number as mutation key, full replace PUT
with no PATCH, in-memory caching with aiocache, and integration-only
test strategy.

Includes index (README.md), Nygard template, and updates to README,
CONTRIBUTING, and CHANGELOG. ADRs for Alembic (#2), PATCH (#461), and
unit tests (#490) reference their respective open issues.

Closes #482

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2e884eba-5b46-4912-b11c-f10df64724f5

📥 Commits

Reviewing files that changed from the base of the PR and between 180587c and f775727.

📒 Files selected for processing (4)
  • docs/adr/0003-uuid-surrogate-primary-key.md
  • docs/adr/0005-full-replace-put-no-patch.md
  • docs/adr/0007-integration-only-test-strategy.md
  • docs/adr/template.md
✅ Files skipped from review due to trivial changes (3)
  • docs/adr/template.md
  • docs/adr/0005-full-replace-put-no-patch.md
  • docs/adr/0003-uuid-surrogate-primary-key.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/adr/0007-integration-only-test-strategy.md

Walkthrough

Adds Architecture Decision Records (ADRs) and ADR authoring guidance: introduces docs/adr/ with README and template, adds seven ADR markdown files (0001–0007), updates top-level docs (README, CONTRIBUTING, CHANGELOG) to reference ADRs, and documents decisions on DB, migrations, keys, API semantics, caching, and testing.

Changes

Cohort / File(s) Summary
Top-level documentation
README.md, CHANGELOG.md, CONTRIBUTING.md
Added "Architecture Decisions" references: README section, CHANGELOG Unreleased entry, and a new CONTRIBUTING section describing ADR process and renumbering of subsequent sections.
ADR index & template
docs/adr/README.md, docs/adr/template.md
Added ADR directory entry point (index of ADRs) and an ADR authoring template following Michael Nygard structure.
ADR set (0001–0003)
docs/adr/0001-sqlite-as-database-engine.md, docs/adr/0002-no-alembic-manual-seed-scripts.md, docs/adr/0003-uuid-surrogate-primary-key.md
Added ADRs covering SQLite + SQLAlchemy async, opting out of Alembic for manual seed scripts, and UUID surrogate primary key strategy (v4 for API, v5 for seeded).
ADR set (0004–0007)
docs/adr/0004-squad-number-as-mutation-key.md, docs/adr/0005-full-replace-put-no-patch.md, docs/adr/0006-in-memory-caching-with-aiocache.md, docs/adr/0007-integration-only-test-strategy.md
Added ADRs for using squad_number as mutation identifier, full-replace PUT semantics (no PATCH), aiocache in-memory caching policy (10m TTL, invalidation on writes, X-Cache header), and integration-only testing strategy using a pre-seeded SQLite DB.

Sequence Diagram(s)

(omitted — changes are documentation-only and do not introduce new control-flow code)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Create docs/adr/ directory with README.md and template.md [#482]
Write initial ADRs (0001–0008) using Michael Nygard template [#482] Only ADRs 0001–0007 are present; ADR-0008 is missing.
Ensure ADRs include Status, Context, Decision, Consequences and alternatives [#482]
Update README.md, CONTRIBUTING.md, and CHANGELOG.md to reference ADRs [#482]
Update AGENTS.md "Additional Resources" to reference docs/adr/ [#482] No changes to AGENTS.md detected in this PR.

Out-of-scope changes

Code Change Explanation
Missing ADR-0008 (docs/adr/0008-*.md) Linked issue requested ADRs 0001–0008; PR only adds 0001–0007, so ADR-0008 is absent and therefore not implemented here.
No update to AGENTS.md (AGENTS.md) Linked issue requires adding ADR reference to AGENTS.md Additional Resources; PR does not modify AGENTS.md, so that objective remains unaddressed.

Possibly related issues

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits format with the 'docs:' prefix, is descriptive and specific about ADR initialization, and is 51 characters—well under the 80-character limit.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/architecture-decision-records
  • 🛠️ sync documentation: Commit on current branch
  • 🛠️ sync documentation: Create PR
  • 🛠️ enforce http error handling: Commit on current branch
  • 🛠️ enforce http error handling: Create PR
  • 🛠️ idiomatic review: Commit on current branch
  • 🛠️ idiomatic review: Create PR
  • 🛠️ verify api contract: Commit on current branch
  • 🛠️ verify api contract: Create PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can validate your CodeRabbit configuration file in your editor.

If your editor has YAML language server, you can enable auto-completion and validation by adding # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

@codecov
Copy link

codecov bot commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5610bf1) to head (f775727).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #535   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          113       113           
=========================================
  Hits           113       113           
Components Coverage Δ
Services 100.00% <ø> (ø)
Routes 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
docs/adr/0007-integration-only-test-strategy.md (1)

31-34: Decouple this ADR from concrete test file paths.

Line 31–Line 34 capture implementation layout, not architecture. Consider wording this as “current structure” (or moving to test docs) so simple test-file reorgs don’t require ADR edits.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/adr/0007-integration-only-test-strategy.md` around lines 31 - 34, Update
the ADR sentence that currently reads "All tests live in `tests/test_main.py`,
use stubs from `tests/player_stub.py` for consistent test data, and rely on a
`function`-scoped `client` fixture from `conftest.py` for per-test isolation" so
it no longer hardcodes concrete test file paths: rephrase to state this as the
"current structure" (e.g., "Currently, tests are organized in a single test
module, use shared stubs for consistent test data, and rely on a function-scoped
client fixture for per-test isolation") or move those implementation details
into separate test documentation; keep the ADR focused on the architectural
testing strategy rather than specific file locations.
docs/adr/0006-in-memory-caching-with-aiocache.md (1)

37-37: Use delete() instead of clear() for per-key cache invalidation.

Cache invalidation on POST, PUT, and DELETE works correctly in your implementation. However, clear(CACHE_KEY) is semantically incorrect for removing a single key in aiocache 0.12.3. The clear() method treats its argument as a namespace prefix and deletes all keys matching that prefix; the correct method for single-key removal is delete(CACHE_KEY). While your code functionally works (the prefix "players" matches the key "players"), using delete() is more idiomatic and prevents brittleness if you add multiple cache keys in the future. Apply this change at lines 78, 223, and 263.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/adr/0006-in-memory-caching-with-aiocache.md` at line 37, Replace uses of
clear(CACHE_KEY) with delete(CACHE_KEY) for per-key cache invalidation: locate
the handlers that invalidate cache on POST, PUT, and DELETE (the code that calls
clear(...) with the CACHE_KEY or "players" namespace) and change those calls to
use delete(CACHE_KEY) instead so only the single key is removed; ensure you
update all occurrences (the three places noted where clear(CACHE_KEY) is used)
and keep the same CACHE_KEY symbol and async/await usage around the aiocache
client or decorator.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/adr/0003-uuid-surrogate-primary-key.md`:
- Around line 35-38: Update the ADR text to accurately reflect the
implementation: replace the incorrect references to a non-existent
HyphenatedUUID custom SQLAlchemy type with the actual storage (UUIDs stored as
hyphenated strings/text using the standard UUID/string column), state that
API-created records use UUID v4 (random) and that migration-seeded records use
hardcoded UUID values (not generated as UUID v5 from squad_number), and make the
same corrections where the ADR mentions v5 derivation (including the lines
corresponding to the earlier v5 claim).

In `@docs/adr/0005-full-replace-put-no-patch.md`:
- Around line 26-27: The ADR incorrectly states that "all domain fields are
required"; update the text to match the actual PlayerRequestModel contract by
noting that only first_name, last_name, squad_number and position are required
while middle_name, date_of_birth, abbr_position, team and league are optional;
locate references to PlayerRequestModel in the ADR and replace the incorrect
blanket "all domain fields are required" phrasing with a precise enumeration of
required vs optional fields to reflect the model definition.

In `@docs/adr/README.md`:
- Around line 15-21: The ADR index currently lists ADRs 0001–0007 but the
project objective expects 0001–0008; add a new table row for ADR-0008 in the ADR
index (README.md) with a descriptive title and Accepted/Proposed status and date
matching the other entries, and ensure the actual ADR file for 0008 (0008-...md)
is added to the docs/adr folder; alternatively, if you intentionally reduced
scope, add a brief note in the PR or the README explaining that ADR-0008 was
omitted and link to the decision discussion.

In `@docs/adr/template.md`:
- Around line 9-31: Update the ADR template by adding explicit "## Alternatives
Considered" and "## Trade-offs" sections (in addition to the existing "##
Context", "## Decision", and "## Consequences" headers) so each ADR records
evaluated alternatives and explicit trade-offs rather than relying on commented
guidance; ensure these new headers are real markdown sections (not HTML
comments) and include brief placeholder guidance under "## Alternatives
Considered" to list evaluated options and under "## Trade-offs" to record
pros/cons and known limitations.

---

Nitpick comments:
In `@docs/adr/0006-in-memory-caching-with-aiocache.md`:
- Line 37: Replace uses of clear(CACHE_KEY) with delete(CACHE_KEY) for per-key
cache invalidation: locate the handlers that invalidate cache on POST, PUT, and
DELETE (the code that calls clear(...) with the CACHE_KEY or "players"
namespace) and change those calls to use delete(CACHE_KEY) instead so only the
single key is removed; ensure you update all occurrences (the three places noted
where clear(CACHE_KEY) is used) and keep the same CACHE_KEY symbol and
async/await usage around the aiocache client or decorator.

In `@docs/adr/0007-integration-only-test-strategy.md`:
- Around line 31-34: Update the ADR sentence that currently reads "All tests
live in `tests/test_main.py`, use stubs from `tests/player_stub.py` for
consistent test data, and rely on a `function`-scoped `client` fixture from
`conftest.py` for per-test isolation" so it no longer hardcodes concrete test
file paths: rephrase to state this as the "current structure" (e.g., "Currently,
tests are organized in a single test module, use shared stubs for consistent
test data, and rely on a function-scoped client fixture for per-test isolation")
or move those implementation details into separate test documentation; keep the
ADR focused on the architectural testing strategy rather than specific file
locations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4a6bd66a-d424-4ce8-9b1f-9d789688dd64

📥 Commits

Reviewing files that changed from the base of the PR and between 5610bf1 and 180587c.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md
  • docs/adr/0001-sqlite-as-database-engine.md
  • docs/adr/0002-no-alembic-manual-seed-scripts.md
  • docs/adr/0003-uuid-surrogate-primary-key.md
  • docs/adr/0004-squad-number-as-mutation-key.md
  • docs/adr/0005-full-replace-put-no-patch.md
  • docs/adr/0006-in-memory-caching-with-aiocache.md
  • docs/adr/0007-integration-only-test-strategy.md
  • docs/adr/README.md
  • docs/adr/template.md

- ADR-0003: clarify UUID v5 values are pre-computed constants in seed
  scripts, not derived at runtime from squad number
- ADR-0005: replace "all domain fields are required" with accurate
  breakdown — 4 required fields, 6 optional
- ADR-0007: rephrase hardcoded file paths to generic structure
  description
- template.md: add explicit Alternatives Considered section

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link

@nanotaboada nanotaboada merged commit 0810c52 into master Mar 22, 2026
13 checks passed
@nanotaboada nanotaboada deleted the docs/architecture-decision-records branch March 22, 2026 16:20
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.

[FEATURE] Implement Architecture Decision Records (ADRs)

1 participant