Skip to content

fix(domain): fail-closed passenger residual via Cat 33 + THB (#150) - #166

Merged
telivity-otaip merged 6 commits into
mainfrom
cursor/partial-refund-residual-proration-29b1
Aug 24, 2026
Merged

fix(domain): fail-closed passenger residual via Cat 33 + THB (#150)#166
telivity-otaip merged 6 commits into
mainfrom
cursor/partial-refund-residual-proration-29b1

Conversation

@telivity-otaip

@telivity-otaip telivity-otaip commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Closes #150. Encodes the passenger residual / partial-refund decision tree: Cat 33 + IATA Ticketing Handbook (THB), not MPA-P interline proration, and fail-closed when the valuation method is unspecified.

What changed (latest)

Agents

Agent Behavior
5.1 Fully unused → residual = ticketed base; partial → residual_valuation required; waiver typology + US DOT 24h from main
5.2 Requires residual_method; keeps per-tax carryforward from main
6.1 PARTIAL requires partial_valuation; waiver typology from main; no coupon-ratio proration

KB

  • docs/knowledge-base/partial-refund-residual-value.md — decision tree, worked examples, forbidden formulas

Test plan

pnpm exec vitest run packages/agents/exchange/src/change-management packages/agents/exchange/src/exchange-reissue packages/agents/settlement/src/refund-processing packages/agents/exchange/src/self-service-rebooking
pnpm exec vitest run
Open in Web Open in Cursor 

cursoragent and others added 3 commits August 24, 2026 08:05
Document passenger residual as Cat 33 + Historical Ticket Based (THB)
valuation; reject original−used, original−change-fee, coupon-ratio,
haversine, and MPA-P (interline-only). Agents 5.1/5.2/6.1 require an
explicit method and return DOMAIN_INPUT_REQUIRED when unspecified.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
Correct invented “Historical Ticket Based” expansion — THB is the IATA
Ticketing Handbook (cite by name only). Rename residual method to
PUBLISHED_FARE. Align with #153: no Cat 33 / unmatched provision → free
penalty; bare waiver_code and missing proration method ≠ free (fail closed).

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
@telivity-otaip
telivity-otaip marked this pull request as ready for review August 24, 2026 08:20
cursoragent and others added 3 commits August 24, 2026 09:45
Rebase PR #166 onto latest main (waiver typology #153, US DOT 24h, tax
carryforward, BSP HOT, ADM prevention, etc.) while preserving issue #150
domain rules:

- Passenger residual = PUBLISHED_FARE | CARRIER_SPECIFIC (THB cite-by-name)
- Fail-closed without proration method; no coupon-ratio / MPA-P / haversine
- Waiver typology from main: assertChangeWaiverInput / assertRefundWaiverInput
- Exchange-reissue keeps per-tax carryforward + requires residual_method

All 3587 tests pass.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
…egration)

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
@telivity-otaip
telivity-otaip merged commit 845c32f into main Aug 24, 2026
1 check passed
@telivity-otaip
telivity-otaip deleted the cursor/partial-refund-residual-proration-29b1 branch August 24, 2026 09: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.

[Help wanted] Partial refund / residual value: published-fare proration vs invented arithmetic

2 participants