From d13dea783ee7aa313da982019f84570efb712aa2 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 3 Jul 2026 18:07:35 +0000 Subject: [PATCH] fix: keep follower debug wrapper visible --- .../skills/unidesk-cicd/references/branch-follower.md | 2 ++ scripts/src/cicd-debug.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.agents/skills/unidesk-cicd/references/branch-follower.md b/.agents/skills/unidesk-cicd/references/branch-follower.md index 161b2fe1..683e5ac0 100644 --- a/.agents/skills/unidesk-cicd/references/branch-follower.md +++ b/.agents/skills/unidesk-cicd/references/branch-follower.md @@ -32,6 +32,8 @@ Do not debug the same state/read/write problem by repeatedly pushing empty or ti When a repeated runtime pitfall or visibility defect is found during branch-follower work, update this reference or the skill entry first, then continue with the narrow debug step. Do not proceed to `run-once`, controller loop observation, automatic follower validation, or source-commit-driven integration until the relevant `state-read`, `status-read`, `decide`, and `state-write` debug steps pass for the affected follower. +`debug-step` wrappers must be failure-visible and non-crashing. If the target-side Job fails, returns an older schema, or omits optional summary fields, the operator-facing CLI must render `-`/null plus the target error and Job identity; it must not throw a local TypeError before showing the target evidence. + ## Source Authority - Follower decisions must not read host source worktrees, target dev directories, `.worktree/*`, local git state, or direct GitHub branch refs. diff --git a/scripts/src/cicd-debug.ts b/scripts/src/cicd-debug.ts index bc7bc01a..a89015cd 100644 --- a/scripts/src/cicd-debug.ts +++ b/scripts/src/cicd-debug.ts @@ -192,16 +192,19 @@ function stateWriteResult(followerId: string, result: CommandResult): Record { - const state = read.stateByFollower[followerId] ?? {}; + const stateByFollower = asOptionalRecord((read as unknown as Record).stateByFollower) ?? {}; + const valueBytesByFollower = asOptionalRecord((read as unknown as Record).stateValueBytes) ?? {}; + const errors = Array.isArray((read as unknown as Record).errors) ? (read as unknown as Record).errors as unknown[] : []; + const state = asOptionalRecord(stateByFollower[followerId]) ?? {}; const source = asOptionalRecord(state.source); const target = asOptionalRecord(state.target); const timings = asOptionalRecord(state.timings); return { present: read.stateConfigMapPresent, ok: read.ok, - errors: read.errors.slice(0, 8), + errors: errors.map(String).slice(0, 8), metadata: read.stateMetadata, - valueBytes: read.stateValueBytes[followerId] ?? null, + valueBytes: numberOrNull(valueBytesByFollower[followerId]), phase: stringOrNull(state.phase), observedSha: stringOrNull(source?.observedSha), targetSha: stringOrNull(target?.targetSha),