This guide covers setting up a development environment for contributing to SattLint.
For public support boundaries, see SUPPORT.md and docs/references/public-support-matrix.md. All contributors are expected to follow CODE_OF_CONDUCT.md.
Maintainer operating docs now start at docs/maintainers/README.md, including the routing map, quality gates, and validation map.
- Check the public support matrix to confirm whether the affected surface is stable or preview.
- Search existing issues to avoid duplicates.
- Open a bug report with:
- SattLint version (
sattlint --version) - Install method and operating system
- Exact command that triggered the issue
- Minimal reproduction input (safe to share)
- Expected vs actual behavior
- SattLint version (
- Read the public support matrix to understand stable vs preview boundaries.
- Open a feature request describing the problem you are solving, the desired behavior, and any current workaround.
-
Fork the repository and create a focused branch (
feature/,fix/, orchore/). -
Keep changes small and scoped to a single concern.
-
Run the pre-commit gate before pushing:
python -m pre_commit run --all-files
-
Run the full audit if your change touches source or test files:
sattlint-repo-audit --profile full --output-dir artifacts/audit
-
Open a pull request against
main. Fill in the PR template with commands run and remaining risks. -
A maintainer will review your changes. Expect questions or requests for narrower scope.
For human-readable CLI reference, see docs/public/feature-guide.md and docs/public/cli-commands.md.
- Usage questions: open a GitHub issue with the question template.
- Security vulnerabilities: follow SECURITY.md and report privately.
- Anything else: open a GitHub issue.
- Python 3.13 or newer
- Git
- A SattLine codebase for testing
Preferred local bootstrap uses uv because CI already installs through uv.
pip install -e .[dev] remains acceptable when uv is unavailable.
# Install Python 3.13 (via your preferred method: pyenv, mise, uv, or system package)
# Clone repository
git clone https://github.com/SorenHJohansen/SattLint.git
cd SattLint
# Preferred: install through uv
uv venv
source .venv/bin/activate
uv pip install -e .[dev,lsp]
# Fallback
# python -m venv .venv
# source .venv/bin/activate
# pip install -e .[dev,lsp]Configure your editor with:
- Python language server (pyright or pylance)
- Ruff for linting and formatting
- Pyright for type checking
Consult your editor's documentation for the appropriate LSP and formatter plugins.
# Install Python from python.org or Windows Store
# Clone repository
git clone https://github.com/SorenHJohansen/SattLint.git
cd SattLint
# Preferred: install through uv
uv venv
python scripts/run_repo_python.py -m pip install -e .[dev,lsp]
# Fallback
# python -m venv .venv
# python scripts/run_repo_python.py -m pip install -e .[dev,lsp]
# Recommended VS Code extensions are listed in .vscode/extensions.jsonTo run the local SattLine VS Code extension client preview:
pip install -e .[lsp]Then copy or symlink vscode\sattline-vscode into your VS Code user extensions directory under a folder such as local.sattline-vscode-dev and reload the window. There is no npm or TypeScript build step in the current client, and this client remains a preview-only surface until it has a public publisher and release story.
If you need a packaged extension artifact, run the extension-local packaging script from WSL:
cd vscode/sattline-vscode
npm run package:vsixThe repository includes .vscode/settings.json which configures:
- Cross-platform Python interpreter discovery via
.venv - Ruff for linting
- Pylance in
openFilesOnlymode for lower editor overhead in this AI-first repo - Pyright CLI runs as the authoritative type-check gate
- Pytest for testing
- Context Optimizer line budget alignment for AI context files
- Search visibility for machine-readable audit reports under
artifacts/audit/
Use the workspace task runner in .vscode/tasks.json for the common AI and validation flows.
The committed task list is intentionally short; keep one-off investigation commands out of the shared workspace file.
All code quality tools are configured in pyproject.toml:
# Format code
ruff format src/ tests/
# Lint code
ruff check src/ tests/
# Type check
pyright src tests
# Run tests
pytest tests/ -v
# Run tests with the enforced coverage baseline
pytest -q --tb=short
# Lint GitHub Actions workflows via the repo wrapper used by pre-commit and CI
python scripts/run_actionlint.py
# Lint Markdown via the repo wrapper used by pre-commit and CI
python scripts/run_markdownlint.py --config .markdownlint-cli2.jsonc
# Run the fast local pre-commit gate
python -m pre_commit run --all-files
# Run the AI post-change drift gate
sattlint-repo-audit --profile full --check-my-changes --output-dir artifacts/audit
# Audit installed Python dependencies
pip-audit
# Run the local pre-push or CI audit
sattlint-repo-audit --profile full --output-dir artifacts/auditThe canonical audit entry point is sattlint-repo-audit.
- Use
--profile quickfor fast edit-and-verify loops. - Use
--profile fullfor the complete lint, type, test, security, dead-code, and repo-audit pass. - Open
artifacts/audit/status.jsonfirst; it is the compact machine-readable summary intended for tooling and AI agents. - The full details remain in
artifacts/audit/summary.json,artifacts/audit/findings.json, andartifacts/audit/pipeline/. python scripts/context_health.py --checkis the fast AI-control-plane gate.python scripts/repo_health.py --check --audit-dir artifacts/auditemits the repo health dashboard from the current audit artifacts.
# Run all tests
pytest
# Run with coverage
pytest --cov=src
# Run specific test file
pytest tests/test_cli.pyThe repository currently enforces a ratcheted minimum coverage threshold in pyproject.toml.
Raise that threshold incrementally as test surface expands instead of jumping directly to the long-term target.
pip install -e .[dev]
pre-commit install
python scripts/context_health.py --check
python -m pre_commit run --all-filesRun focused owner validation immediately after the first substantive edit.
Use python scripts/context_health.py --check when the AI-control plane changes.
Use python -m pre_commit run --all-files as the fast local hygiene gate for staged formatting, changed Markdown lint, SattLine syntax-check, and targeted context-health checks.
Use sattlint-repo-audit --profile full --check-my-changes --output-dir artifacts/audit as the AI post-change drift gate.
Use sattlint-repo-audit --profile full --output-dir artifacts/audit as the real local pre-push gate before you push or when you want CI-equivalent repo proof.
Use the shared workspace tasks only as thin wrappers around those same commands when you want them in VS Code.
Use python scripts/run_ai_edit_gate.py <touched paths...> only when you are debugging the .github/hooks/ai-edit-gate.json hook itself.
Use one focused branch or worktree per slice.
- Start from
AGENTS.mdand the owning file, failing command, or failing test. - Keep the slice small enough that focused validation is obvious.
- Run the first focused owner validation immediately.
- Run
python scripts/context_health.py --checkwhen AI-control files changed. - AI-touched files are additionally blocked through
.github/hooks/ai-edit-gate.json; rerunpython scripts/run_ai_edit_gate.py <touched paths...>only when debugging that hook locally. - Run
python -m pre_commit run --all-files, thensattlint-repo-audit --profile full --check-my-changes --output-dir artifacts/auditwhile iterating, and finish withsattlint-repo-audit --profile full --output-dir artifacts/auditbefore pushing.
Repository structure for maintainer work:
AGENTS.mdis the human-authored AI workflow contract..ai/is reserved for machine-authored AI artifacts and handoff data.docs/maintainers/holds human maintainer docs..github/workflows/should stay small: CI, nightly, and publish..vscode/should stay repo-wide and stable, not issue-specific.
Recommended branch names:
feature/<topic>fix/<topic>chore/<topic>
Recommended context workflow in VS Code:
@context-optimizer /audit
src/sattlint/- Main source codetests/- Test suitegrammar/- SattLine grammar filespyproject.toml- Project configuration and dependencies.editorconfig- Cross-editor formatting rules.vscode/settings.json- VS Code workspace configurationvscode/sattline-vscode/- Local VS Code extension client forsattlint_lspsrc/sattlint_lsp/- Python LSP server implementation used by the VS Code client
- Create a focused branch or worktree.
- Keep the slice small and run the first focused validation immediately.
- Run
python scripts/context_health.py --checkwhen AI-control files changed, thenpython -m pre_commit run --all-files, thensattlint-repo-audit --profile full --check-my-changes --output-dir artifacts/audit, and usesattlint-repo-audit --profile full --output-dir artifacts/auditbefore pushing. - Fill in the pull request template with commands run and remaining risks.
- Push and create the pull request.
Note: src/sattlint/docgenerator/configgen.py generates Excel configuration workbooks and now requires an explicit root directory argument instead of relying on a workstation-specific default path. It is not required for core SattLint functionality.
- Use
pathlib.Pathfor file operations - Avoid hard-coded paths in new code
- Keep
.vscode/settings.jsonplatform-neutral by pointing at the virtual environment root instead of OS-specific executables - Test changes on both platforms if possible