CLI maintenance audit: 21 findings (spec drift, missing tests, weak assertions)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- github-actions, javascript
- Lĩnh vực
- build-system, ci-cd, cli, documentation, testing
Hướng nghiên cứu
Bắt đầu với cli/specs/audit-sonnet.md và cli/specs/audit-delta.md, sau đó đối chiếu các phát hiện với cli/specs/requirements.md, cli/specs/design.md, cli/specs/validation.md, launch.js, cli.js, package.json, các test và cấu hình GitHub Actions. Chạy các test CLI hiện có và kiểm tra dry-run của npm pack; được xem là hoàn tất khi từng phát hiện được liệt kê đã được xử lý và assertion, bản cập nhật tài liệu hoặc độ bao phủ CI được chỉ định đều hiện diện.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Background
A maintenance audit of the CLI was conducted against cli/specs/requirements.md, cli/specs/design.md, cli/specs/validation.md, implementation files, and tests. Full audit report: cli/specs/audit-sonnet.md. Delta analysis (what agents missed and why): cli/specs/audit-delta.md.
Not urgent — nothing is broken in production — but these shouldn't get lost.
High Severity
F-001 — TC-CLI-080/081 spawn arg assertions are illusory
- Tests check function exports and source strings, but never intercept
spawnto verifycmd/argsper CLI - The
switch/caseinlaunch.js:89–105is behaviorally untested - Fix: intercept
child_process.spawnwith a mock, assert correctcmdandargsfor each CLI variant
F-002 — REQ-CLI-019 spawn failure path completely untested
- No test triggers
child.on("error", ...)inlaunch.js:112–119 - Traceability matrix maps REQ-CLI-019 → TC-CLI-076, but TC-CLI-076 tests "no CLI found" (different path)
- Fix: add a test that passes a nonexistent binary and asserts error message/exit code
F-003 — Spec frontmatter says version 0.3.0, package.json is 0.5.0
- Affects
requirements.md,design.md,validation.md— all sayversion: "0.3.0" - Fix: bump all three to
0.5.0and add revision history entries
Medium Severity
F-004 — REQ-CLI-082 (publishConfig) has no automated test
- Validation plan says "verified by package.json inspection" — no TC covers this
- Fix: add a test asserting
publishConfig.access === "public"and scoped package name
F-005 — REQ-CLI-091 (cross-platform) has no CI matrix
- Platform-aware code exists but no CI runs tests on Windows + macOS + Linux
- Fix: add a GitHub Actions matrix job
F-006 — TC-CLI-071 (gh-copilot detection) not implemented
detectCli()gh-copilot branch is untested- Fix: implement TC-CLI-071
F-007 — TC-CLI-075 (--cli flag override) not implemented
- REQ-CLI-011 core behavior is untested
- Fix: implement TC-CLI-075
F-008 — TC-CLI-079 (temp dir cleanup on exit) not implemented
- REQ-CLI-018 cleanup behavior is untested
- Fix: implement TC-CLI-079
F-009 — TC-CLI-100/121 (npm pack distribution) not implemented
- No test runs
npm pack --dry-runto verify package contents - Fix: implement as a build-type test
F-010 — TC-CLI-073 type mismatch (integration vs spec's unit)
- Spec says "Type: Unit — call
detectCli()directly"; test runs full CLI binary viaexecFileSync - Fix: refactor TC-CLI-073 to call
detectCli()as a unit
F-011 — REQ-CLI-094 (dependency count) has no automated test
- One assertion (
Object.keys(pkg.dependencies).length === 2) would cover this - Fix: add assertion to package.json inspection test
Low Severity
F-012 — REQ-CLI-082/090 not traced in design document
enginesandpublishConfigfields not mentioned in design doc §6- Fix: add brief §6 entries for both
F-013 — GAP-010 in design.md should be marked resolved
cli.js:48already documents valid--clivalues; gap is closed- Fix: update GAP-010 status to "Resolved in v0.5.0"
F-014 — Informational launch messages undocumented
launch.jsprints "PromptKit content staged at: ..." and "Launching [cli]..." — not in any spec- Fix: document in design.md §4 or requirements
F-015 — Usage hint references stale assemble verb
cli.js:98hint doesn't mentioninteractivesubcommand- Fix: update hint to say "run
promptkit interactive"
F-016 — TC-CLI-077 (fallback warning) not implemented
- Fix: implement TC-CLI-077
F-017 — TC-CLI-101 (content/ gitignored) not automated
- Could be a static test asserting
.gitignorecontainscontent/ - Fix: implement as a simple assertion
F-018 — TC-CLI-078 only checks 2 of 5 component directories
- Test asserts
personas/andtemplates/exist but skipsprotocols/,formats/,taxonomies/ - Fix: add assertions for all five
F-019 — TC-CLI-002 doesn't test -V short flag
- REQ-CLI-003 says "--version or -V" but test only uses
--version - Fix: add
-Vassertion
F-020 — TC-CLI-053 assertion too weak
- Spec says hint should reference "promptkit interactive"; test only checks for "promptkit"
- Fix: tighten assertion to check for "interactive"
Reference Files
cli/specs/audit-sonnet.md— Sonnet blind audit (18 findings, overlaps heavily)cli/specs/audit-delta.md— Root cause analysis of what agents miss and whycli/specs/maintenance-audit.md— Original 8-finding audit
- Ngôn ngữ chính
- JavaScript
- Star
- 105
- Fork
- 23
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/PromptKit
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
Tất cả issue của microsoft/PromptKit
Issue tương tự
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Automattic/safe-publish#594 ·
-
内部文件键(绝对路径的 base64)泄漏到界面标签 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NousResearch/hermes-agent#121143 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100