fix(script-analysis): key the trust verdict cache on every verdict input (CMN-5, WP1 task 1.3)

TrustVerdictCache keyed on the code hash alone while the verdict also
depends on the analysis reference set (and its degraded-fallback mode).
The key is now (code SHA-256, degraded flag, base-reference fingerprint,
extra-reference digest), length-prefixed. File-backed extra references
are digested (path/size/mtime/kind/aliases/embed) so the Central UI run
gate's calls are cached under their own key; an extra reference with no
stable identity stays uncacheable.

The old extras test passed a PortableExecutableReference[] positionally,
which binds to the explicit-base overload, so it never exercised the
extras path; the tests now use the named argument.
This commit is contained in:
Joseph Doherty
2026-12-03 09:46:32 -05:00
parent a9549fbc6e
commit 5469ece012
5 changed files with 167 additions and 32 deletions
@@ -12,6 +12,10 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="ZB.MOM.WW.ScadaBridge.ScriptAnalysis.Tests" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../ZB.MOM.WW.ScadaBridge.Commons/ZB.MOM.WW.ScadaBridge.Commons.csproj" />
</ItemGroup>