Skip to content

v2.9.0 — the patch that patches another mod is finally checked

Choose a tag to compare

@WingedGuardian WingedGuardian released this 28 Aug 04:26
· 1324 commits to master since this release

A cross-mod script patch was validated by nothing at all. X4 mods patch each other by mirroring
the target's path inside their own folder — <mymod>/extensions/<target>/md/foo.xml. Both halves of
the schema pass checked direct children only, so every one of those files fell straight through.
Measured on a real 125-mod install: 16 such files across 8 mods, every one of them live.

They are now validated through the document the engine actually builds — target plus patch,
merged — rather than the patch file, which is a <diff> the engine never parses on its own. That
also dissolves the depth problem instead of fighting it: after merging, there is no nesting left.

The interesting part is what it refuses to tell you. Validating the merged document alone would
blame a mod for its target's pre-existing schema violations. MEASURED: 182 findings, of which 167
(91.8%) belong to the target, not the patcher
— a mod named moreroomsforships fails md.xsd's
capital-letter pattern because its own author named it that, and the patching mod can neither cause
nor fix it. Reporting those would flood, and a check that floods trains you to ignore it. So both
sides are validated and diffed per finding: 15 introduced, 1 fixed.

fixed is reported as well as introduced, because a check that can only go one way cannot be
trusted to go the other.

A file that could not be checked never reads as one that came back clean, and the two reasons are
kept apart — because one of them is a real defect:

  • target mod is not installed — the engine no-ops the patch too; nothing wrong.
  • target is installed but does not supply that file — a stale patch that silently never applies.
    One live instance found: a mod patching md/spawnclaymore.xml in a target that ships seven md
    files, none of them that one. The engine logs nothing for this.

x4effective dump stopped reporting a wrong question as a missing answer. Addressing a mod's
document by its path on disk — extensions/<mod>/md/foo.xml — printed no effective content, which
reads as not in the live tree when the truth was right file, wrong form: documents are keyed by
the vpath the engine builds, and for a DLC that literal path is the vpath while for a mod it is
not. 1,713 of 3,257 addressable paths are mod-owned, so this covered a third of the surface. It
now resolves the path and says so out loud, because resolving it silently would trade one confident
wrong answer for another. A genuine absence still exits 1.


Known limit, stated because it is easier to trust a tool that names its edges: the attribution diff
compares the target alone against the target plus this mod. A finding that appears only in
combination with a third mod's patch is outside what it can see.