refactor: add TaskFlow.Contracts for error codes and enums
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 43/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp, docker
- Domain
- backend-api-design, build-system, ci-cd, testing
Research direction
Start by checking #398, which blocks this issue, then inspect TaskRuleErrors.cs, TaskItemsController, ToolGuard, and TaskFlow.Api/Dockerfile to confirm the existing error codes and project references. Review the API and MCP project files and deployment workflow to identify required changes. Done when the reflection test covers every code, the API image builds, npm run gen:api produces no unwanted changes, changes to TaskFlow.Contracts trigger API deployment, and plugin/bin contains no EF Core assemblies.
Written by the indexing model from the issue text.
Description
Part of #397. Blocked by #398.
Problem
The API has about 18 distinct machine-readable error codes (from a pattern search; confirm the list when centralising them). ToolGuard maps 5. Only 3 are in TaskRuleErrors.cs; others, such as TASK_START_NOT_ALLOWED, are defined in TaskItemsController. A new code reaches users with no specific guidance, and nothing flags it.
Scope
- Add a
TaskFlow.Contractsproject at the repo root, referenced byTaskFlow.ApiandTaskFlow.Mcp. It has no EF Core or ASP.NET dependencies. - Move every error code into it as a constant. Leave the response bodies in the API.
- Move
StatusandPriorityinto it. Decide whether the MCP server adopts the enums or keeps strings, based on the size of that migration. - Add a reflection test: each code must be mapped in
ToolGuardor appear on an explicit "no message needed" list. - Update
TaskFlow.Api/Dockerfileto copy the new project before restore and publish.
Out of scope
Sharing DTOs and business rules such as IsBlockable.
Acceptance criteria
- Adding a new error code without a mapping or list entry fails a test.
- The API image builds, and the generated web client has no unwanted changes after
npm run gen:api. - A change to
TaskFlow.Contractsdeploys the API, because it sits outside theassistant/**ignore. plugin/bincontains no EF Core assemblies.
- Dominant language
- C#
- Stars
- 1
- Forks
- 0
- Avg merge
- 2h 2m
- Merged PRs (30d)
- 98
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nevridge/TaskFlow
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
All issues in nevridge/TaskFlow
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
juandresrodca/AdminForge#54 ·
-
要トリアージ 辞書
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
yksr-melt/Meltype#1625 · 1 reaction ·
Maintainers usually reply within 1 day
-
Docs typoOpen
Difficulty 1/5 Under an hour Newbie friendliness 78/100
MonoGame/docs.monogame.github.io#328 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
space-wizards/RobustToolbox#7197 ·
Maintainers usually reply within 1 day
-
documentation high priority
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
lachydotmcg/capri-desktop#201 ·
Maintainers usually reply within 1 day