Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Please describe the tests that you ran to verify your changes.
* Python version:
* Clawra version:

## Risk and Compatibility

- Public API or behavior changed:
- Public documentation updated:
- Offline demo still works without external services:

## Checklist:

- [ ] My code follows the style guidelines of this project
Expand All @@ -28,4 +34,4 @@ Please describe the tests that you ran to verify your changes.
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] Any dependent changes have been merged and published in downstream modules
22 changes: 22 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Offline Benchmark

on:
workflow_dispatch:

jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install package
run: python -m pip install -e ".[dev]"
- name: Run benchmark
run: python examples/benchmark_offline.py | tee benchmark.json
- name: Upload benchmark result
uses: actions/upload-artifact@v4
with:
name: offline-benchmark
path: benchmark.json
29 changes: 17 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
lint:
name: Ruff Lint
name: Lint Public Entry Points
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -17,23 +17,29 @@ jobs:
with:
python-version: "3.10"
- name: Install ruff
run: pip install ruff
run: pip install -e ".[dev]"
- name: Run ruff
run: ruff check .
run: >-
ruff check examples/benchmark_offline.py
tests/test_import_surface.py
tests/test_offline_benchmark.py
tests/test_package_metadata.py

type-check:
name: Mypy Type Check
name: Compile Public Entry Points
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: pip install mypy types-PyYAML types-requests
- name: Run mypy
run: mypy src/
- name: Compile public entry points
run: >-
python -m py_compile examples/benchmark_offline.py
tests/test_import_surface.py
tests/test_offline_benchmark.py
tests/test_package_metadata.py

test:
name: Pytest
Expand All @@ -50,11 +56,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev,neo4j]
pip install -e ".[dev]"
- name: Test with pytest
env:
NEO4J_URI: bolt://localhost:7687
NEO4J_USER: neo4j
NEO4J_PASSWORD: password
SKIP_LLM: "true"
run: pytest tests/ --tb=short
- name: Run offline benchmark smoke test
run: python examples/benchmark_offline.py
20 changes: 10 additions & 10 deletions .github/workflows/ontology-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ jobs:
for file in ${{ steps.changed.outputs.changed }}; do
echo "Validating: $file"
python -c "
import rdflib
g = rdflib.Graph()
try:
g.parse('$file', format='turtle' if '$file'.endswith('.ttl') else 'xml')
print(f'✓ $file: Valid RDF syntax')
print(f' Triples: {len(g)}')
except Exception as e:
print(f'✗ $file: {e}')
exit(1)
"
import rdflib
g = rdflib.Graph()
try:
g.parse('$file', format='turtle' if '$file'.endswith('.ttl') else 'xml')
print(f'✓ $file: Valid RDF syntax')
print(f' Triples: {len(g)}')
except Exception as e:
print(f'✗ $file: {e}')
exit(1)
"
done

- name: Run Competency Questions Check
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,20 @@ jobs:
python-version: "3.12"

- name: Install build dependencies
run: pip install build
run: pip install build twine

- name: Build package
run: python -m build

- name: Validate distribution metadata
run: python -m twine check dist/*

- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: python-distributions
path: dist

- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
Expand All @@ -35,6 +44,11 @@ jobs:
needs: build
steps:
- uses: actions/checkout@v4
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: python-distributions
path: dist
- name: Create Release
uses: softprops/action-gh-release@v1
with:
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/test.yml

This file was deleted.

15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,18 @@ Every contribution matters — from bug reports to code changes. Thank you for h
- Issues labeled [help wanted](https://github.com/wu-xiaochen/clawra-engine/labels/help%20wanted)

**Questions?** Open a [discussion](https://github.com/wu-xiaochen/clawra-engine/discussions) or join our Discord.

## Release-Quality Checks

Before opening a pull request, also run:

```bash
ruff check .
python examples/benchmark_offline.py
```

The demo and benchmark must work without API keys, Neo4j, or network access.
Tests that require external services should be marked `integration` and
document their required environment.

For security-sensitive reports, see [SECURITY.md](SECURITY.md).
Loading
Loading