/** * Apply a plan. The only module in this feature that writes anything to GitHub. * * It imports no `node:fs` — deliberately, and pinned by a test. `sync` writes nothing to * disk, and the cheapest way to keep that true is for the writing module to have no * ability to. Snapshotting a directory around a run would be the weaker check: cost * capture writes into `.aidlc/` during a session, so a whole-tree snapshot is either * flaky or has to exclude so much that it stops proving anything. * * A `create` is **one** invocation carrying the discovery label, the status label, and the * body marker. If the label were applied by a second call, a process death between the two * would strand an issue invisible to discovery — which the next run would duplicate. One * invocation makes the issue discoverable the instant it exists, and that atomicity is * what the whole no-local-state design rests on. * * Execution **aborts on the first failure**. A rate limit or an authorization failure will * fail everything after it too, so continuing would turn one legible error into forty. * * Requirements: roadmap-issue-projection/AC-23, roadmap-issue-projection/AC-41, * roadmap-issue-projection/AC-42, roadmap-issue-projection/AC-43, * roadmap-issue-projection/AC-46 * * @module */ import { type GhRunner } from './gh.js'; import { type Plan, type PlanLine } from './types.js'; export interface ExecReport { applied: readonly PlanLine[]; /** Set when a write failed; everything in `notAttempted` was skipped because of it. */ failure: { line: PlanLine; error: string; } | null; notAttempted: readonly PlanLine[]; } /** * Numbers GitHub hands out during the run. A milestone or an issue this run creates has no * number at plan time, and the `update-milestone` that follows it needs one * (github-milestones/AC-7). Held in memory only: sync writes nothing to disk. */ export interface RunNumbers { /** Milestone id → GitHub milestone number. */ milestones: Map; /** Item id → the issue number its `create` printed. */ issues: Map; } export declare function applyPlan(gh: GhRunner, plan: Plan, discoveryLabel: string): ExecReport; /** * The `gh` argv for one write outcome. * * Milestone writes go through `gh api`: `gh` has no milestone command, and * `gh issue edit --milestone` looks titles up among open milestones only, so an issue could * never be put under a done one (github-milestones/AC-9). Text from tracked files goes in as * `-f`, a raw string; `-F` would read a value starting `@` as a file. `-F` carries only a * number or `null` this module produced. */ export declare function invocationFor(plan: Plan, line: PlanLine, discoveryLabel: string, run?: RunNumbers): string[]; /** Render an execution report for stdout. */ export declare function renderExecReport(report: ExecReport): string; //# sourceMappingURL=execute.d.ts.map