Conversation
Issue #1313: [Audit] Consolidate duplicated dialect/DB/chain helpers into shared modulesAutomated Status SummaryScopeThe dual-dialect DB layer is implemented by per-module copies of the same helpers instead of shared functions, so every new flow re-implements (and can drift on) dialect handling. Verified copies at
Est. ~210 LOC of duplication; the risk is divergence (a fix applied to one copy and not the others) — the same defect class behind several other audit findings. Tasks
Acceptance Criteria
Full Issue TextWhyThe dual-dialect DB layer is implemented by per-module copies of the same helpers instead of shared functions, so every new flow re-implements (and can drift on) dialect handling. Verified copies at
Est. ~210 LOC of duplication; the risk is divergence (a fix applied to one copy and not the others) — the same defect class behind several other audit findings. ScopeConsolidate the duplicated dialect/DB/chain helpers into shared locations ( Non-Goals
Tasks
Acceptance Criteria
Implementation NotesAudit baseline: |
|
PR created. |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 48 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
To use Codex here, create a Codex account and connect to github. |
There was a problem hiding this comment.
Pull request overview
This PR appears to be an automated “bootstrap” commit for Issue #1313, but it does not include any of the described consolidation work (shared DB/dialect helpers, chain utils, CIK normalization, or the single-definition/grep gate).
Changes:
- Adds a single bootstrap marker file for Codex tracking on issue #1313.
| @@ -0,0 +1 @@ | |||
| <!-- bootstrap for codex on issue #1313 --> | |||
|
Closing this bootstrap PR as duplicate cap clutter. Source issue #1313 was already implemented by PR #1361, which merged at 2026-07-01T21:24Z and has verify:compare sequencing pending on the reopened source issue. This PR only contains the generated agents/codex-1313.md bootstrap file, has Keepalive OFF, and should not consume opener capacity. |
Keepalive: OFF
Source Issue #1313: [Audit] Consolidate duplicated dialect/DB/chain helpers into shared modules
Base: main
Head: codex/issue-1313
Source: #1313
Automated Status Summary
Scope
The dual-dialect DB layer is implemented by per-module copies of the same helpers instead of shared functions, so every new flow re-implements (and can drift on) dialect handling. Verified copies at
e5764a5:_placeholder(conn)/_is_sqlite(conn)(pick?vs%s,isinstance(conn, sqlite3.Connection)) duplicated across 12 modules:etl/{activism_detection,activism_flow,conviction_flow,daily_diff_flow,digest_flow,edgar_flow,evaluation_flow,ingest_flow,news_flow}.py,api/{signals,chat,activism}.py._columns/_get_columns(SQLitePRAGMA/pragma_table_infovs PGinformation_schema.columns) inetl/digest_flow.py:84,etl/edgar_flow.py:62,api/search.py:47.api_usagetable DDL inetl/evaluation_flow.py:101,llm/cost_tracking.py:25,adapters/base.py:83/102._extract_json_text(chains/filing_summary.py:169,chains/holdings_analysis.py:155),_cursor_rows_to_dicts(same two),_guard_context/_acquire_connection(chains/rag_search.py,chains/nl_query.py),_normalize_cik(api/managers.py:245,scripts/seed_universe.py:23,scripts/resolve_aliases.py:29).Est. ~210 LOC of duplication; the risk is divergence (a fix applied to one copy and not the others) — the same defect class behind several other audit findings.
Tasks
is_sqlite(conn),get_placeholder(conn),get_table_columns(conn, table), and publicensure_api_usage_schema(conn)toadapters/base.py; replace the 12+3+3 call sites.extract_json_text()androws_to_dicts()tochains/utils.py; replace the chain copies. Centralize_guard_context/_acquire_connection.normalize_cik()and replace the 3 copies.Acceptance Criteria
_placeholdercopy in any module trips the single-definition gate.Full Issue Text
Why
The dual-dialect DB layer is implemented by per-module copies of the same helpers instead of shared functions, so every new flow re-implements (and can drift on) dialect handling. Verified copies at
e5764a5:_placeholder(conn)/_is_sqlite(conn)(pick?vs%s,isinstance(conn, sqlite3.Connection)) duplicated across 12 modules:etl/{activism_detection,activism_flow,conviction_flow,daily_diff_flow,digest_flow,edgar_flow,evaluation_flow,ingest_flow,news_flow}.py,api/{signals,chat,activism}.py._columns/_get_columns(SQLitePRAGMA/pragma_table_infovs PGinformation_schema.columns) inetl/digest_flow.py:84,etl/edgar_flow.py:62,api/search.py:47.api_usagetable DDL inetl/evaluation_flow.py:101,llm/cost_tracking.py:25,adapters/base.py:83/102._extract_json_text(chains/filing_summary.py:169,chains/holdings_analysis.py:155),_cursor_rows_to_dicts(same two),_guard_context/_acquire_connection(chains/rag_search.py,chains/nl_query.py),_normalize_cik(api/managers.py:245,scripts/seed_universe.py:23,scripts/resolve_aliases.py:29).Est. ~210 LOC of duplication; the risk is divergence (a fix applied to one copy and not the others) — the same defect class behind several other audit findings.
Scope
Consolidate the duplicated dialect/DB/chain helpers into shared locations (
adapters/base.pyfor DB;chains/utils.pyfor chain helpers; autilsnormalizer for CIK) and update call sites to import them.Non-Goals
check_dialect_portability.pygate semantics.Tasks
is_sqlite(conn),get_placeholder(conn),get_table_columns(conn, table), and publicensure_api_usage_schema(conn)toadapters/base.py; replace the 12+3+3 call sites.extract_json_text()androws_to_dicts()tochains/utils.py; replace the chain copies. Centralize_guard_context/_acquire_connection.normalize_cik()and replace the 3 copies.Acceptance Criteria
_placeholdercopy in any module trips the single-definition gate.Implementation Notes
Audit baseline:
main@e5764a5on 2026-06-28. Call sites enumerated by the duplication sweep (Code/Audits/Manager-Database/2026-06-28-02-duplication-quality.md).—
PR created automatically to engage Codex.