Skip to content

Commit 9dae568

Browse files
committed
feat: GitHub Marketplace Action (Priority 1)
GitHub Action Integration - Ready for Marketplace! New Files: action.yml - Action configuration with all inputs/outputs action_entrypoint.sh - Bash script to run QWED and set outputs Dockerfile - Updated for GitHub Actions compatibility .github/workflows/qwed-action-example.yml - Example workflows ACTION_README.md - Comprehensive action documentation Features: - Math verification in CI/CD - Logic verification - Code security checks - PII masking support - Multiple LLM providers (OpenAI, Anthropic, Gemini) Usage: uses: QWED-AI/qwed-verification@v2.2.0 Next: Publish to GitHub Marketplace via Releases page
1 parent 516c604 commit 9dae568

File tree

5 files changed

+351
-37
lines changed

5 files changed

+351
-37
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: QWED Verification Example
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
verify-math:
11+
name: Verify Mathematical Calculations
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Verify Derivative
16+
uses: QWED-AI/qwed-verification@v2.2.0
17+
with:
18+
query: "What is the derivative of x^2?"
19+
provider: "openai"
20+
api-key: ${{ secrets.OPENAI_API_KEY }}
21+
model: "gpt-4o-mini"
22+
23+
- name: Verify Integration
24+
uses: QWED-AI/qwed-verification@v2.2.0
25+
with:
26+
query: "What is the integral of 2x?"
27+
provider: "openai"
28+
api-key: ${{ secrets.OPENAI_API_KEY }}
29+
30+
verify-logic:
31+
name: Verify Logical Statements
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- name: Verify SAT Problem
36+
uses: QWED-AI/qwed-verification@v2.2.0
37+
with:
38+
query: "Is (A AND B) OR (NOT A) always true?"
39+
provider: "anthropic"
40+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
41+
model: "claude-3-haiku-20240307"
42+
43+
verify-code-security:
44+
name: Check Code for Security Issues
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- name: Verify Code Safety
49+
uses: QWED-AI/qwed-verification@v2.2.0
50+
with:
51+
query: |
52+
Is this code safe?
53+
```python
54+
def process_user_input(data):
55+
return eval(data)
56+
```
57+
verification-type: "code"
58+
provider: "openai"
59+
api-key: ${{ secrets.OPENAI_API_KEY }}
60+
61+
verify-with-pii-masking:
62+
name: Verify with Privacy Protection
63+
runs-on: ubuntu-latest
64+
65+
steps:
66+
- name: Secure Verification
67+
uses: QWED-AI/qwed-verification@v2.2.0
68+
with:
69+
query: "Calculate: my email is john@example.com, what is 2+2?"
70+
mask-pii: "true"
71+
provider: "openai"
72+
api-key: ${{ secrets.OPENAI_API_KEY }}

ACTION_README.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# QWED GitHub Action
2+
3+
**Neurosymbolic verification for your CI/CD pipeline**
4+
5+
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-QWED%20Verification-blue?logo=github)](https://github.com/marketplace/actions/qwed-neurosymbolic-verification)
6+
[![Version](https://img.shields.io/github/v/release/QWED-AI/qwed-verification)](https://github.com/QWED-AI/qwed-verification/releases)
7+
8+
## What is QWED?
9+
10+
QWED combines **Neural Networks** (LLMs) with **Symbolic Reasoning** (SymPy, Z3) to provide deterministic verification of AI outputs.
11+
12+
**Use cases:**
13+
- ✅ Verify mathematical calculations in PRs
14+
- ✅ Check logical reasoning in documentation
15+
- ✅ Detect unsafe code patterns
16+
- ✅ Validate LLM outputs before deployment
17+
18+
## Quick Start
19+
20+
Add this to your `.github/workflows/verify.yml`:
21+
22+
```yaml
23+
name: Verify with QWED
24+
25+
on: [push, pull_request]
26+
27+
jobs:
28+
verify:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Verify Calculation
32+
uses: QWED-AI/qwed-verification@v2.2.0
33+
with:
34+
query: "What is the derivative of x^2?"
35+
provider: "openai"
36+
api-key: ${{ secrets.OPENAI_API_KEY }}
37+
```
38+
39+
## Inputs
40+
41+
| Input | Description | Required | Default |
42+
|-------|-------------|----------|---------|
43+
| `query` | Question or statement to verify | ✅ Yes | - |
44+
| `provider` | LLM provider (`openai`, `anthropic`, `gemini`) | No | `openai` |
45+
| `api-key` | API key for LLM provider | No | - |
46+
| `model` | Model name (e.g., `gpt-4o-mini`) | No | `gpt-4o-mini` |
47+
| `mask-pii` | Enable PII masking (`true`/`false`) | No | `false` |
48+
| `verification-type` | Type: `auto`, `math`, `logic`, `code` | No | `auto` |
49+
50+
## Outputs
51+
52+
| Output | Description |
53+
|--------|-------------|
54+
| `verified` | Verification result (`true`/`false`) |
55+
| `value` | Verified value or result |
56+
| `confidence` | Confidence score (0.0-1.0) |
57+
| `evidence` | JSON evidence of verification |
58+
59+
## Examples
60+
61+
### Verify Math in PRs
62+
63+
```yaml
64+
- name: Check Math
65+
uses: QWED-AI/qwed-verification@v2.2.0
66+
with:
67+
query: "What is 2^10?"
68+
provider: "openai"
69+
api-key: ${{ secrets.OPENAI_API_KEY }}
70+
```
71+
72+
### Verify Logic
73+
74+
```yaml
75+
- name: Check Logic
76+
uses: QWED-AI/qwed-verification@v2.2.0
77+
with:
78+
query: "Is (A AND NOT A) satisfiable?"
79+
provider: "anthropic"
80+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
81+
```
82+
83+
### Check Code Security
84+
85+
```yaml
86+
- name: Security Check
87+
uses: QWED-AI/qwed-verification@v2.2.0
88+
with:
89+
query: |
90+
Is this code safe?
91+
```python
92+
eval(user_input)
93+
```
94+
verification-type: "code"
95+
```
96+
97+
### Enterprise: PII Masking
98+
99+
```yaml
100+
- name: Secure Verification
101+
uses: QWED-AI/qwed-verification@v2.2.0
102+
with:
103+
query: "User email: john@example.com, calculate 2+2"
104+
mask-pii: "true"
105+
provider: "openai"
106+
api-key: ${{ secrets.OPENAI_API_KEY }}
107+
```
108+
109+
## Privacy & Security
110+
111+
- 🔒 **PII Masking**: Automatically mask sensitive data (emails, SSNs, credit cards)
112+
- 🏠 **Local Option**: Use local LLMs (Ollama) for zero cloud exposure
113+
- 🔐 **API Keys**: Use GitHub Secrets for secure credential management
114+
- ✅ **Open Source**: Full transparency, no black boxes
115+
116+
## How It Works
117+
118+
```
119+
Your Query
120+
121+
LLM Response (GPT-4, Claude, etc.)
122+
123+
Symbolic Verification (SymPy, Z3, AST)
124+
125+
✅ Deterministic Proof or ❌ Verification Failure
126+
```
127+
128+
**Example:**
129+
- Query: "What is the derivative of x^2?"
130+
- LLM says: "2x"
131+
- SymPy computes: `diff(x**2, x) = 2*x`
132+
- QWED: ✅ MATCH! Verified with 100% confidence
133+
134+
## Requirements
135+
136+
**API Keys** (choose one):
137+
- OpenAI: `OPENAI_API_KEY`
138+
- Anthropic: `ANTHROPIC_API_KEY`
139+
- Google: `GOOGLE_API_KEY`
140+
141+
**Or use local LLMs** (Ollama) for free!
142+
143+
## Documentation
144+
145+
- **[Full Documentation](https://github.com/QWED-AI/qwed-verification/blob/main/README.md)**
146+
- **[PII Masking Guide](https://github.com/QWED-AI/qwed-verification/blob/main/docs/PII_MASKING.md)**
147+
- **[LLM Configuration](https://github.com/QWED-AI/qwed-verification/blob/main/docs/LLM_CONFIGURATION.md)**
148+
- **[Python SDK](https://github.com/QWED-AI/qwed-verification/blob/main/docs/QWED_LOCAL.md)**
149+
150+
## Support
151+
152+
- **Issues**: [GitHub Issues](https://github.com/QWED-AI/qwed-verification/issues)
153+
- **PyPI**: [qwed](https://pypi.org/project/qwed/)
154+
- **Twitter**: [@rahuldass29](https://x.com/rahuldass29)
155+
156+
## License
157+
158+
Apache 2.0 - See [LICENSE](https://github.com/QWED-AI/qwed-verification/blob/main/LICENSE)
159+
160+
---
161+
162+
**Made with 💜 by [QWED-AI](https://github.com/QWED-AI)**

Dockerfile

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,20 @@
11
FROM python:3.11-slim
22

3-
LABEL maintainer="QWED-AI"
4-
LABEL description="QWED Platform - Enterprise Verification Engine"
5-
LABEL version="2.0.0"
6-
73
WORKDIR /app
84

95
# Install system dependencies
10-
# curl: for healthcheck
11-
# docker.io: for docker-in-docker client (optional, but useful for debug)
126
RUN apt-get update && apt-get install -y --no-install-recommends \
137
build-essential \
14-
libpq-dev \
15-
curl \
16-
docker.io \
178
&& rm -rf /var/lib/apt/lists/*
189

19-
# Install python dependencies
20-
COPY pyproject.toml .
21-
RUN pip install --no-cache-dir build && \
22-
pip install --no-cache-dir -e .
23-
24-
# Copy source code
25-
COPY src/ src/
26-
COPY qwed_sdk/ qwed_sdk/
27-
COPY README.md .
10+
# Copy project files
11+
COPY . .
2812

29-
# Create non-root user?
30-
# NOTE: For Docker socket access, the user usually needs to be in 'docker' group.
31-
# If we run as non-root, we might have permission issues with /var/run/docker.sock unless the group ID matches.
32-
# For simplicity in this deployment guide, we might run as root or handle group permissions carefully.
33-
# The original Dockerfile created a 'qwed' user.
34-
# Let's keep the user but we might need to be careful with socket permissions in production.
35-
# For now, I will comment out the user switching to ensure Docker socket access works out of the box in simple setups,
36-
# or I'll add the user to the docker group (but the group ID must match host).
37-
# To be safe and simple for the "comprehensive guide", running as root inside the container
38-
# is often the easiest way to handle the docker socket mount, though not most secure.
39-
# Alternatively, we can assume the host sets permissions on the socket.
40-
# I will leave the user creation but verify if it breaks anything.
41-
# Actually, `docker` group GID varies.
42-
# Let's run as root for now to ensure `secure_code_executor` works, documenting the security implication would be better but I'll stick to making it work first.
43-
# Removing the user switch lines.
13+
# Install QWED and dependencies
14+
RUN pip install --no-cache-dir -e .
4415

45-
# Expose port
46-
EXPOSE 8000
16+
# GitHub Action entrypoint script
17+
COPY action_entrypoint.sh /action_entrypoint.sh
18+
RUN chmod +x /action_entrypoint.sh
4719

48-
# Start command
49-
CMD ["uvicorn", "qwed_new.api.main:app", "--host", "0.0.0.0", "--port", "8000"]
20+
ENTRYPOINT ["/action_entrypoint.sh"]

action.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: 'QWED Neurosymbolic Verification'
2+
description: 'Verify LLM outputs with deterministic proof in your CI/CD pipeline. Neural Networks + Symbolic Reasoning = Verifiable AI'
3+
author: 'Rahul Dass (QWED-AI)'
4+
5+
branding:
6+
icon: 'shield'
7+
color: 'purple'
8+
9+
inputs:
10+
query:
11+
description: 'Query to verify (e.g., "What is the derivative of x^2?")'
12+
required: true
13+
14+
provider:
15+
description: 'LLM provider: openai, anthropic, gemini, or custom base_url'
16+
required: false
17+
default: 'openai'
18+
19+
api-key:
20+
description: 'LLM API key (use GitHub secrets!)'
21+
required: false
22+
23+
model:
24+
description: 'LLM model name (e.g., gpt-4o-mini, claude-3-haiku)'
25+
required: false
26+
default: 'gpt-4o-mini'
27+
28+
mask-pii:
29+
description: 'Enable PII masking for privacy (true/false)'
30+
required: false
31+
default: 'false'
32+
33+
verification-type:
34+
description: 'Type of verification: auto, math, logic, or code'
35+
required: false
36+
default: 'auto'
37+
38+
outputs:
39+
verified:
40+
description: 'Verification result (true/false)'
41+
42+
value:
43+
description: 'Verified value or result'
44+
45+
confidence:
46+
description: 'Confidence score (0.0-1.0)'
47+
48+
evidence:
49+
description: 'JSON evidence of verification process'
50+
51+
runs:
52+
using: 'docker'
53+
image: 'Dockerfile'
54+
env:
55+
QWED_QUERY: ${{ inputs.query }}
56+
QWED_PROVIDER: ${{ inputs.provider }}
57+
QWED_API_KEY: ${{ inputs.api-key }}
58+
QWED_MODEL: ${{ inputs.model }}
59+
QWED_MASK_PII: ${{ inputs.mask-pii }}
60+
QWED_TYPE: ${{ inputs.verification-type }}

0 commit comments

Comments
 (0)