This commit is contained in:
Nkem Joseph-Palmer 2026-09-21 10:19:26 -07:00 • committed by GitHub
commit d29b7c170e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 61 additions and 4 deletions

44
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,44 @@
name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Type-check & test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.12'
- uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
enable-cache: true
- name: Install dependencies
run: uv sync --frozen
# pre-commit.ci already runs ruff and bandit, but it cannot run the
# `language: system` mypy hook (see .pre-commit-config.yaml `skip:`),
# so mypy runs here instead.
- name: Type-check with mypy
run: uv run mypy strix/
- name: Run tests
run: uv run pytest -q

View file

@ -63,7 +63,7 @@ Target-specific workflows built on the same engine:
- Python 3.12+, managed with `uv`. Install dev deps: `make dev-install`.
- Lint/format/type-check/security, all in one: `make check-all` (ruff, mypy, bandit).
- Tests: `uv run pytest`.
- Tests: `make test` (or `uv run pytest`). Included in `make check-all`.
- Run from source: `uv run strix --target <target>`.
- Layout: `strix/agents` (agent graph + prompts), `strix/tools` (proxy, browser, terminal, scanners), `strix/runtime` (Docker sandbox), `strix/report` (findings, SARIF), `strix/skills` (internal knowledge packs the pentest agents load — different from the consumer skills in `skills/`), `strix/interface` (CLI/TUI), `containers/` (sandbox image).
- Pre-commit hooks: `make pre-commit` (or `uv run pre-commit install`).

View file

@ -1,4 +1,4 @@
.PHONY: help install dev-install format lint type-check security check-all clean pre-commit setup-dev dev viewer wheel tui-build tui-test tui-lint
.PHONY: help install dev-install format lint type-check security test check-all clean pre-commit setup-dev dev viewer wheel tui-build tui-test tui-lint
TUI_BINARY := build/sidecar/strix-tui$(if $(filter Windows_NT,$(OS)),.exe)
@ -13,6 +13,7 @@ help:
@echo " lint - Lint code with ruff"
@echo " type-check - Run type checking with mypy and pyright"
@echo " security - Run security checks with bandit"
@echo " test - Run the test suite with pytest"
@echo " check-all - Run all code quality checks"
@echo ""
@echo "Development:"
@ -57,7 +58,12 @@ security:
uv run bandit -r strix/ -c pyproject.toml
@echo "✅ Security checks complete!"
check-all: format lint type-check security
test:
@echo "🧪 Running tests with pytest..."
uv run pytest
@echo "✅ Tests complete!"
check-all: format lint type-check security test
@echo "✅ All code quality checks passed!"
pre-commit:

View file

@ -13,7 +13,14 @@ def test_resolves_common_bare_model_names() -> None:
resolve_litellm_model.cache_clear()
assert resolve_litellm_model("deepseek-v4-flash") == "deepseek/deepseek-v4-flash"
assert resolve_litellm_model("openai/deepseek-v4-flash") == "deepseek/deepseek-v4-flash"
assert resolve_litellm_model("grok-4.5") == "xai/grok-4.5"
# Several providers resell grok-4.5 at identical prices, so the resolver is
# free to return any of them (it only declines to guess when prices differ).
# Assert the contract -- a provider-qualified name LiteLLM can price -- rather
# than which equally-priced entry happens to sort first.
resolved_grok = resolve_litellm_model("grok-4.5")
assert resolved_grok is not None
assert resolved_grok.endswith("/grok-4.5")
assert resolved_grok in litellm.model_cost
# MiniMax-M3 is sold by several LiteLLM providers at different prices, so
# the resolver must not guess from its bare name. A provider-qualified
# model remains deterministic.