codegraph-brain 0.6.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.
- codegraph_brain-0.6.0/.github/workflows/autodoc.yml +84 -0
- codegraph_brain-0.6.0/.github/workflows/ci.yml +39 -0
- codegraph_brain-0.6.0/.github/workflows/guardian.yml +235 -0
- codegraph_brain-0.6.0/.github/workflows/release-please.yml +77 -0
- codegraph_brain-0.6.0/.gitignore +231 -0
- codegraph_brain-0.6.0/.pre-commit-config.yaml +27 -0
- codegraph_brain-0.6.0/.python-version +1 -0
- codegraph_brain-0.6.0/.release-please-manifest.json +3 -0
- codegraph_brain-0.6.0/CHANGELOG.md +209 -0
- codegraph_brain-0.6.0/CLAUDE.md +89 -0
- codegraph_brain-0.6.0/CONTRIBUTING.md +73 -0
- codegraph_brain-0.6.0/LICENSE +21 -0
- codegraph_brain-0.6.0/Makefile +54 -0
- codegraph_brain-0.6.0/PKG-INFO +240 -0
- codegraph_brain-0.6.0/README.md +190 -0
- codegraph_brain-0.6.0/benchmarks/guardian/CURATION.md +191 -0
- codegraph_brain-0.6.0/benchmarks/guardian/pr-122.yaml +83 -0
- codegraph_brain-0.6.0/benchmarks/guardian/pr-140.yaml +113 -0
- codegraph_brain-0.6.0/benchmarks/guardian/pr-141.yaml +12 -0
- codegraph_brain-0.6.0/benchmarks/guardian/pr-142.yaml +23 -0
- codegraph_brain-0.6.0/benchmarks/guardian/pr-143.yaml +51 -0
- codegraph_brain-0.6.0/benchmarks/guardian/pr-144.yaml +52 -0
- codegraph_brain-0.6.0/benchmarks/guardian/pr-278.yaml +10 -0
- codegraph_brain-0.6.0/benchmarks/guardian/results.jsonl +150 -0
- codegraph_brain-0.6.0/data/.gitkeep +0 -0
- codegraph_brain-0.6.0/docs/CASE_STUDY.md +135 -0
- codegraph_brain-0.6.0/docs/architecture/HOW_IT_WORKS.md +157 -0
- codegraph_brain-0.6.0/docs/architecture/ONTOLOGY.md +132 -0
- codegraph_brain-0.6.0/docs/architecture/PATTERNS_AND_TRIADS.md +190 -0
- codegraph_brain-0.6.0/docs/architecture/SELF_PORTRAIT.md +110 -0
- codegraph_brain-0.6.0/docs/architecture/diagrams/pipeline_flow.mermaid +32 -0
- codegraph_brain-0.6.0/docs/architecture/health_badge.json +8 -0
- codegraph_brain-0.6.0/docs/examples/.gitkeep +0 -0
- codegraph_brain-0.6.0/docs/how-to/AGENT_ONBOARDING.md +99 -0
- codegraph_brain-0.6.0/docs/how-to/CLI_USAGE.md +148 -0
- codegraph_brain-0.6.0/docs/how-to/MCP_REFERENCE.md +290 -0
- codegraph_brain-0.6.0/docs/ontology/.gitkeep +0 -0
- codegraph_brain-0.6.0/docs/ontology/core.yaml +87 -0
- codegraph_brain-0.6.0/docs/ontology/domains.yaml +79 -0
- codegraph_brain-0.6.0/docs/ontology/patterns.yaml +202 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-09-domain-pattern-fingerprint-design.md +293 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-09-pattern-alphabet-motif-basis-design.md +405 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-10-guardian-sprint-design.md +480 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-11-fastapi-di-edges-design.md +265 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-11-guardian-chunked-review-design.md +265 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-11-guardian-chunker-design.md +152 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-11-mcp-drift-validate-fqn-design.md +232 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-11-resolver-split-design.md +268 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-11-symbol-import-edges-design.md +248 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-12-drift-empty-domains-design.md +249 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-12-gate-semantics-design.md +261 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-12-init-ontology-design.md +206 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-12-release-please-ci-design.md +93 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-13-suggest-packages-design.md +297 -0
- codegraph_brain-0.6.0/docs/specs/2026-06-13-tangle-anti-pattern-design.md +148 -0
- codegraph_brain-0.6.0/docs/specs/2026-07-29-guardian-skeptic-scoring-design.md +288 -0
- codegraph_brain-0.6.0/docs/specs/2026-07-30-cgis-fractal-design.md +266 -0
- codegraph_brain-0.6.0/docs/specs/2026-07-30-cgis-fractal-plan.md +1182 -0
- codegraph_brain-0.6.0/docs/specs/2026-07-30-chunk-source-filter-design.md +166 -0
- codegraph_brain-0.6.0/docs/specs/2026-07-30-chunk-source-filter-plan.md +330 -0
- codegraph_brain-0.6.0/docs/specs/2026-07-30-genai-client-close-design.md +135 -0
- codegraph_brain-0.6.0/docs/specs/2026-07-30-genai-client-close-plan.md +219 -0
- codegraph_brain-0.6.0/docs/specs/2026-07-30-guardian-precision-bench-design.md +217 -0
- codegraph_brain-0.6.0/docs/specs/2026-07-30-guardian-precision-bench-plan.md +601 -0
- codegraph_brain-0.6.0/docs/specs/2026-07-30-guardian-timeout-retry-design.md +212 -0
- codegraph_brain-0.6.0/docs/specs/2026-07-30-guardian-timeout-retry-plan.md +701 -0
- codegraph_brain-0.6.0/docs/specs/BLUEPRINT.md +100 -0
- codegraph_brain-0.6.0/docs/specs/PRD.md +68 -0
- codegraph_brain-0.6.0/docs/specs/TDD.md +111 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-09-fingerprint-drift.md +1651 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-10-guardian-context-skeptic-inline.md +1941 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-10-guardian-structured-findings-bench.md +1734 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-10-motif-basis-part-b.md +1740 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-10-unified-pattern-alphabet.md +1283 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-11-fastapi-di-edges.md +977 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-11-guardian-chunked-review.md +1222 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-11-guardian-chunker.md +727 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-11-mcp-drift-validate-fqn.md +1004 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-11-resolver-split.md +912 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-12-drift-empty-domains.md +633 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-12-gate-semantics.md +661 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-12-init-ontology.md +678 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-12-release-please-ci.md +166 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-12-symbol-import-edges.md +488 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-06-13-suggest-packages.md +1237 -0
- codegraph_brain-0.6.0/docs/specs/plans/2026-07-29-guardian-skeptic-scoring.md +1237 -0
- codegraph_brain-0.6.0/main.py +6 -0
- codegraph_brain-0.6.0/pyproject.toml +239 -0
- codegraph_brain-0.6.0/release-please-config.json +9 -0
- codegraph_brain-0.6.0/scripts/gen_ideal_graph.py +425 -0
- codegraph_brain-0.6.0/scripts/generate_health.py +114 -0
- codegraph_brain-0.6.0/scripts/generate_mcp_ref.py +67 -0
- codegraph_brain-0.6.0/scripts/generate_schema_docs.py +76 -0
- codegraph_brain-0.6.0/scripts/guardian_bench.py +304 -0
- codegraph_brain-0.6.0/scripts/guardian_review.py +112 -0
- codegraph_brain-0.6.0/scripts/inject_readme_graph.py +126 -0
- codegraph_brain-0.6.0/scripts/probe_closure_gap.py +269 -0
- codegraph_brain-0.6.0/scripts/probe_tier_ladder.py +228 -0
- codegraph_brain-0.6.0/src/cgis/__init__.py +10 -0
- codegraph_brain-0.6.0/src/cgis/__main__.py +16 -0
- codegraph_brain-0.6.0/src/cgis/api/.gitkeep +0 -0
- codegraph_brain-0.6.0/src/cgis/api/__init__.py +1 -0
- codegraph_brain-0.6.0/src/cgis/api/mcp_server.py +550 -0
- codegraph_brain-0.6.0/src/cgis/cli.py +1516 -0
- codegraph_brain-0.6.0/src/cgis/core/.gitkeep +0 -0
- codegraph_brain-0.6.0/src/cgis/core/models.py +140 -0
- codegraph_brain-0.6.0/src/cgis/extractors/.gitkeep +0 -0
- codegraph_brain-0.6.0/src/cgis/extractors/_python_ast.py +194 -0
- codegraph_brain-0.6.0/src/cgis/extractors/_python_classes.py +126 -0
- codegraph_brain-0.6.0/src/cgis/extractors/_python_functions.py +312 -0
- codegraph_brain-0.6.0/src/cgis/extractors/_python_imports.py +188 -0
- codegraph_brain-0.6.0/src/cgis/extractors/_python_types.py +84 -0
- codegraph_brain-0.6.0/src/cgis/extractors/base.py +42 -0
- codegraph_brain-0.6.0/src/cgis/extractors/python_extractor.py +235 -0
- codegraph_brain-0.6.0/src/cgis/extractors/typescript_extractor.py +310 -0
- codegraph_brain-0.6.0/src/cgis/guardian/__init__.py +1 -0
- codegraph_brain-0.6.0/src/cgis/guardian/bench.py +199 -0
- codegraph_brain-0.6.0/src/cgis/guardian/chunked.py +240 -0
- codegraph_brain-0.6.0/src/cgis/guardian/chunker.py +148 -0
- codegraph_brain-0.6.0/src/cgis/guardian/collector.py +309 -0
- codegraph_brain-0.6.0/src/cgis/guardian/core.py +120 -0
- codegraph_brain-0.6.0/src/cgis/guardian/diff_index.py +151 -0
- codegraph_brain-0.6.0/src/cgis/guardian/findings.py +70 -0
- codegraph_brain-0.6.0/src/cgis/guardian/github_poster.py +133 -0
- codegraph_brain-0.6.0/src/cgis/guardian/metrics.py +108 -0
- codegraph_brain-0.6.0/src/cgis/guardian/prompts.py +217 -0
- codegraph_brain-0.6.0/src/cgis/guardian/providers/__init__.py +1 -0
- codegraph_brain-0.6.0/src/cgis/guardian/providers/base.py +112 -0
- codegraph_brain-0.6.0/src/cgis/guardian/providers/gemini.py +83 -0
- codegraph_brain-0.6.0/src/cgis/guardian/providers/mistral.py +83 -0
- codegraph_brain-0.6.0/src/cgis/guardian/providers/ollama.py +99 -0
- codegraph_brain-0.6.0/src/cgis/guardian/recording.py +82 -0
- codegraph_brain-0.6.0/src/cgis/guardian/render.py +107 -0
- codegraph_brain-0.6.0/src/cgis/guardian/runner.py +295 -0
- codegraph_brain-0.6.0/src/cgis/guardian/skeptic.py +208 -0
- codegraph_brain-0.6.0/src/cgis/pipeline.py +252 -0
- codegraph_brain-0.6.0/src/cgis/py.typed +0 -0
- codegraph_brain-0.6.0/src/cgis/query/analysis/__init__.py +0 -0
- codegraph_brain-0.6.0/src/cgis/query/analysis/analyzer.py +241 -0
- codegraph_brain-0.6.0/src/cgis/query/analysis/anomaly.py +34 -0
- codegraph_brain-0.6.0/src/cgis/query/analysis/cohesion.py +277 -0
- codegraph_brain-0.6.0/src/cgis/query/analysis/health.py +128 -0
- codegraph_brain-0.6.0/src/cgis/query/analysis/suggest_service.py +221 -0
- codegraph_brain-0.6.0/src/cgis/query/context/__init__.py +0 -0
- codegraph_brain-0.6.0/src/cgis/query/context/audit.py +134 -0
- codegraph_brain-0.6.0/src/cgis/query/context/context_service.py +129 -0
- codegraph_brain-0.6.0/src/cgis/query/context/prompt.py +184 -0
- codegraph_brain-0.6.0/src/cgis/query/context/snippet.py +96 -0
- codegraph_brain-0.6.0/src/cgis/query/drift/__init__.py +0 -0
- codegraph_brain-0.6.0/src/cgis/query/drift/_scc.py +90 -0
- codegraph_brain-0.6.0/src/cgis/query/drift/drift.py +867 -0
- codegraph_brain-0.6.0/src/cgis/query/drift/drift_service.py +217 -0
- codegraph_brain-0.6.0/src/cgis/query/drift/fingerprint.py +255 -0
- codegraph_brain-0.6.0/src/cgis/query/drift/fractal.py +292 -0
- codegraph_brain-0.6.0/src/cgis/query/drift/ontology_init.py +470 -0
- codegraph_brain-0.6.0/src/cgis/query/drift/quotient.py +75 -0
- codegraph_brain-0.6.0/src/cgis/query/drift/triads.py +234 -0
- codegraph_brain-0.6.0/src/cgis/query/engine.py +170 -0
- codegraph_brain-0.6.0/src/cgis/query/fqn.py +65 -0
- codegraph_brain-0.6.0/src/cgis/query/render/__init__.py +0 -0
- codegraph_brain-0.6.0/src/cgis/query/render/graph_json.py +42 -0
- codegraph_brain-0.6.0/src/cgis/query/render/mermaid.py +235 -0
- codegraph_brain-0.6.0/src/cgis/query/render/metrics.py +346 -0
- codegraph_brain-0.6.0/src/cgis/resolver/.gitkeep +0 -0
- codegraph_brain-0.6.0/src/cgis/resolver/__init__.py +1 -0
- codegraph_brain-0.6.0/src/cgis/resolver/engine.py +145 -0
- codegraph_brain-0.6.0/src/cgis/resolver/indices.py +184 -0
- codegraph_brain-0.6.0/src/cgis/resolver/symbols.py +179 -0
- codegraph_brain-0.6.0/src/cgis/resolver/uplift.py +263 -0
- codegraph_brain-0.6.0/src/cgis/storage/.gitkeep +0 -0
- codegraph_brain-0.6.0/src/cgis/storage/sqlite_store.py +589 -0
- codegraph_brain-0.6.0/tests/integration/.gitkeep +0 -0
- codegraph_brain-0.6.0/tests/self_parsing/.gitkeep +0 -0
- codegraph_brain-0.6.0/tests/self_parsing/__init__.py +0 -0
- codegraph_brain-0.6.0/tests/self_parsing/conftest.py +66 -0
- codegraph_brain-0.6.0/tests/self_parsing/test_architecture.py +209 -0
- codegraph_brain-0.6.0/tests/self_parsing/test_drift.py +161 -0
- codegraph_brain-0.6.0/tests/self_parsing/test_fractal.py +45 -0
- codegraph_brain-0.6.0/tests/self_parsing/test_init_ontology_roundtrip.py +55 -0
- codegraph_brain-0.6.0/tests/self_parsing/test_self_parse.py +224 -0
- codegraph_brain-0.6.0/tests/self_parsing/test_self_parse_ts.py +122 -0
- codegraph_brain-0.6.0/tests/self_parsing/test_suggest.py +65 -0
- codegraph_brain-0.6.0/tests/unit/.gitkeep +0 -0
- codegraph_brain-0.6.0/tests/unit/conftest.py +197 -0
- codegraph_brain-0.6.0/tests/unit/guardian_stubs.py +53 -0
- codegraph_brain-0.6.0/tests/unit/test___main__.py +11 -0
- codegraph_brain-0.6.0/tests/unit/test_analyzer.py +451 -0
- codegraph_brain-0.6.0/tests/unit/test_audit.py +146 -0
- codegraph_brain-0.6.0/tests/unit/test_cli.py +1428 -0
- codegraph_brain-0.6.0/tests/unit/test_cohesion.py +172 -0
- codegraph_brain-0.6.0/tests/unit/test_context_service.py +294 -0
- codegraph_brain-0.6.0/tests/unit/test_di_acceptance.py +122 -0
- codegraph_brain-0.6.0/tests/unit/test_drift.py +1662 -0
- codegraph_brain-0.6.0/tests/unit/test_drift_service.py +915 -0
- codegraph_brain-0.6.0/tests/unit/test_fingerprint.py +512 -0
- codegraph_brain-0.6.0/tests/unit/test_fqn.py +100 -0
- codegraph_brain-0.6.0/tests/unit/test_fractal.py +332 -0
- codegraph_brain-0.6.0/tests/unit/test_gen_ideal_graph.py +229 -0
- codegraph_brain-0.6.0/tests/unit/test_generate_mcp_ref.py +49 -0
- codegraph_brain-0.6.0/tests/unit/test_graph_json.py +63 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_bench.py +370 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_chunked.py +420 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_chunker.py +366 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_collector.py +438 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_core.py +750 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_diff_index.py +134 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_findings.py +124 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_metrics.py +210 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_poster.py +221 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_providers.py +132 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_recording.py +71 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_render.py +215 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_runner.py +511 -0
- codegraph_brain-0.6.0/tests/unit/test_guardian_skeptic.py +233 -0
- codegraph_brain-0.6.0/tests/unit/test_health_scorer.py +156 -0
- codegraph_brain-0.6.0/tests/unit/test_import_acceptance.py +86 -0
- codegraph_brain-0.6.0/tests/unit/test_mcp_server.py +808 -0
- codegraph_brain-0.6.0/tests/unit/test_mermaid.py +359 -0
- codegraph_brain-0.6.0/tests/unit/test_metrics.py +373 -0
- codegraph_brain-0.6.0/tests/unit/test_models.py +62 -0
- codegraph_brain-0.6.0/tests/unit/test_ontology_compliance.py +114 -0
- codegraph_brain-0.6.0/tests/unit/test_ontology_init.py +328 -0
- codegraph_brain-0.6.0/tests/unit/test_patterns_yaml.py +209 -0
- codegraph_brain-0.6.0/tests/unit/test_pipeline.py +265 -0
- codegraph_brain-0.6.0/tests/unit/test_prompt.py +234 -0
- codegraph_brain-0.6.0/tests/unit/test_python_extractor.py +722 -0
- codegraph_brain-0.6.0/tests/unit/test_quotient.py +77 -0
- codegraph_brain-0.6.0/tests/unit/test_resolver.py +1245 -0
- codegraph_brain-0.6.0/tests/unit/test_resolver_indices.py +133 -0
- codegraph_brain-0.6.0/tests/unit/test_resolver_symbols.py +109 -0
- codegraph_brain-0.6.0/tests/unit/test_snippet.py +123 -0
- codegraph_brain-0.6.0/tests/unit/test_sqlite_store.py +791 -0
- codegraph_brain-0.6.0/tests/unit/test_suggest_service.py +181 -0
- codegraph_brain-0.6.0/tests/unit/test_triads.py +234 -0
- codegraph_brain-0.6.0/tests/unit/test_typescript_extractor.py +337 -0
- codegraph_brain-0.6.0/tests/unit/test_uplift.py +361 -0
- codegraph_brain-0.6.0/uv.lock +2183 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: Self-Documenting Architecture Sync
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
paths-ignore:
|
|
7
|
+
- 'docs/**'
|
|
8
|
+
- 'README.md'
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
pull-requests: write
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
sync-architecture-docs:
|
|
17
|
+
name: Regenerate architecture graph & MCP reference
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout Code
|
|
21
|
+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
22
|
+
with:
|
|
23
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
24
|
+
|
|
25
|
+
- name: Setup uv
|
|
26
|
+
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: true
|
|
29
|
+
python-version: "3.12"
|
|
30
|
+
|
|
31
|
+
- name: Install CGIS
|
|
32
|
+
run: uv sync
|
|
33
|
+
|
|
34
|
+
- name: Self-ingest core engine
|
|
35
|
+
run: uv run cgis ingest ./src --output /tmp/self_graph.db
|
|
36
|
+
|
|
37
|
+
- name: Generate pipeline flow diagram
|
|
38
|
+
run: |
|
|
39
|
+
mkdir -p docs/architecture/diagrams
|
|
40
|
+
uv run cgis trace "cgis.pipeline.IngestionPipeline.run" \
|
|
41
|
+
--db /tmp/self_graph.db \
|
|
42
|
+
--depth 1 \
|
|
43
|
+
--format mermaid \
|
|
44
|
+
--internal-only \
|
|
45
|
+
> docs/architecture/diagrams/pipeline_flow.mermaid
|
|
46
|
+
|
|
47
|
+
- name: Compute graph health badge
|
|
48
|
+
run: uv run python scripts/generate_health.py --db /tmp/self_graph.db
|
|
49
|
+
|
|
50
|
+
- name: Inject graph into README.md
|
|
51
|
+
run: |
|
|
52
|
+
uv run python scripts/inject_readme_graph.py \
|
|
53
|
+
--db /tmp/self_graph.db \
|
|
54
|
+
--fqn "cgis.pipeline.IngestionPipeline.run" \
|
|
55
|
+
--depth 1 \
|
|
56
|
+
--path-prefix "src/"
|
|
57
|
+
|
|
58
|
+
- name: Generate MCP reference manual
|
|
59
|
+
run: uv run python scripts/generate_mcp_ref.py
|
|
60
|
+
|
|
61
|
+
- name: Sync schema docs from source
|
|
62
|
+
run: uv run python scripts/generate_schema_docs.py
|
|
63
|
+
|
|
64
|
+
- name: Open PR with generated docs
|
|
65
|
+
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7
|
|
66
|
+
with:
|
|
67
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
68
|
+
commit-message: "docs: auto-sync architecture graph and MCP reference"
|
|
69
|
+
branch: docs/auto-sync
|
|
70
|
+
delete-branch: true
|
|
71
|
+
title: "docs: auto-sync architecture graph and MCP reference"
|
|
72
|
+
body: |
|
|
73
|
+
Auto-generated by the [Self-Documenting Architecture Sync](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) workflow.
|
|
74
|
+
|
|
75
|
+
Updates:
|
|
76
|
+
- Pipeline flow diagram (`docs/architecture/diagrams/pipeline_flow.mermaid`)
|
|
77
|
+
- Graph health badge (`docs/architecture/health_badge.json`)
|
|
78
|
+
- Schema docs (`docs/architecture/HOW_IT_WORKS.md`)
|
|
79
|
+
- MCP reference (`docs/how-to/MCP_REFERENCE.md`)
|
|
80
|
+
- README diagram injection
|
|
81
|
+
labels: "docs,automated"
|
|
82
|
+
add-paths: |
|
|
83
|
+
README.md
|
|
84
|
+
docs/
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Continuous Integration
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, dev, "feat/**", "fix/**", "docs/**" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
python-ci:
|
|
11
|
+
name: Python Verification
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout Code
|
|
15
|
+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
16
|
+
|
|
17
|
+
- name: Setup uv
|
|
18
|
+
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
|
|
19
|
+
with:
|
|
20
|
+
enable-cache: true
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
|
|
23
|
+
- name: Install Dependencies
|
|
24
|
+
run: uv sync --group dev
|
|
25
|
+
|
|
26
|
+
- name: Ruff Format Check
|
|
27
|
+
run: uv run ruff format --check .
|
|
28
|
+
|
|
29
|
+
- name: Ruff Lint
|
|
30
|
+
run: uv run ruff check .
|
|
31
|
+
|
|
32
|
+
- name: Interrogate (≥90% docstring coverage)
|
|
33
|
+
run: uv run interrogate -v --fail-under 90 src/cgis
|
|
34
|
+
|
|
35
|
+
- name: Mypy (strict)
|
|
36
|
+
run: uv run mypy src
|
|
37
|
+
|
|
38
|
+
- name: Pytest
|
|
39
|
+
run: uv run pytest --cov=cgis --cov-report=term-missing
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
name: Guardian Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issue_comment:
|
|
5
|
+
types: [created]
|
|
6
|
+
|
|
7
|
+
permissions: {}
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
review:
|
|
11
|
+
# job-level if: uses GitHub expression engine, not shell — safe for comment.body comparison
|
|
12
|
+
if: |
|
|
13
|
+
github.event.issue.pull_request != null &&
|
|
14
|
+
github.event.comment.body == '/guardian review'
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
pull-requests: write
|
|
19
|
+
issues: write
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- name: Check commenter has write access
|
|
23
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
|
|
24
|
+
with:
|
|
25
|
+
script: |
|
|
26
|
+
const { data: perm } = await github.rest.repos.getCollaboratorPermissionLevel({
|
|
27
|
+
owner: context.repo.owner,
|
|
28
|
+
repo: context.repo.repo,
|
|
29
|
+
username: context.payload.comment.user.login,
|
|
30
|
+
});
|
|
31
|
+
const allowed = ['admin', 'write'];
|
|
32
|
+
if (!allowed.includes(perm.permission)) {
|
|
33
|
+
core.setFailed(`@${context.payload.comment.user.login} needs write access to trigger Guardian Review (has: ${perm.permission})`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
- name: React to trigger comment
|
|
37
|
+
env:
|
|
38
|
+
GH_TOKEN: ${{ github.token }}
|
|
39
|
+
COMMENT_ID: ${{ github.event.comment.id }}
|
|
40
|
+
run: |
|
|
41
|
+
gh api repos/$GITHUB_REPOSITORY/issues/comments/$COMMENT_ID/reactions \
|
|
42
|
+
-X POST -f content=eyes
|
|
43
|
+
|
|
44
|
+
- name: Validate PR number and get base branch
|
|
45
|
+
env:
|
|
46
|
+
PR_NUMBER: ${{ github.event.issue.number }}
|
|
47
|
+
GH_TOKEN: ${{ github.token }}
|
|
48
|
+
run: |
|
|
49
|
+
if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
|
|
50
|
+
echo "Invalid PR number: $PR_NUMBER" && exit 1
|
|
51
|
+
fi
|
|
52
|
+
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
|
|
53
|
+
BASE_BRANCH=$(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json baseRefName --jq '.baseRefName')
|
|
54
|
+
echo "BASE_BRANCH=$BASE_BRANCH" >> $GITHUB_ENV
|
|
55
|
+
|
|
56
|
+
- name: Checkout PR branch
|
|
57
|
+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
58
|
+
with:
|
|
59
|
+
# PR_NUMBER validated as digits-only in previous step
|
|
60
|
+
ref: refs/pull/${{ env.PR_NUMBER }}/head
|
|
61
|
+
fetch-depth: 0
|
|
62
|
+
|
|
63
|
+
- name: Fetch base branch for diff
|
|
64
|
+
run: git fetch origin "$BASE_BRANCH"
|
|
65
|
+
|
|
66
|
+
- name: Install uv
|
|
67
|
+
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
|
|
68
|
+
|
|
69
|
+
- name: Install dependencies
|
|
70
|
+
run: uv sync --group guardian
|
|
71
|
+
|
|
72
|
+
- name: Build code graph
|
|
73
|
+
run: uv run cgis ingest ./src --output graph.db
|
|
74
|
+
|
|
75
|
+
- name: Restore metrics from data branch
|
|
76
|
+
run: |
|
|
77
|
+
git fetch origin data/guardian-metrics 2>/dev/null && \
|
|
78
|
+
git show origin/data/guardian-metrics:guardian_metrics.jsonl \
|
|
79
|
+
> guardian_metrics.jsonl 2>/dev/null || true
|
|
80
|
+
|
|
81
|
+
- name: Run Guardian Review
|
|
82
|
+
id: guardian
|
|
83
|
+
env:
|
|
84
|
+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
|
85
|
+
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
|
86
|
+
GUARDIAN_PROVIDER: ${{ vars.GUARDIAN_PROVIDER }}
|
|
87
|
+
GUARDIAN_MODEL: ${{ vars.GUARDIAN_MODEL }}
|
|
88
|
+
GH_TOKEN: ${{ github.token }}
|
|
89
|
+
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
90
|
+
GUARDIAN_FEATURES: ${{ vars.GUARDIAN_FEATURES }}
|
|
91
|
+
GUARDIAN_SKEPTIC: ${{ vars.GUARDIAN_SKEPTIC }}
|
|
92
|
+
GUARDIAN_SKEPTIC_MODEL: ${{ vars.GUARDIAN_SKEPTIC_MODEL }}
|
|
93
|
+
run: |
|
|
94
|
+
uv run python scripts/guardian_review.py \
|
|
95
|
+
--output guardian_report.md \
|
|
96
|
+
--db graph.db \
|
|
97
|
+
--pr "$PR_NUMBER" \
|
|
98
|
+
--metrics guardian_metrics.jsonl \
|
|
99
|
+
--record-finder guardian_finder.json \
|
|
100
|
+
--inline \
|
|
101
|
+
--base-branch "$BASE_BRANCH"
|
|
102
|
+
|
|
103
|
+
- name: Upload metrics artifact
|
|
104
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
105
|
+
with:
|
|
106
|
+
name: guardian-metrics-${{ env.PR_NUMBER }}
|
|
107
|
+
path: guardian_metrics.jsonl
|
|
108
|
+
retention-days: 7
|
|
109
|
+
|
|
110
|
+
- name: Upload finder recording artifact
|
|
111
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
112
|
+
with:
|
|
113
|
+
name: guardian-finder-${{ env.PR_NUMBER }}
|
|
114
|
+
path: guardian_finder.json
|
|
115
|
+
retention-days: 7
|
|
116
|
+
|
|
117
|
+
- name: Post review as PR comment
|
|
118
|
+
if: steps.guardian.outputs.posted_inline != 'true'
|
|
119
|
+
uses: peter-evans/create-or-update-comment@a111a2c3bacd7be7898ee22d0d71d9aec2bb972c # v4
|
|
120
|
+
with:
|
|
121
|
+
issue-number: ${{ env.PR_NUMBER }}
|
|
122
|
+
body-path: guardian_report.md
|
|
123
|
+
|
|
124
|
+
save-metrics:
|
|
125
|
+
needs: review
|
|
126
|
+
runs-on: ubuntu-latest
|
|
127
|
+
# contents: write is scoped to this job only — no PR code runs here
|
|
128
|
+
permissions:
|
|
129
|
+
contents: write
|
|
130
|
+
|
|
131
|
+
steps:
|
|
132
|
+
- name: Checkout main
|
|
133
|
+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
134
|
+
with:
|
|
135
|
+
ref: main
|
|
136
|
+
fetch-depth: 0
|
|
137
|
+
|
|
138
|
+
- name: Download metrics artifact
|
|
139
|
+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
|
140
|
+
with:
|
|
141
|
+
name: guardian-metrics-${{ github.event.issue.number }}
|
|
142
|
+
|
|
143
|
+
- name: Push metrics to data branch
|
|
144
|
+
env:
|
|
145
|
+
PR_NUMBER: ${{ github.event.issue.number }}
|
|
146
|
+
run: |
|
|
147
|
+
git config user.name "github-actions[bot]"
|
|
148
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
149
|
+
if git ls-remote --exit-code origin data/guardian-metrics > /dev/null 2>&1; then
|
|
150
|
+
git worktree add /tmp/metrics origin/data/guardian-metrics
|
|
151
|
+
else
|
|
152
|
+
git worktree add --orphan -b data/guardian-metrics /tmp/metrics
|
|
153
|
+
fi
|
|
154
|
+
cp guardian_metrics.jsonl /tmp/metrics/
|
|
155
|
+
git -C /tmp/metrics add guardian_metrics.jsonl
|
|
156
|
+
git -C /tmp/metrics diff --cached --quiet || \
|
|
157
|
+
git -C /tmp/metrics commit -m "metrics: guardian review PR #${PR_NUMBER} [skip ci]"
|
|
158
|
+
git -C /tmp/metrics push origin HEAD:data/guardian-metrics
|
|
159
|
+
|
|
160
|
+
rate:
|
|
161
|
+
# Triggered by: /guardian rate <applied> in a PR comment
|
|
162
|
+
# Example: /guardian rate 2
|
|
163
|
+
if: |
|
|
164
|
+
github.event.issue.pull_request != null &&
|
|
165
|
+
startsWith(github.event.comment.body, '/guardian rate ')
|
|
166
|
+
runs-on: ubuntu-latest
|
|
167
|
+
permissions:
|
|
168
|
+
contents: write
|
|
169
|
+
issues: read
|
|
170
|
+
|
|
171
|
+
steps:
|
|
172
|
+
- name: Check commenter has write access
|
|
173
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
|
|
174
|
+
with:
|
|
175
|
+
script: |
|
|
176
|
+
const { data: perm } = await github.rest.repos.getCollaboratorPermissionLevel({
|
|
177
|
+
owner: context.repo.owner,
|
|
178
|
+
repo: context.repo.repo,
|
|
179
|
+
username: context.payload.comment.user.login,
|
|
180
|
+
});
|
|
181
|
+
const allowed = ['admin', 'write'];
|
|
182
|
+
if (!allowed.includes(perm.permission)) {
|
|
183
|
+
core.setFailed(`@${context.payload.comment.user.login} needs write access (has: ${perm.permission})`);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
- name: Parse rate command
|
|
187
|
+
env:
|
|
188
|
+
COMMENT_BODY: ${{ github.event.comment.body }}
|
|
189
|
+
PR_NUMBER: ${{ github.event.issue.number }}
|
|
190
|
+
run: |
|
|
191
|
+
if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
|
|
192
|
+
echo "Invalid PR number: $PR_NUMBER" && exit 1
|
|
193
|
+
fi
|
|
194
|
+
APPLIED=$(echo "$COMMENT_BODY" | sed -n 's|^/guardian rate \([0-9]*\).*|\1|p')
|
|
195
|
+
if ! [[ "$APPLIED" =~ ^[0-9]+$ ]]; then
|
|
196
|
+
echo "Invalid applied count in comment: '$COMMENT_BODY'" && exit 1
|
|
197
|
+
fi
|
|
198
|
+
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
|
|
199
|
+
echo "APPLIED=$APPLIED" >> $GITHUB_ENV
|
|
200
|
+
|
|
201
|
+
- name: Checkout main
|
|
202
|
+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
203
|
+
with:
|
|
204
|
+
ref: main
|
|
205
|
+
fetch-depth: 0
|
|
206
|
+
|
|
207
|
+
- name: Install uv
|
|
208
|
+
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
|
|
209
|
+
|
|
210
|
+
- name: Install dependencies
|
|
211
|
+
run: uv sync --frozen
|
|
212
|
+
|
|
213
|
+
- name: Rate review and push metrics
|
|
214
|
+
run: |
|
|
215
|
+
git config user.name "github-actions[bot]"
|
|
216
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
217
|
+
|
|
218
|
+
git fetch origin data/guardian-metrics
|
|
219
|
+
git show origin/data/guardian-metrics:guardian_metrics.jsonl \
|
|
220
|
+
> guardian_metrics.jsonl
|
|
221
|
+
|
|
222
|
+
uv run cgis guardian-rate "$PR_NUMBER" "$APPLIED" \
|
|
223
|
+
--metrics guardian_metrics.jsonl
|
|
224
|
+
|
|
225
|
+
if git ls-remote --exit-code origin data/guardian-metrics > /dev/null 2>&1; then
|
|
226
|
+
git worktree add /tmp/metrics origin/data/guardian-metrics
|
|
227
|
+
else
|
|
228
|
+
git worktree add --orphan -b data/guardian-metrics /tmp/metrics
|
|
229
|
+
fi
|
|
230
|
+
cp guardian_metrics.jsonl /tmp/metrics/
|
|
231
|
+
git -C /tmp/metrics add guardian_metrics.jsonl
|
|
232
|
+
git -C /tmp/metrics diff --cached --quiet || \
|
|
233
|
+
git -C /tmp/metrics commit \
|
|
234
|
+
-m "metrics: rate PR #${PR_NUMBER} applied=${APPLIED} [skip ci]"
|
|
235
|
+
git -C /tmp/metrics push origin HEAD:data/guardian-metrics
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: Release Please
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release-please:
|
|
10
|
+
name: Release Please
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
# Scoped to this job only: the publish job below must never inherit
|
|
14
|
+
# write access to the repository.
|
|
15
|
+
contents: write
|
|
16
|
+
pull-requests: write
|
|
17
|
+
outputs:
|
|
18
|
+
release_created: ${{ steps.release.outputs.release_created }}
|
|
19
|
+
tag_name: ${{ steps.release.outputs.tag_name }}
|
|
20
|
+
steps:
|
|
21
|
+
- name: Run release-please
|
|
22
|
+
id: release
|
|
23
|
+
uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1
|
|
24
|
+
with:
|
|
25
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
26
|
+
config-file: release-please-config.json
|
|
27
|
+
manifest-file: .release-please-manifest.json
|
|
28
|
+
|
|
29
|
+
publish:
|
|
30
|
+
name: Publish to PyPI
|
|
31
|
+
needs: release-please
|
|
32
|
+
if: needs.release-please.outputs.release_created == 'true'
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
environment:
|
|
35
|
+
name: pypi
|
|
36
|
+
url: https://pypi.org/p/codegraph-brain
|
|
37
|
+
permissions:
|
|
38
|
+
# Mints the short-lived OIDC token PyPI exchanges for an upload token.
|
|
39
|
+
# This is the whole point of trusted publishing: no API token in secrets.
|
|
40
|
+
id-token: write
|
|
41
|
+
# Lets the publish action attach PEP 740 provenance attestations.
|
|
42
|
+
attestations: write
|
|
43
|
+
contents: read
|
|
44
|
+
steps:
|
|
45
|
+
- name: Checkout Code
|
|
46
|
+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
47
|
+
with:
|
|
48
|
+
ref: ${{ needs.release-please.outputs.tag_name }}
|
|
49
|
+
|
|
50
|
+
- name: Setup uv
|
|
51
|
+
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
|
|
52
|
+
with:
|
|
53
|
+
enable-cache: true
|
|
54
|
+
python-version: "3.12"
|
|
55
|
+
|
|
56
|
+
- name: Build sdist and wheel
|
|
57
|
+
run: uv build
|
|
58
|
+
|
|
59
|
+
- name: Verify metadata
|
|
60
|
+
# Pinned and wheel-only: this job holds publish rights, so the tooling
|
|
61
|
+
# it pulls in must not be a floating version that can run setup scripts.
|
|
62
|
+
run: uvx --no-build --from "twine==7.0.0" twine check dist/*
|
|
63
|
+
|
|
64
|
+
- name: Verify version matches the tag
|
|
65
|
+
env:
|
|
66
|
+
TAG_NAME: ${{ needs.release-please.outputs.tag_name }}
|
|
67
|
+
run: |
|
|
68
|
+
set -euo pipefail
|
|
69
|
+
built=$(ls dist/*.whl | sed -E 's/.*-([0-9][^-]*)-py3.*/\1/')
|
|
70
|
+
echo "tag=$TAG_NAME built=$built"
|
|
71
|
+
case "$TAG_NAME" in
|
|
72
|
+
*"$built") ;;
|
|
73
|
+
*) echo "::error::tag $TAG_NAME does not match built version $built"; exit 1 ;;
|
|
74
|
+
esac
|
|
75
|
+
|
|
76
|
+
- name: Publish
|
|
77
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# Superpowers planning artifacts
|
|
75
|
+
docs/superpowers/
|
|
76
|
+
.superpowers/
|
|
77
|
+
.claude/
|
|
78
|
+
|
|
79
|
+
# PyBuilder
|
|
80
|
+
.pybuilder/
|
|
81
|
+
target/
|
|
82
|
+
|
|
83
|
+
# Jupyter Notebook
|
|
84
|
+
.ipynb_checkpoints
|
|
85
|
+
|
|
86
|
+
# IPython
|
|
87
|
+
profile_default/
|
|
88
|
+
ipython_config.py
|
|
89
|
+
|
|
90
|
+
# pyenv
|
|
91
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
92
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
93
|
+
# .python-version
|
|
94
|
+
|
|
95
|
+
# pipenv
|
|
96
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
97
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
98
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
99
|
+
# install all needed dependencies.
|
|
100
|
+
# Pipfile.lock
|
|
101
|
+
|
|
102
|
+
# UV
|
|
103
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
104
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
105
|
+
# commonly ignored for libraries.
|
|
106
|
+
# uv.lock
|
|
107
|
+
|
|
108
|
+
# poetry
|
|
109
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
110
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
111
|
+
# commonly ignored for libraries.
|
|
112
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
113
|
+
# poetry.lock
|
|
114
|
+
# poetry.toml
|
|
115
|
+
|
|
116
|
+
# pdm
|
|
117
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
118
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
119
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
120
|
+
# pdm.lock
|
|
121
|
+
# pdm.toml
|
|
122
|
+
.pdm-python
|
|
123
|
+
.pdm-build/
|
|
124
|
+
|
|
125
|
+
# pixi
|
|
126
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
127
|
+
# pixi.lock
|
|
128
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
129
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
130
|
+
.pixi
|
|
131
|
+
|
|
132
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
133
|
+
__pypackages__/
|
|
134
|
+
|
|
135
|
+
# Celery stuff
|
|
136
|
+
celerybeat-schedule
|
|
137
|
+
celerybeat.pid
|
|
138
|
+
|
|
139
|
+
# Redis
|
|
140
|
+
*.rdb
|
|
141
|
+
*.aof
|
|
142
|
+
*.pid
|
|
143
|
+
|
|
144
|
+
# RabbitMQ
|
|
145
|
+
mnesia/
|
|
146
|
+
rabbitmq/
|
|
147
|
+
rabbitmq-data/
|
|
148
|
+
|
|
149
|
+
# ActiveMQ
|
|
150
|
+
activemq-data/
|
|
151
|
+
|
|
152
|
+
# SageMath parsed files
|
|
153
|
+
*.sage.py
|
|
154
|
+
|
|
155
|
+
# Environments
|
|
156
|
+
.env
|
|
157
|
+
.envrc
|
|
158
|
+
.venv
|
|
159
|
+
env/
|
|
160
|
+
venv/
|
|
161
|
+
ENV/
|
|
162
|
+
env.bak/
|
|
163
|
+
venv.bak/
|
|
164
|
+
|
|
165
|
+
# Spyder project settings
|
|
166
|
+
.spyderproject
|
|
167
|
+
.spyproject
|
|
168
|
+
|
|
169
|
+
# Rope project settings
|
|
170
|
+
.ropeproject
|
|
171
|
+
|
|
172
|
+
# mkdocs documentation
|
|
173
|
+
/site
|
|
174
|
+
|
|
175
|
+
# mypy
|
|
176
|
+
.mypy_cache/
|
|
177
|
+
.dmypy.json
|
|
178
|
+
dmypy.json
|
|
179
|
+
|
|
180
|
+
# Pyre type checker
|
|
181
|
+
.pyre/
|
|
182
|
+
|
|
183
|
+
# pytype static type analyzer
|
|
184
|
+
.pytype/
|
|
185
|
+
|
|
186
|
+
# Cython debug symbols
|
|
187
|
+
cython_debug/
|
|
188
|
+
|
|
189
|
+
# PyCharm
|
|
190
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
191
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
192
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
193
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
194
|
+
# .idea/
|
|
195
|
+
|
|
196
|
+
# Abstra
|
|
197
|
+
# Abstra is an AI-powered process automation framework.
|
|
198
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
199
|
+
# Learn more at https://abstra.io/docs
|
|
200
|
+
.abstra/
|
|
201
|
+
|
|
202
|
+
# Visual Studio Code
|
|
203
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
204
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
205
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
206
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
207
|
+
# .vscode/
|
|
208
|
+
# Temporary file for partial code execution
|
|
209
|
+
tempCodeRunnerFile.py
|
|
210
|
+
|
|
211
|
+
# Ruff stuff:
|
|
212
|
+
.ruff_cache/
|
|
213
|
+
|
|
214
|
+
# PyPI configuration file
|
|
215
|
+
.pypirc
|
|
216
|
+
|
|
217
|
+
# Marimo
|
|
218
|
+
marimo/_static/
|
|
219
|
+
marimo/_lsp/
|
|
220
|
+
__marimo__/
|
|
221
|
+
|
|
222
|
+
# Streamlit
|
|
223
|
+
.streamlit/secrets.toml
|
|
224
|
+
graph.json
|
|
225
|
+
*.db
|
|
226
|
+
ui/
|
|
227
|
+
guardian_metrics.jsonl
|
|
228
|
+
|
|
229
|
+
# SQLite WAL/SHM sidecars
|
|
230
|
+
*.db-wal
|
|
231
|
+
*.db-shm
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
rev: v0.15.16
|
|
4
|
+
hooks:
|
|
5
|
+
- id: ruff
|
|
6
|
+
args: [--fix]
|
|
7
|
+
- id: ruff-format
|
|
8
|
+
|
|
9
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
10
|
+
rev: v2.1.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: mypy
|
|
13
|
+
args: [--config-file=pyproject.toml]
|
|
14
|
+
files: ^src/
|
|
15
|
+
additional_dependencies:
|
|
16
|
+
- httpx>=0.27 # imported directly by guardian/providers/base.py (#275)
|
|
17
|
+
- pydantic>=2.13.4
|
|
18
|
+
- structlog>=25.5.0
|
|
19
|
+
- types-pyyaml>=6.0.12.20260518
|
|
20
|
+
- rich>=15.0.0
|
|
21
|
+
- typer>=0.26.7
|
|
22
|
+
- tree-sitter>=0.25.2
|
|
23
|
+
- tree-sitter-python>=0.25.0
|
|
24
|
+
- tree-sitter-typescript>=0.23.2
|
|
25
|
+
- pytest>=9.0.3
|
|
26
|
+
- "mcp[cli]>=2" # must match the pyproject bound
|
|
27
|
+
- duckdb>=1.1.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|