Sophyane 21.4.2 Autonomous Software Engineering Harness
Local-first evidence-gated software engineering platform. Plans, synthesizes AST patches, runs sandboxed commands, audits test suites, and enforces zero unhandled success claims. Connected via
sophyane-ecosystem-v1 contract.
Repair Postgres Cutover
SLI Semantic Decomposition
Tough100 Benchmark Race
/sli (Ontology)
/doctor
/help
❯
Repair Pytest assertion regression with PostgreSQL cutover rollback isolation guard
SLI Intent Decomposition & Evidence Plan (Sophyane Kernel · 142ms)
[1] Intent Classification: Request contains repair verbs ('repair', 'fix') and software terms ('pytest', 'cutover', 'guard').
[2] Policy Engine: Assigned Option 1 (Evidence-Gated Fast Path), timeout budget: 10,000ms.
[3] Capability Engine: Decomposed into `software_repair_postgres_cutover` & `ast_transaction_isolation`.
[4] Step 1: Run sandboxed `pytest` on `tests/test_sli_postgres_cutover.py` to capture baseline failure traceback.
[5] Step 2: Use `EditFile` to inject guarded transaction block, `SET LOCAL lock_timeout`, and invariant assertion.
[6] Step 3: Re-run verification tests to prove exit code 0.
[7] Step 4: Persist `.sophyane-harness-report.json` and promote pattern to Xerus memory.
Bash (Sandbox)
python -m pytest tests/test_sli_postgres_cutover.py -v
Baseline Captured
============================= test session starts ==============================
rootdir: /root/sophyane-workspace
collected 3 items
tests/test_sli_postgres_cutover.py::test_cutover_guard FAILED [ 33%]
tests/test_sli_postgres_cutover.py::test_rollback_isolation PASSED [ 66%]
tests/test_sli_postgres_cutover.py::test_connection_pool_resilience PASSED [100%]
=================================== FAILURES ===================================
______________________________ test_cutover_guard ______________________________
async def test_cutover_guard():
> res = await cutover.execute_cutover("sophyane_v2")
E AssertionError: Schema invariant violated: lock_timeout was not set.
=========================== 1 failed, 2 passed in 0.18s ===========================
[Exit code: 1]
EditFile (AST Patch)
src/sophyane/sli_postgres.py
Reconciled
async def execute_cutover(self, target_schema: str) -> CutoverResult:
async with self._pool.acquire() as conn:
- await conn.execute(f"ALTER DATABASE SET SCHEMA {target_schema}")
- return CutoverResult(success=True)
+ async with conn.transaction():
+ # Guarded transaction with automated rollback & invariant check
+ await conn.execute("SET LOCAL lock_timeout = '2000ms';")
+ await conn.execute(f"ALTER DATABASE SET SCHEMA {target_schema}")
+ await self._verify_invariants(conn)
+ return CutoverResult(success=True, isolated=True)
Bash (Verification)
python -m pytest tests/test_sli_postgres_cutover.py -v
100% Pass
============================= test session starts ==============================
collected 3 items
tests/test_sli_postgres_cutover.py::test_cutover_guard PASSED [ 33%]
tests/test_sli_postgres_cutover.py::test_rollback_isolation PASSED [ 66%]
tests/test_sli_postgres_cutover.py::test_connection_pool_resilience PASSED [100%]
============================== 3 passed in 0.09s ===============================
[Exit code: 0]
Sophyane Harness Report (Verified):
1. Fixed the cutover invariant defect in src/sophyane/sli_postgres.py by wrapping schema mutations inside an isolated transaction with lock_timeout = '2000ms'.
2. Verified all 3 pytest suites with exit code 0 (duration: 0.09s).
3. Machine-readable evidence written to .sophyane-harness-report.json and promoted to Xerus persistent memory ontology.
/help — List all Sophyane harness commands
/sli — Inspect SLI concept ontology and learned rules
/harness — Execute strict evidence-gated TDD repair
/race — Run adaptive multi-provider race (Option 2)
/evolve — Run candidate self-evolution against Tough100
/doctor — Diagnostics on Python, C++ fast-path, Postgres
/diff — View working directory git status and diff
/evidence — View persisted JSON evidence report
/clear — Clear terminal screen history
Enter Run Task
Shift+Enter Newline
/ Commands
Tab Autocomplete
Policy: Evidence-Gated Zero-Hallucination