todo-45.3-sync-resolution-completeness.md 1.9 KB

Todo 45.3 Sync Resolution Completeness Plan

Status: done

Result

Synchronous execution honors structured resolution completeness and rejects incomplete optional-only arguments without invoking the handler.

Goal

Keep synchronous and asynchronous event execution semantically aligned by rejecting a structured deterministic resolution that explicitly reports complete=False, even when the schema has no required fields.

Scope

  • Add a regression test for execute_sync() with an optional-only schema and an explicitly incomplete structured resolver result.
  • Return INVALID_ARGUMENTS with a stable incomplete-arguments error before invoking the handler.
  • Preserve complete structured results and legacy plain-dict resolver compatibility.
  • Do not add synchronous LLM fallback support in this fix.

Files

  • Modify: src/agent_lab/application/events/kernel.py
  • Modify: tests/test_event_kernel.py

Requirement Execution Loop

Plan

  1. Write a failing test proving the current sync path executes the handler for an explicitly incomplete result.
  2. Capture the completeness flag in execute_sync() and normalize it to the same invalid result used by the async path when no fallback can run.
  3. Run focused kernel tests, the full suite, and git diff --check.

Act

  • Use EventArgumentResolution(arguments={}, complete=False) with a schema whose fields are optional.
  • Track handler calls and assert the count remains zero.
  • Assert status is INVALID_ARGUMENTS and the error is event arguments incomplete.

Observe

Confirm sync execution no longer treats schema-valid-but-incomplete resolution as executable, while complete and plain-dict resolvers remain unchanged.

Update

  • Re-run Todo 45 specification and quality reviews.
  • Mark Todos 45 through 45.3 done only after review and fresh verification.

Verification

  • uv run pytest tests/test_event_kernel.py -q
  • uv run pytest
  • git diff --check