/** * Resume 時の run artifact(reports/)継承 — manifest 付きスナップショット。 * * resume は新しい run slug/dir を作るが、{report:X} は現 run の reportDir への * 単純パス置換のため、abort 前に旧 run が生成したレポートを引き継がないと * producer 実行後の resume で consumer の参照が必ず壊れる(v3-r4 の resume * 境界バグ)。ここでは旧 run の workflow 成果物全体を新 run の reports/ * として原子的に継承する。writer の lock・履歴を保持する * `.takt-report-internal/` は継承しない。 * * 重要なポイント: * - workflow成果物の選択コピーはしない。静的解析では workflow_call / loop * judge / 動的 facet の参照を把握しきれないため、内部名前空間を除く全体を * コピーする。 * - 祖先探索・fallback はしない。常に source_run_slug の直接の親のみ。 * - symlink・run 外 path・非通常ファイルは拒否。target reports/ が既に非空なら * fail-fast。失敗時は一時成果物を除去し、半端な reports/ を公開しない。 * - 公開 workflow 成果物のファイル一覧と hash の SSOT は manifest * (resume-artifacts.json)。meta.json からは manifest への参照のみ。 * - **公開は単一 rename に集約する(atomic publication requirement)**: manifest は staged * reports の内側(reports/resume-artifacts.json、予約名)に置き、一時領域で * 全部完成させてから reports の rename 1回だけで公開する。ロールバックという * 概念が存在しないため、並行 resume の勝者破壊もロールバック失敗による * 中途半端な状態も原理的に起きない。予約名は次回 resume のコピーから除外する * (継承 manifest は新 manifest に置き換わる)。 */ export { RESUME_ARTIFACTS_FILE_NAME } from '../../models/reserved-report-names.js'; export interface ResumeReportSnapshotFileEntry { /** reports/ からの相対パス(POSIX 区切り) */ readonly path: string; readonly size: number; readonly sha256: string; } export interface ResumeReportSnapshotReferenceEntry { readonly reference: string; readonly path: string; } export interface ResumeReportSnapshotConsumerEntry { readonly consumerKey: string; readonly reportDirectories: readonly string[]; readonly references: readonly ResumeReportSnapshotReferenceEntry[]; } export interface ResumeReportSnapshotManifest { readonly version: 1 | 2; readonly sourceRunSlug: string; readonly targetRunSlug: string; readonly createdAt: string; readonly files: readonly ResumeReportSnapshotFileEntry[]; readonly resumeReportConsumers?: readonly ResumeReportSnapshotConsumerEntry[]; } export interface InheritResumeReportSnapshotOptions { /** .takt/runs が存在するディレクトリ(実行 cwd) */ readonly cwd: string; /** Central execution may own the runs directory outside project cwd. */ readonly runsDirectory?: string; readonly sourceRunSlug: string; readonly targetRunSlug: string; readonly resumeReportConsumers?: readonly ResumeReportSnapshotConsumerEntry[]; } export declare class ResumeReportSnapshotSourceError extends Error { constructor(message: string, options?: ErrorOptions); } export declare function resumeArtifactsPath(cwd: string, runSlug: string, runsDirectory?: string): string; export declare function readResumeReportSnapshotManifest(cwd: string, runSlug: string, runsDirectory?: string): ResumeReportSnapshotManifest | undefined; /** * source run の reports/ を target run の reports/ として継承する。 * * 手順: 検証 → 一時ディレクトリへ再帰コピー + manifest を一時領域の**内側**に * 生成(reports/resume-artifacts.json、予約名)→ reports の rename **1回だけ**で * 公開。公開操作が単一 rename に集約されているため、ロールバックという概念が * 存在しない: rename 失敗(並行敗者の宛先既存を含む)時は staging を掃除する * だけで、公開済み状態に触る操作が一切ない。掃除自体が失敗しても公開物は * 不変のまま。 */ export declare function inheritResumeReportSnapshot(options: InheritResumeReportSnapshotOptions): ResumeReportSnapshotManifest; //# sourceMappingURL=resume-report-snapshot.d.ts.map