Skip to content

fix: guard weekly command center freshness#152

Merged
saagpatel merged 1 commit into
mainfrom
codex/fix-weekly-source-freshness
Jul 4, 2026
Merged

fix: guard weekly command center freshness#152
saagpatel merged 1 commit into
mainfrom
codex/fix-weekly-source-freshness

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

Summary

  • Add source-freshness metadata to the weekly command-center digest
  • Suppress stale control-center queue advice when portfolio truth is newer than the audit report
  • Print a concise refresh decision instead of dumping stale queue pressure

Verification

  • /opt/homebrew/bin/python3.13 -m pytest tests/test_weekly_command_center.py tests/test_cli_hardening.py -q
  • /opt/homebrew/bin/python3.13 -m src.cli security-gate --output-dir output --max-age-hours 168 --json
  • /opt/homebrew/bin/python3.13 -m src.cli saagpatel --control-center

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

Copy link
Copy Markdown

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: e7f373a851

ℹ️ 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".

Comment thread src/cli.py
_parse_iso_dt(normalized.get("generated_at")) or datetime.now(timezone.utc),
)
json_artifact, md_artifact, weekly_json, weekly_md, _payload = _write_control_center_artifacts(
json_artifact, md_artifact, weekly_json, weekly_md, payload = _write_control_center_artifacts(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard generated control-center artifacts too

When portfolio-truth-latest.json is newer than the audit report, this call still writes the operator control-center JSON and Markdown from the stale snapshot before the new freshness check runs. The CLI suppresses the stale queue in stdout, but it immediately prints paths to artifacts whose operator_queue/What To Do Next still come from the older report, so opening the control-center artifact can act on the same queue the guard says to refresh.

Useful? React with 👍 / 👎.

)
truth = portfolio_truth or {}
freshness = _source_freshness(report_data, truth)
source_is_stale = freshness["status"] != "current"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Suppress automation candidates when sources are stale

When portfolio truth is newer than the report and the stale report's decision_quality_v1.decision_quality_status is trusted, the new guard only replaces the headline/decision text; the digest still passes that trusted stale status into select_automation_candidates, so the weekly Markdown can list repos under Automation Candidates while also saying to refresh before choosing a repo action. Treat the stale-source case as not trusted, or suppress the automation section along with the stale queue-derived fields.

Useful? React with 👍 / 👎.

@saagpatel
saagpatel merged commit c301ae6 into main Jul 4, 2026
4 checks passed
@saagpatel
saagpatel deleted the codex/fix-weekly-source-freshness branch July 4, 2026 12:30
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.

1 participant