Align scoped workflow draft port naming with actual semantics#252
Merged
potter-sun merged 1 commit intoApr 20, 2026
Merged
Conversation
Under PR #248 / #249, POST /api/workspace/workflows silently migrated from runtime-commit upsert to editor-draft blob write. The behaviour was corrected in #249, but the contract names still advertised the old semantics: - IWorkflowStoragePort / UploadWorkflowYamlAsync / StoredWorkflowYaml - AppScopedWorkflowService.SaveAsync - ChronoStorageWorkflowStoragePort Each name claimed "generic storage" or "save workflow", while the actual responsibility is "scoped workflow draft catalog". Per CLAUDE.md (命名跟随 职责 / API 字段单一语义), callers reading these names form incorrect expectations about runtime visibility, revision IDs, and commit semantics. This commit is a pure semantic rename — no behaviour change: - IWorkflowStoragePort -> IWorkflowDraftStore - ChronoStorageWorkflowStoragePort -> ChronoStorageWorkflowDraftStore - StoredWorkflowYaml -> WorkflowDraft - UploadWorkflowYamlAsync -> SaveDraftAsync - ListWorkflowYamlsAsync -> ListDraftsAsync - GetWorkflowYamlAsync -> GetDraftAsync - DeleteWorkflowYamlAsync -> DeleteDraftAsync - AppScopedWorkflowService.SaveAsync -> SaveDraftAsync (internal helpers named Stored*/storedWorkflow* also renamed to Draft/draft for consistency) - Test stubs / fixtures renamed in lock-step HTTP path POST /api/workspace/workflows and WorkflowFileResponse are intentionally left unchanged — phase 2 will address the response-type double semantics and optionally add an explicit publish endpoint. All 203 Aevatar.Studio.Tests and 339 Aevatar.Tools.Cli.Tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## refactor/frontend #252 +/- ##
=====================================================
- Coverage 68.55% 68.54% -0.02%
=====================================================
Files 1109 1109
Lines 77905 77905
Branches 10204 10204
=====================================================
- Hits 53406 53398 -8
- Misses 20595 20601 +6
- Partials 3904 3906 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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
IWorkflowStoragePort→IWorkflowDraftStore,ChronoStorageWorkflowStoragePort→ChronoStorageWorkflowDraftStore,StoredWorkflowYaml→WorkflowDraft; port methodsUpload/List/Get/DeleteWorkflowYamlAsync→Save/List/Get/DeleteDraftAsync;AppScopedWorkflowService.SaveAsync→SaveDraftAsync; matching internal helpers and test stubs.POST /api/workspace/workflowssilently migrated from runtime-commit to draft-only write, but every layer's name still advertised the old semantics, violating CLAUDE.md 命名跟随职责 / API 字段单一语义./api/workspace/workflow-drafts), splitWorkflowFileResponseinto draft vs committed variants, and decide whether to add an explicit publish endpoint — those all cascade into the frontend.Why this is phase 1 only
POST /api/workspace/workflowsstays. Renaming it would cascade into ~78 frontend files and 3+ frontend test suites.WorkflowFileResponsestill mixes draft-origin fields (FilePath/DirectoryId) with committed-origin fields (Document/Findings/UpdatedAtUtc). Splitting it is a larger design call.IScopeWorkflowCommandPortis not re-wired into Studio saves. If the team decides "save = always draft, publish is a separate user action" then the current shape is correct; if "save = commit" semantics must come back, that's a phase-2 decision.Test plan
dotnet build src/Aevatar.Studio.Hosting/Aevatar.Studio.Hosting.csproj— 0 errorsdotnet test test/Aevatar.Studio.Tests/Aevatar.Studio.Tests.csproj— 203/203 passdotnet test test/Aevatar.Tools.Cli.Tests/Aevatar.Tools.Cli.Tests.csproj— 339/339 passPOST /api/workspace/workflowsand the frontend sees the saved YAML🤖 Generated with Claude Code