Skip to content

fix: only negative transfer time as an "uncertain transfer" - #66

Merged
reidzeibel merged 2 commits into
mainfrom
ridwan/adjust-risk-rule
Sep 7, 2026
Merged

fix: only negative transfer time as an "uncertain transfer"#66
reidzeibel merged 2 commits into
mainfrom
ridwan/adjust-risk-rule

Conversation

@reidzeibel

Copy link
Copy Markdown
Member

Adjusted to below zero only, due to 0s transfer time can be considered as a valid trip by Entur

See reference https://mittatb.slack.com/archives/C09CJU3JUH5/p1788553292396239

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

The behavior change is small, consistent with the stated intent, and is covered by updated and new tests (only minor doc wording nits remain).

Pull request overview

Adjusts transfer-risk classification so only negative transfer gaps are flagged as “uncertain”, aligning behavior with Entur trip planner semantics where a 0s transfer can be considered feasible.

Changes:

  • Update getTransferRisk to return undefined for seconds >= 0 (only < 0 is “uncertain”).
  • Refresh docs to match the updated interpretation of “risky” transfers.
  • Update and extend unit tests to cover the 0-second transfer behavior at both function and leg levels.
File summaries
File Description
src/transfer-risk/types.ts Updates TransferRisk documentation wording.
src/transfer-risk/transfer-risk.ts Changes risk classification to only flag negative gaps; updates related JSDoc.
src/transfer-risk/tests/transfer-risk.test.ts Updates existing tests and adds coverage for zero-gap leg transfers.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • 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/transfer-risk.ts Outdated
Comment thread src/transfer-risk/types.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@reidzeibel
reidzeibel merged commit 0a48ebf into main Sep 7, 2026
1 check passed
@reidzeibel
reidzeibel deleted the ridwan/adjust-risk-rule branch September 7, 2026 08:37
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.

2 participants