Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

919 B
Raw Blame
// SPDX-License-Identifier: AGPL-3.0-only
// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
// including ports, remain AGPLv3; serving them over a network requires releasing their source.

export type Gate = { id: string; cmd: string };
export type GateResult = { id: string; passed: boolean; output: string };
export type Exec = (cmd: string) => { ok: boolean; output: string };

/** The v1 floor: cheap, deterministic, reuses the @carbon/checks checks. Add a row to grow. */
export const FLOOR_GATES: Gate[] = [
  { id: "lint", cmd: "pnpm exec biome check" },
  { id: "conformance", cmd: "pnpm --filter @carbon/checks test" },
  { id: "clobbers", cmd: "pnpm --filter @carbon/checks clobbers" }
];

export function runGates(gates: Gate[], exec: Exec): GateResult[] {
  return gates.map((g) => {
    const r = exec(g.cmd);
    return { id: g.id, passed: r.ok, output: r.output };
  });
}