Framework knowledge is spread across 6+ tables in 4 modules plus templates

Offen
#52 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
lua, python
Bereich
devtools, tooling

Rechercherichtung

Start with mcp-server/tools/manifest_common.py (FRAMEWORK_DEPS, VALID_FRAMEWORKS and the error string), then compare FRAMEWORK_INIT_CLIENT and FRAMEWORK_INIT_SERVER in mcp-server/tools/scaffold.py and the scores/evidence literals in mcp-server/tools/detect_framework.py. The issue proposes a single framework registry, with tests written first for validation, detection and scaffold output. Done means those modules derive from one registry and a newly registered framework works without edits elsewhere; there is no test suite yet, so the first step is adding one.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

severity: medium tech-debt

Summary

The list of supported frameworks and what each one means is repeated in at least six tables across four Python modules, plus tool docstrings and one directory per framework under templates/. None reference each other, so adding or changing a framework requires about nine coordinated edits and a partial edit fails silently.

Where

  • mcp-server/tools/manifest_common.py:12-19 (FRAMEWORK_DEPS), :23 (VALID_FRAMEWORKS), :43 (hand-written error string)
  • mcp-server/tools/scaffold.py:15-33 (FRAMEWORK_INIT_CLIENT and FRAMEWORK_INIT_SERVER, byte-identical)
  • mcp-server/tools/detect_framework.py:14-43 (MANIFEST_SIGNALS, CODE_SIGNALS), :58-65 (scores / evidence literals)
  • mcp-server/server.py:45, 86, 108 (framework lists in tool docstrings)
  • templates/<framework>/, templates/vorp/fxmanifest.lua:2 (game compatibility only in comments)

Details

  • A framework missing from the scores literal raises KeyError in detect_framework; one missing from FRAMEWORK_INIT_* produces an empty init line with no error.
  • FRAMEWORK_INIT_SERVER is a verbatim duplicate of FRAMEWORK_INIT_CLIENT.
  • Game compatibility (VORP/RSG are RedM-only, Qbox/ESX/QB/ox are FiveM-only) exists only in template comments and is not enforced (see "Reject invalid framework/game combinations and offer a multi-framework bridge").

Impact

Maintainability: adding a framework (for example a new RedM core) means touching about nine places, and missed spots produce wrong output rather than errors.

Suggested fix

  1. Tests first: validate_inputs accepts every framework; detect_framework returns each framework for a minimal fixture workspace; the scaffold emits each framework's init line.
  2. Add a FRAMEWORKS: dict[str, Framework] registry in manifest_common.py, where Framework is a dataclass (id, dependency, init_lua, games, manifest_signals, code_signals).
  3. Derive VALID_FRAMEWORKS, FRAMEWORK_DEPS and the error message from it (keep the old names as aliases).
  4. Point the scaffold at FRAMEWORKS[fw].init_lua and delete both INIT dicts.
  5. Build detect_framework's scores/evidence and signals from the registry.
  6. Enforce games in validate_inputs.

Acceptance criteria

  • Framework metadata lives in one registry; other modules derive from it.
  • Adding a framework to the registry is enough for validation, scaffold init, manifest dependency and detection (plus a template directory).
  • Tests cover every registered framework.

Getting started

  • Relevant files: mcp-server/tools/manifest_common.py, mcp-server/tools/scaffold.py, mcp-server/tools/detect_framework.py, mcp-server/server.py
  • How to run checks: there is no test suite yet; run the MCP server with cd mcp-server && pip install -r requirements.txt && python server.py, and CI checks live in .github/workflows/validate.yml
  • Related docs: skills/framework-detection/SKILL.md

Filed by repo-audit/full-audit at 701824d. Severity: medium. Effort: M. audit-key: tech-debt|mcp-server/tools/manifest_common.py|VALID_FRAMEWORKS

Vorherrschende Sprache
Python
Sterne
7
Forks
4
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TMHSDigital/CFX-Developer-Tools

Alle Issues in TMHSDigital/CFX-Developer-Tools

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.