-
-
Notifications
You must be signed in to change notification settings - Fork 563
feat(shortestpath): harden the pathfinder engine #1847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e3013b4
bc7fe6d
6b16001
7c45c15
dc459ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package net.runelite.client.plugins.microbot.shortestpath; | ||
|
|
||
| /** | ||
| * Explicit production planner rollout state. | ||
| * | ||
| * <p>A single mode prevents contradictory combinations such as selecting the upstream planner while | ||
| * comparison telemetry is disabled. The canary is deliberately limited to resolved F2P policy; members | ||
| * routes remain local until their own evidence gate is accepted.</p> | ||
| */ | ||
| public enum PlannerSelectionMode | ||
| { | ||
| /** Run only the local Microbot planner. */ | ||
| LOCAL, | ||
| /** Keep the local planner authoritative and compare the pinned upstream planner asynchronously. */ | ||
| SHADOW, | ||
| /** Select a semantically matching upstream result for F2P routes, with an automatic local fallback. */ | ||
| UPSTREAM_F2P_CANARY; | ||
|
|
||
| public boolean comparisonEnabled() | ||
| { | ||
| return this != LOCAL; | ||
| } | ||
|
|
||
| public boolean f2pCanaryEnabled() | ||
| { | ||
| return this == UPSTREAM_F2P_CANARY; | ||
| } | ||
|
|
||
| public static PlannerSelectionMode fromConfigValue(Object value, PlannerSelectionMode defaultValue) | ||
| { | ||
| if (value instanceof PlannerSelectionMode) | ||
| { | ||
| return (PlannerSelectionMode) value; | ||
| } | ||
| if (value instanceof String) | ||
| { | ||
| try | ||
| { | ||
| return PlannerSelectionMode.valueOf(((String) value).trim().toUpperCase()); | ||
| } | ||
| catch (IllegalArgumentException ignored) | ||
| { | ||
| // Invalid test/plugin-message overrides fail closed to the persisted/default mode. | ||
| } | ||
| } | ||
| return defaultValue; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -904,4 +904,18 @@ default boolean useLiveCollision() { | |
| default boolean resetLearnedCollision() { | ||
| return false; | ||
| } | ||
|
|
||
| @ConfigItem( | ||
| keyName = "plannerSelectionMode", | ||
| name = "Planner rollout mode", | ||
| description = "Local is the production default. Shadow compares the pinned upstream planner. " | ||
| + "The F2P canary selects only semantically matching upstream routes and automatically " | ||
| + "falls back to local; members routes remain local.", | ||
| position = 3, | ||
| section = sectionDeveloper, | ||
| hidden = true | ||
| ) | ||
| default PlannerSelectionMode plannerSelectionMode() { | ||
| return PlannerSelectionMode.LOCAL; | ||
| } | ||
|
Comment on lines
+918
to
+920
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Recalculate when the rollout mode changes.
🤖 Prompt for AI Agents |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.