Skip to content

fix: keep portfolio registry notes idempotent#151

Merged
saagpatel merged 1 commit into
mainfrom
codex/fix-portfolio-notes-idempotence
Jul 4, 2026
Merged

fix: keep portfolio registry notes idempotent#151
saagpatel merged 1 commit into
mainfrom
codex/fix-portfolio-notes-idempotence

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

Summary

  • Strip generated purpose prefixes from legacy registry notes during portfolio truth reconciliation
  • Add a regression test for repeated generated purpose text in registry notes
  • Regenerated live portfolio truth locally and confirmed the GithubRepoAuditor notes field no longer accumulates repeated prose

Verification

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

@saagpatel
saagpatel merged commit ae947bf into main Jul 4, 2026
4 checks passed
@saagpatel
saagpatel deleted the codex/fix-portfolio-notes-idempotence branch July 4, 2026 12:16

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

ℹ️ 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 +813 to +814
while value == purpose or value.startswith(f"{purpose} "):
value = value[len(purpose) :].strip()

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 Preserve manual notes that start with the purpose

Because this normalization now runs for every legacy_registry_path, not just registries known to be generated by portfolio_truth_render, a hand-maintained legacy row whose Notes text legitimately begins with the repo/group purpose gets rewritten in the canonical snapshot. For example, with purpose API migration and notes API migration blocked on auth, the loop removes the leading phrase and stores only blocked on auth in declared.notes; scope the stripping to generated registry input or another unambiguous generated prefix so legacy source text is not silently lost.

Useful? React with 👍 / 👎.

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