/** * Project Execution Contract — 项目声明的执行命令来源(build/test/allowed/cwd/env)。 * * 职责边界: * - 负责:声明项目的 build/test 命令 + 工作目录 + 环境 + 允许命令白名单 * - 不负责:命令执行(verification_executor)、猜命令(禁止) * * 原则:verification 从 contract resolve 命令,禁止自行猜命令。 * command 必须经过 canExecute 校验(在 verification_executor executeRealCommand)。 * 来源:contract 由项目/用户/AI 宿主配置(SoloForge 不生成,无 LLM)。 */ export interface CommandSpec { /** 命令标识(如 "unit-test"/"build") */ name: string; /** 实际命令(必须经 canExecute 校验) */ command: string; /** 验证层 */ layer: "build" | "test"; } export interface ProjectExecutionContract { /** 构建命令(L1 build 验证) */ build_commands?: CommandSpec[]; /** 测试命令(L2 test 验证,须含测试痕迹防伪造) */ test_commands?: CommandSpec[]; /** 允许的命令白名单(可选,约束 command 来源,超白名单拒) */ allowed_commands?: string[]; /** 工作目录(命令执行 cwd,canExecute 要求明确) */ working_directory: string; /** 环境要求(env 变量) */ environment_requirements?: Record; }