Files
openclaw/scripts/frv-proof-broker.d.mts
Vincent Koc 063fcaf89e improve(ci): add trusted FRV proof broker (#128966)
* improve(ci): add trusted FRV proof broker

* fix(ci): tighten FRV proof broker boundaries

* test(ci): narrow FRV broker workflow lookup

* fix(ci): renew FRV broker mutation authority

* fix(ci): bind FRV proof to broker attempt
2026-08-25 16:36:50 +08:00

54 lines
1.3 KiB
TypeScript

export type BrokerContext = {
actor: string;
correlation: string;
headSha: string;
prNumber: number;
repository: "openclaw/openclaw";
runId: number;
workflowSha: string;
};
export type GitHubApi = {
request(method: string, path: string, body?: unknown): Promise<unknown>;
};
export type FixtureRunExpectation = {
attempt: number;
branch: string;
conclusion: "failure" | "success";
correlation: string;
headSha: string;
repository: string;
runId?: number;
};
export type ProofReceipt = {
actor: string;
correlation: string;
fixtureRunAttempt: 2;
fixtureRunId: number;
headSha: string;
operation: "noop";
prNumber: number;
repository: "openclaw/openclaw";
sourceRef: "refs/heads/main";
workflowSha: string;
};
export function validateBrokerRequest(event: unknown, env: NodeJS.ProcessEnv): BrokerContext;
export function validateFixtureRun(
value: unknown,
expected: FixtureRunExpectation,
): Record<string, unknown>;
export function runProofBroker(options: {
api: GitHubApi;
env: NodeJS.ProcessEnv;
event: unknown;
sleep?: (milliseconds: number) => Promise<void>;
}): Promise<ProofReceipt>;
export function createGitHubApi(options: {
repository: string;
token: string;
fetchImpl?: typeof fetch;
}): GitHubApi;