anaxigraph 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 (82) hide show
  1. anaxigraph-0.1.0/.anaxigraph.yml +80 -0
  2. anaxigraph-0.1.0/.dockerignore +16 -0
  3. anaxigraph-0.1.0/.env.example +25 -0
  4. anaxigraph-0.1.0/Dockerfile +27 -0
  5. anaxigraph-0.1.0/LICENSE +134 -0
  6. anaxigraph-0.1.0/MANIFEST.in +12 -0
  7. anaxigraph-0.1.0/PKG-INFO +326 -0
  8. anaxigraph-0.1.0/README.md +297 -0
  9. anaxigraph-0.1.0/compose.maxos.yml +17 -0
  10. anaxigraph-0.1.0/compose.yml +120 -0
  11. anaxigraph-0.1.0/docs/architecture.md +65 -0
  12. anaxigraph-0.1.0/docs/coding-patterns.md +22 -0
  13. anaxigraph-0.1.0/docs/data-model.md +46 -0
  14. anaxigraph-0.1.0/docs/docker.md +232 -0
  15. anaxigraph-0.1.0/docs/feature-development-plan.md +469 -0
  16. anaxigraph-0.1.0/docs/maxos-agent.md +144 -0
  17. anaxigraph-0.1.0/docs/onboarding.md +346 -0
  18. anaxigraph-0.1.0/docs/plugin-system.md +33 -0
  19. anaxigraph-0.1.0/examples/maxos-agent.anaxigraph.yml +215 -0
  20. anaxigraph-0.1.0/pyproject.toml +64 -0
  21. anaxigraph-0.1.0/repo_instructions.md +2013 -0
  22. anaxigraph-0.1.0/repositories.example.yml +14 -0
  23. anaxigraph-0.1.0/setup.cfg +4 -0
  24. anaxigraph-0.1.0/src/anaxigraph/__init__.py +7 -0
  25. anaxigraph-0.1.0/src/anaxigraph/__main__.py +4 -0
  26. anaxigraph-0.1.0/src/anaxigraph/agent.py +934 -0
  27. anaxigraph-0.1.0/src/anaxigraph/analyzers/__init__.py +17 -0
  28. anaxigraph-0.1.0/src/anaxigraph/analyzers/base.py +30 -0
  29. anaxigraph-0.1.0/src/anaxigraph/analyzers/javascript.py +265 -0
  30. anaxigraph-0.1.0/src/anaxigraph/analyzers/python.py +380 -0
  31. anaxigraph-0.1.0/src/anaxigraph/analyzers/text.py +222 -0
  32. anaxigraph-0.1.0/src/anaxigraph/api.py +616 -0
  33. anaxigraph-0.1.0/src/anaxigraph/architecture.py +780 -0
  34. anaxigraph-0.1.0/src/anaxigraph/cli.py +653 -0
  35. anaxigraph-0.1.0/src/anaxigraph/config.py +362 -0
  36. anaxigraph-0.1.0/src/anaxigraph/coverage.py +215 -0
  37. anaxigraph-0.1.0/src/anaxigraph/dashboard/__init__.py +1 -0
  38. anaxigraph-0.1.0/src/anaxigraph/dashboard/app.js +2091 -0
  39. anaxigraph-0.1.0/src/anaxigraph/dashboard/favicon.svg +20 -0
  40. anaxigraph-0.1.0/src/anaxigraph/dashboard/index.html +472 -0
  41. anaxigraph-0.1.0/src/anaxigraph/dashboard/mask-icon.svg +6 -0
  42. anaxigraph-0.1.0/src/anaxigraph/dashboard/styles.css +721 -0
  43. anaxigraph-0.1.0/src/anaxigraph/git.py +271 -0
  44. anaxigraph-0.1.0/src/anaxigraph/guidance.py +148 -0
  45. anaxigraph-0.1.0/src/anaxigraph/history.py +117 -0
  46. anaxigraph-0.1.0/src/anaxigraph/languages.py +123 -0
  47. anaxigraph-0.1.0/src/anaxigraph/mcp_server.py +462 -0
  48. anaxigraph-0.1.0/src/anaxigraph/models.py +88 -0
  49. anaxigraph-0.1.0/src/anaxigraph/onboarding.py +504 -0
  50. anaxigraph-0.1.0/src/anaxigraph/registry.py +85 -0
  51. anaxigraph-0.1.0/src/anaxigraph/relationships.py +75 -0
  52. anaxigraph-0.1.0/src/anaxigraph/scanner.py +1164 -0
  53. anaxigraph-0.1.0/src/anaxigraph/semantic.py +353 -0
  54. anaxigraph-0.1.0/src/anaxigraph/semantic_agent.py +343 -0
  55. anaxigraph-0.1.0/src/anaxigraph/semantic_agent_protocol.py +220 -0
  56. anaxigraph-0.1.0/src/anaxigraph/semantic_contract.py +356 -0
  57. anaxigraph-0.1.0/src/anaxigraph/semantic_graph.py +219 -0
  58. anaxigraph-0.1.0/src/anaxigraph/semantic_module_plan.py +302 -0
  59. anaxigraph-0.1.0/src/anaxigraph/semantic_records.py +335 -0
  60. anaxigraph-0.1.0/src/anaxigraph/semantic_reporting.py +249 -0
  61. anaxigraph-0.1.0/src/anaxigraph/semantic_requests.py +271 -0
  62. anaxigraph-0.1.0/src/anaxigraph/semantic_results.py +210 -0
  63. anaxigraph-0.1.0/src/anaxigraph/semantic_runner.py +423 -0
  64. anaxigraph-0.1.0/src/anaxigraph/semantic_scope_plan.py +376 -0
  65. anaxigraph-0.1.0/src/anaxigraph/storage.py +1809 -0
  66. anaxigraph-0.1.0/src/anaxigraph/understanding.py +29 -0
  67. anaxigraph-0.1.0/src/anaxigraph.egg-info/PKG-INFO +326 -0
  68. anaxigraph-0.1.0/src/anaxigraph.egg-info/SOURCES.txt +80 -0
  69. anaxigraph-0.1.0/src/anaxigraph.egg-info/dependency_links.txt +1 -0
  70. anaxigraph-0.1.0/src/anaxigraph.egg-info/entry_points.txt +2 -0
  71. anaxigraph-0.1.0/src/anaxigraph.egg-info/requires.txt +10 -0
  72. anaxigraph-0.1.0/src/anaxigraph.egg-info/top_level.txt +1 -0
  73. anaxigraph-0.1.0/tests/test_agent.py +83 -0
  74. anaxigraph-0.1.0/tests/test_analyzers.py +73 -0
  75. anaxigraph-0.1.0/tests/test_api_mcp.py +273 -0
  76. anaxigraph-0.1.0/tests/test_config.py +115 -0
  77. anaxigraph-0.1.0/tests/test_history_registry.py +94 -0
  78. anaxigraph-0.1.0/tests/test_onboarding.py +108 -0
  79. anaxigraph-0.1.0/tests/test_product_names.py +12 -0
  80. anaxigraph-0.1.0/tests/test_scanner.py +313 -0
  81. anaxigraph-0.1.0/tests/test_semantic.py +188 -0
  82. anaxigraph-0.1.0/tests/test_understanding.py +568 -0
@@ -0,0 +1,80 @@
1
+ project:
2
+ name: AnaxiGraph
3
+
4
+ architecture:
5
+ policy: docs/coding-patterns.md
6
+ protected_paths:
7
+ - src/anaxigraph/storage.py
8
+ - src/anaxigraph/mcp_server.py
9
+ rules:
10
+ - id: module-size
11
+ type: max_module_loc
12
+ severity: warning
13
+ max: 500
14
+ paths: [src/**]
15
+ - id: function-size
16
+ type: max_function_lines
17
+ severity: info
18
+ max: 40
19
+ paths: [src/**]
20
+ - id: symbol-complexity
21
+ type: max_symbol_complexity
22
+ severity: warning
23
+ max: 15
24
+ - id: fan-out
25
+ type: max_fan_out
26
+ severity: warning
27
+ max: 15
28
+ - id: dependency-cycles
29
+ type: no_cycles
30
+ severity: error
31
+
32
+ groups:
33
+ extraction:
34
+ paths:
35
+ - src/anaxigraph/analyzers/**
36
+ - src/anaxigraph/languages.py
37
+ - src/anaxigraph/scanner.py
38
+ intelligence:
39
+ paths:
40
+ - src/anaxigraph/architecture.py
41
+ - src/anaxigraph/coverage.py
42
+ - src/anaxigraph/agent.py
43
+ - src/anaxigraph/semantic.py
44
+ - src/anaxigraph/semantic_*.py
45
+ - src/anaxigraph/understanding.py
46
+ persistence:
47
+ paths: [src/anaxigraph/storage.py]
48
+ interfaces:
49
+ paths:
50
+ - src/anaxigraph/api.py
51
+ - src/anaxigraph/mcp_server.py
52
+ - src/anaxigraph/cli.py
53
+ - src/anaxigraph/dashboard/**
54
+ tests:
55
+ paths: [tests/**]
56
+ documentation:
57
+ paths:
58
+ - docs/**
59
+ - '*.md'
60
+
61
+ agent:
62
+ context_limit: 25
63
+ neighbor_depth: 2
64
+ payload_limit_bytes: 20000
65
+ protected_paths:
66
+ - src/anaxigraph/storage.py
67
+ - src/anaxigraph/mcp_server.py
68
+
69
+ coverage:
70
+ files: [coverage.xml]
71
+
72
+ # Semantic understanding is opt-in because it sends eligible source and graph context to the
73
+ # configured model. See docs/onboarding.md before enabling it.
74
+ semantic:
75
+ enabled: false
76
+ provider: agent
77
+ refresh: manual
78
+ max_jobs_per_run: 100
79
+ max_parallel_jobs: 1
80
+ agent_lease_seconds: 1800
@@ -0,0 +1,16 @@
1
+ .anaxigraph
2
+ .git
3
+ .pytest_cache
4
+ .ruff_cache
5
+ .venv
6
+ node_modules
7
+ test-results
8
+ playwright-report
9
+ __pycache__
10
+ build
11
+ coverage.xml
12
+ dist
13
+ *.db
14
+ *.db-shm
15
+ *.db-wal
16
+ *.egg-info
@@ -0,0 +1,25 @@
1
+ # The sibling MaxOS checkout works without creating a .env file.
2
+ # Change this when the target repository lives elsewhere.
3
+ ANAXIGRAPH_REPOSITORY=../maxos_agent
4
+
5
+ # Parent directory containing every repository you want the container to see.
6
+ # It is mounted read-only at /repositories; only registry entries are scannable.
7
+ ANAXIGRAPH_REPOSITORIES_ROOT=..
8
+
9
+ # Copy repositories.example.yml to repositories.yml, add your repos, then set this.
10
+ ANAXIGRAPH_REGISTRY=./repositories.example.yml
11
+
12
+ # Dashboard/API port published only on the local machine by default.
13
+ ANAXIGRAPH_BIND_ADDRESS=127.0.0.1
14
+ ANAXIGRAPH_PORT=8765
15
+
16
+ # Optional continuous refresh interval used by the `watch` Compose profile.
17
+ ANAXIGRAPH_WATCH_INTERVAL=10
18
+
19
+ # Optional model-backed module understanding. Credentials stay in the environment, never in the
20
+ # repository policy. Leave both blank when semantic.enabled is false.
21
+ OPENAI_API_KEY=
22
+ ANTHROPIC_API_KEY=
23
+
24
+ # MaxOS's default Compose network. Override this if its project name changes.
25
+ MAXOS_DOCKER_NETWORK=maxos_agent_default
@@ -0,0 +1,27 @@
1
+ FROM python:3.12-slim
2
+
3
+ LABEL org.opencontainers.image.source="https://github.com/hcekne/anaxigraph" \
4
+ org.opencontainers.image.description="Temporal architecture intelligence for software repositories" \
5
+ org.opencontainers.image.licenses="Apache-2.0"
6
+
7
+ ENV PYTHONDONTWRITEBYTECODE=1 \
8
+ PYTHONUNBUFFERED=1 \
9
+ PIP_DISABLE_PIP_VERSION_CHECK=1 \
10
+ PIP_ROOT_USER_ACTION=ignore
11
+
12
+ WORKDIR /app
13
+ RUN apt-get update \
14
+ && DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends git \
15
+ && rm -rf /var/lib/apt/lists/*
16
+ COPY pyproject.toml README.md MANIFEST.in LICENSE /app/
17
+ COPY src /app/src
18
+ RUN pip install --no-cache-dir .
19
+
20
+ RUN useradd --create-home --uid 10001 anaxigraph \
21
+ && mkdir -p /state \
22
+ && chown anaxigraph:anaxigraph /state
23
+ USER anaxigraph
24
+
25
+ EXPOSE 8765
26
+ ENTRYPOINT ["anaxigraph"]
27
+ CMD ["serve", "--host", "0.0.0.0", "--port", "8765"]
@@ -0,0 +1,134 @@
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, and distribution as defined
10
+ by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is
13
+ granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are
16
+ controlled by, or are under common control with that entity. For the purposes of this definition,
17
+ "control" means (i) the power, direct or indirect, to cause the direction or management of such
18
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
19
+ outstanding shares, or (iii) beneficial ownership of such entity.
20
+
21
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this
22
+ License.
23
+
24
+ "Source" form shall mean the preferred form for making modifications, including but not limited to
25
+ software source code, documentation source, and configuration files.
26
+
27
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a
28
+ Source form, including but not limited to compiled object code, generated documentation, and
29
+ conversions to other media types.
30
+
31
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under
32
+ the License, as indicated by a copyright notice that is included in or attached to the work.
33
+
34
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or
35
+ derived from) the Work and for which the editorial revisions, annotations, elaborations, or other
36
+ modifications represent, as a whole, an original work of authorship. For the purposes of this
37
+ License, Derivative Works shall not include works that remain separable from, or merely link (or
38
+ bind by name) to the interfaces of, the Work and Derivative Works thereof.
39
+
40
+ "Contribution" shall mean any work of authorship, including the original version of the Work and
41
+ any modifications or additions to that Work or Derivative Works thereof, that is intentionally
42
+ submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or
43
+ Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this
44
+ definition, "submitted" means any form of electronic, verbal, or written communication sent to the
45
+ Licensor or its representatives, including but not limited to communication on electronic mailing
46
+ lists, source code control systems, and issue tracking systems that are managed by, or on behalf of,
47
+ the Licensor for the purpose of discussing and improving the Work, but excluding communication
48
+ that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a
49
+ Contribution."
50
+
51
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a
52
+ Contribution has been received by Licensor and subsequently incorporated within the Work.
53
+
54
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each
55
+ Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
56
+ irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display,
57
+ publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object
58
+ form.
59
+
60
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor
61
+ hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
62
+ (except as stated in this section) patent license to make, have made, use, offer to sell, sell,
63
+ import, and otherwise transfer the Work, where such license applies only to those patent claims
64
+ licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by
65
+ combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If
66
+ You institute patent litigation against any entity (including a cross-claim or counterclaim in a
67
+ lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct
68
+ or contributory patent infringement, then any patent licenses granted to You under this License for
69
+ that Work shall terminate as of the date such litigation is filed.
70
+
71
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof
72
+ in any medium, with or without modifications, and in Source or Object form, provided that You meet
73
+ the following conditions:
74
+
75
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
76
+
77
+ (b) You must cause any modified files to carry prominent notices stating that You changed the
78
+ files; and
79
+
80
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright,
81
+ patent, trademark, and attribution notices from the Source form of the Work, excluding those notices
82
+ that do not pertain to any part of the Derivative Works; and
83
+
84
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative
85
+ Works that You distribute must include a readable copy of the attribution notices contained within
86
+ such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works,
87
+ in at least one of the following places: within a NOTICE text file distributed as part of the
88
+ Derivative Works; within the Source form or documentation, if provided along with the Derivative
89
+ Works; or, within a display generated by the Derivative Works, if and wherever such third-party
90
+ notices normally appear. The contents of the NOTICE file are for informational purposes only and
91
+ do not modify the License. You may add Your own attribution notices within Derivative Works that You
92
+ distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such
93
+ additional attribution notices cannot be construed as modifying the License.
94
+
95
+ You may add Your own copyright statement to Your modifications and may provide additional or
96
+ different license terms and conditions for use, reproduction, or distribution of Your
97
+ modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and
98
+ distribution of the Work otherwise complies with the conditions stated in this License.
99
+
100
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution
101
+ intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms
102
+ and conditions of this License, without any additional terms or conditions. Notwithstanding the
103
+ above, nothing herein shall supersede or modify the terms of any separate license agreement you may
104
+ have executed with Licensor regarding such Contributions.
105
+
106
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service
107
+ marks, or product names of the Licensor, except as required for reasonable and customary use in
108
+ describing the origin of the Work and reproducing the content of the NOTICE file.
109
+
110
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor
111
+ provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT
112
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any
113
+ warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
114
+ PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing
115
+ the Work and assume any risks associated with Your exercise of permissions under this License.
116
+
117
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including
118
+ negligence), contract, or otherwise, unless required by applicable law (such as deliberate and
119
+ grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages,
120
+ including any direct, indirect, special, incidental, or consequential damages of any character
121
+ arising as a result of this License or out of the use or inability to use the Work (including but
122
+ not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any
123
+ and all other commercial damages or losses), even if such Contributor has been advised of the
124
+ possibility of such damages.
125
+
126
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works
127
+ thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity,
128
+ or other liability obligations and/or rights consistent with this License. However, in accepting
129
+ such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf
130
+ of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor
131
+ harmless for any liability incurred by, or claims asserted against, such Contributor by reason of
132
+ your accepting any such warranty or additional liability.
133
+
134
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,12 @@
1
+ include .anaxigraph.yml
2
+ include .dockerignore
3
+ include .env.example
4
+ include Dockerfile
5
+ include LICENSE
6
+ include compose.maxos.yml
7
+ include compose.yml
8
+ include repositories.example.yml
9
+ include repo_instructions.md
10
+ recursive-include docs *.md
11
+ recursive-include examples *.yml
12
+ recursive-include src/anaxigraph/dashboard *.html *.css *.js *.svg
@@ -0,0 +1,326 @@
1
+ Metadata-Version: 2.4
2
+ Name: anaxigraph
3
+ Version: 0.1.0
4
+ Summary: A temporal architecture and intelligence layer for software repositories
5
+ Author: AnaxiGraph contributors
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/hcekne/anaxigraph
8
+ Project-URL: Repository, https://github.com/hcekne/anaxigraph
9
+ Keywords: architecture,static-analysis,knowledge-graph,mcp,repository-analysis
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Software Development :: Quality Assurance
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: fastapi<1,>=0.115
20
+ Requires-Dist: mcp<2,>=1.28
21
+ Requires-Dist: PyYAML<7,>=6
22
+ Requires-Dist: uvicorn<1,>=0.30
23
+ Provides-Extra: dev
24
+ Requires-Dist: httpx<1,>=0.27; extra == "dev"
25
+ Requires-Dist: pytest<9,>=8; extra == "dev"
26
+ Requires-Dist: pytest-cov<7,>=5; extra == "dev"
27
+ Requires-Dist: ruff<1,>=0.9; extra == "dev"
28
+ Dynamic: license-file
29
+
30
+ <p align="center">
31
+ <img src="src/anaxigraph/dashboard/favicon.svg" width="112" alt="AnaxiGraph logo" />
32
+ </p>
33
+
34
+ <h1 align="center">AnaxiGraph</h1>
35
+
36
+ <p align="center">
37
+ <strong>Keep AI-accelerated codebases coherent as they grow.</strong><br />
38
+ See the architecture, control entropy, and give coding agents grounded context.
39
+ </p>
40
+
41
+ <p align="center">
42
+ <a href="https://github.com/hcekne/anaxigraph/actions/workflows/ci.yml"><img alt="CI status" src="https://github.com/hcekne/anaxigraph/actions/workflows/ci.yml/badge.svg" /></a>
43
+ <a href="LICENSE"><img alt="Apache 2.0 license" src="https://img.shields.io/badge/license-Apache--2.0-167a96" /></a>
44
+ <img alt="Python 3.11+" src="https://img.shields.io/badge/python-3.11%2B-315f9f" />
45
+ <img alt="MCP Streamable HTTP" src="https://img.shields.io/badge/MCP-Streamable_HTTP-7652a4" />
46
+ </p>
47
+
48
+ <p align="center">
49
+ <a href="docs/onboarding.md">Get started</a> Β·
50
+ <a href="docs/docker.md">Docker guide</a> Β·
51
+ <a href="CONTRIBUTING.md">Contribute</a>
52
+ </p>
53
+
54
+ AI makes it easy to add code faster than a team can understand the architecture absorbing it.
55
+ Hidden coupling, duplicated behavior, inconsistent abstractions, and one-off agent changes can
56
+ quietly accumulate into spaghetti code.
57
+
58
+ AnaxiGraph creates an architectural feedback loop for that problem. It turns a repository and its
59
+ Git history into a living, explorable system map, helping people and coding agents understand how
60
+ the code fits together before they change it. The goal is not architecture-by-score; it is to make
61
+ important trade-offs visible, evidence-backed, and reviewable while there is still time to act.
62
+
63
+ | | What you get |
64
+ |---|---|
65
+ | 🧹 **Control entropy** | Catch growing modules, dependency cycles, boundary erosion, and repeated responsibilities before they harden into spaghetti code. |
66
+ | πŸ›οΈ **Build for change** | Review whether boundaries, patterns, and abstraction candidates fit the codebase you have and the system you are building toward. |
67
+ | πŸ•ΈοΈ **Graph understanding** | Move from a bird's-eye architecture map to the dependencies, history, and evidence behind an individual module. |
68
+ | πŸ•°οΈ **Repository biography** | Replay how the system grew across real Git history instead of seeing only today's tree. |
69
+ | 🧭 **Auditability** | Trace findings and interpretations back to files, relationships, commits, and snapshots. |
70
+ | πŸ€– **Safer AI coding** | Give Codex a small, evidence-backed work envelope so agent changes respect the wider architecture. |
71
+
72
+ Under the hood, AnaxiGraph is a standalone temporal architecture observatory. It scans source and
73
+ Git history without modifying the target, persists a versioned dependency graph, evaluates
74
+ architecture signals, renders an interactive dashboard, and serves bounded context and impact
75
+ analysis to coding agents.
76
+
77
+ The dashboard includes a filterable Modules ledger for purpose, architecture placement, size,
78
+ complexity, coupling, Git activity, imported coverage, findings, and review attention. Graph
79
+ regions scale with their module populations so dense areas receive proportionally more space.
80
+
81
+ ### Three surfaces, one index
82
+
83
+ - **πŸ”­ AnaxiGraph** is the dashboard, analysis engine, and overall project.
84
+ - **πŸ—‚οΈ AnaxiIndex** is the persistent SQLite knowledge store for repositories, modules, symbols,
85
+ relationships, intent, findings, and history.
86
+ - **πŸ”Œ AnaxiMCP** exposes that knowledge to Codex and other coding agents over MCP.
87
+
88
+ The analysis engine is Python-first and supports mixed repositories containing Python,
89
+ TypeScript, JavaScript, JSX, CSS, configuration, and documentation.
90
+
91
+ ### Deterministic facts + real module understanding
92
+
93
+ AnaxiGraph has two separate AI-facing paths that reinforce one another:
94
+
95
+ ```text
96
+ source + Git ── deterministic scan/hashes ──→ versioned graph
97
+ β”‚ changed modules only
98
+ β–Ό
99
+ semantic work queue in AnaxiIndex
100
+ β”‚ β”‚
101
+ connected coding agent optional model worker
102
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
103
+ β–Ό
104
+ versioned semantic dossiers
105
+ ```
106
+
107
+ The first opt-in semantic bootstrap reads every eligible first-party module and records its
108
+ purpose, contracts, architecture role, related responsibilities, pattern opportunities,
109
+ placement guidance, risks, and provenance. It then synthesizes subsystem and repository context.
110
+ Later scans compare structural, interface, relationship, prompt, model, and intent fingerprints,
111
+ so unchanged source is reused rather than paid for again. Parser facts and model interpretations
112
+ remain separate throughout.
113
+
114
+ ## πŸš€ Get running in five minutes
115
+
116
+ AnaxiGraph normally runs as a Docker sidecar beside the repository you are coding in. From that
117
+ repository, run these commands in a **normal terminal**:
118
+
119
+ ```bash
120
+ cd /path/to/your/repository
121
+ uvx --from git+https://github.com/hcekne/anaxigraph anaxigraph init .
122
+ docker compose -f compose.anaxigraph.yml up -d
123
+ ```
124
+
125
+ The initializer writes `.anaxigraph.yml` and `compose.anaxigraph.yml` without replacing existing
126
+ files. The Compose service mounts the repository read-only, persists AnaxiIndex in a named volume,
127
+ scans the current tree, and imports representative graph frames from the initial Git commit
128
+ through HEAD.
129
+
130
+ Open <http://127.0.0.1:8765> and follow the four-step dashboard tour.
131
+
132
+ ## πŸ€– Connect Codex
133
+
134
+ Run the following in a shell on the machine where Codex itself runs. It can be run from any
135
+ directory:
136
+
137
+ ```bash
138
+ codex mcp add anaxigraph --url http://127.0.0.1:8765/mcp
139
+ codex mcp list
140
+ ```
141
+
142
+ By default, `codex mcp add` stores the connection in `~/.codex/config.toml`. Future Codex CLI and
143
+ IDE sessions on that same host can then use AnaxiMCP from any coding repository. Start a new Codex
144
+ session in the project you want to edit:
145
+
146
+ ```bash
147
+ cd /path/to/your/repository
148
+ codex
149
+ ```
150
+
151
+ If you want the connection available only inside one trusted repository, add it to that
152
+ repository's `.codex/config.toml` instead:
153
+
154
+ ```toml
155
+ [mcp_servers.anaxigraph]
156
+ url = "http://127.0.0.1:8765/mcp"
157
+ ```
158
+
159
+ ### Remote Linux server + local browser
160
+
161
+ When AnaxiGraph and Codex run on a remote Linux server while you view the dashboard from another
162
+ computer, the Codex-to-AnaxiMCP route is direct:
163
+
164
+ ```text
165
+ Codex on server ── http://127.0.0.1:8765/mcp ──→ AnaxiMCP container
166
+ Local browser ── SSH port forward ───────────→ dashboard on :8765
167
+ ```
168
+
169
+ The SSH tunnel is only needed by the browser. Codex on the server does not go through your local
170
+ computer or the tunnel; it reaches the published container port on its own host. A server session
171
+ looks like this:
172
+
173
+ ```bash
174
+ # Run on the Linux server where Codex runs
175
+ curl http://127.0.0.1:8765/healthz
176
+ codex mcp add anaxigraph --url http://127.0.0.1:8765/mcp
177
+ codex mcp list
178
+ cd /path/to/your/repository
179
+ codex
180
+ ```
181
+
182
+ If Codex runs on your local computer instead, the forwarded URL works while the SSH tunnel is
183
+ active. If Codex itself runs in another container on the same Docker network, use
184
+ `http://anaxigraph:8765/mcp` instead of `127.0.0.1`.
185
+
186
+ Other MCP clients use the same endpoint. See the complete [onboarding guide](docs/onboarding.md)
187
+ for the human-to-agent workflow, optional coverage, history, custom ports, updates, and reset
188
+ behavior, and the official [Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp)
189
+ for Codex configuration details.
190
+
191
+ ### Build the semantic baseline with your coding agent (optional)
192
+
193
+ The recommended Docker path needs no LLM key inside AnaxiGraph. Enable agent-funded semantics in
194
+ `.anaxigraph.yml`:
195
+
196
+ ```yaml
197
+ semantic:
198
+ enabled: true
199
+ provider: agent
200
+ refresh: manual
201
+ max_parallel_jobs: 1
202
+ agent_lease_seconds: 1800
203
+ ```
204
+
205
+ Refresh the scan or choose **Prepare semantic work** in the dashboard. Then ask the coding agent
206
+ that is already connected to AnaxiMCP and running in the target repository:
207
+
208
+ > Use AnaxiGraph to build or resume the semantic baseline for this repository. Call
209
+ > `ANAXIGRAPH_SEMANTIC_SCHEMA` once, then repeat `ANAXIGRAPH_SEMANTIC_WORK`, fetch every requested
210
+ > evidence page, analyze the module or scope using your own model context, and call
211
+ > `ANAXIGRAPH_SEMANTIC_SUBMIT`. Continue until WORK returns `complete`. Do not edit source while
212
+ > performing this mapping task.
213
+
214
+ AnaxiGraph chooses only stale work, supplies source plus deterministic graph/Git evidence, leases
215
+ each job, validates the returned dossier, and writes it to AnaxiIndex. The coding agent supplies
216
+ the reasoning and uses its own token allowance. The repository mount remains read-only, and the
217
+ queue can resume in another agent session if the first session stops.
218
+
219
+ An in-container hosted worker remains available as an alternative for unattended schedules:
220
+
221
+ ```yaml
222
+ semantic:
223
+ enabled: true
224
+ provider: openai # or anthropic
225
+ model: your-model
226
+ refresh: periodic
227
+ ```
228
+
229
+ ```bash
230
+ export OPENAI_API_KEY="..." # use ANTHROPIC_API_KEY for provider: anthropic
231
+ docker compose -f compose.anaxigraph.yml --profile ai up -d
232
+ docker compose -f compose.anaxigraph.yml logs -f anaxigraph-semantic
233
+ ```
234
+
235
+ For a local installation, `provider: codex` and `provider: claude` run those authenticated CLIs as
236
+ workers. The [semantic onboarding guide](docs/onboarding.md#build-the-ai-understanding-baseline)
237
+ explains the agent-funded loop, hosted workers, privacy controls, incremental invalidation, and
238
+ scheduling.
239
+
240
+ ## πŸ”„ Keep it current
241
+
242
+ Follow startup or scanning with:
243
+
244
+ ```bash
245
+ docker compose -f compose.anaxigraph.yml logs -f anaxigraph
246
+ ```
247
+
248
+ To refresh automatically while you code, enable the optional watcher:
249
+
250
+ ```bash
251
+ docker compose -f compose.anaxigraph.yml --profile watch up -d
252
+ ```
253
+
254
+ ## πŸ—ΊοΈ Shared multi-repository service
255
+
256
+ The repository also contains an operator setup for one dashboard across several allowlisted
257
+ read-only mounts. This is useful for a team installation or for switching projects without
258
+ running several ports:
259
+
260
+ ```bash
261
+ git clone https://github.com/hcekne/anaxigraph.git
262
+ cd anaxigraph
263
+ cp .env.example .env
264
+ cp repositories.example.yml repositories.yml
265
+ # Edit the host mounts and registry, then:
266
+ docker compose up --build -d
267
+ ```
268
+
269
+ The browser cannot ask the server to browse arbitrary host paths. See
270
+ [Docker operation](docs/docker.md) and [MaxOS integration](docs/maxos-agent.md).
271
+
272
+ ## πŸ’» Local CLI
273
+
274
+ ```bash
275
+ uv tool install -e .
276
+ anaxigraph init /path/to/repository --no-compose
277
+ anaxigraph scan /path/to/repository
278
+ anaxigraph serve --repository /path/to/repository --scan-on-start --open
279
+ ```
280
+
281
+ AnaxiIndex is stored outside the target at
282
+ `${XDG_STATE_HOME:-~/.local/state}/anaxigraph/anaxi-index.db`. Override it with `--db` or
283
+ `ANAXIGRAPH_DB`.
284
+
285
+ Useful commands:
286
+
287
+ ```bash
288
+ anaxigraph update /path/to/repository
289
+ anaxigraph understand /path/to/repository
290
+ anaxigraph semantic-status /path/to/repository
291
+ anaxigraph history /path/to/repository --limit 64
292
+ anaxigraph review /path/to/repository
293
+ anaxigraph scope /path/to/repository --goal "Add saved prompts to Workbench"
294
+ anaxigraph impact /path/to/repository --target backend/app/services/chat.py
295
+ anaxigraph watch /path/to/repository
296
+ anaxigraph mcp --repository /path/to/repository --port 8765
297
+ ```
298
+
299
+ The `serve` and `mcp` commands both expose the dashboard and JSON API at
300
+ `http://127.0.0.1:8765`, with Streamable HTTP MCP at `http://127.0.0.1:8765/mcp`. See
301
+ [`docs/maxos-agent.md`](docs/maxos-agent.md) for the ready-to-run MaxOS integration.
302
+
303
+ ## 🧠 What is persisted
304
+
305
+ - repositories, commit/working-tree snapshots, artifacts, and artifact versions
306
+ - source symbols and deterministic import/call relationships with evidence
307
+ - raw and language-aware structural hashes for incremental scans
308
+ - declared and inferred architecture groups
309
+ - metrics, coverage measurements, Git change history, and temporal trends
310
+ - architecture findings with stable identity and lifecycle state
311
+ - durable intrinsic, contextual, subsystem, and repository dossiers with provider/model/prompt
312
+ plus coding-agent executor provenance, resumable work state, fingerprints, token usage, and
313
+ cost estimates
314
+
315
+ The target repository only needs an optional `.anaxigraph.yml`; analysis state remains external.
316
+
317
+ ## πŸ› οΈ Development
318
+
319
+ ```bash
320
+ uv sync --extra dev
321
+ uv run pytest
322
+ uv run ruff check .
323
+ ```
324
+
325
+ The product brief and requirement source is [`repo_instructions.md`](repo_instructions.md).
326
+ Contributions are welcome; see [`CONTRIBUTING.md`](CONTRIBUTING.md).