/** * v2.15.0 follow-up — G1: slice business review state. * * The 12 Gaps positioning memory: each slice completion triggers a * business review by the user (not a technical review). The user * evaluates 4-5 business / product items; technical metrics (coverage, * P99, security scan) are AI auto-decided in `peaks-rd`'s fan-out. * * State persistence: `.peaks/_runtime//slice-reviews/.json`. * * reviewScore: 1-5 per item; overallOk when avg >= 3 AND no P0 fail * decision: pending | accepted | rejected * rejectionReason: only when decision = rejected */ export type SliceReviewDecision = 'pending' | 'accepted' | 'rejected'; export interface SliceReviewItem { /** Item identifier (e.g. "business-match", "boundary-cases", "ui-assembly", "mergeable"). */ readonly id: string; /** Human-readable question / check. */ readonly question: string; /** User's score 1-5, or null when not yet reviewed. */ readonly score: number | null; /** Optional user note (especially on rejection). */ readonly note?: string; } export interface SliceReview { readonly sliceId: string; /** Session id this review belongs to. */ readonly sessionId: string; /** ISO when the review was first opened (or the slice completed). */ readonly createdAt: string; /** ISO when the user last updated (accepted/rejected). */ readonly updatedAt: string; /** Current decision. */ readonly decision: SliceReviewDecision; /** The 4-5 review items. */ readonly items: readonly SliceReviewItem[]; /** Optional reason when decision = rejected. */ readonly rejectionReason?: string; } /** The 5 default review items per slice (the 12 Gaps memory checklist). */ export declare const DEFAULT_REVIEW_ITEMS: readonly { id: string; question: string; }[]; export declare function buildEmptySliceReview(sliceId: string, sessionId: string, now?: Date): SliceReview; export declare function getReviewDir(projectRoot: string, sessionId: string): string; export declare function getReviewPath(projectRoot: string, sessionId: string, sliceId: string): string; export declare function readSliceReview(projectRoot: string, sessionId: string, sliceId: string): SliceReview | null; export declare function writeSliceReview(projectRoot: string, review: SliceReview): void; /** Update a single item's score. Returns the new state. */ export declare function scoreItem(review: SliceReview, itemId: string, score: number, note?: string, now?: Date): SliceReview; /** Compute the average score across all scored items. */ export declare function averageScore(review: SliceReview): number | null; /** Decide accept/reject based on the 12 Gaps threshold: * - avg score >= 3 AND no item scored <= 2 → accepted * - any item scored 1 (P0 fail) or avg < 3 → rejected */ export declare function deriveDecision(review: SliceReview): SliceReviewDecision; /** Apply the derived decision to a review (used by `peaks slice accept`). */ export declare function acceptReview(review: SliceReview, now?: Date): SliceReview; export declare function rejectReview(review: SliceReview, reason: string, now?: Date): SliceReview; /** Render the review as a user-facing checklist (for `peaks slice review`). */ export interface ReviewChecklistItem { readonly id: string; readonly question: string; readonly currentScore: number | null; readonly prompt: string; } export declare function renderChecklist(review: SliceReview): readonly ReviewChecklistItem[];