fix(portfolio-truth): reconcile GitHub archived status#131
Conversation
- Overlay live GitHub archived metadata when building portfolio truth. - Fall back to latest audit report metadata if live status is unavailable. - Add regression coverage for archived repo attention reconciliation. Tests: uv run pytest tests/test_portfolio_truth.py -q; uv run pytest -q; uv run ruff check .
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a71e96b3ec
ℹ️ 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".
| token=getattr(args, "token", None), | ||
| cache=None if getattr(args, "no_cache", False) else ResponseCache(), | ||
| ) | ||
| if repo_status_by_name is None: |
There was a problem hiding this comment.
Fall back when live repo data is partial
When --portfolio-truth runs without an owner-scoped token, or with a token for a different user, GitHubClient.list_repos() still succeeds via the public /users/{username}/repos path and returns only public repos rather than None. Because the audit-report fallback only runs on None, archived private repos present in the local workspace and in the last authenticated audit report get no status overlay and can remain active/decision-needed. Consider merging the audit-report overlay for repos missing from the live result, or only treating live data as authoritative when it is owner-private.
Useful? React with 👍 / 👎.
| repo_name = (repo_full_name or "").rsplit("/", 1)[-1] | ||
| return lookup.get(repo_name) or lookup.get(display_name) |
There was a problem hiding this comment.
Match archived status by full name first
When the workspace contains a checkout from another owner whose repo basename matches one of the audited user's repos, this lookup still uses only the basename/display name, so other/Alpha can inherit saagpatel/Alpha's archived flag and be forced into archived attention incorrectly. The status entries already carry full_name; key and select by the full owner/repo before falling back to basename-only matching.
Useful? React with 👍 / 👎.
What
Why
How
Testing
Performance Impact
Risk / Notes