fix: expose follower closeout gates

This commit is contained in:
Codex
2026-07-03 18:20:51 +00:00
parent c0062455fd
commit dc488302b8
2 changed files with 46 additions and 0 deletions
@@ -36,6 +36,8 @@ When a repeated runtime pitfall or visibility defect is found during branch-foll
`debug-step` output must stay bounded in both text and JSON modes. The default machine payload should include step result, compact state/status/decision/write summaries, target Job identity and short error/timing fields only. Full target Job logs, full target JSON and long stdout/stderr tails belong behind explicit drill-down, not in the default `--json` payload.
`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.
## Source Authority
- Follower decisions must not read host source worktrees, target dev directories, `.worktree/*`, local git state, or direct GitHub branch refs.
+44
View File
@@ -188,6 +188,7 @@ function compactTargetDebugResult(parsed: Record<string, unknown> | null): Recor
aligned: status.aligned === true ? true : status.aligned === false ? false : null,
pipelineRun: stringOrNull(status.pipelineRun),
message: stringOrNull(status.message),
gates: asOptionalRecord(status.gates),
},
decision: decision === null ? null : {
phase: stringOrNull(decision.phase),
@@ -269,6 +270,7 @@ function stateSnapshot(read: K8sStateRead, followerId: string): Record<string, u
}
function compactAdapterStatus(live: AdapterSummary): Record<string, unknown> {
const payload = asOptionalRecord(live.payload);
return {
ok: live.ok,
phase: live.phase,
@@ -278,6 +280,48 @@ function compactAdapterStatus(live: AdapterSummary): Record<string, unknown> {
pipelineRun: live.pipelineRun,
inFlightJob: live.inFlightJob,
message: live.message,
gates: compactStatusGates(payload),
};
}
function compactStatusGates(payload: Record<string, unknown> | null): Record<string, unknown> | null {
if (payload === null) return null;
const gitMirror = asOptionalRecord(payload.gitMirror);
const tekton = asOptionalRecord(payload.tekton);
const argo = asOptionalRecord(payload.argo);
const runtime = asOptionalRecord(payload.runtime);
return {
gitMirror: gitMirror === null ? null : {
ok: gitMirror.ok === true,
sourceSnapshotReady: gitMirror.sourceSnapshotReady === true,
pendingFlush: gitMirror.pendingFlush === true,
githubInSync: gitMirror.githubInSync === true,
localSource: stringOrNull(gitMirror.localSource),
githubSource: stringOrNull(gitMirror.githubSource),
localGitops: stringOrNull(gitMirror.localGitops),
githubGitops: stringOrNull(gitMirror.githubGitops),
},
tekton: tekton === null ? null : {
name: stringOrNull(tekton.name),
succeeded: tekton.succeeded === true ? true : tekton.succeeded === false ? false : null,
reason: stringOrNull(tekton.reason),
startTime: stringOrNull(tekton.startTime),
completionTime: stringOrNull(tekton.completionTime),
durationSeconds: numberOrNull(tekton.durationSeconds),
},
argo: argo === null ? null : {
syncStatus: stringOrNull(argo.syncStatus),
healthStatus: stringOrNull(argo.healthStatus),
revision: stringOrNull(argo.revision),
ready: argo.ready === true,
},
runtime: runtime === null ? null : {
ready: runtime.ready === true,
targetSha: stringOrNull(runtime.targetSha),
expectedSha: stringOrNull(runtime.expectedSha),
aligned: runtime.aligned === true ? true : runtime.aligned === false ? false : null,
},
errors: Array.isArray(payload.errors) ? payload.errors.map(String).slice(0, 5) : [],
};
}