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

Ouverte
#1,313 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
57/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
typescript
Domaine
cli

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
TypeScript
Étoiles
481
Forks
45
Merge moyen
1 j 13 h
PR mergées (30 j)
91

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de ai-driven-dev/framework

Toutes les issues de ai-driven-dev/framework

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.