Supervisor S-3/S-4: MCP-Light-Server, Profile, gespeicherte Berichte, Designer-UI
S-4 MCP-Light (Daten-Tuer fuer externe KI-Clients, KEIN Modell-Zugang - Modelle laufen weiter ueber OpenRouter): - McpJsonRpc (pur): JSON-RPC 2.0 fuer initialize/ping/tools/list/tools/call ueber die read-only Tool-Registry; Notifications/Fehlerfaelle spezifikationskonform. - McpLightServer (HostedService): lokaler Streamable-HTTP-Endpoint. OPT-IN via POLYTRADER_MCP_PORT, bindet NUR 127.0.0.1. Claude Code: claude mcp add --transport http polytrader http://127.0.0.1:PORT/mcp - End-to-End-Test ueber echtes HTTP (initialize, tools/call, Notification=202, GET=405). S-3 Profile + Berichte: - SupervisorProfiles: Allgemein/Technik/CopyTrading/ResolutionFarming als System-Prompt- Zusatz + Tool-Subset ueber EINER Agent-Infrastruktur (Technik z.B. ohne Strategie-Tools). Agent filtert Tools je Profil. - sup_reports (SupervisorDbContext, Migration generiert UND angewendet): jede Analyse wird mit Profil/Modell/Frage/Antwort/Tool-Aufrufen/Token gespeichert -> Supervisor auditierbar. UI (Richards Vorgabe: designerfaehig): - SupervisorMainForm auf partial + .Designer.cs umgestellt - alle Controls im Designer (3 Tabs: Analyse mit Profil-Combo+Modellfeld, Dossiers, Berichte mit Split/Grid/Detail). Tests: +16 (MCP-JSON-RPC 6, MCP-HTTP-E2E 1, Profile 2, bestehende erweitert). Build 0 Fehler, 360 Tests gruen, --smoke-ui alle 5 Views gruen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
5d732277b2
commit
b7b2a141e3
@@ -51,6 +51,7 @@ namespace PolyTrader.Tests
|
||||
{
|
||||
private readonly Queue<ChatResponse> _script;
|
||||
public List<IReadOnlyList<ChatMessage>> Requests { get; } = new();
|
||||
public List<IReadOnlyList<SupervisorTool>> OfferedTools { get; } = new();
|
||||
|
||||
public ScriptedChatClient(params ChatResponse[] script) => _script = new Queue<ChatResponse>(script);
|
||||
|
||||
@@ -58,6 +59,7 @@ namespace PolyTrader.Tests
|
||||
IReadOnlyList<SupervisorTool> tools, CancellationToken ct)
|
||||
{
|
||||
Requests.Add(new List<ChatMessage>(messages));
|
||||
OfferedTools.Add(new List<SupervisorTool>(tools));
|
||||
return Task.FromResult(_script.Count > 0 ? _script.Dequeue() : new ChatResponse { Content = "leer" });
|
||||
}
|
||||
}
|
||||
@@ -154,5 +156,32 @@ namespace PolyTrader.Tests
|
||||
Assert.Contains("PolyTrader", ctx);
|
||||
Assert.Contains("read-only", ctx);
|
||||
}
|
||||
|
||||
// ----- Profile (S-3) -----
|
||||
|
||||
[Fact]
|
||||
public async Task Technik_profile_filters_tools_and_extends_prompt()
|
||||
{
|
||||
var reg = RegistryWithEcho();
|
||||
reg.Register(new SupervisorTool("read_logs", "Logs", """{"type":"object","properties":{}}""", _ => "logs"));
|
||||
var chat = new ScriptedChatClient(new ChatResponse { Content = "ok" });
|
||||
var agent = new SupervisorAgent(chat, reg);
|
||||
|
||||
await agent.AskAsync("check", profile: SupervisorProfiles.Technik);
|
||||
|
||||
// Prompt trägt den Profil-Fokus; dem Modell wurde NUR das Technik-Subset angeboten
|
||||
// (Registry hat echo/boom/read_logs → im Technik-Filter ist davon nur read_logs).
|
||||
Assert.Contains("FOKUS TECHNIK-SUPERVISOR", chat.Requests[0][0].Content);
|
||||
Assert.Single(chat.OfferedTools[0]);
|
||||
Assert.Equal("read_logs", chat.OfferedTools[0][0].Name);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Profiles_lookup_is_case_insensitive_with_fallback()
|
||||
{
|
||||
Assert.Equal("Technik", SupervisorProfiles.ByName("technik").Name);
|
||||
Assert.Equal("Allgemein", SupervisorProfiles.ByName("gibtsnicht").Name);
|
||||
Assert.Equal(4, SupervisorProfiles.All.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user