Fix portfolio projection truth contracts#71
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6de825d08
ℹ️ 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".
| if full_name.rsplit("/", 1)[-1].lower() == checkout_key: | ||
| return full_name |
There was a problem hiding this comment.
Require matching owner before replacing archive origin
When a checkout has an archive/import origin plus a normal upstream remote under another owner, this loop accepts the upstream solely because its repo basename matches the local directory. That changes identity.repo_full_name to the upstream owner/repo, so downstream joins and automation keyed by repo_full_name can target the wrong GitHub repository; the archive repair should only auto-promote same-owner aliases (or an explicit canonical remote).
Useful? React with 👍 / 👎.
What
Fix the portfolio truth/projection contract lane by adding
notion_projection_policy.v2, truth-shadow row support, canonical remote identity selection, and a durable reconciliation note.Why
The live contract-health audit showed Notion projection drift and two portfolio truth identity mismatches where local archive/import remotes were winning over canonical public repo identities.
Review Of What Was Built
canonical, then normalorigin, while allowing archive/import origins to yield to a matching public remote.Cleanup Review
Verification Summary
uv run ruff check src/portfolio_truth_sources.py src/project_registry.py tests/test_portfolio_truth.py tests/test_project_registry.pyPYTHONDONTWRITEBYTECODE=1 uv run pytest tests/test_portfolio_truth.py tests/test_portfolio_truth_sources.py tests/test_project_registry.py -qcontract-healthpassed after the refreshed truth snapshot showed0 truth-only / 14 audit-only.Shipped Summary
Portfolio truth now maps
ApplyKitandGithubRepoAuditorto their public canonical repo identities, while private archive/import repos remain audit-only.Next Phase
Decide separately whether any remaining supplementary non-Projects audit-only surfaces should gain registry metadata. Do not promote them into first-class truth without explicit operator approval.
Remaining Roadmap
fable-outputsafter the June 22, 2026 campaign window.