Skip to content

feat(books): plan REI Hub reconciliation without duplicate ledger rows - #207

Merged
chitcommit merged 9 commits into
mainfrom
feat/rei-hub-reconciliation-plan-20261013
Oct 13, 2026
Merged

chitcommit merged 9 commits into
mainfrom
feat/rei-hub-reconciliation-plan-20261013

Conversation

@chitcommit

@chitcommit chitcommit commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Refs #158.

Adds the Finance half of the REI Hub synthetic-user sync.

What it does:

  • New pure rei-hub-reconciliation planner parses a ChittyScrape REI Hub snapshot.
  • Matches REI Hub rows to existing ChittyFinance transactions by exact date/amount and bounded description/vendor similarity.
  • Resolves REI Hub property evidence against existing Finance properties.
  • Uses the current canonical findAccountCode projection rather than the obsolete hardcoded mappings from merged PR feat: REI Hub general ledger import endpoint #107.
  • Flags 1970-01-01 and inactive-payee source-quality defects.
  • Returns machine-executable repair proposals pointing to existing guarded endpoints:
    • property assignment → existing transaction PATCH
    • classification proposal → L1 /api/classification/suggest
    • authoritative classification → existing L2 route
    • reconciliation → existing L2 route
    • COA mutation → existing L4 owner/admin route
  • Reconciled conflicts are review-only.
  • No REI Hub rows are inserted as new Finance transactions.
  • Exposes the comparison plan through MCP for agent use.
  • Adds governed MCP repair tools for property assignment, authoritative classification, reconciliation, and tenant COA create/update.
  • MCP writes reuse existing tenant-role authority: L2 = owner/admin/manager; L4 COA mutation = owner/admin.

Endpoint:
POST /api/import/rei-hub/compare — dry-run only.

Why not revive PR #107:
That importer created a second REI Hub transaction population and used COA mappings that are now obsolete. REI Hub is comparison/evidence here; ChittyFinance remains the SOT.

No schema/database/queue/store changes. No production financial writes.

Summary by CodeRabbit

  • New Features
    • Added dry-run comparison of REI Hub transaction snapshots with finance records, including match results, quality flags, and suggested follow-up actions.
    • Added tools to assign properties, classify and reconcile transactions, and create or update chart-of-accounts accounts.
    • Reconciled transactions with conflicting details are flagged for review rather than proposed for updates.
  • Bug Fixes
    • Improved handling of invalid dates, amounts, descriptions, and inactive vendors during snapshot comparison.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 571f868f-2a23-4d66-ab07-f4623dc76631
📥 Commits

Reviewing files that changed from the base of the PR and between 116c6fc and cd9d708.

📒 Files selected for processing (6)
  • server/__tests__/mcp.test.ts
  • server/__tests__/rei-hub-reconciliation.test.ts
  • server/app.ts
  • server/books/rei-hub-reconciliation.ts
  • server/routes/mcp.ts
  • server/routes/rei-hub.ts
 _______________________________________
< Nullus Bugus Maximus. No bug too big. >
 ---------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chitcommit
chitcommit marked this pull request as ready for review October 13, 2026 12:42
@chitcommit
chitcommit enabled auto-merge (squash) October 13, 2026 12:42
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chitcommit
chitcommit merged commit 987b06c into main Oct 13, 2026
10 of 12 checks passed
@chitcommit
chitcommit deleted the feat/rei-hub-reconciliation-plan-20261013 branch October 13, 2026 12:51
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