Skip to content

Commit d9ebdba

Browse files
Merge branch 'main' into fix/issue-457-edit-unsuccessfull
2 parents 96f5e09 + 47f9470 commit d9ebdba

105 files changed

Lines changed: 3851 additions & 148 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"zoo-code": patch
3+
---
4+
5+
Fix command auto-approval for multi-line shell constructs that must be treated as a single command.
6+
7+
**Quoted multi-line arguments** (`sh -c '...'`, `sh -c $'...'`, `sh -c "..."`): the parser previously split on every newline before handling quotes, so newlines inside a quoted argument were treated as separate commands, defeating allowlist auto-approval. Single-quoted, ANSI-C (`$'...'`), and double-quoted strings are now masked before the newline split so embedded newlines and operators stay within their command.
8+
9+
**Heredocs** (`<< EOF`, `<< 'EOF'`, `<< "EOF"`, `<<- EOF`): the entire heredoc -- opener line, body, and terminator -- is now treated as a single quoted region. Body lines are not split into independent sub-commands. All heredoc delimiter quoting styles (unquoted, single-quoted, double-quoted, backslash-escaped) are supported. An unterminated heredoc (missing terminator) is treated as malformed and returned as a single opaque token.
10+
11+
**Locale quoting** (`$"..."`): treated as a distinct token analogous to ANSI-C quoting, preserving the `$` prefix and preventing the double-quote handler from stripping it.
12+
13+
Quote masking is comment-aware: a quote character inside a `#` comment is not paired with a quote on a later line, so a comment cannot hide a real newline separator and merge two distinct commands. Commands with an unterminated quote are detected with a quote-aware scanner and returned as a single opaque token, preventing a line inside the unclosed quote from surfacing as an independently auto-approvable command. Genuine unquoted newlines still split into separate sub-commands, each of which must be allowlisted for auto-approval.
14+
15+
**Pattern selector (UI)**: the command pattern breakdown shown after execution now uses the same heredoc- and quote-aware parser (`parseCommand`) before extracting patterns, so an unterminated or terminated heredoc no longer produces spurious tokens like `EOF`, body-line words, or `<<` fragments in the allow/deny selector.
16+
17+
Note: this change only prevents *auto-approval* of fragments from a malformed command; it does not reject malformed commands before execution, which will be addressed in a separate PR to keep the scope focused here.

CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Zoo Code is a community-driven project, and we deeply value every contribution.
2020
- [Before You Contribute](#before-you-contribute)
2121
- [Finding & Planning Your Contribution](#finding--planning-your-contribution)
2222
- [Development & Submission Process](#development--submission-process)
23+
- [Pull Request Expectations](#pull-request-expectations)
24+
- [AI-Assisted Contributions](#ai-assisted-contributions)
2325
- [Legal](#legal)
2426

2527
## Before You Contribute
@@ -136,6 +138,32 @@ pnpm install
136138
- **Weekly In-depth Review:** Comprehensive assessment.
137139
- **Iterate promptly** based on feedback.
138140

141+
### Pull Request Expectations
142+
143+
Pull requests should be reviewable, tested, and maintainable. Before opening a PR, please make sure that:
144+
145+
- The change is scoped to a specific issue, bug, or improvement.
146+
- You can explain what the change does and why it is correct.
147+
- You have tested the change locally where practical.
148+
- You are willing to respond to review feedback and make reasonable follow-up changes.
149+
- The PR does not require maintainers to substantially rewrite, redesign, or take ownership of the implementation before it can be merged.
150+
151+
Maintainers may close PRs that are incomplete, too broad, inactive, not aligned with the project direction, or that create disproportionate review or maintenance burden. Closing a PR is not a judgment on the contributor; it is a maintainer decision that the change cannot be accepted in its present form.
152+
153+
### AI-Assisted Contributions
154+
155+
Use of AI tools is allowed, but contributors remain fully responsible for their submissions.
156+
157+
If you use AI tools to help create a PR, you must:
158+
159+
- Review and understand every meaningful change.
160+
- Be able to explain the implementation and tradeoffs in your own words.
161+
- Test the change yourself. If testing is impractical for your environment, explain why in the PR description and describe how reviewers can verify the change instead.
162+
- Verify that generated code is correct, necessary, and compatible with the project license.
163+
- Consider disclosing AI assistance in the PR description when it materially shaped the code, tests, or design — this helps reviewers give better feedback.
164+
165+
Please do not submit AI-generated changes that you do not understand or cannot maintain through review. Maintainers may close PRs that appear substantially AI-assisted but lack human verification, clear rationale, or review follow-through.
166+
139167
## Legal
140168

141169
By contributing, you agree your contributions will be licensed under the Apache 2.0 License, consistent with Zoo Code's licensing.

locales/ca/CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locales/de/CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locales/es/CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locales/fr/CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)