Skip to content

[P24] [Architecture] Объединить анализ трансферов и анализ реальных игроков в общий модуль #24

Description

@MostDef2000

Decision

NEW TASK

Responsible agent

Primary: SLF Transfer Analyzer Agent
Coordination required: SLF Team Management Agent, if real-player analysis UI/files are owned by Team Management.

Author note

Пользователь: "нужно сделать одинаковые модули трансферного анализа и анализа реала игроков. это один и тот же функционал, не нужно поддерживать и развивать две кодовых базы"

Problem

There are two similar/duplicated analysis implementations:

  • transfer analysis;
  • real-player analysis.

They appear to solve the same functional problem or share most of the same logic, but are maintained as separate code paths. This creates duplication and makes future changes risky: fixes/features may be applied to one analyzer but not the other.

Expected behavior

Refactor toward one shared analysis engine / shared scoring module that can be reused by both contexts:

  • Transfer Analyzer context;
  • real-player analysis context.

UI/page-specific adapters may remain separate, but the core analysis logic should be shared.

Scope

Discussion/architecture first.

Likely in scope:

  • identify duplicated transfer/real-player analysis logic;
  • define shared engine interface;
  • define input model shared by both contexts;
  • define output model shared by both contexts;
  • keep thin adapters for page-specific data extraction and rendering;
  • plan migration without breaking existing UI.

Out of scope

  • immediate large refactor without plan;
  • changing recommendation engine / Strategy Data;
  • changing unrelated Team4 helpers;
  • release files;
  • version bump;
  • manual edits to built userscript.

First return

DISCUSSION ONLY.

Agent must return:

  1. Branch Freshness Check.
  2. Inventory of existing related files/functions for:
    • transfer analysis;
    • real-player analysis.
  3. Identify duplicated logic and differences.
  4. Decide correct ownership boundary:
    • what belongs to Transfer Analyzer;
    • what belongs to Team Management;
    • what should become shared/core analysis logic.
  5. Propose target architecture:
    • shared analysis engine;
    • transfer adapter;
    • real-player adapter;
    • UI rendering boundaries.
  6. Propose migration plan in small safe steps.
  7. State required changed files for step 1 only.
  8. State cache/schema/storage impact.
  9. State bundle-order/module-registry impact.
  10. Acceptance checks.
  11. Ask for COMMIT APPROVED before writing.

Acceptance checks

  • There is a single shared source of truth for common player analysis/scoring logic.
  • Transfer analysis and real-player analysis use the same shared logic where their behavior is identical.
  • Context-specific differences are explicit adapters/config, not copy-pasted code.
  • Existing transfer analysis UI still works.
  • Existing real-player analysis UI still works.
  • No unrelated Team Management helpers changed.
  • No Strategy Data files changed.
  • No release artifacts changed by module branch.
  • No version bump by module branch.

PM planning

Complexity: L
Risk: high
Recommended order: later
Type: Architecture / Refactor
Reason:

  • This is cross-context logic consolidation.
  • It can reduce maintenance cost, but it touches two analysis flows and may cross Transfer Analyzer / Team Management boundaries.
  • Must be done in small staged commits after discussion.

Notes

This should not start as a direct implementation. First step must be an architecture/discovery pass. The PM preference is to consolidate common analysis logic while keeping page-specific adapters separate.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions