Skip to content

feat(adm-prevention): complete passive / UC / churning detection (#145) - #162

Merged
telivity-otaip merged 6 commits into
mainfrom
cursor/adm-prevention-passive-churn-1548
Aug 24, 2026
Merged

feat(adm-prevention): complete passive / UC / churning detection (#145)#162
telivity-otaip merged 6 commits into
mainfrom
cursor/adm-prevention-passive-churn-1548

Conversation

@telivity-otaip

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

Copy link
Copy Markdown
Collaborator

Closes #145

What does this PR do?

Hardens Agent 6.2 ADM Prevention with KB-backed passive/UC/churning detection from mid-office practice, so HX/UN/NO-only scanners stop missing the scariest false negatives.

Type of change

  • Enhancement to existing agent
  • Domain logic correction
  • Documentation

Domain impact

Per authoritative KB for #145:

  • IATA Reso 850m = ADM memo windows / dispute process (Agent 6.3 context) — not passive/status rules
  • Passive / UC / churn = carrier booking policy + host statuses HX / UC / UN / NO / TK (cross-host core)
  • HN / PK / GK / YK (and peers) live in per-host maps — not one universal IATA meaning; ignored when gds is omitted/UNKNOWN
  • Travelport: those statuses do not need a ticketing field — status alone is enough; DX marriage break is Travelport-only
  • Churning requires segment history — current HK alone is the classic false negative
  • No carrier-secret commission tables — commission check stays caller-supplied rates only

KB: docs/knowledge-base/adm-prevention.md

Checklist

  • pnpm exec vitest run packages/agents/settlement/src/adm-prevention passes (62 tests)
  • pnpm --filter @otaip/agents-settlement run typecheck passes
  • ESLint clean on changed adm-prevention sources
  • No any types
  • New domain logic sourced from KB (+ public GDS status tables cited there)
  • Tests/fixtures encode domain knowledge (not smoke-only)

Test plan

  • Unit tests cover core set HX/UC/UN/NO/TK, Amadeus HN/PK only when gds=AMADEUS, Sabre YK only when gds=SABRE, no universalization of HN/PK/GK/YK without host, Travelport “no ticketing field” note, history-required churn, Travelport DX marriage break, TTL deadline-day timezone
  • Fixtures under __tests__/fixtures/:
    • churn-all-hk-now.json
    • uncleared-tk.json
    • uc-hn-passive-pk.json (Amadeus)
    • travelport-dx-marriage.json
    • ttl-deadline-day-tz.json
Open in Web Open in Cursor 

cursoragent and others added 3 commits August 24, 2026 08:02
Add KB-backed host status matrix (HX/UC/UN/NO/TK + extended),
history-required churning, Travelport DX marriage note, and TTL
deadline-day timezone checks. Fixtures encode scariest false negatives.
No carrier-secret commission tables.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
Do not globalize host-specific status codes as one IATA meaning.
Core HX/UC/UN/NO/TK stays cross-host; HN/PK/GK/YK and peers apply
only when gds is set. Unknown host uses core only (DOMAIN_QUESTION).

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 marked this pull request as ready for review August 24, 2026 09:10
cursoragent and others added 3 commits August 24, 2026 09:14
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 be34bb8 into main Aug 24, 2026
1 check passed
@telivity-otaip
telivity-otaip deleted the cursor/adm-prevention-passive-churn-1548 branch August 24, 2026 09:22
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] ADM Prevention: complete passive / UC / churning detection from real mid-office practice

2 participants