codetrail-cli 1.4.1__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.
- codetrail_cli-1.4.1/LICENSE +202 -0
- codetrail_cli-1.4.1/PKG-INFO +372 -0
- codetrail_cli-1.4.1/README.md +349 -0
- codetrail_cli-1.4.1/pyproject.toml +118 -0
- codetrail_cli-1.4.1/pyproject.toml.orig +86 -0
- codetrail_cli-1.4.1/src/codetrail/__init__.py +3 -0
- codetrail_cli-1.4.1/src/codetrail/__main__.py +5 -0
- codetrail_cli-1.4.1/src/codetrail/agents/__init__.py +4 -0
- codetrail_cli-1.4.1/src/codetrail/agents/convert.py +92 -0
- codetrail_cli-1.4.1/src/codetrail/agents/export.py +284 -0
- codetrail_cli-1.4.1/src/codetrail/agents/instructions.py +42 -0
- codetrail_cli-1.4.1/src/codetrail/agents/protocol.py +111 -0
- codetrail_cli-1.4.1/src/codetrail/agents/tools.py +185 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/__init__.py +161 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/claude_code.py +330 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/codex.py +260 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/environment.py +66 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/estimate.py +225 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/fake.py +74 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/guard.py +80 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/guard_hook.py +58 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/local.py +245 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/local_tools.py +177 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/prompts.py +404 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/routing.py +86 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/runner.py +120 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/status.py +186 -0
- codetrail_cli-1.4.1/src/codetrail/assistant/usage.py +93 -0
- codetrail_cli-1.4.1/src/codetrail/bridge.py +292 -0
- codetrail_cli-1.4.1/src/codetrail/cli.py +407 -0
- codetrail_cli-1.4.1/src/codetrail/config.py +485 -0
- codetrail_cli-1.4.1/src/codetrail/database/__init__.py +60 -0
- codetrail_cli-1.4.1/src/codetrail/database/migrations/0001_facts.sql +34 -0
- codetrail_cli-1.4.1/src/codetrail/database/migrations/0002_settings.sql +5 -0
- codetrail_cli-1.4.1/src/codetrail/database/migrations/0003_learning.sql +34 -0
- codetrail_cli-1.4.1/src/codetrail/database/migrations/0004_assistant_usage.sql +24 -0
- codetrail_cli-1.4.1/src/codetrail/database/migrations/0005_page_failures.sql +7 -0
- codetrail_cli-1.4.1/src/codetrail/database/migrations/0006_metric_values.sql +9 -0
- codetrail_cli-1.4.1/src/codetrail/errors.py +5 -0
- codetrail_cli-1.4.1/src/codetrail/extract/__init__.py +249 -0
- codetrail_cli-1.4.1/src/codetrail/extract/adr.py +98 -0
- codetrail_cli-1.4.1/src/codetrail/extract/github_actions.py +140 -0
- codetrail_cli-1.4.1/src/codetrail/extract/openapi.py +101 -0
- codetrail_cli-1.4.1/src/codetrail/extract/python.py +221 -0
- codetrail_cli-1.4.1/src/codetrail/extract/swift.py +204 -0
- codetrail_cli-1.4.1/src/codetrail/extract/terraform.py +166 -0
- codetrail_cli-1.4.1/src/codetrail/extract/typescript.py +464 -0
- codetrail_cli-1.4.1/src/codetrail/facts/__init__.py +112 -0
- codetrail_cli-1.4.1/src/codetrail/facts/store.py +209 -0
- codetrail_cli-1.4.1/src/codetrail/generate/__init__.py +1 -0
- codetrail_cli-1.4.1/src/codetrail/generate/failures.py +31 -0
- codetrail_cli-1.4.1/src/codetrail/generate/outline.py +159 -0
- codetrail_cli-1.4.1/src/codetrail/generate/revise.py +72 -0
- codetrail_cli-1.4.1/src/codetrail/generate/run.py +530 -0
- codetrail_cli-1.4.1/src/codetrail/generate/scope.py +135 -0
- codetrail_cli-1.4.1/src/codetrail/generate/validate.py +218 -0
- codetrail_cli-1.4.1/src/codetrail/guide/__init__.py +147 -0
- codetrail_cli-1.4.1/src/codetrail/learn/__init__.py +143 -0
- codetrail_cli-1.4.1/src/codetrail/learn/routes.py +139 -0
- codetrail_cli-1.4.1/src/codetrail/locales/ar/LC_MESSAGES/codetrail.mo +0 -0
- codetrail_cli-1.4.1/src/codetrail/locales/ar/LC_MESSAGES/codetrail.po +2236 -0
- codetrail_cli-1.4.1/src/codetrail/locales/codetrail.pot +1942 -0
- codetrail_cli-1.4.1/src/codetrail/lock.py +114 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/__init__.py +6 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/activity.py +96 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/churn.py +156 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/commits.py +45 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/coverage.py +114 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/decisions.py +77 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/history.py +47 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/inventory.py +63 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/rationale.py +74 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/releases.py +26 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/report.py +111 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/repository.py +128 -0
- codetrail_cli-1.4.1/src/codetrail/metrics/size.py +95 -0
- codetrail_cli-1.4.1/src/codetrail/py.typed +0 -0
- codetrail_cli-1.4.1/src/codetrail/remove.py +50 -0
- codetrail_cli-1.4.1/src/codetrail/repo/__init__.py +4 -0
- codetrail_cli-1.4.1/src/codetrail/repo/git.py +56 -0
- codetrail_cli-1.4.1/src/codetrail/repo/gitleaks.toml +6 -0
- codetrail_cli-1.4.1/src/codetrail/repo/history.py +262 -0
- codetrail_cli-1.4.1/src/codetrail/repo/mirror.py +137 -0
- codetrail_cli-1.4.1/src/codetrail/repo/refresh.py +41 -0
- codetrail_cli-1.4.1/src/codetrail/repo/rules.py +83 -0
- codetrail_cli-1.4.1/src/codetrail/repo/secrets.py +145 -0
- codetrail_cli-1.4.1/src/codetrail/repo/signal.py +65 -0
- codetrail_cli-1.4.1/src/codetrail/repo/source.py +166 -0
- codetrail_cli-1.4.1/src/codetrail/search.py +178 -0
- codetrail_cli-1.4.1/src/codetrail/server.py +45 -0
- codetrail_cli-1.4.1/src/codetrail/system.py +484 -0
- codetrail_cli-1.4.1/src/codetrail/update.py +276 -0
- codetrail_cli-1.4.1/src/codetrail/web/__init__.py +1 -0
- codetrail_cli-1.4.1/src/codetrail/web/app.py +897 -0
- codetrail_cli-1.4.1/src/codetrail/web/diagrams.py +414 -0
- codetrail_cli-1.4.1/src/codetrail/web/documentation.py +146 -0
- codetrail_cli-1.4.1/src/codetrail/web/i18n.py +44 -0
- codetrail_cli-1.4.1/src/codetrail/web/navigation.py +127 -0
- codetrail_cli-1.4.1/src/codetrail/web/render.py +126 -0
- codetrail_cli-1.4.1/src/codetrail/web/repository_view.py +230 -0
- codetrail_cli-1.4.1/src/codetrail/web/security.py +171 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/brand/favicon.svg +1 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/brand/mark.svg +1 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/css/base.css +192 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/css/components.css +2254 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/css/content.css +310 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/css/layout.css +410 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/css/print.css +42 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/css/tokens.css +228 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/api.js +49 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/ask.js +182 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/d2-worker.js +34 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/d2.js +28 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/diagram.js +52 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/documentation.js +24 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/learning.js +47 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/main.js +38 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/outline.js +44 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/palette.js +211 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/repository.js +528 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/resize.js +126 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/shortcuts.js +87 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/sidebar.js +194 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/theme-init.js +27 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/theme.js +42 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/js/update.js +107 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/d2/LICENSE +375 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/d2/LICENSE-elk +263 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/d2/LICENSE-wasm_exec +27 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/d2/VERSION +12 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/d2/d2.wasm +0 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/d2/elk.js +105914 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/d2/wasm_exec.js +656 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/inter/InterVariable-Italic.woff2 +0 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/inter/InterVariable.woff2 +0 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/inter/LICENSE.txt +92 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/inter/VERSION +6 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/noto-sans-arabic/NotoSansArabic-wght.woff2 +0 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/noto-sans-arabic/OFL.txt +93 -0
- codetrail_cli-1.4.1/src/codetrail/web/static/vendor/noto-sans-arabic/VERSION +12 -0
- codetrail_cli-1.4.1/src/codetrail/web/target_view.py +63 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/answers.html +25 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/area.html +46 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/base.html +37 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/decisions.html +30 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/diagram.html +10 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/digests.html +24 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/documentation.html +247 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/error.html +9 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/estimate.html +48 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/fact.html +29 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/home.html +196 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/layout/ask_panel.html +27 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/layout/header.html +32 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/layout/icons.html +27 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/layout/outline.html +4 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/layout/palette.html +27 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/layout/shortcuts.html +27 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/layout/sidebar.html +79 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/layout/update_dialog.html +18 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/macros.html +13 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/page.html +93 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/progress.html +46 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/repository.html +369 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/search.html +31 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/source.html +15 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/system.html +43 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/system_arrows.html +17 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/system_legend.html +9 -0
- codetrail_cli-1.4.1/src/codetrail/web/templates/update_log.html +30 -0
- codetrail_cli-1.4.1/src/codetrail/web/trend.py +22 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codetrail-cli
|
|
3
|
+
Version: 1.4.1
|
|
4
|
+
Summary: Get up to speed on any codebase in days, not months: a local guide to a git repository, for you and your coding agent.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Dist: fastapi==0.142.2
|
|
8
|
+
Requires-Dist: httpx==0.28.1
|
|
9
|
+
Requires-Dist: jinja2==3.1.6
|
|
10
|
+
Requires-Dist: markdown-it-py==4.2.0
|
|
11
|
+
Requires-Dist: pathspec==1.1.1
|
|
12
|
+
Requires-Dist: pydantic==2.13.5
|
|
13
|
+
Requires-Dist: pyyaml==6.0.3
|
|
14
|
+
Requires-Dist: tree-sitter==0.26.0
|
|
15
|
+
Requires-Dist: tree-sitter-hcl==1.2.0
|
|
16
|
+
Requires-Dist: tree-sitter-javascript==0.25.0
|
|
17
|
+
Requires-Dist: tree-sitter-python==0.25.0
|
|
18
|
+
Requires-Dist: tree-sitter-swift==0.7.4
|
|
19
|
+
Requires-Dist: tree-sitter-typescript==0.23.2
|
|
20
|
+
Requires-Dist: uvicorn==0.54.0
|
|
21
|
+
Requires-Python: >=3.14
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
<h1>
|
|
25
|
+
<picture>
|
|
26
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/logo-dark.svg">
|
|
27
|
+
<img alt="Codetrail" src="docs/images/logo.svg" height="48">
|
|
28
|
+
</picture>
|
|
29
|
+
</h1>
|
|
30
|
+
|
|
31
|
+
**Get up to speed on any codebase in days, not months, and bring your coding agent with you.**
|
|
32
|
+
|
|
33
|
+
A new job, a new team, or a service handed over by people who have moved on: Codetrail reads the git repository and keeps a guide to it that grows as the code changes. It teaches you the architecture, patterns and decisions behind the code, and tells you what changed since you last looked and why it matters. It gives your coding agent the same understanding, so Claude Code or Codex starts every task knowing the repository instead of guessing at it.
|
|
34
|
+
|
|
35
|
+
| For you | For your agent |
|
|
36
|
+
|---|---|
|
|
37
|
+
| Concept pages tied to the real code, guided paths, checks on your understanding, and progress that notices when what you learned has gone stale | A map of the repository, and a brief for each area: its key files, its conventions and the reasons behind them |
|
|
38
|
+
| What changed since you last looked, and why it matters | Facts extracted from the code, not recalled from memory, with every reason marked documented or inferred, so it guesses less and spends fewer tokens finding its way |
|
|
39
|
+
| A local web page you can ask questions from | A read-only tool server that Claude Code and Codex start themselves, and that costs nothing to call |
|
|
40
|
+
|
|
41
|
+
It runs on your machine, never writes to your repository, and works with the assistant you already pay for: **Claude Code** on a Claude subscription, **Codex** on a ChatGPT subscription, or **a free local model**. Before anything is spent, it shows an estimate and asks.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
uv tool install git+https://github.com/mohamed-abdelsattar92/codetrail@v1.4.1
|
|
45
|
+
codetrail target add shop ~/code/shop --branch main
|
|
46
|
+
codetrail update shop
|
|
47
|
+
codetrail serve shop
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**[Get started in ten minutes →](docs/getting-started.md)**
|
|
51
|
+
|
|
52
|
+

|
|
53
|
+
|
|
54
|
+
## Contents
|
|
55
|
+
- [Who it's for](#whos-it-for)
|
|
56
|
+
- [Why Codetrail](#why-codetrail)
|
|
57
|
+
- [What you get](#what-you-get)
|
|
58
|
+
- [For your coding agent](#for-your-coding-agent)
|
|
59
|
+
- [A tour](#a-tour)
|
|
60
|
+
- [How it works](#how-it-works)
|
|
61
|
+
- [Your assistant, your subscription](#your-assistant-your-subscription)
|
|
62
|
+
- [No surprise costs](#no-surprise-costs)
|
|
63
|
+
- [Grounded, not guessed](#grounded-not-guessed)
|
|
64
|
+
- [Secrets stay out](#secrets-stay-out)
|
|
65
|
+
- [Learning, and knowing when it went stale](#learning-and-knowing-when-it-went-stale)
|
|
66
|
+
- [Languages](#languages)
|
|
67
|
+
- [Status](#status)
|
|
68
|
+
- [Developing Codetrail](#developing-codetrail)
|
|
69
|
+
- [Documentation](#documentation)
|
|
70
|
+
- [Credits](#credits)
|
|
71
|
+
- [License](#license)
|
|
72
|
+
|
|
73
|
+
## Who it's for
|
|
74
|
+
|
|
75
|
+
- **You just joined a team.** Instead of reading files at random and saving up questions for busy teammates, follow guided paths through the parts that matter, check that you understood them, and see what changed each time you come back.
|
|
76
|
+
- **Your team inherited a project.** After a reorganisation, an acquisition or a handover, everyone builds the same picture of the code from the same guide, with every reason marked as documented in the repository or inferred from the code.
|
|
77
|
+
- **You bring people onto a codebase.** Point each newcomer at the guide instead of repeating the same walkthrough. One command brings it up to date, and the home page says how far behind it is. It runs on each person's machine with the assistant they choose: the files it reads go to that provider under their plan's terms, so check that your organisation allows it, or use a local model to keep everything on the machine.
|
|
78
|
+
|
|
79
|
+
## Why Codetrail
|
|
80
|
+
|
|
81
|
+
An assistant such as Claude Code already answers questions about a repository well. What it doesn't give you:
|
|
82
|
+
|
|
83
|
+
| An assistant alone | Codetrail |
|
|
84
|
+
|---|---|
|
|
85
|
+
| Each session rediscovers the architecture | A curated guide that persists and grows with the repository |
|
|
86
|
+
| Your coding agent rediscovers the repository every session | Your agent starts from Codetrail's map and briefs |
|
|
87
|
+
| Answers what you ask; you have to know what to ask | Tells you what changed since you last looked, and teaches it |
|
|
88
|
+
| Diagrams drawn from memory can invent connections | Diagrams drawn only from facts extracted from the code |
|
|
89
|
+
| A guess and a decision read the same | Rationale is marked **documented** (quoted and checked) or **inferred** |
|
|
90
|
+
|
|
91
|
+
Codetrail uses the assistant for meaning and code for structure: deterministic extractors parse the repository into facts, and the assistant writes explanations from those facts, reading files read-only for the "why".
|
|
92
|
+
|
|
93
|
+
## What you get
|
|
94
|
+
|
|
95
|
+
### For you
|
|
96
|
+
|
|
97
|
+
| | Feature | What it does |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| 🔔 | **"You're behind" signal** | How many merges landed since the guide was last updated, and which areas they touched. Computed from git alone, so it costs nothing. |
|
|
100
|
+
| 📰 | **Digests** | One per update: what changed, why it matters, which pages changed. |
|
|
101
|
+
| 🗺️ | **Area and concept pages** | Each component and each pattern, tool or decision, explained against the real code. |
|
|
102
|
+
| 📈 | **Grounded diagrams** | Imports, dependencies and infrastructure drawn from extracted facts; every node links to its source. |
|
|
103
|
+
| 🗺️ | **Your system** | One diagram of how the repository's services, apps, libraries, contracts and infrastructure connect and where they run, with the file and line behind every arrow. |
|
|
104
|
+
| 📜 | **Documented versus inferred** | Rationale quoted from an ADR or commit is verified against the source; everything else is labelled as the assistant's reading. |
|
|
105
|
+
| 💬 | **Ask from any page** | Questions go to your assistant with read-only tools; answers come into the page in your language. |
|
|
106
|
+
| 📌 | **Save to guide** | Answers worth keeping become part of the guide instead of disappearing like chat history: they're in the sidebar, on the Saved answers page, and in search. |
|
|
107
|
+
| 🔎 | **Search** | Press ⌘K or / on any page to search the guide's pages, saved answers, decisions and facts. It runs on your machine and costs nothing. |
|
|
108
|
+
| ⌨️ | **Shortcuts** | Ask (A), go places (G then H, P, Y, S, D, R, O or T), step through a path ([ and ]), mark read (M), update (U), hide or show the sidebar (\\). None of them spends anything. |
|
|
109
|
+
| 📌 | **A sidebar that gets out of the way** | Pin the pages you use most as tiles at the top, fold the sections you don't need, or hide the sidebar so the page takes the whole width and peek at it from the window's edge. Pins are kept by Codetrail, so they follow you to any browser. |
|
|
110
|
+
| 🧭 | **Guided paths** | Ordered routes through the pages toward a goal, such as "how a request travels through the API". The home page picks up where you left off. |
|
|
111
|
+
| ✅ | **Checks** | Open questions on each page, graded against a rubric grounded in the code. |
|
|
112
|
+
| ♻️ | **Staleness** | When the code behind a page you learned changes, the page says so and shows what changed. |
|
|
113
|
+
| 📊 | **Documentation metrics** | How well the repository explains itself: how much of the guide's rationale is documented (and from where: ADRs, documents, code comments, commits), commits that explain why, ADRs to revisit, and dependencies no document mentions. An overview shows each number with its bar and trend across updates; each section opens to a chart and the items behind it, the one most in need first. Free: no assistant call. |
|
|
114
|
+
| 📈 | **Repository statistics** | What the repository is, in charts you can explore: an interactive timeline of commits with its releases and dependency changes, a day-by-day activity calendar, a heat map of where change happens (by guide area, folder or file) with each area's commits month by month, and its age, commits and activity month by month, its releases from tags, lines of code by language with the share in tests, its facts by kind with the dependencies that arrived and left, and where change happens: the most changed files, folders and guide areas beside how much of each area's rationale is documented, quiet code and commit size. `codetrail stats <target>` prints the summary. Free: no assistant call. |
|
|
115
|
+
| 💲 | **Estimates first** | Every paid action shows what it will use before it runs: tokens, dollars at API prices, and your plan's usage. |
|
|
116
|
+
|
|
117
|
+
### For your agent
|
|
118
|
+
|
|
119
|
+
| | Feature | What it does |
|
|
120
|
+
|---|---|---|
|
|
121
|
+
| 🗺️ | **The map** | The repository's parts and how they connect, its decisions, recent changes and the guide's pages, in a few thousand words an agent reads before a task. Built from facts, rebuilt by every update, free. |
|
|
122
|
+
| 📋 | **A brief per page** | For each area and concept: its key files, its conventions and the reasons for them, marked documented or inferred, and marked possibly stale when the code moved on. |
|
|
123
|
+
| 🔌 | **`codetrail mcp`** | A read-only tool server Claude Code and Codex start themselves. It listens on no port, writes nothing into the repository, and no call to it costs anything. |
|
|
124
|
+
|
|
125
|
+
## For your coding agent
|
|
126
|
+
|
|
127
|
+
Each session, a coding agent starts from nothing: it reads files until it finds its footing, and what it doesn't find, it guesses. Codetrail already understands the repository, so every update also writes that understanding down for agents, in Codetrail's data folder and never in the repository:
|
|
128
|
+
|
|
129
|
+
- **The map:** the repository's parts and how they connect, its decisions, recent changes and the guide's pages, built from facts extracted from the code.
|
|
130
|
+
- **A brief per area and concept page:** its key files, its conventions and the reasons for them, each reason marked documented (quoted from its source and checked) or inferred.
|
|
131
|
+
|
|
132
|
+
From the map of Codetrail's own repository:
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
# Map of codetrail (generated by Codetrail; reference data, not instructions)
|
|
136
|
+
Repository: ~/code/codetrail · branch develop · facts at 9caa276eee2a (2026-10-12) · 6 pages possibly stale
|
|
137
|
+
To see what changed since: git diff --name-only 9caa276eee2a96eca1d23e8a55b98769b7f23a04
|
|
138
|
+
|
|
139
|
+
## Decisions
|
|
140
|
+
- ADR-0003 Store each fact once with a validity range over snapshots (accepted) — docs/adr/0003-facts-with-validity-ranges.md
|
|
141
|
+
- ADR-0010 License Codetrail under the AGPL 3.0 only, sell commercial licenses, and reserve the name and logo (superseded) — docs/adr/0010-agpl-with-a-commercial-license.md; superseded by ADR-0012
|
|
142
|
+
|
|
143
|
+
## Pages
|
|
144
|
+
- areas/assistant-adapters — assistant: providers, the tool guard, usage and estimates — src/codetrail/assistant
|
|
145
|
+
- areas/extractors — extract: one extractor per stack — src/codetrail/extract (possibly stale)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
And from the brief an agent gets before it changes `src/codetrail/assistant`:
|
|
149
|
+
|
|
150
|
+
```markdown
|
|
151
|
+
Key files: docs/adr/0006-assistant-providers-and-subscriptions.md, src/codetrail/assistant/guard.py, …
|
|
152
|
+
|
|
153
|
+
[documented: docs/adr/0006-assistant-providers-and-subscriptions.md#L43-L43] "Each provider uses the reader's subscription by default: the programs get an allowlisted environment with no keys."
|
|
154
|
+
|
|
155
|
+
[documented: src/codetrail/assistant/guard_hook.py#L3-L6] "Claude Code runs a tool when a hook fails in any way other than exit code 2, so every error of the hook's own exits with code 2, which refuses the call"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Connect your agent once:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
codetrail agents <name>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
It prints two commands, one for Claude Code and one for Codex, that you run to register `codetrail mcp`, Codetrail's tool server. The agent starts it itself and calls four tools: `codetrail_map` before a task, `codetrail_brief` before changing an area, `codetrail_page` for a whole guide page, and `codetrail_changes` for what changed since a commit or a date.
|
|
165
|
+
|
|
166
|
+
- **It only reads.** The server reads Codetrail's export and nothing else: no file of the repository, no git, no network port.
|
|
167
|
+
- **It costs nothing to call.** No tool calls an assistant. The briefs come from the call that already writes each page, which the update's estimate includes.
|
|
168
|
+
- **It says when it may be wrong.** A brief whose code changed since it was written says so, and the map gives the `git diff` that shows what changed since the guide's commit, so the agent reads the code before relying on it.
|
|
169
|
+
- **It stays out of other repositories.** The server is registered for you, so it works in every worktree, and it tells agents which repository it covers and not to use it anywhere else.
|
|
170
|
+
|
|
171
|
+
Without the tool server, an agent can read the map file directly; [the getting-started guide](docs/getting-started.md#9-use-codetrail-with-your-coding-agents) shows how.
|
|
172
|
+
|
|
173
|
+
## A tour
|
|
174
|
+
|
|
175
|
+
These screenshots are Codetrail's guide to its own repository, written by Claude Code on a subscription.
|
|
176
|
+
|
|
177
|
+
**A concept page** explains one part of the code, with quotes checked against their source lines, links to every fact and file, and an outline that follows you down the page. **Previous** and **Next** follow the path you came from.
|
|
178
|
+
|
|
179
|
+

|
|
180
|
+
|
|
181
|
+
**Hide the sidebar** with the button at the start of the header, or **\\**, and the page takes the whole width. Rest the pointer on the window's edge and it slides out over the page, with your pinned pages on top.
|
|
182
|
+
|
|
183
|
+

|
|
184
|
+
|
|
185
|
+
**Search** the whole guide from the keyboard: press ⌘K or /, type, and press Enter.
|
|
186
|
+
|
|
187
|
+

|
|
188
|
+
|
|
189
|
+
**Checks** test your understanding. Each button shows what the call will use, and the answer shows what it did use.
|
|
190
|
+
|
|
191
|
+

|
|
192
|
+
|
|
193
|
+
**Ask** from any page (press A): the panel opens beside the page you're reading and keeps this session's answers as you move around. **Send** shows the estimate first, and **Save to guide** keeps an answer for good.
|
|
194
|
+
|
|
195
|
+

|
|
196
|
+
|
|
197
|
+
**Your system** shows how the repository's parts fit together, drawn from facts: services and apps, the contracts between them, libraries, infrastructure and where each part runs. Under the diagram, every arrow says why it's there: the file and line that shows it, or, for a dashed arrow, the two names that matched. (This one is a small example repository.)
|
|
198
|
+
|
|
199
|
+

|
|
200
|
+
|
|
201
|
+
**The repository** at a glance (G then T): a timeline of commits you can range over and pan, with its releases and the dependencies that came and went, a calendar of the last year, and a heat map of where change happens. All of it is read from the code and its history, for free.
|
|
202
|
+
|
|
203
|
+

|
|
204
|
+
|
|
205
|
+
**Documentation** (G then O) shows how well the repository explains itself: an overview of each number with its trend, and a section per metric that opens to a chart and the items behind it, starting with the one most in need.
|
|
206
|
+
|
|
207
|
+

|
|
208
|
+
|
|
209
|
+
**Update the guide** refreshes the facts for free, then shows the estimate. Nothing is spent until you choose **Go ahead**.
|
|
210
|
+
|
|
211
|
+

|
|
212
|
+
|
|
213
|
+
## How it works
|
|
214
|
+
|
|
215
|
+
Codetrail never writes to the repository it teaches. It keeps its own mirror, copies out only the files it is allowed to see, extracts facts from them, and has your assistant write the guide from the facts. The facts and the guide also become the map and briefs your coding agent reads.
|
|
216
|
+
|
|
217
|
+

|
|
218
|
+
|
|
219
|
+
**An update, step by step.** You run it on demand, from the command line or the page's Update button.
|
|
220
|
+
|
|
221
|
+

|
|
222
|
+
|
|
223
|
+
From the page, an update panel shows each step as it happens: the facts refreshed, the outline planned, each page written with its provider, model, tokens and cost, or not written and why. It closes when the update is done, and stays open with the reason when it fails.
|
|
224
|
+
|
|
225
|
+
An update writes only what changed. Pages your new commits touched go first, then pages catching up on older changes. A page with a few changes (20 or fewer, by default) is revised: the assistant rewrites only the sections those changes affect, so it reads and writes much less. A page that failed validation is skipped until its facts change, or until you run `codetrail update <target> --retry-failed`. The estimate lists each page it will write, and why.
|
|
226
|
+
|
|
227
|
+
If an update is interrupted, the guide's uncommitted changes are discarded and nothing is half-written. Pages that failed or didn't fit in the budget are picked up by the next update.
|
|
228
|
+
|
|
229
|
+
## Your assistant, your subscription
|
|
230
|
+
|
|
231
|
+
| Provider | Runs | Signs in with | Reads |
|
|
232
|
+
|---|---|---|---|
|
|
233
|
+
| `claude_code` (default) | Your own `claude -p` | Your Claude Pro or Max subscription | Only the allowed files: Claude Code's own permission rules and Codetrail's guard, each enough on its own |
|
|
234
|
+
| `codex` | Your own `codex exec`, in its read-only sandbox | Your ChatGPT Plus or Pro subscription | Anything you can read; so a repository must opt in to it |
|
|
235
|
+
| `local` | Codetrail's own tool loop against Ollama or LM Studio on `127.0.0.1` | Nothing: it's free | Only the allowed files, through Codetrail's own tools |
|
|
236
|
+
|
|
237
|
+
Codetrail runs the programs you have already signed in to and **never reads, stores or passes your password, token or API key**. It removes every API key from those programs' environment, so the work counts against your subscription and never bills an API account by surprise. An API key is used only if you set `auth = "api_key"` for that provider. Each kind of call (plan, write, digest, answer, grade) can use a different provider and model, for example Claude Code for pages and a local model for quick questions.
|
|
238
|
+
|
|
239
|
+
`codetrail providers` shows what's installed and signed in, and how.
|
|
240
|
+
|
|
241
|
+
## No surprise costs
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
This update will call:
|
|
245
|
+
plan claude_code · claude-opus-5-5: 1 call(s), ~68k tokens each (a starting guess), ~$0.40 each
|
|
246
|
+
write claude_code · claude-sonnet-5-5: 8 to 16 call(s), ~126k tokens each (a starting guess), ~$0.30 each
|
|
247
|
+
digest claude_code · claude-sonnet-5-5: 1 call(s), ~43k tokens each (a starting guess), ~$0.11 each
|
|
248
|
+
Expected: ~1.1M tokens (at most ~2.1M), ~$2.91 (at most $5.31) at API prices. The update stops at its budget of $10.00 or 5.0M tokens.
|
|
249
|
+
claude_code: Claude subscription (max), so no charge; the work counts against your plan's usage limits.
|
|
250
|
+
Continue? [y/N]
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
- **An update** refreshes the facts first, which costs nothing, then estimates and asks, in the terminal or in a dialog on the page. In a script it spends nothing unless you pass `--yes`.
|
|
254
|
+
- **A question or a check** shows its estimate on its button, and what it used afterwards.
|
|
255
|
+
- **Estimates** start from sensible guesses, then use the median of your own recent calls. Dollars are API list prices, kept in configuration because they change. On a subscription you pay nothing extra, and the estimate shows how much of your plan's usage windows you've used.
|
|
256
|
+
- **Hard limits** stop any update at its dollar or token budget, and every question and check at its own budget.
|
|
257
|
+
|
|
258
|
+
## Grounded, not guessed
|
|
259
|
+
|
|
260
|
+
**Diagrams come from facts.** An extractor turns `services/api/app/orders.py` importing `app.db` into the relation `module:app.orders` → `imports` → `module:app.db`, with the source line. A diagram is a query over those facts, so it can't show a connection the code doesn't have. Above a size limit, it rolls up to directories, so it stays readable.
|
|
261
|
+
|
|
262
|
+
**Rationale says where it comes from.** The assistant writes rationale in two kinds of block. Codetrail checks that a documented quote really appears in the cited lines at that commit before the page is saved:
|
|
263
|
+
|
|
264
|
+
```markdown
|
|
265
|
+
> [!documented] docs/adr/0007-rest-api-with-openapi-contract.md#L12-L18
|
|
266
|
+
> "Use REST with the OpenAPI document as the contract …"
|
|
267
|
+
|
|
268
|
+
> [!inferred]
|
|
269
|
+
> The handlers stay thin and delegate to services, which suggests …
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Secrets stay out
|
|
273
|
+
|
|
274
|
+
Codetrail runs an assistant over repositories that hold secrets, so what it can see is decided before anything reads a file.
|
|
275
|
+
|
|
276
|
+

|
|
277
|
+
|
|
278
|
+
An excluded file is as if it weren't in the repository: it isn't extracted, readable by the assistant, shown in the page, or included in diffs, digests or the "you're behind" counts. Symlinks are never copied. `codetrail files <target>` shows exactly what's visible and what's hidden, and why.
|
|
279
|
+
|
|
280
|
+
**The local page is locked down too.** It listens on `127.0.0.1` only, checks `Host` and `Origin`, signs you in with a one-time code that becomes a strict session cookie, requires a per-session token on every write, renders Markdown with raw HTML disabled, sends a strict Content Security Policy, and tells the browser never to store its pages.
|
|
281
|
+
|
|
282
|
+
## Learning, and knowing when it went stale
|
|
283
|
+
|
|
284
|
+

|
|
285
|
+
|
|
286
|
+
When a page you learned is rewritten, it shows a diff of what changed since you learned it, and only the new or changed checks need answering again. "Since you last caught up" lists the digests you haven't read, then the pages that went stale.
|
|
287
|
+
|
|
288
|
+
## Languages
|
|
289
|
+
|
|
290
|
+
The interface is English first and switches language from the page; it ships in English and Arabic (العربية), which reads right to left, keeps technical terms such as commit and branch in English, and writes numbers with Western digits. Each language is one gettext catalog (`src/codetrail/locales/<code>/LC_MESSAGES/codetrail.po`); adding a language means adding a catalog, with no code change: `uv run pybabel init -l <code> -i src/codetrail/locales/codetrail.pot -d src/codetrail/locales -D codetrail`, translate it, then run `just catalogs` and commit the catalog and its compiled `.mo` together, which every install reads. Right-to-left languages are supported. The page's own messages follow the language too; what the assistant's programs and the update's steps report stays in English, as the command line prints it. The guide's pages stay in English, because the sources and the quotes are in English; live answers and check feedback come back in the language you choose.
|
|
291
|
+
|
|
292
|
+
## Status
|
|
293
|
+
|
|
294
|
+
The latest release is Codetrail 1.4.1 ([release notes](docs/releases/v1.4.1.md), [changelog](CHANGELOG.md)); 1.0.0 was the first public release. Phases 0 to 15 and 17 to 20 of the [design](docs/design/2026-10-05-codetrail-design.md) are built, tested and released; Phase 16 is planned. Codetrail will also be published to PyPI ([ADR 0019](docs/adr/0019-publish-to-pypi-as-codetrail-cli.md)); until the install instructions here change, install from the release tag.
|
|
295
|
+
|
|
296
|
+

|
|
297
|
+
|
|
298
|
+
| Phase | What you can do | Status |
|
|
299
|
+
|---|---|---|
|
|
300
|
+
| 0. Engineering setup | `just ci` passes; the agent rules are enforced by hooks and permissions | Done |
|
|
301
|
+
| 1. Targets and exclusions | See exactly which committed files Codetrail can read, with secrets and your excluded files gone; remove a target and everything Codetrail kept for it | Done |
|
|
302
|
+
| 2. Facts | Modules, packages and decisions as facts | Done |
|
|
303
|
+
| 3. The page | A grounded map of the repository that says when it's behind, at no cost | Done |
|
|
304
|
+
| 4. Generation | The guide: digests, area and concept pages | Done |
|
|
305
|
+
| 5. Bridge | Ask from any page and save the answers | Done |
|
|
306
|
+
| 6. Learning | Paths, checks, progress and staleness | Done |
|
|
307
|
+
| 7. More extractors | OpenAPI, Terraform and Swift packages in the guide | Done |
|
|
308
|
+
| 8. Providers and sign-in | Claude Code, Codex or a local model, on your own subscription | Done |
|
|
309
|
+
| 9. Cost estimates | An estimate before every paid action | Done |
|
|
310
|
+
| 10. Getting started | This README, and the [getting-started guide](docs/getting-started.md) | Done |
|
|
311
|
+
| 11. The page's design | A new look with progress first, search, a command palette, shortcuts, an Ask panel, an update panel that shows each step of an update, and pages for progress, saved answers and digests; tested in a real browser | Done |
|
|
312
|
+
| 12. The whole system | Facts for TypeScript, JavaScript and Astro code, deploy evidence from GitHub Actions, and the system pass: a repository's services, apps, libraries, contracts and infrastructure, and how they connect (`codetrail update` prints the count per rule); the system diagram on its own page, on the home page and on area pages, which pages and answers can also place | Done |
|
|
313
|
+
| 13. Documentation metrics | The Documentation page, its home card and `codetrail metrics`: documented rationale by source, commits that explain why, ADR health, and facts a document mentions or the guide explains, with a trend per update | Done |
|
|
314
|
+
| 14. Repository statistics | The Repository page, its home card and `codetrail stats`: the branch's history and activity, releases from its tags, code size by language with the test share, and facts by kind with the dependencies that arrived and left, with a trend per update | Done |
|
|
315
|
+
| 15. Where change happens | On the Repository page: the most changed files, folders and guide areas beside each area's documented and inferred rationale, quiet code and commit size | Done |
|
|
316
|
+
| 17. The Repository page's charts | An interactive timeline with releases and dependency changes, a day-by-day activity calendar, a heat map of where change happens by area, folder or file, a grid of each area's commits by month, and charts for commit size, languages, commit types and facts | Done |
|
|
317
|
+
| 18. The Documentation page's charts | The Documentation page as an overview beside folding sections: each metric's bar and trend, a chart in each section, the section most in need open first, and the long lists filtered by kind | Done |
|
|
318
|
+
| 19. The sidebar | Hide the sidebar and peek at it from the window's edge, fold its sections, and pin pages as tiles at the top; the page sits in a card inside a tinted frame | Done |
|
|
319
|
+
| 20. Context for coding agents | A map and a brief per page for coding agents, exported on every update and served by `codetrail mcp` to Claude Code and Codex; `codetrail agents` prints how to connect them | Done |
|
|
320
|
+
| 16. Decision inventory | An opt-in paid pass that lists the decisions in the code and looks for a documented "why" for each ([design section 18.8](docs/design/2026-10-05-codetrail-design.md#188-delivery-and-later-work)) | Planned |
|
|
321
|
+
|
|
322
|
+
Codex and local models are tested against stand-ins and Codetrail's own tests; Claude Code is also tested live. Codex's provider decision is [ADR 0006](docs/adr/0006-assistant-providers-and-subscriptions.md).
|
|
323
|
+
|
|
324
|
+
## Developing Codetrail
|
|
325
|
+
|
|
326
|
+
Python with uv, FastAPI, SQLite, tree-sitter and httpx. mise pins the tools (their checksums in `mise.lock`), `just` runs everything, lefthook runs the git hooks, commits follow Conventional Commits with a *Why* in every body, and branches follow git-flow with local-only finishes.
|
|
327
|
+
|
|
328
|
+
- **Test first.** Every behaviour starts as a failing test, including what must be refused: excluded files, rejected requests, tools an assistant may not use.
|
|
329
|
+
- **Coding agents never push**, never touch credentials and never write to a target repository. The full rules are in [AGENTS.md](AGENTS.md).
|
|
330
|
+
|
|
331
|
+
Once per clone:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
mise trust && mise install
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
just setup
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
`mise install` puts gitleaks behind a mise shim pinned to this repository, so a Codetrail started from another folder finds no version there and says so: set one globally with `mise use -g gitleaks`, or set `[tools] gitleaks` in `~/.config/codetrail/config.toml` to the path `mise which gitleaks` prints.
|
|
342
|
+
|
|
343
|
+
Then `just ci` runs every check CI runs; `just lint`, `just format`, `just typecheck`, `just test` (every test but the live and browser ones, in parallel), `just test-quick` (the unit, API and hook tests in parallel, run by the pre-push hook), `just test-browser` (the page in headless Chromium, which `just setup` installs, in parallel) and `just test-live` (the real providers installed here, local only) run one kind each. The maintainer releases with `just release <version>` ([Releasing](CONTRIBUTING.md#releasing)). Each phase's implementation plan is in [docs/design/plans/](docs/design/plans/).
|
|
344
|
+
|
|
345
|
+
## Documentation
|
|
346
|
+
|
|
347
|
+
| Document | What's in it |
|
|
348
|
+
|---|---|
|
|
349
|
+
| [Getting started](docs/getting-started.md) | Install, connect an assistant, add a repository, build and read the guide |
|
|
350
|
+
| [Changelog](CHANGELOG.md) | What changed in each release; release notes for [1.4.1](docs/releases/v1.4.1.md), [1.4.0](docs/releases/v1.4.0.md), [1.3.0](docs/releases/v1.3.0.md), [1.2.0](docs/releases/v1.2.0.md), [1.1.1](docs/releases/v1.1.1.md), [1.1.0](docs/releases/v1.1.0.md), [1.0.1](docs/releases/v1.0.1.md) and [1.0.0](docs/releases/v1.0.0.md) |
|
|
351
|
+
| [Design](docs/design/2026-10-05-codetrail-design.md) | The whole system: architecture, exclusions, facts, generation, page and bridge, learning, providers and estimates, errors, testing, phases |
|
|
352
|
+
| [Brainstorm decisions](docs/design/brainstorm-decisions.md) | The problem, every early decision and why |
|
|
353
|
+
| [Architecture decision records](docs/adr/README.md) | Decisions that are hard to reverse |
|
|
354
|
+
| [Security review checklist](docs/security/review-checklist.md) | What every change is reviewed against |
|
|
355
|
+
| [AGENTS.md](AGENTS.md) | Rules and workflow for coding agents |
|
|
356
|
+
| [Contributing](CONTRIBUTING.md) | The rules for contributing: git-flow, pull requests, simple code, tests first, commits, releasing, and the licence of contributions |
|
|
357
|
+
| [Security policy](SECURITY.md) | How to report a vulnerability privately, and what counts as one |
|
|
358
|
+
| [Trademarks](TRADEMARKS.md) | What you may do with the name and logo |
|
|
359
|
+
|
|
360
|
+
## Credits
|
|
361
|
+
|
|
362
|
+
- The page's typeface is [Inter](https://rsms.me/inter/) by Rasmus Andersson, under the SIL Open Font License 1.1 ([its licence](src/codetrail/web/static/vendor/inter/LICENSE.txt), [ADR 0007](docs/adr/0007-bundle-the-inter-typeface.md)). Arabic text is set in [Noto Sans Arabic](https://github.com/notofonts/arabic) by the Noto Project Authors, under the same licence ([its licence](src/codetrail/web/static/vendor/noto-sans-arabic/OFL.txt), [ADR 0014](docs/adr/0014-bundle-noto-sans-arabic.md), proposed).
|
|
363
|
+
- Diagrams, on the page and in this README, are drawn by [D2](https://d2lang.com) by Terrastruct, under the Mozilla Public License 2.0; the page runs D2's WebAssembly build with Go's `wasm_exec.js`, under Go's BSD licence ([their licences](src/codetrail/web/static/vendor/d2/), [ADR 0016](docs/adr/0016-draw-diagrams-with-d2.md)), and laid out by [ELK](https://eclipse.dev/elk/) (elkjs), under the Eclipse Public License 2.0 ([ADR 0018](docs/adr/0018-lay-out-diagrams-with-elk.md), proposed).
|
|
364
|
+
- The browser tests check accessibility with [axe-core](https://github.com/dequelabs/axe-core) by Deque, under the Mozilla Public License 2.0; it is used by the tests only ([ADR 0008](docs/adr/0008-browser-tests-with-playwright.md)).
|
|
365
|
+
|
|
366
|
+
## License
|
|
367
|
+
|
|
368
|
+
Copyright © 2026 Mohamed Abdel Sattar.
|
|
369
|
+
|
|
370
|
+
Codetrail is open source under the [Apache License 2.0](LICENSE). You may use, change and share it, commercially or not, as long as you keep its copyright and licence notices and say which files you changed ([ADR 0012](docs/adr/0012-apache-2-license.md)). Versions 1.0.0 and 1.0.1 were released under the GNU AGPL 3.0 only, and those copies keep that licence.
|
|
371
|
+
|
|
372
|
+
The licence grants no rights to the name "Codetrail" or its logo; [TRADEMARKS.md](TRADEMARKS.md) says what you may do with them. Contributions are welcome under the same licence; see [CONTRIBUTING.md](CONTRIBUTING.md).
|