From 419f4502eeb7adc038e2de7b2a10736b6ddf5c6f Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 3 Jul 2026 19:18:25 +0000 Subject: [PATCH] fix: keep all follower status compact --- .../skills/unidesk-cicd/references/branch-follower.md | 2 ++ scripts/native/cicd/read-state-summary.mjs | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.agents/skills/unidesk-cicd/references/branch-follower.md b/.agents/skills/unidesk-cicd/references/branch-follower.md index c3e602e5..476dce5d 100644 --- a/.agents/skills/unidesk-cicd/references/branch-follower.md +++ b/.agents/skills/unidesk-cicd/references/branch-follower.md @@ -42,6 +42,8 @@ Target-side state summaries used by `status`, `events`, `logs` and `debug-step s Follower-scoped commands such as `status --follower`, `events --follower`, `logs --follower` and `debug-step --follower` must ask the target summary helper for only that follower's state. Do not fetch every follower and filter locally at the operator side; multi-follower summaries have different size budgets and should use lower per-follower stage limits. +Multi-follower status summaries should omit per-follower `command.payload`/native drill-down payloads entirely; those belong to follower-scoped `events`/`logs`/`debug-step` queries. Default all-follower status must remain parseable below the transport stdout limit. + `scripts/src/cicd.ts` should stay a thin branch-follower route/orchestration entry, not a catch-all implementation file. Rendering, debug steps, controller manifests, native K8s helpers, adapter-specific trigger/status logic and large data compactors must live in responsibility-specific modules before `cicd.ts` approaches the 3000-line hard split point. `status-read`, `events`, `logs` and debug summaries must expose compact closeout gate details when a follower is not aligned: git-mirror readiness, Tekton PipelineRun condition, Argo sync/health, runtime target sha/readiness and short errors. Repeating only phase/observed/target/message is a visibility defect and must be fixed before further rollout tuning. diff --git a/scripts/native/cicd/read-state-summary.mjs b/scripts/native/cicd/read-state-summary.mjs index a3b07051..99981a9d 100644 --- a/scripts/native/cicd/read-state-summary.mjs +++ b/scripts/native/cicd/read-state-summary.mjs @@ -71,7 +71,7 @@ function readConfigMapViaKubectl() { } } -function compactStateText(text) { +function compactStateText(text, includeCommand) { if (typeof text !== "string" || text.length === 0) return null; let state; try { @@ -79,7 +79,7 @@ function compactStateText(text) { } catch { return null; } - return { + const compact = { id: stringOrNull(state.id), adapter: stringOrNull(state.adapter), enabled: state.enabled === true, @@ -97,8 +97,9 @@ function compactStateText(text) { timings: compactTimings(state.timings), warnings: arrayStrings(state.warnings).slice(0, 6), stateFormat: stringOrNull(state.stateFormat), - command: compactCommand(state.command), }; + if (includeCommand) compact.command = compactCommand(state.command); + return compact; } function compactCommand(command) { @@ -335,11 +336,12 @@ const valueBytes = {}; if (result.ok && result.present) { const data = recordOrNull(result.object?.data) || {}; + const includeCommand = followerIds.length === 1; for (const id of followerIds) { const text = typeof data[id] === "string" ? data[id] : ""; if (text.length === 0) continue; valueBytes[id] = Buffer.byteLength(text, "utf8"); - const compact = compactStateText(text); + const compact = compactStateText(text, includeCommand); if (compact === null) errors.push(`${id}: invalid state json`); else stateByFollower[id] = compact; }