fix: expose AgentRun branch-follower CI reuse evidence

This commit is contained in:
Codex
2026-07-04 08:08:41 +00:00
parent 111aa222bb
commit 3a0407f87c
5 changed files with 562 additions and 44 deletions
+15
View File
@@ -114,6 +114,21 @@ export function runtimeReuseService(config: RuntimeReuseConfig | null, ids: read
return config.services.find((service) => wanted.has(service.id)) ?? null;
}
export function requiredReuseServiceError(reuseConfig: RuntimeReuseConfig, ids: readonly string[], mode: "runtimeReuse" | "envReuse"): string | null {
const service = runtimeReuseService(reuseConfig, ids);
if (service === null) return `${RUNTIME_REUSE_CONFIG_PATH} must declare service ${ids.join("|")}`;
if (mode === "runtimeReuse") {
if (service.runtimeReuse === null) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} must declare runtimeReuse`;
if (service.runtimeReuse.enabled === false) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} runtimeReuse is disabled`;
if (service.runtimeReuse.codeIdentityPaths.length === 0 && service.runtimeReuse.envIdentityPaths.length === 0) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} runtimeReuse must declare codeIdentity or envIdentity paths`;
return null;
}
if (service.envReuse === null) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} must declare envReuse`;
if (service.envReuse.enabled === false) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} envReuse is disabled`;
if (service.envReuse.envIdentityFiles.length === 0 && service.envReuse.nodeDepsPath === null) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} envReuse must declare envIdentityFiles or nodeDepsPath`;
return null;
}
function parseServices(spec: Record<string, unknown>, errors: string[]): RuntimeReuseService[] {
const raw = spec.services;
const items = Array.isArray(raw)