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

Aperta
#1,313 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
57/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
cli

Direzione di ricerca

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.

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

Descrizione

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.

Lingua principale
TypeScript
Stelle
481
Fork
45
Merge medio
1g 13h
PR unite (30g)
91

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 ai-driven-dev/framework

Tutte le issue di ai-driven-dev/framework

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.