Skip to content

📝 docs(adr): add ADR-125 for usage snapshot SK redesign#304

Draft
sodre wants to merge 2 commits into
mainfrom
docs/adr-121-usage-snapshot-sk-redesign
Draft

📝 docs(adr): add ADR-125 for usage snapshot SK redesign#304
sodre wants to merge 2 commits into
mainfrom
docs/adr-121-usage-snapshot-sk-redesign

Conversation

@sodre

@sodre sodre commented Feb 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Proposes redesigning usage snapshot sort key format from #USAGE#{resource}#{window_key} to #USAGE#{window_type}#{resource}#{window_key}
  • Introduces rollup snapshots with resource="_all_" for efficient billing dashboard queries
  • Enables window type filtering via SK prefix instead of FilterExpression

Motivation

Current design has two limitations:

  1. Window type filtering requires FilterExpression (reads all items, filters client-side)
  2. Cross-resource time-range queries require reading all snapshots and aggregating client-side

Trade-offs

  • Positive: Efficient billing queries, no LSI required, works with existing tables after backfill
  • Negative: 2x write amplification in aggregator, ~1.5-2x storage

Test plan

  • Review ADR for clarity and completeness
  • Validate alternatives considered section captures the brainstorming discussion

🤖 Generated with Claude Code

Proposes redesigning usage snapshot sort key to include window type
before resource, and introducing rollup snapshots with resource="_all_"
for efficient billing dashboard queries.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Feb 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.14%. Comparing base (614a777) to head (a29cce7).
⚠️ Report is 382 commits behind head on main.
✅ All tests successful. No failed tests found.

❗ There is a different number of reports uploaded between BASE (614a777) and HEAD (a29cce7). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (614a777) HEAD (a29cce7)
doctest 2 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #304      +/-   ##
==========================================
- Coverage   37.35%   29.14%   -8.21%     
==========================================
  Files          24       37      +13     
  Lines        4645     7854    +3209     
==========================================
+ Hits         1735     2289     +554     
- Misses       2910     5565    +2655     
Flag Coverage Δ
doctest 29.14% <ø> (-8.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

ADR-121 is already taken on main by the native-sync-unasync decision.
Renumber this proposed ADR to 125 (next free number after the
policy-rename ADR was moved to 124) to avoid the collision.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sodre sodre changed the title 📝 docs(adr): add ADR-121 for usage snapshot SK redesign 📝 docs(adr): add ADR-125 for usage snapshot SK redesign Jun 12, 2026
sodre added a commit that referenced this pull request Jun 12, 2026
…refs (#422)

## Summary

This PR collects four commits of ADR consistency cleanup on `main`:

1. **Resolve the duplicate ADR-121** — two Accepted ADRs both claimed
number 121. Native-sync keeps 121 (earlier file, referenced externally
by CLAUDE.md); the IAM policy-rename ADR is renumbered `121 → 124` (next
free number after `123-local-secondary-indexes`). Structural collision
fix only — no decision content changed, consistent with the ADR
immutability rule.
2. **Normalize ADR-121 (native-sync) status header** — it used a `##
Status` heading with the value on a separate line; normalized to the
`**Status:**` / `**Date:**` inline format mandated by ADR-000 (Date
`2026-02-02`, from the file's creation commit).
3. **Add ADRs 114-124 to the mkdocs navigation** — the nav previously
stopped at ADR-113, leaving 114-124 unreachable from the docs site.
Added thematic groups covering 114-124 and reflecting the corrected
numbering.
4. **Resolve cross-ADR consistency issues** surfaced by `/adr
consistency`:
- **ADR-107**: annotate its partial supersession by ADR-117. Two
Accepted ADRs asserted opposite IAM defaults (roles-by-default vs
policies-by-default); flag it in the status line and add a Decision note
pointing to ADR-117 (current default) and ADR-124 (policy rename) so the
reversed default is unambiguous.
- **ADR-100**: this Proposed index still presented superseded
sub-decisions (102→118, 103→122) as authoritative and used the
pre-composite `#LIMIT#` schema. Mark the superseded rows and show the
current composite `#CONFIG` keys.
- **ADR-013**: accept it. It was Proposed yet already superseded ADR-012
— an invalid state. Its decision is complete and already operationalized
as `.claude/rules/docs-parity.md`, so finalize the status.

This is the **main-branch half of a coordinated cleanup**. The other
halves renumber ADRs on open PRs so the whole sequence is
collision-free:

- **#304**: `121 → 125`
- **#393**: `123-129 → 126-132` (plus the same inherited `121 → 124`
fix)

Together these yield a collision-free ADR sequence **121-132**.

## Test plan

- [ ] `ls docs/adr/12*.md` shows no duplicate ADR numbers
- [ ] `grep -rn "121-policy-rename" docs/` returns no stale references
- [ ] ADR-124 header reads `# ADR-124: Rename IAM Policies for Clarity`
- [ ] ADR-121 header uses the `**Status:**` / `**Date:**` inline format
- [ ] `mkdocs build` reaches ADRs 114-124 from the nav
- [ ] ADR-107 status line notes the partial supersession by ADR-117
- [ ] ADR-100 marks the 102→118 / 103→122 superseded rows and shows
`#CONFIG` keys
- [ ] ADR-013 status reads Accepted

🤖 Generated with [Claude Code](https://claude.ai/code)
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