[go-fan] Go Module Review: mvdan.cc/sh/v3
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 74/100
Hướng nghiên cứu
Đọc pkg/workflow/taint/javascript_workflow.go quanh dòng 223 và kiểm tra quá trình duyệt của javascriptExecutables. Báo cáo chỉ ra rằng callback của syntax.Walk luôn tiếp tục và đề xuất syntax.Preorder làm phương án thay thế không làm thay đổi hành vi; trước tiên hãy kiểm tra cách quá trình duyệt hiện tại thu thập các tệp thực thi. Hoàn thành khi điểm gọi đó sử dụng Preorder và giữ nguyên các kết quả đã thu thập.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Go Fan Report: mvdan.cc/sh/v3
Module Overview
mvdan.cc/sh/v3 (repo mvdan/sh) is a pure-Go shell parser, formatter, and interpreter (the engine behind shfmt), supporting POSIX Shell, Bash, Zsh, and mksh. gh-aw only imports its syntax subpackage, the AST parser, and does not use interp, expand, shell, or pattern.
Current Usage in gh-aw
- Files: 3 non-test files plus 1 test file, all in pkg/workflow/taint
- Purpose: static taint-tracking security analyzer for shell run steps in agentic workflows. It propagates untrusted data (issue/PR titles, comments, etc.) through assignments, command substitutions, redirects, pipes, and env/curl/wget calls, flagging leaks into logs, files, GITHUB_OUTPUT/GITHUB_ENV, or network requests.
- Key APIs: syntax.NewParser().Parse, syntax.Walk, and type-switching over CallExpr, BinaryCmd, IfClause, ForClause, WhileClause, CaseClause, FuncDecl, ParamExp, CmdSubst, and more.
Research Findings
Version pinned: v3.14.1, which is the latest release (published 2026-09-06). gh-aw is already fully up to date; no version bump needed.
Recent releases: v3.14.1 fixed heredoc indentation and a zsh parsing edge case (no effect on gh-aw). v3.14.0 added syntax.Preorder, a Walk-complementing iter.Seq[Node] range-over-func iterator, plus parser correctness fixes. v3.13.0 added Zsh language support to the parser.
Improvement Opportunities
Quick Wins:
- javascriptExecutables in pkg/workflow/taint/javascript_workflow.go (around line 223) calls syntax.Walk with a callback that always returns true, meaning it never prunes the traversal. This is exactly the case the new (v3.14.0) syntax.Preorder iterator was added for. Replacing it with a for node := range syntax.Preorder(tree) loop is a behavior-neutral readability improvement. The other 4 syntax.Walk call sites in the package rely on pruning and should keep using Walk directly.
Feature Opportunities:
- None of the interp/expand/pattern additions apply, since gh-aw correctly stays with the static syntax parser only.
- Zsh parsing is available since v3.13.0 but not modeled; shell.go explicitly reports a gap for any shell other than bash/sh. Low priority since GitHub Actions built-in shell values do not include zsh on hosted runners.
Best Practice Alignment:
- Parser configuration is already minimal and correct: no Variant, RecoverErrors, StopAt, or KeepPadding options are set, which is the right conservative choice for a security analyzer.
- Dependency surface is already minimal: only syntax is imported, never interp or cmd/shfmt.
Recommendations
- Optional, low risk: replace the javascriptExecutables syntax.Walk call with syntax.Preorder for a small readability win.
- No version bump needed; already on latest v3.14.1.
- No urgent action needed otherwise; the module is well-utilized and scoped tightly to the syntax subpackage for a legitimate static-analysis use case.
Generated by Go Fan. Module summary saved to scratchpad/mods/sh.md
References:
Generated by 🐹 Go Fan · claude · agent · 163.6 AIC · ⌖ 0.88 AIC · ⊞ 6.6K · ◷
- expires on Oct 20, 2026, 12:13 AM UTC-08:00
- Ngôn ngữ chính
- Go
- Star
- 5.4k
- Fork
- 584
- Merge trung bình
- 3 giờ 16 phút
- Pull request đã merge (30 ngày)
- 829
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc 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 github/gh-aw
-
automation models
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
cookie delight
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
github/gh-aw#70274 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agentic-workflows automation aw-essential cookie
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
automated conformance medium-priority safe-outputs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
plugins: symlinked plugin directories are skippedCó thể đã có người làm @lab1207 đã nhận hôm nay. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
eugenioenko/ttt#1029 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Edwin-metcalf/MetCode#24 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-operator
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
keyxmakerx/Chronicle#1654 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Low] CSI plugin builds staging directories from storage_volume_id without a containment checkĐang mởarea/security kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
agent-substrate/substrate#2935 ·
Maintainer thường phản hồi trong vòng 1 ngày