Repository navigation
fix(OMN-19513): work_ledger_rows refuses ledger writes under a test runner - #3216
Merged
Merged
Conversation
…unner The work-ledger projection writer judges its DSN before any connect or statement: under a test runner (PYTEST_CURRENT_TEST, pytest or unittest imported, ONEX_TEST_CONTEXT set) a non-loopback DSN exits 79 naming ledger-test-write-guard. No bypass flag, no allowlist. tests/conftest.py strips the ambient database URL and binding overlay. Version bumped to 0.4.277 for the release-identity gate.
✅ Architectural Review — PASSEDErrors: 0 What this checks
No architectural violations found. Static architectural lint — no model inference (OMN-14176). |
✅ Hostile Reviewer — PASSEDBlocking findings (critical/error): 0 Gate semantics
Powered by omniintelligence.review_pairing.cli_review — node-based adversarial review via HandlerLlmCliSubprocess (OMN-8524) |
jonahgabriel
enabled auto-merge (squash)
October 2, 2026 00:06
… bump to 0.4.278 CI on PR #3216 failed typecheck because SqliteTableRowSource lacked walk_origin and the selection parameter required by ProtocolProjectionRowSource. Added selection support (newest, walk, ranked) to build_sqlite_window_query and SqliteTableRowSource.rows, and implemented walk_origin to return one below the smallest integer cursor or None. Added two unit tests to cover the new selection and walk_origin behavior. Bumped pyproject.toml and uv.lock from 0.4.277 to 0.4.278 to satisfy the Release Identity Gate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change implements a hard guard for the work-ledger projection writer (
WorkLedgerProjectionWriter, tableomninode_internal.work_ledger_rows). It refuses to execute when a real Data Source Name (DSN) is detected while running under a test runner.Implementation Details
handlers/handler_work_ledger_write_guard.pycontainingHandlerWorkLedgerWriteGuard.PYTEST_CURRENT_TESTis set, ifpytestorunittestis imported, or ifONEX_TEST_CONTEXTis non-empty. NoONEX_TEST_CONTEXTvalue removes a signal (0still counts as set).79(SystemExit), naming the guardledger-test-write-guard.db.connectand before any SQL statement execution.handle()andproject_event().tests/conftest.pyincludes an autouse fixture that deletesOMNIDASH_ANALYTICS_DB_URLandOMNIMARKET_PROJECTION_RUNTIME_BINDING_OVERLAY.Versioning & Configuration
omnibase_internal#121.Verification
tests/unit/nodes/node_projection_work_ledger/test_work_ledger_write_guard_omn19513.pycontains 7 tests; the five behaviours below are the core:79; the recording DB saw zero calls.79for a real DSN and0for loopback.ONEX_TEST_CONTEXT=0cannot remove the test runner signal.4of the7tests fail (verified locally); the remaining tests coverproject_event()refusal, the conftest strip and the switched-off control.34passed intests/unit/nodes/node_projection_work_ledger.ruffandmypystrict checks are clean.pre-commithooks ran on commit.Ticket: OMN-19513.
Lab: host h201, lane ledger-guard-market, command
uv run pytest tests/unit/nodes/node_projection_work_ledger -q, observed 34 passed; with the refusal switched off 4 of the 7 new tests failed.Lab: host h202, head e8f5d89, command
uv run pytest tests/unit/nodes/node_projection_read_effect tests/unit/nodes/node_projection_work_ledger -q, observed 65 passed;uv run mypy src/omnimarket/ --strictreported no issues in 4014 source files, after merging dev and giving SqliteTableRowSource the walk_origin method and selection parameter that ProtocolProjectionRowSource requires.DELEGATION delegated=1 runs=0076c107-75a3-4baf-a97d-f09a6bfcdb2d
Evidence-Ticket: OMN-19513
Evidence-Source: OCC#12260