From 0042b7dc8526f8495f44a92567a1acfaa20690c6 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 11 Jun 2026 03:35:34 +0000 Subject: [PATCH] test: cover agentrun resource command followups --- scripts/agentrun-cli-contract-test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/agentrun-cli-contract-test.ts b/scripts/agentrun-cli-contract-test.ts index 6f360331..189fd286 100644 --- a/scripts/agentrun-cli-contract-test.ts +++ b/scripts/agentrun-cli-contract-test.ts @@ -91,6 +91,25 @@ assertCondition( "AgentRun CLI bridge must not collapse official AgentRun failures into bridge failures", ); +assertCondition( + agentRunSource.includes("const resourceArgs = action === undefined ? actionArgs : [action, ...actionArgs];") + && agentRunSource.includes("const options = parseResourceOptions(resourceArgs);") + && agentRunSource.includes("const file = options.file ?? requiredContext(\"apply\", \"-f |-\");"), + "AgentRun resource parser must parse verb-level flags such as apply -f - before requiring runtime config", +); + +assertCondition( + agentRunSource.includes("const effectiveLimit = options.tail ?? options.limit;") + && agentRunSource.includes("return renderEventLike(command, result, { ...options, limit: effectiveLimit }, \"Log\""), + "AgentRun logs must map --tail N into the low-noise page limit and preserve pagination commands", +); + +assertCondition( + agentRunSource.includes("function rerunWithoutDryRun(command: string): string") + && agentRunSource.includes("options.dryRun ? [rerunWithoutDryRun(command)] : undefined"), + "AgentRun dry-run resource mutations must return resource-command follow-up instead of official bridge internals", +); + console.log(JSON.stringify({ ok: true, checks: [ @@ -104,5 +123,8 @@ console.log(JSON.stringify({ "AgentRun control-plane status degrades empty runtime JSON snippets", "AgentRun CLI bridge selects remote frontend backend in runner/no-Docker environments", "AgentRun CLI bridge keeps AgentRun failures distinct from bridge failures", + "AgentRun resource parser supports apply -f -", + "AgentRun logs tail controls page limit", + "AgentRun dry-run mutations keep resource-command follow-up", ], }));