Skip to content

fix: run_debate_cycle() counts a stance posted only if the GitHub writes succeeded - #590

Open
essentialbit wants to merge 2 commits into
mainfrom
fix/debate-stances-posted-count-checks-gh-post
Open

fix: run_debate_cycle() counts a stance posted only if the GitHub writes succeeded#590
essentialbit wants to merge 2 commits into
mainfrom
fix/debate-stances-posted-count-checks-gh-post

Conversation

@essentialbit

Copy link
Copy Markdown
Owner

Summary

  • run_debate_cycle() incremented summary["stances_posted"] unconditionally after attempting the comment + consensus-label _gh_post() calls, without checking either return value.
  • A dropped write (e.g. a transient GitHub API 503, same class of outage that motivated PR fix: retry _gh_post/_gh_delete once on transient network failure #588's _gh_post/_gh_delete retry) still counted as "posted" — the hourly cycle report could overstate what actually landed on the issue.
  • Now both _gh_post() calls must succeed (non-None return) for the stance to count; otherwise it's counted in errors instead.

Self-directed tooling fix — root cause flagged but left unfixed in a prior cycle's memory note (fredai.md, "Separate, not-yet-fixed correctness gap"), fixed now as its own small scoped PR per that note. Not routed through the debate/consensus pipeline since it's a correctness fix to the pipeline's own reporting, not a new capability proposal.

Test plan

  • python3 -c "from main import *" — import OK, no route/schema regressions
  • Scratch verification script (mocked _gh_post, deleted after use) covering 3 cases: both writes succeed → 1 posted/0 errors; comment write fails → 0 posted/1 error; label write fails → 0 posted/1 error. All pass.
  • CI (pending)

Saifodius and others added 2 commits August 17, 2026 12:29
…ting a stance as posted

Previously incremented stances_posted unconditionally after attempting the
comment+label posts, so a dropped write (e.g. GitHub 503 mid-outage) still
counted as "posted" — the cycle report could overstate what actually landed.
Now counts a stance as posted only if both the comment and label writes
succeeded; a partial/failed write increments errors instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant