Skip to content

feat!: only use uncertain transfer risk - #64

Merged
reidzeibel merged 3 commits into
mainfrom
ridwan/transfer-risk-remove-unlikely
Sep 4, 2026
Merged

feat!: only use uncertain transfer risk#64
reidzeibel merged 3 commits into
mainfrom
ridwan/transfer-risk-remove-unlikely

Conversation

@reidzeibel

@reidzeibel reidzeibel commented Sep 4, 2026

Copy link
Copy Markdown
Member

Good news, impossible or unlikely state is now dropped, so then the rule is simpler!
Bad news? it is a breaking change. 😅

TransferRisk.Unlikely and UNLIKELY_TRANSFER_LIMIT_IN_SECONDS are removed. Any gap equals to or below zero now classifies as TransferRisk.Uncertain, so getTransferRisk(-300) returns 'uncertain' where it previously returned 'unlikely'.

May this PR simplifies everything! 🙏🏼

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

Behavioral changes are consistent across implementation, exports, and tests, with only a small documentation wording nit noted.

Pull request overview

This PR simplifies the transfer-risk model by removing the unlikely state and its threshold, leaving a single uncertain risk for any non-positive (missed or zero-slack) transfer gap, and updates exports/tests accordingly.

Changes:

  • Remove TransferRisk.Unlikely and the UNLIKELY_TRANSFER_LIMIT_IN_SECONDS threshold constant.
  • Update getTransferRisk to classify any finite seconds <= 0 gap as TransferRisk.Uncertain.
  • Update public exports and unit tests to reflect the single remaining risk level.
File summaries
File Description
src/transfer-risk/types.ts Removes Unlikely and updates TransferRisk shape/docs for the simplified model.
src/transfer-risk/transfer-risk.ts Simplifies getTransferRisk to return only Uncertain (or undefined).
src/transfer-risk/index.ts Removes re-export of the deleted threshold constant; keeps TransferRisk export.
src/transfer-risk/tests/transfer-risk.test.ts Updates test expectations and removes references to the deleted constant/state.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/transfer-risk/types.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@reidzeibel
reidzeibel merged commit fbd1904 into main Sep 4, 2026
1 check passed
@reidzeibel
reidzeibel deleted the ridwan/transfer-risk-remove-unlikely branch September 4, 2026 11:21
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.

3 participants