Skip to content

refactor: break taskLearning metrics<->routing static import cycle - #6077

Merged
atomantic merged 1 commit into
mainfrom
claim/issue-5916
Sep 3, 2026
Merged

refactor: break taskLearning metrics<->routing static import cycle#6077
atomantic merged 1 commit into
mainfrom
claim/issue-5916

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • Breaks the taskLearning/metrics.js <-> taskLearning/routing.js static ESM import cycle by moving the reset path (resetTaskTypeLearning, removeTaskTypeFromLearningData, purgeEnvironmentalFailuresForType) into a new store-only leaf, server/services/taskLearning/reset.js.
  • routing.js now imports the reset from ./reset.js instead of ./metrics.js; metrics.js and the taskLearning barrel re-export the moved symbols, so existing direct importers (migrations 197/198/234, routes, tests) keep working unchanged.
  • Deletes the Break the taskLearning metrics <-> routing static import cycle #5916 entry from KNOWN_CYCLIC_COMPONENTS in server/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.
  • Node import smoke check: reset.js exports all three symbols; metrics.js and the barrel re-export them (back-compat for migrations 197/198/234).
  • Local reviewer (mtplx, low) blocked: no model configured for the mtplx reviewer — proceeding without a local-reviewer verdict.

…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.
@atomantic
atomantic merged commit b411162 into main Sep 3, 2026
7 checks passed
@atomantic
atomantic deleted the claim/issue-5916 branch September 3, 2026 15:34
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.

Break the taskLearning metrics <-> routing static import cycle

1 participant