sentinelrag 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sentinelrag-0.2.0/.env.example +46 -0
- sentinelrag-0.2.0/.github/CODEOWNERS +6 -0
- sentinelrag-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yml +46 -0
- sentinelrag-0.2.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- sentinelrag-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yml +25 -0
- sentinelrag-0.2.0/.github/actions/sentinelrag-gate/action.yml +42 -0
- sentinelrag-0.2.0/.github/dependabot.yml +17 -0
- sentinelrag-0.2.0/.github/labeler.yml +18 -0
- sentinelrag-0.2.0/.github/pull_request_template.md +16 -0
- sentinelrag-0.2.0/.github/release.yml +15 -0
- sentinelrag-0.2.0/.github/workflows/ci.yml +28 -0
- sentinelrag-0.2.0/.github/workflows/codeql.yml +23 -0
- sentinelrag-0.2.0/.github/workflows/eval-gate.yml +18 -0
- sentinelrag-0.2.0/.github/workflows/eval.yml +9 -0
- sentinelrag-0.2.0/.github/workflows/labeler.yml +15 -0
- sentinelrag-0.2.0/.github/workflows/redteam-gate.yml +17 -0
- sentinelrag-0.2.0/.github/workflows/redteam.yml +9 -0
- sentinelrag-0.2.0/.github/workflows/supply-chain-gate.yml +24 -0
- sentinelrag-0.2.0/.gitignore +42 -0
- sentinelrag-0.2.0/CHANGELOG.md +20 -0
- sentinelrag-0.2.0/CODE_OF_CONDUCT.md +36 -0
- sentinelrag-0.2.0/CONTRIBUTING.md +37 -0
- sentinelrag-0.2.0/Dockerfile +15 -0
- sentinelrag-0.2.0/LICENSE +21 -0
- sentinelrag-0.2.0/PKG-INFO +183 -0
- sentinelrag-0.2.0/README.md +138 -0
- sentinelrag-0.2.0/SECURITY.md +39 -0
- sentinelrag-0.2.0/benchmarks/README.md +6 -0
- sentinelrag-0.2.0/benchmarks/asr_vs_alpha.json +34 -0
- sentinelrag-0.2.0/benchmarks/asr_vs_alpha.png +0 -0
- sentinelrag-0.2.0/benchmarks/baseline_evidence.json +63 -0
- sentinelrag-0.2.0/benchmarks/corpus_manifest.json +26 -0
- sentinelrag-0.2.0/benchmarks/export_leaderboard.py +25 -0
- sentinelrag-0.2.0/benchmarks/hygiene_report.json +8 -0
- sentinelrag-0.2.0/benchmarks/leaderboard.json +23 -0
- sentinelrag-0.2.0/benchmarks/pareto_plot.png +0 -0
- sentinelrag-0.2.0/benchmarks/pareto_points.json +22 -0
- sentinelrag-0.2.0/benchmarks/phase1_retrieval.json +25 -0
- sentinelrag-0.2.0/benchmarks/phase1_retrieval.md +14 -0
- sentinelrag-0.2.0/benchmarks/phase2_eval.json +54 -0
- sentinelrag-0.2.0/benchmarks/phase2_eval.md +6 -0
- sentinelrag-0.2.0/benchmarks/phase3_trajectory.json +18 -0
- sentinelrag-0.2.0/benchmarks/poison_benchmark_v1.json +6 -0
- sentinelrag-0.2.0/benchmarks/public_retrieval.json +25 -0
- sentinelrag-0.2.0/benchmarks/run_hygiene_scan.py +30 -0
- sentinelrag-0.2.0/benchmarks/run_pareto.py +89 -0
- sentinelrag-0.2.0/benchmarks/run_phase1_retrieval.py +48 -0
- sentinelrag-0.2.0/benchmarks/run_phase2_eval.py +41 -0
- sentinelrag-0.2.0/benchmarks/run_phase3_trajectory.py +59 -0
- sentinelrag-0.2.0/benchmarks/run_poison_benchmark_v1.py +87 -0
- sentinelrag-0.2.0/benchmarks/run_public_retrieval.py +24 -0
- sentinelrag-0.2.0/benchmarks/run_redteam_sweep.py +52 -0
- sentinelrag-0.2.0/config/eval_thresholds.yaml +19 -0
- sentinelrag-0.2.0/config/gate_policy.yaml +38 -0
- sentinelrag-0.2.0/data/PUBLIC_CORPUS.md +5 -0
- sentinelrag-0.2.0/data/golden.jsonl +5 -0
- sentinelrag-0.2.0/data/golden_dataset.json +42 -0
- sentinelrag-0.2.0/data/judge_calibration.json +41 -0
- sentinelrag-0.2.0/data/mini_corpus/01-overview.md +9 -0
- sentinelrag-0.2.0/data/mini_corpus/02-ingest.md +9 -0
- sentinelrag-0.2.0/data/mini_corpus/03-retrieval.md +10 -0
- sentinelrag-0.2.0/data/mini_corpus/04-eval.md +8 -0
- sentinelrag-0.2.0/data/mini_corpus/05-security.md +6 -0
- sentinelrag-0.2.0/data/mini_qrels.json +36 -0
- sentinelrag-0.2.0/data/public_corpus/pc-01-triple-gate.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-02-hybrid-fusion.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-03-bm25-sparse.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-04-dense-vectors.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-05-chunk-fixed.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-06-chunk-semantic.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-07-reranking.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-08-agentic-hop.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-09-router.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-10-judge.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-11-golden-set.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-12-poison-meta.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-13-lexical-defense.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-14-qdrant.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-15-otel.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-16-mock-ci.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-17-pareto.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-18-mrr.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-19-recall-k.md +3 -0
- sentinelrag-0.2.0/data/public_corpus/pc-20-eval-gate.md +3 -0
- sentinelrag-0.2.0/data/public_qrels.json +66 -0
- sentinelrag-0.2.0/docker-compose.yml +25 -0
- sentinelrag-0.2.0/docs/CHAT_MEMORY.md +60 -0
- sentinelrag-0.2.0/docs/COMPARISON.md +28 -0
- sentinelrag-0.2.0/docs/OWASP_RAG_CI_MAP.md +24 -0
- sentinelrag-0.2.0/docs/POISON_BENCHMARK_v1.md +22 -0
- sentinelrag-0.2.0/docs/SECURITY_AUDIT.md +47 -0
- sentinelrag-0.2.0/docs/STORY.md +51 -0
- sentinelrag-0.2.0/docs/adr/001-stack.md +53 -0
- sentinelrag-0.2.0/docs/adr/002-security.md +29 -0
- sentinelrag-0.2.0/docs/azure/CREDENTIALS_CHECKLIST.md +49 -0
- sentinelrag-0.2.0/docs/azure/RUNBOOK.md +82 -0
- sentinelrag-0.2.0/docs/azure/vm-bootstrap.sh +33 -0
- sentinelrag-0.2.0/examples/adapter_template.py +23 -0
- sentinelrag-0.2.0/pyproject.toml +114 -0
- sentinelrag-0.2.0/scripts/azure_vm_deploy.py +115 -0
- sentinelrag-0.2.0/scripts/check_eval_gate.py +78 -0
- sentinelrag-0.2.0/scripts/check_redteam_gate.py +51 -0
- sentinelrag-0.2.0/scripts/demo.ps1 +35 -0
- sentinelrag-0.2.0/scripts/generate_golden_dataset.py +72 -0
- sentinelrag-0.2.0/scripts/mcp_sentinelrag_gate.py +37 -0
- sentinelrag-0.2.0/scripts/verify_repo_secrets.py +52 -0
- sentinelrag-0.2.0/src/sentinelrag/__init__.py +3 -0
- sentinelrag-0.2.0/src/sentinelrag/api/__init__.py +1 -0
- sentinelrag-0.2.0/src/sentinelrag/api/app.py +257 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/__init__.py +1 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/agreement.py +54 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/golden_io.py +38 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/judge.py +111 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/judges/v1/faithfulness.txt +17 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/judges/v1/manifest.yaml +8 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/judges/v1/relevance.txt +13 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/latency.py +15 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/metrics.py +39 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/phase1_retrieval.py +110 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/phase2_rag.py +123 -0
- sentinelrag-0.2.0/src/sentinelrag/eval/trajectory.py +40 -0
- sentinelrag-0.2.0/src/sentinelrag/gate/__init__.py +6 -0
- sentinelrag-0.2.0/src/sentinelrag/gate/adapter.py +66 -0
- sentinelrag-0.2.0/src/sentinelrag/gate/cli.py +114 -0
- sentinelrag-0.2.0/src/sentinelrag/gate/evidence.py +105 -0
- sentinelrag-0.2.0/src/sentinelrag/gate/policy.py +125 -0
- sentinelrag-0.2.0/src/sentinelrag/gate/reports/__init__.py +1 -0
- sentinelrag-0.2.0/src/sentinelrag/gate/reports/junit.py +50 -0
- sentinelrag-0.2.0/src/sentinelrag/gate/reports/markdown.py +54 -0
- sentinelrag-0.2.0/src/sentinelrag/gate/reports/sarif.py +62 -0
- sentinelrag-0.2.0/src/sentinelrag/gate/runner.py +93 -0
- sentinelrag-0.2.0/src/sentinelrag/generation/__init__.py +5 -0
- sentinelrag-0.2.0/src/sentinelrag/generation/llm.py +190 -0
- sentinelrag-0.2.0/src/sentinelrag/ingest/__init__.py +1 -0
- sentinelrag-0.2.0/src/sentinelrag/ingest/chunking.py +113 -0
- sentinelrag-0.2.0/src/sentinelrag/ingest/filters.py +21 -0
- sentinelrag-0.2.0/src/sentinelrag/ingest/hygiene.py +90 -0
- sentinelrag-0.2.0/src/sentinelrag/ingest/loaders.py +21 -0
- sentinelrag-0.2.0/src/sentinelrag/ingest/pipeline.py +124 -0
- sentinelrag-0.2.0/src/sentinelrag/ingest/provenance.py +43 -0
- sentinelrag-0.2.0/src/sentinelrag/ingest/schema.py +23 -0
- sentinelrag-0.2.0/src/sentinelrag/observability/__init__.py +1 -0
- sentinelrag-0.2.0/src/sentinelrag/observability/cost.py +43 -0
- sentinelrag-0.2.0/src/sentinelrag/observability/tracing.py +26 -0
- sentinelrag-0.2.0/src/sentinelrag/paths.py +35 -0
- sentinelrag-0.2.0/src/sentinelrag/redteam/__init__.py +1 -0
- sentinelrag-0.2.0/src/sentinelrag/redteam/attacks.py +80 -0
- sentinelrag-0.2.0/src/sentinelrag/redteam/defenses.py +28 -0
- sentinelrag-0.2.0/src/sentinelrag/redteam/harness.py +126 -0
- sentinelrag-0.2.0/src/sentinelrag/redteam/post_retrieval.py +58 -0
- sentinelrag-0.2.0/src/sentinelrag/retrieval/__init__.py +1 -0
- sentinelrag-0.2.0/src/sentinelrag/retrieval/agentic.py +68 -0
- sentinelrag-0.2.0/src/sentinelrag/retrieval/bm25_index.py +37 -0
- sentinelrag-0.2.0/src/sentinelrag/retrieval/embeddings.py +60 -0
- sentinelrag-0.2.0/src/sentinelrag/retrieval/fusion.py +30 -0
- sentinelrag-0.2.0/src/sentinelrag/retrieval/reranker.py +51 -0
- sentinelrag-0.2.0/src/sentinelrag/retrieval/stores.py +145 -0
- sentinelrag-0.2.0/src/sentinelrag/retrieval/strategies.py +84 -0
- sentinelrag-0.2.0/src/sentinelrag/router/__init__.py +1 -0
- sentinelrag-0.2.0/src/sentinelrag/router/complexity.py +19 -0
- sentinelrag-0.2.0/src/sentinelrag/router/policy.py +42 -0
- sentinelrag-0.2.0/src/sentinelrag/settings.py +100 -0
- sentinelrag-0.2.0/tests/test_api.py +81 -0
- sentinelrag-0.2.0/tests/test_benchmark.py +16 -0
- sentinelrag-0.2.0/tests/test_chunking.py +34 -0
- sentinelrag-0.2.0/tests/test_fusion.py +29 -0
- sentinelrag-0.2.0/tests/test_fusion_extra.py +9 -0
- sentinelrag-0.2.0/tests/test_gate.py +63 -0
- sentinelrag-0.2.0/tests/test_gate_extended.py +63 -0
- sentinelrag-0.2.0/tests/test_hygiene_metrics.py +40 -0
- sentinelrag-0.2.0/tests/test_ingest_pipeline.py +53 -0
- sentinelrag-0.2.0/tests/test_judge.py +25 -0
- sentinelrag-0.2.0/tests/test_llm.py +112 -0
- sentinelrag-0.2.0/tests/test_metrics.py +16 -0
- sentinelrag-0.2.0/tests/test_observability.py +15 -0
- sentinelrag-0.2.0/tests/test_phase2_eval.py +14 -0
- sentinelrag-0.2.0/tests/test_phase3_agentic.py +37 -0
- sentinelrag-0.2.0/tests/test_pipeline.py +26 -0
- sentinelrag-0.2.0/tests/test_public_corpus.py +22 -0
- sentinelrag-0.2.0/tests/test_redteam.py +7 -0
- sentinelrag-0.2.0/tests/test_retrieval.py +43 -0
- sentinelrag-0.2.0/tests/test_retrieval_strategies.py +46 -0
- sentinelrag-0.2.0/tests/test_router.py +15 -0
- sentinelrag-0.2.0/tests/test_settings.py +34 -0
- sentinelrag-0.2.0/uv.lock +3409 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Copy to .env — never commit .env
|
|
2
|
+
# Prefix SENTINELRAG_ maps to Settings. Other keys are for provider SDKs.
|
|
3
|
+
|
|
4
|
+
# --- App (OSS contributors: keep mock defaults) ---
|
|
5
|
+
SENTINELRAG_APP_NAME=SentinelRAG
|
|
6
|
+
SENTINELRAG_ENV=dev
|
|
7
|
+
SENTINELRAG_HOST=0.0.0.0
|
|
8
|
+
SENTINELRAG_PORT=8000
|
|
9
|
+
SENTINELRAG_VECTOR_STORE_BACKEND=memory
|
|
10
|
+
|
|
11
|
+
# --- Qdrant (Compose overrides URL to http://qdrant:6333) ---
|
|
12
|
+
SENTINELRAG_QDRANT_URL=http://localhost:6333
|
|
13
|
+
SENTINELRAG_QDRANT_COLLECTION=sentinelrag
|
|
14
|
+
|
|
15
|
+
# --- Models (CI / offline defaults) ---
|
|
16
|
+
SENTINELRAG_EMBEDDING_MODEL=mock-embedder
|
|
17
|
+
SENTINELRAG_RERANKER_MODEL=mock-reranker
|
|
18
|
+
SENTINELRAG_LLM_PROVIDER=mock
|
|
19
|
+
SENTINELRAG_LLM_MODEL=mock-llm
|
|
20
|
+
|
|
21
|
+
# --- Budgets ---
|
|
22
|
+
SENTINELRAG_COST_BUDGET_USD=0.01
|
|
23
|
+
SENTINELRAG_LATENCY_BUDGET_MS=2000
|
|
24
|
+
|
|
25
|
+
# --- Optional production overrides (uncomment and fill locally) ---
|
|
26
|
+
# SENTINELRAG_EMBEDDING_MODEL=BAAI/bge-small-en-v1.5
|
|
27
|
+
# SENTINELRAG_LLM_PROVIDER=gemini
|
|
28
|
+
# SENTINELRAG_LLM_MODEL=gemini-2.0-flash
|
|
29
|
+
# GEMINI_API_KEY=
|
|
30
|
+
|
|
31
|
+
# --- Other providers (unused unless SENTINELRAG_LLM_PROVIDER matches) ---
|
|
32
|
+
OPENAI_API_KEY=
|
|
33
|
+
AZURE_OPENAI_API_KEY=
|
|
34
|
+
AZURE_OPENAI_ENDPOINT=
|
|
35
|
+
AZURE_OPENAI_API_VERSION=2024-10-21
|
|
36
|
+
AZURE_OPENAI_DEPLOYMENT=
|
|
37
|
+
ANTHROPIC_API_KEY=
|
|
38
|
+
AWS_ACCESS_KEY_ID=
|
|
39
|
+
AWS_SECRET_ACCESS_KEY=
|
|
40
|
+
AWS_REGION=us-east-1
|
|
41
|
+
HF_TOKEN=
|
|
42
|
+
|
|
43
|
+
# --- Azure VM deploy (local ops only; never commit real values) ---
|
|
44
|
+
# AZURE_VM_HOST=
|
|
45
|
+
# AZURE_VM_USER=
|
|
46
|
+
# AZURE_VM_SSH_KEY=
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Something broke in SentinelRAG (tests, API, benchmarks, CI)
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: what
|
|
7
|
+
attributes:
|
|
8
|
+
label: What happened?
|
|
9
|
+
description: What did you expect vs what you saw?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: repro
|
|
14
|
+
attributes:
|
|
15
|
+
label: Steps to reproduce
|
|
16
|
+
placeholder: |
|
|
17
|
+
uv sync --extra dev
|
|
18
|
+
uv run pytest -k ...
|
|
19
|
+
validations:
|
|
20
|
+
required: true
|
|
21
|
+
- type: dropdown
|
|
22
|
+
id: area
|
|
23
|
+
attributes:
|
|
24
|
+
label: Area
|
|
25
|
+
options:
|
|
26
|
+
- retrieval / ingest
|
|
27
|
+
- eval / judges
|
|
28
|
+
- red-team / defenses
|
|
29
|
+
- router / agentic
|
|
30
|
+
- API / compose
|
|
31
|
+
- CI / benchmarks
|
|
32
|
+
- other
|
|
33
|
+
validations:
|
|
34
|
+
required: true
|
|
35
|
+
- type: input
|
|
36
|
+
id: version
|
|
37
|
+
attributes:
|
|
38
|
+
label: Version or commit
|
|
39
|
+
placeholder: v0.1.0 or git sha
|
|
40
|
+
- type: checkboxes
|
|
41
|
+
id: secrets
|
|
42
|
+
attributes:
|
|
43
|
+
label: Safety check
|
|
44
|
+
options:
|
|
45
|
+
- label: I did not paste API keys, passwords, or private `.env` contents
|
|
46
|
+
required: true
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose an enhancement aligned with eval-gated RAG
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: problem
|
|
7
|
+
attributes:
|
|
8
|
+
label: Problem or opportunity
|
|
9
|
+
description: What pain does this solve for RAG builders?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: proposal
|
|
14
|
+
attributes:
|
|
15
|
+
label: Proposed approach
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: checkboxes
|
|
19
|
+
id: gates
|
|
20
|
+
attributes:
|
|
21
|
+
label: Eval / security impact
|
|
22
|
+
options:
|
|
23
|
+
- label: Needs new or updated benchmark JSON
|
|
24
|
+
- label: Needs eval-gate or redteam-gate threshold change
|
|
25
|
+
- label: No gate impact (docs-only)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: SentinelRAG supply-chain gate
|
|
2
|
+
description: Run unified retrieval, quality, and poison gates with SARIF/JUnit outputs
|
|
3
|
+
inputs:
|
|
4
|
+
policy:
|
|
5
|
+
description: Path to gate_policy.yaml
|
|
6
|
+
required: false
|
|
7
|
+
default: config/gate_policy.yaml
|
|
8
|
+
baseline:
|
|
9
|
+
description: Baseline evidence JSON
|
|
10
|
+
required: false
|
|
11
|
+
default: benchmarks/baseline_evidence.json
|
|
12
|
+
refresh:
|
|
13
|
+
description: Regenerate benchmarks before gate
|
|
14
|
+
required: false
|
|
15
|
+
default: "false"
|
|
16
|
+
working-directory:
|
|
17
|
+
description: Repository root
|
|
18
|
+
required: false
|
|
19
|
+
default: "."
|
|
20
|
+
outputs:
|
|
21
|
+
passed:
|
|
22
|
+
description: Whether the gate passed
|
|
23
|
+
value: ${{ steps.gate.outputs.passed }}
|
|
24
|
+
runs:
|
|
25
|
+
using: composite
|
|
26
|
+
steps:
|
|
27
|
+
- name: Install package
|
|
28
|
+
shell: bash
|
|
29
|
+
working-directory: ${{ inputs.working-directory }}
|
|
30
|
+
run: |
|
|
31
|
+
pip install uv
|
|
32
|
+
uv sync --extra dev
|
|
33
|
+
- name: Run gate
|
|
34
|
+
id: gate
|
|
35
|
+
shell: bash
|
|
36
|
+
working-directory: ${{ inputs.working-directory }}
|
|
37
|
+
run: |
|
|
38
|
+
set -e
|
|
39
|
+
ARGS="run --policy ${{ inputs.policy }} --baseline ${{ inputs.baseline }}"
|
|
40
|
+
if [ "${{ inputs.refresh }}" = "true" ]; then ARGS="$ARGS --refresh"; fi
|
|
41
|
+
uv run sentinelrag-gate $ARGS
|
|
42
|
+
echo "passed=true" >> "$GITHUB_OUTPUT"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "pip"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
open-pull-requests-limit: 5
|
|
8
|
+
labels:
|
|
9
|
+
- dependencies
|
|
10
|
+
- security
|
|
11
|
+
- package-ecosystem: "github-actions"
|
|
12
|
+
directory: "/"
|
|
13
|
+
schedule:
|
|
14
|
+
interval: weekly
|
|
15
|
+
labels:
|
|
16
|
+
- dependencies
|
|
17
|
+
- ci
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
gate:
|
|
2
|
+
- changed-files:
|
|
3
|
+
- any-glob-to-any-file:
|
|
4
|
+
- src/sentinelrag/gate/**
|
|
5
|
+
- config/gate_policy.yaml
|
|
6
|
+
security:
|
|
7
|
+
- changed-files:
|
|
8
|
+
- any-glob-to-any-file:
|
|
9
|
+
- src/sentinelrag/redteam/**
|
|
10
|
+
- src/sentinelrag/ingest/hygiene.py
|
|
11
|
+
ci:
|
|
12
|
+
- changed-files:
|
|
13
|
+
- any-glob-to-any-file:
|
|
14
|
+
- .github/workflows/**
|
|
15
|
+
docs:
|
|
16
|
+
- changed-files:
|
|
17
|
+
- any-glob-to-any-file:
|
|
18
|
+
- "**/*.md"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
-
|
|
4
|
+
|
|
5
|
+
## Test plan
|
|
6
|
+
|
|
7
|
+
- [ ] `uv run pytest`
|
|
8
|
+
- [ ] `uv run ruff check src tests`
|
|
9
|
+
- [ ] `uv run mypy src/sentinelrag`
|
|
10
|
+
- [ ] Regenerated `benchmarks/*.json` if behavior changed
|
|
11
|
+
- [ ] `uv run python scripts/verify_repo_secrets.py`
|
|
12
|
+
|
|
13
|
+
## Gates
|
|
14
|
+
|
|
15
|
+
- [ ] No secrets / `.env` files in the diff
|
|
16
|
+
- [ ] CI eval thresholds updated only with justification in PR description
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
changelog:
|
|
2
|
+
exclude:
|
|
3
|
+
labels:
|
|
4
|
+
- dependencies
|
|
5
|
+
categories:
|
|
6
|
+
- title: Breaking Changes
|
|
7
|
+
labels: [breaking]
|
|
8
|
+
- title: Features
|
|
9
|
+
labels: [enhancement, feature]
|
|
10
|
+
- title: Fixes
|
|
11
|
+
labels: [bug, fix]
|
|
12
|
+
- title: Security
|
|
13
|
+
labels: [security]
|
|
14
|
+
- title: Other
|
|
15
|
+
labels: ["*"]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
quality:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: astral-sh/setup-uv@v4
|
|
14
|
+
with:
|
|
15
|
+
enable-cache: true
|
|
16
|
+
- name: Install
|
|
17
|
+
run: uv sync --extra dev
|
|
18
|
+
- name: Ruff
|
|
19
|
+
run: uv run ruff check src tests
|
|
20
|
+
- name: Mypy
|
|
21
|
+
run: uv run mypy src/sentinelrag
|
|
22
|
+
- name: Pytest
|
|
23
|
+
run: uv run pytest
|
|
24
|
+
env:
|
|
25
|
+
SENTINELRAG_ENV: ci
|
|
26
|
+
SENTINELRAG_LLM_PROVIDER: mock
|
|
27
|
+
- name: Secret scan (tracked files)
|
|
28
|
+
run: uv run python scripts/verify_repo_secrets.py
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: codeql
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
schedule:
|
|
8
|
+
- cron: "17 7 * * 1"
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
analyze:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
permissions:
|
|
14
|
+
security-events: write
|
|
15
|
+
contents: read
|
|
16
|
+
actions: read
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: github/codeql-action/init@v3
|
|
20
|
+
with:
|
|
21
|
+
languages: python
|
|
22
|
+
- uses: github/codeql-action/autobuild@v3
|
|
23
|
+
- uses: github/codeql-action/analyze@v3
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: eval-gate
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_call:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
phase1-retrieval:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: astral-sh/setup-uv@v4
|
|
15
|
+
- run: uv sync --extra dev
|
|
16
|
+
- run: uv run python benchmarks/run_phase1_retrieval.py
|
|
17
|
+
- run: uv run python benchmarks/run_phase2_eval.py
|
|
18
|
+
- run: uv run python scripts/check_eval_gate.py
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: redteam-gate
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_call:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
redteam:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: astral-sh/setup-uv@v4
|
|
15
|
+
- run: uv sync --extra dev
|
|
16
|
+
- run: uv run python benchmarks/run_redteam_sweep.py
|
|
17
|
+
- run: uv run python scripts/check_redteam_gate.py
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: supply-chain-gate
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_call:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
gate:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
security-events: write
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: astral-sh/setup-uv@v4
|
|
18
|
+
- run: uv sync --extra dev
|
|
19
|
+
- run: uv run sentinelrag-gate run --refresh
|
|
20
|
+
- name: Upload gate artifacts
|
|
21
|
+
uses: actions/upload-artifact@v4
|
|
22
|
+
with:
|
|
23
|
+
name: sentinelrag-gate
|
|
24
|
+
path: .sentinelrag/gate/
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Secrets & local env
|
|
2
|
+
.env
|
|
3
|
+
.env.*
|
|
4
|
+
!.env.example
|
|
5
|
+
|
|
6
|
+
# SSH / keys (never commit)
|
|
7
|
+
*.pem
|
|
8
|
+
*.ppk
|
|
9
|
+
id_rsa*
|
|
10
|
+
id_ed25519*
|
|
11
|
+
sentinelrag_azure*
|
|
12
|
+
|
|
13
|
+
# Python
|
|
14
|
+
__pycache__/
|
|
15
|
+
*.py[cod]
|
|
16
|
+
*.egg-info/
|
|
17
|
+
.eggs/
|
|
18
|
+
dist/
|
|
19
|
+
build/
|
|
20
|
+
.venv/
|
|
21
|
+
venv/
|
|
22
|
+
.mypy_cache/
|
|
23
|
+
.ruff_cache/
|
|
24
|
+
.pytest_cache/
|
|
25
|
+
.coverage
|
|
26
|
+
htmlcov/
|
|
27
|
+
coverage.xml
|
|
28
|
+
|
|
29
|
+
# OS / IDE
|
|
30
|
+
.DS_Store
|
|
31
|
+
Thumbs.db
|
|
32
|
+
.idea/
|
|
33
|
+
.vscode/
|
|
34
|
+
*.swp
|
|
35
|
+
|
|
36
|
+
# Local gate outputs (regenerate with sentinelrag-gate run)
|
|
37
|
+
.sentinelrag/
|
|
38
|
+
|
|
39
|
+
# Benchmarks / local data (keep committed JSON results when intentional)
|
|
40
|
+
*.log
|
|
41
|
+
data/raw/
|
|
42
|
+
.qdrant/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.2.0] — 2026-11-08
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Pre-ingest **hygiene scanner** (`sentinelrag-gate scan`) and corpus **provenance** manifests.
|
|
8
|
+
- Retrieval **hit_rate@k** + **latency_ms_mean** in Phase 1 / public benchmarks and evidence.
|
|
9
|
+
- Citation coverage helper; expanded supply-chain gate policy.
|
|
10
|
+
- Dependabot, CodeQL, CODEOWNERS, labeler, release notes config.
|
|
11
|
+
- Poison benchmark v1, SARIF/JUnit evidence gate, composite Action (from 0.1.x line).
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Package version **0.2.0**; README focused on install + out-of-box gate usage.
|
|
16
|
+
- Maintainer-complete surface — no open “good first issue” backlog documents.
|
|
17
|
+
|
|
18
|
+
## [0.1.0] — 2026-11-08
|
|
19
|
+
|
|
20
|
+
- Phases 0–6: adaptive RAG, eval gates, red-team, OSS launch pack.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our pledge
|
|
4
|
+
|
|
5
|
+
We pledge to make participation in SentinelRAG a harassment-free experience for
|
|
6
|
+
everyone, regardless of age, body size, disability, ethnicity, gender identity and
|
|
7
|
+
expression, level of experience, education, socio-economic status, nationality, personal
|
|
8
|
+
appearance, race, religion, or sexual identity and orientation.
|
|
9
|
+
|
|
10
|
+
## Our standards
|
|
11
|
+
|
|
12
|
+
Examples of behavior that contributes to a positive environment:
|
|
13
|
+
|
|
14
|
+
- Using welcoming and inclusive language
|
|
15
|
+
- Being respectful of differing viewpoints and experiences
|
|
16
|
+
- Gracefully accepting constructive criticism
|
|
17
|
+
- Focusing on what is best for the community
|
|
18
|
+
|
|
19
|
+
Examples of unacceptable behavior:
|
|
20
|
+
|
|
21
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
22
|
+
- Public or private harassment
|
|
23
|
+
- Publishing others' private information without explicit permission
|
|
24
|
+
|
|
25
|
+
## Enforcement
|
|
26
|
+
|
|
27
|
+
Report unacceptable behavior via
|
|
28
|
+
[GitHub Issues](https://github.com/prakash888kp/SentinelRAG/issues) (for public
|
|
29
|
+
matters) or contact the maintainer through your preferred private channel if GitHub
|
|
30
|
+
does not suffice.
|
|
31
|
+
|
|
32
|
+
Maintainers may remove, edit, or reject contributions that violate this Code of Conduct.
|
|
33
|
+
|
|
34
|
+
## Attribution
|
|
35
|
+
|
|
36
|
+
Adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
SentinelRAG optimizes for **reproducible supply-chain gates**. Keep benchmarks and tests offline-friendly.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/prakash888kp/SentinelRAG.git
|
|
9
|
+
cd SentinelRAG
|
|
10
|
+
uv sync --extra dev
|
|
11
|
+
cp .env.example .env
|
|
12
|
+
uv run pytest
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Before a PR
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uv run ruff check src tests scripts benchmarks
|
|
19
|
+
uv run mypy src/sentinelrag
|
|
20
|
+
uv run pytest
|
|
21
|
+
uv run sentinelrag-gate run --refresh
|
|
22
|
+
uv run python scripts/verify_repo_secrets.py
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Regenerate and commit `benchmarks/*.json` when behavior changes.
|
|
26
|
+
|
|
27
|
+
## Standards
|
|
28
|
+
|
|
29
|
+
- Python 3.11+, ruff + mypy strict on `src/sentinelrag`
|
|
30
|
+
- No secrets in git (`.env` ignored)
|
|
31
|
+
- Prefer focused PRs with tests
|
|
32
|
+
|
|
33
|
+
## Community
|
|
34
|
+
|
|
35
|
+
- **Maintainer:** PRAKASH KUMAR K ([@prakash888kp](https://github.com/prakash888kp))
|
|
36
|
+
- **Support:** [GitHub Issues](https://github.com/prakash888kp/SentinelRAG/issues)
|
|
37
|
+
- `CODE_OF_CONDUCT.md` · `SECURITY.md`
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
FROM python:3.11-slim
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
RUN pip install --no-cache-dir uv
|
|
6
|
+
|
|
7
|
+
COPY pyproject.toml README.md ./
|
|
8
|
+
COPY data ./data
|
|
9
|
+
COPY src ./src
|
|
10
|
+
|
|
11
|
+
RUN uv pip install --system .
|
|
12
|
+
|
|
13
|
+
EXPOSE 8000
|
|
14
|
+
|
|
15
|
+
CMD ["uvicorn", "sentinelrag.api.app:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SentinelRAG contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|