Skip to content
Merged
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
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.py]
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
77 changes: 77 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
area/docs:
- changed-files:
- any-glob-to-any-file:
- "**/*.md"
- "**/*.mdx"
- "docs/**"

area/frontend:
- changed-files:
- any-glob-to-any-file:
- "app/**"
- "components/**"
- "pages/**"
- "styles/**"
- "public/**"

area/backend:
- changed-files:
- any-glob-to-any-file:
- "app/**"
- "api/**"
- "server/**"
- "src/**"
- "main.py"

area/infra:
- changed-files:
- any-glob-to-any-file:
- "docker-compose*.yml"
- "**/Dockerfile*"
- "infra/**"
- "k8s/**"
- "helm/**"
- "**/*.tf"

area/sdk:
- changed-files:
- any-glob-to-any-file:
- "governs_ai/**"
- "src/**"
- "pyproject.toml"
- "package.json"
- "tsconfig.json"

area/security:
- changed-files:
- any-glob-to-any-file:
- "**/auth/**"
- "**/security/**"
- "manifest.json"
- "**/*policy*"
- "**/*permission*"

kind/ci:
- changed-files:
- any-glob-to-any-file:
- ".github/workflows/**"
- ".github/labeler.yml"

kind/tests:
- changed-files:
- any-glob-to-any-file:
- "tests/**"
- "**/*test*.py"
- "**/*.spec.ts"
- "**/*.test.ts"
- "**/*.test.tsx"

kind/deps:
- changed-files:
- any-glob-to-any-file:
- "package.json"
- "pnpm-lock.yaml"
- "requirements.txt"
- "requirements-dev.txt"
- "pyproject.toml"
- "poetry.lock"
19 changes: 19 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PR Labeler

on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- name: Label pull requests
uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing to GovernsAI Precheck

## Setup

```bash
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
```

## Development

```bash
uvicorn app.main:app --reload --host 0.0.0.0 --port 8080
```

## Validation

```bash
pytest
```

## Pull Request Checklist

- Add or update tests for policy behavior changes.
- Keep API responses backward compatible unless versioned.
- Document new environment variables and defaults.
8 changes: 4 additions & 4 deletions PROJECT_SPECS.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ GET /api/v1/health
{
"ok": true,
"service": "governsai-precheck",
"version": "0.0.1"
"version": "0.1.0"
}
```

Expand All @@ -170,7 +170,7 @@ GET /api/v1/ready
{
"ready": true,
"service": "governsai-precheck",
"version": "0.0.1",
"version": "0.1.0",
"checks": {
"presidio": {"status": "ok", "message": "..."},
"policy": {"status": "ok", "message": "..."},
Expand Down Expand Up @@ -284,7 +284,7 @@ GET /api/v1/health
{
"ok": true,
"service": "governsai-precheck",
"version": "0.0.1"
"version": "0.1.0"
}
```

Expand All @@ -300,7 +300,7 @@ GET /api/v1/ready
{
"ready": true,
"service": "governsai-precheck",
"version": "0.0.1",
"version": "0.1.0",
"checks": {
"presidio": {
"status": "ok",
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# GovernsAI Precheck

[![npm](https://img.shields.io/npm/v/%40governs-ai%2Fsdk?label=npm%20%40governs-ai%2Fsdk)](https://www.npmjs.com/package/@governs-ai/sdk)
[![PyPI](https://img.shields.io/pypi/v/governs-ai-sdk?label=PyPI%20governs-ai-sdk)](https://pypi.org/project/governs-ai-sdk/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

**Fully Open Source (MIT)** - PII detection and policy evaluation service for AI applications.

This service provides real-time policy evaluation and PII detection/redaction for AI tool usage. You can use it, modify it, and even offer it as a hosted service - no restrictions.
Expand Down Expand Up @@ -263,4 +267,4 @@ Precheck is the core of the GovernsAI ecosystem:
- **Browser Extension** - MIT
- **Platform Console** - ELv2 (source-available for self-hosting)

Learn more: [GovernsAI Licensing](https://docs.governsai.com/licensing)
Learn more: [GovernsAI Licensing](https://docs.governsai.com/licensing)
11 changes: 6 additions & 5 deletions app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import hashlib
import json
import secrets
import os
from datetime import datetime
from typing import List, Tuple, Optional

Expand Down Expand Up @@ -110,7 +111,7 @@ async def health():
return {
"ok": True,
"service": "governsai-precheck",
"version": "0.0.1"
"version": "0.1.0"
}

@router.get("/v1/ready")
Expand Down Expand Up @@ -190,7 +191,7 @@ async def ready():
return {
"ready": overall_ready,
"service": "governsai-precheck",
"version": "0.0.1",
"version": "0.1.0",
"checks": checks,
"timestamp": int(time.time())
}
Expand All @@ -206,9 +207,9 @@ async def metrics():
"""
# Set service info if not already set
set_service_info(
version="0.0.1",
build_date="2024-01-XX",
git_commit="unknown"
version="0.1.0",
build_date=os.getenv("BUILD_DATE", "unknown"),
git_commit=os.getenv("GIT_COMMIT", "unknown")
)

metrics_data = get_metrics()
Expand Down
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def create_app() -> FastAPI:
_configure_logging()
app = FastAPI(
title="GovernsAI Precheck",
version="0.0.1",
version="0.1.0",
description="Policy evaluation and PII redaction service for GovernsAI",
lifespan=lifespan
)
Expand Down
Loading
Loading