Skip to content

refactor: cross-app import boundaries and import-linter#240

Merged
wpak-ai merged 4 commits into
cppalliance:developfrom
snowfox1003:refactor/cross-app-import-boundaries
May 26, 2026
Merged

refactor: cross-app import boundaries and import-linter#240
wpak-ai merged 4 commits into
cppalliance:developfrom
snowfox1003:refactor/cross-app-import-boundaries

Conversation

@snowfox1003
Copy link
Copy Markdown
Collaborator

@snowfox1003 snowfox1003 commented May 25, 2026

Summary

Resolves the five cross-app import tech-debt edges documented in docs/cross-app-dependencies.md and enforces them in CI with import-linter.

  • Pinecone: Collectors (boost_library_docs_tracker, cppa_slack_tracker) call cppa_pinecone_sync.services.sync_source_to_pinecone instead of importing sync / ingestion internals.
  • Identity hub: boost_usage_tracker.update_repository_from_csv uses cppa_user_tracker.services.get_github_account_by_username instead of querying GitHubAccount directly.
  • GitHub activity: clang_github_tracker imports orchestration helpers only from new github_activity_tracker.sync_api (not fetcher, sync.*, workspace, or preprocessors).
  • Dashboard: Removes boost_library_usage_dashboard/models.py re-export shim; callers use boost_usage_tracker.models directly.
  • Tooling: Adds .importlinter contracts, import-linter dev dependency, and pre-commit lint-imports hook.
  • Docs: Updates cross-app dependency matrix, service API docs, CHANGELOG, and Python 3.13.x prerequisite wording (pyproject.toml, README, CONTRIBUTING).

Test plan

  • uv run lint-imports (or pre-commit import-linter hook) passes
  • uv run pyright passes
  • pytest github_activity_tracker/tests/test_sync_api.py
  • pytest cppa_user_tracker/tests/test_services.py
  • pytest cppa_slack_tracker/tests/test_run_command.py
  • pytest boost_library_docs_tracker/tests/test_run_boost_library_docs_tracker_command.py
  • pytest boost_library_usage_dashboard/tests/test_models.py
  • Smoke: run_boost_library_docs_tracker / run_cppa_slack_tracker Pinecone sync path (if Pinecone env available)
  • Smoke: clang_github_tracker sync/backfill still runs against sync_api imports

Closes #229

Summary by CodeRabbit

  • New Features

    • Added import-linter validation in CI and pre-commit to enforce cross-app import rules.
    • Introduced public sync façades for GitHub and Pinecone workflows plus a normalized Pinecone instance type.
  • Documentation

    • Updated API docs and guidelines to reference the new sync entrypoints and Pinecone usage.
    • Updated Python prerequisites to 3.13.x across docs.
  • Chores

    • Tightened project Python requirement to 3.13.

Review Change Stack

@snowfox1003 snowfox1003 self-assigned this May 25, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9d2d012b-15e2-4b27-93f1-ad8d69e24b4c

📥 Commits

Reviewing files that changed from the base of the PR and between 3909d87 and 4359ac6.

📒 Files selected for processing (2)
  • cppa_pinecone_sync/tests/test_types.py
  • cppa_pinecone_sync/types.py

📝 Walkthrough

Walkthrough

This PR resolves five documented cross-app import tech-debt edges by introducing service-layer façades (github_activity_tracker.sync_api, cppa_pinecone_sync.sync_api), creating a shared PineconeInstance type with flexible coercion, adding a cppa_user_tracker account lookup service, migrating consumers to those APIs, removing a dashboard re-export shim, and enabling import-linter CI enforcement. Python baseline upgraded to 3.13.

Changes

Cross-app import boundary refactor and enforcement

Layer / File(s) Summary
Python 3.13 version baseline upgrade
pyproject.toml, pyrightconfig.json, scripts/validate_collector_scaffold.py, CONTRIBUTING.md, README.md, SECURITY.md, docs/Development_guideline.md, requirements-dev.in, core/_version.py
Project infrastructure tightened from Python 3.11+ to Python 3.13 across build metadata, type checking config, scaffolding, docs, and dev requirements.
Create github_activity_tracker sync_api façade
github_activity_tracker/sync_api.py, github_activity_tracker/tests/test_sync_api.py, docs/service_api/github_activity_tracker.md
New module re-exports fetcher, JSON normalization, raw-source helpers, workspace path/iterator helpers, and document builders; tests verify exports are present and callable; service API docs added.
Migrate clang_github_tracker to sync_api
clang_github_tracker/management/commands/backfill_clang_github_tracker.py, clang_github_tracker/preprocessors/issue_preprocessor.py, clang_github_tracker/preprocessors/pr_preprocessor.py, clang_github_tracker/sync_raw.py
Backfill command, issue/PR preprocessors, and sync_raw now import normalization/document-builder/path helpers from github_activity_tracker.sync_api instead of internal modules.
Extract PineconeInstance to shared types module
cppa_pinecone_sync/types.py, cppa_pinecone_sync/tests/test_types.py
New types.py defines PineconeInstance enum (PUBLIC, PRIVATE) with coerce(instance) normalizing None/enum/string inputs; tests added for coercion behavior.
Create cppa_pinecone_sync sync_api façade and relax instance handling
cppa_pinecone_sync/sync.py, cppa_pinecone_sync/sync_api.py, cppa_pinecone_sync/tests/*, docs/service_api/cppa_pinecone_sync.md, docs/Pinecone_preprocess_guideline.md
New sync_api.py façade re-exports sync_to_pinecone, PineconeInstance, and PreprocessFn. sync_to_pinecone signature updated: instance is now keyword-only, accepts `PineconeInstance
Migrate boost_library_docs_tracker to Pinecone sync_api
boost_library_docs_tracker/management/commands/run_boost_library_docs_tracker.py, boost_library_docs_tracker/tests/test_run_boost_library_docs_tracker_command.py
Command now imports from cppa_pinecone_sync.sync_api and handles missing/import-error behavior against that façade; tests updated to mock sys.modules["cppa_pinecone_sync.sync_api"].
Migrate cppa_slack_tracker to Pinecone sync_api
cppa_slack_tracker/management/commands/run_cppa_slack_tracker.py, cppa_slack_tracker/tests/test_run_command.py
Slack tracker collector imports from cppa_pinecone_sync.sync_api; callers removed explicit instance arg; tests refactored to inject MagicMock into sys.modules["cppa_pinecone_sync.sync_api"] for success/error/exception cases.
Create cppa_user_tracker service helper for account lookup
cppa_user_tracker/services.py, cppa_user_tracker/tests/test_services.py, docs/service_api/cppa_user_tracker.md
New get_github_account_by_username(username: str) -> GitHubAccount | None read-only helper normalizes input and returns matching account or None; get_or_create_owner_account updated to use it; tests added for existing username, unknown username, and blank/whitespace cases; docs updated.
Migrate boost_usage_tracker CSV importer to user service
boost_usage_tracker/update_repository_from_csv.py
CSV owner resolution now calls get_github_account_by_username instead of querying GitHubAccount model directly; skip logic and downstream processing unchanged.
Remove boost_library_usage_dashboard models re-export shim
boost_library_usage_dashboard/models.py, boost_library_usage_dashboard/tests/test_models.py
Removed __all__ re-export of BoostExternalRepository and BoostUsage from dashboard models module; tests updated to import directly from boost_usage_tracker.models.
Configure import-linter CI enforcement
.importlinter, .pre-commit-config.yaml, requirements-dev.in
Added .importlinter with three forbidden-import contracts: forbid-tech-debt-pinecone (blocks boost_library_docs_tracker & cppa_slack_tracker importing cppa_pinecone_sync.sync/ingestion/services), forbid-tech-debt-usage-csv-user-model (blocks boost_usage_tracker.update_repository_from_csv importing cppa_user_tracker.models), forbid-tech-debt-clang-github-internals (blocks clang_github_tracker importing github_activity_tracker.fetcher/sync/workspace/preprocessors). Pre-commit hook import-linter with lint-imports command added; import-linter>=2.1,<3 added as a dev dependency.
Update documentation for resolved tech-debt and import enforcement
CHANGELOG.md, docs/cross-app-dependencies.md, docs/service_api/*, docs/Pinecone_preprocess_guideline.md
Changelog documents the five resolved cross-app import edges and import-linter enforcement. Cross-app dependencies doc updated to mark resolved edges, reflect service boundaries, update import tables and Mermaid labels, and document import-linter configuration and run commands. Service API and Pinecone preprocess docs updated to reference new façades and types.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement, documentation

Suggested reviewers

  • wpak-ai
  • jonathanMLDev

Poem

A rabbit hops through import trees,
Five tangled edges now find ease,
Façades and types in tidy rows,
The linter guards where boundary goes—
Now imports hop where order grows 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.42% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'refactor: cross-app import boundaries and import-linter' accurately summarizes the main change: resolving cross-app import tech-debt and enforcing boundaries with import-linter tooling.
Linked Issues check ✅ Passed All five cross-app import edges documented in issue #229 are addressed: Pinecone collectors use sync_api, boost_usage_tracker uses service lookup, clang_github_tracker uses sync_api, dashboard removes re-export shim, and import-linter enforces the boundaries via CI.
Out of Scope Changes check ✅ Passed All changes are directly scoped to resolving the five cross-app import edges, implementing import-linter enforcement, and updating related documentation, tests, and configuration files; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@snowfox1003 snowfox1003 marked this pull request as draft May 25, 2026 16:47
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
github_activity_tracker/tests/test_sync_api.py (1)

6-29: ⚡ Quick win

Assert the full sync_api export contract explicitly.

Current tests validate only a subset of symbols. Adding one exact __all__ assertion will better protect the cross-app boundary from accidental API drift.

Proposed test hardening
 from github_activity_tracker import sync_api
 
+def test_sync_api_public_contract_is_stable():
+    expected = {
+        "build_issue_document",
+        "build_pr_document",
+        "fetcher",
+        "get_commit_json_path",
+        "get_issue_json_path",
+        "get_pr_json_path",
+        "get_raw_source_issue_path",
+        "get_raw_source_pr_path",
+        "iter_existing_commit_jsons",
+        "iter_existing_issue_jsons",
+        "iter_existing_pr_jsons",
+        "normalize_issue_json",
+        "normalize_pr_json",
+        "save_commit_raw_source",
+        "save_issue_raw_source",
+        "save_pr_raw_source",
+    }
+    assert set(sync_api.__all__) == expected
+    for name in expected:
+        assert hasattr(sync_api, name)
+
 
 def test_sync_api_exports_fetcher():
     assert sync_api.fetcher is not None
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@github_activity_tracker/tests/test_sync_api.py` around lines 6 - 29, Add a
strict export contract assertion: check sync_api.__all__ exactly matches the
expected list of public symbols to prevent accidental API drift. In the
test_sync_api.py add an assertion like comparing tuple(getattr(sync_api,
"__all__", None)) or set(sync_api.__all__) to the explicit list:
["fetcher","normalize_issue_json","normalize_pr_json","save_commit_raw_source","save_issue_raw_source","save_pr_raw_source","get_commit_json_path","get_raw_source_issue_path","iter_existing_pr_jsons","build_issue_document","build_pr_document"];
if __all__ is missing make the test fail so authors add/maintain it.
core/_version.py (1)

1-2: 💤 Low value

Auto-generated version file in version control.

This file is generated by setuptools-scm (per line 1 comment and pyproject.toml lines 17-22). Modern Python packaging best practices typically exclude generated version files from version control, adding them to .gitignore and letting the build process generate them.

However, pyproject.toml explicitly configures version_file = "core/_version.py", indicating the project intends to commit this file. If this is intentional (e.g., for environments without git metadata), this is acceptable but will cause version string changes in every commit.

Consider whether this file should be in .gitignore or if the current approach serves a specific deployment need.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/_version.py` around lines 1 - 2, The repo contains an auto-generated
version file core/_version.py with the variable version =
"0.1.1.dev0+gfcfdda0ab.d20260525" committed; decide whether to keep committing
this generated file or ignore it: if you want builds to generate the version at
build time, remove core/_version.py from version control and add it to
.gitignore (and ensure pyproject.toml no longer requires a committed file),
otherwise document and accept that pyproject.toml's version_file =
"core/_version.py" is intentional (keep the file committed) and add a note to
the repo README explaining why the generated file is checked in for environments
lacking git metadata.
.importlinter (1)

2-17: 💤 Low value

Consider adding slack_event_handler to root_packages.

The app inventory in docs/cross-app-dependencies.md lists slack_event_handler as an installed app. While it has no domain models and no current import contracts, including it in root_packages would make the configuration complete and future-proof against accidental cross-app imports.

📦 Proposed addition
     github_activity_tracker
+    slack_event_handler
     wg21_paper_tracker
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.importlinter around lines 2 - 17, The .importlinter configuration's
root_packages list is missing slack_event_handler; add slack_event_handler to
the root_packages block (the root_packages key in the .importlinter file) so the
package list includes "slack_event_handler" to match
docs/cross-app-dependencies.md and prevent accidental cross-app import issues.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.importlinter:
- Around line 2-17: The .importlinter configuration's root_packages list is
missing slack_event_handler; add slack_event_handler to the root_packages block
(the root_packages key in the .importlinter file) so the package list includes
"slack_event_handler" to match docs/cross-app-dependencies.md and prevent
accidental cross-app import issues.

In `@core/_version.py`:
- Around line 1-2: The repo contains an auto-generated version file
core/_version.py with the variable version = "0.1.1.dev0+gfcfdda0ab.d20260525"
committed; decide whether to keep committing this generated file or ignore it:
if you want builds to generate the version at build time, remove
core/_version.py from version control and add it to .gitignore (and ensure
pyproject.toml no longer requires a committed file), otherwise document and
accept that pyproject.toml's version_file = "core/_version.py" is intentional
(keep the file committed) and add a note to the repo README explaining why the
generated file is checked in for environments lacking git metadata.

In `@github_activity_tracker/tests/test_sync_api.py`:
- Around line 6-29: Add a strict export contract assertion: check
sync_api.__all__ exactly matches the expected list of public symbols to prevent
accidental API drift. In the test_sync_api.py add an assertion like comparing
tuple(getattr(sync_api, "__all__", None)) or set(sync_api.__all__) to the
explicit list:
["fetcher","normalize_issue_json","normalize_pr_json","save_commit_raw_source","save_issue_raw_source","save_pr_raw_source","get_commit_json_path","get_raw_source_issue_path","iter_existing_pr_jsons","build_issue_document","build_pr_document"];
if __all__ is missing make the test fail so authors add/maintain it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8e61a19b-9577-46a5-a2f5-313ff90d2d70

📥 Commits

Reviewing files that changed from the base of the PR and between fcfdda0 and 96d5401.

⛔ Files ignored due to path filters (2)
  • requirements-dev.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (32)
  • .importlinter
  • .pre-commit-config.yaml
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md
  • SECURITY.md
  • boost_library_docs_tracker/management/commands/run_boost_library_docs_tracker.py
  • boost_library_docs_tracker/tests/test_run_boost_library_docs_tracker_command.py
  • boost_library_usage_dashboard/models.py
  • boost_library_usage_dashboard/tests/test_models.py
  • boost_usage_tracker/update_repository_from_csv.py
  • clang_github_tracker/management/commands/backfill_clang_github_tracker.py
  • clang_github_tracker/preprocessors/issue_preprocessor.py
  • clang_github_tracker/preprocessors/pr_preprocessor.py
  • clang_github_tracker/sync_raw.py
  • core/_version.py
  • cppa_pinecone_sync/services.py
  • cppa_slack_tracker/management/commands/run_cppa_slack_tracker.py
  • cppa_slack_tracker/tests/test_run_command.py
  • cppa_user_tracker/services.py
  • cppa_user_tracker/tests/test_services.py
  • docs/Development_guideline.md
  • docs/cross-app-dependencies.md
  • docs/service_api/cppa_pinecone_sync.md
  • docs/service_api/cppa_user_tracker.md
  • docs/service_api/github_activity_tracker.md
  • github_activity_tracker/sync_api.py
  • github_activity_tracker/tests/test_sync_api.py
  • pyproject.toml
  • pyrightconfig.json
  • requirements-dev.in
  • scripts/validate_collector_scaffold.py
💤 Files with no reviewable changes (1)
  • boost_library_usage_dashboard/models.py

@snowfox1003
Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cppa_pinecone_sync/services.py`:
- Around line 22-47: sync_source_to_pinecone currently forwards the instance
verbatim; validate and normalize it before calling sync_to_pinecone: import
PineconeInstance, set pinecone_instance = PineconeInstance.PUBLIC when instance
is None, allow string names by mapping them to PineconeInstance (e.g.
PineconeInstance[instance] or by value) and if the provided instance is not a
PineconeInstance or mappable string raise a clear ValueError indicating allowed
values; finally pass the normalized pinecone_instance into sync_to_pinecone
(refer to sync_source_to_pinecone, PineconeInstance.PUBLIC, parameter instance,
and sync_to_pinecone).

In `@docs/cross-app-dependencies.md`:
- Around line 170-183: Update this page so the summary table and the earlier
detailed rows are consistent: find the earlier section(s) that still list
boost_library_usage_dashboard as a shim and the script
update_repository_from_csv.py as unresolved tech-debt and change their state to
match the "resolved" summary (i.e., remove/mark the shim and
update_repository_from_csv.py entries as resolved), ensuring mentions of
boost_library_docs_tracker, cppa_slack_tracker, boost_usage_tracker (CSV
import/GitHubAccount), and clang_github_tracker align with the summary; keep the
resolved wording and CI/import-linter note unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 532a41f3-4ff6-4482-93eb-56313384d881

📥 Commits

Reviewing files that changed from the base of the PR and between fcfdda0 and 96d5401.

⛔ Files ignored due to path filters (2)
  • requirements-dev.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (32)
  • .importlinter
  • .pre-commit-config.yaml
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md
  • SECURITY.md
  • boost_library_docs_tracker/management/commands/run_boost_library_docs_tracker.py
  • boost_library_docs_tracker/tests/test_run_boost_library_docs_tracker_command.py
  • boost_library_usage_dashboard/models.py
  • boost_library_usage_dashboard/tests/test_models.py
  • boost_usage_tracker/update_repository_from_csv.py
  • clang_github_tracker/management/commands/backfill_clang_github_tracker.py
  • clang_github_tracker/preprocessors/issue_preprocessor.py
  • clang_github_tracker/preprocessors/pr_preprocessor.py
  • clang_github_tracker/sync_raw.py
  • core/_version.py
  • cppa_pinecone_sync/services.py
  • cppa_slack_tracker/management/commands/run_cppa_slack_tracker.py
  • cppa_slack_tracker/tests/test_run_command.py
  • cppa_user_tracker/services.py
  • cppa_user_tracker/tests/test_services.py
  • docs/Development_guideline.md
  • docs/cross-app-dependencies.md
  • docs/service_api/cppa_pinecone_sync.md
  • docs/service_api/cppa_user_tracker.md
  • docs/service_api/github_activity_tracker.md
  • github_activity_tracker/sync_api.py
  • github_activity_tracker/tests/test_sync_api.py
  • pyproject.toml
  • pyrightconfig.json
  • requirements-dev.in
  • scripts/validate_collector_scaffold.py
💤 Files with no reviewable changes (1)
  • boost_library_usage_dashboard/models.py

Comment thread cppa_pinecone_sync/services.py Outdated
Comment thread docs/cross-app-dependencies.md
@snowfox1003 snowfox1003 marked this pull request as ready for review May 25, 2026 17:49
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.importlinter (1)

2-17: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add core to .importlinter root_packages

core/ exists, and many packages in the current root_packages list import from core.* (collectors/operations/utils/protocols/errors, etc.). Leaving core out of root_packages prevents import-linter from analyzing/flagging cross-boundary violations involving core.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.importlinter around lines 2 - 17, Add "core" to the root_packages list in
the .importlinter config so import-linter will analyze imports to and from core;
update the root_packages block (the list containing boost_collector_runner,
boost_library_docs_tracker, etc.) to include core as a top-level package name to
ensure cross-boundary violations involving core.* are detected.
🧹 Nitpick comments (1)
.importlinter (1)

29-29: 💤 Low value

Consider eventually tightening allow_indirect_imports to false.

All three contracts currently set allow_indirect_imports = true, which permits violations through transitive imports (e.g., if app_a imports helper_b, and helper_b imports the forbidden module, the violation is not caught). While this setting is appropriate during the initial migration to reduce false positives, you may want to tighten these contracts to allow_indirect_imports = false once the direct imports are fully resolved and the service boundaries are stable. This will provide stronger enforcement against future violations.

Also applies to: 38-38, 50-50

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.importlinter at line 29, The import linter config currently sets the
boolean option allow_indirect_imports = true in three contract blocks which
permits transitive import violations; change those three occurrences of
allow_indirect_imports from true to false to enforce direct+indirect import
restrictions, run the import-linter check suite to surface transitive
violations, and iteratively fix or explicitly whitelist any legitimate
exceptions (or add narrow contract rules) until the linter is clean.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cppa_pinecone_sync/types.py`:
- Around line 21-25: The enum coercion currently lowercases string inputs but
doesn't trim whitespace, causing valid inputs like " PRIVATE " to raise
ValueError; update the coercion in the relevant enum class method (the block
that calls cls(instance.lower())) to normalize the input by stripping
surrounding whitespace first (use instance.strip().lower()) before attempting
cls(...), and keep the existing ValueError raising behavior on failure so inputs
with only surrounding whitespace are handled correctly.

---

Outside diff comments:
In @.importlinter:
- Around line 2-17: Add "core" to the root_packages list in the .importlinter
config so import-linter will analyze imports to and from core; update the
root_packages block (the list containing boost_collector_runner,
boost_library_docs_tracker, etc.) to include core as a top-level package name to
ensure cross-boundary violations involving core.* are detected.

---

Nitpick comments:
In @.importlinter:
- Line 29: The import linter config currently sets the boolean option
allow_indirect_imports = true in three contract blocks which permits transitive
import violations; change those three occurrences of allow_indirect_imports from
true to false to enforce direct+indirect import restrictions, run the
import-linter check suite to surface transitive violations, and iteratively fix
or explicitly whitelist any legitimate exceptions (or add narrow contract rules)
until the linter is clean.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 33722aee-fd97-406e-9e14-b15c7a17d740

📥 Commits

Reviewing files that changed from the base of the PR and between 4033db5 and 3909d87.

📒 Files selected for processing (20)
  • .importlinter
  • boost_library_docs_tracker/management/commands/run_boost_library_docs_tracker.py
  • boost_library_docs_tracker/tests/test_run_boost_library_docs_tracker_command.py
  • core/_version.py
  • cppa_pinecone_sync/README.md
  • cppa_pinecone_sync/__init__.py
  • cppa_pinecone_sync/ingestion.py
  • cppa_pinecone_sync/management/commands/run_cppa_pinecone_sync.py
  • cppa_pinecone_sync/sync.py
  • cppa_pinecone_sync/sync_api.py
  • cppa_pinecone_sync/tests/test_ingestion.py
  • cppa_pinecone_sync/tests/test_sync.py
  • cppa_pinecone_sync/tests/test_sync_api.py
  • cppa_pinecone_sync/tests/test_types.py
  • cppa_pinecone_sync/types.py
  • cppa_slack_tracker/management/commands/run_cppa_slack_tracker.py
  • cppa_slack_tracker/tests/test_run_command.py
  • docs/Pinecone_preprocess_guideline.md
  • docs/cross-app-dependencies.md
  • docs/service_api/cppa_pinecone_sync.md
✅ Files skipped from review due to trivial changes (7)
  • cppa_pinecone_sync/tests/test_ingestion.py
  • cppa_pinecone_sync/init.py
  • core/_version.py
  • cppa_pinecone_sync/README.md
  • cppa_pinecone_sync/sync_api.py
  • docs/Pinecone_preprocess_guideline.md
  • docs/cross-app-dependencies.md

Comment thread cppa_pinecone_sync/types.py
@wpak-ai wpak-ai merged commit ba5fa0b into cppalliance:develop May 26, 2026
5 checks passed
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.

Remove five cross-app import edges bypassing service boundaries

3 participants