/** * `slowcook stories status` pure helper — 0.19.5-α (sc#146 #6). * * Cross-references the consumer's `specs/_index.yaml` against PR/label * facts to produce a per-story stage table. Pure function — no fs, no * network. The CLI wrapper (`./index.ts`) gathers the inputs. * * Stage mapping (per slowcook conventions): * * | Stage | Slowcook label evidence | * |---------|-------------------------------| * | refine | a `slowcook-spec` PR exists | * | testgen | a `slowcook-tests` PR exists | * | vibe | a `slowcook-mockup` PR exists | * | brew | a `slowcook-brew` PR exists | * | chef | a `slowcook-chef` PR exists | * * Per-stage cell semantics: * * - `✓` — a PR with the matching label exists AND is merged * - `→` — a PR with the matching label exists AND is open * - `✗` — a PR was opened but closed unmerged * - `—` — no PR found for this stage * * For consumers running the local-pipeline pattern (see * `docs/local-pipeline-role.md`), the slowcook labels may not be * applied to human-driven PRs. In that case the helper falls back * to matching by PR-branch-name (`slowcook//story-N` → * stage=). * * Gantt-style stage-by-stage output is parked for a follow-up * (sc#146 #6 acceptance: "Defer the Gantt-style output to a follow-up. * Just ship the underlying table first."). */ import type { SpecIndex, SpecIndexEntry } from "@slowcook-ai/core"; export type StoriesStatusCell = "merged" | "open" | "closed_unmerged" | "absent"; export interface StoriesStatusRow { storyId: string; title: string; status: SpecIndexEntry["status"]; sourceIssue: string | undefined; /** Per-stage status. Stages: refine / testgen / vibe / brew / chef. */ stages: Record<"refine" | "testgen" | "vibe" | "brew" | "chef", StoriesStatusCell>; } export interface PullRequestFact { number: number; title: string; /** Source-of-truth labels on the PR. */ labels: string[]; /** Branch name; used as the fallback signal when labels are absent. */ headBranch: string; /** "open" | "closed". */ state: "open" | "closed"; /** True iff the PR is closed AND was merged. */ merged: boolean; } /** * Build the status table for every story in the index. * * @param specIndex - the parsed `specs/_index.yaml` content * @param pullRequests - all PRs in the repo (merged + open + closed-unmerged). * The CLI wrapper passes the union of label-matched * results; pass an empty array if GH access is * unavailable + the row will report all stages as * absent (still useful for spec-only summary). */ export declare function buildStoriesStatus(specIndex: SpecIndex, pullRequests: PullRequestFact[]): StoriesStatusRow[]; /** * Render a status row set as an ASCII-art table. Used by the CLI * wrapper's stdout. Pure function — no colour codes, no terminal * width detection. */ export declare function renderStoriesStatusTable(rows: StoriesStatusRow[]): string; //# sourceMappingURL=status.d.ts.map