refactor: split observability/events/persistence into per-subdomain package#2262
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request completes the first wave of a package-vertical hardening initiative by decomposing a large, monolithic observability persistence module into a structured, per-subdomain package. This refactor improves maintainability and architectural clarity by aligning event constant definitions with their respective entities, while also updating the codebase's internal tooling and architectural gates to support the new modular structure. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
🧰 Additional context used🧠 Learnings (14)📓 Common learnings📚 Learning: 2026-04-26T08:52:54.166ZApplied to files:
📚 Learning: 2026-04-24T20:59:36.323ZApplied to files:
📚 Learning: 2026-04-24T08:06:06.042ZApplied to files:
📚 Learning: 2026-03-15T18:17:43.675ZApplied to files:
📚 Learning: 2026-04-30T10:46:02.441ZApplied to files:
📚 Learning: 2026-04-02T08:47:46.313ZApplied to files:
📚 Learning: 2026-04-02T08:47:46.313ZApplied to files:
📚 Learning: 2026-04-24T20:59:36.323ZApplied to files:
📚 Learning: 2026-04-30T10:46:02.441ZApplied to files:
📚 Learning: 2026-04-24T20:59:36.323ZApplied to files:
📚 Learning: 2026-05-31T17:59:47.787ZApplied to files:
📚 Learning: 2026-04-02T08:47:46.313ZApplied to files:
📚 Learning: 2026-03-15T18:17:43.675ZApplied to files:
🔇 Additional comments (3)
WalkthroughThe PR removes the single monolithic persistence observability module and replaces it with src/synthorg/observability/events/persistence/ containing many per-subdomain modules that declare typed Final[str] event-name constants. It updates imports across API, engine, persistence, and repository code to the new submodule paths, adds a persistence package init with an empty all, adjusts scripts and baselines (module-size gates and central-junk baseline), updates docs and ADRs to reflect the narrowed allowlist, and updates tests to discover and import persistence submodules. Suggested labels
|
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request decomposes the monolithic observability/events/persistence.py god-module into a per-subdomain package under src/synthorg/observability/events/persistence/. The constants are now distributed across individual, declarative subdomain modules, and all imports across the codebase have been updated accordingly. Additionally, the god-module allowlist and central junk-drawer checks have been updated to remove references to the dissolved module, and related documentation, architecture reports, and unit tests have been adjusted. I have no feedback to provide as there are no review comments to evaluate.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2262 +/- ##
=======================================
Coverage 88.91% 88.92%
=======================================
Files 2671 2726 +55
Lines 139985 140051 +66
=======================================
+ Hits 124474 124545 +71
+ Misses 15511 15506 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@CLAUDE.md`:
- Line 20: The Module-Size Budget bullet (the line starting with "**Module-Size
Budget (MANDATORY)**") mixes policy with migration history and an issue
back-reference; remove the migration/history phrasing ("dissolved into a
per-subdomain package", "the five `api/` entries drained once the controller
decomposition brought them under their tier caps") and the `#2052-style`
parenthetical so the bullet is strictly normative, and if needed move any
historical notes or issue references (e.g., mentions of
`observability/events/persistence.py` or `api/` entries) into a separate
changelog/history section instead of the policy text.
In `@docs/decisions/0006-tiered-module-size-policy.md`:
- Around line 73-77: Remove the issue back-references and migration-framing
language from the ADR text: eliminate references like “#2246/#2051” and phrases
implying migration status (e.g., “left the allowlist in `#2246` when it dissolved
into a per-subdomain package”); keep only the rationale and policy wording,
mention the god-module allowlist symbol (core/enums.py) and gate script name
(check_no_growth_in_god_modules.py) as implementation pointers if needed, and
apply the same cleanup to the other edited regions (lines referenced in the
review) so the markdown contains only "why" explanation without reviewer
citations or issue/migration framing.
In `@docs/decisions/0008-controller-decomposition.md`:
- Around line 118-119: The sentence in
docs/decisions/0008-controller-decomposition.md contains reviewer/issue
back-references and migration phrasing; remove the issue IDs and
migration-status wording so it simply states the factual outcome (e.g.,
"core/enums.py remains; observability/events/persistence.py was split into a
per-subdomain package") — edit the line referencing `core/enums.py` and
`observability/events/persistence.py` to drop `#2051`, `#2246` and any "until" /
migration framing and keep only the concise why/what description.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 1239ec3d-94cb-4fc1-bf26-3575d3d211af
📒 Files selected for processing (197)
CLAUDE.mddata/architecture_report.jsondata/codebase_map.jsondata/feature_index.jsondocs/decisions/0006-tiered-module-size-policy.mddocs/decisions/0008-controller-decomposition.mddocs/reference/conventions.mdscripts/check_no_central_junk_drawer.pyscripts/check_no_growth_in_god_modules.pyscripts/check_persistence_boundary.pyscripts/convention_gate_map.yamlsrc/synthorg/api/controllers/artifacts.pysrc/synthorg/api/lifecycle_builder.pysrc/synthorg/api/lifecycle_helpers/ticket_cleanup.pysrc/synthorg/api/webhook_cleanup.pysrc/synthorg/engine/artifacts/service.pysrc/synthorg/integrations/mcp_catalog/in_memory_installations.pysrc/synthorg/observability/events/deliverable_receipts.pysrc/synthorg/observability/events/persistence.pysrc/synthorg/observability/events/persistence/__init__.pysrc/synthorg/observability/events/persistence/agent_state.pysrc/synthorg/observability/events/persistence/api_key.pysrc/synthorg/observability/events/persistence/artifact.pysrc/synthorg/observability/events/persistence/artifact_storage.pysrc/synthorg/observability/events/persistence/audit_entry.pysrc/synthorg/observability/events/persistence/backend.pysrc/synthorg/observability/events/persistence/ceremony_state.pysrc/synthorg/observability/events/persistence/charter.pysrc/synthorg/observability/events/persistence/checkpoint.pysrc/synthorg/observability/events/persistence/circuit_breaker.pysrc/synthorg/observability/events/persistence/codebase_structure_map.pysrc/synthorg/observability/events/persistence/collab_metric.pysrc/synthorg/observability/events/persistence/connection.pysrc/synthorg/observability/events/persistence/connection_secret.pysrc/synthorg/observability/events/persistence/conversation.pysrc/synthorg/observability/events/persistence/conversation_turn.pysrc/synthorg/observability/events/persistence/conversational.pysrc/synthorg/observability/events/persistence/conversational_proposal.pysrc/synthorg/observability/events/persistence/cost_claim_dedupe.pysrc/synthorg/observability/events/persistence/cost_forecast.pysrc/synthorg/observability/events/persistence/cost_record.pysrc/synthorg/observability/events/persistence/decision_record.pysrc/synthorg/observability/events/persistence/dynamic_tool.pysrc/synthorg/observability/events/persistence/flight_recorder.pysrc/synthorg/observability/events/persistence/heartbeat.pysrc/synthorg/observability/events/persistence/knowledge_provenance.pysrc/synthorg/observability/events/persistence/knowledge_source.pysrc/synthorg/observability/events/persistence/lifecycle_event.pysrc/synthorg/observability/events/persistence/mcp_installation.pysrc/synthorg/observability/events/persistence/meeting_cooldown.pysrc/synthorg/observability/events/persistence/message.pysrc/synthorg/observability/events/persistence/migration.pysrc/synthorg/observability/events/persistence/oauth_state.pysrc/synthorg/observability/events/persistence/parked_context.pysrc/synthorg/observability/events/persistence/preset_override.pysrc/synthorg/observability/events/persistence/principle_override.pysrc/synthorg/observability/events/persistence/project.pysrc/synthorg/observability/events/persistence/project_cost_agg.pysrc/synthorg/observability/events/persistence/project_doc.pysrc/synthorg/observability/events/persistence/project_environment.pysrc/synthorg/observability/events/persistence/project_workspace.pysrc/synthorg/observability/events/persistence/research_run.pysrc/synthorg/observability/events/persistence/risk_override.pysrc/synthorg/observability/events/persistence/seen_claims.pysrc/synthorg/observability/events/persistence/setting.pysrc/synthorg/observability/events/persistence/ssrf_violation.pysrc/synthorg/observability/events/persistence/subworkflow.pysrc/synthorg/observability/events/persistence/task.pysrc/synthorg/observability/events/persistence/task_metric.pysrc/synthorg/observability/events/persistence/timescaledb.pysrc/synthorg/observability/events/persistence/tracked_container.pysrc/synthorg/observability/events/persistence/user.pysrc/synthorg/observability/events/persistence/webhook_receipt.pysrc/synthorg/observability/events/persistence/workflow_def.pysrc/synthorg/observability/events/persistence/workflow_exec.pysrc/synthorg/observability/events/project_brain.pysrc/synthorg/persistence/_conversation_marshalling.pysrc/synthorg/persistence/_shared/audit.pysrc/synthorg/persistence/_shared/charter_marshalling.pysrc/synthorg/persistence/_shared/cost_forecast_marshalling.pysrc/synthorg/persistence/_shared/workflow_definition_marshalling.pysrc/synthorg/persistence/_shared/workflow_execution_marshalling.pysrc/synthorg/persistence/charter_factory.pysrc/synthorg/persistence/conversational_factory.pysrc/synthorg/persistence/factory.pysrc/synthorg/persistence/filesystem_artifact_storage.pysrc/synthorg/persistence/migration_helpers.pysrc/synthorg/persistence/migrations.pysrc/synthorg/persistence/postgres/_backend_accessors.pysrc/synthorg/persistence/postgres/agent_state_repo.pysrc/synthorg/persistence/postgres/artifact_repo.pysrc/synthorg/persistence/postgres/audit_repository.pysrc/synthorg/persistence/postgres/backend.pysrc/synthorg/persistence/postgres/backend_connection.pysrc/synthorg/persistence/postgres/backend_migration.pysrc/synthorg/persistence/postgres/ceremony_scheduler_state_repo.pysrc/synthorg/persistence/postgres/charter_repo.pysrc/synthorg/persistence/postgres/checkpoint_repo.pysrc/synthorg/persistence/postgres/circuit_breaker_repo.pysrc/synthorg/persistence/postgres/codebase_structure_map_repo.pysrc/synthorg/persistence/postgres/connection_repo.pysrc/synthorg/persistence/postgres/connection_secret_repo.pysrc/synthorg/persistence/postgres/conversation_repo.pysrc/synthorg/persistence/postgres/conversational_proposal_repo.pysrc/synthorg/persistence/postgres/cost_forecast_repo.pysrc/synthorg/persistence/postgres/cost_record_repo.pysrc/synthorg/persistence/postgres/decision/_audit.pysrc/synthorg/persistence/postgres/decision/_cas.pysrc/synthorg/persistence/postgres/decision/_query.pysrc/synthorg/persistence/postgres/docs_repo.pysrc/synthorg/persistence/postgres/flight_recorder_repo.pysrc/synthorg/persistence/postgres/heartbeat_repo.pysrc/synthorg/persistence/postgres/hr_repositories.pysrc/synthorg/persistence/postgres/knowledge_provenance_repo.pysrc/synthorg/persistence/postgres/knowledge_source_repo.pysrc/synthorg/persistence/postgres/mcp_installation_repo.pysrc/synthorg/persistence/postgres/meeting_cooldown_repo.pysrc/synthorg/persistence/postgres/message_repo.pysrc/synthorg/persistence/postgres/oauth_state_repo.pysrc/synthorg/persistence/postgres/parked_context_repo.pysrc/synthorg/persistence/postgres/preset_override_repo.pysrc/synthorg/persistence/postgres/principle_override_repo.pysrc/synthorg/persistence/postgres/project_cost_aggregate_repo.pysrc/synthorg/persistence/postgres/project_environment_repo.pysrc/synthorg/persistence/postgres/project_repo.pysrc/synthorg/persistence/postgres/project_workspace_repo.pysrc/synthorg/persistence/postgres/provider_audit_repo.pysrc/synthorg/persistence/postgres/research_run_repo.pysrc/synthorg/persistence/postgres/risk_override_repo.pysrc/synthorg/persistence/postgres/seen_claims_repo.pysrc/synthorg/persistence/postgres/ssrf_violation_repo.pysrc/synthorg/persistence/postgres/subworkflow_repo/_crud.pysrc/synthorg/persistence/postgres/subworkflow_repo/_marshalling.pysrc/synthorg/persistence/postgres/subworkflow_repo/_references.pysrc/synthorg/persistence/postgres/task_repo.pysrc/synthorg/persistence/postgres/tool_blueprint_repo.pysrc/synthorg/persistence/postgres/tracked_container_repo.pysrc/synthorg/persistence/postgres/user_repo.pysrc/synthorg/persistence/postgres/webhook_receipt_repo.pysrc/synthorg/persistence/postgres/workflow_definition_repo.pysrc/synthorg/persistence/postgres/workflow_execution_repo.pysrc/synthorg/persistence/sqlite/_backend_accessors.pysrc/synthorg/persistence/sqlite/agent_state_repo.pysrc/synthorg/persistence/sqlite/artifact_repo.pysrc/synthorg/persistence/sqlite/audit_repository.pysrc/synthorg/persistence/sqlite/backend.pysrc/synthorg/persistence/sqlite/ceremony_scheduler_state_repo.pysrc/synthorg/persistence/sqlite/charter_repo.pysrc/synthorg/persistence/sqlite/checkpoint_repo.pysrc/synthorg/persistence/sqlite/circuit_breaker_repo.pysrc/synthorg/persistence/sqlite/codebase_structure_map_repo.pysrc/synthorg/persistence/sqlite/connection_repo.pysrc/synthorg/persistence/sqlite/connection_secret_repo.pysrc/synthorg/persistence/sqlite/conversation_repo/_header.pysrc/synthorg/persistence/sqlite/conversation_repo/_turns.pysrc/synthorg/persistence/sqlite/conversational_proposal_repo.pysrc/synthorg/persistence/sqlite/cost_forecast_repo.pysrc/synthorg/persistence/sqlite/cost_record_repo.pysrc/synthorg/persistence/sqlite/decision/_audit.pysrc/synthorg/persistence/sqlite/decision/_base.pysrc/synthorg/persistence/sqlite/decision/_cas.pysrc/synthorg/persistence/sqlite/decision/_query.pysrc/synthorg/persistence/sqlite/docs_repo.pysrc/synthorg/persistence/sqlite/flight_recorder_repo.pysrc/synthorg/persistence/sqlite/heartbeat_repo.pysrc/synthorg/persistence/sqlite/hr_repositories.pysrc/synthorg/persistence/sqlite/knowledge_provenance_repo.pysrc/synthorg/persistence/sqlite/knowledge_source_repo.pysrc/synthorg/persistence/sqlite/mcp_installation_repo.pysrc/synthorg/persistence/sqlite/meeting_cooldown_repo.pysrc/synthorg/persistence/sqlite/message_repo.pysrc/synthorg/persistence/sqlite/oauth_state_repo.pysrc/synthorg/persistence/sqlite/parked_context_repo.pysrc/synthorg/persistence/sqlite/preset_override_repo.pysrc/synthorg/persistence/sqlite/principle_override_repo.pysrc/synthorg/persistence/sqlite/project_cost_aggregate_repo.pysrc/synthorg/persistence/sqlite/project_environment_repo.pysrc/synthorg/persistence/sqlite/project_repo.pysrc/synthorg/persistence/sqlite/project_workspace_repo.pysrc/synthorg/persistence/sqlite/provider_audit_repo.pysrc/synthorg/persistence/sqlite/research_run_repo.pysrc/synthorg/persistence/sqlite/risk_override_repo.pysrc/synthorg/persistence/sqlite/seen_claims_repo.pysrc/synthorg/persistence/sqlite/ssrf_violation_repo.pysrc/synthorg/persistence/sqlite/subworkflow_repo.pysrc/synthorg/persistence/sqlite/task_repo.pysrc/synthorg/persistence/sqlite/tool_blueprint_repo.pysrc/synthorg/persistence/sqlite/tracked_container_repo.pysrc/synthorg/persistence/sqlite/user_repo.pysrc/synthorg/persistence/sqlite/webhook_receipt_repo.pysrc/synthorg/persistence/sqlite/workflow_definition_repo.pysrc/synthorg/persistence/sqlite/workflow_execution_repo.pytests/unit/observability/test_events.pytests/unit/persistence/_shared/test_audit_helpers.pytests/unit/scripts/test_check_no_central_junk_drawer.pytests/unit/scripts/test_check_no_growth_in_god_modules.pytests/unit/scripts/test_check_persistence_boundary.py
💤 Files with no reviewable changes (1)
- src/synthorg/observability/events/persistence.py
Remove migration-status framing flagged by CodeRabbit: - CLAUDE.md Module-Size Budget bullet: drop the issue-style ref and the persistence.py/api-entries migration narrative; keep normative policy. - ADR-0006 / ADR-0008: restate the lines this PR touched as current state, dropping the per-subdomain dissolution bookkeeping and now-stale events/persistence.py mentions. Pre-existing EPIC/follow-up references that form the ADR decision-record structure are kept.
The .test_durations.{unit,integration} timing manifests key durations by
pytest node IDs, which embed credential-detector and em-dash-hook
parametrize labels (PEM begin/end marker text, HTML entities) and omit a
trailing newline. They tripped detect-private-key, no-em-dashes,
end-of-file-fixer, and mixed-line-ending whenever a push range included a
.test_durations refresh from main. Exclude the two generated files from
those four content hooks.
PG01 (postgres.excessive_locks) demands CREATE INDEX CONCURRENTLY. Every index in the Postgres revisions is built in the same migration that creates its table, so the table is empty and the build locks nothing. CONCURRENTLY cannot run inside a transaction, so adopting it would only make these migrations non-atomic for no availability gain. Exclude the rule; re-enable when a migration indexes an already-populated table under live traffic.
0764362 to
e3ea2b0
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
.pre-commit-config.yaml (3)
884-884:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRemove stale file pattern reference to dissolved
events/persistence.py.The file pattern includes
observability/events/persistence\.py, which is being removed in this PR. Remove the obsolete pattern.Suggested fix
- files: ^(src/synthorg/(core/enums\.py|observability/events/persistence\.py|api/state\.py)|scripts/check_no_central_junk_drawer\.py|scripts/_central_junk_drawer_baseline\.json|\.pre-commit-config\.yaml)$ + files: ^(src/synthorg/(core/enums\.py|api/state\.py)|scripts/check_no_central_junk_drawer\.py|scripts/_central_junk_drawer_baseline\.json|\.pre-commit-config\.yaml)$🤖 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 @.pre-commit-config.yaml at line 884, The .pre-commit-config.yaml files regex still references the removed path "observability/events/persistence\.py"; edit the pattern string under the affected files entry to remove that obsolete segment (i.e., delete the `observability/events/persistence\.py` alternative from the files: ^(... ) pattern) so the regex no longer matches the dissolved file path while preserving the other listed patterns such as `src/synthorg/core/enums\.py`, `api/state\.py`, and the scripts.
875-875:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRemove stale file pattern reference to dissolved
events/persistence.py.The file pattern still includes
observability/events/persistence\.py, which is being removed in this PR. Clean up the trigger pattern to remove the non-existent file.Suggested fix
- files: ^(src/synthorg/(core/enums\.py|observability/events/persistence\.py)|scripts/check_no_growth_in_god_modules\.py|\.pre-commit-config\.yaml)$ + files: ^(src/synthorg/core/enums\.py|scripts/check_no_growth_in_god_modules\.py|\.pre-commit-config\.yaml)$🤖 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 @.pre-commit-config.yaml at line 875, Update the regex in the files entry that currently includes the stale pattern "observability/events/persistence\.py" so the pre-commit hook no longer references a removed file; locate the files: ^(src/synthorg/(core/enums\.py|observability/events/persistence\.py)|scripts/check_no_growth_in_god_modules\.py|\.pre-commit-config\.yaml)$ pattern in .pre-commit-config.yaml and remove the "observability/events/persistence\.py" alternative (adjust the grouped alternation to "src/synthorg/(core/enums\.py)" or expand as needed) so the regex only matches existing paths.
872-872:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate hook display name to reflect removal of
events/persistence.py.The hook name still lists
events/persistence.pyas a god-module, but this file has been dissolved into a per-subdomain package per the PR objectives. Onlycore/enums.pyremains as the allowlisted god-module per the updated CLAUDE.md line 20.Suggested fix
- name: god-modules must net-shrink (core/enums.py, events/persistence.py) + name: god-modules must net-shrink (core/enums.py)🤖 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 @.pre-commit-config.yaml at line 872, Update the pre-commit hook display name that currently reads "god-modules must net-shrink (core/enums.py, events/persistence.py)" to reflect removal of events/persistence.py by changing it to "god-modules must net-shrink (core/enums.py)"; locate the hook entry using the exact name string in .pre-commit-config.yaml and edit the name value so the only allowlisted module shown is core/enums.py.
🤖 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.
Outside diff comments:
In @.pre-commit-config.yaml:
- Line 884: The .pre-commit-config.yaml files regex still references the removed
path "observability/events/persistence\.py"; edit the pattern string under the
affected files entry to remove that obsolete segment (i.e., delete the
`observability/events/persistence\.py` alternative from the files: ^(... )
pattern) so the regex no longer matches the dissolved file path while preserving
the other listed patterns such as `src/synthorg/core/enums\.py`,
`api/state\.py`, and the scripts.
- Line 875: Update the regex in the files entry that currently includes the
stale pattern "observability/events/persistence\.py" so the pre-commit hook no
longer references a removed file; locate the files:
^(src/synthorg/(core/enums\.py|observability/events/persistence\.py)|scripts/check_no_growth_in_god_modules\.py|\.pre-commit-config\.yaml)$
pattern in .pre-commit-config.yaml and remove the
"observability/events/persistence\.py" alternative (adjust the grouped
alternation to "src/synthorg/(core/enums\.py)" or expand as needed) so the regex
only matches existing paths.
- Line 872: Update the pre-commit hook display name that currently reads
"god-modules must net-shrink (core/enums.py, events/persistence.py)" to reflect
removal of events/persistence.py by changing it to "god-modules must net-shrink
(core/enums.py)"; locate the hook entry using the exact name string in
.pre-commit-config.yaml and edit the name value so the only allowlisted module
shown is core/enums.py.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 1ba63dfe-f761-4bb9-94af-18f1e99337ba
📒 Files selected for processing (200)
.pre-commit-config.yaml.sqlfluffCLAUDE.mddata/architecture_report.jsondata/codebase_map.jsondata/feature_index.jsondocs/decisions/0006-tiered-module-size-policy.mddocs/decisions/0008-controller-decomposition.mddocs/reference/conventions.mdscripts/_central_junk_drawer_baseline.jsonscripts/check_no_central_junk_drawer.pyscripts/check_no_growth_in_god_modules.pyscripts/check_persistence_boundary.pyscripts/convention_gate_map.yamlsrc/synthorg/api/controllers/artifacts.pysrc/synthorg/api/lifecycle_builder.pysrc/synthorg/api/lifecycle_helpers/ticket_cleanup.pysrc/synthorg/api/webhook_cleanup.pysrc/synthorg/engine/artifacts/service.pysrc/synthorg/integrations/mcp_catalog/in_memory_installations.pysrc/synthorg/observability/events/deliverable_receipts.pysrc/synthorg/observability/events/persistence.pysrc/synthorg/observability/events/persistence/__init__.pysrc/synthorg/observability/events/persistence/agent_state.pysrc/synthorg/observability/events/persistence/api_key.pysrc/synthorg/observability/events/persistence/artifact.pysrc/synthorg/observability/events/persistence/artifact_storage.pysrc/synthorg/observability/events/persistence/audit_entry.pysrc/synthorg/observability/events/persistence/backend.pysrc/synthorg/observability/events/persistence/ceremony_state.pysrc/synthorg/observability/events/persistence/charter.pysrc/synthorg/observability/events/persistence/checkpoint.pysrc/synthorg/observability/events/persistence/circuit_breaker.pysrc/synthorg/observability/events/persistence/codebase_structure_map.pysrc/synthorg/observability/events/persistence/collab_metric.pysrc/synthorg/observability/events/persistence/connection.pysrc/synthorg/observability/events/persistence/connection_secret.pysrc/synthorg/observability/events/persistence/conversation.pysrc/synthorg/observability/events/persistence/conversation_turn.pysrc/synthorg/observability/events/persistence/conversational.pysrc/synthorg/observability/events/persistence/conversational_proposal.pysrc/synthorg/observability/events/persistence/cost_claim_dedupe.pysrc/synthorg/observability/events/persistence/cost_forecast.pysrc/synthorg/observability/events/persistence/cost_record.pysrc/synthorg/observability/events/persistence/decision_record.pysrc/synthorg/observability/events/persistence/dynamic_tool.pysrc/synthorg/observability/events/persistence/flight_recorder.pysrc/synthorg/observability/events/persistence/heartbeat.pysrc/synthorg/observability/events/persistence/knowledge_provenance.pysrc/synthorg/observability/events/persistence/knowledge_source.pysrc/synthorg/observability/events/persistence/lifecycle_event.pysrc/synthorg/observability/events/persistence/mcp_installation.pysrc/synthorg/observability/events/persistence/meeting_cooldown.pysrc/synthorg/observability/events/persistence/message.pysrc/synthorg/observability/events/persistence/migration.pysrc/synthorg/observability/events/persistence/oauth_state.pysrc/synthorg/observability/events/persistence/parked_context.pysrc/synthorg/observability/events/persistence/preset_override.pysrc/synthorg/observability/events/persistence/principle_override.pysrc/synthorg/observability/events/persistence/project.pysrc/synthorg/observability/events/persistence/project_cost_agg.pysrc/synthorg/observability/events/persistence/project_doc.pysrc/synthorg/observability/events/persistence/project_environment.pysrc/synthorg/observability/events/persistence/project_workspace.pysrc/synthorg/observability/events/persistence/research_run.pysrc/synthorg/observability/events/persistence/risk_override.pysrc/synthorg/observability/events/persistence/seen_claims.pysrc/synthorg/observability/events/persistence/setting.pysrc/synthorg/observability/events/persistence/ssrf_violation.pysrc/synthorg/observability/events/persistence/subworkflow.pysrc/synthorg/observability/events/persistence/task.pysrc/synthorg/observability/events/persistence/task_metric.pysrc/synthorg/observability/events/persistence/timescaledb.pysrc/synthorg/observability/events/persistence/tracked_container.pysrc/synthorg/observability/events/persistence/user.pysrc/synthorg/observability/events/persistence/webhook_receipt.pysrc/synthorg/observability/events/persistence/workflow_def.pysrc/synthorg/observability/events/persistence/workflow_exec.pysrc/synthorg/observability/events/project_brain.pysrc/synthorg/persistence/_conversation_marshalling.pysrc/synthorg/persistence/_shared/audit.pysrc/synthorg/persistence/_shared/charter_marshalling.pysrc/synthorg/persistence/_shared/cost_forecast_marshalling.pysrc/synthorg/persistence/_shared/workflow_definition_marshalling.pysrc/synthorg/persistence/_shared/workflow_execution_marshalling.pysrc/synthorg/persistence/charter_factory.pysrc/synthorg/persistence/conversational_factory.pysrc/synthorg/persistence/factory.pysrc/synthorg/persistence/filesystem_artifact_storage.pysrc/synthorg/persistence/migration_helpers.pysrc/synthorg/persistence/migrations.pysrc/synthorg/persistence/postgres/_backend_accessors.pysrc/synthorg/persistence/postgres/agent_state_repo.pysrc/synthorg/persistence/postgres/artifact_repo.pysrc/synthorg/persistence/postgres/audit_repository.pysrc/synthorg/persistence/postgres/backend.pysrc/synthorg/persistence/postgres/backend_connection.pysrc/synthorg/persistence/postgres/backend_migration.pysrc/synthorg/persistence/postgres/ceremony_scheduler_state_repo.pysrc/synthorg/persistence/postgres/charter_repo.pysrc/synthorg/persistence/postgres/checkpoint_repo.pysrc/synthorg/persistence/postgres/circuit_breaker_repo.pysrc/synthorg/persistence/postgres/codebase_structure_map_repo.pysrc/synthorg/persistence/postgres/connection_repo.pysrc/synthorg/persistence/postgres/connection_secret_repo.pysrc/synthorg/persistence/postgres/conversation_repo.pysrc/synthorg/persistence/postgres/conversational_proposal_repo.pysrc/synthorg/persistence/postgres/cost_forecast_repo.pysrc/synthorg/persistence/postgres/cost_record_repo.pysrc/synthorg/persistence/postgres/decision/_audit.pysrc/synthorg/persistence/postgres/decision/_cas.pysrc/synthorg/persistence/postgres/decision/_query.pysrc/synthorg/persistence/postgres/docs_repo.pysrc/synthorg/persistence/postgres/flight_recorder_repo.pysrc/synthorg/persistence/postgres/heartbeat_repo.pysrc/synthorg/persistence/postgres/hr_repositories.pysrc/synthorg/persistence/postgres/knowledge_provenance_repo.pysrc/synthorg/persistence/postgres/knowledge_source_repo.pysrc/synthorg/persistence/postgres/mcp_installation_repo.pysrc/synthorg/persistence/postgres/meeting_cooldown_repo.pysrc/synthorg/persistence/postgres/message_repo.pysrc/synthorg/persistence/postgres/oauth_state_repo.pysrc/synthorg/persistence/postgres/parked_context_repo.pysrc/synthorg/persistence/postgres/preset_override_repo.pysrc/synthorg/persistence/postgres/principle_override_repo.pysrc/synthorg/persistence/postgres/project_cost_aggregate_repo.pysrc/synthorg/persistence/postgres/project_environment_repo.pysrc/synthorg/persistence/postgres/project_repo.pysrc/synthorg/persistence/postgres/project_workspace_repo.pysrc/synthorg/persistence/postgres/provider_audit_repo.pysrc/synthorg/persistence/postgres/research_run_repo.pysrc/synthorg/persistence/postgres/risk_override_repo.pysrc/synthorg/persistence/postgres/seen_claims_repo.pysrc/synthorg/persistence/postgres/ssrf_violation_repo.pysrc/synthorg/persistence/postgres/subworkflow_repo/_crud.pysrc/synthorg/persistence/postgres/subworkflow_repo/_marshalling.pysrc/synthorg/persistence/postgres/subworkflow_repo/_references.pysrc/synthorg/persistence/postgres/task_repo.pysrc/synthorg/persistence/postgres/tool_blueprint_repo.pysrc/synthorg/persistence/postgres/tracked_container_repo.pysrc/synthorg/persistence/postgres/user_repo.pysrc/synthorg/persistence/postgres/webhook_receipt_repo.pysrc/synthorg/persistence/postgres/workflow_definition_repo.pysrc/synthorg/persistence/postgres/workflow_execution_repo.pysrc/synthorg/persistence/sqlite/_backend_accessors.pysrc/synthorg/persistence/sqlite/agent_state_repo.pysrc/synthorg/persistence/sqlite/artifact_repo.pysrc/synthorg/persistence/sqlite/audit_repository.pysrc/synthorg/persistence/sqlite/backend.pysrc/synthorg/persistence/sqlite/ceremony_scheduler_state_repo.pysrc/synthorg/persistence/sqlite/charter_repo.pysrc/synthorg/persistence/sqlite/checkpoint_repo.pysrc/synthorg/persistence/sqlite/circuit_breaker_repo.pysrc/synthorg/persistence/sqlite/codebase_structure_map_repo.pysrc/synthorg/persistence/sqlite/connection_repo.pysrc/synthorg/persistence/sqlite/connection_secret_repo.pysrc/synthorg/persistence/sqlite/conversation_repo/_header.pysrc/synthorg/persistence/sqlite/conversation_repo/_turns.pysrc/synthorg/persistence/sqlite/conversational_proposal_repo.pysrc/synthorg/persistence/sqlite/cost_forecast_repo.pysrc/synthorg/persistence/sqlite/cost_record_repo.pysrc/synthorg/persistence/sqlite/decision/_audit.pysrc/synthorg/persistence/sqlite/decision/_base.pysrc/synthorg/persistence/sqlite/decision/_cas.pysrc/synthorg/persistence/sqlite/decision/_query.pysrc/synthorg/persistence/sqlite/docs_repo.pysrc/synthorg/persistence/sqlite/flight_recorder_repo.pysrc/synthorg/persistence/sqlite/heartbeat_repo.pysrc/synthorg/persistence/sqlite/hr_repositories.pysrc/synthorg/persistence/sqlite/knowledge_provenance_repo.pysrc/synthorg/persistence/sqlite/knowledge_source_repo.pysrc/synthorg/persistence/sqlite/mcp_installation_repo.pysrc/synthorg/persistence/sqlite/meeting_cooldown_repo.pysrc/synthorg/persistence/sqlite/message_repo.pysrc/synthorg/persistence/sqlite/oauth_state_repo.pysrc/synthorg/persistence/sqlite/parked_context_repo.pysrc/synthorg/persistence/sqlite/preset_override_repo.pysrc/synthorg/persistence/sqlite/principle_override_repo.pysrc/synthorg/persistence/sqlite/project_cost_aggregate_repo.pysrc/synthorg/persistence/sqlite/project_environment_repo.pysrc/synthorg/persistence/sqlite/project_repo.pysrc/synthorg/persistence/sqlite/project_workspace_repo.pysrc/synthorg/persistence/sqlite/provider_audit_repo.pysrc/synthorg/persistence/sqlite/research_run_repo.pysrc/synthorg/persistence/sqlite/risk_override_repo.pysrc/synthorg/persistence/sqlite/seen_claims_repo.pysrc/synthorg/persistence/sqlite/ssrf_violation_repo.pysrc/synthorg/persistence/sqlite/subworkflow_repo.pysrc/synthorg/persistence/sqlite/task_repo.pysrc/synthorg/persistence/sqlite/tool_blueprint_repo.pysrc/synthorg/persistence/sqlite/tracked_container_repo.pysrc/synthorg/persistence/sqlite/user_repo.pysrc/synthorg/persistence/sqlite/webhook_receipt_repo.pysrc/synthorg/persistence/sqlite/workflow_definition_repo.pysrc/synthorg/persistence/sqlite/workflow_execution_repo.pytests/unit/observability/test_events.pytests/unit/persistence/_shared/test_audit_helpers.pytests/unit/scripts/test_check_no_central_junk_drawer.pytests/unit/scripts/test_check_no_growth_in_god_modules.pytests/unit/scripts/test_check_persistence_boundary.py
💤 Files with no reviewable changes (1)
- src/synthorg/observability/events/persistence.py
CodeRabbit outside-diff findings: .pre-commit-config.yaml still referenced the dissolved observability/events/persistence.py. Dropped it from the no-growth-in-god-modules and no-central-junk-drawer files: triggers, updated the god-modules hook display name to (core/enums.py), and fixed the stale comment. The file is now a per-subdomain package and neither gate script tracks it.
Summary
Dissolves the 895-line
observability/events/persistence.pyjunk-drawer (380persistence.<entity>.<action>logging-event constants spanning ~54 unrelatedsub-domains) into a per-subdomain package
observability/events/persistence/, onemodule per entity. This is Wave 1 of the package-vertical hardening program (parent
#2051, EPIC #2046), independent of the enum slices.
Closes #2246
What changed
observability/events/persistence/with an empty declarative__init__.py(no__all__re-export bag) plus 55 entity modules (task.py,cost_record.py,cost_forecast.py,artifact.py,artifact_storage.py,connection_secret.py, ...). Each is# module-kind: declarative. The monolith isdeleted.
values (e.g.
PERSISTENCE_ARTIFACT_STORED = "persistence.artifact_storage.stored"),so placement follows the value's second dotted segment. This keeps a clean 1:1
correspondence: each repository imports from exactly the event module that mirrors it.
task.py, not_task.py): sub-modules ARE the publicsurface; ~129 callsites import directly from them.
check_no_growth_in_god_modules.py,check_no_central_junk_drawer.py, CLAUDE.md andADR-0006/0008; regenerated
data/architecture_report.json. Added a--update-baselineflag to
check_no_central_junk_drawer.pywith tests.test_events.pyswitched topkgutil.walk_packagesso the now-fragmented persistence constants stay covered by
test_no_duplicates/test_follow_dot_pattern; addedtest_persistence_subpackage_is_walked.Verification
ruff+mypy --strictgreen; full-m unitsuite green.Review
Pre-PR review ran 9 focused agents (persistence / python / code-reviewer / docs /
comment-quality-rot / conventions / test-quality / type-design / logging). Core refactor
got APPROVE from the persistence, python, and code reviewers; 13 findings (stale
references + test-hardening) addressed in
07643623d.Follow-up (operator action)
The stale
events/persistence.pyentry inscripts/_central_junk_drawer_baseline.jsonis classifier-blocked for the agent. Regenerate locally with:
then commit the result onto this branch before merge.