Skip to content

fix(portfolio-truth): derive the security cohort at the plan instant - #275

Closed
saagpatel wants to merge 1 commit into
mainfrom
codex/cohort-plan-clock
Closed

saagpatel wants to merge 1 commit into
mainfrom
codex/cohort-plan-clock

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

portfolio-maintenance failed on 2026-10-11 at 2 AM PT: the 01:30 cohort plan and the 02:00 R3 recomputation derived attention at different instants, and a repo crossed the 30-day recent/stale cliff in between. The collector now records the plan's generated_at in the receipt transition; publication derives candidate (R3) and final (R5) attention at that instant. Freshness, observation times and snapshot generated_at stay on the publication clock; older receipts keep wall-clock derivation; exact set equality still rejects real membership changes. Checks: ruff clean, 3652 passed. Astra r1: ship.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T10:55:24.811938Z baed8f0 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: baed8f092b

ℹ️ 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 on lines +2787 to +2790
if "plan_generated_at" in transition:
_parse_datetime(
transition["plan_generated_at"],
field_name="cohort.transition.plan_generated_at",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Bound the plan clock to receipt creation

When the collector is given an old but otherwise valid plan, this check accepts its timestamp without bounding it against the newly produced receipt. The receipt can therefore be fresh while publication rewinds all recency derivation to an arbitrarily old instant, allowing a repository that is stale today to remain classified as recent and omitted from the current security cohort. Reject future timestamps and plans older than the permitted collection interval, or bind the plan age to produced_at, before this value can drive canonical PortfolioTruth.

AGENTS.md reference: src/AGENTS.md:L5-L10

Useful? React with 👍 / 👎.

@saagpatel

Copy link
Copy Markdown
Owner Author

Superseded by #274, which fixes the same clock race (and adds pending-coverage reporting and R3 diagnostics). Closing as a duplicate.

@saagpatel saagpatel closed this Oct 11, 2026
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