refactor: Phase 3 — split workspace.ts and plugin.ts by responsibility - #91
Merged
Merged
Conversation
…aged fs, lock, and session file Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nd wiring One FlowService per plugin instance, one workspace resolution path. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…he split modules The load-time workspace validation now records why Flow cannot start before rethrowing, and the developer guide names the new infrastructure and platform modules. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
4 tasks
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
Phase 3 of the runtime refactor plan (
.agents/plans/13-runtime-refactor/README.md). Stacked on #90; retarget once that merges.Two file splits plus one follow-up from the final review:
infrastructure/fs/workspace.tssplit intoworkspace-paths.ts(root validation and.flowlayout),managed-fs.ts(managed filesystem primitives),session-lock.ts(cross-process lock), and a 299-lineworkspace.tskeeping only the session file protocol. Every function body moved verbatim; every importer repointed, including two the plan's file list missed (source-identity.tsand the persistence test's child-process import URL).workspace.tsre-exports nothing exceptArchiveCollisionError. The new files form a strict DAG with no backward edges.platform/opencode/plugin.tssplit intocommand-hook.ts,tool-guard.ts, and a wiring-onlyplugin.ts. Three deliberate changes, all named in the plan: the plugin resolves its workspace throughresolveWorkspaceRootat load (validation moves from the first tool call to plugin load; no valid workspace is affected, and the leadership registry key is unchanged because it already realpathed); oneFlowServiceper plugin instance for the command hook and auto-drive status reads instead of one per call (the whole factory chain is stateless, so this is equivalent); the twosession.deletedchecks in the event hook merged into one branch. The per-call resolution insidetools.tsis deliberately kept: tools must resolve from their ownToolContext.docs/development.mdnames the new modules; the docs byte cap forced a prose trim in the same file.No prompt text, guidance, Zod schema, tool name, tool response field, Session v5 shape, or error message changes.
Test plan
bun run checkatab97a60: 1231 pass, 1 skip, 0 failbun run smoke:liveagainst a reachable OpenCode host: 22 pass. Note: the smoke used a valid workspace, so it does not exercise the new load-time refusal path; the unit test above does.Deferred follow-ups (not blocking)
docs/development.md("must" in Documentation, "immediately" in Release, "intentionally" in Change discipline). Phase 4 edits the same section and restores them.workspace-validation.tscarries its ownlstat/open/realpathprimitives that overlapmanaged-fs.ts; consolidating is a natural later step.guardToolskeeps positional parameters whilecreateCommandHooktakes an options object; justified by what each needs, revisit only if a parameter is added.🤖 Generated with Claude Code