grimoire-dashboard 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 (130) hide show
  1. grimoire_dashboard-0.1.0/.crush/.gitignore +1 -0
  2. grimoire_dashboard-0.1.0/.crush/crush.db +0 -0
  3. grimoire_dashboard-0.1.0/.crush/crush.db-shm +0 -0
  4. grimoire_dashboard-0.1.0/.crush/crush.db-wal +0 -0
  5. grimoire_dashboard-0.1.0/.dockerignore +13 -0
  6. grimoire_dashboard-0.1.0/.github/workflows/docs.yaml +48 -0
  7. grimoire_dashboard-0.1.0/.gitignore +215 -0
  8. grimoire_dashboard-0.1.0/AGENTS.md +76 -0
  9. grimoire_dashboard-0.1.0/CONTRIBUTING.md +69 -0
  10. grimoire_dashboard-0.1.0/Dockerfile +35 -0
  11. grimoire_dashboard-0.1.0/LICENSE +201 -0
  12. grimoire_dashboard-0.1.0/METRICS.md +35 -0
  13. grimoire_dashboard-0.1.0/PKG-INFO +60 -0
  14. grimoire_dashboard-0.1.0/README.md +32 -0
  15. grimoire_dashboard-0.1.0/config.yaml.example +72 -0
  16. grimoire_dashboard-0.1.0/data/actions/rerun-failed-pr-workflows.yaml +61 -0
  17. grimoire_dashboard-0.1.0/data/actions/test.yaml +6 -0
  18. grimoire_dashboard-0.1.0/data/checks/charmcraft-fetch-lib.yaml +16 -0
  19. grimoire_dashboard-0.1.0/data/checks/uv-lock-fresh.yaml +21 -0
  20. grimoire_dashboard-0.1.0/data/checks/watchdog.yaml +6 -0
  21. grimoire_dashboard-0.1.0/data/setup.sh +11 -0
  22. grimoire_dashboard-0.1.0/docker-compose.yml +13 -0
  23. grimoire_dashboard-0.1.0/docker-entrypoint.sh +12 -0
  24. grimoire_dashboard-0.1.0/docs/specs/00-overview.md +184 -0
  25. grimoire_dashboard-0.1.0/docs/specs/01-scaffolding-and-configuration.md +241 -0
  26. grimoire_dashboard-0.1.0/docs/specs/02-github-data-service.md +264 -0
  27. grimoire_dashboard-0.1.0/docs/specs/03-workspace-manager.md +156 -0
  28. grimoire_dashboard-0.1.0/docs/specs/04-checks-engine.md +284 -0
  29. grimoire_dashboard-0.1.0/docs/specs/05-actions-engine.md +227 -0
  30. grimoire_dashboard-0.1.0/docs/specs/06-web-application.md +508 -0
  31. grimoire_dashboard-0.1.0/docs/specs/07-observability-and-devops.md +287 -0
  32. grimoire_dashboard-0.1.0/docs/user/assets/favicon.ico +0 -0
  33. grimoire_dashboard-0.1.0/docs/user/assets/logo-nav.png +0 -0
  34. grimoire_dashboard-0.1.0/docs/user/explanation/architecture.md +88 -0
  35. grimoire_dashboard-0.1.0/docs/user/how-to/deploy.md +108 -0
  36. grimoire_dashboard-0.1.0/docs/user/how-to/write-a-check.md +150 -0
  37. grimoire_dashboard-0.1.0/docs/user/how-to/write-an-action.md +127 -0
  38. grimoire_dashboard-0.1.0/docs/user/index.md +39 -0
  39. grimoire_dashboard-0.1.0/docs/user/mkdocs.yml +71 -0
  40. grimoire_dashboard-0.1.0/docs/user/reference/actions.md +71 -0
  41. grimoire_dashboard-0.1.0/docs/user/reference/api.md +44 -0
  42. grimoire_dashboard-0.1.0/docs/user/reference/checks.md +101 -0
  43. grimoire_dashboard-0.1.0/docs/user/reference/configuration.md +271 -0
  44. grimoire_dashboard-0.1.0/docs/user/tutorials/getting-started.md +86 -0
  45. grimoire_dashboard-0.1.0/justfile +201 -0
  46. grimoire_dashboard-0.1.0/logo.png +0 -0
  47. grimoire_dashboard-0.1.0/pyproject.toml +92 -0
  48. grimoire_dashboard-0.1.0/src/grimoire/__init__.py +1 -0
  49. grimoire_dashboard-0.1.0/src/grimoire/__main__.py +20 -0
  50. grimoire_dashboard-0.1.0/src/grimoire/actions/__init__.py +0 -0
  51. grimoire_dashboard-0.1.0/src/grimoire/actions/engine.py +276 -0
  52. grimoire_dashboard-0.1.0/src/grimoire/actions/loader.py +54 -0
  53. grimoire_dashboard-0.1.0/src/grimoire/actions/router.py +290 -0
  54. grimoire_dashboard-0.1.0/src/grimoire/actions/scheduler.py +63 -0
  55. grimoire_dashboard-0.1.0/src/grimoire/app.py +312 -0
  56. grimoire_dashboard-0.1.0/src/grimoire/checks/__init__.py +0 -0
  57. grimoire_dashboard-0.1.0/src/grimoire/checks/engine.py +244 -0
  58. grimoire_dashboard-0.1.0/src/grimoire/checks/loader.py +56 -0
  59. grimoire_dashboard-0.1.0/src/grimoire/checks/router.py +314 -0
  60. grimoire_dashboard-0.1.0/src/grimoire/checks/scheduler.py +67 -0
  61. grimoire_dashboard-0.1.0/src/grimoire/config.py +211 -0
  62. grimoire_dashboard-0.1.0/src/grimoire/database.py +254 -0
  63. grimoire_dashboard-0.1.0/src/grimoire/github/__init__.py +0 -0
  64. grimoire_dashboard-0.1.0/src/grimoire/github/client.py +380 -0
  65. grimoire_dashboard-0.1.0/src/grimoire/github/router.py +170 -0
  66. grimoire_dashboard-0.1.0/src/grimoire/github/schemas.py +99 -0
  67. grimoire_dashboard-0.1.0/src/grimoire/github/service.py +835 -0
  68. grimoire_dashboard-0.1.0/src/grimoire/models.py +104 -0
  69. grimoire_dashboard-0.1.0/src/grimoire/observability/__init__.py +0 -0
  70. grimoire_dashboard-0.1.0/src/grimoire/observability/logging.py +56 -0
  71. grimoire_dashboard-0.1.0/src/grimoire/observability/metrics.py +128 -0
  72. grimoire_dashboard-0.1.0/src/grimoire/script.py +57 -0
  73. grimoire_dashboard-0.1.0/src/grimoire/targeting.py +87 -0
  74. grimoire_dashboard-0.1.0/src/grimoire/web/__init__.py +0 -0
  75. grimoire_dashboard-0.1.0/src/grimoire/web/backlog.py +515 -0
  76. grimoire_dashboard-0.1.0/src/grimoire/web/router.py +1497 -0
  77. grimoire_dashboard-0.1.0/src/grimoire/web/static/favicon.ico +0 -0
  78. grimoire_dashboard-0.1.0/src/grimoire/web/static/logo-nav.png +0 -0
  79. grimoire_dashboard-0.1.0/src/grimoire/web/templates/actions.html +131 -0
  80. grimoire_dashboard-0.1.0/src/grimoire/web/templates/backlog.html +364 -0
  81. grimoire_dashboard-0.1.0/src/grimoire/web/templates/base.html +118 -0
  82. grimoire_dashboard-0.1.0/src/grimoire/web/templates/checks.html +167 -0
  83. grimoire_dashboard-0.1.0/src/grimoire/web/templates/dashboard.html +222 -0
  84. grimoire_dashboard-0.1.0/src/grimoire/web/templates/loading.html +16 -0
  85. grimoire_dashboard-0.1.0/src/grimoire/web/templates/not_found.html +17 -0
  86. grimoire_dashboard-0.1.0/src/grimoire/web/templates/partials/action_results.html +70 -0
  87. grimoire_dashboard-0.1.0/src/grimoire/web/templates/partials/action_run_button.html +28 -0
  88. grimoire_dashboard-0.1.0/src/grimoire/web/templates/partials/action_run_detail.html +58 -0
  89. grimoire_dashboard-0.1.0/src/grimoire/web/templates/partials/backlog_items.html +101 -0
  90. grimoire_dashboard-0.1.0/src/grimoire/web/templates/partials/check_output.html +5 -0
  91. grimoire_dashboard-0.1.0/src/grimoire/web/templates/partials/check_results.html +70 -0
  92. grimoire_dashboard-0.1.0/src/grimoire/web/templates/partials/check_run_button.html +28 -0
  93. grimoire_dashboard-0.1.0/src/grimoire/web/templates/partials/dashboard_list.html +111 -0
  94. grimoire_dashboard-0.1.0/src/grimoire/web/templates/partials/dashboard_matrix.html +113 -0
  95. grimoire_dashboard-0.1.0/src/grimoire/web/templates/partials/loading_progress.html +14 -0
  96. grimoire_dashboard-0.1.0/src/grimoire/web/templates/partials/refresh_button.html +27 -0
  97. grimoire_dashboard-0.1.0/src/grimoire/web/templates/repository.html +258 -0
  98. grimoire_dashboard-0.1.0/src/grimoire/workspace/__init__.py +0 -0
  99. grimoire_dashboard-0.1.0/src/grimoire/workspace/manager.py +236 -0
  100. grimoire_dashboard-0.1.0/tests/__init__.py +0 -0
  101. grimoire_dashboard-0.1.0/tests/conftest.py +56 -0
  102. grimoire_dashboard-0.1.0/tests/test_actions/__init__.py +0 -0
  103. grimoire_dashboard-0.1.0/tests/test_actions/test_engine.py +422 -0
  104. grimoire_dashboard-0.1.0/tests/test_actions/test_loader.py +119 -0
  105. grimoire_dashboard-0.1.0/tests/test_actions/test_router.py +232 -0
  106. grimoire_dashboard-0.1.0/tests/test_app.py +19 -0
  107. grimoire_dashboard-0.1.0/tests/test_checks/__init__.py +0 -0
  108. grimoire_dashboard-0.1.0/tests/test_checks/test_engine.py +190 -0
  109. grimoire_dashboard-0.1.0/tests/test_checks/test_loader.py +120 -0
  110. grimoire_dashboard-0.1.0/tests/test_checks/test_router.py +226 -0
  111. grimoire_dashboard-0.1.0/tests/test_checks/test_scheduler.py +65 -0
  112. grimoire_dashboard-0.1.0/tests/test_checks/test_targeting.py +120 -0
  113. grimoire_dashboard-0.1.0/tests/test_config.py +310 -0
  114. grimoire_dashboard-0.1.0/tests/test_database.py +166 -0
  115. grimoire_dashboard-0.1.0/tests/test_github/__init__.py +0 -0
  116. grimoire_dashboard-0.1.0/tests/test_github/test_client.py +410 -0
  117. grimoire_dashboard-0.1.0/tests/test_github/test_router.py +64 -0
  118. grimoire_dashboard-0.1.0/tests/test_github/test_service.py +760 -0
  119. grimoire_dashboard-0.1.0/tests/test_observability/__init__.py +0 -0
  120. grimoire_dashboard-0.1.0/tests/test_observability/test_logging.py +84 -0
  121. grimoire_dashboard-0.1.0/tests/test_observability/test_metrics.py +125 -0
  122. grimoire_dashboard-0.1.0/tests/test_script.py +107 -0
  123. grimoire_dashboard-0.1.0/tests/test_web/__init__.py +0 -0
  124. grimoire_dashboard-0.1.0/tests/test_web/conftest.py +320 -0
  125. grimoire_dashboard-0.1.0/tests/test_web/test_backlog.py +916 -0
  126. grimoire_dashboard-0.1.0/tests/test_web/test_router.py +668 -0
  127. grimoire_dashboard-0.1.0/tests/test_web/test_viewmodel.py +54 -0
  128. grimoire_dashboard-0.1.0/tests/test_workspace/__init__.py +0 -0
  129. grimoire_dashboard-0.1.0/tests/test_workspace/test_manager.py +400 -0
  130. grimoire_dashboard-0.1.0/uv.lock +1684 -0
@@ -0,0 +1 @@
1
+ *
Binary file
@@ -0,0 +1,13 @@
1
+ workspace/
2
+ .venv/
3
+ .git/
4
+ *.db
5
+ *.log
6
+ __pycache__/
7
+ .ruff_cache/
8
+ .pytest_cache/
9
+ .coverage
10
+ dist/
11
+ build/
12
+ docs/
13
+ tests/
@@ -0,0 +1,48 @@
1
+ name: Deploy Documentation
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - "docs/user/**"
8
+ - ".github/workflows/docs.yaml"
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: read
13
+ pages: write
14
+ id-token: write
15
+
16
+ concurrency:
17
+ group: "pages"
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ build:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - uses: actions/setup-python@v5
27
+ with:
28
+ python-version: "3.13"
29
+
30
+ - name: Install mkdocs-material
31
+ run: pip install mkdocs-material
32
+
33
+ - name: Build docs
34
+ run: mkdocs build --config-file docs/user/mkdocs.yml
35
+
36
+ - uses: actions/upload-pages-artifact@v3
37
+ with:
38
+ path: site
39
+
40
+ deploy:
41
+ needs: build
42
+ runs-on: ubuntu-latest
43
+ environment:
44
+ name: github-pages
45
+ url: ${{ steps.deployment.outputs.page_url }}
46
+ steps:
47
+ - id: deployment
48
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,215 @@
1
+ # Grimoire-specific files
2
+ config.yaml
3
+ grimoire.db
4
+ /workspace/
5
+
6
+
7
+ # Python
8
+
9
+ # Byte-compiled / optimized / DLL files
10
+ __pycache__/
11
+ *.py[codz]
12
+ *$py.class
13
+
14
+ # C extensions
15
+ *.so
16
+
17
+ # Distribution / packaging
18
+ .Python
19
+ build/
20
+ develop-eggs/
21
+ dist/
22
+ downloads/
23
+ eggs/
24
+ .eggs/
25
+ lib/
26
+ lib64/
27
+ parts/
28
+ sdist/
29
+ var/
30
+ wheels/
31
+ share/python-wheels/
32
+ *.egg-info/
33
+ .installed.cfg
34
+ *.egg
35
+ MANIFEST
36
+
37
+ # PyInstaller
38
+ # Usually these files are written by a python script from a template
39
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
40
+ *.manifest
41
+ *.spec
42
+
43
+ # Installer logs
44
+ pip-log.txt
45
+ pip-delete-this-directory.txt
46
+
47
+ # Unit test / coverage reports
48
+ htmlcov/
49
+ .tox/
50
+ .nox/
51
+ .coverage
52
+ .coverage.*
53
+ .cache
54
+ nosetests.xml
55
+ coverage.xml
56
+ *.cover
57
+ *.py.cover
58
+ .hypothesis/
59
+ .pytest_cache/
60
+ cover/
61
+
62
+ # Translations
63
+ *.mo
64
+ *.pot
65
+
66
+ # Django stuff:
67
+ *.log
68
+ local_settings.py
69
+ db.sqlite3
70
+ db.sqlite3-journal
71
+
72
+ # Flask stuff:
73
+ instance/
74
+ .webassets-cache
75
+
76
+ # Scrapy stuff:
77
+ .scrapy
78
+
79
+ # Sphinx documentation
80
+ docs/_build/
81
+
82
+ # PyBuilder
83
+ .pybuilder/
84
+ target/
85
+
86
+ # Jupyter Notebook
87
+ .ipynb_checkpoints
88
+
89
+ # IPython
90
+ profile_default/
91
+ ipython_config.py
92
+
93
+ # pyenv
94
+ # For a library or package, you might want to ignore these files since the code is
95
+ # intended to run in multiple environments; otherwise, check them in:
96
+ # .python-version
97
+
98
+ # pipenv
99
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
101
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
102
+ # install all needed dependencies.
103
+ #Pipfile.lock
104
+
105
+ # UV
106
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
107
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
108
+ # commonly ignored for libraries.
109
+ #uv.lock
110
+
111
+ # poetry
112
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
113
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
114
+ # commonly ignored for libraries.
115
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
116
+ #poetry.lock
117
+ #poetry.toml
118
+
119
+ # pdm
120
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
121
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
122
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
123
+ #pdm.lock
124
+ #pdm.toml
125
+ .pdm-python
126
+ .pdm-build/
127
+
128
+ # pixi
129
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
130
+ #pixi.lock
131
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
132
+ # in the .venv directory. It is recommended not to include this directory in version control.
133
+ .pixi
134
+
135
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
136
+ __pypackages__/
137
+
138
+ # Celery stuff
139
+ celerybeat-schedule
140
+ celerybeat.pid
141
+
142
+ # SageMath parsed files
143
+ *.sage.py
144
+
145
+ # Environments
146
+ .env
147
+ .envrc
148
+ .venv
149
+ env/
150
+ venv/
151
+ ENV/
152
+ env.bak/
153
+ venv.bak/
154
+
155
+ # Spyder project settings
156
+ .spyderproject
157
+ .spyproject
158
+
159
+ # Rope project settings
160
+ .ropeproject
161
+
162
+ # mkdocs documentation
163
+ /site
164
+
165
+ # mypy
166
+ .mypy_cache/
167
+ .dmypy.json
168
+ dmypy.json
169
+
170
+ # Pyre type checker
171
+ .pyre/
172
+
173
+ # pytype static type analyzer
174
+ .pytype/
175
+
176
+ # Cython debug symbols
177
+ cython_debug/
178
+
179
+ # PyCharm
180
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
181
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
182
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
183
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
184
+ #.idea/
185
+
186
+ # Abstra
187
+ # Abstra is an AI-powered process automation framework.
188
+ # Ignore directories containing user credentials, local state, and settings.
189
+ # Learn more at https://abstra.io/docs
190
+ .abstra/
191
+
192
+ # Visual Studio Code
193
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
194
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
195
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
196
+ # you could uncomment the following to ignore the entire vscode folder
197
+ # .vscode/
198
+
199
+ # Ruff stuff:
200
+ .ruff_cache/
201
+
202
+ # PyPI configuration file
203
+ .pypirc
204
+
205
+ # Cursor
206
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
207
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
208
+ # refer to https://docs.cursor.com/context/ignore-files
209
+ .cursorignore
210
+ .cursorindexingignore
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
@@ -0,0 +1,76 @@
1
+ # AGENTS.md
2
+
3
+ Instructions for AI agents working on this codebase.
4
+
5
+ ## Orientation
6
+
7
+ Read `docs/specs/00-overview.md` first — it has the tech stack, project structure, module dependency graph, config format, and REST API summary.
8
+
9
+ ## Specs
10
+
11
+ Every module has a spec in `docs/specs/`, numbered by dependency order. Each spec is the authoritative reference for its module: it includes all models, file paths, API routes, and acceptance criteria.
12
+
13
+ - **Read the relevant spec before modifying a module.**
14
+ - When adding a feature that spans modules, update all affected specs.
15
+ - If a new independent module is needed, create a new numbered spec following the same format.
16
+ - Specs are self-contained, agent-optimized, and ordered so module N only depends on modules < N.
17
+
18
+ ## Workflow for new features
19
+
20
+ Before implementing a new feature, identify which modules and specs are affected. Present this list to the user for approval before writing any code. This includes:
21
+
22
+ - Which spec files will be read and potentially updated.
23
+ - Which source modules will be modified or created.
24
+ - Whether new tests are needed and where they belong.
25
+
26
+ ## Commands
27
+
28
+ Run `just --list` to see all available recipes. The key one is:
29
+
30
+ ```bash
31
+ just check # format + lint + test — run this after every change
32
+ ```
33
+
34
+ After any code change, run `just check` and verify zero failures before considering the change complete.
35
+
36
+ ## Commits
37
+
38
+ All commits must use [Conventional Commits](https://www.conventionalcommits.org/) format:
39
+
40
+ ```
41
+ <type>(<optional scope>): <description>
42
+ ```
43
+
44
+ Common types: `feat`, `fix`, `docs`, `refactor`, `test`, `build`, `ci`, `chore`.
45
+
46
+ ## Testing
47
+
48
+ Tests mirror the source structure under `tests/`. Key conventions:
49
+
50
+ - All tests are async — no manual `@pytest.mark.asyncio` needed.
51
+ - GitHub API mocking uses `respx` — never make real API calls in tests.
52
+ - Web route tests populate the in-memory cache via `update_cache()` in a fixture.
53
+ - Filesystem-touching tests use `tmp_path` for isolation.
54
+
55
+ When modifying or adding functionality, add or update corresponding tests in the matching `tests/` subdirectory.
56
+
57
+ ## Database
58
+
59
+ We are in active development — there is no need for schema migrations. When changing the SQLite schema (adding/removing columns or tables), just update the SQLModel definitions and delete `grimoire.db`. It will be recreated on the next run.
60
+
61
+ ## Style
62
+
63
+ - Keep code simple, modular, and testable.
64
+ - Only comment where behavior is non-obvious.
65
+ - Use `TYPE_CHECKING` imports to avoid circular dependencies between modules.
66
+ - Module-level mutable state uses setter functions (e.g., `set_checks_state()`) for dependency injection and testability.
67
+
68
+ ## Documentation
69
+
70
+ User-facing documentation lives in `docs/user/` and is built with [MkDocs Material](https://squidfunnel.github.io/mkdocs-material/).
71
+
72
+ - **When adding or changing user-visible features, update the relevant page(s) in `docs/user/`.**
73
+ - Configuration changes → update `docs/user/configuration.md`.
74
+ - New check/action capabilities → update `docs/user/checks.md` or `docs/user/actions.md`.
75
+ - Preview locally with `just docs`.
76
+
@@ -0,0 +1,69 @@
1
+ # Contributing to Grimoire
2
+
3
+ Thanks for your interest in contributing! 🔮
4
+
5
+ ## Development Setup
6
+
7
+ ### Prerequisites
8
+
9
+ - Python 3.13+
10
+ - [uv](https://docs.astral.sh/uv/) — fast Python package manager
11
+ - [just](https://github.com/casey/just) — command runner
12
+
13
+ ### Getting Started
14
+
15
+ ```bash
16
+ # Clone the repo
17
+ git clone https://github.com/lucabello/grimoire.git
18
+ cd grimoire
19
+
20
+ # Install dependencies and activate the venv
21
+ just venv
22
+
23
+ # Copy and edit the config
24
+ cp config.yaml.example config.yaml
25
+
26
+ # Run in dev mode (auto-reload)
27
+ just dev
28
+ ```
29
+
30
+ ### Useful Commands
31
+
32
+ ```bash
33
+ just check # Run format + lint + test (do this before every commit)
34
+ just format # Auto-format code
35
+ just lint # Run all linters (ruff, pyright, codespell, vulture)
36
+ just test # Run the test suite
37
+ just coverage # Run tests with coverage report
38
+ just docs # Serve documentation locally
39
+ ```
40
+
41
+ ## Code Style
42
+
43
+ - **Formatter/Linter**: [Ruff](https://docs.astral.sh/ruff/) (line length: 99)
44
+ - **Type checking**: [Pyright](https://github.com/microsoft/pyright)
45
+ - Keep code simple, modular, and testable
46
+ - Only comment where behavior is non-obvious
47
+ - Use `TYPE_CHECKING` imports to avoid circular dependencies
48
+
49
+ ## Testing
50
+
51
+ Tests live under `tests/`, mirroring the `src/` structure.
52
+
53
+ - All tests are **async** — no manual `@pytest.mark.asyncio` needed
54
+ - GitHub API mocking uses **respx** — never make real API calls
55
+ - Use `tmp_path` for filesystem isolation
56
+
57
+ When adding a feature, add or update tests in the matching `tests/` subdirectory.
58
+
59
+ ## Pull Request Workflow
60
+
61
+ 1. Create a feature branch from `main`
62
+ 2. Make your changes
63
+ 3. Run `just check` and ensure all checks pass
64
+ 4. Push and open a PR against `main`
65
+ 5. Describe what your change does and link any related issues
66
+
67
+ ## Architecture
68
+
69
+ Developer specs live in [`docs/specs/`](docs/specs/). Start with [`00-overview.md`](docs/specs/00-overview.md) for the full architecture, module graph, and API reference.
@@ -0,0 +1,35 @@
1
+ FROM python:3.13-slim AS base
2
+
3
+ RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ git \
5
+ gpg \
6
+ ssh-client \
7
+ curl \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Install gh CLI
11
+ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
12
+ | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
13
+ && chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
14
+ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
15
+ | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
16
+ && apt-get update && apt-get install -y gh \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
20
+
21
+ WORKDIR /app
22
+
23
+ COPY pyproject.toml uv.lock ./
24
+ RUN uv sync --no-dev --frozen
25
+
26
+ COPY src/ src/
27
+ COPY docker-entrypoint.sh /usr/local/bin/
28
+
29
+ EXPOSE 8000
30
+
31
+ HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
32
+ CMD curl -f http://localhost:8000/health || exit 1
33
+
34
+ ENTRYPOINT ["docker-entrypoint.sh"]
35
+ CMD ["uv", "run", "uvicorn", "grimoire.app:create_app", "--factory", "--host", "0.0.0.0", "--port", "8000"]
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.