refactor: add TaskFlow.Contracts for error codes and enums

Aperta
#399 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
43/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, docker

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
C#
Stelle
1
Fork
0
Merge medio
2h 2m
PR unite (30g)
98

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nevridge/TaskFlow

Tutte le issue di nevridge/TaskFlow

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.