// S3 of docs/plans/2026-08-14-request-intake.md — `/fire` incident id derivation. Machine
// failures produce identical signature strings (e.g. `deploy-local:actions-gateway-config-missing`),
// so the incident id IS the dedup key: same project + signature always maps to the same id, which
// makes the store's PRIMARY KEY constraint the atomic claim (see RequestsStore.claimFire).
import { createHash } from "node:crypto";

export function fireIncidentId(project: string, signature: string): string {
  const hash = createHash("sha256").update(`${project}\n${signature}`).digest("hex").slice(0, 16);
  return `fire-${hash}`;
}
