tell-tale file to know whether Mojave is installed
From what the question seems to imply:

the most significant file that the macOS system writes for itself is perhaps its own version number file?

That file is located at 

/System/Library/CoreServices/SystemVersion.plist


If that file contains, for example:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
        &lt;key&gt;ProductBuildVersion&lt;/key&gt;
        &lt;string&gt;16G1618&lt;/string&gt;
        &lt;key&gt;ProductCopyright&lt;/key&gt;
        &lt;string&gt;1983-2018 Apple Inc.&lt;/string&gt;
        &lt;key&gt;ProductName&lt;/key&gt;
        &lt;string&gt;Mac OS X&lt;/string&gt;
        &lt;key&gt;ProductUserVisibleVersion&lt;/key&gt;
        &lt;string&gt;10.12.6&lt;/string&gt;
        &lt;key&gt;ProductVersion&lt;/key&gt;
        &lt;string&gt;10.12.6&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Then the above is for Sierra 10.12.6.