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

未关闭
#1,313 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 小时
30 天内合并 PR
91

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ai-driven-dev/framework 的其他 Issue

查看 ai-driven-dev/framework 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。