/** * The `roadmap.sync` section of `.aidlc/config.yaml`. * * Follows the convention every other module's config reader in this package follows — * there is no central config loader here, ten call sites each parse the file inline — * with one boundary drawn explicitly, because the requirements review found revision 1 * contradicting itself about it: * * - A malformed **container** reads as *not configured*: unparseable YAML, `roadmap` * not a mapping, `roadmap.sync` not a mapping. One bad section must never break an * unrelated command. * - Anything wrong **inside** a well-formed `sync` mapping is a *named refusal*, * including a wrong-typed value. `provider: 123` is a mistake somebody made on * purpose and wants told about; silently reading it as "you have not configured this" * would send them looking in the wrong place. * * The section is read from the **primary checkout**, the same tree the items come from. * Items and eligibility are one fact; reading them from two trees would let a feature * branch change what a colleague's `sync` publishes. * * Requirements: roadmap-issue-projection/AC-1 … roadmap-issue-projection/AC-9 * * @module */ import { type RoadmapStatus } from '../paths.js'; /** The `roadmap.sync` section, validated. */ export interface SyncConfig { provider: 'github'; /** `owner/name`, or null when `gh` resolves the current repository. */ repo: string | null; statuses: readonly RoadmapStatus[]; label: string; } export type SyncConfigResult = { kind: 'ok'; config: SyncConfig; } | { kind: 'not-configured'; } | { kind: 'invalid'; error: string; }; /** * The default eligible statuses. * * The line falls between "thinking" and "work". `inbox/` means captured, not committed * to — projecting it puts issues on a board for decisions nobody has made. `hold/` * holds parked and declined work, which on this project means pricing thinking and a * competitor teardown; a markdown file in a repo and an indexed, notification-generating * issue are not the same exposure even when both are technically public. */ export declare const DEFAULT_STATUSES: readonly RoadmapStatus[]; /** * Absolute path of a checkout's config file. * * Exported so a refusal can name the file it read. `notConfiguredMessage` used to say * `.aidlc/config.yaml` and stop there, which in a worktree names a file that is not the * one consulted — the section is read from the primary checkout. One reader lost an * afternoon to that on 2026-09-07 (issue-tracker-in-init/AC-31, AC-32). */ export declare function syncConfigPath(root: string): string; /** * Validate a repository coordinate. Shared by the config value and `--repo`, so the two * can never diverge. */ export declare function validateRepo(raw: unknown, source: string): { ok: true; repo: string; } | { ok: false; error: string; }; /** * Validate the discovery label. * * A comma is refused explicitly rather than folded into a charset message, because the * failure it causes is silent and expensive: `gh`'s `--label` is a comma-split slice, so * `aidlc,urgent` would AND two labels in discovery, return an empty issue map, and * re-create every issue on every run. The discovery label *is* the identity of a * projected issue, so a wrong one is a duplicate-issue generator, not a cosmetic error. */ export declare function validateLabel(raw: unknown): { ok: true; label: string; } | { ok: false; error: string; }; /** * Validate the eligible-status list. * * Exported so the `aidlc init` wizard can check its own answer against the reader's rule * rather than reimplementing it. The wizard must never write a section this function * refuses — a setup command that produces a config its own reader rejects is worse than * no setup command (issue-tracker-in-init/AC-9). */ export declare function validateStatuses(raw: unknown): { ok: true; statuses: RoadmapStatus[]; } | { ok: false; error: string; }; /** * Read and validate the `roadmap.sync` section from a checkout's config. * * @param primaryCheckoutRoot - The primary checkout's working tree. */ export declare function readSyncConfig(primaryCheckoutRoot: string): SyncConfigResult; /** * Apply a `--repo` flag over a config, with identical validation. * * The flag wins. It is the likelier source of a wrong value — typed by hand, once — * which is why it goes through the same validator rather than a looser one. */ export declare function withRepoOverride(config: SyncConfig, repo: string | undefined): SyncConfigResult; /** * The message for a project that has not opted in. * * Takes the path it read rather than deriving it, because the caller already resolved the * primary checkout and deriving it twice is how the two come to disagree. Naming the * absolute path is the whole point: on 2026-09-07 this refusal was read as a possible bug * precisely because `.aidlc/config.yaml` in a worktree is not the file consulted, and the * reader had no way to tell whether they were meant to write the section or whether * something had failed to create it. `aidlc init` is named because it now offers to write * it (issue-tracker-in-init/AC-31 … AC-33). * * @param configPath - The absolute path of the file that was read. */ export declare function notConfiguredMessage(configPath: string): string; //# sourceMappingURL=config.d.ts.map