You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an explicit contract-focused test suite that hard-fails when CodeWalk drifts from critical OpenCode lifecycle semantics, especially around prompt_async, optimistic message IDs, SSE reconciliation, and deferred config mutation.
This issue depends on the contract inventory produced in #26 and should treat that inventory as the baseline.
Why this exists
The highest-risk regressions in CodeWalk are not generic UI bugs; they are contract regressions where the client silently diverges from the server-authoritative lifecycle. ADR-023 already calls this out, and ADR-019 adds timing sensitivity around PATCH /config during active processing.
Known dangerous areas include:
Optimistic message ID shape (local_user_*)
Accidentally forwarding messageId in prompt_async
Session state transitions that invent client-side meaning instead of following server events
Merge/reconcile behavior that drops valid assistant responses
Config mutation while the server is actively processing
Prefer high-signal tests that lock behavior at the contract boundary over snapshotting random widget trees. The point is to make future drift expensive and obvious.
Summary
Add an explicit contract-focused test suite that hard-fails when CodeWalk drifts from critical OpenCode lifecycle semantics, especially around
prompt_async, optimistic message IDs, SSE reconciliation, and deferred config mutation.This issue depends on the contract inventory produced in #26 and should treat that inventory as the baseline.
Why this exists
The highest-risk regressions in CodeWalk are not generic UI bugs; they are contract regressions where the client silently diverges from the server-authoritative lifecycle. ADR-023 already calls this out, and ADR-019 adds timing sensitivity around
PATCH /configduring active processing.Known dangerous areas include:
local_user_*)messageIdinprompt_asyncRequired references
ADR.mdADR.mdBEHAVIOR.mdCurrent repo evidence to inspect
lib/presentation/providers/chat_provider.dartlib/presentation/providers/chat_provider/chat_provider_message_merge_ops.dartlib/presentation/providers/chat_provider/chat_provider_realtime_ops.dartlib/presentation/providers/chat_provider/chat_provider_event_reducer_ops.dartlib/data/datasources/chat_remote_datasource.dartlib/data/datasources/app_remote_datasource.darttest/integration/opencode_server_integration_test.darttest/support/mock_opencode_server.darttest/unit/providers/chat_provider_*Scope
Implement a dedicated contract test layer that validates at minimum:
prompt_asyncpayload must not forwardmessageIdlocal_user_<timestamp>_<seq>patternidle,busy, etc.)PATCH /configmust not happen during active processing in ways forbidden by ADR-019/commandvs chat send path) once Contract Matrix: build OpenCode source-of-truth and capability inventory for CodeWalk #26 confirms the baselineDeliverables
test/contract/Acceptance criteria
local_user_*ormessageIdforwarding causes CI failure.Non-goals
Test commands
make checkDependencies
Notes for the implementer
Prefer high-signal tests that lock behavior at the contract boundary over snapshotting random widget trees. The point is to make future drift expensive and obvious.