/** * * Purpose: * The original `peaks tech plan` / `peaks tech status` (in `tech-service.ts`) * is keyed by an active session id (the change-id axis was removed in * v2.19.0). This module provides the *consumer-side wiring* that lets the * same CLI surface be re-keyed by an explicit `--change-id ` for the * OpenSpec / change-driven workflow. The path math, change-id validation, * helpers in `src/services/openspec/artifact-boundary.ts`. * * Style: * - Named function exports (matches `artifact-boundary.ts`). * - Hand-rolled `Result` unions — no `neverthrow` dep. * - Pure path math; never reads the filesystem. * * Hard ban: * - This file MUST NOT import from `peaks-loop-shared` (stays inside * - This file MUST NOT touch `src/services/openspec/artifact-boundary.ts` */ import type { WorkspaceConfig } from '../config/config-types.js'; import { type BoundaryError, type ChangeIdError, type PlanArtifactPathOutput, type WorkspaceUnavailableResponse, type Result } from '../openspec/artifact-boundary.js'; export type TechArtifactPathResult = PlanArtifactPathOutput; export type TechChangeArtifacts = { taskGraph: TechArtifactPathResult; waveManifests: TechArtifactPathResult[]; reviewChecklist: TechArtifactPathResult; approvalTemplate: TechArtifactPathResult; }; export type TechChangeStatusValue = 'unavailable' | 'missing' | 'blocked' | 'approved'; export type TechChangeStatus = { changeId: string; status: TechChangeStatusValue; artifactRoot: string; requiredArtifacts: string[]; missingArtifacts: string[]; approvalRecord: string | null; blockedReasons: string[]; nextActions: string[]; }; /** * Validate a change-id string. This is a thin consumer-side wrapper that * change-id-axis service has a single named export point (`validateTechChangeId`) * and so the test file can import it without reaching across to openspec. */ export declare function validateTechChangeId(id: string): Result<{ changeId: string; }, ChangeIdError>; /** * Plan the 5 artifact-relative paths the tech-change-id planner needs to * expose: * - `taskGraph` → `/architecture/tech-task-graph.json` * - `waveManifests` → `/architecture/waves/wave--.json` (4) * - `reviewChecklist` → `/architecture/tech-review-checklist.md` * - `approvalTemplate` → `/architecture/tech-approval-record.template.md` * * failure (so callers get a single, deterministic BoundaryError). * * Pure path math — does not touch the filesystem. */ export declare function planTechArtifactPath(input: { changeId: string; workspaceRoot: string; requestId: string; }): Result; /** * Build the workspace-unavailable response for the change-id-axis tech * the same single source of truth (nextActions constant) is reused. * * The `mode` discriminator matches the existing artifact-boundary shape * (`'preview-only' | 'blocked'`). */ export declare function buildTechWorkspaceUnavailable(input: { mode: WorkspaceUnavailableResponse['mode']; }): WorkspaceUnavailableResponse; export type { WorkspaceConfig };