feat: full scan mode, init command, 18 gates, and 100% test coverage #4
Merged
Conversation
…incident, observability, memsafe, license, aiml, container) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…per-commit) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er detection in DepsGate Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements APIGate with pattern-based detection of insecure API patterns: TLS verification disabled, wildcard CORS origins, API credentials in query params, credentialed CORS headers, and GraphQL introspection enabled. Wires gate into GATE_CONTROL_MAP (SC-8, AC-3, SC-5, SI-10) and ALL_GATES. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eclarations in APIGate
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…39/AC-6/SI-7) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n debt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Gate) Also fix pre-existing mypy import-not-found errors across all test gate files by setting ignore_missing_imports = true in [tool.mypy]; the controlgate package is installed in editable mode for pytest but not in the isolated pre-commit mypy environment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Captures approved design for: - controlgate scan --mode full (synthetic DiffFile approach, directory walk with git ls-files fallback) - controlgate init (interactive bootstrap: .controlgate.yml, .pre-commit-config.yaml, CONTROLGATE.md, GitHub/GitLab/Bitbucket CI templates) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7-task TDD plan covering: - Task 1: full_scan config fields - Task 2: _get_full_files() with git ls-files + fallback walk - Task 3: --mode full wired into scan_command + parser - Task 4: init_command.py with all 6 file templates - Task 5: init subcommand wired into CLI - Task 6: README + docs updates (8 → 18 gates) - Task 7: final validation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
## Changes ### .controlgate.yml - Renamed `input` gate to `input_validation` for consistency with gate module naming - Renamed `change` gate to `change_control` for consistency with gate module naming - Added 10 new security gates, all enabled with `action: warn` by default: - `deps` – Dependency integrity and supply chain checks - `api` – API security (CORS, TLS verification, key exposure) - `privacy` – PII handling, data retention, and serialization checks - `resilience` – Deletion protection, retry logic, and snapshot policies - `incident` – Error suppression, silent catch blocks, traceback exposure - `observability` – Monitoring flags, log drivers, and liveness probes - `memsafe` – Unsafe memory ops, eval/exec, C FFI patterns - `license` – Copyleft license detection in dependencies and source - `aiml` – AI/ML model loading safety and prompt injection patterns - `container` – Container privilege escalation and image hygiene ### CHANGELOG.md - Added unreleased entry documenting the expansion to 18 gates Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Auto-formatted with `ruff format` to fix CI lint failures: - src/controlgate/gates/deps_gate.py - tests/test_gates/test_deps_gate.py - tests/test_gates/test_incident_gate.py - tests/test_gates/test_privacy_gate.py - tests/test_gates/test_resilience_gate.py No logic changes — whitespace and line-length fixes only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add 8 targeted tests covering the 12 previously uncovered lines: - _get_full_files: except ValueError (path outside root), OSError on read_bytes, and OSError on read_text - scan_command: else branch when _get_diff returns non-empty content - init_command: invalid baseline fallback, _prompt_yn empty-input default, and _prompt without a default value Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements bump_version.py in hooks/ with TDD: tests written first, confirmed failing, then implementation added to achieve 100% coverage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan