feat(p9): real-egress proof (env-gated HttpProvider) + /health bindings + smoke

Task 9.5: /health now reports the egress provider backing each channel (sandbox
vs http). scripts/smoke-capability.mjs proves the slice end to end: sandbox egress
SENT through the broker; EMAIL routed to the env-gated HttpProvider and actually
delivered to a LOCAL echo server (real egress, no external network, no credentials);
idempotent replay; /health bindings. App wires CapabilityModule.

P9 slice-1 verification: 103 tests green, pnpm -r build all packages+demos,
boundary clean, capability smoke PASS, all prior smokes (realtime/inbox/support/
adapter/route/ai/calendar) still PASS through the broker.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-01 20:38:47 +05:30
parent a1f46646ee
commit f7519d36f0
3 changed files with 71 additions and 3 deletions
@@ -1,12 +1,16 @@
import { Controller, Get } from '@nestjs/common';
import { PrismaService } from './prisma/prisma.service';
import { CapabilityProviderRegistry } from './capability/capability.registry';
@Controller('health')
export class HealthController {
constructor(private readonly prisma: PrismaService) {}
constructor(
private readonly prisma: PrismaService,
private readonly providers: CapabilityProviderRegistry,
) {}
@Get()
async check(): Promise<{ status: string; db: boolean }> {
async check(): Promise<{ status: string; db: boolean; egressProviders: Record<string, string> }> {
let db = false;
try {
await this.prisma.$queryRaw`SELECT 1`;
@@ -14,6 +18,7 @@ export class HealthController {
} catch {
db = false;
}
return { status: 'ok', db };
// Ops view: which provider (sandbox vs http) backs each egress channel.
return { status: 'ok', db, egressProviders: this.providers.bindings() };
}
}