Skip to content

fix(portfolio-truth): reconcile GitHub archived status#131

Merged
saagpatel merged 1 commit into
mainfrom
codex/ghra-archived-status-reconcile
Jul 3, 2026
Merged

fix(portfolio-truth): reconcile GitHub archived status#131
saagpatel merged 1 commit into
mainfrom
codex/ghra-archived-status-reconcile

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

What

  • Overlays GitHub archived metadata into portfolio truth generation.
  • Falls back to latest audit-report metadata when live repo status is unavailable.
  • Adds regression coverage for archived repos becoming archived attention, not decision-needed noise.

Why

  • Archived GitHub repos should not stay active in the portfolio attention surface just because local catalog metadata is stale.

How

  • Reuses the existing GitHub client and response cache in the portfolio-truth CLI path.
  • Carries a small repo-status overlay into reconciliation and records provenance as github.archived.
  • Keeps this out of Notion/dialect identity logic.

Testing

  • uv run pytest tests/test_portfolio_truth.py -q
  • uv run pytest -q
  • uv run ruff check .
  • uv run python -m src.cli report saagpatel --portfolio-truth --portfolio-truth-allow-empty-notion

Performance Impact

  • One existing paginated repo-list call during portfolio-truth generation when live GitHub access is available; falls back to local audit metadata on failure.

Risk / Notes

  • Live run generated portfolio truth for 161 projects and reported 15 GitHub-archived repos in the source summary.

- 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 .
@saagpatel
saagpatel merged commit 37299dd into main Jul 3, 2026
4 checks passed
@saagpatel
saagpatel deleted the codex/ghra-archived-status-reconcile branch July 3, 2026 09:37

@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: 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".

Comment thread src/cli.py
token=getattr(args, "token", None),
cache=None if getattr(args, "no_cache", False) else ResponseCache(),
)
if repo_status_by_name is None:

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 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 👍 / 👎.

Comment on lines +384 to +385
repo_name = (repo_full_name or "").rsplit("/", 1)[-1]
return lookup.get(repo_name) or lookup.get(display_name)

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 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 👍 / 👎.

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