- Forge webhook POST /api/webhooks/forge HMAC sha256 verify, marker echodo-convoy → pr_review→merged as automation - Completion artifacts table 0017, deterministic summary template, gallery /artifacts - Ops copilot tRPC copilot + context tools (fleet, convoy, backlog) + panel + Draft Task → backlog.createTask - Doc-writer SOPs: webhook rotation, copilot prompt, published flow examples - Allow pr_review→merged as automation for webhook Convoy: .convoys/owner-cockpit-v02 Co-authored-by: orchestrator
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import type { ConvoyClassification } from "../convoy-lifecycle/schemas";
|
|
|
|
export type CompletionSummaryInput = {
|
|
slug: string;
|
|
classification: ConvoyClassification;
|
|
successMetric: string;
|
|
briefs: Array<{ title: string; status: string | null }>;
|
|
modelAlias?: string | null;
|
|
harnessAlias?: string | null;
|
|
prUrl?: string | null;
|
|
};
|
|
|
|
export function generateCompletionSummary(input: CompletionSummaryInput): string {
|
|
const briefCount = input.briefs.length;
|
|
const briefTitles =
|
|
briefCount === 0
|
|
? "No briefs"
|
|
: input.briefs.map((b) => `${b.title} (${b.status ?? "—"})`).join(", ");
|
|
|
|
const modelLine = input.modelAlias ? `Model: ${input.modelAlias}` : "Model: n/a";
|
|
const harnessLine = input.harnessAlias ? `Harness: ${input.harnessAlias}` : "Harness: n/a";
|
|
const prLine = input.prUrl ? `PR: ${input.prUrl}` : "PR: n/a";
|
|
|
|
const lines: string[] = [
|
|
"## Summary",
|
|
`Convoy ${input.slug} ${input.classification} — ${input.successMetric}`,
|
|
`Briefs: ${briefCount} — ${briefTitles}`,
|
|
modelLine,
|
|
harnessLine,
|
|
prLine,
|
|
];
|
|
|
|
return lines.join("\n");
|
|
}
|