Skip to content

Fix code quality issues and prevent useless follow-up issues#417

Merged
stranske merged 6 commits intomainfrom
fix/code-quality-issues
Jan 1, 2026
Merged

Fix code quality issues and prevent useless follow-up issues#417
stranske merged 6 commits intomainfrom
fix/code-quality-issues

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Jan 1, 2026

Source: Issue #415

Automated Status Summary

Scope

Address unmet acceptance criteria from PR #413.

Tasks

  • Review verifier output and determine necessary tasks

Acceptance criteria

  • Acceptance criteria section missing from source issue.

Head SHA: c6aca42
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
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
Validate Sync Manifest ✅ success View run

Copilot AI review requested due to automatic review settings January 1, 2026 07:05
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@stranske stranske temporarily deployed to agent-high-privilege January 1, 2026 07:05 — with GitHub Actions Inactive
@github-actions github-actions bot added the autofix Opt-in automated formatting & lint remediation label Jan 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 1, 2026

Status | ✅ no new diagnostics
History points | 1
Timestamp | 2026-01-01 07:32:30 UTC
Report artifact | autofix-report-pr-417
Remaining | 0
New | 0
No additional artifacts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 1, 2026

Automated Status Summary

Head SHA: 97723ab
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 92.21%
Baseline 85.00%
Delta +7.21%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
scripts/workflow_health_check.py 62.6% 28
scripts/classify_test_failures.py 62.9% 37
scripts/ledger_validate.py 65.3% 63
scripts/mypy_return_autofix.py 82.6% 11
scripts/ledger_migrate_base.py 85.5% 13
scripts/fix_cosmetic_aggregate.py 92.3% 1
scripts/coverage_history_append.py 92.8% 2
scripts/workflow_validator.py 93.3% 4
scripts/update_autofix_expectations.py 93.9% 1
scripts/pr_metrics_tracker.py 95.7% 3
scripts/generate_residual_trend.py 96.6% 1
scripts/build_autofix_pr_comment.py 97.0% 2
scripts/aggregate_agent_metrics.py 97.2% 0
scripts/fix_numpy_asserts.py 98.1% 0
scripts/sync_test_dependencies.py 98.3% 1

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


Keepalive checklist

Scope

Address unmet acceptance criteria from PR #413.

Tasks

  • Review verifier output and determine necessary tasks

Acceptance criteria

  • Acceptance criteria section missing from source issue.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 1, 2026

🤖 Keepalive Loop Status

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

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Gate success
Tasks 0/2 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). |

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 addresses code quality issues identified in Copilot reviews and fixes a bug where the Agent Verifier created useless follow-up issues when source PRs/issues lacked acceptance criteria.

Key Changes:

  • Fixed tomlkit compatibility issues in Python script using duck-typing
  • Removed redundant ternary operators and fixed indentation in workflow files
  • Added isMissingInfoGap() function to filter out non-actionable verifier gaps
  • Added 7 new tests covering the verifier fix

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/resolve_mypy_pin.py Fixed tomlkit compatibility using hasattr for duck-typing and added type validation
templates/consumer-repo/.github/workflows/agents-guard.yml Removed one redundant ternary operator in rate limit handling
templates/consumer-repo/.github/scripts/agents-guard.js Fixed indentation and removed redundant array reassignment
docs/archive/CODE_QUALITY_ISSUES_2026-01-01.md Archived code quality issues document with fix status
.github/workflows/agents-guard.yml Removed one redundant ternary operator in rate limit handling
.github/scripts/verifier_issue_formatter.js Added isMissingInfoGap function to prevent creating follow-up issues for missing source info
.github/scripts/keepalive_loop.js Fixed typo in numbered list comment
.github/scripts/agents-guard.js Fixed indentation and removed redundant array reassignment
.github/scripts/tests/verifier-issue-formatter.test.js Added 7 tests for isMissingInfoGap function and integration scenarios

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

stranske added a commit that referenced this pull request Jan 1, 2026
1. Remove redundant /i regex flags in isMissingInfoGap() since text
   is already lowercased via .toLowerCase()

2. Improve numbered list comment in keepalive_loop.js to clarify
   both 1., 2., 3. and 1), 2), 3) formats are matched

3. Fix ALL remaining redundant ternary operators for Number() conversion:
   - agents-guard.yml (3 instances - lines 314, 442 fixed)
   - health-44-gate-branch-protection.yml (1 instance)
   - agents_pr_meta_update_body.js (1 instance)
   - templates/consumer-repo agents-guard.yml (2 instances)

4. Add missing tests for formatSimpleFollowUpIssue hasSubstantiveContent
   with missing info gaps (2 new test cases)
- Fix tomlkit isinstance checks - use hasattr for duck typing (#3)
- Add type validation for python_version before str() conversion (#6)
- Fix redundant ternary operators in agents-guard.yml (3 instances) (#1)
- Fix authorIsCodeowner indentation in agents-guard.js (#4)
- Fix inconsistent array indentation in agents-guard.js (#5)
- Remove redundant instructions=[] reassignment in agents-guard.js (#7)
- Fix typo in keepalive_loop.js numbered list comment (#9)

All fixes applied to both main files and templates/consumer-repo.
See docs/CODE_QUALITY_ISSUES.md for issue tracking.
Add isMissingInfoGap() to detect verifier gaps that are about missing
source info rather than actual verification failures. These gaps (like
'Provide explicit acceptance criteria in the PR description') indicate
the source issue/PR lacked structured criteria, not that verification
found actual problems.

Updated hasSubstantiveContent check to filter out these 'missing info'
gaps, preventing creation of follow-up issues when there's nothing
actionable to fix.

Fixes issue #415 scenario where follow-up issues were created despite
having only placeholder content because the verifier gaps were about
missing source info.

Added 7 new tests:
- isMissingInfoGap() unit tests
- Integration tests for hasSubstantiveContent with missing info gaps
Use dict() to normalize tomlkit Table objects with type: ignore[call-overload]
comments to satisfy mypy type checking while preserving duck-typing
compatibility with tomlkit's custom container types.

Fixes mypy errors:
  tools/resolve_mypy_pin.py:36: error: Item "None" has no attribute "get" [union-attr]
  tools/resolve_mypy_pin.py:39: error: Item "None" has no attribute "get" [union-attr]
Different mypy versions report different error codes for the same issue.
Use a combined ignore comment to handle both.
1. Remove redundant /i regex flags in isMissingInfoGap() since text
   is already lowercased via .toLowerCase()

2. Improve numbered list comment in keepalive_loop.js to clarify
   both 1., 2., 3. and 1), 2), 3) formats are matched

3. Fix ALL remaining redundant ternary operators for Number() conversion:
   - agents-guard.yml (3 instances - lines 314, 442 fixed)
   - health-44-gate-branch-protection.yml (1 instance)
   - agents_pr_meta_update_body.js (1 instance)
   - templates/consumer-repo agents-guard.yml (2 instances)

4. Add missing tests for formatSimpleFollowUpIssue hasSubstantiveContent
   with missing info gaps (2 new test cases)
@stranske stranske force-pushed the fix/code-quality-issues branch from 91e11f4 to c6aca42 Compare January 1, 2026 07:31
@stranske stranske temporarily deployed to agent-high-privilege January 1, 2026 07:31 — with GitHub Actions Inactive
@stranske stranske merged commit ac80d82 into main Jan 1, 2026
107 checks passed
@stranske stranske deleted the fix/code-quality-issues branch January 1, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autofix Opt-in automated formatting & lint remediation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants