Skip to content

Align scoped workflow draft port naming with actual semantics#252

Merged
potter-sun merged 1 commit into
refactor/frontendfrom
fix/2026-04-20_workflow-draft-semantic-rename
Apr 20, 2026
Merged

Align scoped workflow draft port naming with actual semantics#252
potter-sun merged 1 commit into
refactor/frontendfrom
fix/2026-04-20_workflow-draft-semantic-rename

Conversation

@eanzhao
Copy link
Copy Markdown
Contributor

@eanzhao eanzhao commented Apr 20, 2026

Summary

  • Pure rename: IWorkflowStoragePortIWorkflowDraftStore, ChronoStorageWorkflowStoragePortChronoStorageWorkflowDraftStore, StoredWorkflowYamlWorkflowDraft; port methods Upload/List/Get/DeleteWorkflowYamlAsyncSave/List/Get/DeleteDraftAsync; AppScopedWorkflowService.SaveAsyncSaveDraftAsync; matching internal helpers and test stubs.
  • Zero behavior change. Motivated by the semantic-drift finding on Refactor/frontend #248 (see Refactor/frontend #248 (comment)): under Refactor/frontend #248/Fix scoped workflow draft handling #249, POST /api/workspace/workflows silently migrated from runtime-commit to draft-only write, but every layer's name still advertised the old semantics, violating CLAUDE.md 命名跟随职责 / API 字段单一语义.
  • This is phase 1 of the alignment. Phase 2 (separate PR) will tackle the HTTP path (/api/workspace/workflow-drafts), split WorkflowFileResponse into 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

  • HTTP path POST /api/workspace/workflows stays. Renaming it would cascade into ~78 frontend files and 3+ frontend test suites.
  • WorkflowFileResponse still mixes draft-origin fields (FilePath/DirectoryId) with committed-origin fields (Document/Findings/UpdatedAtUtc). Splitting it is a larger design call.
  • IScopeWorkflowCommandPort is 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 errors
  • dotnet test test/Aevatar.Studio.Tests/Aevatar.Studio.Tests.csproj — 203/203 pass
  • dotnet test test/Aevatar.Tools.Cli.Tests/Aevatar.Tools.Cli.Tests.csproj — 339/339 pass
  • CI
  • Manual smoke: Studio editor save still round-trips a workflow through POST /api/workspace/workflows and the frontend sees the saved YAML

🤖 Generated with Claude Code

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
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 72.30769% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.54%. Comparing base (a4a5a92) to head (61a0814).
⚠️ Report is 2 commits behind head on refactor/frontend.

Files with missing lines Patch % Lines
...tar.Studio.Application/AppScopedWorkflowService.cs 81.63% 5 Missing and 4 partials ⚠️
...ructure/Storage/ChronoStorageWorkflowDraftStore.cs 12.50% 7 Missing ⚠️
...ication/Studio/Abstractions/IWorkflowDraftStore.cs 80.00% 1 Missing ⚠️
....Studio.Hosting/Controllers/WorkspaceController.cs 0.00% 1 Missing ⚠️
@@                  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     
Flag Coverage Δ
ci 68.54% <72.30%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...osting/StudioHostingServiceCollectionExtensions.cs 100.00% <100.00%> (ø)
...DependencyInjection/ServiceCollectionExtensions.cs 100.00% <100.00%> (ø)
...ication/Studio/Abstractions/IWorkflowDraftStore.cs 80.00% <80.00%> (ø)
....Studio.Hosting/Controllers/WorkspaceController.cs 30.34% <0.00%> (ø)
...ructure/Storage/ChronoStorageWorkflowDraftStore.cs 34.83% <12.50%> (ø)
...tar.Studio.Application/AppScopedWorkflowService.cs 60.64% <81.63%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@potter-sun potter-sun merged commit fd9e546 into refactor/frontend Apr 20, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants