Repository navigation
Closed
Labels
Description
Summary
detect_framework_tool scores ox_lib as ox_core, so standalone, ESX and QBCore resources that use ox_lib are reported as ox_core with high confidence. Ties are broken by dict order, so multi-framework bridge resources are always reported as esx.
Where
mcp-server/tools/detect_framework.py:14-24(MANIFEST_SIGNALS,"ox_lib": "oxcore","qb-","esx_")mcp-server/tools/detect_framework.py:36-38(CODE_SIGNALS,@ox_libandexports['ox_lib']as oxcore)mcp-server/tools/detect_framework.py:74(best = max(scores, ...))mcp-server/tools/detect_framework.py:131-134(raw substring match over the whole manifest)
Details
- ox_lib is a framework-agnostic utility library used by ESX, QBCore, Qbox and plain standalone resources, yet it adds +3 to
oxcoreper manifest and more per code match. - Manifest signals are raw substring checks over the whole file, comments included.
"qb-"matches anyqb-*dependency (such asqb-target, common in ESX and standalone resources), and"qb-core"also matches"qb-", so one dependency scores twice."esx_"matches any text containing it. max()returns the first key on a tie, andesxis first. Running the tool on this repo's bridge examples (for exampleexamples/secure-shop) reportsDetected framework: esx, Confidence: medium (4 signals, 50% of total)with qbcore at the same score.
Impact
The framework-detection skill then generates code for the wrong framework, for example ox_core calls (Ox.GetPlayer) on a server that has no ox_core, or ESX-only code for a resource that supports both ESX and QBCore.
Steps to reproduce
- Create a directory with an
fxmanifest.luacontainingshared_script '@ox_lib/init.lua'and no framework dependency. cd mcp-server && python -c "from tools.detect_framework import detect_framework as d; print(d('<dir>'))"reportsoxcore, confidence high.python -c "from tools.detect_framework import detect_framework as d; print(d('../examples/secure-shop'))"reports esx with qbcore tied.
Suggested fix
- Treat ox_lib as a library signal (score 0, report it as "library: ox_lib"); count only
ox_core/@ox_corefor oxcore. - Match manifest signals as quoted dependency or script tokens (for example
['"]@?ox_core[/'"]) instead of bare substrings; restrictqb-matching toqb-core; ignore comments. - When the top two scores tie, report "multiple frameworks / bridge" with both names instead of picking one.
Acceptance criteria
- A manifest with only
@ox_lib/init.luadetects asstandalone(with ox_lib noted as a library). - Each of
templates/{esx,qbcore,qbox,oxcore,vorp,rsg,standalone}detects its own framework with confidencehigh. - Equal esx and qbcore scores produce an explicit multi-framework / bridge result.
- A manifest with
@qbx_coreand@ox_libdetectsqbox, not a tie with oxcore. - Tests also cover: empty dir gives
standalonewith "No framework signals detected"; nonexistent path givesError: directory not found; files undernode_modules/and.git/are ignored; files over 256 KB are read only up toMAX_FILE_SIZE.
Getting started
- Relevant files:
mcp-server/tools/detect_framework.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: S. audit-key: bug|mcp-server/tools/detect_framework.py|detect_framework
Activity
TMHSDigital commentedon Nov 21, 2026
Fixed in a43be53.
Manifest signals now match quoted dependency/script tokens (comments ignored), ox_lib and oxmysql are reported as libraries without scoring, and equal top scores report "multiple frameworks / bridge".
Verified: Every framework template detects its own framework with high confidence; an ox_lib-only manifest is standalone with ox_lib listed; @qbx_core + @ox_lib is qbox; es_extended + qb-core and examples/secure-shop report a bridge; qb-target and commented names are ignored. Covered by mcp-server/tests/test_detect_framework.py.