commitguardian 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- commitguardian-0.1.0/.gitignore +44 -0
- commitguardian-0.1.0/CHANGELOG.md +515 -0
- commitguardian-0.1.0/CITATION.cff +26 -0
- commitguardian-0.1.0/CODE_OF_CONDUCT.md +39 -0
- commitguardian-0.1.0/CONTRIBUTING.md +395 -0
- commitguardian-0.1.0/LICENSE +21 -0
- commitguardian-0.1.0/PKG-INFO +694 -0
- commitguardian-0.1.0/README.md +654 -0
- commitguardian-0.1.0/SECURITY.md +202 -0
- commitguardian-0.1.0/action.yml +93 -0
- commitguardian-0.1.0/config/default.yaml +39 -0
- commitguardian-0.1.0/config/examples/allow-ai.yaml +15 -0
- commitguardian-0.1.0/config/examples/block-ai-coauthors.yaml +20 -0
- commitguardian-0.1.0/config/examples/enterprise.yaml +38 -0
- commitguardian-0.1.0/config/strict.yaml +29 -0
- commitguardian-0.1.0/docs/README.md +78 -0
- commitguardian-0.1.0/docs/adr/001-detection-separate-from-policy.md +39 -0
- commitguardian-0.1.0/docs/adr/002-rules-as-data.md +37 -0
- commitguardian-0.1.0/docs/adr/003-fail-closed.md +42 -0
- commitguardian-0.1.0/docs/adr/004-trusted-policy-source.md +37 -0
- commitguardian-0.1.0/docs/adr/005-no-regex-trailer-parser.md +43 -0
- commitguardian-0.1.0/docs/adr/006-mandatory-policy-only-strengthens.md +37 -0
- commitguardian-0.1.0/docs/adr/007-immutable-evidence.md +39 -0
- commitguardian-0.1.0/docs/adr/008-not-published-to-pypi.md +52 -0
- commitguardian-0.1.0/docs/adr/009-published-to-pypi-as-commitguardian.md +83 -0
- commitguardian-0.1.0/docs/adr/README.md +19 -0
- commitguardian-0.1.0/docs/api/README.md +143 -0
- commitguardian-0.1.0/docs/api/audit.md +164 -0
- commitguardian-0.1.0/docs/api/authentication.md +347 -0
- commitguardian-0.1.0/docs/api/authorization.md +167 -0
- commitguardian-0.1.0/docs/api/bulk-operations.md +147 -0
- commitguardian-0.1.0/docs/api/compliance-exports.md +70 -0
- commitguardian-0.1.0/docs/api/errors.md +129 -0
- commitguardian-0.1.0/docs/api/exceptions.md +225 -0
- commitguardian-0.1.0/docs/api/github-installations.md +109 -0
- commitguardian-0.1.0/docs/api/notifications.md +407 -0
- commitguardian-0.1.0/docs/api/organizations.md +246 -0
- commitguardian-0.1.0/docs/api/pagination.md +117 -0
- commitguardian-0.1.0/docs/api/policies.md +374 -0
- commitguardian-0.1.0/docs/api/policy-drafts.md +318 -0
- commitguardian-0.1.0/docs/api/rate-limits.md +73 -0
- commitguardian-0.1.0/docs/api/repositories.md +221 -0
- commitguardian-0.1.0/docs/api/repository-groups.md +159 -0
- commitguardian-0.1.0/docs/api/rollouts.md +147 -0
- commitguardian-0.1.0/docs/api/rules.md +152 -0
- commitguardian-0.1.0/docs/api/scan-schedules.md +129 -0
- commitguardian-0.1.0/docs/api/scans.md +254 -0
- commitguardian-0.1.0/docs/api/security-posture.md +230 -0
- commitguardian-0.1.0/docs/api/simulations.md +85 -0
- commitguardian-0.1.0/docs/api/violations.md +150 -0
- commitguardian-0.1.0/docs/api/webhooks.md +100 -0
- commitguardian-0.1.0/docs/architecture.md +388 -0
- commitguardian-0.1.0/docs/cli/README.md +50 -0
- commitguardian-0.1.0/docs/cli/benchmark.md +77 -0
- commitguardian-0.1.0/docs/cli/doctor.md +76 -0
- commitguardian-0.1.0/docs/cli/github.md +57 -0
- commitguardian-0.1.0/docs/cli/init.md +54 -0
- commitguardian-0.1.0/docs/cli/install.md +66 -0
- commitguardian-0.1.0/docs/cli/policy.md +41 -0
- commitguardian-0.1.0/docs/cli/reproduce.md +56 -0
- commitguardian-0.1.0/docs/cli/scan.md +65 -0
- commitguardian-0.1.0/docs/community/README.md +23 -0
- commitguardian-0.1.0/docs/community/case-study-template.md +76 -0
- commitguardian-0.1.0/docs/community/data-policy.md +51 -0
- commitguardian-0.1.0/docs/community/external-evaluation.md +76 -0
- commitguardian-0.1.0/docs/community/feedback-triage.md +47 -0
- commitguardian-0.1.0/docs/community/good-first-issues.md +77 -0
- commitguardian-0.1.0/docs/community/pilot-program.md +73 -0
- commitguardian-0.1.0/docs/compliance-reporting.md +112 -0
- commitguardian-0.1.0/docs/configuration.md +261 -0
- commitguardian-0.1.0/docs/dashboard.md +776 -0
- commitguardian-0.1.0/docs/deployment/README.md +156 -0
- commitguardian-0.1.0/docs/deployment/github-actions.md +111 -0
- commitguardian-0.1.0/docs/deployment/github-app.md +85 -0
- commitguardian-0.1.0/docs/deployment/local.md +101 -0
- commitguardian-0.1.0/docs/deployment/organization.md +117 -0
- commitguardian-0.1.0/docs/deployment/production.md +274 -0
- commitguardian-0.1.0/docs/deployment/self-hosted.md +343 -0
- commitguardian-0.1.0/docs/deployment/troubleshooting.md +256 -0
- commitguardian-0.1.0/docs/deployment.md +56 -0
- commitguardian-0.1.0/docs/detection-engine.md +190 -0
- commitguardian-0.1.0/docs/evidence/cli.json +34 -0
- commitguardian-0.1.0/docs/evidence/phase-10-report.md +367 -0
- commitguardian-0.1.0/docs/evidence/phase-10-verification-report.md +609 -0
- commitguardian-0.1.0/docs/evidence/tests.json +68 -0
- commitguardian-0.1.0/docs/evidence/timeline.md +52 -0
- commitguardian-0.1.0/docs/evidence/validation-matrix.md +38 -0
- commitguardian-0.1.0/docs/getting-started/quickstart.md +140 -0
- commitguardian-0.1.0/docs/git-hooks.md +323 -0
- commitguardian-0.1.0/docs/github-app.md +531 -0
- commitguardian-0.1.0/docs/github-enforcement.md +369 -0
- commitguardian-0.1.0/docs/maintainers/README.md +28 -0
- commitguardian-0.1.0/docs/maintainers/architecture.md +151 -0
- commitguardian-0.1.0/docs/maintainers/benchmarking.md +79 -0
- commitguardian-0.1.0/docs/maintainers/development.md +181 -0
- commitguardian-0.1.0/docs/maintainers/incident-response.md +20 -0
- commitguardian-0.1.0/docs/maintainers/release-process.md +276 -0
- commitguardian-0.1.0/docs/maintainers/repository-management.md +66 -0
- commitguardian-0.1.0/docs/maintainers/security.md +58 -0
- commitguardian-0.1.0/docs/merge-queue.md +120 -0
- commitguardian-0.1.0/docs/notifications.md +253 -0
- commitguardian-0.1.0/docs/operations/runbook.md +611 -0
- commitguardian-0.1.0/docs/organization-governance.md +269 -0
- commitguardian-0.1.0/docs/policy-engine.md +92 -0
- commitguardian-0.1.0/docs/policy-exceptions.md +125 -0
- commitguardian-0.1.0/docs/policy-inheritance.md +231 -0
- commitguardian-0.1.0/docs/policy-management.md +184 -0
- commitguardian-0.1.0/docs/policy-rollouts.md +133 -0
- commitguardian-0.1.0/docs/policy-simulation.md +103 -0
- commitguardian-0.1.0/docs/presentations/commitguard-technical-overview.md +53 -0
- commitguardian-0.1.0/docs/presentations/technical-article.md +207 -0
- commitguardian-0.1.0/docs/recovery.md +97 -0
- commitguardian-0.1.0/docs/repository-management.md +223 -0
- commitguardian-0.1.0/docs/research/README.md +52 -0
- commitguardian-0.1.0/docs/research/bypass-resistance.md +56 -0
- commitguardian-0.1.0/docs/research/commitguard-architecture.md +118 -0
- commitguardian-0.1.0/docs/research/cross-platform-validation.md +65 -0
- commitguardian-0.1.0/docs/research/detection-evaluation.md +134 -0
- commitguardian-0.1.0/docs/research/fuzzing.md +98 -0
- commitguardian-0.1.0/docs/research/github-enforcement-validation.md +69 -0
- commitguardian-0.1.0/docs/research/impact.md +74 -0
- commitguardian-0.1.0/docs/research/innovation.md +95 -0
- commitguardian-0.1.0/docs/research/limitations.md +93 -0
- commitguardian-0.1.0/docs/research/merge-queue-security.md +44 -0
- commitguardian-0.1.0/docs/research/methodology.md +113 -0
- commitguardian-0.1.0/docs/research/performance-evaluation.md +100 -0
- commitguardian-0.1.0/docs/research/policy-tampering.md +64 -0
- commitguardian-0.1.0/docs/research/problem-definition.md +67 -0
- commitguardian-0.1.0/docs/research/reliability-evaluation.md +50 -0
- commitguardian-0.1.0/docs/research/reproducibility.md +97 -0
- commitguardian-0.1.0/docs/research/roadmap.md +89 -0
- commitguardian-0.1.0/docs/security/README.md +34 -0
- commitguardian-0.1.0/docs/security/authorization-matrix.md +238 -0
- commitguardian-0.1.0/docs/security/ci-pipeline-security.md +111 -0
- commitguardian-0.1.0/docs/security/incident-response.md +102 -0
- commitguardian-0.1.0/docs/security/review-guide.md +428 -0
- commitguardian-0.1.0/docs/security/security-boundaries.md +268 -0
- commitguardian-0.1.0/docs/security/supply-chain.md +77 -0
- commitguardian-0.1.0/docs/security/threat-model.md +723 -0
- commitguardian-0.1.0/docs/security/vulnerability-response.md +73 -0
- commitguardian-0.1.0/docs/security-posture.md +203 -0
- commitguardian-0.1.0/docs/support/compatibility-policy.md +218 -0
- commitguardian-0.1.0/docs/support/compatibility.md +180 -0
- commitguardian-0.1.0/docs/support/maintenance-policy.md +127 -0
- commitguardian-0.1.0/docs/threat-model.md +12 -0
- commitguardian-0.1.0/examples/README.md +32 -0
- commitguardian-0.1.0/examples/basic/.commitguard.yaml +17 -0
- commitguardian-0.1.0/examples/basic/README.md +58 -0
- commitguardian-0.1.0/examples/basic/commits/ai-coauthor.txt +3 -0
- commitguardian-0.1.0/examples/basic/commits/ai-tool-footer.txt +3 -0
- commitguardian-0.1.0/examples/basic/commits/clean.txt +6 -0
- commitguardian-0.1.0/examples/basic/commits/disguised-coauthor.txt +3 -0
- commitguardian-0.1.0/examples/basic/commits/malformed-trailer.txt +3 -0
- commitguardian-0.1.0/examples/basic/expected.json +30 -0
- commitguardian-0.1.0/examples/exceptions/README.md +35 -0
- commitguardian-0.1.0/examples/github-actions/README.md +44 -0
- commitguardian-0.1.0/examples/github-actions/commitguard.yml +33 -0
- commitguardian-0.1.0/examples/github-app/README.md +52 -0
- commitguardian-0.1.0/examples/organization-policy/README.md +42 -0
- commitguardian-0.1.0/examples/organization-policy/mandatory-policy.yaml +17 -0
- commitguardian-0.1.0/examples/organization-policy/repository-attempt.yaml +9 -0
- commitguardian-0.1.0/examples/policy-rollout/README.md +38 -0
- commitguardian-0.1.0/hooks/README.md +9 -0
- commitguardian-0.1.0/hooks/commit-msg +31 -0
- commitguardian-0.1.0/hooks/pre-commit +31 -0
- commitguardian-0.1.0/hooks/pre-push +33 -0
- commitguardian-0.1.0/pyproject.toml +169 -0
- commitguardian-0.1.0/requirements/ci.in +11 -0
- commitguardian-0.1.0/requirements/ci.txt +253 -0
- commitguardian-0.1.0/rules/ai-domains.yaml +51 -0
- commitguardian-0.1.0/rules/ai-identities.yaml +131 -0
- commitguardian-0.1.0/rules/bot-identities.yaml +53 -0
- commitguardian-0.1.0/rules/patterns.yaml +52 -0
- commitguardian-0.1.0/src/commitguard/__init__.py +26 -0
- commitguardian-0.1.0/src/commitguard/__main__.py +6 -0
- commitguardian-0.1.0/src/commitguard/api/__init__.py +18 -0
- commitguardian-0.1.0/src/commitguard/api/app.py +1376 -0
- commitguardian-0.1.0/src/commitguard/api/governance.py +1085 -0
- commitguardian-0.1.0/src/commitguard/api/hosting.py +196 -0
- commitguardian-0.1.0/src/commitguard/api/http.py +252 -0
- commitguardian-0.1.0/src/commitguard/api/settings.py +169 -0
- commitguardian-0.1.0/src/commitguard/audit/__init__.py +13 -0
- commitguardian-0.1.0/src/commitguard/audit/logger.py +34 -0
- commitguardian-0.1.0/src/commitguard/audit/models.py +222 -0
- commitguardian-0.1.0/src/commitguard/audit/storage.py +59 -0
- commitguardian-0.1.0/src/commitguard/ci/__init__.py +7 -0
- commitguardian-0.1.0/src/commitguard/ci/context.py +60 -0
- commitguardian-0.1.0/src/commitguard/cli/__init__.py +6 -0
- commitguardian-0.1.0/src/commitguard/cli/app.py +74 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/__init__.py +1 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/benchmark.py +441 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/check.py +100 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/ci.py +165 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/dashboard.py +141 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/doctor.py +533 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/github.py +449 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/hook.py +156 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/init.py +137 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/install.py +152 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/policy.py +36 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/report.py +39 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/reproduce.py +123 -0
- commitguardian-0.1.0/src/commitguard/cli/commands/scan.py +47 -0
- commitguardian-0.1.0/src/commitguard/cli/common.py +44 -0
- commitguardian-0.1.0/src/commitguard/cli/output.py +89 -0
- commitguardian-0.1.0/src/commitguard/cli/render.py +367 -0
- commitguardian-0.1.0/src/commitguard/config/__init__.py +6 -0
- commitguardian-0.1.0/src/commitguard/config/defaults.py +53 -0
- commitguardian-0.1.0/src/commitguard/config/enforcement.py +53 -0
- commitguardian-0.1.0/src/commitguard/config/loader.py +174 -0
- commitguardian-0.1.0/src/commitguard/config/schema.py +105 -0
- commitguardian-0.1.0/src/commitguard/config/sources.py +183 -0
- commitguardian-0.1.0/src/commitguard/controlplane/__init__.py +24 -0
- commitguardian-0.1.0/src/commitguard/controlplane/access.py +231 -0
- commitguardian-0.1.0/src/commitguard/controlplane/commands.py +393 -0
- commitguardian-0.1.0/src/commitguard/controlplane/errors.py +88 -0
- commitguardian-0.1.0/src/commitguard/controlplane/identity.py +478 -0
- commitguardian-0.1.0/src/commitguard/controlplane/members.py +219 -0
- commitguardian-0.1.0/src/commitguard/controlplane/notifications.py +787 -0
- commitguardian-0.1.0/src/commitguard/controlplane/pagination.py +146 -0
- commitguardian-0.1.0/src/commitguard/controlplane/policies.py +1204 -0
- commitguardian-0.1.0/src/commitguard/controlplane/queries.py +1814 -0
- commitguardian-0.1.0/src/commitguard/controlplane/results.py +909 -0
- commitguardian-0.1.0/src/commitguard/controlplane/rules.py +184 -0
- commitguardian-0.1.0/src/commitguard/controlplane/views.py +799 -0
- commitguardian-0.1.0/src/commitguard/core/__init__.py +6 -0
- commitguardian-0.1.0/src/commitguard/core/context.py +31 -0
- commitguardian-0.1.0/src/commitguard/core/decision.py +58 -0
- commitguardian-0.1.0/src/commitguard/core/engine.py +82 -0
- commitguardian-0.1.0/src/commitguard/core/result.py +177 -0
- commitguardian-0.1.0/src/commitguard/detectors/__init__.py +6 -0
- commitguardian-0.1.0/src/commitguard/detectors/base.py +58 -0
- commitguardian-0.1.0/src/commitguard/detectors/bot.py +87 -0
- commitguardian-0.1.0/src/commitguard/detectors/coauthor.py +86 -0
- commitguardian-0.1.0/src/commitguard/detectors/identity.py +76 -0
- commitguardian-0.1.0/src/commitguard/detectors/registry.py +72 -0
- commitguardian-0.1.0/src/commitguard/detectors/trailer.py +211 -0
- commitguardian-0.1.0/src/commitguard/exceptions/__init__.py +33 -0
- commitguardian-0.1.0/src/commitguard/exceptions/base.py +9 -0
- commitguardian-0.1.0/src/commitguard/exceptions/configuration.py +22 -0
- commitguardian-0.1.0/src/commitguard/exceptions/detection.py +11 -0
- commitguardian-0.1.0/src/commitguard/exceptions/git.py +41 -0
- commitguardian-0.1.0/src/commitguard/exceptions/service.py +25 -0
- commitguardian-0.1.0/src/commitguard/git/__init__.py +12 -0
- commitguardian-0.1.0/src/commitguard/git/commands.py +101 -0
- commitguardian-0.1.0/src/commitguard/git/commit.py +97 -0
- commitguardian-0.1.0/src/commitguard/git/diff.py +36 -0
- commitguardian-0.1.0/src/commitguard/git/hooks.py +527 -0
- commitguardian-0.1.0/src/commitguard/git/push.py +93 -0
- commitguardian-0.1.0/src/commitguard/git/ranges.py +71 -0
- commitguardian-0.1.0/src/commitguard/git/repository.py +447 -0
- commitguardian-0.1.0/src/commitguard/github/__init__.py +34 -0
- commitguardian-0.1.0/src/commitguard/github/actions.py +163 -0
- commitguardian-0.1.0/src/commitguard/github/app.py +935 -0
- commitguardian-0.1.0/src/commitguard/github/auth.py +217 -0
- commitguardian-0.1.0/src/commitguard/github/check_runs.py +172 -0
- commitguardian-0.1.0/src/commitguard/github/checks.py +210 -0
- commitguardian-0.1.0/src/commitguard/github/client.py +844 -0
- commitguardian-0.1.0/src/commitguard/github/enforcement_status.py +209 -0
- commitguardian-0.1.0/src/commitguard/github/errors.py +129 -0
- commitguardian-0.1.0/src/commitguard/github/events.py +563 -0
- commitguardian-0.1.0/src/commitguard/github/identifiers.py +90 -0
- commitguardian-0.1.0/src/commitguard/github/installations.py +566 -0
- commitguardian-0.1.0/src/commitguard/github/markdown.py +19 -0
- commitguardian-0.1.0/src/commitguard/github/permissions.py +70 -0
- commitguardian-0.1.0/src/commitguard/github/pull_requests.py +53 -0
- commitguardian-0.1.0/src/commitguard/github/queue.py +47 -0
- commitguardian-0.1.0/src/commitguard/github/recovery.py +124 -0
- commitguardian-0.1.0/src/commitguard/github/repositories.py +305 -0
- commitguardian-0.1.0/src/commitguard/github/server.py +52 -0
- commitguardian-0.1.0/src/commitguard/github/settings.py +174 -0
- commitguardian-0.1.0/src/commitguard/github/storage.py +2315 -0
- commitguardian-0.1.0/src/commitguard/github/webhooks.py +129 -0
- commitguardian-0.1.0/src/commitguard/github/worker.py +628 -0
- commitguardian-0.1.0/src/commitguard/github/workflow.py +286 -0
- commitguardian-0.1.0/src/commitguard/governance/__init__.py +26 -0
- commitguardian-0.1.0/src/commitguard/governance/bulk.py +765 -0
- commitguardian-0.1.0/src/commitguard/governance/cache.py +88 -0
- commitguardian-0.1.0/src/commitguard/governance/common.py +216 -0
- commitguardian-0.1.0/src/commitguard/governance/exceptions.py +861 -0
- commitguardian-0.1.0/src/commitguard/governance/groups.py +448 -0
- commitguardian-0.1.0/src/commitguard/governance/inventory.py +386 -0
- commitguardian-0.1.0/src/commitguard/governance/posture.py +1272 -0
- commitguardian-0.1.0/src/commitguard/governance/resolver.py +632 -0
- commitguardian-0.1.0/src/commitguard/governance/rollouts.py +760 -0
- commitguardian-0.1.0/src/commitguard/governance/rules.py +371 -0
- commitguardian-0.1.0/src/commitguard/governance/schedules.py +663 -0
- commitguardian-0.1.0/src/commitguard/governance/service.py +120 -0
- commitguardian-0.1.0/src/commitguard/governance/settings.py +365 -0
- commitguardian-0.1.0/src/commitguard/governance/simulation.py +618 -0
- commitguardian-0.1.0/src/commitguard/governance/workflow.py +734 -0
- commitguardian-0.1.0/src/commitguard/notifications/__init__.py +2 -0
- commitguardian-0.1.0/src/commitguard/notifications/channels/__init__.py +1 -0
- commitguardian-0.1.0/src/commitguard/notifications/channels/base.py +22 -0
- commitguardian-0.1.0/src/commitguard/notifications/channels/email.py +110 -0
- commitguardian-0.1.0/src/commitguard/notifications/channels/in_app.py +74 -0
- commitguardian-0.1.0/src/commitguard/notifications/channels/sink.py +58 -0
- commitguardian-0.1.0/src/commitguard/notifications/channels/webhook.py +233 -0
- commitguardian-0.1.0/src/commitguard/notifications/deduplication.py +57 -0
- commitguardian-0.1.0/src/commitguard/notifications/dispatcher.py +201 -0
- commitguardian-0.1.0/src/commitguard/notifications/models.py +439 -0
- commitguardian-0.1.0/src/commitguard/notifications/outbox.py +106 -0
- commitguardian-0.1.0/src/commitguard/notifications/preferences.py +224 -0
- commitguardian-0.1.0/src/commitguard/notifications/retry.py +282 -0
- commitguardian-0.1.0/src/commitguard/notifications/service.py +128 -0
- commitguardian-0.1.0/src/commitguard/notifications/settings.py +167 -0
- commitguardian-0.1.0/src/commitguard/notifications/templates.py +108 -0
- commitguardian-0.1.0/src/commitguard/observability/__init__.py +5 -0
- commitguardian-0.1.0/src/commitguard/observability/logging.py +161 -0
- commitguardian-0.1.0/src/commitguard/observability/metrics.py +105 -0
- commitguardian-0.1.0/src/commitguard/policies/__init__.py +6 -0
- commitguardian-0.1.0/src/commitguard/policies/defaults.py +48 -0
- commitguardian-0.1.0/src/commitguard/policies/evaluator.py +66 -0
- commitguardian-0.1.0/src/commitguard/policies/governance.py +498 -0
- commitguardian-0.1.0/src/commitguard/policies/loader.py +23 -0
- commitguardian-0.1.0/src/commitguard/policies/mandatory.py +52 -0
- commitguardian-0.1.0/src/commitguard/policies/model.py +46 -0
- commitguardian-0.1.0/src/commitguard/provenance/__init__.py +9 -0
- commitguardian-0.1.0/src/commitguard/provenance/author.py +146 -0
- commitguardian-0.1.0/src/commitguard/provenance/committer.py +16 -0
- commitguardian-0.1.0/src/commitguard/provenance/normalization.py +158 -0
- commitguardian-0.1.0/src/commitguard/provenance/signatures.py +34 -0
- commitguardian-0.1.0/src/commitguard/provenance/trailers.py +256 -0
- commitguardian-0.1.0/src/commitguard/research/__init__.py +26 -0
- commitguardian-0.1.0/src/commitguard/research/compare.py +231 -0
- commitguardian-0.1.0/src/commitguard/research/datasets.py +1484 -0
- commitguardian-0.1.0/src/commitguard/research/detection.py +183 -0
- commitguardian-0.1.0/src/commitguard/research/environment.py +185 -0
- commitguardian-0.1.0/src/commitguard/research/gitenv.py +108 -0
- commitguardian-0.1.0/src/commitguard/research/hooks.py +247 -0
- commitguardian-0.1.0/src/commitguard/research/metrics.py +85 -0
- commitguardian-0.1.0/src/commitguard/research/performance.py +194 -0
- commitguardian-0.1.0/src/commitguard/research/platform.py +288 -0
- commitguardian-0.1.0/src/commitguard/research/report.py +372 -0
- commitguardian-0.1.0/src/commitguard/research/repository.py +111 -0
- commitguardian-0.1.0/src/commitguard/research/reproduction.py +297 -0
- commitguardian-0.1.0/src/commitguard/research/results.py +94 -0
- commitguardian-0.1.0/src/commitguard/rules/__init__.py +11 -0
- commitguardian-0.1.0/src/commitguard/rules/loader.py +102 -0
- commitguardian-0.1.0/src/commitguard/rules/matcher.py +212 -0
- commitguardian-0.1.0/src/commitguard/rules/models.py +269 -0
- commitguardian-0.1.0/src/commitguard/security/__init__.py +5 -0
- commitguardian-0.1.0/src/commitguard/security/hashing.py +30 -0
- commitguardian-0.1.0/src/commitguard/security/rate_limit.py +33 -0
- commitguardian-0.1.0/src/commitguard/security/safe_yaml.py +69 -0
- commitguardian-0.1.0/src/commitguard/security/sanitization.py +85 -0
- commitguardian-0.1.0/src/commitguard/security/secrets.py +169 -0
- commitguardian-0.1.0/src/commitguard/security/validation.py +89 -0
- commitguardian-0.1.0/src/commitguard/services/__init__.py +15 -0
- commitguardian-0.1.0/src/commitguard/services/analysis.py +119 -0
- commitguardian-0.1.0/src/commitguard/services/audit.py +95 -0
- commitguardian-0.1.0/src/commitguard/services/ci.py +383 -0
- commitguardian-0.1.0/src/commitguard/services/enforcement.py +102 -0
- commitguardian-0.1.0/src/commitguard/services/hooks.py +254 -0
- commitguardian-0.1.0/src/commitguard/services/remediation.py +99 -0
- commitguardian-0.1.0/src/commitguard/services/reports.py +146 -0
- commitguardian-0.1.0/src/commitguard/services/scan.py +172 -0
- commitguardian-0.1.0/src/commitguard/utils/__init__.py +1 -0
- commitguardian-0.1.0/src/commitguard/utils/filesystem.py +72 -0
- commitguardian-0.1.0/src/commitguard/utils/platform.py +35 -0
- commitguardian-0.1.0/src/commitguard/utils/subprocess.py +84 -0
- commitguardian-0.1.0/tests/conftest.py +366 -0
- commitguardian-0.1.0/tests/e2e/dashboard_harness.py +806 -0
- commitguardian-0.1.0/tests/fixtures/commits/ai_agent_author.yaml +6 -0
- commitguardian-0.1.0/tests/fixtures/commits/ai_wording_only.yaml +9 -0
- commitguardian-0.1.0/tests/fixtures/commits/bot_author.yaml +9 -0
- commitguardian-0.1.0/tests/fixtures/commits/chatgpt_coauthor.yaml +8 -0
- commitguardian-0.1.0/tests/fixtures/commits/claude_coauthor.yaml +8 -0
- commitguardian-0.1.0/tests/fixtures/commits/copilot_coauthor.yaml +8 -0
- commitguardian-0.1.0/tests/fixtures/commits/generated_with_trailer.yaml +10 -0
- commitguardian-0.1.0/tests/fixtures/commits/human_coauthor.yaml +8 -0
- commitguardian-0.1.0/tests/fixtures/commits/malformed_trailer.yaml +10 -0
- commitguardian-0.1.0/tests/fixtures/commits/malicious_message.yaml +8 -0
- commitguardian-0.1.0/tests/fixtures/commits/multiple_coauthors.yaml +10 -0
- commitguardian-0.1.0/tests/fixtures/commits/normal_human.yaml +8 -0
- commitguardian-0.1.0/tests/fixtures/commits/unknown_ai_agent.yaml +11 -0
- commitguardian-0.1.0/tests/fixtures/policies/alias.yaml +5 -0
- commitguardian-0.1.0/tests/fixtures/policies/duplicate-keys.yaml +6 -0
- commitguardian-0.1.0/tests/fixtures/policies/null-action.yaml +4 -0
- commitguardian-0.1.0/tests/fixtures/policies/python-tag.yaml +2 -0
- commitguardian-0.1.0/tests/fixtures/policies/string-boolean.yaml +4 -0
- commitguardian-0.1.0/tests/fixtures/policies/unknown-key.yaml +4 -0
- commitguardian-0.1.0/tests/fixtures/policies/unknown-policy.yaml +4 -0
- commitguardian-0.1.0/tests/fixtures/policies/valid-minimal.yaml +1 -0
- commitguardian-0.1.0/tests/fixtures/repositories/README.md +9 -0
- commitguardian-0.1.0/tests/fixtures/webhooks/README.md +6 -0
- commitguardian-0.1.0/tests/fixtures/webhooks/installation.created.json +40 -0
- commitguardian-0.1.0/tests/fixtures/webhooks/installation.deleted.json +33 -0
- commitguardian-0.1.0/tests/fixtures/webhooks/installation_repositories.added.json +28 -0
- commitguardian-0.1.0/tests/fixtures/webhooks/installation_repositories.removed.json +28 -0
- commitguardian-0.1.0/tests/fixtures/webhooks/pull_request.closed.json +74 -0
- commitguardian-0.1.0/tests/fixtures/webhooks/pull_request.opened.json +74 -0
- commitguardian-0.1.0/tests/fixtures/webhooks/pull_request.reopened.json +74 -0
- commitguardian-0.1.0/tests/fixtures/webhooks/pull_request.synchronize.json +76 -0
- commitguardian-0.1.0/tests/fixtures/webhooks/push.json +49 -0
- commitguardian-0.1.0/tests/integration/git/test_cli_commands.py +352 -0
- commitguardian-0.1.0/tests/integration/git/test_repository.py +175 -0
- commitguardian-0.1.0/tests/integration/github/app/conftest.py +872 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/conftest.py +532 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_dashboard_api.py +150 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_dashboard_authorization.py +454 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_dashboard_lifecycle.py +256 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_dashboard_notifications.py +499 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_dashboard_performance.py +255 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_dashboard_policies.py +216 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_dashboard_recovery.py +454 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_dashboard_security.py +424 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_governance_end_to_end.py +356 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_governance_isolation.py +212 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_governance_operations.py +318 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_governance_performance.py +183 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_governance_policies.py +289 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_governance_rollouts.py +319 -0
- commitguardian-0.1.0/tests/integration/github/app/dashboard/test_governance_workflow.py +428 -0
- commitguardian-0.1.0/tests/integration/github/app/security/test_server_enforcement_experiments.py +324 -0
- commitguardian-0.1.0/tests/integration/github/app/test_app_action_consistency.py +84 -0
- commitguardian-0.1.0/tests/integration/github/app/test_app_cli.py +162 -0
- commitguardian-0.1.0/tests/integration/github/app/test_app_concurrency.py +134 -0
- commitguardian-0.1.0/tests/integration/github/app/test_app_end_to_end.py +172 -0
- commitguardian-0.1.0/tests/integration/github/app/test_app_http.py +160 -0
- commitguardian-0.1.0/tests/integration/github/app/test_app_merge_queue_reruns.py +474 -0
- commitguardian-0.1.0/tests/integration/github/app/test_app_security.py +405 -0
- commitguardian-0.1.0/tests/integration/github/conftest.py +237 -0
- commitguardian-0.1.0/tests/integration/github/security/test_bypass_resistance.py +268 -0
- commitguardian-0.1.0/tests/integration/github/test_action_scripts.py +105 -0
- commitguardian-0.1.0/tests/integration/github/test_ci_github.py +433 -0
- commitguardian-0.1.0/tests/integration/github/test_ci_security.py +118 -0
- commitguardian-0.1.0/tests/integration/github/test_defense_in_depth.py +159 -0
- commitguardian-0.1.0/tests/integration/github/test_github_cli.py +127 -0
- commitguardian-0.1.0/tests/integration/github/test_github_placeholder.py +43 -0
- commitguardian-0.1.0/tests/integration/hooks/conftest.py +45 -0
- commitguardian-0.1.0/tests/integration/hooks/test_commit_hooks.py +316 -0
- commitguardian-0.1.0/tests/integration/hooks/test_end_to_end.py +101 -0
- commitguardian-0.1.0/tests/integration/hooks/test_hook_templates.py +60 -0
- commitguardian-0.1.0/tests/integration/hooks/test_install.py +247 -0
- commitguardian-0.1.0/tests/integration/hooks/test_pre_push.py +309 -0
- commitguardian-0.1.0/tests/integration/test_examples.py +138 -0
- commitguardian-0.1.0/tests/security/conftest.py +73 -0
- commitguardian-0.1.0/tests/security/test_fuzz_parsers.py +526 -0
- commitguardian-0.1.0/tests/security/test_properties.py +210 -0
- commitguardian-0.1.0/tests/security/test_redos.py +209 -0
- commitguardian-0.1.0/tests/unit/config/test_config_validation.py +254 -0
- commitguardian-0.1.0/tests/unit/controlplane/test_controlplane.py +383 -0
- commitguardian-0.1.0/tests/unit/controlplane/test_governance_units.py +300 -0
- commitguardian-0.1.0/tests/unit/core/test_decision.py +19 -0
- commitguardian-0.1.0/tests/unit/core/test_engine.py +126 -0
- commitguardian-0.1.0/tests/unit/core/test_result.py +90 -0
- commitguardian-0.1.0/tests/unit/detectors/test_bot.py +64 -0
- commitguardian-0.1.0/tests/unit/detectors/test_coauthor.py +214 -0
- commitguardian-0.1.0/tests/unit/detectors/test_identity.py +63 -0
- commitguardian-0.1.0/tests/unit/detectors/test_registry.py +72 -0
- commitguardian-0.1.0/tests/unit/detectors/test_trailer.py +113 -0
- commitguardian-0.1.0/tests/unit/git/test_hook_rendering.py +80 -0
- commitguardian-0.1.0/tests/unit/git/test_push_parsing.py +61 -0
- commitguardian-0.1.0/tests/unit/github/app/conftest.py +27 -0
- commitguardian-0.1.0/tests/unit/github/app/test_auth.py +280 -0
- commitguardian-0.1.0/tests/unit/github/app/test_client.py +283 -0
- commitguardian-0.1.0/tests/unit/github/app/test_phase7_events_and_storage.py +326 -0
- commitguardian-0.1.0/tests/unit/github/app/test_policy_and_checks.py +301 -0
- commitguardian-0.1.0/tests/unit/github/app/test_secrets_and_logging.py +122 -0
- commitguardian-0.1.0/tests/unit/github/app/test_service_entry_points.py +54 -0
- commitguardian-0.1.0/tests/unit/github/app/test_storage.py +357 -0
- commitguardian-0.1.0/tests/unit/github/app/test_webhook_events.py +242 -0
- commitguardian-0.1.0/tests/unit/github/app/test_webhooks.py +171 -0
- commitguardian-0.1.0/tests/unit/github/test_events_and_output.py +175 -0
- commitguardian-0.1.0/tests/unit/github/test_workflows_static.py +247 -0
- commitguardian-0.1.0/tests/unit/notifications/test_notification_units.py +364 -0
- commitguardian-0.1.0/tests/unit/policies/test_evaluator.py +113 -0
- commitguardian-0.1.0/tests/unit/policies/test_governance_resolution.py +304 -0
- commitguardian-0.1.0/tests/unit/policies/test_policy_loader.py +44 -0
- commitguardian-0.1.0/tests/unit/provenance/test_identity_parsing.py +84 -0
- commitguardian-0.1.0/tests/unit/provenance/test_models.py +54 -0
- commitguardian-0.1.0/tests/unit/provenance/test_trailers.py +248 -0
- commitguardian-0.1.0/tests/unit/research/test_compare.py +98 -0
- commitguardian-0.1.0/tests/unit/rules/test_matcher.py +109 -0
- commitguardian-0.1.0/tests/unit/rules/test_rules_loader.py +74 -0
- commitguardian-0.1.0/tests/unit/security/test_safe_subprocess.py +49 -0
- commitguardian-0.1.0/tests/unit/security/test_sanitization.py +73 -0
- commitguardian-0.1.0/tests/unit/security/test_validation.py +55 -0
- commitguardian-0.1.0/tests/unit/services/test_analyzer.py +100 -0
- commitguardian-0.1.0/tests/unit/services/test_remediation.py +139 -0
- commitguardian-0.1.0/tests/unit/test_architecture.py +358 -0
- commitguardian-0.1.0/tests/unit/test_documented_commands.py +73 -0
- commitguardian-0.1.0/tests/unit/test_env_example.py +55 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.so
|
|
5
|
+
*.egg-info/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
|
|
9
|
+
# Virtual environments
|
|
10
|
+
.venv/
|
|
11
|
+
venv/
|
|
12
|
+
|
|
13
|
+
# Tooling caches
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
.mypy_cache/
|
|
16
|
+
.ruff_cache/
|
|
17
|
+
.coverage
|
|
18
|
+
htmlcov/
|
|
19
|
+
|
|
20
|
+
# Environment files (never commit real secrets)
|
|
21
|
+
.env
|
|
22
|
+
.env.*
|
|
23
|
+
!.env.example
|
|
24
|
+
|
|
25
|
+
# Local audit storage (future, opt-in)
|
|
26
|
+
*.sqlite
|
|
27
|
+
*.sqlite3
|
|
28
|
+
*.db
|
|
29
|
+
|
|
30
|
+
# Editors / OS
|
|
31
|
+
.idea/
|
|
32
|
+
.vscode/
|
|
33
|
+
.DS_Store
|
|
34
|
+
|
|
35
|
+
node_modules
|
|
36
|
+
*/node_modules
|
|
37
|
+
dist/
|
|
38
|
+
*/dist/
|
|
39
|
+
|
|
40
|
+
# Dashboard (web/)
|
|
41
|
+
web/test-results/
|
|
42
|
+
web/test-results-screenshots/
|
|
43
|
+
web/playwright-report/
|
|
44
|
+
web/node_modules/.tmp/
|
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [0.1.0] - 2026-09-18
|
|
8
|
+
|
|
9
|
+
### Packaging
|
|
10
|
+
|
|
11
|
+
- **Published to PyPI as `commitguardian`** (`pipx install commitguardian`). The
|
|
12
|
+
product, import package and console script are all still `commitguard`; the
|
|
13
|
+
distribution name differs because `commitguard` and `commitguard-cli` on PyPI
|
|
14
|
+
belong to two unrelated projects by other authors. See
|
|
15
|
+
[ADR-009](docs/adr/009-published-to-pypi-as-commitguardian.md), which
|
|
16
|
+
supersedes ADR-008.
|
|
17
|
+
- Releases are published with **PyPI Trusted Publishing** (OIDC from the tagged
|
|
18
|
+
release workflow). No API token is created, stored or rotated.
|
|
19
|
+
- **The sdist is now built from an allowlist.** The default configuration
|
|
20
|
+
produced an 8.4 MB sdist containing an editor's scratch worktree under
|
|
21
|
+
`.kilo/` (a second copy of the repository), the `.hypothesis/` cache and 22 MB
|
|
22
|
+
of generated benchmark datasets. It is now 988 KB of source, tests, docs and
|
|
23
|
+
metadata, and the release workflow fails if a local directory reappears.
|
|
24
|
+
- Version `0.1.0.dev0` -> `0.1.0`, so `pip install commitguardian` resolves it
|
|
25
|
+
without `--pre`.
|
|
26
|
+
- Added `project.urls` (homepage, repository, documentation, changelog, issues)
|
|
27
|
+
for the PyPI project page.
|
|
28
|
+
- **Releases publish automatically.** A final tag `vX.Y.Z` now validates,
|
|
29
|
+
builds, smoke-tests on Linux, macOS and Windows, publishes the GitHub release
|
|
30
|
+
and publishes to PyPI with no further action. A release candidate (`rcN`)
|
|
31
|
+
stops at a draft prerelease and is never published to PyPI.
|
|
32
|
+
- The GitHub Marketplace listing stays manual, because GitHub provides no API
|
|
33
|
+
for it: `gh release create` has no marketplace flag and the release object has
|
|
34
|
+
no marketplace field. The release job instead **fails** if `action.yml` or the
|
|
35
|
+
README would stop the listing checkbox appearing, and writes the link and the
|
|
36
|
+
exact category values into the workflow run summary.
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- **`remediation.auto_remove`** (opt-in, off by default): the `commit-msg` hook
|
|
41
|
+
deletes prohibited AI, bot or agent attribution from the pending commit
|
|
42
|
+
message instead of refusing the commit, reports every line it removed, and
|
|
43
|
+
lets the commit through. It rewrites no history - `commit-msg` runs before Git
|
|
44
|
+
creates the commit object. It refuses whatever it cannot provably fix:
|
|
45
|
+
attribution in the author or committer identity, a message that would be left
|
|
46
|
+
empty, or a detector failure. The stripped message is re-analysed and the
|
|
47
|
+
commit proceeds only if it is then clean. `pre-push` never removes anything,
|
|
48
|
+
and a mandatory organization policy cannot switch it on.
|
|
49
|
+
See [docs/configuration.md](docs/configuration.md#remediation).
|
|
50
|
+
|
|
51
|
+
### Fixed (Phase 10 verification pass)
|
|
52
|
+
|
|
53
|
+
- The Git hook's fail-closed message escaped newlines, so a multi-line reason
|
|
54
|
+
(an invalid `.commitguard.yaml` listing several fields) printed as one
|
|
55
|
+
unreadable `\x0a` run. Reason blocks now keep their newlines and indent every
|
|
56
|
+
continuation line, so text from a configuration file cannot start a line at
|
|
57
|
+
column 0 and impersonate a CommitGuard status line.
|
|
58
|
+
- GitHub App state: `installation_repositories`, `known_repositories` and
|
|
59
|
+
`installation_sync_status` were never deleted when an installation was purged,
|
|
60
|
+
so an organization's repository names stayed in the database indefinitely,
|
|
61
|
+
contradicting the documented retention behaviour.
|
|
62
|
+
- The repository's own enforcement workflow fell back to installing CommitGuard
|
|
63
|
+
from `$GITHUB_WORKSPACE` - the change under review - when the trusted commit
|
|
64
|
+
predated CI support. The check now fails instead.
|
|
65
|
+
- `.env.example` claimed CommitGuard reads no environment variables; it reads 30.
|
|
66
|
+
It now lists them all, and a test keeps it in sync with the source.
|
|
67
|
+
- Removed pictographic characters from CommitGuard's own output (Check Run
|
|
68
|
+
markdown, GitHub Actions summaries, CLI status lines) and documentation prose.
|
|
69
|
+
They remain only in detection *inputs* (the adversarial dataset and fixtures).
|
|
70
|
+
|
|
71
|
+
### Security (Phase 10 — three detection bypasses and two ReDoS defects, found by this project's own testing)
|
|
72
|
+
|
|
73
|
+
- **Detection bypass**: a Unicode letter or number before a trailer key
|
|
74
|
+
(`\u32acCo-authored-by:`, `\u2460Co-authored-by:`) hid AI attribution. The
|
|
75
|
+
leading-character rule used Unicode-aware `isalnum()` and ran after NFKC, so
|
|
76
|
+
such characters joined the key. Trailer keys are ASCII, so the prefix is now
|
|
77
|
+
whatever precedes the first ASCII letter or digit, judged both before and after
|
|
78
|
+
NFKC, with the shortest reading winning; Latin look-alikes remain part of the
|
|
79
|
+
key. Found by property-based fuzzing; dataset 1.2.0; regression tests in
|
|
80
|
+
`tests/unit/provenance/test_trailers.py`.
|
|
81
|
+
- **Detection bypass**: Unicode default-ignorable code points that are neither
|
|
82
|
+
control nor format characters (variation selectors, U+034F, Hangul fillers)
|
|
83
|
+
hid a trailer key or an agent alias — `Co-authored\ufe0f-by:` and
|
|
84
|
+
`Clau\u034fde Code` were allowed. `normalize_text` now removes every
|
|
85
|
+
default-ignorable code point (checked against the Unicode 18.0.0 data file).
|
|
86
|
+
Found by property-based fuzzing; dataset 1.3.0.
|
|
87
|
+
- **ReDoS**: the JWT secret-redaction pattern was quadratic (4.6 s on 80 KB of
|
|
88
|
+
`eyJ-eyJ-…`), and redaction runs on untrusted text before truncation. Replaced
|
|
89
|
+
with a linear scan; equivalence checked over 300,000 random strings.
|
|
90
|
+
- **ReDoS**: the workflow `secrets.` check was quadratic (2.7 s on 60 KB of
|
|
91
|
+
`${{${{…`), and the App inspects workflow files fetched from monitored
|
|
92
|
+
repositories. Replaced with two linear steps.
|
|
93
|
+
- **Notification delivery**: `commitguard github serve` never loaded the
|
|
94
|
+
notification settings, so e-mail and webhook notifications were silently never
|
|
95
|
+
delivered. Both entry points now build the service through one factory.
|
|
96
|
+
- **Documentation-driven dependency confusion**: several pages instructed
|
|
97
|
+
`pip install 'commitguard[app]'`, which resolves to an unrelated PyPI project.
|
|
98
|
+
Corrected everywhere; a test now fails if any documentation reintroduces it.
|
|
99
|
+
|
|
100
|
+
### Added (Phase 10 — external adoption, reproducibility and open source readiness)
|
|
101
|
+
|
|
102
|
+
- `commitguard reproduce all|security|benchmark|integration|github`: re-runs the
|
|
103
|
+
published evidence with PASS / FAIL / SKIPPED / NOT RUN statuses. A skipped step
|
|
104
|
+
is never reported as a pass.
|
|
105
|
+
- `commitguard report security`: assembles `reports/security-report.{json,md}`
|
|
106
|
+
and `benchmark-report.md` from recorded results and test evidence, labelling
|
|
107
|
+
every statement Measured, Tested, Observed, Expected or Not tested.
|
|
108
|
+
- Security test suite (`tests/security/`): property-based fuzzing of every parser
|
|
109
|
+
that handles untrusted input, a ReDoS suite covering all 33 regular expressions
|
|
110
|
+
in the source, and invariant tests (determinism, detector-order independence,
|
|
111
|
+
fail-closed behaviour, the mandatory-policy floor). 350 tests now carry the
|
|
112
|
+
`security` marker; `hypothesis` added to the development dependencies.
|
|
113
|
+
- Dataset versions 1.2.0 (9,157 cases) and 1.3.0 (9,174 cases), written before the
|
|
114
|
+
runs that exposed the corresponding bypasses.
|
|
115
|
+
- `examples/`: basic, github-actions, github-app, organization-policy, exceptions
|
|
116
|
+
and policy-rollout, each with expected results — verified by
|
|
117
|
+
`tests/integration/test_examples.py` against the real engine.
|
|
118
|
+
- `commitguard doctor`: PASS / WARNING / FAIL / NOT CONFIGURED / INFO statuses,
|
|
119
|
+
runtime dependency and GitHub App configuration checks, and `--json`.
|
|
120
|
+
- `commitguard init`: interactive setup when run by a person, `--install-hooks`,
|
|
121
|
+
and `--non-interactive` for scripts and CI.
|
|
122
|
+
- Release engineering: `.github/workflows/release.yml` (validation gate, one
|
|
123
|
+
build, install and smoke test on three operating systems, `SHA256SUMS`, SBOM,
|
|
124
|
+
draft release) and CI jobs for the security suite, cross-platform validation and
|
|
125
|
+
package installation.
|
|
126
|
+
- Documentation: `docs/getting-started/quickstart.md`, `docs/cli/`, `docs/api/`,
|
|
127
|
+
`docs/deployment/`, `docs/operations/runbook.md`, `docs/security/` (threat
|
|
128
|
+
model, boundaries, authorization matrix, review guide, vulnerability and
|
|
129
|
+
incident response, supply chain, CI pipeline review), `docs/research/` (18
|
|
130
|
+
documents), `docs/adr/` (8 records), `docs/maintainers/`, `docs/community/`,
|
|
131
|
+
`docs/support/`, `docs/evidence/`, `evidence/`, `award-evidence/`, `ROADMAP.md`,
|
|
132
|
+
`CITATION.cff`, issue forms, pull request template and `CODEOWNERS`.
|
|
133
|
+
|
|
134
|
+
### Changed (Phase 10)
|
|
135
|
+
|
|
136
|
+
- `SECURITY.md`: response targets, disclosure policy, safe harbour and the list of
|
|
137
|
+
fixes to date.
|
|
138
|
+
- The workflow policy test now allows write permissions only in a job of a
|
|
139
|
+
workflow that no pull request can trigger, instead of banning them outright.
|
|
140
|
+
- README: an installation section (with the PyPI name-collision warning), the
|
|
141
|
+
reproduction commands and the new documentation index.
|
|
142
|
+
|
|
143
|
+
### Added (Phase 8 — organization governance, central policy and enterprise security)
|
|
144
|
+
|
|
145
|
+
- Organization governance package (`commitguard.governance`) with 65 `/api/v1`
|
|
146
|
+
routes (`commitguard.api.governance`), documented in `docs/dashboard.md`.
|
|
147
|
+
- Permissions `organization:read/manage`, `security:read/manage`,
|
|
148
|
+
`exceptions:read/create/approve/revoke`, `policies:publish/approve/emergency`
|
|
149
|
+
and `rules:manage`, assigned to the existing roles.
|
|
150
|
+
- Organization security settings (versioned, optimistic concurrency): security
|
|
151
|
+
baseline, policy approval and separation of duties, exception limits and
|
|
152
|
+
approval threshold, onboarding defaults, rollout thresholds, alert
|
|
153
|
+
aggregation, time zone. Relaxing a control needs confirmation, a reason and a
|
|
154
|
+
recent sign-in, and is audited and notified.
|
|
155
|
+
- Repository inventory with separate dimensions (connection, archived,
|
|
156
|
+
onboarding, mode, enforcement, policy propagation); discovery from
|
|
157
|
+
installation events and synchronisation; `enforce` and `monitor` modes;
|
|
158
|
+
installation synchronisation health.
|
|
159
|
+
- Repository groups (archived, never deleted) and background bulk operations
|
|
160
|
+
(group membership, onboarding, mode, monitoring, scans) that are bounded,
|
|
161
|
+
idempotent, retryable, cancellable and audited.
|
|
162
|
+
- Policy targets for organization, repository groups and repositories, with
|
|
163
|
+
**mandatory** (floor) and **default** entries; pure per-rule resolver
|
|
164
|
+
(`commitguard.policies.governance`) with provenance, conflicts, exceptions and
|
|
165
|
+
monitor mode; effective policy cache with same-transaction invalidation,
|
|
166
|
+
background propagation and propagation status; governance versions and
|
|
167
|
+
provenance recorded with every scan.
|
|
168
|
+
- Policy workflow: drafts, submission, approval bound to the document
|
|
169
|
+
fingerprint, rejection, publication against the base version, emergency
|
|
170
|
+
publication (owners, critical audit and notification).
|
|
171
|
+
- Read-only policy simulation of drafts against recorded scans and findings
|
|
172
|
+
with the real policy evaluator, queued with leases and bounded.
|
|
173
|
+
- Staged policy rollouts (pilot repositories, cumulative percentages),
|
|
174
|
+
pause/resume, automatic pause on error or block thresholds, optional
|
|
175
|
+
automatic rollback through the Phase 7 rollback path.
|
|
176
|
+
- Policy exceptions scoped to a repository, group or organization, lowering one
|
|
177
|
+
rule to `warn` or `allow` until expiry; approval rules, separation of duties,
|
|
178
|
+
revocation, expiry worker, expiry warnings and notifications.
|
|
179
|
+
- Organization rules: versioned identity data (AI agents and bots) compiled into
|
|
180
|
+
the trusted rule set without patterns or code; rules version recorded per scan.
|
|
181
|
+
- Scheduled scans of default branches (daily/weekly, time zones) through the
|
|
182
|
+
normal worker, skipping unchanged heads, with per-run records.
|
|
183
|
+
- Security posture with explicit states and reasons, compliance fraction,
|
|
184
|
+
repository security matrix with drift, trends from history and daily
|
|
185
|
+
snapshots, security events with acknowledgement, organization search,
|
|
186
|
+
JSON/CSV compliance reports that state they are not certifications.
|
|
187
|
+
- Notification types `violation_digest`, `policy_approval_requested`,
|
|
188
|
+
`policy_emergency_published`, `policy_rollout_failed`,
|
|
189
|
+
`policy_propagation_failed`, `exception_requested`, `exception_approved`,
|
|
190
|
+
`exception_expiring`, `exception_ended`, `repository_unprotected`,
|
|
191
|
+
`organization_settings_changed`; optional hourly violation digests for
|
|
192
|
+
e-mail and webhooks.
|
|
193
|
+
- Dashboard pages under `/organization` and `/settings/organization`.
|
|
194
|
+
- Documentation: organization governance, policy inheritance, simulation,
|
|
195
|
+
exceptions, rollouts, repository management, security posture and compliance
|
|
196
|
+
reporting; architecture, threat model, deployment, policy management,
|
|
197
|
+
notifications and dashboard updated.
|
|
198
|
+
- Tests: resolver and governance unit tests; integration tests for policies,
|
|
199
|
+
workflow, rollouts, operations, cross-tenant and role sweeps over every
|
|
200
|
+
governance route, a 39-step end-to-end scenario and performance budgets with
|
|
201
|
+
1,000 repositories; `scripts/benchmark_governance.py` for 10,000 repositories,
|
|
202
|
+
100,000 scans and 1,000,000 findings.
|
|
203
|
+
|
|
204
|
+
### Changed (Phase 8)
|
|
205
|
+
|
|
206
|
+
- Database schema 4 (automatic migration; existing repositories become
|
|
207
|
+
`onboarded` in `enforce` mode, so enforcement is unchanged).
|
|
208
|
+
- Audit events are immutable (update trigger); retention purging also removes
|
|
209
|
+
finished simulations, bulk operations and scheduled scan runs.
|
|
210
|
+
- Removing a member's last membership ends their sessions immediately.
|
|
211
|
+
- With `require_policy_approval`, the direct organization policy save returns
|
|
212
|
+
`APPROVAL_REQUIRED`.
|
|
213
|
+
- Policy drafts can be rebased on the current version, accept a publication
|
|
214
|
+
reason, link the rollout they started, keep the diff they published, and
|
|
215
|
+
expose `can_cancel`/`can_emergency_publish`; relaxed settings are listed in
|
|
216
|
+
`error.details.changes`; security events reference their resource.
|
|
217
|
+
- `policy_source` lists the governance layers applied (for example
|
|
218
|
+
`+ group Backend policy v2 + 1 exception(s)`).
|
|
219
|
+
|
|
220
|
+
### Added (Phase 7 — notifications, merge queue, check re-runs and policy recovery)
|
|
221
|
+
|
|
222
|
+
- Notification subsystem (`commitguard.notifications`): typed notification
|
|
223
|
+
events written to a transactional outbox in the same database transaction as
|
|
224
|
+
the change that caused them; a dispatcher that fans out to per-user in-app
|
|
225
|
+
inbox rows and e-mail/webhook delivery records; a delivery worker with leases,
|
|
226
|
+
bounded retries (1 m, 5 m, 30 m, 2 h; 5 attempts), idempotency keys and
|
|
227
|
+
delivery audit events.
|
|
228
|
+
- Notification types: `critical_violation`, `high_violation` (newly blocked
|
|
229
|
+
violations, one per rule per pull request/branch/merge group per hour),
|
|
230
|
+
`policy_changed`, `policy_rolled_back`, `installation_disconnected`,
|
|
231
|
+
`installation_reconnected` (state transitions only), `merge_queue_failure`,
|
|
232
|
+
`check_rerun_failed`.
|
|
233
|
+
- Channels: in-app notification center (`/notifications`, bell with bounded
|
|
234
|
+
unread counts), SMTP e-mail (`EmailProvider` interface, plain text), and
|
|
235
|
+
HMAC-SHA256 signed webhooks with timestamps, per-endpoint derived secrets
|
|
236
|
+
shown once, public-address checks with pinned connections, and no redirects.
|
|
237
|
+
`COMMITGUARD_NOTIFICATIONS_MODE=test` records deliveries without sending.
|
|
238
|
+
- Preferences: versioned organization settings (`notifications:manage`,
|
|
239
|
+
confirmation to turn deliveries off), organization e-mail recipients and
|
|
240
|
+
webhooks, personal in-app mutes for non-mandatory types; delivery log.
|
|
241
|
+
- GitHub App merge queue support: `merge_group` `checks_requested` scans
|
|
242
|
+
`base_sha..head_sha` and publishes `commitguard-app` on the merge group
|
|
243
|
+
commit; `destroyed` cancels queued scans and ends exposures; refs and head
|
|
244
|
+
commit validated; out-of-order and duplicate events handled; merge queue
|
|
245
|
+
status (`enabled`/`not_enabled`/`unknown`) from rulesets; repository merge
|
|
246
|
+
queue view and `GET /api/v1/repositories/{id}/merge-queue`.
|
|
247
|
+
- Check re-runs: `check_run` and `check_suite` `rerequested` create a new
|
|
248
|
+
execution of the stored scan (matched by `external_id`, installation,
|
|
249
|
+
repository, SHA and check name; other Apps ignored); stale re-runs of
|
|
250
|
+
outdated commits refused and audited; duplicates collapse.
|
|
251
|
+
- Scan executions: `scan_key`, execution number, trigger (`push`,
|
|
252
|
+
`pull_request`, `merge_group`, `manual`, `rerun`, `retry`) and previous
|
|
253
|
+
execution on every job; `GET /api/v1/scans/{id}/executions`; scan detail
|
|
254
|
+
shows execution history and flags differing policy or rules versions.
|
|
255
|
+
- Organization policy rollback (`POST /api/v1/policies/{id}/rollback`,
|
|
256
|
+
`policies:rollback`): a new immutable version restoring an earlier document,
|
|
257
|
+
with reason, confirmation, recent sign-in for weakening rollbacks, optimistic
|
|
258
|
+
concurrency, integrity check, audit event and notification in one
|
|
259
|
+
transaction; `GET /api/v1/policies/{id}/diff`; version history with status,
|
|
260
|
+
lineage, change summaries, compare and rollback dialog in the dashboard.
|
|
261
|
+
- Event records: webhook deliveries store provider, action, processing status,
|
|
262
|
+
attempts and tenant IDs; a failed or abandoned delivery is processed again
|
|
263
|
+
on redelivery.
|
|
264
|
+
- Recovery service: marks abandoned event processing failed and schedules up
|
|
265
|
+
to two automatic retry executions for infrastructure failures; jobs that
|
|
266
|
+
exhaust their attempts are audited and fail their check.
|
|
267
|
+
- Metrics: `github_events_received`, `github_events_failed`,
|
|
268
|
+
`github_events_replayed`, `check_reruns`, `scan_retries`,
|
|
269
|
+
`merge_groups_scanned`, `merge_groups_failed`, `policy_rollbacks`,
|
|
270
|
+
`policy_rollback_failures`, `notifications_created`, `notifications_sent`,
|
|
271
|
+
`notifications_failed`, `notification_retries`.
|
|
272
|
+
- Audit events for scan starts and retries, re-run requests and rejections,
|
|
273
|
+
merge groups, policy rollbacks, notification creation, delivery, failure,
|
|
274
|
+
reads, settings, preferences and webhooks; audit events carry the API
|
|
275
|
+
`request_id`.
|
|
276
|
+
- Documentation: `docs/notifications.md`, `docs/merge-queue.md`,
|
|
277
|
+
`docs/policy-management.md`, `docs/recovery.md`.
|
|
278
|
+
- Tests: notification units, event normalisation, storage and migration,
|
|
279
|
+
merge queue and re-run integration, notification and recovery API tests, the
|
|
280
|
+
Phase 7 lifecycle scenario, Phase 7 performance volumes (100,000
|
|
281
|
+
notifications, 100,000 event records, 10,000 policy versions), frontend
|
|
282
|
+
tests and a browser scenario.
|
|
283
|
+
|
|
284
|
+
### Changed (Phase 7)
|
|
285
|
+
|
|
286
|
+
- State database schema 3, migrated automatically: scan executions (existing
|
|
287
|
+
re-scans backfilled as manual executions), event processing status, merge
|
|
288
|
+
groups, policy version kind and rollback lineage with triggers that refuse
|
|
289
|
+
updates and deletes of published versions, notification tables.
|
|
290
|
+
- Repositories whose GitHub App installation is suspended or removed, or that
|
|
291
|
+
are no longer granted, are `at_risk` instead of `unprotected`; the overview
|
|
292
|
+
warns that GitHub enforcement is at risk.
|
|
293
|
+
- Superseded scans are shown with the result `stale` instead of `cancelled`.
|
|
294
|
+
- Dashboard **Scan again** creates a new execution of the same scan and is
|
|
295
|
+
refused while one is already queued or running.
|
|
296
|
+
- A late `suspend`, `unsuspend` or `new_permissions_accepted` event no longer
|
|
297
|
+
revives a deleted installation.
|
|
298
|
+
- The optional `merge_queues: read` permission and `check_run`, `check_suite`
|
|
299
|
+
and `merge_group` subscriptions are reported by `commitguard github validate`
|
|
300
|
+
as warnings when missing; installation tokens remain down-scoped to the
|
|
301
|
+
required permissions.
|
|
302
|
+
- Policy page success messages survive the editor remounting after a save.
|
|
303
|
+
|
|
304
|
+
### Added (Phase 6 — security dashboard and control plane)
|
|
305
|
+
|
|
306
|
+
- Web dashboard (`web/`, React 19 + TypeScript + Vite) served by the App
|
|
307
|
+
service from the same origin: landing page, sign-in, overview, repositories
|
|
308
|
+
and repository detail, scans and scan detail, violations and violation
|
|
309
|
+
detail, policies, rules and rule detail, audit log, GitHub installations and
|
|
310
|
+
installation detail, settings, and a 404 page. Loading, empty, success and
|
|
311
|
+
error states on every page; responsive layouts with a navigation drawer and
|
|
312
|
+
stacked table cards; light and dark themes; WCAG 2.2 AA checks.
|
|
313
|
+
- Dashboard API `/api/v1` (framework-free WSGI, `commitguard.api`):
|
|
314
|
+
consistent `data`/`meta` and `error` envelopes, cursor pagination,
|
|
315
|
+
server-side filtering, allow-listed sorting and search, security headers,
|
|
316
|
+
CORS allow-list, per-user rate limits, request IDs and structured request logs.
|
|
317
|
+
- Sign-in with the GitHub App's user authorization (state bound to the
|
|
318
|
+
browser, PKCE); server-side sessions with hashed tokens, absolute and idle
|
|
319
|
+
expiry, revocation; session-derived CSRF tokens; re-authentication for
|
|
320
|
+
weakening changes.
|
|
321
|
+
- Roles (viewer, security manager, admin, owner) with explicit permissions;
|
|
322
|
+
tenant isolation by GitHub account plus the installations and repositories
|
|
323
|
+
GitHub reports for the user; `commitguard dashboard members list|grant|revoke`.
|
|
324
|
+
- Control plane (`commitguard.controlplane`): scan result recording with
|
|
325
|
+
findings, evidence and commit identities; violation lifecycle (open,
|
|
326
|
+
acknowledged, resolved) driven by pull request and branch exposures;
|
|
327
|
+
versioned organization policy floors with optimistic concurrency, applied to
|
|
328
|
+
App scans through the mandatory-policy floor; reproducibility metadata per
|
|
329
|
+
scan (organization policy version, effective policy, rules and CommitGuard
|
|
330
|
+
versions); scan comparison; re-scans; repository monitoring pause/resume;
|
|
331
|
+
enforcement evidence (Actions workflow detection, required check from
|
|
332
|
+
rulesets and branch protection); installation repository sync; rule catalogue.
|
|
333
|
+
- Audit events with actors and organization scope for sign-in, sessions,
|
|
334
|
+
members, policy changes, violation lifecycle, monitoring, sync, enforcement
|
|
335
|
+
checks and re-scans; `SECURITY_ALERT_TYPES` for future notifications.
|
|
336
|
+
- Tests: two-tenant authorization and IDOR tests for every route, security
|
|
337
|
+
tests (CSRF, CORS, injection, XSS, traversal, secrets in responses and logs,
|
|
338
|
+
rate limits, headers), policy, lifecycle and end-to-end API tests, a
|
|
339
|
+
performance test (100 repositories, 10k scans, 50k findings, 100k audit
|
|
340
|
+
events), Vitest component and page tests, and Playwright browser tests
|
|
341
|
+
(primary scenario, responsive, axe accessibility, CSP, cookies).
|
|
342
|
+
- Docs: `dashboard.md`; deployment, architecture, GitHub App, GitHub
|
|
343
|
+
enforcement, configuration, threat model, README and SECURITY updated.
|
|
344
|
+
|
|
345
|
+
### Changed (Phase 6)
|
|
346
|
+
|
|
347
|
+
- The GitHub Action is listed as **CommitGuard AI Attribution Check** (the
|
|
348
|
+
name "CommitGuard" is taken on GitHub Marketplace) and declares Marketplace
|
|
349
|
+
branding (`shield`, `gray-dark`). The `uses:` reference is unchanged.
|
|
350
|
+
- State database schema 2 with ordered, transactional migrations; Phase 5
|
|
351
|
+
databases are upgraded in place.
|
|
352
|
+
- The worker records results through `ScanResultRecorder` and evaluates each
|
|
353
|
+
installation with its organization's policy floor.
|
|
354
|
+
- `CIRun` and `ScanResult` carry the effective policies; `Repository.is_ancestor`.
|
|
355
|
+
- Audit events gain `actor_type`, `actor_id`, `actor_login` and `account_id`;
|
|
356
|
+
audit storage fills the account from the installation.
|
|
357
|
+
- Findings now store the author and committer of commits with findings
|
|
358
|
+
(previously no identities were stored); commit messages are still never stored.
|
|
359
|
+
- `RequestRateLimiter` moved to `commitguard.security.rate_limit`.
|
|
360
|
+
- `commitguard github serve` and `wsgi_app_from_environment` serve the dashboard
|
|
361
|
+
when `COMMITGUARD_DASHBOARD_URL` is set.
|
|
362
|
+
|
|
363
|
+
### Added (Phase 5 — GitHub App and centralised enforcement)
|
|
364
|
+
|
|
365
|
+
- GitHub App service (`commitguard github serve`, optional `app` extra):
|
|
366
|
+
- WSGI webhook endpoint `POST /webhooks/github` with `GET /health` and `GET /ready`;
|
|
367
|
+
- HMAC-SHA256 signature verification, delivery-ID replay protection, size,
|
|
368
|
+
content-type, JSON (duplicate keys, depth) and per-client rate limits;
|
|
369
|
+
- typed events for `installation`, `installation_repositories`, `push` and `pull_request`.
|
|
370
|
+
- App authentication: RS256 JWTs from the App ID and private key (fails closed
|
|
371
|
+
on bad keys); installation tokens down-scoped to one repository and least
|
|
372
|
+
privilege, cached in memory only.
|
|
373
|
+
- Small GitHub REST client:
|
|
374
|
+
- HTTPS only, no redirects, same-origin pagination;
|
|
375
|
+
- normalised errors (401/403/404/409/422/429/5xx/timeouts);
|
|
376
|
+
- bounded retries and rate-limit backoff.
|
|
377
|
+
- Installation lifecycle and authorization: install, uninstall, suspend,
|
|
378
|
+
repositories added and removed, and authorization by repository ID before
|
|
379
|
+
every scan.
|
|
380
|
+
- Metadata-only partial Git mirrors: no checkout, hooks or blobs, and no lazy
|
|
381
|
+
fetch during analysis. Requires Git 2.45+.
|
|
382
|
+
- `ScanService` (`ScanRequest` → `ScanResult` with statistics and a
|
|
383
|
+
deterministic scan ID) and `EnforcementService` (exit codes and check
|
|
384
|
+
conclusions). `commitguard ci github` now uses them.
|
|
385
|
+
- Check Runs `commitguard-app` (pull requests) and `commitguard-app/push`:
|
|
386
|
+
- queued → in_progress → completed lifecycle, with bounded Markdown output;
|
|
387
|
+
- ownership-guarded writes, so a stale scan never overwrites a newer result;
|
|
388
|
+
- the exact scanned SHA, verified before publishing.
|
|
389
|
+
- SQLite state store for deliveries, installations, jobs, check ownership and
|
|
390
|
+
audit events: tenant-scoped reads and configurable retention.
|
|
391
|
+
- Event queue abstraction with an in-process implementation, durable job recovery.
|
|
392
|
+
- Audit events (`audit.models`, `services.audit`); structured JSON logs with
|
|
393
|
+
correlation IDs and secret redaction (`observability`); in-memory metrics.
|
|
394
|
+
- Mandatory policy floor (`policies.mandatory`,
|
|
395
|
+
`COMMITGUARD_APP_MANDATORY_POLICY_FILE`) that repository configuration cannot weaken.
|
|
396
|
+
- Policy weakening detection: CI reports and Check Runs flag commits that would
|
|
397
|
+
disable or relax a trusted policy.
|
|
398
|
+
- `commitguard github validate` (configuration, Git version, authentication,
|
|
399
|
+
permissions, events, installation access) and `commitguard github webhook-test`.
|
|
400
|
+
- Docs: `github-app.md`, `deployment.md`; threat model, configuration,
|
|
401
|
+
architecture and enforcement docs updated.
|
|
402
|
+
|
|
403
|
+
### Changed (Phase 5)
|
|
404
|
+
|
|
405
|
+
- `services.ci` split into `plan_ci` and `execute_ci_plan`. Commits are
|
|
406
|
+
analysed in batches (`Repository.iter_commits`).
|
|
407
|
+
- `run_git` accepts additional (never overriding) environment variables;
|
|
408
|
+
`Repository` can carry a per-repository Git environment.
|
|
409
|
+
- `CIReport` gains `policy_weakenings`; reports may list a `mandatory:` config source.
|
|
410
|
+
- Roadmap: security intelligence (signatures, secret detection) moves after the dashboard.
|
|
411
|
+
|
|
412
|
+
### Added (Phase 4 — GitHub server-side enforcement)
|
|
413
|
+
|
|
414
|
+
- `commitguard ci github`: analyses commits introduced by `pull_request`
|
|
415
|
+
(`head ^base`), `merge_group` and `push` events (new branches, deletions,
|
|
416
|
+
annotated tags, force pushes), fails closed (exit 2) on any error, supports
|
|
417
|
+
`--config`, `--fail-on block|warn`, `--max-commits`, `--format json`,
|
|
418
|
+
`--report-file`; writes annotations, job summary and step outputs in Actions.
|
|
419
|
+
- Trusted policy source: CI reads `.commitguard.yaml` from the base / before /
|
|
420
|
+
default-branch commit, never from the change; config changes are reported.
|
|
421
|
+
- `CIContext` (provider-neutral), `GitHubPullRequestContext`,
|
|
422
|
+
`GitHubPushContext`, `GitHubMergeGroupContext`, `CommitRange`, `PolicySource`.
|
|
423
|
+
- Composite `action.yml` (setup-python pinned, hash-pinned dependencies,
|
|
424
|
+
install from the Action's own source) and `requirements/ci.txt`.
|
|
425
|
+
- `.github/workflows/commitguard.yml` now enforces on this repository,
|
|
426
|
+
installing CommitGuard from a trusted commit via `git worktree`.
|
|
427
|
+
- `commitguard init --github` (pinned Action required, never overwrites) and
|
|
428
|
+
`commitguard github setup` (read-only guidance).
|
|
429
|
+
- `commitguard doctor`: rules provenance, GitHub workflow inspection
|
|
430
|
+
(triggers, permissions, pinning, fetch-depth, secrets, cancel-in-progress)
|
|
431
|
+
and an enforcement summary that never claims branch protection.
|
|
432
|
+
|
|
433
|
+
### Changed
|
|
434
|
+
|
|
435
|
+
- All workflows pin third-party actions to commit SHAs.
|
|
436
|
+
- `Repository.read_blob_at`, `ref_commit`, `object_exists`; pre-push planning
|
|
437
|
+
uses `CommitRange`.
|
|
438
|
+
- Reports gain an optional `ci` section.
|
|
439
|
+
|
|
440
|
+
### Added (Phase 3 — Git hook enforcement)
|
|
441
|
+
|
|
442
|
+
- `commitguard install` / `uninstall`: managed hooks with `# BEGIN/END COMMITGUARD`
|
|
443
|
+
markers and checksums; existing hooks preserved as `<hook>.pre-commitguard`
|
|
444
|
+
and chained (CommitGuard first, then the original hook with the same stdin);
|
|
445
|
+
refuses shared `core.hooksPath` unless `--allow-shared-hooks-path`.
|
|
446
|
+
- `--global` installation through a Git template directory (`init.templateDir`
|
|
447
|
+
set only when unset; `core.hooksPath` never touched).
|
|
448
|
+
- `commitguard hook pre-commit | commit-msg <file> | pre-push [remote] [url]`,
|
|
449
|
+
all fail closed (exit 2 on any error).
|
|
450
|
+
- pre-push outgoing commit planning: multiple refs, new branches, deletions,
|
|
451
|
+
annotated tags, tags to non-commits, force pushes, merges, detached HEAD,
|
|
452
|
+
pushes to URLs, SHA deduplication, `max_push_commits` bound.
|
|
453
|
+
- commit-msg message cleanup honouring `commit.cleanup` and scissors lines.
|
|
454
|
+
- `enforcement:` configuration section (per-hook switches, push commit limit).
|
|
455
|
+
- `commitguard doctor` rewritten: sections, hook presence/integrity/
|
|
456
|
+
executability/interpreter checks, engine self-test, HEALTHY/DEGRADED/UNHEALTHY.
|
|
457
|
+
- `commitguard check --verbose`; commit subjects in reports.
|
|
458
|
+
- CI matrix on Ubuntu, macOS and Windows; bandit in the security workflow.
|
|
459
|
+
- `.gitattributes` keeping hooks and shell scripts LF.
|
|
460
|
+
|
|
461
|
+
### Security (Phase 3)
|
|
462
|
+
|
|
463
|
+
- Hooks run `python -P` so a `commitguard/` directory in the repository cannot
|
|
464
|
+
shadow the installed package.
|
|
465
|
+
- Hook reference copies in `hooks/` are generated and verified by tests.
|
|
466
|
+
|
|
467
|
+
### Added (Phase 2 — AI attribution detection)
|
|
468
|
+
|
|
469
|
+
- Commit model with derived trailers, pending commits and reserved signature field.
|
|
470
|
+
- Lenient, bounded trailer and identity parser recording malformed and evasive
|
|
471
|
+
variants (missing separators, odd key spellings, invisible characters,
|
|
472
|
+
Unicode line separators, trailing escape codes).
|
|
473
|
+
- Rule files as data (`rules/*.yaml`) with strict schemas, cross-validation and
|
|
474
|
+
packaging into the wheel; deterministic identity matcher with confidence levels.
|
|
475
|
+
- Detectors: `coauthor` (`ai_coauthor`), `identity` (`ai_identity`), `trailer`
|
|
476
|
+
(`ai_trailer`, `malformed_trailer`), `bot` (`bot_identity`).
|
|
477
|
+
- Engine skips detectors with no enabled rules and validates finding commit SHAs.
|
|
478
|
+
- Layered configuration: built-in → global → repository → `--config`.
|
|
479
|
+
- Working `commitguard scan` and `commitguard check` (revision ranges,
|
|
480
|
+
`--message-file`, `--format json`, `--quiet`, `--max-commits`).
|
|
481
|
+
- Shared analysis service and JSON/audit-ready report models.
|
|
482
|
+
|
|
483
|
+
### Changed
|
|
484
|
+
|
|
485
|
+
- Exit codes: `0` allowed, `1` blocked, `2` any error (previously 3/4/5/70).
|
|
486
|
+
- `Finding.rule` renamed to `rule_id`; findings gain `title` and `confidence`;
|
|
487
|
+
`ScanContext` → `CommitContext`, `ScanResult` → `DetectionResult`.
|
|
488
|
+
- Unknown agents are no longer expected to be inferred from name wording.
|
|
489
|
+
- `commit-msg` hook template now calls `commitguard check --quiet --message-file`.
|
|
490
|
+
|
|
491
|
+
### Security
|
|
492
|
+
|
|
493
|
+
- Invisible and look-alike characters in source files replaced with code points.
|
|
494
|
+
- Unexpected CLI exceptions map to exit code 2 without tracebacks.
|
|
495
|
+
|
|
496
|
+
## [0.1.0.dev0] - Phase 1
|
|
497
|
+
|
|
498
|
+
### Added
|
|
499
|
+
|
|
500
|
+
- Phase 1 foundation: project structure, packaging (`pyproject.toml`), CI,
|
|
501
|
+
security and placeholder CommitGuard workflows.
|
|
502
|
+
- CLI skeleton (Typer): `init`, `policy list` and `doctor` are functional;
|
|
503
|
+
`install`, `uninstall`, `scan` and `check` expose their interfaces and exit
|
|
504
|
+
with a "not implemented" status.
|
|
505
|
+
- Strict configuration schema and loader (`.commitguard.yaml`), rejecting
|
|
506
|
+
unknown keys/policies, wrong types, duplicate keys and YAML aliases.
|
|
507
|
+
- Built-in policy defaults and fail-closed policy evaluator.
|
|
508
|
+
- Core models (`Commit`, `Finding`, `Evidence`, `ScanResult`, `Decision`),
|
|
509
|
+
detector interface, explicit detector registry and detection engine.
|
|
510
|
+
- Hardened, read-only Git wrapper: repository discovery and commit reading.
|
|
511
|
+
- Terminal output sanitisation, input validation and hashing helpers.
|
|
512
|
+
- Stub detectors (`coauthor`, `identity`, `trailer`, `bot`), rule data files,
|
|
513
|
+
hook templates, and xfail specifications for Phase 2 and Phase 3.
|
|
514
|
+
- Documentation: architecture, detection engine, policy engine,
|
|
515
|
+
configuration, Git hooks, GitHub enforcement and threat model.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
title: "CommitGuard: Git commit provenance and contribution policy enforcement"
|
|
3
|
+
message: "If you reference this project, please cite it as below."
|
|
4
|
+
type: software
|
|
5
|
+
authors:
|
|
6
|
+
- family-names: Oyinlola
|
|
7
|
+
given-names: Oluwayemi
|
|
8
|
+
repository-code: "https://github.com/oyinlola-tech/commitguard"
|
|
9
|
+
url: "https://github.com/oyinlola-tech/commitguard"
|
|
10
|
+
abstract: >-
|
|
11
|
+
CommitGuard is a defence-in-depth security system for enforcing configurable Git
|
|
12
|
+
contribution policies across developer machines, GitHub repositories and
|
|
13
|
+
organizations, with centralised policy governance, auditable security decisions
|
|
14
|
+
and reproducible security validation. Its detection accuracy is measured against
|
|
15
|
+
a versioned labelled dataset, and its benchmark results, including failing runs,
|
|
16
|
+
are published immutably.
|
|
17
|
+
keywords:
|
|
18
|
+
- git
|
|
19
|
+
- security
|
|
20
|
+
- provenance
|
|
21
|
+
- policy-enforcement
|
|
22
|
+
- ai-attribution
|
|
23
|
+
- software-supply-chain
|
|
24
|
+
license: MIT
|
|
25
|
+
version: 0.1.0.dev0
|
|
26
|
+
date-released: "2026-09-17"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
This project adopts the
|
|
4
|
+
[Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
|
|
5
|
+
|
|
6
|
+
## Summary
|
|
7
|
+
|
|
8
|
+
We want CommitGuard to be a welcoming, harassment-free project for everyone,
|
|
9
|
+
regardless of age, body size, visible or invisible disability, ethnicity, sex
|
|
10
|
+
characteristics, gender identity and expression, level of experience,
|
|
11
|
+
education, socio-economic status, nationality, personal appearance, race,
|
|
12
|
+
caste, color, religion, or sexual identity and orientation.
|
|
13
|
+
|
|
14
|
+
Expected behaviour includes empathy and kindness, respect for differing
|
|
15
|
+
opinions, giving and gracefully accepting constructive feedback, and taking
|
|
16
|
+
responsibility for mistakes.
|
|
17
|
+
|
|
18
|
+
Unacceptable behaviour includes sexualised language or imagery, trolling,
|
|
19
|
+
insulting or derogatory comments, personal or political attacks, public or
|
|
20
|
+
private harassment, publishing others' private information without explicit
|
|
21
|
+
permission, and other conduct that could reasonably be considered
|
|
22
|
+
inappropriate in a professional setting.
|
|
23
|
+
|
|
24
|
+
Note that discussions about AI-assisted development can be contentious. Debate
|
|
25
|
+
policies and ideas; do not attack people for how they choose to work.
|
|
26
|
+
|
|
27
|
+
## Enforcement
|
|
28
|
+
|
|
29
|
+
Project maintainers are responsible for clarifying and enforcing these
|
|
30
|
+
standards and may remove, edit, or reject contributions that do not align
|
|
31
|
+
with them, and may temporarily or permanently ban contributors for behaviour
|
|
32
|
+
they deem harmful.
|
|
33
|
+
|
|
34
|
+
Report incidents privately to the project maintainers.
|
|
35
|
+
<!-- TODO: add a dedicated conduct contact address. -->
|
|
36
|
+
|
|
37
|
+
All complaints will be reviewed and investigated promptly and fairly, and the
|
|
38
|
+
privacy of the reporter will be respected. The full enforcement guidelines are
|
|
39
|
+
those of the Contributor Covenant 2.1 linked above.
|