[Bug]: create-new-feature.sh reserves feature numbers non-atomically — concurrent invocations can share/overwrite a spec directory

Đang mở
#4,270 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bash
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu với .specify/scripts/bash/create-new-feature.sh và truy vết cách nó quét specs/, chọn một số, tạo thư mục và ghi spec.md. So sánh quy trình này với phần “Create the directory and spec file” trong .claude/skills/speckit-specify/SKILL.md. Hoàn thành có nghĩa là các lần gọi đồng thời sẽ dành riêng các thư mục khác nhau và không lần gọi nào ghi đè lên spec.md của lần gọi khác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Version

spec-kit v1.0.1 (.specify/scripts/bash/create-new-feature.sh; the flow is also described in .claude/skills/speckit-specify/SKILL.md, "Create the directory and spec file")

Description

Sequential numbering scans existing specs/ directories, picks max+1, checks for existence, then uses mkdir -p and writes spec.md. Nothing in that sequence is atomic: two concurrent invocations (parallel agents on worktrees sharing a specs dir, or two terminals) can both scan, both select the same number, both pass the existence check (mkdir -p succeeds either way), and both write spec.md into the same directory — the second silently overwrites the first's starting specification.

This matters more now that multi-agent setups routinely run more than one spec-kit session against the same repository.

Expected behavior

Reserve the directory with plain mkdir (no -p) so creation is exclusive; on EEXIST, discard the selected number, rescan, and retry before writing spec.md. A lock file would also work.

Related

Prior sequential-numbering issues (#935, #975, #1332) covered scan-logic bugs in single-invocation scenarios; this one is specifically about the missing atomicity under concurrency.

Ngôn ngữ chính
Python
Star
138k
Fork
12.4k
Merge trung bình
3 ngày 6 giờ
Pull request đã merge (30 ngày)
136

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/spec-kit

Tất cả issue của github/spec-kit

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.