Skip to content

fix: resolve 8 issues found in Codex run log audit#1480

Merged
stranske merged 4 commits intomainfrom
fix/codex-log-issues
Feb 12, 2026
Merged

fix: resolve 8 issues found in Codex run log audit#1480
stranske merged 4 commits intomainfrom
fix/codex-log-issues

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Feb 12, 2026

Source: Issue #1

Automated Status Summary

Scope

scripts/validate_fast.sh contains 12 TODO Phase 4 markers referencing Trend_Model_Project-specific features (SRC_FILES detection, autofix tests, coverage requirements) that are not applicable to this workflow repository. These dead code paths and stale references cause confusion and add maintenance burden.

Tasks

  • Remove all TODO Phase 4 markers and their associated dead/commented code blocks.
  • Remove SRC_FILES and AUTOFIX_FILES detection logic that references src/ directory patterns not present in this repo.
  • Update linting targets to use scripts/ and .github/ instead of src/ tests/.
  • Replace Python package-specific validation (coverage requirements, import tests) with workflow-specific checks (actionlint, YAML validation).
  • Ensure the script still runs successfully after cleanup.

Acceptance criteria

  • grep -c "TODO Phase" scripts/validate_fast.sh returns 0.
  • Script executes without errors: bash scripts/validate_fast.sh --help works.
  • No references to src/ directory or Trend_Model_Project-specific patterns remain.
  • Validation targets are appropriate for a workflow repository (scripts/, .github/).

Head SHA: 8499bfa
Latest Runs: ✅ success — Gate
Required: gate: ✅ success

Workflow / Job Result Logs
Agents PR meta manager ❔ in progress 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
Health 72 Template Sync ✅ success View run
Health 73 Template Completeness ✅ success View run
Health 74 Template Drift ✅ success View run
Keepalive E2E ✅ 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

Essential fixes:
- Reporter sparse-checkout: add .github/actions to checkout so setup-api-client
  action is available (was failing 100% on Workflows repo)
- Belt Worker: re-install API client after branch checkout wipes node_modules
  (was causing @octokit/rest import failures and degraded token rotation)

High-value fixes:
- LLM analysis outputs: use print(..., end='') to strip trailing newlines from
  python extraction (confidence values had '\n' suffix e.g. '0.63\n')
- Repo variables fetch: downgrade from core.info to core.debug since the token
  permission limitation is known and the fallback to defaults works correctly

Medium fixes:
- Health 75 API Rate Diagnostic: pass secrets to 4 setup-api-client calls that
  were missing the input, causing 'No tokens were exported' warnings
- datetime.utcnow(): replace deprecated calls with timezone-aware alternative
  in both Belt Worker ledger functions

Low-salience fixes:
- error_classifier: gate entry log behind RUNNER_DEBUG to reduce log noise
- Non-artifact commit warning: downgrade from warning to notice since it is
  expected behavior when Codex produces only workflow artifacts
Copilot AI review requested due to automatic review settings February 12, 2026 01:02
@stranske stranske temporarily deployed to agent-high-privilege February 12, 2026 01:03 — with GitHub Actions Inactive
@agents-workflows-bot
Copy link
Copy Markdown
Contributor

agents-workflows-bot bot commented Feb 12, 2026

Automated Status Summary

Head SHA: 941cfde
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / guard
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 93.12%
Baseline 85.00%
Delta +8.12%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
src/cli_parser.py 81.8% 4
src/percentile_calculator.py 95.0% 1
src/aggregator.py 95.0% 2
src/__init__.py 100.0% 0
src/ndjson_parser.py 100.0% 0

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


Keepalive checklist

Scope

scripts/validate_fast.sh contains 12 TODO Phase 4 markers referencing Trend_Model_Project-specific features (SRC_FILES detection, autofix tests, coverage requirements) that are not applicable to this workflow repository. These dead code paths and stale references cause confusion and add maintenance burden.

Tasks

  • Remove all TODO Phase 4 markers and their associated dead/commented code blocks.
  • Remove SRC_FILES and AUTOFIX_FILES detection logic that references src/ directory patterns not present in this repo.
  • Update linting targets to use scripts/ and .github/ instead of src/ tests/.
  • Replace Python package-specific validation (coverage requirements, import tests) with workflow-specific checks (actionlint, YAML validation).
  • Ensure the script still runs successfully after cleanup.

Acceptance criteria

  • grep -c "TODO Phase" scripts/validate_fast.sh returns 0.
  • Script executes without errors: bash scripts/validate_fast.sh --help works.
  • No references to src/ directory or Trend_Model_Project-specific patterns remain.
  • Validation targets are appropriate for a workflow repository (scripts/, .github/).

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8121fffd3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@stranske-keepalive
Copy link
Copy Markdown
Contributor

stranske-keepalive bot commented Feb 12, 2026

🤖 Keepalive Loop Status

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

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Disposition skipped (transient)
Gate success
Tasks 0/9 complete
Timeout 45 min (default)
Timeout usage 3m elapsed (7%, 42m remaining)
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

Addresses multiple reliability and log-noise issues found during a Codex run log audit, primarily by ensuring required local actions/dependencies are available after checkouts and by tightening signal-to-noise in keepalive/Codex workflows.

Changes:

  • Fix missing local action availability and dependency loss across checkouts (Reporter sparse-checkout; Belt Worker re-install of API client).
  • Improve downstream data correctness and monitoring reliability (LLM analysis output formatting; Health 75 secrets passed to setup action; Python UTC deprecation fix).
  • Reduce expected/benign log noise (repo variables fetch message level; error classifier debug gating; warning→notice for “artifact-only” changes).

Reviewed changes

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

Show a summary per file
File Description
.github/workflows/agents-keepalive-loop-reporter.yml Adds .github/actions to sparse-checkout so setup-api-client can be found.
.github/workflows/agents-72-codex-belt-worker.yml Re-installs API client after branch checkout; replaces utcnow() usage in embedded Python ledger logic.
.github/workflows/reusable-codex-run.yml Removes trailing newlines from extracted LLM analysis fields; downgrades “no non-artifact changes” to notice.
.github/workflows/health-75-api-rate-diagnostic.yml Passes secrets + github_token inputs into setup-api-client in multiple jobs/locations.
.github/scripts/keepalive_loop.js Downgrades repo variables fetch failure logging to core.debug.
.github/scripts/error_classifier.js Gates classifier console logging behind RUNNER_DEBUG.
templates/consumer-repo/.github/workflows/agents-72-codex-belt-worker.yml Mirrors Belt Worker reinstall + UTC fix for consumer template.
templates/consumer-repo/.github/scripts/keepalive_loop.js Mirrors repo variables fetch logging downgrade for consumer template.
templates/consumer-repo/.github/scripts/error_classifier.js Mirrors RUNNER_DEBUG gating for consumer template.

Comment on lines +594 to +599
- name: Re-install API client after branch checkout
if: ${{ steps.parallel.outputs.allowed == 'true' && (inputs.keepalive != true || steps.keepalive_gate.outputs.action != 'skip') }}
uses: ./.github/actions/setup-api-client
with:
secrets: ${{ toJSON(secrets) }}
github_token: ${{ github.token }}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

setup-api-client sets GITHUB_TOKEN/GH_TOKEN based on the github_token input. Passing ${{ github.token }} here can override the earlier belt token selection (GH_BELT_TOKEN from the App/PAT) and reduce the effectiveness of the token load balancer. Consider passing ${{ env.GH_BELT_TOKEN || github.token }} to keep the exported default token aligned with the belt token.

Copilot uses AI. Check for mistakes.
1. Use .belt-tools action path instead of ./ for setup-api-client
   after branch checkout, so the action runs from trusted Workflows
   code rather than the untrusted issue branch (security fix).

2. Pass GH_BELT_TOKEN || github.token as github_token input to
   preserve the belt token selection instead of overriding
   GITHUB_TOKEN/GH_TOKEN with the default workflow token.
@stranske stranske temporarily deployed to agent-high-privilege February 12, 2026 01:27 — with GitHub Actions Inactive
…eshold

Two independent fixes for broken automation flows:

1. capability_check.py: The bare \bsecrets?\b regex matched negative
   mentions like 'no secrets' in issue constraint text, causing
   _requires_admin_access() to return true and the fallback classifier
   to BLOCK tasks that merely *describe* a no-secrets constraint.
   Replace with specific verb+secrets patterns (manage/configure/set/
   create/update/delete/add/modify/rotate secrets).
   Root cause of PAEM #1403 false-positive BLOCKED.

2. verdict_policy.py: CONCERNS_NEEDS_HUMAN_THRESHOLD lowered from 0.85
   to 0.50.  The old threshold meant any split verdict (PASS + CONCERNS)
   with <85% confidence on the concerns side triggered needs_human,
   blocking automatic follow-up issue creation.  A 72% confidence
   concerns verdict (TMP #4894) is well above chance and should produce
   a follow-up rather than require manual triage.

Both template and main copies updated; new regression tests added.
@stranske stranske temporarily deployed to agent-high-privilege February 12, 2026 02:48 — with GitHub Actions Inactive
@stranske stranske temporarily deployed to agent-high-privilege February 12, 2026 02:50 — with GitHub Actions Inactive
@github-actions github-actions bot added the autofix Opt-in automated formatting & lint remediation label Feb 12, 2026
@stranske stranske merged commit cbf4573 into main Feb 12, 2026
167 checks passed
@stranske stranske deleted the fix/codex-log-issues branch February 12, 2026 03:01
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