/** * Workspace isolation for evaluation-implementation separation (FR-24). * * Ensures coding agents cannot modify evaluator scripts by enforcing * isolation at three layers: * L0 — OS file permissions (strongest, host-dependent) * L4 — ACP harness write-path whitelist * L6 — Prompt injection (weakest, redundancy layer) * * AC-24.1: Auto-create evaluators/ directory. * AC-24.2: Set file permissions (L0) when host supports it. * AC-24.3: Generate allowedWritePaths config (L4). * AC-24.4: Generate prompt injection text (L6). * AC-24.6: Warn but don't block when L0 unavailable. * AC-24.7: Output isolation status report. */ import type { IsolationStatus, IsolationLayerStatus, AllowedWritePathsConfig } from './evaluator-types.js'; /** * Initialize the evaluators directory with appropriate isolation. * * AC-24.1: Creates evaluators/ if it doesn't exist. * AC-24.2: Attempts to set read-only permissions for non-owner users (L0). */ export declare function initEvaluatorsDirectory(projectRoot: string): IsolationLayerStatus; /** * Generate L4 isolation config: allowed write paths for coding agents. * * AC-24.3: Coding agent sessions get a write-path whitelist that * excludes evaluators/ and docs/. */ export declare function generateAllowedWritePaths(): AllowedWritePathsConfig; /** * Generate L6 prompt injection text for the Implement stage. * * AC-24.4: Explicit constraint in the coding agent's execution context. */ export declare function generateIsolationPromptInjection(): string; /** * Run full isolation setup and produce status report. * * AC-24.7: Isolation status report with per-layer status. * * @param projectRoot - Project root directory. * @returns IsolationStatus report. */ export declare function setupWorkspaceIsolation(projectRoot: string): IsolationStatus; /** * Validate path patterns for unsupported glob characters. * * P1-3: isWriteAllowed only supports prefix matching. If a config * contains glob patterns (e.g. 'evaluators/**') they will NOT be * evaluated as globs, leading to silent mismatches. This helper * detects such patterns so callers can warn early. * * @returns Array of warning strings (empty = all patterns are clean). */ export declare function validatePathPatterns(patterns: string[]): string[]; /** * Validate that a file write target is allowed under isolation rules. * * AC-24.5: At least one layer should catch violations. * This function provides programmatic L4-level checking. * * **Important**: This function uses *prefix matching only*. * Glob patterns (e.g. 'evaluators/**') are NOT evaluated as globs. * Use {@link validatePathPatterns} at config-load time to catch * unsupported glob syntax in deny lists. * * @param filePath - Relative file path from project root. * @returns true if the write is allowed, false if it violates isolation. */ export declare function isWriteAllowed(filePath: string): boolean; //# sourceMappingURL=workspace-isolation.d.ts.map