Skip to content

[codex] Harden weekly metrics telemetry contracts - #1903

Merged
stranske merged 2 commits into
mainfrom
codex/workflows-review-controls-20260426b
Apr 26, 2026
Merged

[codex] Harden weekly metrics telemetry contracts#1903
stranske merged 2 commits into
mainfrom
codex/workflows-review-controls-20260426b

Conversation

@stranske

@stranske stranske commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Source: Issue #1836

Related to campaign issue #1836

Automated Status Summary

Scope

Sync/Dependabot Campaign Queue

Remote GitHub Actions owns discovery for sync-generated and Dependabot PR rounds. Local Codex should only claim items from this issue when needs-local-codex work is queued.

Summary

Context for Agent

Related Issues/PRs

Tasks

  • Updated: 2026-04-26T13:55:31.783Z
  • Repos checked: 11/11
  • Open sync PRs: 461
  • Open Dependabot PRs: 0
  • Active review threads queued: 710
  • Items needing local Codex: 0
  • Actionable local Codex items: 0
  • Claimable local Codex items: 0
  • Source-fixed candidates: 0
  • Superseded sync candidates: 120
  • Finished local results without published source changes: 0
  • Claimed local Codex items: 0
  • Next claim lease expires: -

Acceptance criteria

  • Status: local-codex-superseded-sync-candidate
  • Source repo: stranske/Workflows
  • Source sync state: superseded (PR a3e3f6fa23d5 / current ede2607c77be)
    • scripts/aggregate_agent_metrics.py:274 (copilot-pull-request-reviewer): The unsupported-model list is configured via UNSUPPORTED_VERIFIER_MODELS here, but the terminal-disposition coverage ...

Head SHA: a4d2a8d
Latest Runs: ✅ success — Gate
Required: gate: ✅ success

Workflow / Job Result Logs
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
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

@stranske-keepalive

Copy link
Copy Markdown
Contributor

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

@stranske-keepalive

stranske-keepalive Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: f08eca1
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / guard
Required: core tests (3.12): ⏳ pending, core tests (3.13): ⏳ 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

Sync/Dependabot Campaign Queue

Remote GitHub Actions owns discovery for sync-generated and Dependabot PR rounds. Local Codex should only claim items from this issue when needs-local-codex work is queued.

Summary

Context for Agent

Related Issues/PRs

Tasks

  • Updated: 2026-04-26T13:55:31.783Z
  • Repos checked: 11/11
  • Open sync PRs: 461
  • Open Dependabot PRs: 0
  • Active review threads queued: 710
  • Items needing local Codex: 0
  • Actionable local Codex items: 0
  • Claimable local Codex items: 0
  • Source-fixed candidates: 0
  • Superseded sync candidates: 120
  • Finished local results without published source changes: 0
  • Claimed local Codex items: 0
  • Next claim lease expires: -

Acceptance criteria

  • Status: local-codex-superseded-sync-candidate
  • Source repo: stranske/Workflows
  • Source sync state: superseded (PR a3e3f6fa23d5 / current ede2607c77be)
    • scripts/aggregate_agent_metrics.py:274 (copilot-pull-request-reviewer): The unsupported-model list is configured via UNSUPPORTED_VERIFIER_MODELS here, but the terminal-disposition coverage ...

@stranske-keepalive

stranske-keepalive Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

🤖 Keepalive Loop Status

PR #1903 | 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/4 complete
Timeout 45 min (default)
Timeout usage 5m elapsed (13%, 40m 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). |

@stranske-keepalive

stranske-keepalive Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor
Keepalive Work Log (click to expand)
# Time (UTC) Agent Action Result Files Tasks Progress Commit Gate
0 2026-04-26 15:37:13 Codex wait (missing-agent-label-transient) skipped 0 0/10 cancelled
0 2026-04-26 15:37:49 Codex wait (missing-agent-label-transient) skipped 0 0/10 cancelled
0 2026-04-26 15:40:39 Codex wait (missing-agent-label-transient) skipped 0 0/12 failure
0 2026-04-26 15:43:24 Codex wait (missing-agent-label-transient) skipped 0 0/12 success
0 2026-04-26 16:10:43 Codex wait (missing-agent-label-transient) skipped +8 0/4 success

@stranske
stranske marked this pull request as ready for review April 26, 2026 16:04
Copilot AI review requested due to automatic review settings April 26, 2026 16:04
@stranske
stranske merged commit 14c2b66 into main Apr 26, 2026
56 of 57 checks passed
@stranske
stranske deleted the codex/workflows-review-controls-20260426b branch April 26, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Hardens the weekly metrics telemetry contracts by bounding legacy pretty-JSON fallback buffering during metrics aggregation and extending the artifact-selection contract so downstream telemetry (terminal-disposition coverage) can preserve “latest candidate” metadata across legacy/new report shapes.

Changes:

  • Add bounded legacy pretty-JSON fallback buffering in _read_ndjson() (lines + bytes) and emit a buffer-limit parse error.
  • Extend weekly metrics artifact selection output with latest_candidate_by_family and update terminal-disposition coverage to read it (and a legacy spelling).
  • Mirror shared script changes into the consumer template and add focused regression tests; apply Black-driven formatting fixes.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/aggregate_agent_metrics.py Bounds legacy pretty-JSON fallback buffering; emits buffer-limit parse error telemetry.
templates/consumer-repo/scripts/aggregate_agent_metrics.py Mirrors the aggregation hardening into the consumer template.
tests/scripts/test_aggregate_agent_metrics.py Adds regression coverage for the legacy fallback buffer limit behavior.
.github/scripts/weekly_metrics_artifacts.js Adds latest_candidate_by_family to the selection report and exports helper.
templates/consumer-repo/.github/scripts/weekly_metrics_artifacts.js Mirrors the selection contract changes into the consumer template.
.github/scripts/terminal_disposition_coverage.js Preserves latest-candidate metadata by consuming new/legacy selection-map fields.
templates/consumer-repo/.github/scripts/terminal_disposition_coverage.js Mirrors terminal coverage contract handling into the consumer template.
.github/scripts/__tests__/weekly-metrics-artifacts.test.js Adds assertions for latest_candidate_by_family and a unit test for helper mapping.
.github/scripts/__tests__/terminal-disposition-coverage.test.js Adds regression test for legacy latest-candidate maps normalization.
scripts/repo_review_evaluator.py Formatting-only changes to satisfy Black gate.
tests/scripts/test_repo_review_evaluator.py Formatting-only change to satisfy Black gate.
Comments suppressed due to low confidence (2)

scripts/aggregate_agent_metrics.py:208

  • _read_ndjson() still appends a ParseErrorDetail for every invalid JSON line. For a very large malformed metrics file this can still consume unbounded memory (even though the pretty-JSON fallback buffer is now bounded), since file_errors grows with the number of lines. Consider capping stored error details (e.g., keep only the first N details plus a final "details-truncated" sentinel) while separately tracking total error counts/counters so the JSON/markdown contract can still report accurate totals.
                try:
                    parsed = json.loads(raw)
                except json.JSONDecodeError:
                    file_errors.append(_parse_error_detail(path, line_number, "invalid-json"))
                    continue

templates/consumer-repo/scripts/aggregate_agent_metrics.py:208

  • _read_ndjson() still accumulates a ParseErrorDetail per invalid JSON line in file_errors. A sufficiently large malformed metrics file can therefore still drive unbounded memory growth despite the new bounds on the legacy pretty-JSON fallback buffer. Consider capping stored error details (keeping only the first N + a truncation sentinel) while tracking total error counts separately so reporting remains accurate.
                try:
                    parsed = json.loads(raw)
                except json.JSONDecodeError:
                    file_errors.append(_parse_error_detail(path, line_number, "invalid-json"))
                    continue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants