Skip to content

refactor: group Drive sources and Claude parsers into subpackages (#403) - #567

Merged
Sinity merged 1 commit into
masterfrom
feature/refactor/403-source-grouping
Apr 28, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/refactor/403-source-grouping

Conversation

@Sinity

@Sinity Sinity commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Summary

Group Drive-specific modules into sources/drive/ and Claude parser modules into sources/parsers/claude/.

  • Drive: 10 files (drive_auth, drive_gateway, drive_source*, drive_types) → sources/drive/
  • Claude: 6 files (claude_ai_parser, claude_code_parser, etc.) → sources/parsers/claude/
  • drive.py → drive/__init__.py and claude.py → claude/__init__.py preserve public API

Ref #403

🤖 Generated with Claude Code

…into parsers/claude/

Move Drive modules (drive_auth, drive_gateway, drive_source*, drive_types) into
polylogue/sources/drive/ and Claude parser modules (claude_ai_parser,
claude_code_parser, etc.) into polylogue/sources/parsers/claude/.

drive.py → drive/__init__.py and claude.py → claude/__init__.py preserve
the public import surface.

Ref #403

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@Sinity
Sinity merged commit b0e8de4 into master Apr 28, 2026
3 of 11 checks passed
@Sinity
Sinity deleted the feature/refactor/403-source-grouping branch April 28, 2026 14:19
@coderabbitai

coderabbitai Bot commented Apr 28, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 32 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f89062e1-85c6-4ee0-a9b5-49ede37f1cea

📥 Commits

Reviewing files that changed from the base of the PR and between cabfa1e and f1e519c.

📒 Files selected for processing (32)
  • docs/plans/topology-target.yaml
  • polylogue/cli/commands/auth.py
  • polylogue/pipeline/services/acquisition.py
  • polylogue/pipeline/services/acquisition_streams.py
  • polylogue/readiness/__init__.py
  • polylogue/sources/drive/.gitkeep
  • polylogue/sources/drive/__init__.py
  • polylogue/sources/drive/auth.py
  • polylogue/sources/drive/auth_support.py
  • polylogue/sources/drive/gateway.py
  • polylogue/sources/drive/source.py
  • polylogue/sources/drive/source_client.py
  • polylogue/sources/drive/source_factory.py
  • polylogue/sources/drive/source_protocol.py
  • polylogue/sources/drive/source_support.py
  • polylogue/sources/drive/types.py
  • polylogue/sources/parsers/claude/__init__.py
  • polylogue/sources/parsers/claude/ai_parser.py
  • polylogue/sources/parsers/claude/code_detection.py
  • polylogue/sources/parsers/claude/code_parser.py
  • polylogue/sources/parsers/claude/common.py
  • polylogue/sources/parsers/claude/index.py
  • tests/conftest.py
  • tests/infra/drive_mocks.py
  • tests/unit/cli/test_operator_support_runtime.py
  • tests/unit/sources/test_assembly.py
  • tests/unit/sources/test_compaction.py
  • tests/unit/sources/test_drive_auth.py
  • tests/unit/sources/test_drive_gateway.py
  • tests/unit/sources/test_drive_source_client.py
  • tests/unit/sources/test_source_laws.py
  • tests/unit/sources/test_tool_result_role_reclassification.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/403-source-grouping

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 59 minutes and 32 seconds.

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

@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

from .drive_auth import default_credentials_path, default_token_path
from .drive_gateway import (

P1 Badge Restore Drive subpackage imports after file moves

This module still imports old sibling names (.drive_auth, .drive_gateway, .drive_source_client, etc.) even though the files were renamed to auth.py, gateway.py, source_client.py, and so on. Importing polylogue.sources.drive.source now raises ModuleNotFoundError, which breaks Drive source wiring and any runtime paths that load Drive support.


from ..assets import asset_path
from ..config import Source
from ..paths.sanitize import safe_path_component
from .dispatch import parse_drive_payload

P1 Badge Correct Drive package relative import depth

After moving this module under sources/drive/, these relative imports are now one level too shallow (for example ..assets resolves to polylogue.sources.assets, which does not exist). That causes import-time failures when loading polylogue.sources.drive, so Drive features cannot initialize.


from .claude_ai_parser import looks_like_ai as _looks_like_ai
from .claude_ai_parser import parse_ai as _parse_ai
from .claude_code_detection import looks_like_code
from .claude_code_parser import parse_code, parse_code_stream

P1 Badge Point Claude parser imports at renamed modules

The new Claude package entrypoint still imports old module names like .claude_ai_parser and .claude_code_parser even though those files were renamed to ai_parser.py and code_parser.py in this commit. Importing polylogue.sources.parsers.claude will fail with ModuleNotFoundError, which breaks Claude parsing paths.

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

Sinity added a commit that referenced this pull request Apr 29, 2026
Two root causes left the CLI and MCP server broken:

1. Circular import in protocols.py: the runtime import from
   storage.runtime triggered a chain through products → storage.repair
   → protocols, failing on partially-initialized module. Moved
   record-type imports under TYPE_CHECKING since from __future__
   import annotations makes them string-only at runtime.

2. #567 (group Drive/Claude sources into subpackages) renamed files
   but did not update internal cross-references. drive_auth.py →
   auth.py but imports still referenced .drive_auth. drive.py →
   drive/__init__.py changed the relative-import depth by one level
   (.dispatch → ..dispatch). Fixed 17 files across drive/ and
   parsers/claude/ to use correct module names and parent depth.

Also fixed: sources/__init__.py still imported from .drive_source
and .drive_types (old flat paths); assembly*.py referenced the old
.claude_index name.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@Sinity
Sinity requested a review from Copilot May 1, 2026 00:45
@Sinity
Sinity removed the request for review from Copilot May 1, 2026 01:10
@Sinity

Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
✅ Actions performed

Full review triggered.

@Sinity
Sinity requested a review from Copilot May 1, 2026 01:55
@Sinity
Sinity removed the request for review from Copilot May 1, 2026 02:20
Sinity added a commit that referenced this pull request May 7, 2026
## Summary
Group Drive-specific modules into `sources/drive/` and Claude parser
modules into `sources/parsers/claude/`.

- Drive: 10 files (drive_auth, drive_gateway, drive_source*,
drive_types) → `sources/drive/`
- Claude: 6 files (claude_ai_parser, claude_code_parser, etc.) →
`sources/parsers/claude/`
- `drive.py` → `drive/__init__.py` and `claude.py` →
`claude/__init__.py` preserve public API

Ref #403

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 <[email protected]>
Sinity added a commit that referenced this pull request May 7, 2026
Two root causes left the CLI and MCP server broken:

1. Circular import in protocols.py: the runtime import from
   storage.runtime triggered a chain through products → storage.repair
   → protocols, failing on partially-initialized module. Moved
   record-type imports under TYPE_CHECKING since from __future__
   import annotations makes them string-only at runtime.

2. #567 (group Drive/Claude sources into subpackages) renamed files
   but did not update internal cross-references. drive_auth.py →
   auth.py but imports still referenced .drive_auth. drive.py →
   drive/__init__.py changed the relative-import depth by one level
   (.dispatch → ..dispatch). Fixed 17 files across drive/ and
   parsers/claude/ to use correct module names and parent depth.

Also fixed: sources/__init__.py still imported from .drive_source
and .drive_types (old flat paths); assembly*.py referenced the old
.claude_index name.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
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