Skip to content

Fix backdated balance propagation across opening checkpoints - #21

Merged
AFR0011 merged 4 commits into
mainfrom
fix/backdated-opening-balance-propagation
Sep 15, 2026
Merged

AFR0011 merged 4 commits into
mainfrom
fix/backdated-opening-balance-propagation

Conversation

@AFR0011

@AFR0011 AFR0011 commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the case where a newly recorded backdated transfer/exchange is saved in history but does not change current balances because its business date predates an opening checkpoint.

Ledger semantics

  • opening checkpoints are treated as baseline snapshots of records that existed when the opening was created.
  • Ledger activity created after an opening is replayed even when its business date is earlier than the opening date.
  • reconciliation checkpoints remain absolute observations and keep the existing historical/same-day ordering behavior.
  • No Dexie or Supabase schema migration is required.

Regression coverage

  • Unit coverage for backdated transactions after an opening checkpoint.
  • Unit coverage proving records already present at opening time remain baked into the opening snapshot.
  • Unit coverage proving backdated records do not cross an absolute reconciliation.
  • Unit coverage for backdated conversions across both source and destination opening checkpoints.
  • Service-level create/update/delete lifecycle coverage for a backdated exchange.
  • Browser regression: onboard balances, record yesterday's exchange, verify both balances move, delete the exchange, verify both balances return to opening values.

Scope / known limitation

This patch fixes newly created backdated activity. It intentionally does not attempt to reconstruct edits to legacy records that were already baked into an opening snapshot, because Ravel does not retain the pre-edit value required to calculate that historical delta safely.

Verification status

Static review completed against the branch diff. Automated tests have not been executed in this environment: no GitHub Actions run is currently available for the branch, and the local execution environment cannot resolve GitHub to clone/install the repository. Keep this PR in draft until the normal lint/typecheck/unit/build/E2E gates are run.

@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ravel Ready Ready Preview Sep 15, 2026 10:04pm UTC

@AFR0011
AFR0011 marked this pull request as ready for review September 15, 2026 22:06
@AFR0011
AFR0011 merged commit 26111f4 into main Sep 15, 2026
4 checks passed
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