Harden model results with lossless isolated repair and scoped permissions

This commit is contained in:
2026-10-09 20:02:41 +01:00
parent 0f80ff4e95
commit 67ac79765f
23 changed files with 977 additions and 58 deletions
+5
View File
@@ -52,6 +52,11 @@ func TestStableNativeSessionContractLive(t *testing.T) {
if len(session.Permission) != 3 || session.Permission[2]["permission"] != "bash" {
t.Fatal("scoped native permission contract not retained", string(data))
}
// Validate the real native JSON-schema request without provider inference.
_, err = c.Native(ctx, "post", "/session/"+result.Data.ID+"/message", map[string]any{"noReply": true, "format": map[string]any{"type": "json_schema", "retryCount": 0, "schema": map[string]any{"type": "object", "required": []string{"outcome", "output"}, "additionalProperties": false, "properties": map[string]any{"outcome": map[string]any{"type": "string", "enum": []string{"success", "error"}}, "output": map[string]any{"type": "object"}}}}, "parts": []map[string]string{{"type": "text", "text": "No inference; validate structured format."}}})
if err != nil {
t.Fatal("native schema request rejected", err)
}
ref, err := c.Reference()
if err != nil {
t.Fatal(err)