Fix "Other" asset type: was suggesting a channel that doesn't exist

nonprobate.js's suggestedChannel() had no case for the "Other" type (or
anything else that fell through every specific check) — it defaulted to
{ channel: 'nomination', label: 'EPF / Takaful nomination' }. Two bugs:
(1) recommending a retirement/insurance nomination for a generic asset
that could be anything (a collectible, a domain name, an heirloom) makes
no sense, and (2) 'nomination' isn't a real value in NominationRegistry's
CHANNEL_TYPES (epf/takaful/bank-mandate/trust/business-continuity/
digital-custody) — the suggestion pointed at a channel that doesn't exist.

Default now points to Hibah — the safest general-purpose fast path since
it needs no institution or legal structure, with a note to consider a
trust setup instead if the asset is high-value or income-generating.

e2e-other.cjs: new suite confirming the fixed suggestion, the corrected
in-app reasoning text, and that following it (Hibah) actually reaches
100% coverage. 4/4 passing. Re-verified all seven prior suites (32/32,
16/16, 12/12, 10/10, 10/10, 9/9, 31/31) — 136/136 total, no regressions.
This commit is contained in:
wmj
2026-08-13 18:33:22 +08:00
parent 10289e2d92
commit 4250f8da14
2 changed files with 75 additions and 1 deletions
+9 -1
View File
@@ -67,5 +67,13 @@ export function suggestedChannel(assetType) {
if (t.includes('digital')) return { channel: 'digital-custody', label: 'Digital custody plan (multi-sig / exchange beneficiary / key escrow)', note: 'Custodial exchange accounts often have a built-in beneficiary/inheritance feature — use it directly. Self-custody wallets need a multi-sig setup or a key-escrow arrangement with your executor; a single seed phrase known only to you is not a fast path, it is a total-loss risk.' };
if (t.includes('vehicle') || t.includes('jewelry') || t.includes('valuables')) return { channel: 'hibah', label: 'Hibah — lifetime gift now', note: 'Movable property like this transfers cleanly by Hibah — offer, acceptance, and possession, done today. No trust or nomination structure is needed for something this easy to hand over while you\'re alive.' };
if (t.includes('property')) return { channel: 'trust', label: 'Pre-funded trust / nominee holding, or Hibah/Waqf now', note: 'Land has no nomination-based bypass in most jurisdictions. Either complete a Hibah/Waqf now (ownership transfers immediately), or set up a trust/nominee holding structure — both require real-world legal steps this app can prepare paperwork for but cannot execute alone.' };
return { channel: 'nomination', label: 'EPF / Takaful nomination', note: 'For retirement funds and insurance/takaful, use the scheme\'s own nomination form — these pay the nominee directly by law, bypassing probate.' };
// Catch-all for "Other" and anything that doesn't match a specific type above.
// Hibah is the safest general default — it works for almost anything you can
// specifically identify and hand over, and needs no institution or legal
// structure to set up. If it's high-value, illiquid, or an ongoing income
// stream (a domain portfolio, IP royalties, an unusual collectible), a trust
// may fit better — the app can't know that from the type alone, so it points
// the simplest, most broadly applicable option first rather than guessing a
// specific institutional channel that likely doesn't apply.
return { channel: 'hibah', label: 'Hibah — lifetime gift now', note: 'For an asset type this app doesn\'t have a specific rule for, Hibah is the safest general starting point — a direct gift, no institution or legal structure required. If it\'s high-value or income-generating (e.g. a business-like asset, IP royalties), consider a trust setup in the Nomination Registry instead.' };
}