Private
Public Access
0
0
Commit Graph

3279 Commits

Author SHA1 Message Date
ed 3d35bb5b3f todo 2026-06-16 01:03:59 -04:00
ed ff91c4e8b0 docs(report): add completion report for rag_test_failures_20260615
Comprehensive 12-section completion report following the format of
TRACK_COMPLETION_ai_loop_regressions_20260615.md. Documents:

- 4 atomic commits, 1288+4+0 fully green baseline
- 2 defensive guards in src/rag_engine.py (lines 150 and 331)
- 3 new unit tests in tests/test_rag_sync_none_error.py
- 4 plan deviations (spec wrong about root cause, test_rag_visual_sim
  was already passing, traceback diagnostic was a dead end, temp dir
  cleanup retry loop for Windows)
- 5 followup recommendations for Tier 1 review
2026-06-16 00:36:24 -04:00
ed ba04363003 conductor(track): mark rag_test_failures_20260615 as completed
Updated metadata.json: status=completed, completed_at=2026-06-15,
verification_criteria filled with actual results.

Updated tracks.md: status=shipped, 4-commit summary, test file added.

Final result: 1288 pass + 4 skip + 0 fail. All 11 batched test tiers pass
in 873.6s. First fully green baseline since 2026-06-12.
2026-06-16 00:31:26 -04:00
ed d89c58103d docs(rag): add troubleshooting section for NoneType.get error
Documents the two bugs fixed in the rag_test_failures_20260615 track:
1. get_all_indexed_paths: m.get('path') failing on None metadata
2. _validate_collection_dim_result: 'if not embeddings' raising
   ValueError on non-empty numpy arrays

Also documents the 'no such table: tenants' chromadb corruption
symptom (wipe .slop_cache/chroma_* to recover).

Plus: 'rag_status' shows 'error: ' prefix is the failure indicator;
the actual error message is the part after the prefix.
2026-06-16 00:28:53 -04:00
ed 6a0ac35738 conductor(checkpoint): Phase 3 complete - RAG test failures fix verified
All 11 batched test tiers pass in 873.6s (333 files):
  tier-1-unit-comms (6)  tier-1-unit-core (194)
  tier-1-unit-gui (21)   tier-1-unit-headless (2)
  tier-1-unit-mma (20)   tier-2-mock_app-comms (2)
  tier-2-mock_app-core (16)  tier-2-mock_app-gui (9)
  tier-2-mock_app-headless (1)  tier-2-mock_app-mma (7)
  tier-3-live_gui (55) - includes 3 RAG tests previously failing

Test delta: 1282 + 4 + 3 -> 1288 + 4 + 0 (3 RAG tests fixed + 3 new unit tests)

Phase 3 verification:
- Phase 3.1: full RAG suite (27 tests) passes in 36s
- Phase 3.2: full test suite (1288 pass + 4 skip + 0 fail) in 697s
- Phase 3.3: full batched test suite (11 tiers, 333 files) passes in 873s
2026-06-16 00:26:59 -04:00
ed 355811635d fix(rag): handle None metadata in get_all_indexed_paths and non-empty numpy in dim check
Two bugs in src/rag_engine.py were causing 'NoneType object has no attribute get'
in the live_gui RAG tests (test_rag_phase4_final_verify,
test_rag_phase4_stress):

1. _validate_collection_dim_result:148
   Old:  if not embeddings or len(embeddings) == 0:
   New:  if embeddings is None or len(embeddings) == 0:
   The 'if not embeddings' check raises ValueError('The truth value of an
   array with more than one element is ambiguous. Use a.any() or a.all()')
   when 'embeddings' is a non-empty numpy array (which is the normal case
   after documents are upserted). The exception is caught by the outer
   'except Exception' which returns a non-ok Result, causing __init__ to
   set self.collection = None. Subsequent 'get_all_indexed_paths()' then
   fails with 'NoneType has no attribute get' on self.collection.get().

2. get_all_indexed_paths:334
   Old:  return list(set(m.get('path') for m in res['metadatas'] if m.get('path')))
   New:  return list(set(m['path'] for m in res['metadatas'] if m is not None and m.get('path')))
   When chromadb returns 'metadatas=[None, ...]' (documents upserted
   without metadata), 'm.get('path')' fails with AttributeError on the
   first None element. Adds 'm is not None' guard.

Both fixes are defensive: the conditions that trigger them (orphan docs
without metadata, non-empty embeddings arrays) are normal valid
states that the old code couldn't handle.

New file: tests/test_rag_sync_none_error.py
   3 unit tests covering both bugs:
   - test_dim_check_does_not_raise_on_non_empty_ndarray
   - test_get_all_indexed_paths_handles_none_metadata
   - test_get_all_indexed_paths_returns_paths_with_metadata

Verified:
- 3/3 focused tests pass
- test_rag_phase4_final_verify.py::test_phase4_final_verify PASSES (was failing)
- test_rag_phase4_stress.py::test_rag_large_codebase_verification_sim PASSES (was failing)
- test_rag_visual_sim.py::test_rag_full_lifecycle_sim PASSES (still passing)
2026-06-16 00:09:02 -04:00
ed 29c64a0125 conductor: register rag_test_failures_20260615 in tracks.md + update public_api row 2026-06-15 21:56:20 -04:00
ed 3fc492e302 conductor(track): metadata.json for rag_test_failures_20260615 2026-06-15 21:54:36 -04:00
ed 3aa4cfa133 conductor(track): plan for rag_test_failures_20260615 (5 phases, ~10 tasks) 2026-06-15 21:53:13 -04:00
ed 006df67637 conductor(track): spec for rag_test_failures_20260615 (3 RAG test fixes, single root cause) 2026-06-15 21:51:11 -04:00
ed bc388f11bb docs(report): add deviation #2.5 for test_headless_verification fix
The headless batch hang the user reported was caused by an xdist worker
crash on test_headless_verification_full_run, not a test logic failure.
The same root cause as the 4 Phase 2 follow-ups (mock returns raw string
but production does 'if not result.ok:'), but with a different failure
mode (worker crash that hangs the batched test runner).

Documented in section 3 of the report as deviation #2.5 with:
- Where it went wrong (missed in the 4 follow-ups)
- The specific symptom in the user's session
- The fix (out-of-band commit e35b6a34)
- Lesson for the next spec (verification must include xdist mode)
2026-06-15 21:28:29 -04:00
ed e35b6a34ad test(headless_verification): wrap mock return in Result(data=...)
The test_headless_verification_full_run test in test_headless_verification.py
mocked src.multi_agent_conductor.ai_client.send_result with a return_value
of a raw string. The production code does 'if not result.ok:' which
fails on raw strings with AttributeError.

In xdist mode this caused a worker crash (gw0/gw11: 'node down: Not
properly terminated') that hung the entire tier-1-unit-headless batch
in the batched test runner (~50s+ per batch). The crash was the
worker dying while pytest-master waited for it; the master never
got a clean exit and the run was orphaned until the user's manual
cancel.

The test was missed in the original Phase 2 list (it was an xdist
crash rather than a test logic failure) and in the 4 Phase 2
follow-up commits (which targeted the 4 specific test files the
user reported during the run).

Change: mock_send.return_value = 'Task completed successfully.' ->
         mock_send.return_value = Result(data='Task completed successfully.')

Plus add the Result import.

2/2 tests in test_headless_verification.py now pass under xdist
(was 1/2 + worker crash in xdist). Full headless batch (14 tests)
completes in 18.7s.
2026-06-15 21:26:42 -04:00
ed 99747cafb9 docs(report): add track completion report for public_api_migration_and_ui_polish_20260615
531-line completion report for Tier 1 review covering:
- Goal & scope (per spec)
- 7 phases of delivery (per commit)
- 6 plan deviations to flag (CRITICAL: 7 production-affected test files
  + 4 follow-up mock fixes were missed in the original spec; the user's
  stated mass-rename send_result->send plan; the track was done on
  master not a feature branch)
- Files changed (per category)
- Verification (per the spec's 15 verification criteria)
- Definition of Done
- Recommended next track (send_result -> send rename)
- Tier 1 review checklist
2026-06-15 21:10:10 -04:00
ed bbd4c7b5c0 conductor(track): mark public_api_migration_and_ui_polish_20260615 as completed
- metadata.json: status -> completed
- state.toml: all 7 phases marked completed; all tasks marked completed
  with their commit SHAs
- Includes the 4 Phase 2 follow-up mock fixes for:
  test_conductor_engine_v2.py (10 tests)
  test_context_pruner.py (1 test)
  test_rag_integration.py (1 test)
  test_tiered_aggregation.py (1 test)

Test count: 1286 + 12 newly-passing = 1298 pass; 4 RAG failures deferred.
(Note: 12 newly-passing includes the 6 pre-existing failures from the
spec PLUS 6 more from test_conductor_engine_v2.py and the user's
manual corrections to test_ai_loop_regressions_20260614.py and
test_conductor_engine_v2.py.)

Total commits in this track: ~25 atomic commits + 6 phase checkpoints.
2026-06-15 20:41:12 -04:00
ed 13f32f52e0 test(tiered_aggregation): wrap mock_send return in Result(data=...) (Phase 2 follow-up)
The test_run_worker_lifecycle_uses_strategy test in test_tiered_aggregation.py
mocked src.multi_agent_conductor.ai_client.send_result with a return_value
of a raw string. The production code does "if not result.ok:" which
fails on raw strings.

3/3 tests in test_tiered_aggregation.py pass (was 2/3).
2026-06-15 20:28:41 -04:00
ed 26e1b65298 test(rag_integration): wrap _send_gemini mock return in Result(data=...)
The test_rag_integration test mocks the internal _send_gemini
function to return a raw string. The production code in
app_controller._handle_request_event now does 'if result.ok:'
which fails on raw strings.

Change: mock_provider.return_value = 'Mock AI Response' ->
         mock_provider.return_value = Result(data='Mock AI Response')

Plus add the Result import.

1 test passes (was 1 pre-existing failure).
2026-06-15 20:27:07 -04:00
ed 58576fcba7 test(context_pruner): wrap send_result lambda in Result(data=...) (Phase 2 follow-up)
The test_token_reduction_logging test in test_context_pruner.py
mocked src.ai_client.send_result with a lambda that returned
a raw string. The production code now does "if not result.ok:"
which fails on raw strings.

1 test passes (was 1 pre-existing failure).
2026-06-15 20:25:44 -04:00
ed 64278d5313 test(conductor_engine_v2): wrap mock_send return values in Result(data=...)
The 7 tests in test_conductor_engine_v2.py (already updated to
mock src.ai_client.send_result) were still returning raw strings
from the mocks. The production code in multi_agent_conductor.py
now does "if not result.ok:" which fails on raw strings with
AttributeError.

Changes:
- Add "from src.result_types import Result" import
- Wrap all mock_send.return_value = "..." with Result(data="...") (4 sites)
- Wrap MagicMock(return_value="...") with Result(data="...") (2 sites)
- Wrap side_effect return with Result(data="Success")

10/10 tests pass (was 3/10).
2026-06-15 20:21:46 -04:00
ed 125a226525 was called rest 2026-06-15 20:10:18 -04:00
ed 48b47d250c oops 2026-06-15 20:04:35 -04:00
ed 4419922bce review batch script 2026-06-15 20:02:36 -04:00
ed 25d047fa75 config 2026-06-15 19:56:44 -04:00
ed 4910a703a7 more manual corrections 2026-06-15 19:41:33 -04:00
ed 4514487283 messing around (intent scripting lang) 2026-06-15 19:34:20 -04:00
ed f9832b07b3 manaul correction attempts 2026-06-15 19:14:22 -04:00
ed 33fcedefc7 docs(product): mark public API deprecation as resolved (Phase 7.2)
Per plan Task 7.2: marked the 'Public API deprecation' section as
RESOLVED 2026-06-15. The section now describes the canonical public
API (send_result()) and points to the public_api_migration_and_ui_polish_20260615
track as the source of the migration.

Verification: rg -i 'send.*deprecat|deprecat.*send' conductor/product-guidelines.md
returns 0 hits.
2026-06-15 18:58:16 -04:00
ed b37a095b14 docs(ai_client): remove send() deprecation references (Phase 7.1)
Per plan Task 7.1: removed all deprecation language about ai_client.send()
from docs/guide_ai_client.md:
- Removed the 'Public API > ai_client.send(...) deprecated' section
- Updated 'Migration Notes for Existing Callers' to reflect the
  public_api_migration_and_ui_polish_20260615 completion
- Updated 'Public API Result Migration' line in the see-also section
  to mark the follow-up track as COMPLETED (not 'planned')

Verification: rg -i 'deprecat.*send|send.*deprecat' docs/guide_ai_client.md
returns 0 hits (the only remaining 'deprecat' mention is the resolved
Public API Result Migration bullet which now describes the resolution
path, not a deprecation).
2026-06-15 18:56:11 -04:00
ed 0e55ebaf08 conductor(checkpoint): Phase 6 complete - deprecation removed
- 8c81b727: Removed @deprecated send() function and typing_extensions.deprecated
  import from src/ai_client.py (lines 2939-3000)
- e40b122b: Deleted obsolete tests/test_deprecation_warnings.py (both
  tests were obsolete after send() removal)
- 90122df3: Removed filterwarnings entry in pyproject.toml that silenced
  the send() deprecation

Verified:
- uv run rg 'ai_client.send\\(' src/ tests/ returns 0 real call sites
  (3 remaining hits are docstring references only)
- import src.ai_client; hasattr(ai, 'send') is False
- 73/73 migrated tests pass

Phases 1-6 complete. Phase 7 (docs + final sweep) in progress.
2026-06-15 18:54:34 -04:00
ed 90122df357 chore(pyproject): remove send_result deprecation filterwarnings (Phase 6.3)
Removes the filterwarnings entry that silenced the DeprecationWarning
emitted by the now-removed send() function. The filter was added in
data_oriented_error_handling_20260606 (commit 73cf321c) specifically
to silence the send() deprecation; no other deprecation in the
codebase was silenced by it. Now that send() is gone, the filter is
obsolete.

Verification: 'uv run rg ignore:Use ai_client.send_result pyproject.toml'
returns 0 hits.
2026-06-15 18:53:48 -04:00
ed e40b122b1b test(ai_client): delete obsolete test_deprecation_warnings.py (Phase 6.2)
Per plan Task 6.3: both tests in test_deprecation_warnings.py are obsolete
after the send() function was removed in Phase 6.1:
- test_send_deprecated_warning_emitted_once_per_site: literally cannot
  run without ai_client.send (AttributeError)
- test_send_result_does_not_emit_deprecation: trivially true after
  send() is removed (no deprecation source)

The test_send_result_does_not_emit_deprecation regression test is
preserved in tests/test_ai_client_result.py (added in Phase 2.7 as the
renamed test). The pre-Phase-2.7 test_send_deprecated_emits_warning
was deleted in Phase 2.7.

Verification: pytest tests/test_deprecation_warnings.py reports
'ERROR: file or directory not found'.
2026-06-15 18:53:02 -04:00
ed 8c81b727d6 refactor(ai_client): remove deprecated send() function (Phase 6.1)
Removes the @deprecated send() function (was at src/ai_client.py:2939-3000)
and the from typing_extensions import deprecated import (line 38). The
function is replaced by send_result() which has been the canonical public
API since the data_oriented_error_handling_20260606 track (commit 9f86b2be).

All 3 production call sites (src/conductor_tech_lead.py:68,
src/orchestrator_pm.py:86, src/multi_agent_conductor.py:591) and 18 test
files were migrated in Phases 1-2; 4 pre-existing failures were fixed in
Phases 3-4. No remaining callers of ai_client.send(.

Verification:
- uv run rg 'def send\\(' src/ai_client.py returns 0 hits
- import src.ai_client; hasattr(ai, 'send') is False
- 73/73 migrated tests pass
2026-06-15 18:48:44 -04:00
ed c50367c6d5 test(log_management_refresh): use rfind() to locate code (Phase 5.2, fixes 1 pre-existing failure)
The test used src.find() which locates the first occurrence of
'Refresh Registry' in the comment block (line 2090 in src/gui_2.py),
not the actual code (line 2111). The 400-char snippet window doesn't
reach the code, so the assertion for 'load_registry' fails.

Production code is already correct (in-place load_registry()) at
src/gui_2.py:2111-2112 (user commit df7bda6e). This test just needs
to use rfind() to locate the actual code, not the comment.

Change: src.find(marker) -> src.rfind(marker)

1 test passes (was 1 pre-existing failure).
2026-06-15 18:27:40 -04:00
ed f663a34f52 test(discussion_truncate): use rfind() to locate code (Phase 5.1, fixes 1 pre-existing failure)
The test used src.find() which locates the first occurrence of
'Keep Pairs:' in the comment block (line 5113 in src/gui_2.py), not
the actual code (line 5130). The 200-char snippet window only reaches
the comment, so the assertions for set_next_item_width(140) and
drag_int fail.

Production code is already correct (set_next_item_width(140) +
drag_int) at src/gui_2.py:5130-5131 (user commit d0b06575). This
test just needs to use rfind() to locate the actual code, not the
comment.

Change: src.find(marker) -> src.rfind(marker)

1 test passes (was 1 pre-existing failure).
2026-06-15 18:21:58 -04:00
ed effa24a7ae test(symbol_parsing): mock send_result not send (Phase 4, fixes 2 pre-existing failures)
The 2 tests in test_symbol_parsing.py mock src.ai_client.send but
production now uses send_result (migrated by doeh_test_thinking_cleanup_20260615
commit 24ba2499). Mocks receive 0 calls; tests fail with
"send was called 0 times".

Changes:
- Replace patch(src.ai_client.send) with patch(src.ai_client.send_result)
- Rename mock_send to mock_send_result
- Set return_value=Result(data="mocked response")
- Add "from src.result_types import Result" import

All 2 tests in test_symbol_parsing.py pass (were 2 pre-existing failures).
2026-06-15 18:20:00 -04:00
ed 3be28cc524 test(qwen): adapt 2 tests to Result API (Phase 3, fixes 2 pre-existing failures)
The _send_qwen() function returns Result[str] after the
data_oriented_error_handling_20260606 refactor (commit 64d6ba2d),
but 2 tests in test_qwen_provider.py were asserting against the
raw str type. They were 2 of the 10 pre-existing failures documented
in the track spec.

Changes (mirrors the doeh_test_thinking_cleanup_20260615 pattern for
grok/llama/llama_native):
- Replace assert result == "hi from qwen" with assert result.ok and result.data == "hi from qwen"
- Replace assert "cat" in result.lower() with assert result.ok and "cat" in result.data.lower()
- Add "from src.result_types import Result" import

All 5 tests in test_qwen_provider.py now pass (was 3/5).
2026-06-15 18:05:45 -04:00
ed da6e084893 conductor(checkpoint): Phase 2 complete - 18 test files migrated to send_result()
Migrated 11 call-site files + 7 production-affected mock files to use
send_result() instead of send():

Call-site migrations (11 files):
- test_ai_client_cli.py
- test_ai_cache_tracking.py
- test_ai_client_result.py (deleted test_send_deprecated_emits_warning;
  renamed test_send_extracts_data_from_result to
  test_send_result_does_not_emit_deprecation)
- test_api_events.py
- test_deepseek_provider.py (6 sites in 1 file)
- test_gemini_cli_edge_cases.py
- test_gemini_cli_integration.py
- test_gemini_cli_parity_regression.py
- test_gui2_mcp.py
- test_tier4_interceptor.py
- test_token_usage.py

Mock migrations (7 files; pre-empted Phase 1 regressions):
- test_conductor_tech_lead.py (3 mocks)
- test_orchestration_logic.py (4 mocks including the missed
  test_run_worker_lifecycle_blocked)
- test_orchestrator_pm.py (3 mocks)
- test_orchestrator_pm_history.py (1 mock)
- test_phase6_engine.py (1 mock)
- test_run_worker_lifecycle_abort.py (1 mock)
- test_spawn_interception_v2.py (1 mock)

test_rag_integration.py mock migration deferred to RAG track (OOS1).

Verified: 64/64 tests pass in the 18 migrated files.
2026-06-15 17:46:26 -04:00
ed 4592618372 fix(orchestration_logic): migrate test_run_worker_lifecycle_blocked mock (Phase 2 follow-up)
Phase 2.13 missed the test_run_worker_lifecycle_blocked test in
test_orchestration_logic.py - it also mocked src.ai_client.send.
The test was failing with "Worker send_result failed for T1: ...
[Errno 2] No such file or directory: .beads_mock/beads.json" because
the unmocked send_result fell through to the real provider which
tried to read beads.json.

Changes:
- Replace patch(src.ai_client.send) with patch(src.ai_client.send_result)
- Wrap mock return_value with Result(data="BLOCKED because of missing info")

All 8 tests in test_orchestration_logic.py now pass.
2026-06-15 17:45:18 -04:00
ed 36962ef6b6 test(tier4_interceptor): migrate to send_result() (Phase 2.11)
The test_ai_client_passes_qa_callback test calls ai_client.send() with
qa_callback=lambda. The qa_callback is passed through to the provider
function (_send_gemini).

Per plan note: the test has complex callback setup; the Result handling
needs the mock to return Result(data="ok") so the qa_callback passes
through and the test succeeds.

Changes:
- Rename ai_client.send(...) to ai_client.send_result(...)
- Add assert result.ok
- Mock _send_gemini to return Result(data="ok") instead of relying on
  the default (which would call the real provider)
- Add "from src.result_types import Result" import

7 tests pass (the migrated test_ai_client_passes_qa_callback was
previously broken because the send() call hit the real provider and
either failed or returned empty; the mock now provides a clean response).
2026-06-15 17:27:31 -04:00
ed cfeb3cb3e0 test(gemini_cli_integration): migrate 2 sites to send_result() (Phase 2.10)
Changes:
- Rename ai_client.send(...) to ai_client.send_result(...) (2 sites)
- Add assert result.ok (1 site; the second test only checks result is not None)
- Add "from src.result_types import Result" import

2 tests pass.
2026-06-15 17:07:20 -04:00
ed 363fe91db0 test(deepseek): migrate 6 sites to send_result() (Phase 2.9)
All 6 sites in test_deepseek_provider.py call ai_client.send(...). Each
assertion pattern is slightly different (==, "in", call_args inspection);
migration follows the same pattern: rename to send_result(), add
assert result.ok, and use result.data for the response text.

Changes:
- Rename ai_client.send(...) to ai_client.send_result(...) (6 sites)
- Add assert result.ok (6 sites)
- Replace result == "x" with result.data == "x" (or "x" in result.data)
- Add "from src.result_types import Result" import

7 tests pass (1 unrelated test_deepseek_model_selection + 6 migrated).
2026-06-15 16:59:46 -04:00
ed d9a79efa25 test(api_events): migrate 2 sites to send_result() (Phase 2.8)
The test_send_emits_events_proper and test_send_emits_tool_events tests
both call ai_client.send(). Migrating to send_result() + assert result.ok.

Changes:
- Rename ai_client.send(...) to ai_client.send_result(...) (2 sites)
- Add assert result.ok (2 sites)
- Add "from src.result_types import Result" import

4 tests pass.
2026-06-15 16:57:53 -04:00
ed 0192978646 test(ai_client_result): migrate to send_result(); drop test_send_deprecated (Phase 2.7)
Per plan Task 2.7:
- DELETE test_send_deprecated_emits_warning (obsolete after Phase 6; send()
  is being removed)
- RENAME test_send_extracts_data_from_result -> test_send_result_does_not_emit_deprecation
  (this is the regression test the plan said to KEEP; it now asserts the new
  API does not emit a deprecation warning, instead of testing the old behavior)
- MIGRATE test_send_extracts_data_from_result (renamed to the above)
- MIGRATE test_send_returns_empty_string_on_error_result ->
  test_send_result_returns_empty_data_with_error_on_auth_failure (asserts
  the Result has data="" and not ok)

5 tests pass (down from 6; the deleted test removed 1; the renamed
test_send_extracts_data_from_result became test_send_result_does_not_emit_deprecation).
2026-06-15 16:55:30 -04:00
ed 1e2c34313c test(token_usage): migrate to send_result() (Phase 2.6)
The test_token_usage_tracking test calls ai_client.send() and verifies
the comms log entry. Migrating to send_result() + assert result.ok.

Changes:
- Rename ai_client.send(...) to ai_client.send_result(...)
- Add assert result.ok
- Add "from src.result_types import Result" import

1 test passes.
2026-06-15 16:51:24 -04:00
ed c59bac59f2 test(gui2_mcp): migrate to send_result() (Phase 2.5)
The test_mcp_tool_call_is_dispatched test calls ai_client.send() and
asserts the MCP dispatch function was called. Migrating to send_result()
+ assert result.ok.

Changes:
- Rename ai_client.send(...) to ai_client.send_result(...)
- Add assert result.ok
- Add "from src.result_types import Result" import

1 test passes.
2026-06-15 16:49:11 -04:00
ed fe52024311 test(gemini_cli_parity_regression): migrate to send_result() (Phase 2.4)
The test_send_invokes_adapter_send test calls ai_client.send() and
asserts the return value. Migrating to send_result() with
assert res.ok and res.data == "Hello from mock adapter".

Changes:
- Rename ai_client.send(...) to ai_client.send_result(...)
- Add assert res.ok before accessing res.data
- Add "from src.result_types import Result" import

1 test passes.
2026-06-15 16:39:31 -04:00
ed b4c9ebd963 test(gemini_cli_edge_cases): migrate to send_result() (Phase 2.3)
The test_gemini_cli_loop_termination test calls ai_client.send() and
asserts the return value. Migrating to send_result() with
assert result.ok and result.data == "Final answer".

Changes:
- Rename ai_client.send(...) to ai_client.send_result(...)
- Add assert result.ok before accessing result.data
- Add "from src.result_types import Result" import

3 tests pass.
2026-06-15 16:31:26 -04:00
ed fab9196bea test(ai_cache_tracking): migrate to send_result() (Phase 2.2)
The test calls ai_client.send() but does not check the return value -
it only verifies the side effect on gemini cache stats. Migrating to
send_result() and asserting result.ok is enough.

Changes:
- Rename ai_client.send(...) to ai_client.send_result(...)
- Add assert result.ok (the return value is unused)
- Add "from src.result_types import Result" import

2 tests pass.
2026-06-15 16:28:20 -04:00
ed ba0df1fa95 test(ai_client_cli): migrate to send_result() (Phase 2.1)
Replaces the deprecated ai_client.send() call with ai_client.send_result()
in the test. The mock for GeminiCliAdapter is unchanged (it is patched
to return a dict that send_result unwraps internally).

Changes:
- Rename response = ai_client.send(...) to result = ai_client.send_result(...)
- Add assert result.ok before accessing result.data
- Add "from src.result_types import Result" import

1 test passes.
2026-06-15 16:26:06 -04:00
ed 16c6705b80 test(spawn_interception_v2): mock send_result not send (Phase 2.18, pre-empts Phase 1.3 regression)
Phase 1.3 migrated run_worker_lifecycle to send_result(). The mock_ai_client
fixture in test_spawn_interception_v2.py mocked src.ai_client.send and
returned a string. The test_run_worker_lifecycle_approved test asserts
on the call_args (user_message + md_content), which still works with
the new mock name.

Changes:
- Replace patch(src.ai_client.send) with patch(src.ai_client.send_result)
- Rename mock_send to mock_send_result
- Wrap mock return_value with Result(data="Task completed")
- Add "from src.result_types import Result" import

All 3 tests in test_spawn_interception_v2.py pass.
2026-06-15 16:24:05 -04:00
ed 7a6ffd8954 test(run_worker_lifecycle_abort): mock send_result not send (Phase 2.17, pre-empts Phase 1.3 regression)
Phase 1.3 migrated run_worker_lifecycle to send_result(). This test
mocks src.ai_client.send and asserts it is NOT called (abort fires
before the AI dispatch). Migrating the mock to send_result is purely
for consistency and future-proofing; the test still passes either way.

Changes:
- Rename patch(src.ai_client.send) to patch(src.ai_client.send_result)
- Rename mock_send to mock_send_result
- Comment updated to reference send_result
2026-06-15 16:21:08 -04:00