UAT: _cleveragents/sync/pull, sync/push, and sync/status A2A methods return stub not_implemented — no functional entity sync in server mode #2148

Open
opened 2026-04-03 04:27:22 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/a2a-sync-pull-push-status-stub
  • Commit Message: fix(a2a): implement _cleveragents/sync/pull, sync/push, and sync/status handlers
  • Milestone: v3.7.0
  • Parent Epic: #933

Bug Report

What Was Tested

Code-level analysis of the _cleveragents/sync/* handler implementations in src/cleveragents/a2a/facade.py.

Expected Behavior (from spec)

The specification defines the following sync methods:

  • _cleveragents/sync/pull: Fetches updates for a specific set of entities from the server
  • _cleveragents/sync/push: Pushes local entity changes to the server
  • _cleveragents/sync/status: Checks the synchronization status of the client (last sync time, pending changes, etc.)

These methods are required for the incremental sync model that operates after the initial _cleveragents/sync/full call. They must:

  1. Accept namespace and entity type parameters
  2. Return actual entity data or sync status information
  3. Integrate with the server's entity persistence layer

Actual Behavior

All three sync methods (sync/pull, sync/push, sync/status) are implemented as a single stub handler _handle_sync_stub in src/cleveragents/a2a/facade.py (lines 604–607):

def _handle_sync_stub(self, params: dict[str, Any]) -> dict[str, Any]:
    return {"status": "not_implemented", "stub": True}

This stub:

  1. Ignores all parameters (namespace, entity type, etc.)
  2. Returns no entity data
  3. Does not integrate with any service layer
  4. Does not track sync state or timestamps
  5. Does not validate that a server connection exists before attempting sync

The server.sync.auto and server.sync.interval config keys are registered (in config_service.py lines 277–292) but are never consumed by any sync implementation — there is no background sync scheduler that uses these values.

Code Locations

  • src/cleveragents/a2a/facade.py lines 278–280: Handler map pointing to _handle_sync_stub
  • src/cleveragents/a2a/facade.py lines 604–607: _handle_sync_stub implementation
  • src/cleveragents/application/services/config_service.py lines 277–292: server.sync.auto and server.sync.interval config keys registered but unused

Steps to Reproduce

from cleveragents.a2a.facade import A2aLocalFacade
from cleveragents.a2a.models import A2aRequest

facade = A2aLocalFacade()

# sync/pull should return entity data, not a stub
req = A2aRequest(method="_cleveragents/sync/pull", params={"namespace": "team-alpha"})
resp = facade.dispatch(req)
assert resp.result.get("stub") is None  # FAILS — returns {"status": "not_implemented", "stub": True}

# sync/status should return actual sync state
req = A2aRequest(method="_cleveragents/sync/status", params={})
resp = facade.dispatch(req)
assert "last_sync_at" in resp.result  # FAILS — returns stub

Severity

High — The incremental sync methods are required for the ongoing entity synchronization model. Without them, clients cannot pull entity updates or push local changes to the server after the initial connection.

Subtasks

  • Implement _handle_sync_pull: validate params (namespace, entity type), query entity persistence layer, return entity data payload
  • Implement _handle_sync_push: validate params, accept entity payload, write to server persistence layer, return confirmation with timestamp
  • Implement _handle_sync_status: return last sync timestamp, pending change count, and connection state
  • Wire server.sync.auto and server.sync.interval config keys into a background sync scheduler
  • Add argument validation (fail-fast) to all three handlers per CONTRIBUTING.md standards
  • Write Behave unit test scenarios for sync/pull, sync/push, and sync/status (happy path + error cases)
  • Write Robot Framework integration test for incremental sync flow (pull → push → status)
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions) and fix any errors

Definition of Done

  • _cleveragents/sync/pull returns real entity data scoped to the requested namespace and entity type
  • _cleveragents/sync/push persists entity changes to the server and returns a timestamped confirmation
  • _cleveragents/sync/status returns last_sync_at, pending_changes, and connection state
  • server.sync.auto and server.sync.interval config keys are consumed by a background scheduler
  • All handlers validate arguments as their first action (fail-fast)
  • No {"status": "not_implemented", "stub": True} responses remain for these three methods
  • Behave scenarios cover happy path and error cases for all three methods
  • Robot Framework integration test for the full incremental sync flow passes
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/a2a-sync-pull-push-status-stub` - **Commit Message**: `fix(a2a): implement _cleveragents/sync/pull, sync/push, and sync/status handlers` - **Milestone**: v3.7.0 - **Parent Epic**: #933 ## Bug Report ### What Was Tested Code-level analysis of the `_cleveragents/sync/*` handler implementations in `src/cleveragents/a2a/facade.py`. ### Expected Behavior (from spec) The specification defines the following sync methods: - `_cleveragents/sync/pull`: Fetches updates for a specific set of entities from the server - `_cleveragents/sync/push`: Pushes local entity changes to the server - `_cleveragents/sync/status`: Checks the synchronization status of the client (last sync time, pending changes, etc.) These methods are required for the incremental sync model that operates after the initial `_cleveragents/sync/full` call. They must: 1. Accept namespace and entity type parameters 2. Return actual entity data or sync status information 3. Integrate with the server's entity persistence layer ### Actual Behavior All three sync methods (`sync/pull`, `sync/push`, `sync/status`) are implemented as a single stub handler `_handle_sync_stub` in `src/cleveragents/a2a/facade.py` (lines 604–607): ```python def _handle_sync_stub(self, params: dict[str, Any]) -> dict[str, Any]: return {"status": "not_implemented", "stub": True} ``` This stub: 1. Ignores all parameters (namespace, entity type, etc.) 2. Returns no entity data 3. Does not integrate with any service layer 4. Does not track sync state or timestamps 5. Does not validate that a server connection exists before attempting sync The `server.sync.auto` and `server.sync.interval` config keys are registered (in `config_service.py` lines 277–292) but are never consumed by any sync implementation — there is no background sync scheduler that uses these values. ### Code Locations - `src/cleveragents/a2a/facade.py` lines 278–280: Handler map pointing to `_handle_sync_stub` - `src/cleveragents/a2a/facade.py` lines 604–607: `_handle_sync_stub` implementation - `src/cleveragents/application/services/config_service.py` lines 277–292: `server.sync.auto` and `server.sync.interval` config keys registered but unused ### Steps to Reproduce ```python from cleveragents.a2a.facade import A2aLocalFacade from cleveragents.a2a.models import A2aRequest facade = A2aLocalFacade() # sync/pull should return entity data, not a stub req = A2aRequest(method="_cleveragents/sync/pull", params={"namespace": "team-alpha"}) resp = facade.dispatch(req) assert resp.result.get("stub") is None # FAILS — returns {"status": "not_implemented", "stub": True} # sync/status should return actual sync state req = A2aRequest(method="_cleveragents/sync/status", params={}) resp = facade.dispatch(req) assert "last_sync_at" in resp.result # FAILS — returns stub ``` ### Severity **High** — The incremental sync methods are required for the ongoing entity synchronization model. Without them, clients cannot pull entity updates or push local changes to the server after the initial connection. ## Subtasks - [ ] Implement `_handle_sync_pull`: validate params (namespace, entity type), query entity persistence layer, return entity data payload - [ ] Implement `_handle_sync_push`: validate params, accept entity payload, write to server persistence layer, return confirmation with timestamp - [ ] Implement `_handle_sync_status`: return last sync timestamp, pending change count, and connection state - [ ] Wire `server.sync.auto` and `server.sync.interval` config keys into a background sync scheduler - [ ] Add argument validation (fail-fast) to all three handlers per CONTRIBUTING.md standards - [ ] Write Behave unit test scenarios for `sync/pull`, `sync/push`, and `sync/status` (happy path + error cases) - [ ] Write Robot Framework integration test for incremental sync flow (pull → push → status) - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions) and fix any errors ## Definition of Done - [ ] `_cleveragents/sync/pull` returns real entity data scoped to the requested namespace and entity type - [ ] `_cleveragents/sync/push` persists entity changes to the server and returns a timestamped confirmation - [ ] `_cleveragents/sync/status` returns `last_sync_at`, `pending_changes`, and connection state - [ ] `server.sync.auto` and `server.sync.interval` config keys are consumed by a background scheduler - [ ] All handlers validate arguments as their first action (fail-fast) - [ ] No `{"status": "not_implemented", "stub": True}` responses remain for these three methods - [ ] Behave scenarios cover happy path and error cases for all three methods - [ ] Robot Framework integration test for the full incremental sync flow passes - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 04:27:27 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High (confirmed) — All three incremental sync methods return stubs. Related to #2135 (missing sync/full). Together, the entire entity sync subsystem is non-functional.
  • Milestone: v3.7.0 (confirmed — A2A Protocol Compliance Epic #933)
  • MoSCoW: Should Have — The incremental sync methods are required for ongoing entity synchronization after the initial sync/full call. Without them, the sync model is completely non-functional. This is a large scope issue but important for server mode.
  • Parent Epic: #933 (confirmed correct)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: High (confirmed) — All three incremental sync methods return stubs. Related to #2135 (missing `sync/full`). Together, the entire entity sync subsystem is non-functional. - **Milestone**: v3.7.0 (confirmed — A2A Protocol Compliance Epic #933) - **MoSCoW**: Should Have — The incremental sync methods are required for ongoing entity synchronization after the initial `sync/full` call. Without them, the sync model is completely non-functional. This is a large scope issue but important for server mode. - **Parent Epic**: #933 (confirmed correct) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo self-assigned this 2026-04-03 16:58:01 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#2148
No description provided.