refactor: add TaskFlow.Contracts for error codes and enums

オープン
#399 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
43/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp, docker

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

tech-debt

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.Contracts project at the repo root, referenced by TaskFlow.Api and TaskFlow.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 Status and Priority into 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 ToolGuard or appear on an explicit "no message needed" list.
  • Update TaskFlow.Api/Dockerfile to copy the new project before restore and publish.

Out of scope

Sharing DTOs and business rules such as IsBlockable.

Acceptance criteria

  1. Adding a new error code without a mapping or list entry fails a test.
  2. The API image builds, and the generated web client has no unwanted changes after npm run gen:api.
  3. A change to TaskFlow.Contracts deploys the API, because it sits outside the assistant/** ignore.
  4. plugin/bin contains no EF Core assemblies.
主要言語
C#
スター
1
フォーク
0
平均マージ
2時間 2分
マージ済み PR(30日)
98

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nevridge/TaskFlow のほかの issue

nevridge/TaskFlow の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。