Skip to content

[codex] fix portfolio truth Notion context mapping#68

Merged
saagpatel merged 2 commits into
mainfrom
codex/notion-context-mapping-fix-2026-06-14
Jun 14, 2026
Merged

[codex] fix portfolio truth Notion context mapping#68
saagpatel merged 2 commits into
mainfrom
codex/notion-context-mapping-fix-2026-06-14

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

Summary

  • add Notion title aliases for GitHub Repo Auditor, MCP Audit, and Notion operating spellings
  • resolve Notion export project mappings through exact and normalized aliases
  • guard portfolio truth publishing against silently replacing existing Notion context rows with zero rows

Verification

  • uv run pytest tests/test_notion_export.py tests/test_notion_registry.py tests/test_portfolio_truth.py tests/test_project_registry.py -q
  • git diff --check HEAD^ HEAD

Notes

  • This is the clean follow-up branch containing only the Notion context mapping fix from the preserved local branch, rebased onto current canonical/main.

@saagpatel saagpatel marked this pull request as ready for review June 14, 2026 09:37
@saagpatel saagpatel merged commit b4e26d4 into main Jun 14, 2026
3 checks passed
@saagpatel saagpatel deleted the codex/notion-context-mapping-fix-2026-06-14 branch June 14, 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: 7294001ba8

ℹ️ 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".



def _notion_project_context_configured() -> bool:
path = _CONFIG_DIR / "notion-config.json"

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 Use the same Notion config path for the drop guard

When audit is run from outside the source checkout, load_safe_notion_project_context() still queries load_notion_project_context() with its default Path("config") relative to the working directory, but this guard checks _CONFIG_DIR/notion-config.json relative to the package repo. In that context a real config/notion-config.json with projects_data_source_id is ignored here, so a missing token/API response can produce notion_context_rows == 0 and still overwrite a previous nonzero truth snapshot because the guard returns early.

Useful? React with 👍 / 👎.

},
"fable-outputs": {
"localProjectId": "37ec21f1-caf0-81b8-b365-e894672184ac"
}

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 Restore mappings for the active Notion-backed repos

When an audit report includes mcp-trust, cross-provider-egress-guard, or fable-outputs, deleting their entries from notion-project-map.json makes export_notion_events() unable to resolve a localProjectId, so those Audit signals are emitted under unmapped_repos instead of being delivered to Notion. These projects are still declared in config/portfolio-catalog.yaml, so this removal regresses the existing mapping coverage rather than just adding aliases.

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