fix: keep follower debug wrapper visible
This commit is contained in:
@@ -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.
|
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
|
## Source Authority
|
||||||
|
|
||||||
- Follower decisions must not read host source worktrees, target dev directories, `.worktree/*`, local git state, or direct GitHub branch refs.
|
- Follower decisions must not read host source worktrees, target dev directories, `.worktree/*`, local git state, or direct GitHub branch refs.
|
||||||
|
|||||||
@@ -192,16 +192,19 @@ function stateWriteResult(followerId: string, result: CommandResult): Record<str
|
|||||||
}
|
}
|
||||||
|
|
||||||
function stateSnapshot(read: K8sStateRead, followerId: string): Record<string, unknown> {
|
function stateSnapshot(read: K8sStateRead, followerId: string): Record<string, unknown> {
|
||||||
const state = read.stateByFollower[followerId] ?? {};
|
const stateByFollower = asOptionalRecord((read as unknown as Record<string, unknown>).stateByFollower) ?? {};
|
||||||
|
const valueBytesByFollower = asOptionalRecord((read as unknown as Record<string, unknown>).stateValueBytes) ?? {};
|
||||||
|
const errors = Array.isArray((read as unknown as Record<string, unknown>).errors) ? (read as unknown as Record<string, unknown>).errors as unknown[] : [];
|
||||||
|
const state = asOptionalRecord(stateByFollower[followerId]) ?? {};
|
||||||
const source = asOptionalRecord(state.source);
|
const source = asOptionalRecord(state.source);
|
||||||
const target = asOptionalRecord(state.target);
|
const target = asOptionalRecord(state.target);
|
||||||
const timings = asOptionalRecord(state.timings);
|
const timings = asOptionalRecord(state.timings);
|
||||||
return {
|
return {
|
||||||
present: read.stateConfigMapPresent,
|
present: read.stateConfigMapPresent,
|
||||||
ok: read.ok,
|
ok: read.ok,
|
||||||
errors: read.errors.slice(0, 8),
|
errors: errors.map(String).slice(0, 8),
|
||||||
metadata: read.stateMetadata,
|
metadata: read.stateMetadata,
|
||||||
valueBytes: read.stateValueBytes[followerId] ?? null,
|
valueBytes: numberOrNull(valueBytesByFollower[followerId]),
|
||||||
phase: stringOrNull(state.phase),
|
phase: stringOrNull(state.phase),
|
||||||
observedSha: stringOrNull(source?.observedSha),
|
observedSha: stringOrNull(source?.observedSha),
|
||||||
targetSha: stringOrNull(target?.targetSha),
|
targetSha: stringOrNull(target?.targetSha),
|
||||||
|
|||||||
Reference in New Issue
Block a user