diff --git a/.github/workflows/dead-code.yml b/.github/workflows/dead-code.yml new file mode 100644 index 0000000..63707e0 --- /dev/null +++ b/.github/workflows/dead-code.yml @@ -0,0 +1,20 @@ +name: Dead code +# Managed by CodexSkills bootstrap-code-quality.py +on: + pull_request: +permissions: + contents: read +jobs: + dead-code: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: astral-sh/setup-uv@v7 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - run: bash scripts/check-dead-code.sh + env: + QUALITY_BASE_REF: origin/${{ github.base_ref }} diff --git a/AGENTS.md b/AGENTS.md index 30be90f..4e2a969 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -27,3 +27,8 @@ - Pricing correctness, simulation integrity, maintained reference cost standards, CLI output, structured LLM parsing, and zero-cost validation are explicit boundaries. - Never call OpenRouter, deploy, publish, or mutate billing during validation. Upload generated evidence from CI; do not commit it. - Track rollout and failures in Plane item `PCTL-17`. + +## Code cleanup + +- Run `bash scripts/check-dead-code.sh` after removing code and before review. +- For cross-file changes, run `graphify update .`, inspect callers and dependencies, and verify findings in current source and framework registrations. diff --git a/scripts/check-dead-code.sh b/scripts/check-dead-code.sh new file mode 100755 index 0000000..bba924c --- /dev/null +++ b/scripts/check-dead-code.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Managed by CodexSkills bootstrap-code-quality.py +set -euo pipefail +cd "$(dirname "$0")/.." +py_files=() +while IFS= read -r -d '' file; do py_files+=("$file"); done < <(git ls-files --cached --others --exclude-standard -z -- '*.py') +if ((${#py_files[@]})); then uvx --from vulture==2.16 vulture "${py_files[@]}" --min-confidence 90; fi +go vet ./...