/** * Lifecycle Hook Dispatcher * * Reads hooks config from config.json and dispatches configured actions * at lifecycle points (increment planned, task completed, increment done). * * All dispatches are: * - Non-blocking (fire-and-forget async) * - Error-isolated (catch + log, never crash) * - Skipped in test environment (process.env.VITEST) * * Part of increment 0298: Hook Lifecycle Wiring */ /** * Options for dispatch methods (internal use) */ export interface DispatchOptions { /** Bypass the test environment guard (for unit testing the dispatcher itself) */ _bypassTestGuard?: boolean; } /** * Result from onIncrementDone with sync status details. * Callers can inspect this to display sync outcome to the user. */ export interface IncrementDoneResult { syncErrors: string[]; syncSuccess: string[]; } /** * Dispatches configured actions at lifecycle hook points. * * All dispatches are error-isolated (catch + log, never crash). * onIncrementDone is awaited by completeIncrement() for reliable post-closure sync. */ export declare class LifecycleHookDispatcher { /** * Dispatch post-increment-planning hooks. * * 2.0: no-op. Kept so callers (create-increment) need no change. */ static onIncrementPlanned(_projectRoot: string, _incrementId: string, _options?: DispatchOptions): Promise; /** * Dispatch post-task-completion hooks. * * Checks hooks.post_task_completion for: * - sync_tasks_md: triggers LivingDocsSync.syncIncrement * - external_tracker_sync: triggers SyncCoordinator.syncIncrementClosure */ static onTaskCompleted(projectRoot: string, incrementId: string, options?: DispatchOptions & { taskId?: string; }): Promise; /** * Dispatch post-increment-done hooks. * * Living docs run when config `livingDocs` is 'onDone'. * Checks hooks.post_increment_done for: * - sync_to_github_project: triggers GitHubFeatureSync for the increment's feature * - close_github_issue: triggers SyncCoordinator.syncIncrementClosure * - update_living_docs_first: if true, living docs sync runs before closure */ static onIncrementDone(projectRoot: string, incrementId: string, options?: DispatchOptions): Promise; /** * Check if dispatch should be skipped (test environment guard) */ /** * Whether the increment's spec.md declares user stories (`## User Stories` * or a `US-NNN` heading). `undefined` when spec.md cannot be read, so a * missing file never changes the sync decision. */ static specHasUserStories(projectRoot: string, incrementId: string): boolean | undefined; private static shouldSkip; /** * Resolve increment directory path from incrementId. * Handles both full IDs ("0499-feature") and short IDs ("0499"). */ private static resolveIncrementDir; /** * Read hooks configuration from config.json */ private static readHooksConfig; /** * Update cross-references in existing living docs after feature specs are created. * * Lightweight post-sync step that: * 1. Updates specs/{project}/README.md with links to the new FS-XXX folder * 2. Logs verification of FEATURE.md existence * * This runs automatically so the link update doesn't depend on the AI skill step. */ private static updateDocsLinks; /** * Log error without propagating. * * 0696 hotfix: when projectRoot is provided, also persist the error * (with full stack) to .specweave/logs/hooks.log. Both the directory * creation and the file append are wrapped in try/catch so a locked * filesystem or missing directory never blocks hook execution. */ private static logError; } //# sourceMappingURL=LifecycleHookDispatcher.d.ts.map