/** * Trunk-based delivery, for real: checkpoint commits at every mid-slice * point the tree is provably green (pushed, pipeline not awaited), one * FINAL commit per finished slice whose pipeline is awaited as the final * arbiter (algorithm.md: every suite was already green, so red here means * environment drift — the caller repairs it with the failed jobs' logs, * and reverts the slice when the repairs run dry: the trunk is never * left red). * * The pipeline is polled on GitLab's REST API. The coordinates come from * the project's own global configuration (gitlabHostname + gitlabProjectId * — the same file the project's CI tasks read); the token comes from the * FARKETARI_READ_JOBS_TOKEN — decrypted from the sops secrets tree, or an * env override of the same name (a read-only * PAT with API access is enough). Missing coordinates or token are a LOUD * throw with instructions — a trunk that cannot see the pipeline must * never quietly report it green. */ import type { CommandRunner } from "./commands.js"; import type { Trunk } from "./hand-off.js"; import type { ProjectSettings } from "./project-config.js"; export interface GitTrunkOptions { repoRoot: string; runner: CommandRunner; /** Repo-relative path of global-configuration.json (layout.infra.globalConfiguration). */ globalConfigurationPath: string; settings?: ProjectSettings; /** Injectable for tests. */ fetchImpl?: typeof fetch; pollIntervalMs?: number; sleep?: (ms: number) => Promise; } export declare function gitTrunk(options: GitTrunkOptions): Trunk;