Add evaluation operations and reporting

This commit is contained in:
dahyeon committed 2026-05-12 08:16:31 -07:00
1 parent 60f33b8f4b
commit 6f09408423
57 files changed
+7060 -142

No files matched your search

+16
View File
@@ -21,6 +21,7 @@ const { getRawSecret } = await import("../common/secret-manager.js");
const { ConversationStore } = await import("../conversation/index.js");
const { ShadowWorker } = await import("../eval/shadow-worker.js");
const { AlertService } = await import("../observability/alert.js");
const { initMongoDB, closeMongoDB } = await import("../common/mongodb.js");
function firstNonEmpty(
...values: Array<string | null | undefined>
@@ -175,15 +176,30 @@ async function bootstrap(): Promise<void> {
});
const conversationStore = new ConversationStore(garnetClient);
const alertService = new AlertService(garnetClient, natsClient);
const mongoConnectionString = firstNonEmpty(
getRawSecret("MONGODB_CONNECTION_STRING"),
process.env["MONGODB_CONNECTION_STRING"],
);
const mongoConnection = mongoConnectionString
? await initMongoDB(mongoConnectionString)
: undefined;
if (!mongoConnection) {
logger.warn(
"[Background] MongoDB connection string missing; eval archive/drift/promote disabled",
);
}
const worker = new ShadowWorker(
garnetClient,
llmClient,
conversationStore,
alertService,
undefined,
mongoConnection,
);
installShutdownHooks(async () => {
await worker.stop();
await closeMongoDB();
await natsClient.close();
await garnetClient.close();
await shutdownTracing();