refactor: break taskLearning metrics<->routing static import cycle - #6077
Merged
Conversation
…5916) Move resetTaskTypeLearning, removeTaskTypeFromLearningData, and purgeEnvironmentalFailuresForType into a new store-only leaf (taskLearning/reset.js). routing.js imports the leaf instead of metrics.js, so the two-module ESM cycle is gone; metrics.js and the barrel re-export the moved symbols for back-compat. Drops the #5916 entry from KNOWN_CYCLIC_COMPONENTS.
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.
Summary
taskLearning/metrics.js<->taskLearning/routing.jsstatic ESM import cycle by moving the reset path (resetTaskTypeLearning,removeTaskTypeFromLearningData,purgeEnvironmentalFailuresForType) into a new store-only leaf,server/services/taskLearning/reset.js.routing.jsnow imports the reset from./reset.jsinstead of./metrics.js;metrics.jsand thetaskLearningbarrel re-export the moved symbols, so existing direct importers (migrations 197/198/234, routes, tests) keep working unchanged.KNOWN_CYCLIC_COMPONENTSinserver/services/serviceImportCycles.test.js(the suite fails both ways, so the baseline only shrinks).No deferred-import workaround — the cycle is removed, not dodged.
Closes #5916
Test plan
services/serviceImportCycles.test.js— passes with the Break the taskLearning metrics <-> routing static import cycle #5916 baseline entry removed (proves the component is gone, both assertions).services/taskLearning/+services/taskLearning.test.js+routes/cosLearningRoutes.test.js— 13 files, 334 tests, all pass.reset.jsexports all three symbols;metrics.jsand the barrel re-export them (back-compat for migrations 197/198/234).