Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This change implements Phase 4 of the codesage project, introducing a plugin architecture and replacing file-based storage with a database-backed persistence layer using SQLAlchemy.

Key changes:

  1. Plugin System: A new PluginManager allows dynamic loading of external Python modules that implement the Plugin interface. Users can define custom Rules and Analyzers.
  2. Persistence Layer: A StorageEngine class manages database interactions using SQLAlchemy. The default database is SQLite (codesage.db), but it supports any SQLAlchemy-compatible database via connection string.
  3. Database Models: Relational models for Project, Snapshot, Issue, and Dependency replace the previous flat YAML storage.
  4. CLI Integration: The codesage scan command now accepts --plugins-dir and --db-url arguments. It executes loaded plugins against the snapshot and saves the results to the database.
  5. Dependencies: Added SQLAlchemy and Alembic.

The change ensures backward compatibility with existing snapshot generation logic while enabling advanced historical analysis and extensibility.


PR created automatically by Jules for task 18056630340618888762 started by @turtacn

- Added `codesage/core/interfaces.py` defining `Plugin`, `Rule`, and `Analyzer` interfaces.
- Implemented `PluginManager` in `codesage/cli/plugin_loader.py` for dynamic plugin loading.
- Created `codesage/history/models.py` with SQLAlchemy models (`Project`, `Snapshot`, `Issue`, `Dependency`).
- Refactored `codesage/history/store.py` to use `StorageEngine` with SQLAlchemy.
- Updated `codesage scan` command to load plugins and persist results to DB.
- Added `sqlalchemy` and `alembic` dependencies.
- Added sample custom rule plugin in `examples/plugins/my_custom_rule.py`.
- Initialized Alembic for database migrations.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@turtacn turtacn merged commit 8097ecc into master Nov 23, 2025
1 check failed
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