refactor(facade): migrate all interfaces to single-core facade (F108)#374
Merged
Conversation
- `.go-arch-lint.yml`: Register new facade dependencies - `internal/application/session_input_reader.go`: Add SessionInputReader consolidating ACP and CLI input handling - `internal/application/session_input_reader_test.go`: Add unit tests for SessionInputReader - `internal/application/facade_adapter.go`: Expand facade adapter with read, resume, and status operations - `internal/application/facade_adapter_reader_test.go`: Add facade reader tests - `internal/application/facade_adapter_resume_test.go`: Add facade resume tests - `internal/application/facade_adapter_status_test.go`: Add facade status tests - `internal/application/facade_projection.go`: Update projection to cover new facade events - `internal/application/acp_session_service.go`: Refactor to use SessionInputReader via facade - `internal/application/acp_session.go`: Align ACP session with new input reader pattern - `internal/application/acp_subscribe_static_test.go`: Add static subscription tests - `internal/application/acp_test_helpers_test.go`: Add shared ACP test helpers - `internal/application/service_validate_options_test.go`: Add validate options coverage - `internal/application/run_session.go`: Route run session through facade adapter - `internal/application/service.go`: Wire SessionInputReader into workflow service - `internal/application/resolver.go`: Update resolver for facade-based wiring - `internal/application/resolver_wire.go`: Align wire config with facade dependencies - `internal/application/execution_service.go`: Adapt execution service to facade contracts - `internal/application/execution_service_transcript.go`: Update transcript integration - `internal/application/drain.go`: Update drain to use facade event types - `internal/application/conversation_manager.go`: Align conversation manager with facade DTOs - `internal/application/history_service.go`: Migrate history service to facade read path - `internal/application/error_codes.go`: Update error codes for facade alignment - `internal/domain/ports/facade.go`: Expand facade port with reader and status contracts - `internal/domain/ports/facade_dto.go`: Add DTOs for read, resume, and status responses - `internal/domain/ports/facade_event.go`: Extend facade event types - `internal/domain/ports/facade_contract_test.go`: Update contract tests for new methods - `internal/domain/transcript/payload.go`: Add payload fields for facade transcript events - `internal/domain/workflow/audit_event.go`: Minor audit event alignment - `internal/infrastructure/acp/input_reader.go`: Remove (consolidated into SessionInputReader) - `internal/infrastructure/acp/input_reader_test.go`: Remove (superseded by session_input_reader_test) - `internal/infrastructure/transcript/nop_recorder.go`: Add no-op recorder for test isolation - `internal/infrastructure/transcript/nop_recorder_test.go`: Add nop recorder tests - `internal/infrastructure/transcript/fanout.go`: Update fanout for new recorder interface - `internal/infrastructure/agents/helpers.go`: Add shared agent helper utilities - `internal/infrastructure/agents/helpers_test.go`: Add helper tests - `internal/infrastructure/errors/human_formatter.go`: Update human formatter output - `internal/infrastructure/pluginmgr/installer.go`: Add plugin installer improvements - `internal/infrastructure/pluginmgr/rpc_manager.go`: Add rpc manager updates - `internal/interfaces/api/bridge.go`: Migrate API bridge to facade read/status/resume - `internal/interfaces/api/handlers_executions.go`: Rewrite execution handlers via facade - `internal/interfaces/api/handlers_history.go`: Migrate history handlers to facade - `internal/interfaces/api/handlers_workflows.go`: Migrate workflow handlers to facade - `internal/interfaces/api/sse.go`: Rewrite SSE streaming through facade events - `internal/interfaces/api/server.go`: Update server wiring for facade-based handlers - `internal/interfaces/api/read_facade_test.go`: Add read facade integration tests - `internal/interfaces/cli/run.go`: Rewrite run command using facade adapter - `internal/interfaces/cli/run_facade_projector.go`: Add CLI facade projector for run output - `internal/interfaces/cli/run_t068_test.go`: Add T068 regression test for run via facade - `internal/interfaces/cli/status.go`: Migrate status command to facade read path - `internal/interfaces/cli/resume.go`: Migrate resume command to facade - `internal/interfaces/cli/history.go`: Migrate history command to facade - `internal/interfaces/cli/list.go`: Migrate list command to facade - `internal/interfaces/cli/validate.go`: Migrate validate command to facade batch delegation - `internal/interfaces/cli/validate_batch_delegation_test.go`: Add batch delegation tests - `internal/interfaces/cli/acp_serve.go`: Update ACP serve to use facade session wiring - `internal/interfaces/cli/config.go`: Wire SessionInputReader in CLI config - `internal/interfaces/cli/ui/sync_writer.go`: Add thread-safe writer for concurrent output - `internal/interfaces/cli/pack_test_helpers_test.go`: Add shared pack test helpers - `internal/interfaces/cli/wiring_transcript_test.go`: Add transcript wiring tests - `internal/interfaces/tui/bridge.go`: Rewrite TUI bridge via facade events - `internal/interfaces/tui/command.go`: Migrate TUI command to facade - `internal/interfaces/tui/tab_monitoring.go`: Update monitoring tab for facade event types - `internal/interfaces/tui/model.go`: Align TUI model with facade DTOs - `internal/interfaces/tui/messages.go`: Update TUI messages for facade event mapping - `internal/testutil/facadetest/facadetest.go`: Extend facade test harness - `internal/testutil/mocks/mocks.go`: Remove hints mock and outdated mocks - `pkg/stringutil/levenshtein.go`: Add Levenshtein distance utility - `pkg/stringutil/levenshtein_test.go`: Add Levenshtein tests - `internal/application/input_bridge.go`: Remove (replaced by SessionInputReader) - `tests/integration/execution/*` (13 files): Remove — coverage absorbed by facade unit tests - `tests/integration/loops/*` (6 files): Remove — coverage absorbed by facade unit tests - `tests/integration/api/*` (3 files): Remove — replaced by facade-based API tests - `tests/integration/features/hooks_test.go`: Remove — superseded by facade hooks coverage - `tests/integration/features/secret_masking_test.go`: Remove — superseded - `tests/integration/features/template_test.go`: Remove — superseded - `tests/integration/features/on_failure_inline_test.go`: Remove — superseded - `tests/integration/subworkflows/*` (2 files): Remove — superseded - `tests/integration/tracing/tracing_test.go`: Remove — superseded - `tests/fixtures/facade/*.golden`: Update golden files for new facade event shapes - `tests/fixtures/workflows/*.yaml`: Sync workflow fixtures with updated field names Closes #373
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FacadeAdapter-based access throughout every command and handlerInputBridgeand ACPinput_readerabstractions, consolidating input handling into the newSessionInputReaderin the application layerFacadeAdaptersurface with reader, resume, and status sub-adapters; addNopRecorder,SyncWriter, andRunFacadeProjectorto support the new wiring across all execution pathsChanges
Domain — Facade Ports
internal/domain/ports/facade.go: Expand facade interface definitions for reader, resume, and status capabilitiesinternal/domain/ports/facade_dto.go: Add/adjust DTOs used by new facade sub-interfacesinternal/domain/ports/facade_event.go: Align event types with facade-based event propagationinternal/domain/ports/facade_contract_test.go: Update contract tests to cover new interface surfaceinternal/domain/transcript/payload.go: Add fields required by facade transcript integrationinternal/domain/workflow/audit_event.go: Minor alignment with new facade event modelinternal/domain/workflow/audit_event_test.go: Add tests for updated audit event fieldsApplication — Facade Adapter & Session Layer
internal/application/facade_adapter.go: ExtendFacadeAdapterwith reader, resume, and status sub-adaptersinternal/application/facade_adapter_reader_test.go: New tests for reader facade surfaceinternal/application/facade_adapter_resume_test.go: New tests for resume facade surfaceinternal/application/facade_adapter_status_test.go: New tests for status facade surfaceinternal/application/facade_adapter_test.go: Update existing adapter tests for new surfaceinternal/application/facade_projection.go: Align projection logic with new facade DTOsinternal/application/facade_projection_test.go: Update and expand projection testsinternal/application/session_input_reader.go: New — consolidates input reading into a single application-layer type, replacingInputBridgeand ACPinput_readerinternal/application/session_input_reader_test.go: Tests forSessionInputReaderinternal/application/input_bridge.go: Deleted — superseded bySessionInputReaderinternal/application/input_bridge_test.go: Deletedinternal/application/acp_session.go: Migrate to facade-based input readinginternal/application/acp_session_service.go: Migrate to facade-based wiring; remove parking-lot session patterninternal/application/acp_session_service_parking_test.go: Deleted — pattern removedinternal/application/acp_session_service_test.go: Rewrite to test facade-based session serviceinternal/application/acp_subscribe_static_test.go: New tests for static ACP subscription pathinternal/application/acp_test_helpers_test.go: New shared helpers for ACP application testsinternal/application/acp_audit_fixes_test.go: Update for facade-based audit wiringinternal/application/acp_session_test.go: Update session tests for new input readerinternal/application/conversation_manager.go: Align with facade adapter changesinternal/application/drain.go: Align with new session wiringinternal/application/error_codes.go: Consolidate error code definitions; remove duplicatesinternal/application/error_codes_test.go: Trim tests for removed error codesinternal/application/execution_service.go: Wire facade-based execution pathinternal/application/execution_service_transcript.go: Align transcript wiring with facadeinternal/application/execution_setup.go: Update setup for new resolver wiringinternal/application/history_service.go: Migrate to facade-based history accessinternal/application/resolver.go: Update resolver for facade-based dependency injectioninternal/application/resolver_wire.go: Rewire resolver composition for facade patterninternal/application/resolver_wire_test.go: Update resolver wiring testsinternal/application/resolver_test.go: Update resolver unit testsinternal/application/run_session.go: Migrate run session to new input readerinternal/application/service.go: Migrate workflow service to facade wiringinternal/application/service_validate_options_test.go: New tests for service option validationinternal/application/session_registry.go: Align registry with new session typesinternal/application/test_helpers.go→internal/application/test_helpers_test.go: Move test helpers to test-only fileinternal/application/execution_service_*_test.go(20 files): Update all execution service tests to facade-based constructionInfrastructure — Input, Transcript & Agents
internal/infrastructure/acp/input_reader.go: Deleted — input reading moved to application layerinternal/infrastructure/acp/input_reader_test.go: Deletedinternal/infrastructure/acp/agent_test.go: Update for removed input readerinternal/infrastructure/acp/doc.go: Update package doc to reflect removed typesinternal/infrastructure/acp/doc_test.go: Align with updated package docinternal/infrastructure/transcript/nop_recorder.go: New no-op transcript recorder for test and dry-run pathsinternal/infrastructure/transcript/nop_recorder_test.go: Tests forNopRecorderinternal/infrastructure/transcript/fanout.go: Align fanout with new recorder interfaceinternal/infrastructure/agents/helpers.go: Add shared provider helper utilitiesinternal/infrastructure/agents/helpers_test.go: Tests for new helper utilitiesinternal/infrastructure/agents/claude_provider_test.go: Update for facade-based test constructioninternal/infrastructure/agents/codex_provider_test.go: Update for facade-based test constructioninternal/infrastructure/agents/codex_provider_validation_unit_test.go: Update validation testsinternal/infrastructure/agents/gemini_provider_test.go: Update for facade-based test constructioninternal/infrastructure/agents/opencode_provider_test.go: Update for facade-based test constructioninternal/infrastructure/errors/human_formatter.go: Align with updated error code taxonomyinternal/infrastructure/errors/human_formatter_test.go: Add tests for new formatter behaviorinternal/infrastructure/pluginmgr/installer.go: Add graceful shutdown before binary removalinternal/infrastructure/pluginmgr/installer_test.go: Update installer testsinternal/infrastructure/pluginmgr/rpc_manager.go: Add connection cleanup hooksinternal/infrastructure/pluginmgr/rpc_manager_test.go: Add RPC manager lifecycle testsInterfaces — CLI
internal/interfaces/cli/run.go: Migrateruncommand to facade-based executioninternal/interfaces/cli/run_facade_projector.go: New —RunFacadeProjectorwires run output through facade projectioninternal/interfaces/cli/run_t068_test.go: New regression test for T068 run pathinternal/interfaces/cli/resume.go: Migrateresumecommand to facade reader/statusinternal/interfaces/cli/status.go: Migratestatuscommand to facade status adapterinternal/interfaces/cli/history.go: Migratehistorycommand to facade history adapterinternal/interfaces/cli/list.go: Migratelistcommand to facadeinternal/interfaces/cli/validate.go: Migratevalidatecommand to facadeinternal/interfaces/cli/acp_serve.go: Migrate ACP serve command to facade session wiringinternal/interfaces/cli/serve.go: Align serve command with facadeinternal/interfaces/cli/config.go: Update CLI config wiring for facadeinternal/interfaces/cli/workflow_cmd.go: Update workflow command for facadeinternal/interfaces/cli/ui/sync_writer.go: New — thread-safe writer for concurrent CLI outputinternal/interfaces/cli/ui/colors.go: Align color helpers with new UI patternsinternal/interfaces/cli/pack_test_helpers_test.go: New shared pack test helpersinternal/interfaces/cli/validate_batch_delegation_test.go: New batch delegation tests for validateinternal/interfaces/cli/collect_pack_workflows_test.go: Deleted — covered by new delegation testsinternal/interfaces/cli/validate_skip_plugins_test.go: Deleted — covered by facade conformance testsinternal/interfaces/cli/history_internal_test.go: Trimmed to remove dead internal testsinternal/interfaces/cli/run_internal_test.go: Trimmed to remove dead internal testsinternal/interfaces/cli/status_internal_test.go: Update internal status tests for facadeinternal/interfaces/cli/acp_serve_lifecycle_test.go: Update lifecycle tests for facade ACP serveinternal/interfaces/cli/acp_serve_test.go: New ACP serve facade testsinternal/interfaces/cli/resume_test.go,resume_list_test.go: Update for facade resumeinternal/interfaces/cli/history_test.go,list_test.go,run_test.go,status_test.go,validate_test.go: Update for facade-based commandsinternal/interfaces/cli/wiring_transcript_test.go: Update transcript wiring testsinternal/interfaces/cli/run_interactive_config_test.go,run_wiring_validator_test.go,validate_mcp_proxy_test.go,validate_pack_test.go,validate_helpers_test.go,list_coverage_test.go: Update for facade migrationInterfaces — API
internal/interfaces/api/bridge.go: Migrate API bridge to facade adapterinternal/interfaces/api/handlers_executions.go: Migrate execution handlers to facadeinternal/interfaces/api/handlers_history.go: Migrate history handlers to facadeinternal/interfaces/api/handlers_workflows.go: Migrate workflow handlers to facadeinternal/interfaces/api/sse.go: Align SSE streaming with facade event propagationinternal/interfaces/api/server.go: Align server setup with facade wiringinternal/interfaces/api/respond_handler.go: Add response helper for facade resultsinternal/interfaces/api/doc.go: Update API package documentationinternal/interfaces/api/read_facade_test.go: New tests for API read facade surfaceinternal/interfaces/api/bridge_test.go,handlers_executions_test.go,handlers_history_test.go,handlers_workflows_test.go,respond_handler_test.go,server_test.go,sse_test.go: Update all API tests for facade migrationInterfaces — TUI
internal/interfaces/tui/bridge.go: Migrate TUI bridge to facade adapterinternal/interfaces/tui/command.go: Align TUI command dispatch with facadeinternal/interfaces/tui/messages.go: Align TUI messages with facade event typesinternal/interfaces/tui/model.go: Update TUI model for facade-based state accessinternal/interfaces/tui/tab_monitoring.go: Migrate monitoring tab to facade status/eventsinternal/interfaces/tui/doc.go: Update TUI package documentationinternal/interfaces/tui/bridge_test.go,command_test.go,messages_test.go,model_test.go,tab_monitoring_test.go,tab_workflows_test.go: Update all TUI tests for facade migrationTest Utilities
internal/testutil/facadetest/facadetest.go: Extend facade test harness for new sub-adaptersinternal/testutil/facadetest/facadetest_test.go: Update facadetest testsinternal/testutil/mocks/mocks.go: Trim mocks no longer needed after facade migrationinternal/testutil/mocks/mocks_hints_test.go: Deleted — hints mock pattern removedinternal/testutil/mocks/mocks_test.go: Remove tests for deleted mocksinternal/testutil/mocks/mocks_agent_test.go,mocks_cli_executor_test.go: Update surviving mock testsinternal/testutil/builders/builders_test.go: Update builder testsinternal/testutil/fixtures/fixtures.go,fixtures_test.go: Align fixtures loader with facade test harnessinternal/testutil/doc.go: Update testutil package documentationIntegration Tests — Deleted (covered by facade conformance)
tests/integration/execution/**(13 files): Deleted — execution scenarios now covered via facade conformance teststests/integration/loops/**(6 files): Deleted — loop scenarios now covered via facade conformance teststests/integration/subworkflows/**(2 files): Deletedtests/integration/features/hooks_test.go,on_failure_inline_test.go,secret_masking_test.go,template_test.go: Deletedtests/integration/api/functional_test.go,pack_workflow_test.go,server_integration_test.go: Deletedtests/integration/cleanup/test_cleanup_functional_test.go: Deletedtests/integration/event_feature_functional_test.go,event_lifecycle_integration_test.go: Deletedtests/integration/agents/display_matrix_test.go: Deletedtests/integration/plugins/http_operation_test.go,notify_plugin_test.go: Deletedtests/integration/state/history_test.go: Deletedtests/integration/tracing/tracing_test.go: Deletedtests/integration/validation/input_validation_functional_test.go,input_validation_test.go: DeletedIntegration Tests — Updated
tests/integration/features/cli_test.go,conversation_test.go,conversation_validation_test.go,facade_conformance_test.go,facade_resume_test.go,interactive_conversation_test.go,interactive_test.go,session_resume_test.go: Migrate to facade-based test harnesstests/integration/cli/**(7 files): Update all CLI integration tests for facadetests/integration/agents/c065_provider_options_audit_test.go,display_events_integration_test.go: Update for facadetests/integration/agents/test_helpers_test.go: New shared helpers for agent integration teststests/integration/cli/cli_test_helpers_test.go: Update shared CLI integration helperstests/integration/errors/error_codes_test.go,error_output_streams_test.go: Update error integration teststests/integration/plugins/github_plugin_test.go,notify_plugin_backend_removal_test.go,plugin_test.go,test_helpers_test.go: Update plugin integration teststests/integration/skills/validate_command_skills_test.go: Update for facade validatetests/integration/tui/tui_functional_test.go,tui_test.go: Update TUI integration teststests/integration/validation/casing_validation_test.go,validation_providers_test.go: Update validation integration teststests/integration/test_helpers_test.go,testhelpers/helpers.go: Update shared integration test infrastructureFixtures & Config
tests/fixtures/facade/acp-session-update.golden,cli-stdout.golden,sse-frames.golden,tui-tea-msg.golden: Update golden files for new facade output formattests/fixtures/workflows/agent-*.yaml,conversation-*.yaml,expr-agent-fields.yaml: Align workflow fixtures with updated provider optionstests/fixtures/api/api-failing.yaml: Update API fixture.go-arch-lint.yml: Register new packages in architecture lint rulesCHANGELOG.md: Add F108 entry.zpm/kb/default/journal.lock,.zpm/kb/feedback/journal.lock: Initialize ZPM knowledge-base journal lockspkg/stringutil/levenshtein.go,levenshtein_test.go: Expose Levenshtein distance utility used in facade error suggestionsTest plan
make build— verify binary compiles clean with no import errors after all interface migrationsmake test-unit— all 53+ unit test packages pass with zero failuresmake test-integration— facade conformance, CLI, TUI, and API integration tests passmake lint— zero violations, including.go-arch-lint.ymlarchitecture constraintsCloses #373
Generated with awf commit workflow