fix: guard weekly command center freshness#152
Conversation
There was a problem hiding this comment.
💡 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".
| _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( |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Verification