Skip to content

[codex] Preserve weekly freshness selection state - #1915

Merged
stranske merged 1 commit into
mainfrom
codex/weekly-freshness-state
Apr 26, 2026
Merged

[codex] Preserve weekly freshness selection state#1915
stranske merged 1 commit into
mainfrom
codex/weekly-freshness-state

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-26T19:20:05.058Z
  • Repos checked: 11/11
  • Open sync PRs: 571
  • Open Dependabot PRs: 0
  • Active review threads queued: 1159
  • Items needing local Codex: 0
  • Actionable local Codex items: 0
  • Claimable local Codex items: 0
  • Source-fixed candidates: 1
  • Superseded sync candidates: 119
  • Finished local results without published source changes: 0
  • Claimed local Codex items: 1
  • Next claim lease expires: 2026-04-26T19:53:31Z

Acceptance criteria

Head SHA: 22ea4e0
Latest Runs: ⏹️ cancelled — Gate
Required: gate: ⏹️ cancelled

Workflow / Job Result Logs
Agents Auto-Pilot ⏭️ skipped View run
Agents Bot Comment Handler ✅ success View run
Agents Keepalive Loop ⏹️ cancelled View run
Agents Verifier ✅ success View run
Auto-label Dependabot PRs ⏭️ skipped View run
CI Autofix Loop ⏹️ cancelled View run
Copilot code review ✅ success View run
Create Issue from Verification (Enhanced) ⏭️ skipped View run
Create New PR from Verification ⏭️ skipped View run
Gate ⏹️ cancelled View run
Health 40 Sweep ✅ success View run
Health 44 Gate Branch Protection ✅ success View run
Health 45 Agents Guard ⏹️ cancelled 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

stranske-keepalive Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: 3ed0313
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

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

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

This PR improves the reliability and debuggability of the weekly Codex freshness + weekly metrics pipelines by (1) isolating the npm cache used for the Codex CLI freshness probe and (2) persisting richer “artifact selection” state into the weekly metrics download manifest (and therefore the aggregated weekly JSON contract), with the same manifest changes synced into the consumer template copy.

Changes:

  • Force check_codex_cli_freshness.query_latest_npm_version() to always use a temporary, isolated NPM_CONFIG_CACHE directory even if the runner environment provides one.
  • Extend weekly metrics download manifest selection to preserve priority-family selection details (candidate counts, family counts, statuses, latest-candidate map) via a new compactSelectionDetails helper.
  • Update/extend Python + Node tests to assert the new behaviors and exported helper; sync the manifest helper change into templates/consumer-repo.

Reviewed changes

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

Show a summary per file
File Description
scripts/check_codex_cli_freshness.py Always overrides NPM_CONFIG_CACHE to an isolated temp dir for npm queries.
tests/scripts/test_check_codex_cli_freshness.py Adds coverage ensuring the npm cache override occurs even when NPM_CONFIG_CACHE is inherited.
.github/scripts/weekly_metrics_download_manifest.js Adds compactSelectionDetails() and uses it when building the manifest selection block; exports helper.
templates/consumer-repo/.github/scripts/weekly_metrics_download_manifest.js Template-synced copy of the same manifest selection compaction/preservation change.
.github/scripts/__tests__/weekly-metrics-download-manifest.test.js Expands fixtures/assertions for preserved selection state and tests compactSelectionDetails().
tests/scripts/test_aggregate_agent_metrics.py Updates expected aggregated JSON contract to include richer manifest selection metadata.

Comment on lines +51 to +53
candidate_family_counts: selection.candidate_family_counts || {},
selected_family_counts: selection.selected_family_counts || {},
missing_priority_families: Array.isArray(selection.missing_priority_families)

Copilot AI Apr 26, 2026

Copy link

Choose a reason for hiding this comment

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

candidate_family_counts and selected_family_counts are passed through with || {}, which still allows non-object truthy values (e.g., arrays/strings) to leak into the manifest. Since this is part of a JSON contract, please validate these fields are plain objects (non-null, non-array) and fall back to {} (optionally shallow-clone) when the selector report is malformed; apply the same guard to latest_candidate_by_family.

Copilot uses AI. Check for mistakes.
Comment on lines +51 to +53
candidate_family_counts: selection.candidate_family_counts || {},
selected_family_counts: selection.selected_family_counts || {},
missing_priority_families: Array.isArray(selection.missing_priority_families)

Copilot AI Apr 26, 2026

Copy link

Choose a reason for hiding this comment

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

candidate_family_counts and selected_family_counts are passed through with || {}, which still allows non-object truthy values (e.g., arrays/strings) to leak into the manifest. Since this is part of a JSON contract, please validate these fields are plain objects (non-null, non-array) and fall back to {} (optionally shallow-clone) when the selector report is malformed; apply the same guard to latest_candidate_by_family.

Copilot uses AI. Check for mistakes.
@stranske
stranske merged commit 9a17c45 into main Apr 26, 2026
109 of 115 checks passed
@stranske
stranske deleted the codex/weekly-freshness-state branch April 26, 2026 19:43
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