Skip to content

Reject a Dash-Prefixed Agents Name in Both Bootstrap Loaders - #3156

Merged
ptr727 merged 4 commits into
developfrom
feature/bootstrap-dash-agents-name
Oct 16, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/bootstrap-dash-agents-name

Conversation

@ptr727

@ptr727 ptr727 commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Fixes #3129

bootstrap.ps1 -Agents and bootstrap.sh --agents now refuse any tool name that starts with a dash before the handoff to install-agents, with an error and a nonzero exit. Without it, pwsh -File binds -All or -a as a parameter of install-agents.ps1 (and --all is read as an option by install-agents.sh), installing every tool.

  • bash: refused during argument parsing, per comma-separated name, before anything runs.
  • PowerShell: refused in Invoke-AgentsInstall over every split name, for ASCII hyphen and also U+2013, U+2014, U+2015, which PowerShell binds as a parameter prefix (autocorrected paste). The check runs after the tree fetch, as the empty-list check does.
  • Tests: one per loader in tests/test_bootstrap.py. Revert proof: with both loaders restored to develop, all subtests of both new tests fail; with the fix they pass.
  • Local review: two passes. Pass 1 found the typographic-dash bypass (fixed). Pass 2 found no code defect and one test gap (U+2015 case), added after the pass as a one-line test-only commit, so the recorded receipt covers that line unreviewed.

Windows native verification (5.1 and 7) is left to the maintainer.

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 16, 2026 11:00
Fixes #3129

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
PowerShell binds a typographic dash as a parameter prefix.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 16, 2026 18:12
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9f3fe1b9-bee3-4b31-9a61-d7c93df1c347
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Add an assertion proving rejected inputs do not trigger the fetch.

1 open finding
What changed in this PR

Adds validation to reject dash-prefixed agent names before installer handoff.

Changes:

  • Validates ASCII and typographic dash prefixes in both loaders.
  • Adds regression tests for rejected names.
File Reviewed changes
tests/​test_bootstrap.py Adds loader rejection tests; should also assert rejection occurs before fetching.
host-setup/​bootstrap.sh Validates agent names during argument parsing.
host-setup/​bootstrap.ps1 Validates ASCII and typographic dash prefixes before installation.

🧠 Review effort: Lite


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/test_bootstrap.py
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Oct 16, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 27296acdee90431a3ab2a1aca56eeb25beb55ec4, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@f8faecc). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #3156   +/-   ##
==========================================
  Coverage           ?   63.97%           
==========================================
  Files              ?       17           
  Lines              ?     9151           
  Branches           ?        0           
==========================================
  Hits               ?     5854           
  Misses             ?     3297           
  Partials           ?        0           
Flag Coverage Δ
python-3.13 63.97% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit a040949 into develop Oct 16, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/bootstrap-dash-agents-name branch October 16, 2026 18:32
ptr727 added a commit that referenced this pull request Oct 16, 2026
… Dash-Name Refusal to Main (#3164)

- #3162 makes `gh-write-guard` read the gh write targets it still
missed: an inherited `GH_REPO` from the session environment, a run-time
word before gh's command, a gh write behind a run-time command word, a
positional repository and the missing write subcommands, `gh api` write
targets outside `repos/`, and the `GH_REPO` gaps #3135 introduced. It
adds no new allow.
- #3156 makes both bootstrap loaders reject a dash-prefixed
`-Agents`/`--agents` name before the handoff, so `-All` can no longer
bind install-agents' switch. Verified natively under pwsh 7 and Windows
PowerShell 5.1 in #3161.
- #3153 lets a manual dispatch bypass the smoke build's paths filter, in
the catalog snippet and the reusable-workflows example together.
- #3154 tests the Docker task workflow's credential check, login, and
hook inputs.
- #3150 bumps the actions-deps group.

After this merges, the host-safety installer payload changes, so the
maintainer runs the installer after promotion.

Closes #3129
Closes #3131
Closes #3132
Closes #3133
Closes #3136
Closes #3147
Closes #3148
Closes #3149

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants