agentlinter 0.2.0__tar.gz → 0.3.2__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.
- agentlinter-0.3.2/.agent-lint.toml.example +32 -0
- agentlinter-0.3.2/.github/ISSUE_TEMPLATE/bug_report.yml +66 -0
- agentlinter-0.3.2/.github/ISSUE_TEMPLATE/feature_request.yml +41 -0
- agentlinter-0.3.2/.github/actions/agent-lint/action.yml +61 -0
- agentlinter-0.3.2/.github/pull_request_template.md +35 -0
- agentlinter-0.3.2/.github/workflows/changelog.yml +33 -0
- agentlinter-0.3.2/.github/workflows/ci.yml +44 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/.github/workflows/codeql.yml +1 -1
- agentlinter-0.3.2/.github/workflows/docs.yml +42 -0
- agentlinter-0.3.2/.github/workflows/pricing-update.yml +47 -0
- agentlinter-0.3.2/.github/workflows/publish.yml +48 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/.github/workflows/release.yml +3 -3
- {agentlinter-0.2.0 → agentlinter-0.3.2}/.github/workflows/secret-scan.yml +1 -1
- {agentlinter-0.2.0 → agentlinter-0.3.2}/.github/workflows/security.yml +2 -2
- {agentlinter-0.2.0 → agentlinter-0.3.2}/.gitignore +12 -0
- agentlinter-0.3.2/.pre-commit-config.yaml +20 -0
- agentlinter-0.3.2/.pre-commit-hooks.yaml +12 -0
- agentlinter-0.3.2/CHANGELOG.md +69 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/CLAUDE.md +49 -11
- agentlinter-0.3.2/CONTRIBUTING.md +186 -0
- agentlinter-0.3.2/Dockerfile +22 -0
- agentlinter-0.3.2/LICENSE +57 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/PKG-INFO +6 -2
- agentlinter-0.3.2/PRICING.md +21 -0
- agentlinter-0.3.2/STATUS.md +35 -0
- agentlinter-0.3.2/docker-bake.hcl +20 -0
- agentlinter-0.3.2/docs/api/models.md +0 -0
- agentlinter-0.3.2/docs/api/parsers.md +0 -0
- agentlinter-0.3.2/docs/api/rules.md +0 -0
- agentlinter-0.3.2/docs/changelog.md +0 -0
- agentlinter-0.3.2/docs/ci.md +68 -0
- agentlinter-0.3.2/docs/config.md +0 -0
- agentlinter-0.3.2/docs/contributing.md +0 -0
- agentlinter-0.3.2/docs/index.md +49 -0
- agentlinter-0.3.2/docs/install.md +0 -0
- agentlinter-0.3.2/docs/quickstart.md +0 -0
- agentlinter-0.3.2/docs/rules/budget.md +0 -0
- agentlinter-0.3.2/docs/rules/efficiency.md +0 -0
- agentlinter-0.3.2/docs/rules/resilience.md +0 -0
- agentlinter-0.3.2/docs/rules/security.md +0 -0
- agentlinter-0.3.2/mkdocs.yml +67 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/pyproject.toml +7 -2
- agentlinter-0.3.2/scripts/benchmark-accuracy.py +96 -0
- agentlinter-0.3.2/scripts/benchmark-performance.py +119 -0
- agentlinter-0.3.2/scripts/fetch-corpus.py +122 -0
- agentlinter-0.3.2/scripts/fetch-pricing.py +91 -0
- agentlinter-0.3.2/scripts/stripe_setup_agent_lint.py +127 -0
- agentlinter-0.3.2/scripts/test-sarif-upload.sh +183 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/__init__.py +1 -1
- agentlinter-0.3.2/src/agent_lint/autofix.py +180 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/cli.py +30 -6
- agentlinter-0.3.2/src/agent_lint/config_file.py +170 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/estimator.py +4 -2
- agentlinter-0.3.2/src/agent_lint/github_formatter.py +80 -0
- agentlinter-0.3.2/src/agent_lint/licensing.py +308 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/linter.py +0 -14
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/rules/efficiency.py +1 -1
- agentlinter-0.3.2/src/agent_lint/sarif_formatter.py +166 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/telemetry.py +3 -1
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agentlinter.egg-info/PKG-INFO +6 -2
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agentlinter.egg-info/SOURCES.txt +55 -1
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agentlinter.egg-info/requires.txt +5 -0
- agentlinter-0.3.2/tests/__init__.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/conftest.py +9 -0
- agentlinter-0.3.2/tests/fixtures/benchmarks/minimal-budget.json +4 -0
- agentlinter-0.3.2/tests/fixtures/benchmarks/minimal-budget.yaml +7 -0
- agentlinter-0.3.2/tests/fixtures/benchmarks/resilience-retry.json +4 -0
- agentlinter-0.3.2/tests/fixtures/benchmarks/resilience-retry.yaml +7 -0
- agentlinter-0.3.2/tests/fixtures/workflows/sample-agent-workflow.yaml +67 -0
- agentlinter-0.3.2/tests/test_autofix.py +120 -0
- agentlinter-0.3.2/tests/test_config_file.py +118 -0
- agentlinter-0.3.2/tests/test_coverage_pro.py +245 -0
- agentlinter-0.3.2/tests/test_github_formatter.py +97 -0
- agentlinter-0.3.2/tests/test_licensing_server.py +265 -0
- agentlinter-0.3.2/tests/test_sarif_formatter.py +111 -0
- agentlinter-0.2.0/.github/workflows/ci.yml +0 -32
- agentlinter-0.2.0/LICENSE +0 -21
- agentlinter-0.2.0/src/agent_lint/licensing.py +0 -174
- {agentlinter-0.2.0 → agentlinter-0.3.2}/.github/dependabot.yml +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/.gitleaks.toml +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/README.md +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/SECURITY.md +0 -0
- /agentlinter-0.2.0/tests/__init__.py → /agentlinter-0.3.2/docs/api/formatters.md +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/setup.cfg +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/__main__.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/comparator.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/config.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/data/providers.yaml +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/exceptions.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/formatters.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/gates.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/models.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/parsers/__init__.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/parsers/crewai.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/parsers/generic.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/parsers/gorgon.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/parsers/langchain.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/pricing.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/rules/__init__.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/rules/budget.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/rules/resilience.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agent_lint/rules/security.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agentlinter.egg-info/dependency_links.txt +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agentlinter.egg-info/entry_points.txt +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/src/agentlinter.egg-info/top_level.txt +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_cli.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_comparator.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_coverage_push_90.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_estimator.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_formatters.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_gates.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_licensing.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_linter.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_models.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_parsers.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_pricing.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_rules.py +0 -0
- {agentlinter-0.2.0 → agentlinter-0.3.2}/tests/test_telemetry.py +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# ---------------------------------------------------------------------------
|
|
2
|
+
# Example project-level configuration for agent-lint.
|
|
3
|
+
# Place this file in your project root as .agent-lint.toml
|
|
4
|
+
# or add [tool.agent-lint] to pyproject.toml instead.
|
|
5
|
+
# ---------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
[agent-lint]
|
|
8
|
+
# Minimum score before CI exits with failure.
|
|
9
|
+
fail-under = 80
|
|
10
|
+
|
|
11
|
+
# Output format: table | json | markdown | sarif
|
|
12
|
+
format = "table"
|
|
13
|
+
|
|
14
|
+
# Rules to suppress globally (equivalent to # agent-lint: ignore=RULE_ID)
|
|
15
|
+
exclude-rules = ["B004", "E003"]
|
|
16
|
+
|
|
17
|
+
# Override default severities per rule.
|
|
18
|
+
[agent-lint.custom-severities]
|
|
19
|
+
S001 = "warning" # Demote shell variable interpolation from ERROR to WARNING.
|
|
20
|
+
R003 = "warning" # Demote retry-without-max from INFO to WARNING.
|
|
21
|
+
|
|
22
|
+
# Paths to lint recursively.
|
|
23
|
+
include-paths = ["workflows/", "agents/"]
|
|
24
|
+
|
|
25
|
+
# Paths to ignore.
|
|
26
|
+
exclude-paths = ["workflows/templates/", "agents/examples/"]
|
|
27
|
+
|
|
28
|
+
# Default category filter (optional).
|
|
29
|
+
# category = "security"
|
|
30
|
+
|
|
31
|
+
# Default severity filter (optional).
|
|
32
|
+
# severity = "error"
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Report a bug in agent-lint
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["bug", "triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for reporting a bug. Please fill in the details below so we can reproduce and fix it.
|
|
10
|
+
- type: input
|
|
11
|
+
id: version
|
|
12
|
+
attributes:
|
|
13
|
+
label: agent-lint Version
|
|
14
|
+
description: What version of agent-lint are you running?
|
|
15
|
+
placeholder: e.g., 0.2.1
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: input
|
|
19
|
+
id: python
|
|
20
|
+
attributes:
|
|
21
|
+
label: Python Version
|
|
22
|
+
description: What Python version are you using?
|
|
23
|
+
placeholder: e.g., 3.12.3
|
|
24
|
+
validations:
|
|
25
|
+
required: true
|
|
26
|
+
- type: dropdown
|
|
27
|
+
id: os
|
|
28
|
+
attributes:
|
|
29
|
+
label: Operating System
|
|
30
|
+
options:
|
|
31
|
+
- macOS
|
|
32
|
+
- Linux
|
|
33
|
+
- Windows
|
|
34
|
+
- Other
|
|
35
|
+
validations:
|
|
36
|
+
required: true
|
|
37
|
+
- type: textarea
|
|
38
|
+
id: what-happened
|
|
39
|
+
attributes:
|
|
40
|
+
label: What happened?
|
|
41
|
+
description: Describe the bug in clear steps.
|
|
42
|
+
placeholder: |
|
|
43
|
+
1. Ran `agent-lint lint workflow.yaml`
|
|
44
|
+
2. Expected to see a score of 85
|
|
45
|
+
3. Got a crash with `PricingError: Unknown provider`
|
|
46
|
+
validations:
|
|
47
|
+
required: true
|
|
48
|
+
- type: textarea
|
|
49
|
+
id: workflow
|
|
50
|
+
attributes:
|
|
51
|
+
label: Workflow YAML (if applicable)
|
|
52
|
+
description: Paste the minimal YAML that triggers the bug.
|
|
53
|
+
render: yaml
|
|
54
|
+
- type: textarea
|
|
55
|
+
id: logs
|
|
56
|
+
attributes:
|
|
57
|
+
label: Output / Logs
|
|
58
|
+
description: Paste the full error output or traceback.
|
|
59
|
+
render: shell
|
|
60
|
+
- type: checkboxes
|
|
61
|
+
id: terms
|
|
62
|
+
attributes:
|
|
63
|
+
label: Code of Conduct
|
|
64
|
+
options:
|
|
65
|
+
- label: I agree to follow this project's Code of Conduct
|
|
66
|
+
required: true
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest a new feature or enhancement for agent-lint
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: ["enhancement", "triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for suggesting a feature. Please describe the use case and proposed solution.
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: problem
|
|
12
|
+
attributes:
|
|
13
|
+
label: Problem Statement
|
|
14
|
+
description: What problem does this feature solve?
|
|
15
|
+
placeholder: |
|
|
16
|
+
Currently, agent-lint only supports Gorgon, CrewAI, and LangChain workflows.
|
|
17
|
+
I need support for OpenAI Swarm YAML configs.
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: solution
|
|
22
|
+
attributes:
|
|
23
|
+
label: Proposed Solution
|
|
24
|
+
description: How should this feature work?
|
|
25
|
+
placeholder: |
|
|
26
|
+
Add a new `WorkflowFormat.SWARM` and `parsers/swarm.py` that detects
|
|
27
|
+
OpenAI Swarm configs by the presence of `agents` and `handoffs` keys.
|
|
28
|
+
validations:
|
|
29
|
+
required: true
|
|
30
|
+
- type: textarea
|
|
31
|
+
id: alternatives
|
|
32
|
+
attributes:
|
|
33
|
+
label: Alternatives Considered
|
|
34
|
+
description: What other approaches have you tried?
|
|
35
|
+
- type: checkboxes
|
|
36
|
+
id: terms
|
|
37
|
+
attributes:
|
|
38
|
+
label: Code of Conduct
|
|
39
|
+
options:
|
|
40
|
+
- label: I agree to follow this project's Code of Conduct
|
|
41
|
+
required: true
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# ---------------------------------------------------------------------------
|
|
2
|
+
# Composite GitHub Action: agent-lint
|
|
3
|
+
# Usage in downstream workflows:
|
|
4
|
+
#
|
|
5
|
+
# steps:
|
|
6
|
+
# - uses: AreteDriver/agent-lint/.github/actions/agent-lint@main
|
|
7
|
+
# with:
|
|
8
|
+
# path: workflows/
|
|
9
|
+
# fail-under: 80
|
|
10
|
+
# format: github
|
|
11
|
+
# ---------------------------------------------------------------------------
|
|
12
|
+
name: 'agent-lint'
|
|
13
|
+
description: 'Lint agent workflow YAML configs for cost and anti-patterns'
|
|
14
|
+
author: 'AreteDriver'
|
|
15
|
+
|
|
16
|
+
inputs:
|
|
17
|
+
path:
|
|
18
|
+
description: 'Path to workflow YAML file or directory'
|
|
19
|
+
required: true
|
|
20
|
+
default: '.'
|
|
21
|
+
fail-under:
|
|
22
|
+
description: 'Minimum lint score (0-100)'
|
|
23
|
+
required: false
|
|
24
|
+
default: '80'
|
|
25
|
+
format:
|
|
26
|
+
description: 'Output format (table|json|markdown|github)'
|
|
27
|
+
required: false
|
|
28
|
+
default: 'github'
|
|
29
|
+
category:
|
|
30
|
+
description: 'Filter by category (budget|resilience|efficiency|security)'
|
|
31
|
+
required: false
|
|
32
|
+
default: ''
|
|
33
|
+
severity:
|
|
34
|
+
description: 'Filter by severity (error|warning|info)'
|
|
35
|
+
required: false
|
|
36
|
+
default: ''
|
|
37
|
+
|
|
38
|
+
runs:
|
|
39
|
+
using: 'composite'
|
|
40
|
+
steps:
|
|
41
|
+
- name: Set up Python
|
|
42
|
+
uses: actions/setup-python@v5
|
|
43
|
+
with:
|
|
44
|
+
python-version: '3.12'
|
|
45
|
+
|
|
46
|
+
- name: Install agent-lint
|
|
47
|
+
shell: bash
|
|
48
|
+
run: pip install agentlinter
|
|
49
|
+
|
|
50
|
+
- name: Run agent-lint
|
|
51
|
+
shell: bash
|
|
52
|
+
run: |
|
|
53
|
+
ARGS=("${{ inputs.path }}")
|
|
54
|
+
[ -n "${{ inputs.fail-under }}" ] && ARGS+=(--fail-under "${{ inputs.fail-under }}")
|
|
55
|
+
[ -n "${{ inputs.category }}" ] && ARGS+=(--category "${{ inputs.category }}")
|
|
56
|
+
[ -n "${{ inputs.severity }}" ] && ARGS+=(--severity "${{ inputs.severity }}")
|
|
57
|
+
agent-lint lint "${ARGS[@]}" --format "${{ inputs.format }}"
|
|
58
|
+
|
|
59
|
+
branding:
|
|
60
|
+
icon: 'shield'
|
|
61
|
+
color: 'blue'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
Brief description of what this PR does.
|
|
4
|
+
|
|
5
|
+
## Type of Change
|
|
6
|
+
|
|
7
|
+
- [ ] Bug fix (`fix:`)
|
|
8
|
+
- [ ] New feature (`feat:`)
|
|
9
|
+
- [ ] Documentation (`docs:`)
|
|
10
|
+
- [ ] CI/CD (`ci:`)
|
|
11
|
+
- [ ] Refactor (`refactor:`)
|
|
12
|
+
- [ ] Tests (`test:`)
|
|
13
|
+
- [ ] Maintenance (`chore:`)
|
|
14
|
+
|
|
15
|
+
## Changes
|
|
16
|
+
|
|
17
|
+
- Change 1
|
|
18
|
+
- Change 2
|
|
19
|
+
- Change 3
|
|
20
|
+
|
|
21
|
+
## Verification
|
|
22
|
+
|
|
23
|
+
- [ ] `ruff check src/ tests/` passes
|
|
24
|
+
- [ ] `ruff format --check src/ tests/` passes
|
|
25
|
+
- [ ] `mypy src/` passes
|
|
26
|
+
- [ ] `pytest tests/ -v` passes
|
|
27
|
+
- [ ] Coverage stays ≥ 90%
|
|
28
|
+
|
|
29
|
+
## Related Issues
|
|
30
|
+
|
|
31
|
+
Fixes # (issue number)
|
|
32
|
+
|
|
33
|
+
## Additional Notes
|
|
34
|
+
|
|
35
|
+
Anything else reviewers should know?
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Generate Changelog
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
changelog:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- name: Generate changelog
|
|
20
|
+
uses: orhun/git-cliff-action@v3
|
|
21
|
+
id: git-cliff
|
|
22
|
+
with:
|
|
23
|
+
args: --latest --strip header
|
|
24
|
+
env:
|
|
25
|
+
OUTPUT: CHANGELOG.md
|
|
26
|
+
|
|
27
|
+
- name: Commit changelog
|
|
28
|
+
run: |
|
|
29
|
+
git config user.name "github-actions[bot]"
|
|
30
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
31
|
+
git add CHANGELOG.md
|
|
32
|
+
git commit -m "chore(release): update CHANGELOG.md"
|
|
33
|
+
git push origin HEAD:main
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
14
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.12"
|
|
17
|
+
- run: pip install ruff
|
|
18
|
+
- run: ruff check src/ tests/
|
|
19
|
+
- run: ruff format --check src/ tests/
|
|
20
|
+
|
|
21
|
+
typecheck:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
|
25
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.12"
|
|
28
|
+
- run: pip install -e ".[dev]"
|
|
29
|
+
# Ratchet: src/ is fully typed under strict mode.
|
|
30
|
+
# tests/ will be added once helper annotations are completed.
|
|
31
|
+
- run: mypy src/
|
|
32
|
+
|
|
33
|
+
test:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
strategy:
|
|
36
|
+
matrix:
|
|
37
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
40
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
|
|
41
|
+
with:
|
|
42
|
+
python-version: ${{ matrix.python-version }}
|
|
43
|
+
- run: pip install -e ".[dev]"
|
|
44
|
+
- run: pytest tests/ -v
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths:
|
|
7
|
+
- "docs/**"
|
|
8
|
+
- "mkdocs.yml"
|
|
9
|
+
- "src/**"
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
pages: write
|
|
14
|
+
id-token: write
|
|
15
|
+
|
|
16
|
+
concurrency:
|
|
17
|
+
group: "pages"
|
|
18
|
+
cancel-in-progress: false
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
build:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
|
|
25
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.12"
|
|
28
|
+
- run: pip install mkdocs-material mkdocstrings[python]
|
|
29
|
+
- run: mkdocs build --strict
|
|
30
|
+
- uses: actions/upload-pages-artifact@v3
|
|
31
|
+
with:
|
|
32
|
+
path: site/
|
|
33
|
+
|
|
34
|
+
deploy:
|
|
35
|
+
needs: build
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
environment:
|
|
38
|
+
name: github-pages
|
|
39
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
40
|
+
steps:
|
|
41
|
+
- id: deployment
|
|
42
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Pricing Data Update
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
# Weekly on Sundays at 05:00 UTC
|
|
6
|
+
- cron: "0 5 * * 0"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
pull-requests: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
update-pricing:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: "3.12"
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: pip install requests
|
|
26
|
+
|
|
27
|
+
- name: Fetch latest pricing
|
|
28
|
+
id: fetch
|
|
29
|
+
run: |
|
|
30
|
+
python scripts/fetch-pricing.py
|
|
31
|
+
env:
|
|
32
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
33
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
34
|
+
|
|
35
|
+
- name: Create Pull Request
|
|
36
|
+
uses: peter-evans/create-pull-request@v6
|
|
37
|
+
with:
|
|
38
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
39
|
+
branch: chore/update-pricing
|
|
40
|
+
title: "chore: update pricing data"
|
|
41
|
+
body: |
|
|
42
|
+
Automated pricing data refresh.
|
|
43
|
+
|
|
44
|
+
- Triggered by: ${{ github.event_name }}
|
|
45
|
+
- Run: ${{ github.run_id }}
|
|
46
|
+
commit-message: "chore: update pricing data"
|
|
47
|
+
delete-branch: true
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
|
|
22
|
+
- name: Install build tools
|
|
23
|
+
run: pip install build
|
|
24
|
+
|
|
25
|
+
- name: Build wheel and sdist
|
|
26
|
+
run: python -m build
|
|
27
|
+
|
|
28
|
+
- name: Upload artifacts
|
|
29
|
+
uses: actions/upload-artifact@v4
|
|
30
|
+
with:
|
|
31
|
+
name: dist
|
|
32
|
+
path: dist/
|
|
33
|
+
|
|
34
|
+
publish:
|
|
35
|
+
needs: build
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
environment: pypi
|
|
38
|
+
steps:
|
|
39
|
+
- name: Download artifacts
|
|
40
|
+
uses: actions/download-artifact@v4
|
|
41
|
+
with:
|
|
42
|
+
name: dist
|
|
43
|
+
path: dist/
|
|
44
|
+
|
|
45
|
+
- name: Publish to PyPI
|
|
46
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
47
|
+
with:
|
|
48
|
+
packages-dir: dist/
|
|
@@ -13,10 +13,10 @@ jobs:
|
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
environment: pypi
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v7
|
|
17
17
|
|
|
18
18
|
- name: Set up Python
|
|
19
|
-
uses: actions/setup-python@v6
|
|
19
|
+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
|
|
20
20
|
with:
|
|
21
21
|
python-version: "3.12"
|
|
22
22
|
|
|
@@ -32,7 +32,7 @@ jobs:
|
|
|
32
32
|
python -m build
|
|
33
33
|
|
|
34
34
|
- name: Create GitHub Release
|
|
35
|
-
uses: softprops/action-gh-release@
|
|
35
|
+
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2
|
|
36
36
|
with:
|
|
37
37
|
generate_release_notes: true
|
|
38
38
|
files: dist/*
|
|
@@ -13,8 +13,8 @@ jobs:
|
|
|
13
13
|
name: Dependency Audit
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
17
|
-
- uses: actions/setup-python@v6
|
|
16
|
+
- uses: actions/checkout@v7
|
|
17
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
|
|
18
18
|
with:
|
|
19
19
|
python-version: "3.12"
|
|
20
20
|
- name: Install dependencies
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# ---------------------------------------------------------------------------
|
|
2
|
+
# Pre-commit config for the agent-lint repository itself.
|
|
3
|
+
# ---------------------------------------------------------------------------
|
|
4
|
+
repos:
|
|
5
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
6
|
+
rev: v0.11.0
|
|
7
|
+
hooks:
|
|
8
|
+
- id: ruff
|
|
9
|
+
args: [--fix]
|
|
10
|
+
- id: ruff-format
|
|
11
|
+
|
|
12
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
13
|
+
rev: v1.15.0
|
|
14
|
+
hooks:
|
|
15
|
+
- id: mypy
|
|
16
|
+
additional_dependencies:
|
|
17
|
+
- pydantic>=2.0
|
|
18
|
+
- typer>=0.9.0
|
|
19
|
+
- rich>=13.0
|
|
20
|
+
- pyyaml>=6.0
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# ---------------------------------------------------------------------------
|
|
2
|
+
# Pre-commit hook definition for consumers who want to lint agent workflows.
|
|
3
|
+
# ---------------------------------------------------------------------------
|
|
4
|
+
- id: agent-lint
|
|
5
|
+
name: agent-lint
|
|
6
|
+
description: "Lint agent workflow YAML configs for cost and anti-patterns"
|
|
7
|
+
entry: agent-lint lint
|
|
8
|
+
language: python
|
|
9
|
+
files: \.(yaml|yml)$
|
|
10
|
+
pass_filenames: true
|
|
11
|
+
require_serial: false
|
|
12
|
+
additional_dependencies: []
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.3.0] - 2026-07-20
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
#### Output Formats
|
|
15
|
+
- **SARIF v2.1.0** output format (`--format sarif`) for GitHub Advanced Security integration (#16)
|
|
16
|
+
- **GitHub PR annotations** output format (`--format github`) that emits `::error`, `::warning`, and `::notice` workflow commands (#18)
|
|
17
|
+
|
|
18
|
+
#### Configuration
|
|
19
|
+
- **Project-level config file support** via `.agent-lint.toml` or `pyproject.toml [tool.agent-lint]` with cascading precedence: CLI flags → env vars → config file → defaults (#17)
|
|
20
|
+
|
|
21
|
+
#### Autofix
|
|
22
|
+
- **Autofix engine** with `--fix` flag on `lint` command. Generates unified diff patches for fixable findings including B001, R003, R004, S003, and E004 (#21)
|
|
23
|
+
|
|
24
|
+
#### CI / CD
|
|
25
|
+
- **Composite GitHub Action** at `.github/actions/agent-lint/action.yml` for reusable workflow integration (#15)
|
|
26
|
+
- **PyPI publish workflow** triggered on `v*` tags using OIDC trusted publishing (#24)
|
|
27
|
+
- **Docker image** with multi-stage build and `docker-bake.hcl` for `linux/amd64` + `linux/arm64` (#24)
|
|
28
|
+
- **Automated changelog generation** on releases via git-cliff (#25)
|
|
29
|
+
|
|
30
|
+
#### Quality Assurance
|
|
31
|
+
- **Accuracy benchmark scaffold** with annotated workflow fixtures for measuring precision / recall / F1 per rule (#22)
|
|
32
|
+
- **Performance benchmark** (`scripts/benchmark-performance.py`) validating lint latency and memory thresholds across 10–1000 step workflows (#25)
|
|
33
|
+
- **Real-world corpus test** (`scripts/fetch-corpus.py`) for false-positive rate measurement against public agent workflow YAMLs (#25)
|
|
34
|
+
- **Mypy typecheck** job in CI with ratchet strategy (#12)
|
|
35
|
+
- **Pre-commit hooks** configuration for downstream consumers (#13)
|
|
36
|
+
|
|
37
|
+
#### Documentation
|
|
38
|
+
- **MkDocs site** with Material theme, API reference, and CI deploy to GitHub Pages (#20)
|
|
39
|
+
- **CONTRIBUTING.md**, issue templates, and pull request template (#19)
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
- License metadata in `pyproject.toml` aligned to MIT (#11)
|
|
43
|
+
- Asymmetric rule imports in `linter.py` replaced with uniform top-level imports (#14)
|
|
44
|
+
- Rich `console.print()` soft-wrap corruption of SARIF JSON replaced with plain `print()` (#16)
|
|
45
|
+
- Config file kebab-case normalization ordering bug with env overrides (#17)
|
|
46
|
+
|
|
47
|
+
## [0.2.1] - 2026-07-07
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
- Pro-gated coverage tests and tiered coverage gates (90% for open-source, 95% for Pro)
|
|
51
|
+
- Free vs Pro pricing documentation with Stripe payment links
|
|
52
|
+
|
|
53
|
+
### Security
|
|
54
|
+
- Scrubbed local paths from repository
|
|
55
|
+
- License switched to BSL-1.1 for Pro feature differentiation
|
|
56
|
+
|
|
57
|
+
## [0.2.0] - 2026-06-15
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
- License server validation and Stripe integration scaffolding
|
|
61
|
+
- Coverage gate CI job (85%)
|
|
62
|
+
- Release workflow and gitleaks secret scanning
|
|
63
|
+
- Rename package to `agentlinter` for PyPI availability
|
|
64
|
+
|
|
65
|
+
## [0.1.1] - 2026-06-01
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
- Initial release of `agent-lint` CLI tool
|
|
69
|
+
- Cost estimation and anti-pattern detection for agent workflow YAML configs
|