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

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
57/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
cli

調査の方向性

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.

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

説明

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.

主要言語
TypeScript
スター
481
フォーク
45
平均マージ
1日 13時間
マージ済み PR(30日)
91

環境構築

はじめの一歩

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

ai-driven-dev/framework のほかの issue

ai-driven-dev/framework の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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