feat!: only use uncertain transfer risk - #64
Merged
Conversation
reidzeibel
requested review from
gorandalum and
rosvik
and
a lite review from Copilot
September 4, 2026 08:58
Contributor
There was a problem hiding this comment.
🟢 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.Unlikelyand theUNLIKELY_TRANSFER_LIMIT_IN_SECONDSthreshold constant. - Update
getTransferRiskto classify any finiteseconds <= 0gap asTransferRisk.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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
gorandalum
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Good news,
impossibleorunlikelystate is now dropped, so then the rule is simpler!Bad news? it is a breaking change. 😅
TransferRisk.UnlikelyandUNLIKELY_TRANSFER_LIMIT_IN_SECONDSare removed. Any gap equals to or below zero now classifies asTransferRisk.Uncertain, sogetTransferRisk(-300)returns'uncertain'where it previously returned'unlikely'.May this PR simplifies everything! 🙏🏼