Skip to content

N17 — recognize live INR currency identities, name the forex balance failure, and capture the Agst Ref shape - #177

Merged
lamemustafa merged 6 commits into
masterfrom
tapish-codex/n17-currency-forex-reopen
Aug 24, 2026
Merged

N17 — recognize live INR currency identities, name the forex balance failure, and capture the Agst Ref shape#177
lamemustafa merged 6 commits into
masterfrom
tapish-codex/n17-currency-forex-reopen

Conversation

@lamemustafa

Copy link
Copy Markdown
Owner

Closes #172. Addresses #170 and item 4 of #107.

1. is_inr rejected ordinary TallyPrime books (#172)

Bridge required the base currency's MAILINGNAME to be the literal Indian Rupees. TallyPrime
7.1 writes INR.
Measured 2026-08-23 against a licensed Silver gateway: six of eight companies on
the machine report INR, including Bridge Validation Lab — Bridge's own reference company, which
predates the corpus generators entirely. Every one of those books evaluated to is_inr = false, so
the bulk sweep refused them with company_base_currency_not_inr and the single-company screen
demanded a manual assertion on every ordinary Indian book.

The accepted set now includes INR. The currency_count == 1 guard is unchanged — with several
currencies defined, which one is BASE is not determinable from that read, and guessing would put a
rupee symbol in front of a dollar balance. Only the name half was wrong. Both spellings are live on
the same machine (older books still say Indian Rupees with the ERP-9-era Rs. symbol), so the
match was widened rather than swapped.

2. Captured fixtures replace hand-authored currency XML

The rule survived because every Indian Rupees in the tree was hand-written — an inline
const LIVE in wire.rs, an inline const CURRENCY in runtime.rs, a doc comment, and the
protocol reference. The tests built their own input and then confirmed Bridge agreed with it. There
was no captured currency response anywhere in the repository.

Three captures now drive those tests, each asserted by SHA-256:

fixture company symbol MAILINGNAME count
currency_inr_modern_live Bridge Validation Lab I₹ INR 1
currency_inr_legacy_live Bridge Billwise Lab Rs. Indian Rupees 1
currency_multi_live BRIDGE CORPUS FOREX $ USD 2

Note the modern symbol is I₹U+0049 followed by U+20B9 — not a bare .

3. A forex ledger's CLOSINGBALANCE is a string, and the error blamed the data (#170)

On a foreign-currency party ledger Tally returns a composite display string
(-$ 2000.00 @ I₹ 84/$ = -I₹ 168000.00) where BILLCL stays a plain decimal. Parsing failed with
InvalidAmount — "Tally returned an invalid native amount" — which reads as though Tally sent
garbage.

Bridge still fails closed, and that is deliberate. No attempt is made to parse the composite
string or to fall back to its base-currency tail. This is a diagnostics change only: the error is now
typed, recognises the shape structurally rather than by symbol, and names the offending ledger. On
the measured book ~98.4% of the party balance sat in the unnamed residual, so naming the ledger is
the difference between an actionable message and a dead end.

4. AllClientsScreen hard-coded ₹ (#107 item 4)

Both outstandings screens now derive the symbol from the same assertion-derived helper.
This was latent, not a live money bug — the sweep refuses non-INR books at the
company_base_currency_not_inr gate, so no foreign balance reaches that screen today. It is
consistency work that stops a future change to the sweep gate from becoming one.

Note #107 item 4's stated reason for deferral — "the currency formal name is unreachable by export"
— is now false; render_company_currency_request reaches it.

5. Captured coverage for the Agst Ref path

A review finding on #171 claimed due-date ageing degrades to bill-date ageing when a settled bill is
reopened by an Agst Ref carrying an empty credit period. Tested live: the premise does not
hold.
Tally populates BILLCREDITPERIOD and BILLDATE on the Agst Ref itself, echoing the
original bill — the corpus generator sends neither field, so the values cannot be an echo of its
input.

That finding was wrong, but it exposed a real gap: neither committed ageing capture contained a
single Agst Ref allocation.
vouchers_agst_ref_reopen_live (127,166 B, BRIDGE CORPUS SETTLED)
now provides them — 12 New Ref and 12 Agst Ref, all 30 Days.

Known limit, stated rather than glossed: that book settles bills to zero but never reopens one
afterwards, so the capture does not execute the post-zero reopen arm — that arm fires on a
bill's first allocation here. The reopen arm remains covered by constructed input, and the
provenance addendum says so. Closing it needs a settle-then-reopen book.

Gates

fmt, clippy with warnings denied, full workspace tests in both feature configurations,
portable-core feature tests, tools workspace tests, TypeScript check, fixture integrity
(72 files, 0 new), and the compatibility gate (unknown_claims=11:evidenced_claims=0).

All six changed pinned files were resealed with the full three-step procedure, verified
independently: 119 pins, 0 stale, and compatibility_surface_sha256 set to the surface's
manifest_sha256 (not the file hash — a distinction that failed CI once already this week).

No dependency or licence change.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13106355ef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/tally/TALLY_PROTOCOL_REFERENCE.md Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d050d620e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/src/commands.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b1a5ac83a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/src/commands.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfe338e68d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/crates/bridge-tally-protocol/src/native_outstandings/wire.rs Outdated
Comment thread src-tauri/crates/bridge-tally-protocol/tests/outstandings.rs Outdated
Accept both observed single-currency Indian mailing names, INR and Indian Rupees, while retaining the count-one guard. Preserve failure-closed foreign-currency ledger parsing but name the ledger in a typed screen error.

Replace self-authored currency shapes with captured UTF-16LE evidence and add captured Agst Ref allocation coverage. The All Clients symbol change is latent consistency work: the sweep currently refuses non-INR books, so no foreign balance reaches that screen today. #107 item 4 no longer needs its formal-name-export deferral because render_company_currency_request reaches it.

No dependency added; no licence change.
@lamemustafa
lamemustafa force-pushed the tapish-codex/n17-currency-forex-reopen branch from bfe338e to 0c7f37d Compare August 24, 2026 06:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c7f37dfd7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/src/commands.rs
@lamemustafa
lamemustafa merged commit 961b536 into master Aug 24, 2026
12 checks passed
@lamemustafa
lamemustafa deleted the tapish-codex/n17-currency-forex-reopen branch August 24, 2026 07:06
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.

is_inr rejects ordinary TallyPrime books: Tally writes MAILINGNAME "INR", Bridge demands "Indian Rupees"

1 participant