mirror of
https://github.com/Fission-AI/OpenSpec.git
synced 2026-11-08 09:22:50 +08:00
* fix(specs): discover nested spec paths recursively across parse, apply, and archive Delta discovery previously read only specs/<name>/spec.md one directory level below a change's specs root, so nested layouts like specs/<area>/<capability>/spec.md were silently skipped: show reported deltaCount 0, and archive/apply completed without merging the delta into the main specs directory. Main-spec discovery had the same one-level assumption, so nested capabilities were also invisible to list, show, view, and validate. Introduce a shared recursive discoverSpecFiles() helper and use it in the change parser, findSpecUpdates (apply/sync/archive), archive's delta detection, and main-spec discovery (item-discovery, list, spec list, view). Capability ids are the directory path relative to the specs root, forward-slash separated on every platform, and apply/archive preserve the relative path when writing the target spec. Symlinks are not followed and dot-directories are skipped. Fixes #1353 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(specs): surface non-ENOENT errors in spec discovery discoverSpecFiles swallowed every readdir error, so an unreadable (EACCES/EIO) capability directory silently vanished from validate/show/ archive/apply — recreating the data-loss class #1353 is closing, now on the merge path. Suppress only the expected missing-root ENOENT and rethrow everything else. Adds regression tests for non-ENOENT (ENOTDIR + guarded EACCES) and the documented symlink-not-followed behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(specs): sort discovered specs by code point, not locale localeCompare follows the process's ICU locale, so ordering could vary by OS/CI. Code-point comparison guarantees the deterministic output the docstring promises. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>