/** * Frontmatter Updater (Layer 1 Idempotency Backfill) * * Updates user story frontmatter with GitHub issue information * after issues are created. This provides the fastest idempotency * check (<1ms) for future syncs. * * Part of 3-layer idempotency strategy: * - Layer 1: User story frontmatter (fastest, <1ms) * - Layer 2: Increment metadata.json (fast, <5ms) * - Layer 3: GitHub API query (slow, 500-2000ms) */ import { Logger } from '../utils/logger.js'; export interface GitHubIssueInfo { number: number; url: string; createdAt: string; } export interface FrontmatterUpdateOptions { projectRoot: string; featureId: string; userStoryId: string; githubIssue: GitHubIssueInfo; logger?: Logger; } export declare class FrontmatterUpdater { private logger; private projectRoot; private cachedProjectId; constructor(options?: { logger?: Logger; projectRoot?: string; }); /** * Get project ID for a given project root * Uses cached value if available, otherwise auto-detects */ private getProjectId; /** * Update user story frontmatter with GitHub issue information * * CRITICAL: This is Layer 1 backfill for 3-layer idempotency * Must be called after GitHub issue creation to cache issue number * * FIX: Added atomic locking to prevent race conditions when * multiple agents update the same user story frontmatter concurrently. */ updateUserStoryFrontmatter(options: FrontmatterUpdateOptions): Promise; /** * Batch update multiple user story frontmatters */ batchUpdateFrontmatters(projectRoot: string, featureId: string, updates: Array<{ userStoryId: string; githubIssue: GitHubIssueInfo; }>): Promise<{ success: number; failed: number; }>; /** * Get user story file path from project root, feature ID, and user story ID */ private getUserStoryPath; /** * Read GitHub issue info from user story frontmatter (Layer 1 check) */ getGitHubIssueFromFrontmatter(projectRoot: string, featureId: string, userStoryId: string): Promise; } //# sourceMappingURL=frontmatter-updater.d.ts.map