export type ChangeImpact = { sessionId: string; sourceArtifacts: string[]; affectedModules: string[]; affectedFiles: string[]; qaImpact: { coverageDelta: number | null; testCount: number; status: 'passed' | 'failed' | 'unknown'; }; riskImpact: { level: 'low' | 'medium' | 'high'; factors: string[]; }; syncPointers: { artifactRepo: string | null; lastSync: string | null; localPath: string; }; }; export type ArtifactRetentionReport = { sliceId: string; prdArtifacts: string[]; rdArtifacts: string[]; qaArtifacts: string[]; coverageArtifacts: string[]; reviewArtifacts: string[]; codeChanges: string[]; retentionStatus: 'local-ready' | 'pending' | 'explicitly-committed' | 'rolled-back'; commitHash: string | null; rollbackPoint: string | null; }; export type ChangeTraceabilityStatus = { sessionId: string | null; hasArtifactRepo: boolean; artifactSyncStatus: 'synced' | 'pending' | 'out-of-sync' | 'unknown'; localArtifactPath: string; requiredArtifacts: { name: string; path: string; exists: boolean; }[]; nextActions: string[]; }; export type CommitBoundary = { sliceId: string; commitHash: string | null; timestamp: string; artifacts: string[]; codeFiles: string[]; syncState: 'synced' | 'pending' | 'failed'; rollbackPoint: string | null; }; /** * The repo's slice-id control — no separator, no drive, no `..`, non-empty, and * not a bare `.`/`..`. Exported 2026-09-14 (repair R1) so the slice-id axis has * ONE control: `slice-review-state.getReviewPath` joins a caller-supplied slice * id into a filename and previously had none, and a second copy of this regex * there would be the same axis decided twice. */ export declare const SLICE_ID_PATTERN: RegExp; /** * Resolution sources for `resolveArtifactSession`, in priority order. * - `active-skill`: the canonical sid-scoped lease projection * (`.peaks/_runtime//leases/presence-*.json`) for the bound * session id. When at least one in-flight lease exists under the * session dir, that session owns the slice's marker artifact. * - `session-json`: the workspace binding in * `.peaks/_runtime/session.json` (with back-compat fallback to * `.peaks/.session.json`) points to a session dir that owns the * slice's marker artifact (active-skill was checked but did not * own it; session-json is the next source). * - `find-fallback`: neither binding owned the artifact, but a `find` * walk under `.peaks/` located a session dir that does own it. */ export type ArtifactSessionSource = 'active-skill' | 'session-json' | 'find-fallback'; export type ResolvedArtifactSession = { resolvedSessionId: string | null; candidateSources: ArtifactSessionSource[]; }; /** * Resolve the session id that owns the slice's artifacts using a 3-tier * precedence: * * 1. The canonical sid-scoped lease projection under the bound * session id (workspace binding + at least one in-flight lease * in `.peaks/_runtime//leases/`). Slice 4.0.11 statusline- * sid-scoped-lease C collapsed the previous * `.peaks/_runtime/active-skill.json` reader into this tier — * the session id is now read from the canonical workspace * binding (was tier 2), gated on a live lease. * 2. `.peaks/_runtime/session.json` `sessionId` (with back-compat * fallback to `.peaks/.session.json`) if it points to a real * session that owns the slice. * 3. `find .peaks/ -name ''` — the first session dir under * `.peaks/` that owns the slice. * 4. else `{ resolvedSessionId: null, candidateSources: [] }`. * * The back-compat fallbacks are tolerated for one minor release so * users with pre-migration trees (or running an older CLI version) * still get a clean resolution. After the migration (or after v1.3.0 * is installed and `peaks workspace reconcile` has been run), only * the new paths exist and the fallbacks never fire. * * `candidateSources` reports which sources were checked before the * resolver found (or did not find) a winner; the list is in the order * the resolver consulted them. This makes the precedence observable in * the JSON envelope so a human reviewer can see "active-skill was empty * AND session-json was empty, so find-fallback won". */ export declare function resolveArtifactSession(projectRoot: string, sliceId: string): ResolvedArtifactSession; export declare function getChangeTraceabilityStatus(): ChangeTraceabilityStatus; export declare function createChangeImpact(options: { sessionId: string; sourceArtifacts?: string[]; affectedModules?: string[]; affectedFiles?: string[]; }): ChangeImpact; export declare function createArtifactRetentionReport(options: { sliceId: string; prdArtifacts?: string[]; rdArtifacts?: string[]; qaArtifacts?: string[]; coverageArtifacts?: string[]; reviewArtifacts?: string[]; codeChanges?: string[]; }): ArtifactRetentionReport; export declare function recordCommitBoundary(options: { sliceId: string; artifacts?: string[]; codeFiles?: string[]; }): CommitBoundary & { resolvedSessionId: string | null; candidateSources: ArtifactSessionSource[]; }; export declare function validateArtifactRetention(sliceId: string): { valid: boolean; missingArtifacts: string[]; warnings: string[]; resolvedSessionId: string | null; candidateSources: ArtifactSessionSource[]; }; export declare function getScHelpText(): string[];