gristle 0.1.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.
Files changed (107) hide show
  1. gristle-0.1.0/.dockerignore +52 -0
  2. gristle-0.1.0/.env.example +21 -0
  3. gristle-0.1.0/.github/workflows/ci.yml +90 -0
  4. gristle-0.1.0/.github/workflows/release.yml +64 -0
  5. gristle-0.1.0/.gitignore +44 -0
  6. gristle-0.1.0/ARCHITECTURE.md +689 -0
  7. gristle-0.1.0/CHANGELOG.md +226 -0
  8. gristle-0.1.0/CLAUDE.md +279 -0
  9. gristle-0.1.0/CONTRIBUTING.md +66 -0
  10. gristle-0.1.0/Dockerfile +39 -0
  11. gristle-0.1.0/LICENSE +21 -0
  12. gristle-0.1.0/PKG-INFO +252 -0
  13. gristle-0.1.0/README.md +207 -0
  14. gristle-0.1.0/SECURITY.md +29 -0
  15. gristle-0.1.0/docker-compose.yml +39 -0
  16. gristle-0.1.0/docs/archive/gristle-spec.md +2342 -0
  17. gristle-0.1.0/docs/audience.md +137 -0
  18. gristle-0.1.0/docs/future-improvements.md +615 -0
  19. gristle-0.1.0/docs/integration-guide.md +1035 -0
  20. gristle-0.1.0/examples/README.md +28 -0
  21. gristle-0.1.0/examples/sample-app/app/main.py +22 -0
  22. gristle-0.1.0/examples/sample-app/app/models.py +13 -0
  23. gristle-0.1.0/examples/sample-app/app/services.py +20 -0
  24. gristle-0.1.0/examples/sample-app/tests/test_services.py +12 -0
  25. gristle-0.1.0/pyproject.toml +108 -0
  26. gristle-0.1.0/railway.toml +9 -0
  27. gristle-0.1.0/src/gristle/__init__.py +3 -0
  28. gristle-0.1.0/src/gristle/cli.py +253 -0
  29. gristle-0.1.0/src/gristle/config.py +105 -0
  30. gristle-0.1.0/src/gristle/graph/__init__.py +6 -0
  31. gristle-0.1.0/src/gristle/graph/client.py +304 -0
  32. gristle-0.1.0/src/gristle/graph/schema.py +73 -0
  33. gristle-0.1.0/src/gristle/ingestion/__init__.py +0 -0
  34. gristle-0.1.0/src/gristle/ingestion/batch.py +104 -0
  35. gristle-0.1.0/src/gristle/ingestion/dependency_checker.py +267 -0
  36. gristle-0.1.0/src/gristle/ingestion/pipeline.py +3005 -0
  37. gristle-0.1.0/src/gristle/ingestion/schema_extractor.py +363 -0
  38. gristle-0.1.0/src/gristle/ingestion/walker.py +180 -0
  39. gristle-0.1.0/src/gristle/ingestion/watcher.py +120 -0
  40. gristle-0.1.0/src/gristle/logging.py +122 -0
  41. gristle-0.1.0/src/gristle/mcp/__init__.py +0 -0
  42. gristle-0.1.0/src/gristle/mcp/auth.py +23 -0
  43. gristle-0.1.0/src/gristle/mcp/server.py +1386 -0
  44. gristle-0.1.0/src/gristle/models.py +289 -0
  45. gristle-0.1.0/src/gristle/parsers/__init__.py +5 -0
  46. gristle-0.1.0/src/gristle/parsers/base.py +27 -0
  47. gristle-0.1.0/src/gristle/parsers/config.py +251 -0
  48. gristle-0.1.0/src/gristle/parsers/drizzle.py +281 -0
  49. gristle-0.1.0/src/gristle/parsers/env_vars.py +31 -0
  50. gristle-0.1.0/src/gristle/parsers/markdown.py +227 -0
  51. gristle-0.1.0/src/gristle/parsers/orm_python.py +282 -0
  52. gristle-0.1.0/src/gristle/parsers/orm_typescript.py +120 -0
  53. gristle-0.1.0/src/gristle/parsers/prisma.py +332 -0
  54. gristle-0.1.0/src/gristle/parsers/python.py +1477 -0
  55. gristle-0.1.0/src/gristle/parsers/registry.py +49 -0
  56. gristle-0.1.0/src/gristle/parsers/security.py +321 -0
  57. gristle-0.1.0/src/gristle/parsers/sfc.py +118 -0
  58. gristle-0.1.0/src/gristle/parsers/typescript.py +2070 -0
  59. gristle-0.1.0/src/gristle/query/__init__.py +0 -0
  60. gristle-0.1.0/src/gristle/query/engine.py +2664 -0
  61. gristle-0.1.0/src/gristle/search/__init__.py +0 -0
  62. gristle-0.1.0/src/gristle/search/embeddings.py +190 -0
  63. gristle-0.1.0/src/gristle/viz/__init__.py +5 -0
  64. gristle-0.1.0/src/gristle/viz/assets/VENDORED.md +25 -0
  65. gristle-0.1.0/src/gristle/viz/assets/cytoscape-dagre.js +397 -0
  66. gristle-0.1.0/src/gristle/viz/assets/cytoscape.min.js +32 -0
  67. gristle-0.1.0/src/gristle/viz/assets/dagre.min.js +3809 -0
  68. gristle-0.1.0/src/gristle/viz/render.py +47 -0
  69. gristle-0.1.0/src/gristle/viz/template.html +204 -0
  70. gristle-0.1.0/tests/__init__.py +0 -0
  71. gristle-0.1.0/tests/conftest.py +28 -0
  72. gristle-0.1.0/tests/fixtures/sample_drizzle/schema.ts +19 -0
  73. gristle-0.1.0/tests/fixtures/sample_prisma/schema.prisma +45 -0
  74. gristle-0.1.0/tests/fixtures/sample_python/models.py +23 -0
  75. gristle-0.1.0/tests/fixtures/sample_python/services.py +60 -0
  76. gristle-0.1.0/tests/fixtures/sample_python/utils.py +28 -0
  77. gristle-0.1.0/tests/test_auth.py +45 -0
  78. gristle-0.1.0/tests/test_batch.py +127 -0
  79. gristle-0.1.0/tests/test_call_resolution.py +2589 -0
  80. gristle-0.1.0/tests/test_callback_detection.py +633 -0
  81. gristle-0.1.0/tests/test_cli.py +66 -0
  82. gristle-0.1.0/tests/test_code_quality.py +323 -0
  83. gristle-0.1.0/tests/test_config.py +616 -0
  84. gristle-0.1.0/tests/test_dependency_checker.py +510 -0
  85. gristle-0.1.0/tests/test_drizzle_parser.py +567 -0
  86. gristle-0.1.0/tests/test_embeddings.py +292 -0
  87. gristle-0.1.0/tests/test_graph_client.py +447 -0
  88. gristle-0.1.0/tests/test_live_smoke.py +183 -0
  89. gristle-0.1.0/tests/test_logging.py +215 -0
  90. gristle-0.1.0/tests/test_markdown_parser.py +224 -0
  91. gristle-0.1.0/tests/test_mcp_server.py +1176 -0
  92. gristle-0.1.0/tests/test_orm_python.py +111 -0
  93. gristle-0.1.0/tests/test_orm_typescript.py +37 -0
  94. gristle-0.1.0/tests/test_parser.py +724 -0
  95. gristle-0.1.0/tests/test_parser_registry.py +97 -0
  96. gristle-0.1.0/tests/test_prisma_parser.py +550 -0
  97. gristle-0.1.0/tests/test_query_engine.py +1453 -0
  98. gristle-0.1.0/tests/test_schema.py +73 -0
  99. gristle-0.1.0/tests/test_schema_extractor.py +391 -0
  100. gristle-0.1.0/tests/test_security.py +574 -0
  101. gristle-0.1.0/tests/test_sfc_parser.py +112 -0
  102. gristle-0.1.0/tests/test_subgraph.py +350 -0
  103. gristle-0.1.0/tests/test_type_flow.py +662 -0
  104. gristle-0.1.0/tests/test_typescript_parser.py +1406 -0
  105. gristle-0.1.0/tests/test_viz.py +64 -0
  106. gristle-0.1.0/tests/test_walker.py +28 -0
  107. gristle-0.1.0/tests/test_watcher.py +108 -0
@@ -0,0 +1,52 @@
1
+ # Version control
2
+ .git
3
+ .gitignore
4
+
5
+ # Python
6
+ __pycache__
7
+ *.pyc
8
+ *.pyo
9
+ *.egg-info
10
+ dist
11
+ build
12
+ .eggs
13
+
14
+ # Virtual environments
15
+ .venv
16
+ venv
17
+ env
18
+
19
+ # IDE
20
+ .vscode
21
+ .idea
22
+ *.swp
23
+ *.swo
24
+
25
+ # Tests
26
+ tests
27
+ .pytest_cache
28
+ .coverage
29
+ htmlcov
30
+
31
+ # Documentation (keep README.md for pyproject.toml metadata)
32
+ *.md
33
+ !README.md
34
+ docs
35
+ LICENSE
36
+
37
+ # Docker
38
+ Dockerfile
39
+ docker-compose.yml
40
+ .dockerignore
41
+
42
+ # Environment and config
43
+ .env
44
+ .env.*
45
+ !.env.example
46
+
47
+ # Repos cloned during ingestion
48
+ repos
49
+
50
+ # OS
51
+ .DS_Store
52
+ Thumbs.db
@@ -0,0 +1,21 @@
1
+ # FalkorDB connection
2
+ GRISTLE_FALKORDB_HOST=localhost
3
+ GRISTLE_FALKORDB_PORT=6390
4
+ GRISTLE_FALKORDB_PASSWORD=
5
+
6
+ # Ingestion
7
+ GRISTLE_MAX_FILE_SIZE_BYTES=512000
8
+ GRISTLE_REPO_STORAGE_PATH=./repos
9
+ GRISTLE_INGESTION_BATCH_SIZE=200
10
+
11
+ # Transport: "stdio" for local MCP, "streamable-http" for remote/Railway
12
+ GRISTLE_TRANSPORT=stdio
13
+ GRISTLE_HTTP_HOST=0.0.0.0
14
+ GRISTLE_HTTP_PORT=8080
15
+
16
+ # Auth — set to enable bearer token auth on HTTP transport
17
+ GRISTLE_API_KEY=
18
+
19
+ # Logging — level: DEBUG, INFO, WARNING, ERROR | format: json, text (auto-detected if unset)
20
+ GRISTLE_LOG_LEVEL=INFO
21
+ GRISTLE_LOG_FORMAT=
@@ -0,0 +1,90 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Cache pip packages
25
+ uses: actions/cache@v4
26
+ with:
27
+ path: ~/.cache/pip
28
+ key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
29
+ restore-keys: |
30
+ ${{ runner.os }}-pip-${{ matrix.python-version }}-
31
+
32
+ - name: Install dependencies
33
+ run: pip install -e ".[dev]"
34
+
35
+ - name: Run tests
36
+ run: pytest --tb=short -q
37
+
38
+ lint:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+
43
+ - uses: actions/setup-python@v5
44
+ with:
45
+ python-version: "3.13"
46
+
47
+ - name: Install ruff
48
+ run: pip install ruff
49
+
50
+ - name: Check formatting
51
+ run: ruff format --check src/ tests/
52
+
53
+ - name: Lint
54
+ run: ruff check src/ tests/
55
+
56
+ typecheck:
57
+ runs-on: ubuntu-latest
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+
61
+ - uses: actions/setup-python@v5
62
+ with:
63
+ python-version: "3.13"
64
+
65
+ - name: Install dependencies
66
+ run: pip install -e ".[dev]"
67
+
68
+ - name: Type check
69
+ run: mypy src/
70
+
71
+ docker:
72
+ runs-on: ubuntu-latest
73
+ needs: test
74
+ if: github.ref == 'refs/heads/main'
75
+ steps:
76
+ - uses: actions/checkout@v4
77
+
78
+ - name: Build Docker image
79
+ run: docker build -t gristle:test .
80
+
81
+ - name: Verify health endpoint exists
82
+ run: |
83
+ docker run -d --name gristle-test \
84
+ -e GRISTLE_TRANSPORT=streamable-http \
85
+ -e GRISTLE_FALKORDB_HOST=localhost \
86
+ -p 8080:8080 \
87
+ gristle:test
88
+ sleep 5
89
+ curl -sf http://localhost:8080/health || echo "Health check failed (expected without FalkorDB)"
90
+ docker stop gristle-test
@@ -0,0 +1,64 @@
1
+ name: Release
2
+
3
+ # Publishes a release when a vX.Y.Z tag is pushed:
4
+ # - PyPI wheel/sdist via OIDC trusted publishing (no stored token)
5
+ # - multi-tag Docker image to GitHub Container Registry (ghcr.io)
6
+ #
7
+ # One-time setup before the first release:
8
+ # 1. On PyPI, configure a "trusted publisher" for this repo + the `pypi`
9
+ # environment (https://docs.pypi.org/trusted-publishers/).
10
+ # 2. Bump __version__ in src/gristle/__init__.py, commit, then:
11
+ # git tag v0.1.0 && git push origin v0.1.0
12
+
13
+ on:
14
+ push:
15
+ tags: ["v*"]
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ jobs:
21
+ pypi:
22
+ name: Publish to PyPI
23
+ runs-on: ubuntu-latest
24
+ environment: pypi
25
+ permissions:
26
+ id-token: write # OIDC trusted publishing
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: actions/setup-python@v5
30
+ with:
31
+ python-version: "3.13"
32
+ - name: Build sdist and wheel
33
+ run: |
34
+ python -m pip install --upgrade build
35
+ python -m build
36
+ - name: Publish to PyPI
37
+ uses: pypa/gh-action-pypi-publish@release/v1
38
+
39
+ docker:
40
+ name: Publish image to GHCR
41
+ runs-on: ubuntu-latest
42
+ permissions:
43
+ contents: read
44
+ packages: write
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ - uses: docker/login-action@v3
48
+ with:
49
+ registry: ghcr.io
50
+ username: ${{ github.actor }}
51
+ password: ${{ secrets.GITHUB_TOKEN }}
52
+ - uses: docker/metadata-action@v5
53
+ id: meta
54
+ with:
55
+ images: ghcr.io/alchemy-agentic/gristle
56
+ tags: |
57
+ type=semver,pattern={{version}}
58
+ type=raw,value=latest
59
+ - uses: docker/build-push-action@v6
60
+ with:
61
+ context: .
62
+ push: true
63
+ tags: ${{ steps.meta.outputs.tags }}
64
+ labels: ${{ steps.meta.outputs.labels }}
@@ -0,0 +1,44 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ *.eggs/
7
+ dist/
8
+ build/
9
+ *.egg
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+ env/
15
+
16
+ # IDE
17
+ .vscode/
18
+ .idea/
19
+ *.swp
20
+ *.swo
21
+
22
+ # Environment
23
+ .env
24
+
25
+ # Testing
26
+ .pytest_cache/
27
+ .mypy_cache/
28
+ .ruff_cache/
29
+ .tox/
30
+ htmlcov/
31
+ .coverage
32
+
33
+ # OS
34
+ Thumbs.db
35
+ .DS_Store
36
+
37
+ # Repos storage
38
+ repos/
39
+
40
+ # Claude Code
41
+ .claude/
42
+
43
+ # Misc artifacts
44
+ nul