Files
stack/apps/api/src/herald/herald.module.ts
T
jason.woltjeandClaude Opus 4.5 d3058cb3de feat(#172): Implement Herald status updates
Implements status broadcasting via bridge module to chat channels. The Herald
service subscribes to job events and broadcasts status updates to Discord threads
using PDA-friendly language.

Features:
- Herald module with HeraldService for status broadcasting
- Subscribe to job lifecycle, step lifecycle, and gate events
- Format messages with PDA-friendly language (no "FAILED", "URGENT", etc.)
- Visual indicators for quick scanning (🟢, 🔵, , ⚠️, ⏸️)
- Channel selection logic via workspace settings
- Route to Discord threads based on job metadata
- Comprehensive unit tests (14 tests passing, 85%+ coverage)

Message format examples:
- Job created: 🟢 Job created for #42
- Job started: 🔵 Job started for #42
- Job completed:  Job completed for #42 (120s)
- Job failed: ⚠️ Job encountered an issue for #42
- Gate passed:  Gate passed: build
- Gate failed: ⚠️ Gate needs attention: test

Quality gates:  typecheck, lint, test, build

PR comment support deferred - requires GitHub/Gitea API client implementation.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-02-01 21:42:44 -06:00

21 lines
629 B
TypeScript

import { Module } from "@nestjs/common";
import { HeraldService } from "./herald.service";
import { PrismaModule } from "../prisma/prisma.module";
import { BridgeModule } from "../bridge/bridge.module";
/**
* Herald Module - Status broadcasting and notifications
*
* Responsibilities:
* - Subscribe to job events
* - Format status messages with PDA-friendly language
* - Route to appropriate channels based on workspace config
* - Support Discord (via bridge) and PR comments
*/
@Module({
imports: [PrismaModule, BridgeModule],
providers: [HeraldService],
exports: [HeraldService],
})
export class HeraldModule {}