/** * git-pipeline: guaranteed branch -> commit -> push -> PR around agent runs. * * Contract ("always viewable on GitHub, local commit as the floor"): * - PRE-RUN `prepareRunGit`: stamp identity/safety excludes, put the work * on a dedicated branch `teamshare/` (config off-switch). * A folder that is not a git repo NEVER blocks the run - it only * downgrades the report with an actionable hint. * - POST-RUN `finalizeRunGit`: commit everything found in the tree (the * linked folder is the agent's workspace), then push best-effort * (project PAT, env, gh CLI, hub-minted App token, or the git * credential helper), then open a PR against the * configured/detected base branch. Local commit is * GUARANTEED whenever anything changed; push and PR are * best-effort with explicit reasons in every report line. * * Every operation is timeout-capped and this module NEVER throws into the * caller - git problems must never fail an otherwise-successful agent run. * * Workspace arbitration (IMP-950): prepare (branch checkout) and finalize * (add/commit/push) mutate the shared tree's branch state - both run under * an EXCLUSIVE repo lock so a second agent can never switch branches under * this run's feet mid-pipeline. * * Implementation lives in sibling modules split by concern; this file stays * the public entry point so existing imports keep working unchanged: * - ./git-core - `git` runner, timeouts, GitLogFn, GitPolicy * - ./git-discovery - findGitRoot / findAllGitRoots / isOnDefaultBranch * - ./git-branch - branch naming + fresh-branch start points * - ./git-prepare - prepareRunGit[Async] (pre-run phase) * - ./git-finalize - finalizeRunGit / commitRemainingChanges (post-run) */ export type { GitLogFn, GitPolicy } from './git-core'; export { resolveGitPolicy } from './git-core'; export { findGitRoot, findAllGitRoots, isOnDefaultBranch, isWorktreeDir, currentBranchOf, mainRepoOfWorktree, } from './git-discovery'; export { resolveRunRepos } from '../workspace/mirror'; export { branchForTask, desiredBranch } from './git-branch'; export type { PrepareRunGitOptions, PreparedGit } from './git-prepare'; export { prepareRunGit, prepareRunGitAsync } from './git-prepare'; export type { FinalizeRunGitOptions, FinalizedGit } from './git-finalize'; export { finalizeRunGit, commitRemainingChanges } from './git-finalize';