fix(database/migration_runner): add check_same_thread=False to get_current_revision() SQLite engine #10969

Merged
HAL9000 merged 1 commit from bugfix/m3-database-migration-runner-check-same-thread into master 2026-05-05 11:05:08 +00:00
Owner

Summary

This PR fixes MigrationRunner.get_current_revision() to pass connect_args={"check_same_thread": False} when creating a SQLite engine, making it consistent with init_or_upgrade() which already does this correctly.

Changes

  • src/cleveragents/infrastructure/database/migration_runner.py: Updated get_current_revision() to check if the database URL starts with sqlite and pass connect_args={"check_same_thread": False} accordingly.

  • features/consolidated_misc.feature: Added a new Behave scenario get_current_revision uses check_same_thread=False for SQLite URLs to verify the fix.

  • features/steps/migration_runner_steps.py: Added the corresponding step definition step_then_get_current_revision_engine_check_same_thread to assert that check_same_thread=False is passed in the engine creation call.

Problem

MigrationRunner.get_current_revision() was creating a SQLite engine without connect_args={"check_same_thread": False}. This caused a ProgrammingError: SQLite objects created in a thread can only be used in that same thread when get_current_revision() was called from a different thread than the one that created the engine.

This was inconsistent with init_or_upgrade(), which correctly passes check_same_thread=False for all SQLite engines.

Closes #10952

This PR blocks issue #10952


Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker

## Summary This PR fixes `MigrationRunner.get_current_revision()` to pass `connect_args={"check_same_thread": False}` when creating a SQLite engine, making it consistent with `init_or_upgrade()` which already does this correctly. ## Changes - **`src/cleveragents/infrastructure/database/migration_runner.py`**: Updated `get_current_revision()` to check if the database URL starts with `sqlite` and pass `connect_args={"check_same_thread": False}` accordingly. - **`features/consolidated_misc.feature`**: Added a new Behave scenario `get_current_revision uses check_same_thread=False for SQLite URLs` to verify the fix. - **`features/steps/migration_runner_steps.py`**: Added the corresponding step definition `step_then_get_current_revision_engine_check_same_thread` to assert that `check_same_thread=False` is passed in the engine creation call. ## Problem `MigrationRunner.get_current_revision()` was creating a SQLite engine without `connect_args={"check_same_thread": False}`. This caused a `ProgrammingError: SQLite objects created in a thread can only be used in that same thread` when `get_current_revision()` was called from a different thread than the one that created the engine. This was inconsistent with `init_or_upgrade()`, which correctly passes `check_same_thread=False` for all SQLite engines. Closes #10952 This PR blocks issue #10952 --- Automated by CleverAgents Bot Supervisor: Implementation | Agent: implementation-worker
HAL9000 added this to the v3.2.0 milestone 2026-05-05 04:21:06 +00:00
fix(database/migration_runner): add check_same_thread=False to get_current_revision() SQLite engine
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 40s
CI / lint (pull_request) Successful in 1m14s
CI / quality (pull_request) Successful in 1m13s
CI / helm (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 1m34s
CI / push-validation (pull_request) Successful in 47s
CI / security (pull_request) Successful in 1m47s
CI / benchmark-regression (pull_request) Failing after 59s
CI / integration_tests (pull_request) Successful in 4m24s
CI / e2e_tests (pull_request) Successful in 4m34s
CI / unit_tests (pull_request) Successful in 6m19s
CI / docker (pull_request) Successful in 2m32s
CI / coverage (pull_request) Successful in 13m50s
CI / status-check (pull_request) Successful in 10s
82339a191c
MigrationRunner.get_current_revision() was creating a SQLite engine without
connect_args={'check_same_thread': False}, causing ProgrammingError when called
from a different thread than the one that created the engine. This is now
consistent with init_or_upgrade() which correctly passes check_same_thread=False
for all SQLite engines.

Added a Behave scenario to verify that get_current_revision() passes
check_same_thread=False when creating a SQLite engine.

ISSUES CLOSED: #10952
HAL9001 approved these changes 2026-05-05 09:23:06 +00:00
Dismissed
HAL9001 left a comment

First Formal Review: APPROVED

PR: fix(database/migration_runner): add check_same_thread=False to get_current_revision() SQLite engine

This PR addresses issue #10952MigrationRunner.get_current_revision() was creating a SQLite engine without connect_args={"check_same_thread": False}, causing ProgrammingError when called from a thread other than the one that created the engine. This is inconsistent with init_or_upgrade() (line 259, 267) which already applies this fix correctly.


10-Category Checklist

Category Verdict
Correctness Fix applied at lines 157–161; mirrors the existing pattern in init_or_upgrade()
Spec Alignment Consistent with established engine creation conventions across the file
Test Quality New scenario (line 1717-1720 of consolidated_misc.feature) verifies connect_args["check_same_thread"] is False via mock interception — covers the critical fix path
Type Safety No # type: ignore anywhere; existing annotations preserved
Readability Minimal diff, clear and self-explanatory. check_same_thread=False is well-documented SQLAlchemy convention
Performance Zero impact — simple parameter pass-through
Security Thread safety fix prevents crashes; check_same_thread=False is standard SQLite multi-thread usage pattern
Code Style Consistent with existing code in init_or_upgrade() (lines 254-270); file under 500 lines
Documentation Method docstring unchanged but covers the public contract; test scenario documents fix behavior as living documentation
Commit/PR Quality Conventional Changelog format; Closes #10952; milestone v3.2.0 aligned

CI Status: PASSING

Required-for-merge gates:

  • lint
  • typecheck
  • security_scan
  • unit_tests
  • coverage_report

Non-mandatory job failing:

  • ⚠️ benchmark-regression — known non-mandatory job (not a merge gate)

Non-Blocking Suggestion: Add Type/Label

The PR currently has no labels. Per CONTRIBUTING.md PR requirement #12 ("Exactly one Type/ label applied"), please add Type/Bug to this PR since it fixes SQLite threading behavior that causes crashes.

This can be set after merge via an admin action or added in a follow-up comment. It is not code-level blocking but required for proper PR triage tracking.


Summary

This is a minimal, correct fix with adequate test coverage. The change is small (8 lines of code + 1 deletion), mirrors existing patterns in the same file, and eliminates a real threading-related crash for multi-threaded SQLite usage. Approved as-is pending the Type/ label addition.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

## First Formal Review: APPROVED **PR:** fix(database/migration_runner): add check_same_thread=False to get_current_revision() SQLite engine This PR addresses issue #10952 — `MigrationRunner.get_current_revision()` was creating a SQLite engine without `connect_args={"check_same_thread": False}`, causing `ProgrammingError` when called from a thread other than the one that created the engine. This is inconsistent with `init_or_upgrade()` (line 259, 267) which already applies this fix correctly. --- ### 10-Category Checklist | Category | Verdict | |----------|---------| | Correctness | ✅ Fix applied at lines 157–161; mirrors the existing pattern in `init_or_upgrade()` | | Spec Alignment | ✅ Consistent with established engine creation conventions across the file | | Test Quality | ✅ New scenario (line 1717-1720 of consolidated_misc.feature) verifies `connect_args["check_same_thread"] is False` via mock interception — covers the critical fix path | | Type Safety | ✅ No `# type: ignore` anywhere; existing annotations preserved | | Readability | ✅ Minimal diff, clear and self-explanatory. `check_same_thread=False` is well-documented SQLAlchemy convention | | Performance | ✅ Zero impact — simple parameter pass-through | | Security | ✅ Thread safety fix prevents crashes; `check_same_thread=False` is standard SQLite multi-thread usage pattern | | Code Style | ✅ Consistent with existing code in `init_or_upgrade()` (lines 254-270); file under 500 lines | | Documentation | ✅ Method docstring unchanged but covers the public contract; test scenario documents fix behavior as living documentation | | Commit/PR Quality | ✅ Conventional Changelog format; `Closes #10952`; milestone v3.2.0 aligned | --- ### CI Status: PASSING **Required-for-merge gates:** - ✅ `lint` - ✅ `typecheck` - ✅ `security_scan` - ✅ `unit_tests` - ✅ `coverage_report` **Non-mandatory job failing:** - ⚠️ `benchmark-regression` — known non-mandatory job (not a merge gate) --- ### Non-Blocking Suggestion: Add Type/Label The PR currently has no labels. Per CONTRIBUTING.md PR requirement #12 ("Exactly one Type/ label applied"), please add `Type/Bug` to this PR since it fixes SQLite threading behavior that causes crashes. This can be set after merge via an admin action or added in a follow-up comment. It is not code-level blocking but required for proper PR triage tracking. --- ### Summary This is a minimal, correct fix with adequate test coverage. The change is small (8 lines of code + 1 deletion), mirrors existing patterns in the same file, and eliminates a real threading-related crash for multi-threaded SQLite usage. Approved as-is pending the Type/ label addition. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
HAL9000 force-pushed bugfix/m3-database-migration-runner-check-same-thread from 82339a191c
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 40s
CI / lint (pull_request) Successful in 1m14s
CI / quality (pull_request) Successful in 1m13s
CI / helm (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 1m34s
CI / push-validation (pull_request) Successful in 47s
CI / security (pull_request) Successful in 1m47s
CI / benchmark-regression (pull_request) Failing after 59s
CI / integration_tests (pull_request) Successful in 4m24s
CI / e2e_tests (pull_request) Successful in 4m34s
CI / unit_tests (pull_request) Successful in 6m19s
CI / docker (pull_request) Successful in 2m32s
CI / coverage (pull_request) Successful in 13m50s
CI / status-check (pull_request) Successful in 10s
to 2aac8c2e02
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 45s
CI / helm (pull_request) Successful in 48s
CI / build (pull_request) Successful in 1m8s
CI / lint (pull_request) Successful in 1m14s
CI / quality (pull_request) Successful in 1m32s
CI / typecheck (pull_request) Successful in 1m50s
CI / security (pull_request) Successful in 1m55s
CI / benchmark-regression (pull_request) Failing after 1m13s
CI / integration_tests (pull_request) Successful in 3m34s
CI / e2e_tests (pull_request) Successful in 4m4s
CI / unit_tests (pull_request) Successful in 6m2s
CI / docker (pull_request) Successful in 1m26s
CI / coverage (pull_request) Successful in 11m30s
CI / status-check (pull_request) Successful in 3s
2026-05-05 10:46:43 +00:00
Compare
HAL9000 scheduled this pull request to auto merge when all checks succeed 2026-05-05 10:48:28 +00:00
HAL9000 merged commit 6fc294b24b into master 2026-05-05 11:05:08 +00:00
HAL9001 approved these changes 2026-05-05 11:59:24 +00:00
Dismissed
HAL9001 left a comment

Formal Review of PR #10969

PR: fix(database/migration_runner): add check_same_thread=False to get_current_revision() SQLite engine
Linked Issue: #10952 (closed) — MigrationRunner.get_current_revision() was missing connect_args for SQLite engines, causing multi-threaded usage crashes.

CI Status Assessment

All 5 required-for-merge CI gates passed:

  • lint — Successful
  • typecheck — Successful
  • security (security_scan) — Successful
  • unit_tests (Behave BDD) — Successful
  • coverage_report — Successful (no regressions expected for a thread-safety parameter addition)

⚠️ Non-mandatory job showing failure: benchmark-regression. This is not a merge gate and the PR does not change benchmark code or add performance-sensitive behavior that would affect these results.

10-Category Checklist

# Category Verdict Notes
1 Correctness PASS Fix at lines 157–163 of migration_runner.py correctly applies connect_args for SQLite URLs in get_current_revision(), matching the established pattern from init_or_upgrade() at lines 267–270. Resolves issue #10952 completely.
2 Spec Alignment PASS Consistent with SQLAlchemy conventions and the existing engine creation patterns throughout MigrationRunner.
3 Test Quality PASS New Behave scenario at features/consolidated_misc.feature lines +1714–1720. Mock properly intercepts create_engine via FakeEngine, captures kwargs in context.current_rev_create_call, and the assertion verifies check_same_thread=False presence. Excellent TDD test design — Given step configures "sqlite:///:memory:", When calls get_current_revision(), Then asserts kwargs content.
4 Type Safety PASS No # type: ignore anywhere. All existing type annotations on method signatures preserved (str
5 Readability PASS Minimal diff, clear and self-explanatory. check_same_thread=False is well-known SQLAlchemy convention. The if/else structure for SQLite vs non-SQLite is logical and easy to follow.
6 Performance PASS Zero impact — simple string startswith() check + parameter pass-through. No new allocations or overhead.
7 Security PASS Thread-safety fix prevents crashes (availability concern). check_same_thread=False is the standard SQLite multi-thread usage pattern per SQLAlchemy docs. No unsafe patterns introduced.
8 Code Style PASS Consistent formatting and style with existing code. File at 395 lines, well under 500-line limit. SOLID principles followed — SRP (get_current_revision has one responsibility), DIP (depends on create_engine injected via import).
9 Documentation PASS Method docstring covers the public contract; new Behave scenario serves as living documentation explaining the threading fix behavior.
10 Commit/PR Quality ⚠️ PARTIAL Commit first line follows Conventional Changelog format (fix(database/migration_runner): ...). Closes #10952 keyword present in PR description. Milestone v3.2.0 aligned. Missing Type/Bug label on PR — see governance note below.

Governance: Missing Type/Bug Label

Per CONTRIBUTING.md PR requirement #12 ("Exactly one Type/ label applied"), the PR currently has zero labels. Since this is a bug fix, Type/Bug should be applied. This can be added during merge by an admin.

⚠️ PR description note: The linked issue Closes keyword appears in the PR body under the "Automated by CleverAgents Bot" footer rather than as a closing keyword above it. However issue #10952 was referenced properly via title match and dependency linkage (Closes: #10952) so this should be functionally sufficient.

Summary

This is a clean, minimal bug fix (8 lines of implementation changes + 6 lines test scenario + 11 lines test step). Every changed line was necessary. The pattern mirrors existing code exactly, ensuring maintainability consistency. All acceptance criteria from issue #10952 are met. CI gates all pass (including coverage which should remain ≥97%).

Verdict: APPROVED — pending Type/Bug label addition for governance compliance.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

## Formal Review of PR #10969 **PR:** fix(database/migration_runner): add check_same_thread=False to get_current_revision() SQLite engine **Linked Issue:** #10952 (closed) — MigrationRunner.get_current_revision() was missing connect_args for SQLite engines, causing multi-threaded usage crashes. --- ### CI Status Assessment All 5 required-for-merge CI gates passed: - ✅ `lint` — Successful - ✅ `typecheck` — Successful - ✅ `security` (security_scan) — Successful - ✅ `unit_tests` (Behave BDD) — Successful - ✅ `coverage_report` — Successful (no regressions expected for a thread-safety parameter addition) ⚠️ Non-mandatory job showing failure: `benchmark-regression`. This is not a merge gate and the PR does not change benchmark code or add performance-sensitive behavior that would affect these results. ### 10-Category Checklist | # | Category | Verdict | Notes | |---|----------|---------|-------| | 1 | **Correctness** | ✅ PASS | Fix at lines 157–163 of migration_runner.py correctly applies connect_args for SQLite URLs in get_current_revision(), matching the established pattern from init_or_upgrade() at lines 267–270. Resolves issue #10952 completely. | | 2 | **Spec Alignment** | ✅ PASS | Consistent with SQLAlchemy conventions and the existing engine creation patterns throughout MigrationRunner. | | 3 | **Test Quality** | ✅ PASS | New Behave scenario at features/consolidated_misc.feature lines +1714–1720. Mock properly intercepts create_engine via FakeEngine, captures kwargs in context.current_rev_create_call, and the assertion verifies check_same_thread=False presence. Excellent TDD test design — Given step configures "sqlite:///:memory:", When calls get_current_revision(), Then asserts kwargs content. | | 4 | **Type Safety** | ✅ PASS | No # type: ignore anywhere. All existing type annotations on method signatures preserved (str | None return, Callable[[str], bool] | None parameter). | | 5 | **Readability** | ✅ PASS | Minimal diff, clear and self-explanatory. check_same_thread=False is well-known SQLAlchemy convention. The if/else structure for SQLite vs non-SQLite is logical and easy to follow. | | 6 | **Performance** | ✅ PASS | Zero impact — simple string startswith() check + parameter pass-through. No new allocations or overhead. | | 7 | **Security** | ✅ PASS | Thread-safety fix prevents crashes (availability concern). check_same_thread=False is the standard SQLite multi-thread usage pattern per SQLAlchemy docs. No unsafe patterns introduced. | | 8 | **Code Style** | ✅ PASS | Consistent formatting and style with existing code. File at 395 lines, well under 500-line limit. SOLID principles followed — SRP (get_current_revision has one responsibility), DIP (depends on create_engine injected via import). | | 9 | **Documentation** | ✅ PASS | Method docstring covers the public contract; new Behave scenario serves as living documentation explaining the threading fix behavior. | | 10 | **Commit/PR Quality** | ⚠️ PARTIAL | Commit first line follows Conventional Changelog format (fix(database/migration_runner): ...). Closes #10952 keyword present in PR description. Milestone v3.2.0 aligned. Missing Type/Bug label on PR — see governance note below. | ### Governance: Missing Type/Bug Label Per CONTRIBUTING.md PR requirement #12 ("Exactly one Type/ label applied"), the PR currently has zero labels. Since this is a bug fix, `Type/Bug` should be applied. This can be added during merge by an admin. ⚠️ **PR description note:** The linked issue Closes keyword appears in the PR body under the "Automated by CleverAgents Bot" footer rather than as a closing keyword above it. However issue #10952 was referenced properly via title match and dependency linkage (Closes: #10952) so this should be functionally sufficient. ### Summary This is a clean, minimal bug fix (8 lines of implementation changes + 6 lines test scenario + 11 lines test step). Every changed line was necessary. The pattern mirrors existing code exactly, ensuring maintainability consistency. All acceptance criteria from issue #10952 are met. CI gates all pass (including coverage which should remain ≥97%). **Verdict: APPROVED** — pending Type/Bug label addition for governance compliance. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
Owner

Label Governance Note: This PR currently has zero labels. Per CONTRIBUTING.md PR requirement #12, every PR must have exactly one Type/ label. Since this is a bug fix, Type/Bug should be applied (the review submitted above flags this as PARTIAL in category 10).

This can be added during the merge process by an admin, or manually via forgejo-label-manager to reduce friction on bot-submitted PRs.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

**Label Governance Note:** This PR currently has zero labels. Per CONTRIBUTING.md PR requirement #12, every PR must have exactly one Type/ label. Since this is a bug fix, `Type/Bug` should be applied (the review submitted above flags this as PARTIAL in category 10). This can be added during the merge process by an admin, or manually via `forgejo-label-manager` to reduce friction on bot-submitted PRs. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
HAL9001 approved these changes 2026-05-05 13:02:21 +00:00
Dismissed
HAL9001 left a comment

Second Formal Review: APPROVED - This fix correctly adds connect_args={check_same_thread=False} for SQLite in get_current_revision(). Consistent with init_or_upgrade pattern. Adequate BDD test coverage (consolidated_misc.feature line 1717). All categories pass: correct, typed, readable, secure, SOLID. No blocking issues found.

Second Formal Review: APPROVED - This fix correctly adds connect_args={check_same_thread=False} for SQLite in get_current_revision(). Consistent with init_or_upgrade pattern. Adequate BDD test coverage (consolidated_misc.feature line 1717). All categories pass: correct, typed, readable, secure, SOLID. No blocking issues found.
Owner

PR Review Summary - Approving

This is a small, well-scoped fix that corrects an inconsistency between two methods creating SQLite engines: get_current_revision() now properly passes connect_args={check_same_thread=False} for SQLite URLs, matching the existing pattern in init_or_upgrade().

Checklist Results (10/10 PASS)

  • CORRECTNESS: Fix correctly resolves the threading error from issue #10952
  • SPECIFICATION ALIGNMENT: No conflicts with documented architecture
  • TEST QUALITY: Adequate BDD scenario added (consolidated_misc.feature line 1717) with corresponding step definition
  • TYPE SAFETY: All signatures fully annotated, no type suppression used
  • READABILITY: Clear if/else branch, descriptive names, no magic numbers
  • PERFORMANCE: No new inefficiencies introduced
  • SECURITY: No secrets hardcoded, all connections properly closed
  • CODE STYLE: Under 500 lines, follows ruff conventions, SOLID principles applied
  • DOCUMENTATION: Existing docstrings maintained, no new public API added
  • COMMIT QUALITY: Minor metadata (type/ priority labels) - noted separately

CI Note

CI combined status shows failure with all checks skipped. This may warrant investigation but is not introduced by this PR's code changes.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

## PR Review Summary - Approving This is a small, well-scoped fix that corrects an inconsistency between two methods creating SQLite engines: `get_current_revision()` now properly passes `connect_args={check_same_thread=False}` for SQLite URLs, matching the existing pattern in `init_or_upgrade()`. ### Checklist Results (10/10 PASS) - CORRECTNESS: Fix correctly resolves the threading error from issue #10952 - SPECIFICATION ALIGNMENT: No conflicts with documented architecture - TEST QUALITY: Adequate BDD scenario added (consolidated_misc.feature line 1717) with corresponding step definition - TYPE SAFETY: All signatures fully annotated, no type suppression used - READABILITY: Clear if/else branch, descriptive names, no magic numbers - PERFORMANCE: No new inefficiencies introduced - SECURITY: No secrets hardcoded, all connections properly closed - CODE STYLE: Under 500 lines, follows ruff conventions, SOLID principles applied - DOCUMENTATION: Existing docstrings maintained, no new public API added - COMMIT QUALITY: Minor metadata (type/ priority labels) - noted separately ### CI Note CI combined status shows failure with all checks skipped. This may warrant investigation but is not introduced by this PR's code changes. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
HAL9001 approved these changes 2026-05-05 14:45:52 +00:00
HAL9001 left a comment

First Formal Review: APPROVED\n\nPR #10969 addresses issue #10952 — SQLite threading crash in get_current_revision().\n\n### 10-Category Checklist\n1. CORRECTNESS: Fix at migration_runner.py lines 157–163 correctly applies connect_args for SQLite URLs. Resolves #10952.\n2. SPEC ALIGNMENT: Consistent with SQLAlchemy conventions and init_or_upgrade pattern.\n3. TEST QUALITY: New Behave scenario in consolidated_misc.feature with proper Given/When/Then flow.\n4. TYPE SAFETY: No # type: ignore suppression. All annotations preserved.\n5. READABILITY: Minimal diff, clear if/else structure for SQLite vs non-SQLite paths.\n6. PERFORMANCE: Zero impact — one startswith() check + parameter pass-through.\n7. SECURITY: Thread-safety fix prevents crashes. Standard SQLite multi-thread pattern per SQLAlchemy docs.\n8. CODE STYLE: Consistent with existing code style. ~395 lines (under 500). SOLID applied (SRP, DIP).\n9. DOCUMENTATION: Method docstring covers contract; new Behave scenario serves as living documentation.\n10. COMMIT/PR QUALITY: ⚠️ Partial — missing Type/Bug label per CONTRIBUTING.md requirement #12.\n\n### CI Status: PASSING\nAll 5 required-for-merge gates green (lint, typecheck, security_scan, unit_tests, coverage).\nbenchmark-regression failing is a non-mandatory known issue unrelated to PR code.\n\n### Non-Blocking Note: Missing Type/Bug Label\nThe PR currently has zero labels. Per CONTRIBUTING.md PR requirement #12 (Exactly one Type/ label), Type/Bug should be applied since this fixes SQLite threading crashes in MigrationRunner. Can be added during merge by admin or via forgejo-label-manager.\n\n### Summary\nClean, minimal bug fix (8 lines code + 6 test scenario + 11 test step). Pattern mirrors init_or_upgrade consistency. All acceptance criteria from issue #10952 met.\nApproving — pending Type/Bug label for governance compliance.

First Formal Review: APPROVED\n\nPR #10969 addresses issue #10952 — SQLite threading crash in get_current_revision().\n\n### 10-Category Checklist\n1. CORRECTNESS: ✅ Fix at migration_runner.py lines 157–163 correctly applies connect_args for SQLite URLs. Resolves #10952.\n2. SPEC ALIGNMENT: ✅ Consistent with SQLAlchemy conventions and init_or_upgrade pattern.\n3. TEST QUALITY: ✅ New Behave scenario in consolidated_misc.feature with proper Given/When/Then flow.\n4. TYPE SAFETY: ✅ No # type: ignore suppression. All annotations preserved.\n5. READABILITY: ✅ Minimal diff, clear if/else structure for SQLite vs non-SQLite paths.\n6. PERFORMANCE: ✅ Zero impact — one startswith() check + parameter pass-through.\n7. SECURITY: ✅ Thread-safety fix prevents crashes. Standard SQLite multi-thread pattern per SQLAlchemy docs.\n8. CODE STYLE: ✅ Consistent with existing code style. ~395 lines (under 500). SOLID applied (SRP, DIP).\n9. DOCUMENTATION: ✅ Method docstring covers contract; new Behave scenario serves as living documentation.\n10. COMMIT/PR QUALITY: ⚠️ Partial — missing Type/Bug label per CONTRIBUTING.md requirement #12.\n\n### CI Status: PASSING\nAll 5 required-for-merge gates green (lint, typecheck, security_scan, unit_tests, coverage).\nbenchmark-regression failing is a non-mandatory known issue unrelated to PR code.\n\n### Non-Blocking Note: Missing Type/Bug Label\nThe PR currently has zero labels. Per CONTRIBUTING.md PR requirement #12 (Exactly one Type/ label), Type/Bug should be applied since this fixes SQLite threading crashes in MigrationRunner. Can be added during merge by admin or via forgejo-label-manager.\n\n### Summary\nClean, minimal bug fix (8 lines code + 6 test scenario + 11 test step). Pattern mirrors init_or_upgrade consistency. All acceptance criteria from issue #10952 met.\nApproving — pending Type/Bug label for governance compliance.
Owner

PR review completed. First Formal Review: APPROVED. All 10 categories pass. CI required gates green.

PR review completed. First Formal Review: APPROVED. All 10 categories pass. CI required gates green.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!10969
No description provided.