Skip to content

fix: Update decode_raw_input.py to pass ruff lint in consumer repos#235

Merged
stranske merged 3 commits intomainfrom
fix/decode-raw-input-ruff
Dec 28, 2025
Merged

fix: Update decode_raw_input.py to pass ruff lint in consumer repos#235
stranske merged 3 commits intomainfrom
fix/decode-raw-input-ruff

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Dec 28, 2025

Automated Status Summary

Scope

  • Scope section missing from source issue.

Tasks

  • Tasks section missing from source issue.

Acceptance criteria

  • Acceptance criteria section missing from source issue.
  • Head SHA: cc5b478
  • Latest Runs: ✅ success — Gate
  • Required: gate: ✅ success
  • | Workflow / Job | Result | Logs |
  • |----------------|--------|------|
  • | Agents PR meta manager | ❔ in progress | View run |
  • | CI Autofix Loop | ✅ success | View run |
  • | Copilot code review | ✅ success | View run |
  • | Gate | ✅ success | View run |
  • | Health 40 Sweep | ✅ success | View run |
  • | Health 44 Gate Branch Protection | ✅ success | View run |
  • | Health 45 Agents Guard | ✅ success | View run |
  • | Health 50 Security Scan | ✅ success | View run |
  • | Maint 52 Validate Workflows | ✅ success | View run |
  • | PR 11 - Minimal invariant CI | ✅ success | View run |
  • | Selftest CI | ✅ success | View run |

Head SHA: beebaeb
Latest Runs: ⏳ queued — Gate
Required: gate: ⏳ queued

Workflow / Job Result Logs
Agents PR meta manager ❔ in progress View run
CI Autofix Loop ❔ in progress View run
Copilot code review ❔ in progress View run
Gate ⏳ queued View run
Health 40 Sweep ✅ success View run
Health 44 Gate Branch Protection ❔ in progress View run
Health 45 Agents Guard ✅ success View run
Health 50 Security Scan ❔ in progress View run
Maint 52 Validate Workflows ✅ success View run
PR 11 - Minimal invariant CI ✅ success View run
Selftest CI ❔ in progress View run

- Use ternary operator instead of if-else block (SIM108)
- Use modern type annotations: list, dict, tuple instead of List, Dict, Tuple (UP006)

Consumer repos like Travel-Plan-Permission have stricter ruff configs that
flagged these issues during the sync PR CI.
Copilot AI review requested due to automatic review settings December 28, 2025 00:22
@github-actions github-actions bot added autofix:clean Clean autofix and removed autofix:clean Clean autofix labels Dec 28, 2025
@agents-workflows-bot
Copy link
Copy Markdown
Contributor

⚠️ Action Required: Unable to determine source issue for PR #235. The PR title, branch name, or body must contain the issue number (e.g. #123, branch: issue-123, or the hidden marker ).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 28, 2025

Status | ✅ no new diagnostics
History points | 1
Timestamp | 2025-12-28 01:06:51 UTC
Report artifact | autofix-report-pr-235
Remaining | 0
New | 0
No additional artifacts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates .github/scripts/decode_raw_input.py to comply with stricter ruff linting rules used in consumer repositories. The changes are purely stylistic and maintain the same functionality while adhering to modern Python type annotation standards and simpler control flow patterns.

  • Replaced typing module classes (List, Dict, Tuple) with modern built-in generic types (list, dict, tuple)
  • Simplified conditional assignment using a ternary operator instead of if-else block

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 28, 2025

Automated Status Summary

Head SHA: 60a269b
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / Enforce agents workflow protections
Required: core tests (3.11): ⏳ pending, core tests (3.12): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 77.97%
Baseline 0.00%
Delta +77.97%
Minimum 70.00%
Status ✅ Pass

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

  • Scope section missing from source issue.

Tasks

  • Tasks section missing from source issue.

Acceptance criteria

  • Acceptance criteria section missing from source issue.
  • [ ]

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 28, 2025

🤖 Keepalive Loop Status

PR #235 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Gate success
Tasks 0/18 complete
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

@github-actions github-actions bot added autofix:clean Clean autofix and removed autofix:clean Clean autofix labels Dec 28, 2025
@github-actions github-actions bot added autofix:clean Clean autofix and removed autofix:clean Clean autofix labels Dec 28, 2025
@stranske stranske merged commit 4db211d into main Dec 28, 2025
36 checks passed
@stranske stranske deleted the fix/decode-raw-input-ruff branch December 28, 2025 01:07
stranske pushed a commit that referenced this pull request Feb 24, 2026
When all tasks were complete but Gate was failing (e.g., lint-ruff),
the keepalive loop would stop after `complete_gate_failure_rounds`
reached its max, without giving fix attempts a fair chance. Three
interacting issues caused this:

1. The `complete-gate-failure-max` check fired BEFORE the fix
   classification logic in the decision tree, blocking fix attempts
   once the counter reached the max.

2. Transient gate states (cancelled) incremented the counter even
   though they don't represent actual fix failures, consuming the
   fix budget with infrastructure noise.

3. The `consecutive_fix_rounds` counter was reset on wait/stop
   actions, losing track of prior fix attempts.

Changes:
- Restructure evaluate decision tree: handle cancelled gates first
  (without consuming fix budget), then try fix before stopping when
  all tasks complete and gate failing
- Only increment complete_gate_failure_rounds on actual agent
  execution rounds (fix/run/conflict), not on wait/skip/stop
- Preserve consecutive_fix_rounds across wait/stop/defer actions
  (only reset on non-fix agent execution)
- Increase default completeGateFailureMax from 2 to 3, allowing
  2 fix attempts before stopping
- Add 10 focused tests for counter behavior

Fixes the issue seen in Counter_Risk PR #235 where the agent
completed all 27 tasks but stopped with complete-gate-failure-max
despite lint-ruff failures that could have been fixed.

https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL
stranske added a commit that referenced this pull request Feb 24, 2026
* fix: correct tasksTotal falsy check and stale iteration in keepalive loop

- Use nullish coalescing (??) instead of logical OR (||) for tasksTotal
  in work-log table rows so that 0 displays as "0" instead of "?"
- Use previousState?.iteration ?? iteration instead of bare iteration
  in rounds_without_task_completion recalculation to stay consistent
  with the "current persisted iteration" rule (line 2739-2741)

Both fixes address review feedback from Copilot on Counter_Risk PR #234.

https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL

* fix: prevent keepalive from stopping without fixing CI failures

When all tasks were complete but Gate was failing (e.g., lint-ruff),
the keepalive loop would stop after `complete_gate_failure_rounds`
reached its max, without giving fix attempts a fair chance. Three
interacting issues caused this:

1. The `complete-gate-failure-max` check fired BEFORE the fix
   classification logic in the decision tree, blocking fix attempts
   once the counter reached the max.

2. Transient gate states (cancelled) incremented the counter even
   though they don't represent actual fix failures, consuming the
   fix budget with infrastructure noise.

3. The `consecutive_fix_rounds` counter was reset on wait/stop
   actions, losing track of prior fix attempts.

Changes:
- Restructure evaluate decision tree: handle cancelled gates first
  (without consuming fix budget), then try fix before stopping when
  all tasks complete and gate failing
- Only increment complete_gate_failure_rounds on actual agent
  execution rounds (fix/run/conflict), not on wait/skip/stop
- Preserve consecutive_fix_rounds across wait/stop/defer actions
  (only reset on non-fix agent execution)
- Increase default completeGateFailureMax from 2 to 3, allowing
  2 fix attempts before stopping
- Add 10 focused tests for counter behavior

Fixes the issue seen in Counter_Risk PR #235 where the agent
completed all 27 tasks but stopped with complete-gate-failure-max
despite lint-ruff failures that could have been fixed.

https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL

* chore: sync template scripts

* fix: address review comments on PR #1651

1. Fix infinite wait loop for non-fixable gate failures: remove
   `isAgentExecution` requirement from counter increment — the
   `gateActuallyFailed` check already filters transient states
   (cancelled/pending), so the counter advances on every genuine
   failure round regardless of action type.

2. Sync template keepalive_loop.js with all main file changes:
   - Restructured evaluate decision tree (cancelled → allComplete → remaining)
   - Updated counter logic (increment on actual failure, preserve on non-success)
   - Fix round preservation across wait/stop/defer actions
   - Default completeGateFailureMax 2 → 3

3. Add test for the non-fixable wait+failure scenario; update
   stop-action test expectation to match new counter semantics.

https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL

* fix: update test to expect gate-cancelled-transient reason

The cancelled gate test expected 'gate-cancelled' but the code now
returns 'gate-cancelled-transient' for non-rate-limit cancellations.
Updated the assertion to match.

https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants