Skip to content

feat: v0.1 tree-sitter complexity gate with Claude Code and Codex hooks - #3

Merged
ElbertePlinio merged 30 commits into
mainfrom
feat/v0.1
Aug 27, 2026
Merged

feat: v0.1 tree-sitter complexity gate with Claude Code and Codex hooks#3
ElbertePlinio merged 30 commits into
mainfrom
feat/v0.1

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

Closes #1

What changed

  • Cargo workspace: complexity-gate-core (tree-sitter parsing, per-language decision/depth/naming tables, config resolution, Git changed-span math) and the complexity-gate CLI (check, hook claude|codex, init, doctor --coverage).
  • Languages: JS, TS, TSX, Svelte (script + template), Dart, Rust, Python, Go. Golden fixtures with reference numbers (ESLint/Oxlint, radon, gocyclo, lizard; Dart/Svelte hand-derived) and a two-sided strictness test.
  • Hooks: Claude Code PostToolUse/Stop and Codex equivalents, loop guard (3 blocks per session, UNRESOLVED after), state under ~/.pickforge/complexity-gate/.
  • Repo gates: CI (test, clippy -D warnings, llvm-cov floor, self-gate, gitleaks, osv-scanner), cargo-dist release workflow, branch protection.
  • docs/spec.md is the contract; docs/hooks.md records the harness mapping.

Tested

  • cargo test --workspace --locked --all-targets, cargo clippy --workspace --all-targets -- -D warnings, cargo run -- check crates (self-gate), cargo llvm-cov — see CI.
  • End-to-end: a real Claude Code session (Stop hook blocked a 21-branch function; agent stopped to ask because the refactor was forbidden) and a real Codex session with hook trust (PostToolUse feedback drove a refactor until the gate passed).
  • Real-repo scans: pickscribe, pickforge, pickgauge (legacy violations reported; --changed scopes them out).
  • Review: serious-backend class — correctness (two rounds), tests/ops, security/deps. All P0–P2 fixed; see adjudication below.

Not tested

  • Release artifacts on macOS/Windows/aarch64 (first tag run will prove them); Windows hook execution.
  • Codex hooks in interactive mode (verified with --dangerously-bypass-hook-trust in exec; interactive requires the one-time trust prompt).

Known risks / decisions

  • Rust match arms and loop count (stricter than clippy's cognitive metric by design; recorded in spec).
  • Repo .complexity-gate.json is trusted like any repo file; tests.exempt is restricted to lines, max_blocks clamped, and a changed config is flagged in the report.
  • Deferred: release workflow permission scoping (release.yml: scope contents:write to the release job #2).
  • Dismissed with rationale: SHA-pinning of actions (workspace uses version tags); --changed <paths> resolves paths relative to cwd like any CLI; config resolves nearest-to-file (supports nested packages).

Local-review risk class: serious backend.

@ElbertePlinio
ElbertePlinio merged commit 33e4328 into main Aug 27, 2026
8 checks passed
@ElbertePlinio
ElbertePlinio deleted the feat/v0.1 branch August 27, 2026 03:58
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.

v0.1: tree-sitter complexity gate binary with Claude/Codex hooks

1 participant