Close ArgoCD change_context double-fetch bug; raise project agent effort#297
Merged
Conversation
… agent effort monitor.yml's change_context step already issued the ArgoCD-history probe BEFORE "Disconnect VPN (post gather)" (confirmed via source + actual step timestamps on runs 30233672995/30240150429) — the step-ordering hypothesis does not hold on current main. What the code did do wrong: it fetched the ArgoCD application JSON TWICE per bot — once via probe_optional() (body discarded) and again, unguarded, to build the displayed history. Under this step's `set -e`/`pipefail`, a transient failure on that second, unguarded curl (even after the probe itself succeeded) aborts the whole gather loop, silently starving every bot processed afterwards of its change_context_manifest.json — exactly the guard's "emitted no valid manifest" fallback text. Add probe_optional_body() to lib.sh: same status/log semantics as probe_optional(), but captures the response body to a file in the same request, so callers needing the body don't issue a second, unguarded fetch. monitor.yml's change_context step now fetches the ArgoCD application once and reads history from the captured file. PR #293's required-vs-optional split is unchanged: probe failure still yields "degraded(optional): ..." and the bot still lands in clean_bots (see fixture test in the PR description). Also raises project.yml's codex-action effort from low to medium per owner approval (PR #295 made a silent-summary miss visible; this addresses the next lever). product.yml and monitor.yml agent effort are untouched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P41roCWN5Fec7m69sSaunU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
monitor.yml. The stated leading hypothesis (change_context running after VPN disconnect) does not hold on currentmain— see evidence below. Instead found and closed a real, latent bug: the change_context step fetched the ArgoCD application JSON twice per bot (once viaprobe_optional(), once more unguarded), and the second unguardedcurlcan abort the whole gather loop underset -e/pipefailon a transient failure, starving later bots in the loop of theirchange_context_manifest.json— producing exactly the guard's "emitted no valid manifest" fallback text.scripts/gather/lib.sh: addedprobe_optional_body()— same status/log semantics asprobe_optional(), but captures the response body to a file in the same request, so the caller never needs a second network round-trip..github/workflows/monitor.yml: change_context step now does one fetch (probe_optional_body) and reads history from the captured file instead of re-curling..github/workflows/project.yml:101:effort: low→effort: medium(owner-approved). Model (gpt-5-mini) unchanged.product.yml/monitor.ymluntouched.Evidence the step-ordering hypothesis is false
Verbatim ordered step names in the
gatherjob, before (origin/main) and after this change — identical,Gather runtime + baseline evidence(which contains the ArgoCD-history fetch) already runs beforeDisconnect VPN (post gather):Confirmed independently via the GitHub Actions API for run
30233672995(head sha93361b89, identical to what's onmain): step 7 "Gather runtime + baseline evidence" ran03:04:47Z–03:05:47Z; step 8 "Disconnect VPN (post gather)" started at03:05:47Z— the ArgoCD fetch runs while the VPN is still up.Also: the specific "binding fact" that run
30233672995's manifest showsdegraded(optional): ... emitted no valid manifestdoes not match what I found. I downloaded that run'smonitor-evidenceartifact directly (gh run download 30233672995 -n monitor-evidence) and every bot'schange_context_manifest.jsonreads{"argocd_history":"ok"}, with real deploy-history entries populated inchange_context.md(e.g. coupon: 4 entries with realid/revision/deployedAt). The next scheduled run at the same commit (30240150429) shows the same —okfor both bots that ran. I could not reproduce the "never populates" symptom on the currentmaincommit across the two most recent runs. The double-fetch bug fixed here is a real, verifiable robustness gap (a transient failure on the redundant second curl would produce exactly the fallback text quoted in the brief for bots processed later in the loop) even though it did not happen to trigger in the two runs I could inspect.Fixture proof: optional failure still yields
degraded(optional)+clean_botsinclusionRan a fixture script that sources the real
scripts/gather/lib.shand re-runs the guard step's BAD-computation logic verbatim against a bot whose ArgoCD-history fetch is wired to an always-failing fakecurl:PR #293's required-vs-optional split is preserved: an ArgoCD-history failure degrades
change_contextonly, never skips the bot.Validation gates
actionlint(v1.7.12, shellcheck 0.11.0 on PATH) over.github/workflows/**:EXIT=0, zero findings.bash -n scripts/gather/lib.sh:EXIT=0.shellcheck -x scripts/gather/lib.sh:EXIT=0.Deviations from the brief
30233672995do not match the current repository state or that run's actual artifact — reported above with verbatim evidence rather than silently re-deriving a different story..github/prompts/sre.md,src/,tests/, or any deploy workflow.🤖 Generated with Claude Code
https://claude.ai/code/session_01P41roCWN5Fec7m69sSaunU