fix(cli): a corrupted manifest is named only by doctor, and EACCES is reported as invalid JSON

Abierto
#1,313 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
57/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
cli

Línea de trabajo

Read manifest-file-io.ts, doctor-use-case.ts, and the two manifest loader files listed for refactor/cli-target; compare how each handles invalid JSON and read errors. Start by adding the two red-first tests described in the issue: invalid JSON through a non-doctor command such as status, and EACCES through doctor. Done means all manifest-loading commands report invalid data and permission failures with the correct cause and recovery command.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Description

A corrupted manifest is reported as manifest-corrupted only by aidd doctor. Every other command surfaces the repository's raw error. Doctor also reports any read failure, EACCES included, as invalid JSON.

Affected file(s)
  • next: cli/src/contexts/framework/application/doctor/doctor-use-case.ts (loadManifest: a bare catch turns every error into "Manifest is corrupted (invalid JSON)"), cli/src/contexts/framework/infrastructure/manifest-file-io.ts (readManifestFile: rethrows non-ENOENT read errors, throws InvalidManifestDataError for bad JSON), about 26 other manifestRepo.load() call sites.
  • refactor/cli-target: cli/src/contexts/installation/application/doctor/load-manifest.ts (LoadManifest), cli/src/contexts/installation/application/shared/require-manifest.ts (requireManifest), cli/src/shared/domain/errors.ts (ManifestUnavailableCode). Both files already carry a Limit: note describing this.
Expected behaviour

Any command that needs the manifest reports an unreadable or invalid one the same way, with the right cause: invalid JSON or a refused version as corrupted, a permission error as a permission error, each with the recovery command.

Observed behaviour
  • Doctor: any load() failure becomes "Manifest is corrupted (invalid JSON). Run aidd clean --force and re-initialize.", including EACCES, which is not a corruption, and the advice (clean --force) is then wrong.
  • Other commands: the raw error from readManifestFile, such as <path> is not valid JSON: ... or an errno message.
AI tool

All

aidd-cli version

unreleased, next

OS

Any

Additional context

Red-first tests: (1) a manifest with invalid JSON through a non-doctor command (for example status) reports the same named error as doctor. (2) A manifest unreadable with EACCES is reported as a permission problem by doctor, not as invalid JSON. Fix direction: classify in the repository or in one shared loader, and have doctor use it too.

Lenguaje dominante
TypeScript
Estrellas
481
Forks
45
Merge medio
1 d 13 h
PR fusionados (30 d)
91

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ai-driven-dev/framework

Todos los issues de ai-driven-dev/framework

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.