Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
import { parse } from "yaml";
type Step = { run?: string; uses?: string; if?: string; with?: Record<string, unknown> };
const workflow: {
jobs: Record<string, { permissions: Record<string, string>; steps: Step[] }>;
} = parse(
readFileSync(
new URL("../../../.github/workflows/nightly-release-green.yml", import.meta.url),
"utf8"
)
);
const headroom = workflow.jobs["baseline-headroom"];
test("headroom reporting cannot reopen a permanent issue or modify issue metadata", () => {
assert.notEqual(headroom.permissions.issues, "write");
for (const step of headroom.steps) {
assert.doesNotMatch(step.run || "", /\bgh\s+issue\s+(?:create|comment|edit|reopen)\b/);
}
});
test("headroom measurements remain available in the run summary and retained artifacts", () => {
const scripts = headroom.steps.map((step) => step.run || "").join("\n");
assert.match(scripts, /node scripts\/quality\/baseline-headroom\.mjs/);
assert.match(scripts, /cat reports\/quality\/headroom\.md >> "\$GITHUB_STEP_SUMMARY"/);
const artifact = headroom.steps.find((step) => step.uses?.startsWith("actions/upload-artifact@"));
assert.ok(artifact);
assert.equal(artifact.if, "always()");
assert.equal(artifact.with?.path, "reports/quality/headroom.*");
assert.equal(artifact.with?.["retention-days"], 90);
});