Skip to content

feat(durable): add union reconciliation by session identity - #121

Merged
jonasotoaguilar merged 5 commits into
feat/durable-mergefrom
feat/durable-reconcile
Sep 2, 2026
Merged

jonasotoaguilar merged 5 commits into
feat/durable-mergefrom
feat/durable-reconcile

Conversation

@jonasotoaguilar

@jonasotoaguilar jonasotoaguilar commented Aug 31, 2026 •

Copy link
Copy Markdown
Owner

🔗 Linked Issue

Related to #117


🏷️ PR Type

What kind of change does this PR introduce?

  • type:bug — Bug fix
  • type:feature — New feature
  • type:docs — Documentation only
  • type:refactor — Code refactoring
  • type:chore — Build, CI, or tooling
  • type:breaking-change — Breaking change

📝 Summary

feat(durable): add union reconciliation by session identity — part of durable per-session checkpoints chain (feat/durable-project-checkpoints) for #117. Union reconciliation by session identity (live session.list + durable checkpoints).


📂 Changes

File / Area What Changed
src/tokenmeter/durable/reconcile.ts Union reconciliation by session ID
test/durable-reconcile.test.ts Reconciliation tests

Chain Context

Field Value
Chain feat/durable-project-checkpoints
Tracker PR #118
Position 3 of 20
Base feat/durable-merge
Depends on #120 (feat/durable-merge)
Follow-up #122 (feat/durable-checkpoints)
Review budget 362 / 400
Starts at feat/durable-merge (#120)
Ends with Union reconciliation by session identity (live session.list + durable checkpoints)

Chain Overview

main
 └── feat/durable-project-checkpoints (tracker, PR #118)
     └── feat/durable-platform-paths (#119)
          └── feat/durable-merge (#120)
               └── 📍 feat/durable-reconcile (#121)
                    └── feat/durable-checkpoints (#122)
                         └── feat/durable-migrate (#123)
                              └── feat/durable-deleted (#124)
                                   └── feat/durable-project-cutover (#125)
                                        └── feat/durable-project-db (#126)
                                             └── feat/durable-project-legacy-adapter (#138)
                                                  └── feat/durable-browser-detail (#127)
                                                       └── feat/durable-browser-tests (#128)
                                                            └── feat/durable-cost-fallback-1 (#129)
                                                                 └── feat/durable-cost-fallback-2 (#130)
                                                                      └── feat/durable-cost-fallback-3 (#131)
                                                                           └── feat/durable-harness-1 (#132)
                                                                                └── feat/durable-harness-migration (#136)
                                                                                     └── feat/durable-harness-2 (#133)
                                                                                          └── feat/durable-finalize-legacy-removal (#140)
                                                                                               └── feat/durable-docs (#134)
                                                                                                    └── fix/durable-project-observed-cost (#142)

Scope

  • Includes: feat(durable): add union reconciliation by session identity
  • Excludes: Next layer: feat(durable): add WAL checkpoint store with monotonic batch upsert

Autonomy

  • CI is expected to pass for this PR branch
  • This PR has one deliverable scope
  • This PR can be rolled back without unrelated changes
  • Tests, docs, or manual verification cover this unit

🧪 Test Plan

bun run typecheck
bun test
  • Type check passes (bun run typecheck — no errors; per-layer focused)
  • Tests pass — per-layer focused durable tests green; stack-top integrated bun test 389/389, bun run typecheck, bun run build verified on fix/durable-project-observed-cost (fix(project): use observed message-derived cost for Project checkpoints #142, top of 20-PR stack)
  • Build passes (bun run build — verified on top; per-layer build green where applicable)
  • Manual canary pending (runtime live verification on final top — stack remains draft)

🤖 Automated Checks

The following checks run automatically on this PR:

Check Status Description
Check PR Cognitive Load ⏳ PR should stay within 400 changed lines (additions + deletions) or use maintainer-applied size:exception
Check Issue Reference ⏳ Tracker/default PR: Closes/Fixes/Resolves #N; child PR: Related to #N
Check Issue Has status:approved ⏳ Linked issue must have been approved before work began
Check PR Has type:* Label ⏳ Exactly one type:* label must be applied

✅ Contributor Checklist

  • PR is linked to an issue with status:approved
  • PR stays within 400 changed lines, or I have requested/obtained maintainer-applied size:exception with rationale documented
  • Tracker/default PR uses Closes #N, child PR uses Related to #N
  • If chained, this PR targets tracker/parent branch, not main
  • I have added the appropriate type:* label to this PR
  • Lint and format checks pass (check-only, no mutation)
  • Tests pass (per-layer + stack-top integrated)
  • I have updated documentation if necessary
  • My commits follow Conventional Commits format
  • My commits do not include Co-Authored-By trailers

💬 Notes for Reviewers

Part of stacked delivery feat/durable-project-checkpoints (20 PRs). Review bottom→top against immediate parent (feat/durable-merge). This PR is draft until full chain review. Stack-top integrated verification: bun test 389/389, bun run typecheck, bun run build on fix/durable-project-observed-cost (#142). Manual live canary pending on final top.

@jonasotoaguilar
jonasotoaguilar merged commit bde454f into feat/durable-project-checkpoints Sep 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature PR type: feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant