Files
agency-agents/.github/workflows/check-tools.yml
T
hotragn bdb3143fcd fix(cli): an unknown option exits 1; convert.sh --help shows every option
Both scripts handled an unknown option with `error ...; usage`, and usage()
always ended in `exit 0`:

  $ ./scripts/convert.sh --tol codex; echo $?
  [ERR] Unknown option: --tol
  ...usage...
  0

so a mistyped flag in CI or a wrapper script read as success. usage() now
takes a status. --help still prints to stdout and exits 0; an unknown
option prints the usage text to stderr and exits 1, the same as a bad
--tool or --division value already does.

convert.sh --help also printed a hard-coded `sed -n '3,28p'`. The option
notes live on lines 33-34, so --parallel and --jobs never appeared, and
--out was only in the synopsis. It now uses USAGE-START/END sentinels, as
install.sh has for a while, and the option list covers --tool and --out.

test-cli-usage.sh checks both scripts: an unknown option exits non-zero
with its name and the usage on stderr and nothing on stdout, --help exits 0
without printing the sentinels, and convert.sh --help describes --tool,
--out, --parallel and --jobs. It fails on main at the first check and runs
in check-tools.yml.
2026-09-30 05:02:50 -04:00

62 lines
2.2 KiB
YAML

name: Check Tools Consistency
# Runs on every PR (no path filter on purpose): a new or renamed tool must trip
# this check even when nobody touched tools.json or the install/convert scripts.
on:
pull_request:
push:
branches: [main]
jobs:
check-tools:
name: tools.json is the single source of truth
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate tool set
run: |
chmod +x scripts/check-tools.sh
./scripts/check-tools.sh
- name: Validate generated Hermes plugin
run: python3 scripts/check-hermes-plugin.py
- name: Validate converted YAML frontmatter
run: bash scripts/test-convert-frontmatter.sh
- name: Reject colliding agent slugs before conversion
run: bash scripts/test-convert-slug-collisions.sh
- name: Refuse symlinked conversion output directories
run: bash scripts/test-convert-symlink-output.sh
- name: Validate converted outputs (round-trip, strict parse, counts, drift)
# Drift is advisory on pull requests (agent PRs always move their own manifest line;
# maintainers regenerate at landing) and enforced on pushes to main.
run: bash scripts/test-convert-outputs.sh ${{ github.event_name == 'pull_request' && '--drift=advisory' || '' }}
- name: Validate agent selection (install.sh --agent / --agents-file)
run: bash scripts/test-agent-selection.sh
- name: Protect unrelated Hermes destinations
run: bash scripts/test-install-hermes-destination.sh
- name: Reject partial installs after conversion failure
run: bash scripts/test-install-conversion-failure.sh
- name: Validate shared destinations for detected tools
run: bash scripts/test-install-all-path-collision.sh
- name: Validate complete selected installs
run: bash scripts/test-install-selection-completeness.sh
- name: Surface parallel conversion failures and clean temp output
run: bash scripts/test-convert-parallel-failure.sh
- name: Reject unclosed agent frontmatter
run: bash scripts/test-frontmatter-closing.sh
- name: Unknown options fail; --help lists every option
run: bash scripts/test-cli-usage.sh