merge: conflict-blocklist filenames + path-based vehicle signal

Bring in two narrow additions previously sitting on a feature branch:

- api/diagnostics.py: \_IGNORED_FILENAMES skip-list for /api/conflicts.
  PZ engine-concatenated and framework-hook files (sandbox-options.txt
  etc.) ship with intentionally distinct sha1s across mods; they are
  not real conflicts. Live cache had 33 providers of sandbox-options.txt
  with 31 distinct hashes generating false-positive conflict rows.

- worker/build_manifest_and_types: extend the path-based Vehicles signal
  to include models_x/vehicles/ and models/vehicles/, catching mods that
  ship 3D vehicle assets without scripts. Existing mods need their
  manifest rebuilt before mod_types reflects the new signal.
This commit is contained in:
2026-05-06 21:35:35 +00:00
2 changed files with 38 additions and 2 deletions

View File

@@ -14,6 +14,29 @@ from typing import Dict, List, Tuple
from mlos_sort import ModInfo from mlos_sort import ModInfo
# Filenames that legitimately appear across multiple mods because they're
# intended merge points — either PZ engine-merged at runtime, or framework
# extension hooks where multiple client mods coexist by design. Multiple
# distinct sha1s here is by-design, not a conflict, so we skip them in
# scan_file_conflicts. Sourced from HellDrinx Mod Manager's known false-
# positive list (backend/services/workshop.cjs); add more here as we
# encounter them.
_IGNORED_FILENAMES = {
# PZ engine-merged at load time
"sandbox-options.txt",
"fileguidtable.xml",
# Framework extension hooks (designed for many mods to override)
"mf_ismoodle.lua", # MoodleFramework hook
"kp_extrabodylocations.lua", # KP body-locations framework hook
"registries.lua", # damnlib-style registry framework
# Specific mod-side merge points
"hat_gasmask.xml",
"hat_gasmask_nofilter.xml",
"sounds_tmrremovemumble.txt",
"null.wav", # silent placeholder, deliberately shared
}
@dataclass @dataclass
class FileConflict: class FileConflict:
rel_path: str rel_path: str
@@ -59,7 +82,14 @@ async def scan_file_conflicts(conn, mods: List[ModInfo]) -> List[FileConflict]:
idx = order_index.get(mod_id) idx = order_index.get(mod_id)
if idx is None: if idx is None:
continue continue
by_path[r["rel_path"]].append((idx, mod_id, r["sha1"])) rel_path = r["rel_path"]
# Skip known intended-merge-point filenames (engine-concatenated or
# framework hooks). These produce noisy false positives because
# multiple mods adding sandbox vars / framework hooks is by design.
basename = rel_path.rsplit("/", 1)[-1]
if basename in _IGNORED_FILENAMES:
continue
by_path[rel_path].append((idx, mod_id, r["sha1"]))
conflicts: List[FileConflict] = [] conflicts: List[FileConflict] = []
for rel, entries in by_path.items(): for rel, entries in by_path.items():

View File

@@ -365,7 +365,13 @@ def build_manifest_and_types(
or suffix in {".png", ".dds"}): or suffix in {".png", ".dds"}):
if path.name.lower() != "poster.png": if path.name.lower() != "poster.png":
tags.add("Textures") tags.add("Textures")
if rel_below.startswith(("scripts/vehicles/", "scripts/vehicle")): # Path-based vehicle detection. scripts/vehicles is the universal
# signal; models[_x]/vehicles/ catches mods that ship 3D assets
# without scripts (rarer, but real — borrowed from HellDrinx Mod
# Manager's heuristic). rel_below is already lowercased so the
# capital "X" in the original PZ "models_X" path lands as "models_x".
if rel_below.startswith(("scripts/vehicles/", "scripts/vehicle",
"models_x/vehicles/", "models/vehicles/")):
tags.add("Vehicles") tags.add("Vehicles")
if rel_below.startswith(("clothing/", "scripts/clothing/")): if rel_below.startswith(("clothing/", "scripts/clothing/")):
tags.add("Clothing") tags.add("Clothing")