feat(governance): implement CEO approvals gate with sandbox test and Hermes bidirectional bridge
Deploy Canina / deploy (push) Successful in 2m35s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 6s

This commit is contained in:
devops committed 2026-10-13 22:33:31 +00:00
1 parent 7f10dad448
commit 5486e746a2
8 files changed
+651 -1

No files matched your search

@@ -0,0 +1,54 @@
import { Injectable, Logger } from "@nestjs/common";
@Injectable()
export class HermesClientService {
private readonly logger = new Logger(HermesClientService.name);
private readonly baseUrl: string;
private readonly apiKey: string;
constructor() {
this.baseUrl = process.env.HERMES_GATEWAY_URL || "http://canina-bot:8642";
this.apiKey = process.env.HERMES_API_KEY || process.env.API_SERVER_KEY || "";
}
async checkHealth(): Promise<boolean> {
try {
const res = await fetch(`${this.baseUrl}/v1/health`, {
headers: {
Authorization: `Bearer ${this.apiKey}`,
},
});
return res.status === 200;
} catch (error: any) {
this.logger.error(`Hermes health check failed: ${error.message}`);
return false;
}
}
async triggerEvent(eventName: string, payload: Record<string, any>) {
try {
this.logger.log(`Dispatching event ${eventName} to Hermes Gateway`);
const res = await fetch(`${this.baseUrl}/v1/chat/completions`, {
method: "POST",
headers: {
Authorization: `Bearer ${this.apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "hermes-agent",
messages: [
{
role: "user",
content: `[EVENT:${eventName}] ${JSON.stringify(payload)}`,
},
],
}),
});
const data = await res.json();
return { success: true, data };
} catch (error: any) {
this.logger.warn(`Could not dispatch event to Hermes: ${error.message}`);
return { success: false, error: error.message };
}
}
}