WebPanel fix round 1: close reply by code, loader PE check, no-open scan, drop Core.xml
- RynthCoreChatCommands: each method keeps its own summary; /rc webpanel close answers by the Close code (closing / already closed / could not close); verb added to the class header list. - Build-Installer.ps1: Assert-PeMachine throws unless Runtime\WebView2Loader.dll is x86 (0x14C). - ChatCommandReplyTests: HandleWebPanelCommand has no Open(, Navigate( or ShellExecute. - Engine csproj: Microsoft.Web.WebView2.Core.xml is not copied (with the other dropped WebView2 copies). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9797db14a3
commit
4e30b16bf5
4 changed files with 42 additions and 9 deletions
|
|
@ -344,7 +344,19 @@ internal static class Program
|
|||
Check(!Regex.IsMatch(src, @"\bReply\(\$?""[Uu]sage"), "no usage line is written as a success (they go through Fail)");
|
||||
Check(!Regex.IsMatch(src, @"\bReply\((usage|ServerUsage)\)"), "nor the usage constants");
|
||||
Check(!Regex.IsMatch(src, @"catch \(Exception ex\) \{ RynthLog\.Compat"), "no command's exception is only logged");
|
||||
}
|
||||
|
||||
Case("RynthCoreChatCommands.cs: /rc webpanel never opens or navigates (an arbitrary-URL command would be a phishing vector)");
|
||||
int wpStart = src.IndexOf("private static void HandleWebPanelCommand", StringComparison.Ordinal);
|
||||
int wpEnd = src.IndexOf("private static void HandleLayoutCommand", StringComparison.Ordinal);
|
||||
Check(wpStart > 0 && wpEnd > wpStart, "found HandleWebPanelCommand");
|
||||
if (wpStart > 0 && wpEnd > wpStart)
|
||||
{
|
||||
string wp = src.Substring(wpStart, wpEnd - wpStart);
|
||||
Check(!Regex.IsMatch(wp, @"\bOpen\("), "HandleWebPanelCommand has no Open(");
|
||||
Check(!Regex.IsMatch(wp, @"\bNavigate\("), "HandleWebPanelCommand has no Navigate(");
|
||||
Check(!wp.Contains("ShellExecute", StringComparison.Ordinal), "HandleWebPanelCommand has no ShellExecute");
|
||||
Check(wp.Contains("WebPanelApi.Close(", StringComparison.Ordinal), "the scan reads the real body (it calls WebPanelApi.Close)");
|
||||
} }
|
||||
|
||||
private static string? FindRepoFile(string relative)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue