Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

refactor: simplify .github folder and fix CI workflows

KaifAhmad1bbad1b62f0b0
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000..5ff1618e
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,8 @@
+# Funding options for Semantica
+# Uncomment and add your usernames/links below
+
+# github: [username]
+# patreon: username
+# ko_fi: username
+# custom: ["https://your-funding-page.com"]
+
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index 7dc393d7..2b702ee7 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,12 +1,8 @@
-blank_issues_enabled: false
+blank_issues_enabled: true
contact_links:
- - name: GitHub Discussions
+ - name: πŸ“š Documentation
+ url: https://github.com/Hawksight-AI/semantica/tree/main/docs
+ about: Browse the documentation
+ - name: πŸ’¬ Discussions
url: https://github.com/Hawksight-AI/semantica/discussions
- about: Ask questions and discuss ideas with the community
- - name: Discord Community
- url: https://discord.gg/semantica
- about: Join our Discord server for real-time help and discussions
- - name: Security Issues
- url: https://github.com/Hawksight-AI/semantica/security/advisories/new
- about: Report security vulnerabilities privately
-
+ about: Ask questions and discuss with the community
diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md
new file mode 100644
index 00000000..f0bd77ef
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/documentation.md
@@ -0,0 +1,60 @@
+---
+name: Documentation Issue
+about: Report issues with documentation or suggest improvements
+title: '[DOCS] '
+labels: documentation
+assignees: ''
+---
+
+## Documentation Issue Type
+
+<!-- Mark the relevant option with an 'x' -->
+
+- [ ] Missing documentation
+- [ ] Incorrect/outdated documentation
+- [ ] Unclear documentation
+- [ ] Broken link
+- [ ] Code example not working
+- [ ] API reference incomplete
+- [ ] Tutorial improvement
+
+## Location
+
+**Documentation URL**: <!-- Link to the documentation page -->
+
+**Section/Page**: <!-- e.g., "Getting Started > Installation" -->
+
+## Issue Description
+
+<!-- Describe what's wrong or missing with the documentation -->
+
+## Current Documentation
+
+<!-- If applicable, quote or describe the current documentation -->
+
+```
+Current text here
+```
+
+## Suggested Improvement
+
+<!-- How should the documentation be improved? -->
+
+```
+Suggested text here
+```
+
+## Expected Information
+
+<!-- What information were you looking for? -->
+
+## Additional Context
+
+- Is this blocking your work? [Yes/No]
+- Related code/features:
+- Useful references or examples:
+
+## Contribution
+
+- [ ] I'm willing to submit a PR to fix this documentation issue
+
diff --git a/.github/ISSUE_TEMPLATE/documentation_issue.md b/.github/ISSUE_TEMPLATE/documentation_issue.md
deleted file mode 100644
index dcac72c3..00000000
--- a/.github/ISSUE_TEMPLATE/documentation_issue.md
+++ /dev/null
@@ -1,64 +0,0 @@
----
-name: Documentation Issue
-about: Report an issue or suggest improvements to documentation
-title: '[DOCS] '
-labels: documentation
-assignees: ''
----
-
-## Documentation Section
-
-Which section or page is affected?
-
-- [ ] Getting Started
-- [ ] API Reference
-- [ ] Concepts
-- [ ] Cookbook
-- [ ] Examples
-- [ ] Other: ___________
-
-**URL or File Path**: [e.g., docs/getting-started.md]
-
-## Current Content
-
-What is the current content or issue?
-
-```markdown
-Paste current content here
-```
-
-## Problem
-
-What is wrong or unclear about the current documentation?
-
-- [ ] Typo or grammar error
-- [ ] Outdated information
-- [ ] Missing information
-- [ ] Unclear explanation
-- [ ] Broken link
-- [ ] Code example doesn't work
-- [ ] Other: ___________
-
-## Proposed Changes
-
-What should the documentation say instead?
-
-```markdown
-Proposed content here
-```
-
-## Rationale
-
-Why is this change needed? How does it improve the documentation?
-
-## Additional Context
-
-- Screenshots (if applicable)
-- Related issues or PRs
-- Any other context
-
-## Contribution
-
-- [ ] I'm willing to submit a PR with the fix
-- [ ] I can help review the changes
-
diff --git a/.github/ISSUE_TEMPLATE/grant.md b/.github/ISSUE_TEMPLATE/grant.md
new file mode 100644
index 00000000..a9efdab8
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/grant.md
@@ -0,0 +1,49 @@
+---
+name: Grant or Partnership
+about: Propose grants, partnerships, or collaboration opportunities
+title: '[PARTNERSHIP] '
+labels: partnership
+assignees: ''
+---
+
+## Organization/Individual
+
+**Name**:
+**Website**:
+**Contact Email**:
+
+## Type of Proposal
+
+- [ ] Research Grant
+- [ ] Development Grant
+- [ ] Academic Partnership
+- [ ] Corporate Sponsorship
+- [ ] Open Source Grant
+- [ ] Other:
+
+## Proposal Summary
+
+<!-- Brief overview of the proposal -->
+
+## Objectives
+
+<!-- What goals would this partnership achieve? -->
+
+## Benefit to Semantica
+
+<!-- How would this benefit the Semantica project and community? -->
+
+## Timeline
+
+**Start Date**:
+**Duration**:
+**Key Milestones**:
+
+## Funding/Resources
+
+<!-- What resources, funding, or support are involved? -->
+
+## Additional Information
+
+<!-- Any other relevant details, documents, or links -->
+
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
deleted file mode 100644
index 53baaefc..00000000
--- a/.github/ISSUE_TEMPLATE/question.md
+++ /dev/null
@@ -1,63 +0,0 @@
----
-name: Question
-about: Ask a question about Semantica
-title: '[QUESTION] '
-labels: question
-assignees: ''
----
-
-## Question
-
-What is your question?
-
-## Context
-
-Provide context about your question:
-
-- What are you trying to accomplish?
-- What have you tried so far?
-- What specific aspect do you need help with?
-
-## Code Example
-
-If applicable, include code that demonstrates your question:
-
-```python
-from semantica import Semantica
-
-# Your code here
-```
-
-## Environment
-
-- **OS**: [e.g., Windows 10, Ubuntu 22.04, macOS 13.0]
-- **Python Version**: [e.g., 3.9.7]
-- **Semantica Version**: [e.g., 0.0.1]
-
-## What You've Tried
-
-- [ ] Checked the documentation
-- [ ] Searched GitHub issues
-- [ ] Searched GitHub discussions
-- [ ] Checked the cookbook examples
-- [ ] Tried debugging on my own
-
-## Additional Information
-
-Any other information that might be helpful:
-
-- Error messages
-- Logs
-- Screenshots
-- Related issues or discussions
-
-## Expected Response
-
-What kind of help are you looking for?
-
-- [ ] Quick answer
-- [ ] Detailed explanation
-- [ ] Code example
-- [ ] Point to documentation
-- [ ] Other: ___________
-
diff --git a/.github/ISSUE_TEMPLATE/support.md b/.github/ISSUE_TEMPLATE/support.md
new file mode 100644
index 00000000..5c99718e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/support.md
@@ -0,0 +1,32 @@
+---
+name: Support Request
+about: Get help or support for using Semantica
+title: '[SUPPORT] '
+labels: support
+assignees: ''
+---
+
+## What do you need help with?
+
+<!-- Briefly describe what you need support for -->
+
+## Your Setup
+
+- **Semantica Version**:
+- **Python Version**:
+- **OS**:
+
+## What you're trying to do
+
+<!-- Describe your goal -->
+
+## Code Example (if applicable)
+
+```python
+# Your code here
+```
+
+## What's not working
+
+<!-- Describe the issue you're facing -->
+
diff --git a/.github/README.md b/.github/README.md
new file mode 100644
index 00000000..5a244261
--- /dev/null
+++ b/.github/README.md
@@ -0,0 +1,40 @@
+# GitHub Configuration for Semantica
+
+## πŸ“‹ Issue Templates
+
+- **[Bug Report](ISSUE_TEMPLATE/bug_report.md)** - Report bugs
+- **[Feature Request](ISSUE_TEMPLATE/feature_request.md)** - Suggest features
+- **[Documentation](ISSUE_TEMPLATE/documentation.md)** - Report docs issues
+- **[Support](ISSUE_TEMPLATE/support.md)** - Get help
+- **[Grant/Partnership](ISSUE_TEMPLATE/grant.md)** - Propose partnerships or funding
+
+## πŸ”„ Workflows
+
+- **[ci.yml](workflows/ci.yml)** - Build validation (runs on push/PR)
+- **[release.yml](workflows/release.yml)** - Release to GitHub & PyPI (runs on version tags)
+- **[security.yml](workflows/security.yml)** - Weekly dependency scan
+- **[docs.yml](workflows/docs.yml)** - Deploy docs to GitHub Pages
+
+## 🀝 Community
+
+- **[FUNDING.yml](FUNDING.yml)** - Sponsorship options
+- **[SUPPORT.md](SUPPORT.md)** - How to get support
+- **[Pull Request Template](pull_request_template.md)** - PR guidelines
+
+## πŸš€ Releasing a New Version
+
+```bash
+# Update version in pyproject.toml and CHANGELOG.md
+git tag v0.0.3
+git push origin v0.0.3
+# GitHub Actions automatically creates release and publishes to PyPI
+```
+
+**Setup Required (one-time):**
+- GitHub: Create environment named `pypi`
+- PyPI: Add trusted publisher for `Hawksight-AI/semantica` with workflow `release.yml`
+
+## πŸ“š Resources
+
+- [GitHub Actions Docs](https://docs.github.com/en/actions)
+- [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/)
diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md
new file mode 100644
index 00000000..d9645f0b
--- /dev/null
+++ b/.github/SUPPORT.md
@@ -0,0 +1,43 @@
+# Support for Semantica
+
+## Getting Help
+
+### πŸ“š Documentation
+Check the [docs folder](https://github.com/Hawksight-AI/semantica/tree/main/docs) and [README](https://github.com/Hawksight-AI/semantica/blob/main/README.md) for guides and examples.
+
+### πŸ’¬ Community Support
+- **GitHub Discussions**: [Ask questions](https://github.com/Hawksight-AI/semantica/discussions)
+- **Discord**: Join our [Discord server](https://discord.gg/semantica) for real-time chat
+
+### πŸ› Bug Reports
+Found a bug? [Create an issue](https://github.com/Hawksight-AI/semantica/issues/new/choose)
+
+### πŸ“– Resources
+- [Quick Start Guide](https://github.com/Hawksight-AI/semantica/blob/main/docs/quickstart.md)
+- [FAQ](https://github.com/Hawksight-AI/semantica/blob/main/docs/faq.md)
+- [Cookbook Examples](https://github.com/Hawksight-AI/semantica/tree/main/cookbook)
+
+## Commercial Support
+
+For enterprise support, custom development, or consulting services:
+- Include "Commercial Support" in the subject line
+
+## Sponsorship
+
+Support Semantica development:
+- [GitHub Sponsors](https://github.com/sponsors/Hawksight-AI)
+
+Your sponsorship helps us:
+- Maintain and improve the framework
+- Add new features and integrations
+- Provide better documentation
+- Support the community
+
+## Response Times
+
+- **Community Support**: Best effort by community members
+- **Bug Reports**: Reviewed within 7 days
+- **Security Issues**: Reviewed within 48 hours
+- **Sponsored Support**: Priority response (24-48 hours)
+
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 9006c0dc..40c88106 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,120 +1,76 @@
## Description
-<!-- Provide a brief description of your changes -->
+<!-- Provide a clear description of your changes -->
## Type of Change
-<!-- Mark the relevant option with an 'x' -->
-
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
-- [ ] Code refactoring
- [ ] Performance improvement
-- [ ] Test addition or update
-- [ ] Other (please describe): ___________
+- [ ] Code refactoring
## Related Issues
<!-- Link related issues using keywords like "Closes", "Fixes", "Resolves" -->
Closes #
-Related to #
Fixes #
## Changes Made
<!-- List the main changes in this PR -->
-- Change 1
-- Change 2
-- Change 3
+-
+-
+-
## Testing
-<!-- Describe the tests you ran and how to verify your changes -->
+<!-- Describe how you tested your changes -->
-- [ ] Tests pass locally
-- [ ] Added new tests for new functionality
-- [ ] Updated existing tests
-- [ ] All tests pass (`pytest`)
-- [ ] Code coverage maintained or improved
+- [ ] Tested locally
+- [ ] Added tests for new functionality
+- [ ] Package builds successfully (`python -m build`)
-### Test Results
+### Test Commands
-```
-Paste test output or command here
+```bash
+# Build the package
+pip install build
+python -m build
+
+# Optional: Run your own tests
+pytest tests/
+
+# Optional: Format code
+black semantica/
+isort semantica/
```
## Documentation
-<!-- Checklist for documentation updates -->
-
- [ ] Updated relevant documentation
- [ ] Added code examples if applicable
- [ ] Updated API reference if adding new APIs
- [ ] Updated cookbook if adding new examples
- [ ] No documentation changes needed
-## Code Quality
-
-<!-- Checklist for code quality -->
-
-- [ ] Code follows style guidelines (black, isort, flake8)
-- [ ] Type hints added for new functions
-- [ ] Docstrings added/updated
-- [ ] No new warnings or errors
-- [ ] Self-review completed
-
-### Code Quality Checks
-
-```bash
-# Run these commands and ensure they pass
-black semantica/ tests/
-isort semantica/ tests/
-flake8 semantica/ tests/
-mypy semantica/
-pytest
-```
-
## Breaking Changes
-<!-- If this is a breaking change, describe the impact and migration path -->
-
**Breaking Changes**: [Yes/No]
-If yes, describe:
-- What breaks
-- Why it's necessary
-- How to migrate
-
-## Screenshots / Examples
-
-<!-- If applicable, add screenshots or code examples -->
-
-```python
-# Example usage of new feature
-```
+<!-- If yes, describe the impact and migration path -->
## Checklist
-<!-- Mark completed items with an 'x' -->
-
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
-- [ ] I have made corresponding changes to the documentation
- [ ] 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
+- [ ] Package builds successfully
## Additional Notes
-<!-- Any additional information, context, or notes for reviewers -->
-
-## Reviewer Notes
-
-<!-- Any specific areas you'd like reviewers to focus on -->
-
+<!-- Any additional information for reviewers -->
diff --git a/.github/scripts/README.md b/.github/scripts/README.md
deleted file mode 100644
index 2779a2af..00000000
--- a/.github/scripts/README.md
+++ /dev/null
@@ -1,137 +0,0 @@
-# Development Scripts
-
-Helper scripts for development, testing, and code quality checks.
-
-## Available Scripts
-
-### Setup Scripts
-
-#### `setup-dev.sh` / `setup-dev.ps1`
-Sets up the development environment.
-
-**Bash (Linux/macOS):**
-```bash
-bash .github/scripts/setup-dev.sh
-```
-
-**PowerShell (Windows):**
-```powershell
-.github\scripts\setup-dev.ps1
-```
-
-**What it does:**
-- Checks Python version
-- Creates virtual environment if needed
-- Installs package with dev dependencies
-- Sets up pre-commit hooks
-- Verifies installation
-
-### Code Quality Scripts
-
-#### `check-code.sh` / `check-code.ps1`
-Runs all code quality checks (formatting, linting, type checking).
-
-**Bash:**
-```bash
-bash .github/scripts/check-code.sh
-```
-
-**PowerShell:**
-```powershell
-.github\scripts\check-code.ps1
-```
-
-**What it checks:**
-- Code formatting (black)
-- Import sorting (isort)
-- Linting (flake8)
-- Type checking (mypy - non-blocking)
-
-#### `format-code.sh` / `format-code.ps1`
-Automatically formats code and sorts imports.
-
-**Bash:**
-```bash
-bash .github/scripts/format-code.sh
-```
-
-**PowerShell:**
-```powershell
-.github\scripts\format-code.ps1
-```
-
-**What it does:**
-- Formats code with black
-- Sorts imports with isort
-
-### Testing Scripts
-
-#### `run-tests.sh` / `run-tests.ps1`
-Runs tests with coverage reporting.
-
-**Bash:**
-```bash
-bash .github/scripts/run-tests.sh
-```
-
-**PowerShell:**
-```powershell
-.github\scripts\run-tests.ps1
-```
-
-**What it does:**
-- Runs pytest with coverage
-- Generates HTML and terminal coverage reports
-- Coverage report: `htmlcov/index.html`
-
-## Quick Start
-
-1. **Setup development environment:**
- ```bash
- # Linux/macOS
- bash .github/scripts/setup-dev.sh
-
- # Windows
- .github\scripts\setup-dev.ps1
- ```
-
-2. **Before committing, run checks:**
- ```bash
- # Linux/macOS
- bash .github/scripts/check-code.sh
-
- # Windows
- .github\scripts\check-code.ps1
- ```
-
-3. **If checks fail, format code:**
- ```bash
- # Linux/macOS
- bash .github/scripts/format-code.sh
-
- # Windows
- .github\scripts\format-code.ps1
- ```
-
-4. **Run tests:**
- ```bash
- # Linux/macOS
- bash .github/scripts/run-tests.sh
-
- # Windows
- .github\scripts\run-tests.ps1
- ```
-
-## Requirements
-
-- Python 3.10+
-- Virtual environment (created by setup script)
-- Dev dependencies installed (`pip install -e ".[dev]"`)
-
-## Notes
-
-- All scripts automatically activate the virtual environment if it exists
-- Scripts check for required directories before running
-- Error messages provide helpful guidance
-- Type checking (mypy) is non-blocking and won't fail the check
-
diff --git a/.github/scripts/check-code.ps1 b/.github/scripts/check-code.ps1
deleted file mode 100644
index b9811bfc..00000000
--- a/.github/scripts/check-code.ps1
+++ /dev/null
@@ -1,63 +0,0 @@
-# Code quality check script (PowerShell)
-# Runs formatting, import sorting, linting, and type checking
-
-$ErrorActionPreference = "Stop"
-
-Write-Host "πŸ” Running code quality checks..." -ForegroundColor Cyan
-
-# Activate virtual environment if it exists
-if (Test-Path "venv") {
- & .\venv\Scripts\Activate.ps1
-}
-
-# Check if directories exist
-if (-not (Test-Path "semantica")) {
- Write-Host "❌ semantica/ directory not found" -ForegroundColor Red
- exit 1
-}
-
-# Check formatting
-Write-Host "πŸ“ Checking code formatting (black)..." -ForegroundColor Yellow
-try {
- black --check semantica/ 2>&1 | Out-Null
- Write-Host "βœ… Black check passed" -ForegroundColor Green
-} catch {
- Write-Host "❌ Code formatting issues found" -ForegroundColor Red
- Write-Host " Run: black semantica/" -ForegroundColor Yellow
- exit 1
-}
-
-# Check import sorting
-Write-Host "πŸ“¦ Checking import sorting (isort)..." -ForegroundColor Yellow
-try {
- isort --check-only semantica/ 2>&1 | Out-Null
- Write-Host "βœ… isort check passed" -ForegroundColor Green
-} catch {
- Write-Host "❌ Import sorting issues found" -ForegroundColor Red
- Write-Host " Run: isort semantica/" -ForegroundColor Yellow
- exit 1
-}
-
-# Lint with flake8
-Write-Host "πŸ”Ž Linting with flake8..." -ForegroundColor Yellow
-try {
- flake8 semantica/
- Write-Host "βœ… flake8 check passed" -ForegroundColor Green
-} catch {
- Write-Host "❌ Linting issues found" -ForegroundColor Red
- exit 1
-}
-
-# Type check with mypy
-Write-Host "πŸ”¬ Type checking with mypy..." -ForegroundColor Yellow
-try {
- mypy semantica/
- Write-Host "βœ… mypy check passed" -ForegroundColor Green
-} catch {
- Write-Host "❌ Type checking issues found" -ForegroundColor Red
- exit 1
-}
-
-Write-Host ""
-Write-Host "βœ… All code quality checks passed!" -ForegroundColor Green
-
diff --git a/.github/scripts/check-code.sh b/.github/scripts/check-code.sh
deleted file mode 100644
index 48c016d3..00000000
--- a/.github/scripts/check-code.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/bash
-# Code quality check script
-# Runs formatting, import sorting, linting, and type checking
-
-set -e
-
-echo "πŸ” Running code quality checks..."
-
-# Activate virtual environment if it exists
-if [ -d "venv" ]; then
- source venv/bin/activate
-fi
-
-# Check if directories exist
-if [ ! -d "semantica" ]; then
- echo "❌ semantica/ directory not found"
- exit 1
-fi
-
-# Check formatting
-echo "πŸ“ Checking code formatting (black)..."
-if black --check semantica/ 2>/dev/null; then
- echo "βœ… Black check passed"
-else
- echo "❌ Code formatting issues found"
- echo " Run: black semantica/"
- exit 1
-fi
-
-# Check import sorting
-echo "πŸ“¦ Checking import sorting (isort)..."
-if isort --check-only semantica/ 2>/dev/null; then
- echo "βœ… isort check passed"
-else
- echo "❌ Import sorting issues found"
- echo " Run: isort semantica/"
- exit 1
-fi
-
-# Lint with flake8
-echo "πŸ”Ž Linting with flake8..."
-if flake8 semantica/; then
- echo "βœ… flake8 check passed"
-else
- echo "❌ Linting issues found"
- exit 1
-fi
-
-# Type check with mypy
-echo "πŸ”¬ Type checking with mypy..."
-if mypy semantica/; then
- echo "βœ… mypy check passed"
-else
- echo "❌ Type checking issues found"
- exit 1
-fi
-
-echo ""
-echo "βœ… All code quality checks passed!"
-
diff --git a/.github/scripts/format-code.ps1 b/.github/scripts/format-code.ps1
deleted file mode 100644
index 470b617d..00000000
--- a/.github/scripts/format-code.ps1
+++ /dev/null
@@ -1,31 +0,0 @@
-# Code formatting script (PowerShell)
-# Formats code with black and sorts imports with isort
-
-$ErrorActionPreference = "Stop"
-
-Write-Host "🎨 Formatting code..." -ForegroundColor Cyan
-
-# Activate virtual environment if it exists
-if (Test-Path "venv") {
- & .\venv\Scripts\Activate.ps1
-}
-
-# Check if directories exist
-if (-not (Test-Path "semantica")) {
- Write-Host "❌ semantica/ directory not found" -ForegroundColor Red
- exit 1
-}
-
-# Format with black
-Write-Host "πŸ“ Formatting with black..." -ForegroundColor Yellow
-black semantica/
-Write-Host "βœ… Black formatting complete" -ForegroundColor Green
-
-# Sort imports with isort
-Write-Host "πŸ“¦ Sorting imports with isort..." -ForegroundColor Yellow
-isort semantica/
-Write-Host "βœ… Import sorting complete" -ForegroundColor Green
-
-Write-Host ""
-Write-Host "βœ… Code formatting complete!" -ForegroundColor Green
-
diff --git a/.github/scripts/format-code.sh b/.github/scripts/format-code.sh
deleted file mode 100644
index 22ab6918..00000000
--- a/.github/scripts/format-code.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-# Code formatting script
-# Formats code with black and sorts imports with isort
-
-set -e
-
-echo "🎨 Formatting code..."
-
-# Activate virtual environment if it exists
-if [ -d "venv" ]; then
- source venv/bin/activate
-fi
-
-# Check if directories exist
-if [ ! -d "semantica" ]; then
- echo "❌ semantica/ directory not found"
- exit 1
-fi
-
-# Format with black
-echo "πŸ“ Formatting with black..."
-black semantica/
-echo "βœ… Black formatting complete"
-
-# Sort imports with isort
-echo "πŸ“¦ Sorting imports with isort..."
-isort semantica/
-echo "βœ… Import sorting complete"
-
-echo ""
-echo "βœ… Code formatting complete!"
-
diff --git a/.github/scripts/run-tests.ps1 b/.github/scripts/run-tests.ps1
deleted file mode 100644
index 974f125b..00000000
--- a/.github/scripts/run-tests.ps1
+++ /dev/null
@@ -1,41 +0,0 @@
-# Test runner script (PowerShell)
-# Runs tests with coverage reporting
-
-$ErrorActionPreference = "Stop"
-
-Write-Host "πŸ§ͺ Running tests..." -ForegroundColor Cyan
-
-# Activate virtual environment if it exists
-if (Test-Path "venv") {
- & .\venv\Scripts\Activate.ps1
-}
-
-# Check if tests directory exists
-if (-not (Test-Path "tests")) {
- Write-Host "⚠️ No tests directory found" -ForegroundColor Yellow
- Write-Host " Create tests/ directory and add test files" -ForegroundColor Yellow
- exit 0
-}
-
-# Check if test files exist
-$testFiles = Get-ChildItem -Path tests -Recurse -Include "test_*.py", "*_test.py" -ErrorAction SilentlyContinue
-if (-not $testFiles) {
- Write-Host "⚠️ No test files found" -ForegroundColor Yellow
- Write-Host " Add test files to tests/ directory" -ForegroundColor Yellow
- exit 0
-}
-
-# Run tests with coverage
-Write-Host "πŸ“Š Running pytest with coverage..." -ForegroundColor Yellow
-pytest `
- --cov=semantica `
- --cov-report=html `
- --cov-report=term-missing `
- --cov-report=xml `
- -v `
- tests/
-
-Write-Host ""
-Write-Host "βœ… Tests complete!" -ForegroundColor Green
-Write-Host "πŸ“Š Coverage report: htmlcov/index.html" -ForegroundColor Cyan
-
diff --git a/.github/scripts/run-tests.sh b/.github/scripts/run-tests.sh
deleted file mode 100644
index c9dcdcc0..00000000
--- a/.github/scripts/run-tests.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-# Test runner script
-# Runs tests with coverage reporting
-
-set -e
-
-echo "πŸ§ͺ Running tests..."
-
-# Activate virtual environment if it exists
-if [ -d "venv" ]; then
- source venv/bin/activate
-fi
-
-# Check if tests directory exists
-if [ ! -d "tests" ]; then
- echo "⚠️ No tests directory found"
- echo " Create tests/ directory and add test files"
- exit 0
-fi
-
-# Check if test files exist
-if [ -z "$(find tests -name 'test_*.py' -o -name '*_test.py' 2>/dev/null)" ]; then
- echo "⚠️ No test files found"
- echo " Add test files to tests/ directory"
- exit 0
-fi
-
-# Run tests with coverage
-echo "πŸ“Š Running pytest with coverage..."
-pytest \
- --cov=semantica \
- --cov-report=html \
- --cov-report=term-missing \
- --cov-report=xml \
- -v \
- tests/
-
-echo ""
-echo "βœ… Tests complete!"
-echo "πŸ“Š Coverage report: htmlcov/index.html"
-
diff --git a/.github/scripts/setup-dev.ps1 b/.github/scripts/setup-dev.ps1
deleted file mode 100644
index bb1f8293..00000000
--- a/.github/scripts/setup-dev.ps1
+++ /dev/null
@@ -1,68 +0,0 @@
-# Development environment setup script (PowerShell)
-# Sets up Python virtual environment and installs dependencies
-
-$ErrorActionPreference = "Stop"
-
-Write-Host "πŸš€ Setting up development environment..." -ForegroundColor Cyan
-
-# Check Python version
-try {
- $pythonVersion = python --version 2>&1
- Write-Host "πŸ“¦ $pythonVersion" -ForegroundColor Green
-} catch {
- Write-Host "❌ Python not found. Please install Python 3.10 or higher" -ForegroundColor Red
- exit 1
-}
-
-# Create virtual environment if it doesn't exist
-if (-not (Test-Path "venv")) {
- Write-Host "πŸ“¦ Creating virtual environment..." -ForegroundColor Yellow
- python -m venv venv
-} else {
- Write-Host "βœ… Virtual environment already exists" -ForegroundColor Green
-}
-
-# Activate virtual environment
-Write-Host "πŸ”Œ Activating virtual environment..." -ForegroundColor Yellow
-& .\venv\Scripts\Activate.ps1
-
-# Upgrade pip
-Write-Host "⬆️ Upgrading pip..." -ForegroundColor Yellow
-python -m pip install --upgrade pip
-
-# Install project in editable mode with dev dependencies
-Write-Host "πŸ“₯ Installing package with dev dependencies..." -ForegroundColor Yellow
-pip install -e ".[dev]"
-
-# Install pre-commit hooks if available
-try {
- $precommit = Get-Command pre-commit -ErrorAction SilentlyContinue
- if ($precommit) {
- Write-Host "πŸͺ Installing pre-commit hooks..." -ForegroundColor Yellow
- pre-commit install
- } else {
- Write-Host "⚠️ pre-commit not found, skipping hooks installation" -ForegroundColor Yellow
- }
-} catch {
- Write-Host "⚠️ Pre-commit installation skipped" -ForegroundColor Yellow
-}
-
-# Verify installation
-Write-Host "βœ… Verifying installation..." -ForegroundColor Yellow
-try {
- python -c "import semantica; print(f'Semantica version: {semantica.__version__}')"
- Write-Host "βœ… Installation verified" -ForegroundColor Green
-} catch {
- Write-Host "❌ Installation verification failed" -ForegroundColor Red
- exit 1
-}
-
-Write-Host ""
-Write-Host "✨ Development environment setup complete!" -ForegroundColor Green
-Write-Host ""
-Write-Host "Next steps:" -ForegroundColor Cyan
-Write-Host " .\venv\Scripts\Activate.ps1 # Activate virtual environment" -ForegroundColor White
-Write-Host " pytest # Run tests" -ForegroundColor White
-Write-Host " black semantica/ # Format code" -ForegroundColor White
-Write-Host " .github\scripts\check-code.ps1 # Run all checks" -ForegroundColor White
-
diff --git a/.github/scripts/setup-dev.sh b/.github/scripts/setup-dev.sh
deleted file mode 100644
index f13e3bda..00000000
--- a/.github/scripts/setup-dev.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-# Development environment setup script
-# Sets up Python virtual environment and installs dependencies
-
-set -e
-
-echo "πŸš€ Setting up development environment..."
-
-# Check Python version
-if ! command -v python3 &> /dev/null; then
- echo "❌ Python 3 not found. Please install Python 3.10 or higher"
- exit 1
-fi
-
-python_version=$(python3 --version 2>&1 | awk '{print $2}')
-echo "πŸ“¦ Python version: $python_version"
-
-# Create virtual environment if it doesn't exist
-if [ ! -d "venv" ]; then
- echo "πŸ“¦ Creating virtual environment..."
- python3 -m venv venv
-else
- echo "βœ… Virtual environment already exists"
-fi
-
-# Activate virtual environment
-echo "πŸ”Œ Activating virtual environment..."
-source venv/bin/activate
-
-# Upgrade pip
-echo "⬆️ Upgrading pip..."
-python -m pip install --upgrade pip
-
-# Install project in editable mode with dev dependencies
-echo "πŸ“₯ Installing package with dev dependencies..."
-pip install -e ".[dev]"
-
-# Install pre-commit hooks if available
-if command -v pre-commit &> /dev/null; then
- echo "πŸͺ Installing pre-commit hooks..."
- pre-commit install || echo "⚠️ Pre-commit installation skipped"
-else
- echo "⚠️ pre-commit not found, skipping hooks installation"
-fi
-
-# Verify installation
-echo "βœ… Verifying installation..."
-if python -c "import semantica; print(f'Semantica version: {semantica.__version__}')" 2>/dev/null; then
- echo "βœ… Installation verified"
-else
- echo "❌ Installation verification failed"
- exit 1
-fi
-
-echo ""
-echo "✨ Development environment setup complete!"
-echo ""
-echo "Next steps:"
-echo " source venv/bin/activate # Activate virtual environment"
-echo " pytest # Run tests"
-echo " black semantica/ # Format code"
-echo " .github/scripts/check-code.sh # Run all checks"
-
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index adcac1a0..e6e712c5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,75 +1,18 @@
name: CI
-# Runs tests across multiple Python versions and performs code quality checks
-# Includes test coverage reporting and linting with flake8 and mypy
-
on:
push:
- branches: [main, develop]
+ branches: [main]
pull_request:
- branches: [main, develop]
-
-permissions:
- contents: read
+ branches: [main]
jobs:
- test:
+ build:
runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.10', '3.11', '3.12']
-
steps:
- uses: actions/checkout@v4
-
- - name: Free Disk Space
- uses: jlumbroso/free-disk-space@main
- with:
- tool-cache: false
- android: true
- dotnet: true
- haskell: true
- large-packages: true
- docker-images: true
- swap-storage: true
-
- - uses: actions/setup-python@v5
- with:
- python-version: ${{ matrix.python-version }}
-
- - run: |
- pip install -e ".[dev]"
-
- - run: pytest --cov=semantica --cov-report=xml --cov-report=term-missing -v
-
- - name: Upload coverage
- if: matrix.python-version == '3.11'
- uses: codecov/codecov-action@v3
- with:
- file: ./coverage.xml
-
- lint:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Free Disk Space
- uses: jlumbroso/free-disk-space@main
- with:
- tool-cache: false
- android: true
- dotnet: true
- haskell: true
- large-packages: true
- docker-images: true
- swap-storage: true
-
- uses: actions/setup-python@v5
with:
python-version: '3.11'
-
- - run: pip install -e ".[dev]"
-
- - run: flake8 semantica/
- - run: mypy semantica/
+ - run: pip install build
+ - run: python -m build
diff --git a/.github/workflows/label-issues.yml b/.github/workflows/label-issues.yml
deleted file mode 100644
index 684acc57..00000000
--- a/.github/workflows/label-issues.yml
+++ /dev/null
@@ -1,107 +0,0 @@
-name: Auto-label Issues
-
-# This workflow automatically labels new issues based on their content
-# It also provides help resources if the user asks for help
-
-on:
- issues:
- types: [opened]
- issue_comment:
- types: [created]
-
-# Permissions needed to add labels and comments
-permissions:
- contents: read
- issues: write
- pull-requests: read
-
-jobs:
- label:
- name: Auto-label Issues
- runs-on: ubuntu-latest
- if: github.event.action == 'opened'
- steps:
- - name: Add labels based on content
- # Uses a script to check title/body for keywords like "bug", "feature", etc.
- uses: actions/github-script@v7
- with:
- script: |
- const issue = context.payload.issue;
- const title = issue.title.toLowerCase();
- const body = (issue.body || '').toLowerCase();
- const text = title + ' ' + body;
-
- const labels = [];
-
- // Bug detection
- if ((text.match(/\b(bug|crash|broken|fails|doesn't work|not working)\b/) &&
- text.match(/\b(error|exception|traceback|problem)\b/)) ||
- title.startsWith('bug:') || title.startsWith('[bug]')) {
- labels.push('bug');
- }
-
- // Feature request
- else if (text.match(/\b(feature request|enhancement request|proposal)\b/) ||
- title.startsWith('feature:') || title.startsWith('[feature]') ||
- title.startsWith('enhancement:') || title.startsWith('[enhancement]')) {
- labels.push('enhancement');
- }
-
- // Documentation
- else if (text.match(/\b(documentation issue|doc fix|docs update)\b/) ||
- title.startsWith('docs:') || title.startsWith('[docs]')) {
- labels.push('documentation');
- }
-
- // Security
- else if (text.match(/\b(security issue|vulnerability|security bug)\b/) ||
- title.startsWith('security:') || title.startsWith('[security]')) {
- labels.push('security');
- }
-
- // Needs triage for incomplete issues
- if (labels.length === 0 && (body.length < 50 || !body.includes('\n'))) {
- labels.push('needs-triage');
- }
-
- // Add labels if found
- if (labels.length > 0) {
- await github.rest.issues.addLabels({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: issue.number,
- labels: labels
- });
- }
-
- help:
- name: Provide Help Resources
- runs-on: ubuntu-latest
- # Runs if the issue contains "/help"
- if: |
- github.event.action == 'opened' &&
- (contains(github.event.issue.body, '/help') || contains(github.event.issue.title, '/help'))
- steps:
- - name: Post help resources
- uses: actions/github-script@v7
- with:
- script: |
- const response = `πŸ“š **Help Resources**
-
-Here are some helpful resources:
-
-- [Getting Started](https://github.com/${{ github.repository }}/blob/main/docs/getting-started.md)
-- [FAQ](https://github.com/${{ github.repository }}/blob/main/docs/faq.md)
-- [Documentation](https://github.com/${{ github.repository }}/tree/main/docs)
-- [GitHub Discussions](https://github.com/${{ github.repository }}/discussions) - Ask questions here
-- [Discord](https://discord.gg/semantica) - Real-time chat
-
-πŸ’‘ **Tip**: For questions, consider using [GitHub Discussions](https://github.com/${{ github.repository }}/discussions) instead of issues.`;
-
- await github.rest.issues.createComment({
- issue_number: context.payload.issue.number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- body: response
- });
-
diff --git a/.github/workflows/mark-answered.yml b/.github/workflows/mark-answered.yml
deleted file mode 100644
index 072a4ace..00000000
--- a/.github/workflows/mark-answered.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-name: Mark Discussion as Answered
-
-# This workflow allows maintainers to mark a discussion comment as the answer
-# Usage: Comment "/answered" on the correct reply
-
-on:
- discussion_comment:
- types: [created]
-
-# Permissions needed to modify discussions
-permissions:
- contents: read
- discussions: write
-
-jobs:
- mark-answered:
- name: Mark Discussion as Answered
- runs-on: ubuntu-latest
- # Only runs if the comment contains "/answered" and is from a maintainer
- if: |
- github.event.action == 'created' &&
- contains(github.event.comment.body, '/answered') &&
- (github.event.comment.author_association == 'MEMBER' ||
- github.event.comment.author_association == 'OWNER' ||
- github.event.comment.author_association == 'COLLABORATOR')
- steps:
- - name: Mark discussion as answered
- uses: actions/github-script@v7
- with:
- script: |
- const discussion = context.payload.discussion;
- const commentId = context.payload.comment.id;
-
- try {
- // Mark the comment as the answer
- await github.rest.discussions.markAnswerComment({
- discussion_number: discussion.number,
- comment_number: commentId,
- owner: context.repo.owner,
- repo: context.repo.repo
- });
-
- // Mark the discussion as answered
- await github.rest.discussions.markAsAnswer({
- discussion_number: discussion.number,
- comment_number: commentId,
- owner: context.repo.owner,
- repo: context.repo.repo
- });
- } catch (error) {
- console.log('Could not mark as answered:', error.message);
- }
-
diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml
deleted file mode 100644
index 96c5841e..00000000
--- a/.github/workflows/pypi.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-name: Publish to PyPI
-
-# This workflow publishes the package to PyPI (Python Package Index)
-# It runs automatically after a GitHub Release is published
-
-on:
- release:
- types: [published]
- workflow_dispatch:
-
-jobs:
- publish:
- name: Publish to PyPI
- runs-on: ubuntu-latest
- environment:
- name: pypi
- url: https://pypi.org/project/semantica/${{ github.event.release.tag_name }}/
-
- # Permissions needed to authenticate with PyPI
- permissions:
- id-token: write
- contents: read
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: "3.11"
-
- - name: Install build tools
- run: |
- python -m pip install --upgrade pip
- pip install build twine
-
- - name: Build package
- # Builds the package again to ensure it's fresh
- run: python -m build
-
- - name: Publish to PyPI
- # Uses Trusted Publishing (OIDC) to upload to PyPI
- uses: pypa/gh-action-pypi-publish@release/v1
- with:
- packages-dir: dist/
- print-hash: true
-
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index c55cf4ce..4d56ef88 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,62 +1,25 @@
-name: Create Release
-
-# This workflow creates a GitHub Release when you push a version tag
-# Example tag: v1.0.0
+name: Release
on:
push:
- tags:
- - 'v*'
+ tags: ['v*']
-# Permissions needed to create a release
permissions:
contents: write
id-token: write
jobs:
release:
- name: Create Release
runs-on: ubuntu-latest
+ environment: pypi
steps:
- - name: Checkout code
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Set up Python
- uses: actions/setup-python@v5
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
with:
python-version: '3.11'
-
- - name: Install build tools
- run: |
- python -m pip install --upgrade pip
- pip install build twine
-
- - name: Extract version from tag
- id: tag
- run: |
- VERSION=${GITHUB_REF#refs/tags/v}
- echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- echo "Version: $VERSION"
-
- - name: Build package
- # Builds the Python package (wheel and source distribution)
- run: python -m build
-
- - name: Validate package
- # Checks if the package description is valid
- run: twine check dist/*
-
- - name: Create GitHub Release
- # Creates the release on GitHub and attaches the built files
- uses: softprops/action-gh-release@v1
+ - run: pip install build
+ - run: python -m build
+ - uses: softprops/action-gh-release@v1
with:
- tag_name: ${{ github.ref_name }}
- name: Release ${{ steps.tag.outputs.VERSION }}
- body_path: CHANGELOG.md
- draft: false
- prerelease: false
- generate_release_notes: true
files: dist/*
-
+ - uses: pypa/gh-action-pypi-publish@release/v1
diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml
index c962e98e..55a088a4 100644
--- a/.github/workflows/security.yml
+++ b/.github/workflows/security.yml
@@ -1,65 +1,18 @@
-name: Security Scan
-
-# Scans dependencies and code for security vulnerabilities
-# Runs on push, PR, weekly schedule, and manual trigger
+name: Security
on:
- push:
- branches: [main, develop]
- pull_request:
- branches: [main, develop]
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
-permissions:
- contents: read
- security-events: write
-
jobs:
- dependency-scan:
+ audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
- - name: Free Disk Space
- uses: jlumbroso/free-disk-space@main
- with:
- tool-cache: false
- android: true
- dotnet: true
- haskell: true
- large-packages: true
- docker-images: true
- swap-storage: true
-
- uses: actions/setup-python@v5
with:
python-version: '3.11'
-
- - run: |
- pip install safety pip-audit
- pip install -e ".[dev]"
-
+ - run: pip install pip-audit
- run: pip-audit
- - run: safety check
- continue-on-error: true
-
- code-scan:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - uses: aquasecurity/trivy-action@master
- with:
- scan-type: 'fs'
- scan-ref: '.'
- format: 'sarif'
- output: 'trivy-results.sarif'
- severity: 'CRITICAL,HIGH'
-
- - uses: github/codeql-action/upload-sarif@v3
- if: always() && hashFiles('trivy-results.sarif') != ''
- with:
- sarif_file: 'trivy-results.sarif'
continue-on-error: true