Enforce exec boundaries with interfaces and generated mocks#423
Closed
Enforce exec boundaries with interfaces and generated mocks#423
Conversation
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
git.Runner,github.Client, and daemonProcessManager, then routing daemon/github/pr callsites through those interfaces.internal/tmuxpackage, addedgo generatemock pipeline ininternal/testutil/mocks, and generated mocks forOrchAPI,Store,Multiplexer,git.Runner, andgithub.Client.stop,continue,exec,log) and added semgrep architecture guards for raw exec and legacy tmux imports.Acceptance Criteria Evidence
git.Runnerinterface exists; daemon uses it instead of raw execinternal/git/runner.gointernal/daemon/proto_handler.goandinternal/daemon/socket.go.github.Clientinterface exists; github/pr packages use itinternal/github/client.gointernal/github/backend.goandinternal/pr/cache.gonow call the client abstraction.daemon.ProcessManagerinterface exists for opencode server lifecycleinternal/daemon/process_manager.gointernal/daemon/socket.gonow routes lifecycle operations throughprocessMgr.internal/tmux/package removed; all callers usemultiplexer.Multiplexerinternal/tmux/tmux.go,internal/tmux/tmux_test.go.attachDeps-style DI (no more direct hardwired deps in targeted commands)internal/cli/stop.go,internal/cli/continue.go,internal/cli/exec.go,internal/cli/log.go.go generatefor interfaces with 5+ methodsinternal/testutil/mocks/generate.goorchapi_moq.go,store_moq.go,multiplexer_moq.go,git_runner_moq.go,github_client_moq.go.internal/testutil/package with common test helpersinternal/testutil/mocks/with generated reusable mocks.exec.Commandin daemon/cli/monitor layers.semgrep/architecture.yaml:no-raw-exec-outside-boundary,no-legacy-tmux-import.make lintpasses with new rulesmake lint(pass).go test ./...passesgo test ./...(pass).var execCommandhacks introducedvar execCommandshims.Validation Commands
go test ./...make lintgo generate ./internal/testutil/mocksRefs: orch-443