Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/dead-code.yml
Original file line number Diff line number Diff line change
@@ -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 }}
5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
8 changes: 8 additions & 0 deletions scripts/check-dead-code.sh
Original file line number Diff line number Diff line change
@@ -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 ./...

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Detect unreferenced Go declarations

When a removal leaves a package-level Go function or method with no callers, this line still exits successfully: go vet has no unused-declaration analyzer (verified with a package containing only an unreferenced function). Consequently, the required cleanup check and its PR job permit the ordinary Go dead-code case they are intended to catch; add a declaration-aware Go analyzer or equivalent check.

AGENTS.md reference: AGENTS.md:L31-L33

Useful? React with 👍 / 👎.

Loading