fathom-rules 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 (157) hide show
  1. fathom_rules-0.1.0/.gitignore +227 -0
  2. fathom_rules-0.1.0/.python-version +1 -0
  3. fathom_rules-0.1.0/Dockerfile +33 -0
  4. fathom_rules-0.1.0/LICENSE +21 -0
  5. fathom_rules-0.1.0/PKG-INFO +195 -0
  6. fathom_rules-0.1.0/README.md +138 -0
  7. fathom_rules-0.1.0/design.md +574 -0
  8. fathom_rules-0.1.0/docs/_index.md +53 -0
  9. fathom_rules-0.1.0/docs/_prompts/audit.md +75 -0
  10. fathom_rules-0.1.0/docs/_prompts/lint.md +50 -0
  11. fathom_rules-0.1.0/docs/_prompts/update.md +57 -0
  12. fathom_rules-0.1.0/docs/api/attestation.md +3 -0
  13. fathom_rules-0.1.0/docs/api/audit.md +3 -0
  14. fathom_rules-0.1.0/docs/api/compiler.md +3 -0
  15. fathom_rules-0.1.0/docs/api/engine.md +3 -0
  16. fathom_rules-0.1.0/docs/api/evaluator.md +3 -0
  17. fathom_rules-0.1.0/docs/api/facts.md +3 -0
  18. fathom_rules-0.1.0/docs/core/attestation.md +111 -0
  19. fathom_rules-0.1.0/docs/core/audit-log.md +111 -0
  20. fathom_rules-0.1.0/docs/core/backward-chaining.md +65 -0
  21. fathom_rules-0.1.0/docs/core/cool.md +72 -0
  22. fathom_rules-0.1.0/docs/core/fact-asserter.md +117 -0
  23. fathom_rules-0.1.0/docs/core/forward-chaining.md +126 -0
  24. fathom_rules-0.1.0/docs/core/message-handlers.md +80 -0
  25. fathom_rules-0.1.0/docs/core/primitives.md +204 -0
  26. fathom_rules-0.1.0/docs/core/runtime.md +125 -0
  27. fathom_rules-0.1.0/docs/core/visual-editor.md +0 -0
  28. fathom_rules-0.1.0/docs/core/working-memory.md +195 -0
  29. fathom_rules-0.1.0/docs/core/yaml-compiler.md +137 -0
  30. fathom_rules-0.1.0/docs/getting-started.md +166 -0
  31. fathom_rules-0.1.0/docs/integration.md +140 -0
  32. fathom_rules-0.1.0/docs/integrations/cli.md +0 -0
  33. fathom_rules-0.1.0/docs/integrations/crew-ai.md +101 -0
  34. fathom_rules-0.1.0/docs/integrations/go-sdk.md +119 -0
  35. fathom_rules-0.1.0/docs/integrations/google-adk.md +100 -0
  36. fathom_rules-0.1.0/docs/integrations/langchain.md +92 -0
  37. fathom_rules-0.1.0/docs/integrations/mcp.md +98 -0
  38. fathom_rules-0.1.0/docs/integrations/open-ai-agent-sdk.md +99 -0
  39. fathom_rules-0.1.0/docs/integrations/prometheus.md +0 -0
  40. fathom_rules-0.1.0/docs/integrations/sidecar.md +113 -0
  41. fathom_rules-0.1.0/docs/integrations/typescript-sdk.md +124 -0
  42. fathom_rules-0.1.0/docs/rule-packs/cmmc.md +197 -0
  43. fathom_rules-0.1.0/docs/rule-packs/hipaa.md +169 -0
  44. fathom_rules-0.1.0/docs/rule-packs/nist-ai-rmf.md +184 -0
  45. fathom_rules-0.1.0/docs/rule-packs/owasp-agentic.md +151 -0
  46. fathom_rules-0.1.0/docs/writing-rules.md +217 -0
  47. fathom_rules-0.1.0/docs/yaml/yaml-facts.md +153 -0
  48. fathom_rules-0.1.0/docs/yaml/yaml-functions.md +213 -0
  49. fathom_rules-0.1.0/docs/yaml/yaml-modules.md +226 -0
  50. fathom_rules-0.1.0/docs/yaml/yaml-rule-language.md +197 -0
  51. fathom_rules-0.1.0/docs/yaml/yaml-templates.md +193 -0
  52. fathom_rules-0.1.0/mkdocs.yml +93 -0
  53. fathom_rules-0.1.0/packages/fathom-editor/index.html +12 -0
  54. fathom_rules-0.1.0/packages/fathom-editor/package.json +22 -0
  55. fathom_rules-0.1.0/packages/fathom-editor/src/App.tsx +163 -0
  56. fathom_rules-0.1.0/packages/fathom-editor/src/api/fathom.ts +93 -0
  57. fathom_rules-0.1.0/packages/fathom-editor/src/components/ClipsPreview.tsx +111 -0
  58. fathom_rules-0.1.0/packages/fathom-editor/src/components/ConditionBuilder.tsx +254 -0
  59. fathom_rules-0.1.0/packages/fathom-editor/src/components/RuleTree.tsx +194 -0
  60. fathom_rules-0.1.0/packages/fathom-editor/src/components/TemplateBrowser.tsx +212 -0
  61. fathom_rules-0.1.0/packages/fathom-editor/src/components/TestRunner.tsx +291 -0
  62. fathom_rules-0.1.0/packages/fathom-editor/src/components/YamlEditor.tsx +105 -0
  63. fathom_rules-0.1.0/packages/fathom-editor/src/main.tsx +9 -0
  64. fathom_rules-0.1.0/packages/fathom-editor/tsconfig.json +21 -0
  65. fathom_rules-0.1.0/packages/fathom-editor/vite.config.ts +19 -0
  66. fathom_rules-0.1.0/packages/fathom-go/Makefile +43 -0
  67. fathom_rules-0.1.0/packages/fathom-go/client.go +189 -0
  68. fathom_rules-0.1.0/packages/fathom-go/go.mod +3 -0
  69. fathom_rules-0.1.0/packages/fathom-ts/package.json +29 -0
  70. fathom_rules-0.1.0/packages/fathom-ts/scripts/generate.sh +27 -0
  71. fathom_rules-0.1.0/packages/fathom-ts/src/client.ts +162 -0
  72. fathom_rules-0.1.0/packages/fathom-ts/tsconfig.json +19 -0
  73. fathom_rules-0.1.0/protos/fathom.proto +124 -0
  74. fathom_rules-0.1.0/pyproject.toml +133 -0
  75. fathom_rules-0.1.0/specs/phase-1/design.md +1258 -0
  76. fathom_rules-0.1.0/specs/phase-1/requirements.md +499 -0
  77. fathom_rules-0.1.0/specs/phase-1/research.md +404 -0
  78. fathom_rules-0.1.0/specs/phase-1/tasks.md +1662 -0
  79. fathom_rules-0.1.0/specs/phase-2/.ralph-state.json +24 -0
  80. fathom_rules-0.1.0/specs/phase-2/.tasks.lock +0 -0
  81. fathom_rules-0.1.0/specs/phase-2/design.md +1262 -0
  82. fathom_rules-0.1.0/specs/phase-2/requirements.md +623 -0
  83. fathom_rules-0.1.0/specs/phase-2/research.md +547 -0
  84. fathom_rules-0.1.0/specs/phase-2/tasks.md +1184 -0
  85. fathom_rules-0.1.0/src/fathom/__init__.py +16 -0
  86. fathom_rules-0.1.0/src/fathom/attestation.py +92 -0
  87. fathom_rules-0.1.0/src/fathom/audit.py +73 -0
  88. fathom_rules-0.1.0/src/fathom/cli.py +655 -0
  89. fathom_rules-0.1.0/src/fathom/compiler.py +1106 -0
  90. fathom_rules-0.1.0/src/fathom/engine.py +739 -0
  91. fathom_rules-0.1.0/src/fathom/errors.py +100 -0
  92. fathom_rules-0.1.0/src/fathom/evaluator.py +149 -0
  93. fathom_rules-0.1.0/src/fathom/facts.py +335 -0
  94. fathom_rules-0.1.0/src/fathom/fleet.py +203 -0
  95. fathom_rules-0.1.0/src/fathom/fleet_pg.py +389 -0
  96. fathom_rules-0.1.0/src/fathom/fleet_redis.py +347 -0
  97. fathom_rules-0.1.0/src/fathom/integrations/__init__.py +0 -0
  98. fathom_rules-0.1.0/src/fathom/integrations/grpc_server.py +196 -0
  99. fathom_rules-0.1.0/src/fathom/integrations/langchain.py +259 -0
  100. fathom_rules-0.1.0/src/fathom/integrations/mcp_server.py +99 -0
  101. fathom_rules-0.1.0/src/fathom/integrations/rest.py +228 -0
  102. fathom_rules-0.1.0/src/fathom/metrics.py +191 -0
  103. fathom_rules-0.1.0/src/fathom/models.py +216 -0
  104. fathom_rules-0.1.0/src/fathom/packs.py +66 -0
  105. fathom_rules-0.1.0/src/fathom/py.typed +0 -0
  106. fathom_rules-0.1.0/src/fathom/rule_packs/__init__.py +1 -0
  107. fathom_rules-0.1.0/src/fathom/rule_packs/_helpers.py +80 -0
  108. fathom_rules-0.1.0/src/fathom/rule_packs/cmmc/__init__.py +50 -0
  109. fathom_rules-0.1.0/src/fathom/rule_packs/cmmc/modules/cmmc_modules.yaml +6 -0
  110. fathom_rules-0.1.0/src/fathom/rule_packs/cmmc/rules/cmmc_rules.yaml +131 -0
  111. fathom_rules-0.1.0/src/fathom/rule_packs/cmmc/templates/cmmc_templates.yaml +21 -0
  112. fathom_rules-0.1.0/src/fathom/rule_packs/hipaa/__init__.py +45 -0
  113. fathom_rules-0.1.0/src/fathom/rule_packs/hipaa/modules/hipaa_modules.yaml +5 -0
  114. fathom_rules-0.1.0/src/fathom/rule_packs/hipaa/rules/hipaa_rules.yaml +63 -0
  115. fathom_rules-0.1.0/src/fathom/rule_packs/hipaa/templates/hipaa_templates.yaml +30 -0
  116. fathom_rules-0.1.0/src/fathom/rule_packs/nist_800_53/__init__.py +46 -0
  117. fathom_rules-0.1.0/src/fathom/rule_packs/nist_800_53/modules/nist_modules.yaml +5 -0
  118. fathom_rules-0.1.0/src/fathom/rule_packs/nist_800_53/rules/ac_rules.yaml +79 -0
  119. fathom_rules-0.1.0/src/fathom/rule_packs/nist_800_53/rules/au_rules.yaml +77 -0
  120. fathom_rules-0.1.0/src/fathom/rule_packs/nist_800_53/rules/sc_rules.yaml +41 -0
  121. fathom_rules-0.1.0/src/fathom/rule_packs/nist_800_53/templates/nist_templates.yaml +54 -0
  122. fathom_rules-0.1.0/src/fathom/rule_packs/owasp_agentic/__init__.py +7 -0
  123. fathom_rules-0.1.0/src/fathom/rule_packs/owasp_agentic/modules/owasp_modules.yaml +5 -0
  124. fathom_rules-0.1.0/src/fathom/rule_packs/owasp_agentic/rules/owasp_rules.yaml +53 -0
  125. fathom_rules-0.1.0/src/fathom/rule_packs/owasp_agentic/templates/owasp_templates.yaml +36 -0
  126. fathom_rules-0.1.0/src/fathom/yaml_utils.py +149 -0
  127. fathom_rules-0.1.0/tests/__init__.py +0 -0
  128. fathom_rules-0.1.0/tests/conftest.py +180 -0
  129. fathom_rules-0.1.0/tests/fixtures/functions/classification.yaml +5 -0
  130. fathom_rules-0.1.0/tests/fixtures/functions/temporal.yaml +10 -0
  131. fathom_rules-0.1.0/tests/fixtures/hierarchies/classification.yaml +7 -0
  132. fathom_rules-0.1.0/tests/fixtures/modules/modules.yaml +6 -0
  133. fathom_rules-0.1.0/tests/fixtures/rules/access-control.yaml +18 -0
  134. fathom_rules-0.1.0/tests/fixtures/templates/agent.yaml +20 -0
  135. fathom_rules-0.1.0/tests/test_attestation.py +265 -0
  136. fathom_rules-0.1.0/tests/test_audit.py +431 -0
  137. fathom_rules-0.1.0/tests/test_backward_chaining.py +216 -0
  138. fathom_rules-0.1.0/tests/test_classification_ops.py +358 -0
  139. fathom_rules-0.1.0/tests/test_cmmc_pack.py +369 -0
  140. fathom_rules-0.1.0/tests/test_compiler_functions.py +742 -0
  141. fathom_rules-0.1.0/tests/test_compiler_modules.py +498 -0
  142. fathom_rules-0.1.0/tests/test_compiler_rules.py +915 -0
  143. fathom_rules-0.1.0/tests/test_compiler_templates.py +931 -0
  144. fathom_rules-0.1.0/tests/test_evaluator.py +857 -0
  145. fathom_rules-0.1.0/tests/test_facts.py +995 -0
  146. fathom_rules-0.1.0/tests/test_hipaa_pack.py +218 -0
  147. fathom_rules-0.1.0/tests/test_integration.py +681 -0
  148. fathom_rules-0.1.0/tests/test_langchain.py +323 -0
  149. fathom_rules-0.1.0/tests/test_mcp.py +422 -0
  150. fathom_rules-0.1.0/tests/test_nist_pack.py +579 -0
  151. fathom_rules-0.1.0/tests/test_owasp_pack.py +220 -0
  152. fathom_rules-0.1.0/tests/test_property_based.py +298 -0
  153. fathom_rules-0.1.0/tests/test_rest.py +560 -0
  154. fathom_rules-0.1.0/tests/test_sdk.py +395 -0
  155. fathom_rules-0.1.0/tests/test_temporal_ops.py +508 -0
  156. fathom_rules-0.1.0/tests/test_temporal_property.py +401 -0
  157. fathom_rules-0.1.0/tests/test_working_memory.py +742 -0
@@ -0,0 +1,227 @@
1
+ ./specs/
2
+ .claude
3
+ .vscode
4
+ .cursor
5
+ .worktrees
6
+
7
+ CLAUDE.md
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
+ # Redis
143
+ *.rdb
144
+ *.aof
145
+ *.pid
146
+
147
+ # RabbitMQ
148
+ mnesia/
149
+ rabbitmq/
150
+ rabbitmq-data/
151
+
152
+ # ActiveMQ
153
+ activemq-data/
154
+
155
+ # SageMath parsed files
156
+ *.sage.py
157
+
158
+ # Environments
159
+ .env
160
+ .envrc
161
+ .venv
162
+ env/
163
+ venv/
164
+ ENV/
165
+ env.bak/
166
+ venv.bak/
167
+
168
+ # Spyder project settings
169
+ .spyderproject
170
+ .spyproject
171
+
172
+ # Rope project settings
173
+ .ropeproject
174
+
175
+ # mkdocs documentation
176
+ /site
177
+
178
+ # mypy
179
+ .mypy_cache/
180
+ .dmypy.json
181
+ dmypy.json
182
+
183
+ # Pyre type checker
184
+ .pyre/
185
+
186
+ # pytype static type analyzer
187
+ .pytype/
188
+
189
+ # Cython debug symbols
190
+ cython_debug/
191
+
192
+ # PyCharm
193
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
194
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
195
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
196
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
197
+ # .idea/
198
+
199
+ # Abstra
200
+ # Abstra is an AI-powered process automation framework.
201
+ # Ignore directories containing user credentials, local state, and settings.
202
+ # Learn more at https://abstra.io/docs
203
+ .abstra/
204
+
205
+ # Visual Studio Code
206
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
207
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
208
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
209
+ # you could uncomment the following to ignore the entire vscode folder
210
+ # .vscode/
211
+
212
+ # Ruff stuff:
213
+ .ruff_cache/
214
+
215
+ # PyPI configuration file
216
+ .pypirc
217
+
218
+ # Marimo
219
+ marimo/_static/
220
+ marimo/_lsp/
221
+ __marimo__/
222
+
223
+ # Streamlit
224
+ .streamlit/secrets.toml
225
+ specs/.current-spec
226
+ specs/phase-1/.tasks.lock
227
+ **/.progress.md
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,33 @@
1
+ # Debian-based image — CLIPS (clipspy) requires glibc, Alpine won't work
2
+ FROM python:3.14-slim-bookworm
3
+
4
+ # Install system deps for building clipspy
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ gcc \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # Install uv
10
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
11
+
12
+ # Create non-root user
13
+ RUN useradd --create-home --shell /bin/bash fathom
14
+ USER fathom
15
+ WORKDIR /home/fathom/app
16
+
17
+ # Copy project files
18
+ COPY --chown=fathom:fathom pyproject.toml uv.lock ./
19
+ COPY --chown=fathom:fathom src/ ./src/
20
+
21
+ # Install with server extras (no dev dependencies)
22
+ RUN uv sync --extra server --no-dev
23
+
24
+ # Create mount point for rules
25
+ RUN mkdir -p /rules
26
+ VOLUME ["/rules"]
27
+
28
+ # Configurable port
29
+ ENV PORT=8080
30
+ EXPOSE ${PORT}
31
+
32
+ # Run the REST server
33
+ CMD ["uv", "run", "uvicorn", "fathom.integrations.rest:app", "--host", "0.0.0.0", "--port", "8080"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kraken Networks
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.
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: fathom-rules
3
+ Version: 0.1.0
4
+ Summary: Deterministic reasoning runtime for AI agents, built on CLIPS via clipspy
5
+ Project-URL: Homepage, https://github.com/kraken-networks/fathom
6
+ Project-URL: Repository, https://github.com/kraken-networks/fathom
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
14
+ Requires-Python: >=3.14
15
+ Requires-Dist: clipspy<1.1,>=1.0.6
16
+ Requires-Dist: pydantic>=2.0
17
+ Requires-Dist: pyyaml>=6.0
18
+ Provides-Extra: all
19
+ Requires-Dist: asyncpg; extra == 'all'
20
+ Requires-Dist: cryptography>=42.0; extra == 'all'
21
+ Requires-Dist: fastapi>=0.100; extra == 'all'
22
+ Requires-Dist: grpcio-tools; extra == 'all'
23
+ Requires-Dist: grpcio>=1.60; extra == 'all'
24
+ Requires-Dist: langchain-core>=0.2; extra == 'all'
25
+ Requires-Dist: mcp>=1.0; extra == 'all'
26
+ Requires-Dist: prometheus-client; extra == 'all'
27
+ Requires-Dist: prometheus-fastapi-instrumentator; extra == 'all'
28
+ Requires-Dist: pyjwt[crypto]>=2.8; extra == 'all'
29
+ Requires-Dist: redis[hiredis]; extra == 'all'
30
+ Requires-Dist: rich>=13; extra == 'all'
31
+ Requires-Dist: typer[all]>=0.12; extra == 'all'
32
+ Requires-Dist: uvicorn>=0.20; extra == 'all'
33
+ Provides-Extra: attestation
34
+ Requires-Dist: cryptography>=42.0; extra == 'attestation'
35
+ Requires-Dist: pyjwt[crypto]>=2.8; extra == 'attestation'
36
+ Provides-Extra: cli
37
+ Requires-Dist: rich>=13; extra == 'cli'
38
+ Requires-Dist: typer[all]>=0.12; extra == 'cli'
39
+ Provides-Extra: fleet
40
+ Requires-Dist: redis[hiredis]; extra == 'fleet'
41
+ Provides-Extra: fleet-pg
42
+ Requires-Dist: asyncpg; extra == 'fleet-pg'
43
+ Provides-Extra: grpc
44
+ Requires-Dist: grpcio-tools; extra == 'grpc'
45
+ Requires-Dist: grpcio>=1.60; extra == 'grpc'
46
+ Provides-Extra: langchain
47
+ Requires-Dist: langchain-core>=0.2; extra == 'langchain'
48
+ Provides-Extra: mcp
49
+ Requires-Dist: mcp>=1.0; extra == 'mcp'
50
+ Provides-Extra: metrics
51
+ Requires-Dist: prometheus-client; extra == 'metrics'
52
+ Requires-Dist: prometheus-fastapi-instrumentator; extra == 'metrics'
53
+ Provides-Extra: server
54
+ Requires-Dist: fastapi>=0.100; extra == 'server'
55
+ Requires-Dist: uvicorn>=0.20; extra == 'server'
56
+ Description-Content-Type: text/markdown
57
+
58
+ # Fathom
59
+
60
+ > A modern Python-first expert system runtime built on CLIPS. Define rules in YAML. Evaluate in microseconds. Zero hallucinations.
61
+
62
+ **Status:** Design Draft
63
+ **License:** MIT
64
+ **Language:** Python 3.14+
65
+ **Package Manager:** uv
66
+
67
+ ---
68
+
69
+ ## Why Fathom?
70
+
71
+ Every AI agent framework lets agents decide what to do by guessing. For most tasks, that's fine.
72
+
73
+ For some tasks, guessing is unacceptable:
74
+
75
+ - **Policy enforcement** — "Is this agent allowed to do this?" can't be a maybe.
76
+ - **Data routing** — "Which databases should this query hit?" can't hallucinate a source.
77
+ - **Compliance** — "Did this fleet operate within NIST 800-53 controls?" needs a provable answer.
78
+ - **Classification** — "What clearance level does this data require?" is not a prompt engineering problem.
79
+
80
+ Fathom provides **deterministic, explainable, auditable reasoning** using CLIPS — a battle-tested expert system — wrapped in a modern Python library with YAML-first rule authoring.
81
+
82
+ ## Quick Start
83
+
84
+ ```bash
85
+ uv add fathom-rules
86
+ ```
87
+
88
+ ```python
89
+ from fathom import Engine
90
+
91
+ engine = Engine()
92
+ engine.load_templates("templates/")
93
+ engine.load_rules("rules/")
94
+
95
+ engine.assert_fact("agent", {
96
+ "id": "agent-alpha",
97
+ "clearance": "secret",
98
+ "purpose": "threat-analysis",
99
+ "session_id": "sess-001"
100
+ })
101
+
102
+ engine.assert_fact("data_request", {
103
+ "agent_id": "agent-alpha",
104
+ "target": "hr_records",
105
+ "classification": "top-secret",
106
+ "action": "read"
107
+ })
108
+
109
+ result = engine.evaluate()
110
+ print(result.decision) # "deny"
111
+ print(result.reason) # "Agent clearance 'secret' insufficient for 'top-secret' data"
112
+ print(result.duration_us) # 47
113
+ ```
114
+
115
+ ## Core Primitives
116
+
117
+ | Primitive | Purpose | CLIPS Construct |
118
+ |-----------|---------|-----------------|
119
+ | **Templates** | Define fact schemas with typed slots | `deftemplate` |
120
+ | **Facts** | Typed instances asserted into working memory | working memory |
121
+ | **Rules** | Pattern-matching logic with conditions and actions | `defrule` |
122
+ | **Modules** | Namespace rules with controlled execution order | `defmodule` |
123
+ | **Functions** | Reusable logic for conditions and actions | `deffunction` |
124
+
125
+ ## Key Differentiator: Working Memory
126
+
127
+ Unlike stateless policy engines (OPA, Cedar), Fathom maintains working memory across evaluations within a session:
128
+
129
+ - **Cumulative reasoning** — "This agent accessed PII from 3 sources — deny the 4th."
130
+ - **Temporal patterns** — "Denial rate spiked 400% in 10 minutes — escalate."
131
+ - **Cross-fact inference** — "Agent A passed data to Agent B, who is requesting external access — violation."
132
+
133
+ ## Integration
134
+
135
+ **As a library:**
136
+ ```python
137
+ from fathom import Engine
138
+ engine = Engine.from_rules("rules/")
139
+ result = engine.evaluate()
140
+ ```
141
+
142
+ **As a sidecar:**
143
+ ```bash
144
+ docker run -p 8080:8080 -v ./rules:/rules kraken/fathom:latest
145
+ curl -X POST localhost:8080/v1/evaluate -d '{"facts": [...], "ruleset": "access-control"}'
146
+ ```
147
+
148
+ **As an MCP tool:**
149
+ ```python
150
+ from fathom.integrations.mcp import FathomMCPServer
151
+ server = FathomMCPServer(engine)
152
+ server.serve()
153
+ ```
154
+
155
+ ## Rule Packs
156
+
157
+ Pre-built rule collections (planned):
158
+
159
+ - `fathom-owasp-agentic` — OWASP Agentic Top 10 mitigations
160
+ - `fathom-nist-800-53` — Access control, audit, information flow
161
+ - `fathom-hipaa` — PHI handling, minimum necessary, breach triggers
162
+ - `fathom-cmmc` — CMMC Level 2+ controls
163
+
164
+ ## Performance Targets
165
+
166
+ | Operation | Target |
167
+ |-----------|--------|
168
+ | Single rule evaluation | < 100µs |
169
+ | 100-rule evaluation | < 500µs |
170
+ | Fact assertion | < 10µs |
171
+ | YAML compilation | < 50ms |
172
+
173
+ ## Related Projects
174
+
175
+ - **Bosun** — Agent governance built on Fathom (fleet analysis, compliance attestation)
176
+ - **Nautilus** — Intelligent data broker built on Fathom (multi-source routing, classification-aware scoping)
177
+
178
+ ## Development
179
+
180
+ ```bash
181
+ git clone <repo-url>
182
+ cd fathom
183
+ uv sync
184
+ uv run pytest
185
+ ```
186
+
187
+ See [design.md](design.md) for the full specification and roadmap.
188
+
189
+ ## License
190
+
191
+ MIT — see [LICENSE](LICENSE) for details.
192
+
193
+ ---
194
+
195
+ Maintained by [Kraken Networks](https://github.com/kraken-networks)
@@ -0,0 +1,138 @@
1
+ # Fathom
2
+
3
+ > A modern Python-first expert system runtime built on CLIPS. Define rules in YAML. Evaluate in microseconds. Zero hallucinations.
4
+
5
+ **Status:** Design Draft
6
+ **License:** MIT
7
+ **Language:** Python 3.14+
8
+ **Package Manager:** uv
9
+
10
+ ---
11
+
12
+ ## Why Fathom?
13
+
14
+ Every AI agent framework lets agents decide what to do by guessing. For most tasks, that's fine.
15
+
16
+ For some tasks, guessing is unacceptable:
17
+
18
+ - **Policy enforcement** — "Is this agent allowed to do this?" can't be a maybe.
19
+ - **Data routing** — "Which databases should this query hit?" can't hallucinate a source.
20
+ - **Compliance** — "Did this fleet operate within NIST 800-53 controls?" needs a provable answer.
21
+ - **Classification** — "What clearance level does this data require?" is not a prompt engineering problem.
22
+
23
+ Fathom provides **deterministic, explainable, auditable reasoning** using CLIPS — a battle-tested expert system — wrapped in a modern Python library with YAML-first rule authoring.
24
+
25
+ ## Quick Start
26
+
27
+ ```bash
28
+ uv add fathom-rules
29
+ ```
30
+
31
+ ```python
32
+ from fathom import Engine
33
+
34
+ engine = Engine()
35
+ engine.load_templates("templates/")
36
+ engine.load_rules("rules/")
37
+
38
+ engine.assert_fact("agent", {
39
+ "id": "agent-alpha",
40
+ "clearance": "secret",
41
+ "purpose": "threat-analysis",
42
+ "session_id": "sess-001"
43
+ })
44
+
45
+ engine.assert_fact("data_request", {
46
+ "agent_id": "agent-alpha",
47
+ "target": "hr_records",
48
+ "classification": "top-secret",
49
+ "action": "read"
50
+ })
51
+
52
+ result = engine.evaluate()
53
+ print(result.decision) # "deny"
54
+ print(result.reason) # "Agent clearance 'secret' insufficient for 'top-secret' data"
55
+ print(result.duration_us) # 47
56
+ ```
57
+
58
+ ## Core Primitives
59
+
60
+ | Primitive | Purpose | CLIPS Construct |
61
+ |-----------|---------|-----------------|
62
+ | **Templates** | Define fact schemas with typed slots | `deftemplate` |
63
+ | **Facts** | Typed instances asserted into working memory | working memory |
64
+ | **Rules** | Pattern-matching logic with conditions and actions | `defrule` |
65
+ | **Modules** | Namespace rules with controlled execution order | `defmodule` |
66
+ | **Functions** | Reusable logic for conditions and actions | `deffunction` |
67
+
68
+ ## Key Differentiator: Working Memory
69
+
70
+ Unlike stateless policy engines (OPA, Cedar), Fathom maintains working memory across evaluations within a session:
71
+
72
+ - **Cumulative reasoning** — "This agent accessed PII from 3 sources — deny the 4th."
73
+ - **Temporal patterns** — "Denial rate spiked 400% in 10 minutes — escalate."
74
+ - **Cross-fact inference** — "Agent A passed data to Agent B, who is requesting external access — violation."
75
+
76
+ ## Integration
77
+
78
+ **As a library:**
79
+ ```python
80
+ from fathom import Engine
81
+ engine = Engine.from_rules("rules/")
82
+ result = engine.evaluate()
83
+ ```
84
+
85
+ **As a sidecar:**
86
+ ```bash
87
+ docker run -p 8080:8080 -v ./rules:/rules kraken/fathom:latest
88
+ curl -X POST localhost:8080/v1/evaluate -d '{"facts": [...], "ruleset": "access-control"}'
89
+ ```
90
+
91
+ **As an MCP tool:**
92
+ ```python
93
+ from fathom.integrations.mcp import FathomMCPServer
94
+ server = FathomMCPServer(engine)
95
+ server.serve()
96
+ ```
97
+
98
+ ## Rule Packs
99
+
100
+ Pre-built rule collections (planned):
101
+
102
+ - `fathom-owasp-agentic` — OWASP Agentic Top 10 mitigations
103
+ - `fathom-nist-800-53` — Access control, audit, information flow
104
+ - `fathom-hipaa` — PHI handling, minimum necessary, breach triggers
105
+ - `fathom-cmmc` — CMMC Level 2+ controls
106
+
107
+ ## Performance Targets
108
+
109
+ | Operation | Target |
110
+ |-----------|--------|
111
+ | Single rule evaluation | < 100µs |
112
+ | 100-rule evaluation | < 500µs |
113
+ | Fact assertion | < 10µs |
114
+ | YAML compilation | < 50ms |
115
+
116
+ ## Related Projects
117
+
118
+ - **Bosun** — Agent governance built on Fathom (fleet analysis, compliance attestation)
119
+ - **Nautilus** — Intelligent data broker built on Fathom (multi-source routing, classification-aware scoping)
120
+
121
+ ## Development
122
+
123
+ ```bash
124
+ git clone <repo-url>
125
+ cd fathom
126
+ uv sync
127
+ uv run pytest
128
+ ```
129
+
130
+ See [design.md](design.md) for the full specification and roadmap.
131
+
132
+ ## License
133
+
134
+ MIT — see [LICENSE](LICENSE) for details.
135
+
136
+ ---
137
+
138
+ Maintained by [Kraken Networks](https://github.com/kraken-networks)