doctracker 0.1.0__tar.gz → 0.3.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.
- doctracker-0.3.1/PKG-INFO +368 -0
- doctracker-0.3.1/README.md +330 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/pyproject.toml +7 -1
- {doctracker-0.1.0 → doctracker-0.3.1}/pyproject.toml.orig +11 -2
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/__init__.py +1 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/__main__.py +2 -0
- doctracker-0.3.1/src/doctracker/cli.py +128 -0
- doctracker-0.3.1/src/doctracker/config.py +198 -0
- doctracker-0.3.1/src/doctracker/embeddings/__init__.py +1 -0
- doctracker-0.3.1/src/doctracker/embeddings/downloads.py +100 -0
- doctracker-0.3.1/src/doctracker/embeddings/llama_cpp.py +239 -0
- doctracker-0.3.1/src/doctracker/embeddings/service.py +386 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/extraction/__init__.py +1 -0
- doctracker-0.3.1/src/doctracker/extraction/graph.py +461 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/extraction/griffe_loader.py +90 -13
- doctracker-0.3.1/src/doctracker/graph/__init__.py +20 -0
- doctracker-0.3.1/src/doctracker/graph/model.py +400 -0
- doctracker-0.3.1/src/doctracker/history/__init__.py +14 -0
- doctracker-0.3.1/src/doctracker/history/git_log.py +471 -0
- doctracker-0.3.1/src/doctracker/history/working.py +188 -0
- doctracker-0.3.1/src/doctracker/integrations/__init__.py +11 -0
- doctracker-0.3.1/src/doctracker/integrations/claude_code.py +127 -0
- doctracker-0.3.1/src/doctracker/integrations/opencode.py +60 -0
- doctracker-0.3.1/src/doctracker/integrations/opencode_plugin.js +101 -0
- doctracker-0.3.1/src/doctracker/notes/__init__.py +22 -0
- doctracker-0.3.1/src/doctracker/notes/commit_flow.py +341 -0
- doctracker-0.3.1/src/doctracker/notes/context.py +202 -0
- doctracker-0.3.1/src/doctracker/notes/store.py +1421 -0
- doctracker-0.3.1/src/doctracker/search/__init__.py +16 -0
- doctracker-0.3.1/src/doctracker/search/engine.py +364 -0
- doctracker-0.3.1/src/doctracker/server/app.py +133 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/server/guide.py +9 -1
- doctracker-0.3.1/src/doctracker/server/hooks.py +44 -0
- doctracker-0.3.1/src/doctracker/server/note_tools.py +527 -0
- doctracker-0.3.1/src/doctracker/server/state.py +61 -0
- doctracker-0.3.1/src/doctracker/server/tools.py +335 -0
- doctracker-0.3.1/src/doctracker/server/watcher.py +134 -0
- doctracker-0.3.1/src/doctracker/server/web.py +545 -0
- doctracker-0.3.1/src/doctracker/storage/__init__.py +1 -0
- doctracker-0.3.1/src/doctracker/storage/index.py +286 -0
- doctracker-0.3.1/src/doctracker/wiki/pages.py +659 -0
- doctracker-0.3.1/src/doctracker/wiki/static/cytoscape-LICENSE.txt +19 -0
- doctracker-0.3.1/src/doctracker/wiki/static/cytoscape.min.js +31 -0
- doctracker-0.3.1/src/doctracker/wiki/static/dagre-LICENSE.txt +19 -0
- doctracker-0.3.1/src/doctracker/wiki/static/dagre.min.js +801 -0
- doctracker-0.3.1/src/doctracker/wiki/static/graph.js +1045 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/abc.svg +18 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/alert-triangle.svg +17 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/arrows-exchange.svg +16 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/binary-tree.svg +23 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/box.svg +18 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/braces.svg +16 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/brand-python.svg +19 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/check.svg +15 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/checkbox.svg +16 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/clock.svg +16 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/file-code.svg +18 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/file.svg +16 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/flag.svg +16 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/folder-open.svg +15 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/folder.svg +15 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/git-branch.svg +20 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/help-circle.svg +17 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/math-function.svg +18 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/notebook.svg +17 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/numbers.svg +18 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/package.svg +19 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/pencil.svg +16 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/point.svg +15 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/puzzle.svg +15 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/sitemap.svg +19 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/square-check.svg +16 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/tabler-icons-LICENSE.txt +21 -0
- doctracker-0.3.1/src/doctracker/wiki/static/icons/trash.svg +19 -0
- doctracker-0.3.1/src/doctracker/wiki/static/live.js +537 -0
- doctracker-0.3.1/src/doctracker/wiki/static/style.css +1332 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/architecture.html +27 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/base.html +58 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/calls.html +40 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/classes.html +23 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/wiki/templates/entity.html +16 -21
- doctracker-0.3.1/src/doctracker/wiki/templates/fragment_content.html +5 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/git.html +45 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/git_commit.html +64 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/header.html +35 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/macros.html +60 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/members.html +18 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/wiki/templates/module.html +5 -6
- doctracker-0.3.1/src/doctracker/wiki/templates/notes.html +89 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/notes_cards.html +19 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/notes_form.html +338 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/notes_head.html +17 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/notes_tree.html +26 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/search.html +79 -0
- doctracker-0.3.1/src/doctracker/wiki/templates/tree.html +43 -0
- doctracker-0.1.0/PKG-INFO +0 -234
- doctracker-0.1.0/README.md +0 -202
- doctracker-0.1.0/src/doctracker/cli.py +0 -55
- doctracker-0.1.0/src/doctracker/config.py +0 -65
- doctracker-0.1.0/src/doctracker/server/app.py +0 -78
- doctracker-0.1.0/src/doctracker/server/state.py +0 -32
- doctracker-0.1.0/src/doctracker/server/tools.py +0 -76
- doctracker-0.1.0/src/doctracker/server/watcher.py +0 -63
- doctracker-0.1.0/src/doctracker/server/web.py +0 -120
- doctracker-0.1.0/src/doctracker/wiki/pages.py +0 -356
- doctracker-0.1.0/src/doctracker/wiki/static/live.js +0 -178
- doctracker-0.1.0/src/doctracker/wiki/static/style.css +0 -424
- doctracker-0.1.0/src/doctracker/wiki/templates/base.html +0 -33
- doctracker-0.1.0/src/doctracker/wiki/templates/fragment_content.html +0 -5
- doctracker-0.1.0/src/doctracker/wiki/templates/header.html +0 -20
- doctracker-0.1.0/src/doctracker/wiki/templates/members.html +0 -18
- doctracker-0.1.0/src/doctracker/wiki/templates/search.html +0 -21
- doctracker-0.1.0/src/doctracker/wiki/templates/tree.html +0 -31
- {doctracker-0.1.0 → doctracker-0.3.1}/LICENSE +0 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/server/__init__.py +0 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/server/guide.md +0 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/wiki/__init__.py +0 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/wiki/static/htmx-LICENSE.txt +0 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/wiki/static/htmx.min.js +0 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/wiki/templates/fragment.html +0 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/wiki/templates/loading.html +0 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/wiki/templates/not_found.html +0 -0
- {doctracker-0.1.0 → doctracker-0.3.1}/src/doctracker/wiki/templates/source.html +0 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: doctracker
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: MCP server that centralizes the documentation of Python projects developed with LLM agents.
|
|
5
|
+
Author: Carlos Filipe de Castro Lemos
|
|
6
|
+
Author-email: Carlos Filipe de Castro Lemos <carlos.lemos.dev@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
License-File: src/doctracker/wiki/static/cytoscape-LICENSE.txt
|
|
10
|
+
License-File: src/doctracker/wiki/static/dagre-LICENSE.txt
|
|
11
|
+
License-File: src/doctracker/wiki/static/htmx-LICENSE.txt
|
|
12
|
+
License-File: src/doctracker/wiki/static/icons/tabler-icons-LICENSE.txt
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
20
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
21
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
22
|
+
Requires-Dist: click>=8.5.0
|
|
23
|
+
Requires-Dist: griffe>=2.4.1
|
|
24
|
+
Requires-Dist: httpx2>=2.16.0
|
|
25
|
+
Requires-Dist: jinja2>=3.1.6
|
|
26
|
+
Requires-Dist: markdown-it-py>=4.2.0
|
|
27
|
+
Requires-Dist: mcp>=2.3.0,<3
|
|
28
|
+
Requires-Dist: numpy>=2.4.6
|
|
29
|
+
Requires-Dist: pygments>=2.21.0
|
|
30
|
+
Requires-Dist: sqlite-vec>=0.1.9
|
|
31
|
+
Requires-Dist: starlette>=1.10.0
|
|
32
|
+
Requires-Dist: uvicorn>=0.54.0
|
|
33
|
+
Requires-Python: >=3.11
|
|
34
|
+
Project-URL: Homepage, https://github.com/cfclemos/doctracker
|
|
35
|
+
Project-URL: Repository, https://github.com/cfclemos/doctracker
|
|
36
|
+
Project-URL: Issues, https://github.com/cfclemos/doctracker/issues
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
|
|
39
|
+
# DOCUMENTATION TRACKER (DOCTRACKER)
|
|
40
|
+
|
|
41
|
+
**One place for the documentation, notes and plans of a Python project developed with LLM agents.**
|
|
42
|
+
|
|
43
|
+
When agents work on a codebase, documentation ends up scattered: notes in many
|
|
44
|
+
Markdown files, memories, code comments and commit messages, all drifting out of
|
|
45
|
+
sync. Documentation Tracker (doctracker) centralizes it. It runs an [MCP](https://modelcontextprotocol.io)
|
|
46
|
+
server that agents (Claude Code, OpenCode, …) connect to, gives them the right
|
|
47
|
+
context at the right moments, and serves a live wiki of the project in your browser.
|
|
48
|
+
|
|
49
|
+
> **Status: alpha (0.3).** The technical reference, search, code graphs, git
|
|
50
|
+
> history, agent notes, the planner and the commit flow work. See [Roadmap](#roadmap).
|
|
51
|
+
|
|
52
|
+
## Features
|
|
53
|
+
|
|
54
|
+
- **Technical reference built from the code** — modules, classes, functions,
|
|
55
|
+
methods and attributes, with signatures, type hints, decorators and parsed
|
|
56
|
+
docstrings (Google, NumPy or Sphinx style).
|
|
57
|
+
- **Static analysis only** — the code is read with [griffe](https://mkdocstrings.github.io/griffe/),
|
|
58
|
+
never imported or executed.
|
|
59
|
+
- **Live wiki** — edit a file or commit and the open page updates by itself.
|
|
60
|
+
- **Code graphs** — architecture (modules and imports, cycles marked), class
|
|
61
|
+
diagram and call graph of any function.
|
|
62
|
+
- **Git history** — branch graph, commits with their diffs, and the commits that
|
|
63
|
+
changed a file or an entity.
|
|
64
|
+
- **Agent notes** — guidelines (how to work) and memory (what is known), optionally
|
|
65
|
+
tied to entities of the code. A new note is compared with the existing ones
|
|
66
|
+
first, so the same knowledge is not written twice.
|
|
67
|
+
- **Planner** — plans, features and tasks with criteria, states, dependencies,
|
|
68
|
+
due dates, annotations and evidence. Done work is archived, tied to its commits.
|
|
69
|
+
- **Commit flow** — the agent plans the commits with you, commits only what you
|
|
70
|
+
approved, records them on their tasks and merges the branch into main when its
|
|
71
|
+
planned work is done. Commits made outside the flow become review tasks.
|
|
72
|
+
- **Context for agents, by itself** — Claude Code hooks and an OpenCode plugin,
|
|
73
|
+
written by doctracker, give the agent the guidelines and the open planning at
|
|
74
|
+
the start of a session, when planning, when a file is read or edited and when
|
|
75
|
+
committing.
|
|
76
|
+
- **Search** — plain text, **BM25** (words in any order), **semantic** (meaning,
|
|
77
|
+
in any language) and **hybrid** (both), the same for agents and in the wiki;
|
|
78
|
+
`recall` searches the open planning first, then the guidelines, memory, code
|
|
79
|
+
and the archive.
|
|
80
|
+
- **Local embeddings** — semantic search runs on your machine with
|
|
81
|
+
[llama.cpp](https://github.com/ggml-org/llama.cpp) (downloaded and managed by
|
|
82
|
+
doctracker, on the GPU when there is one) or on your own [vLLM](https://github.com/vllm-project/vllm) server.
|
|
83
|
+
- **Everything in one folder** — doctracker keeps its data in `doc/` inside your
|
|
84
|
+
project; the agents' settings it writes stay local and out of git.
|
|
85
|
+
- **Cross-platform** — Windows and Linux, Python 3.11+.
|
|
86
|
+
|
|
87
|
+
## Installation
|
|
88
|
+
|
|
89
|
+
Install it as a development dependency of the project you want to document:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
uv add --dev doctracker
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
or with pip:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
pip install doctracker
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Quick start
|
|
102
|
+
|
|
103
|
+
From the root of your project:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
doctracker init # creates doc/config/config.json (packages are detected automatically)
|
|
107
|
+
doctracker start # starts the server
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
With uv, prefix the commands with `uv run` (e.g. `uv run doctracker start`).
|
|
111
|
+
`start` runs `init` on its own if the project has no configuration yet.
|
|
112
|
+
|
|
113
|
+
The server prints where it wrote the agents' settings and its two addresses:
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
Claude Code hooks: .claude/settings.local.json
|
|
117
|
+
OpenCode plugin: .opencode/plugins/doctracker.js
|
|
118
|
+
Wiki: http://127.0.0.1:8765/
|
|
119
|
+
MCP: http://127.0.0.1:8765/mcp
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Open the wiki in your browser. Keep the server running while you work on the code;
|
|
123
|
+
stop it with `Ctrl+C`.
|
|
124
|
+
|
|
125
|
+
## Connecting an agent
|
|
126
|
+
|
|
127
|
+
The MCP server uses the Streamable HTTP transport at `http://127.0.0.1:8765/mcp`.
|
|
128
|
+
Start the server before the agent.
|
|
129
|
+
|
|
130
|
+
**Claude Code** — add a `.mcp.json` file at the root of your project:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"mcpServers": {
|
|
135
|
+
"doctracker": { "type": "http", "url": "http://127.0.0.1:8765/mcp" }
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
or register it from the terminal:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
claude mcp add --transport http doctracker http://127.0.0.1:8765/mcp
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
`init` and `start` also write doctracker's hooks into `.claude/settings.local.json`
|
|
147
|
+
(your other settings are kept) and switch Claude Code's own auto memory off for
|
|
148
|
+
the project, so notes are kept only in doctracker.
|
|
149
|
+
|
|
150
|
+
**OpenCode** (version 2) — nothing to configure. When OpenCode is installed (or the
|
|
151
|
+
project has an `.opencode/` folder), `init` and `start` write the plugin
|
|
152
|
+
`.opencode/plugins/doctracker.js`, which registers the MCP server and gives the
|
|
153
|
+
context. The plugin is kept out of git through `.git/info/exclude`.
|
|
154
|
+
|
|
155
|
+
**Other agents** — any MCP client that supports Streamable HTTP can connect to the
|
|
156
|
+
same URL. Without hooks, the agent gets the same contexts from the `agent_context`
|
|
157
|
+
tool.
|
|
158
|
+
|
|
159
|
+
### When the agent gets what
|
|
160
|
+
|
|
161
|
+
| Moment | Context |
|
|
162
|
+
| --- | --- |
|
|
163
|
+
| Session start, after a summary, subagent | where notes and plans live, the guidelines given always, the open planning, the review tasks |
|
|
164
|
+
| Planning (plan mode, OpenCode's `plan` agent) | the planning guidelines, the requirements of the open plans, and a reminder to record the approved plan in the Planner |
|
|
165
|
+
| A file is read or edited | the notes about its code, once per file and session, and a reminder when no task is in progress |
|
|
166
|
+
| Committing | the commit guidelines, with the pre-commit material |
|
|
167
|
+
| Server not running | a request to ask you whether to start it |
|
|
168
|
+
|
|
169
|
+
### What the agent gets
|
|
170
|
+
|
|
171
|
+
| Group | Tools |
|
|
172
|
+
| --- | --- |
|
|
173
|
+
| Code | `list_entities`, `get_entity`, `status`, `documentation_guide` (also the `doctracker://guide` resource) |
|
|
174
|
+
| Search | `recall`, `hybrid_search`, `bm25_search`, `semantic_search` |
|
|
175
|
+
| Graphs | `architecture_view`, `class_diagram_view`, `call_graph_view` |
|
|
176
|
+
| Git | `git_history`, `git_branches`, `git_commit` |
|
|
177
|
+
| Notes | `create_note`, `update_note`, `supersede_note`, `delete_note`, `list_notes` |
|
|
178
|
+
| Planner | `work_context`, `create_plan`, `update_plan`, `add_feature`, `update_feature`, `add_task`, `update_task`, `check_criterion`, `annotate_task`, `add_task_evidence`, `add_dependency`, `remove_dependency`, `delete_item`, and the tools to change or delete annotations and evidence |
|
|
179
|
+
| Commit flow | `prepare_commit`, `commit`, `after_commit`, `clean_done`, `merge_branch` |
|
|
180
|
+
| Context | `agent_context` |
|
|
181
|
+
| Embeddings | `embedding_status`, `set_embedding_model`, `set_models_dir` |
|
|
182
|
+
|
|
183
|
+
## Notes and planning
|
|
184
|
+
|
|
185
|
+
**Notes** are short facts, in two groups:
|
|
186
|
+
|
|
187
|
+
| Group | Types | Given to the agent |
|
|
188
|
+
| --- | --- | --- |
|
|
189
|
+
| Guidelines (how to work) | `preference`, `rule` | by itself, at their moments: `always`, `planning`, `commit`; and when the code of their entities is read or edited |
|
|
190
|
+
| Memory (what is known) | `decision`, `context`, `pitfall`, `reference` | found with `recall` when needed |
|
|
191
|
+
|
|
192
|
+
A note that stops being true is superseded by a new one, not rewritten. Before a
|
|
193
|
+
note is added it is compared with the active notes of its group; when similar ones
|
|
194
|
+
exist it is refused and they are listed, so the agent updates one of them instead.
|
|
195
|
+
|
|
196
|
+
**The Planner** holds plans made of features, and features made of tasks. Tasks
|
|
197
|
+
have criteria, a state (`todo`, `doing`, `done`), annotations of what was done or
|
|
198
|
+
found, and evidence. Any item can depend on another; blocked and late items are
|
|
199
|
+
marked. Only you approve a task as done. The fixed **Reviews** plan collects the
|
|
200
|
+
commits made outside the commit flow, and is shown only when it has tasks.
|
|
201
|
+
|
|
202
|
+
## The commit flow
|
|
203
|
+
|
|
204
|
+
1. **Pre-commit** — `prepare_commit` gives the changed files, the open tasks and
|
|
205
|
+
the commit guidelines. The agent proposes the commits (files, message and tasks)
|
|
206
|
+
and goes through them with you; the server checks that every file is in one
|
|
207
|
+
commit only and lists what is missing.
|
|
208
|
+
2. **Commit** — `commit` runs `git add` and `git commit` for each approved group,
|
|
209
|
+
and stops at the first error, leaving that group's changes unstaged.
|
|
210
|
+
3. **Post-commit** — `after_commit` records the commits on their tasks, lists what
|
|
211
|
+
is pending and what can be cleaned, and merges the branch into main (`--no-ff`)
|
|
212
|
+
once its planned work is done and committed. `clean_done` archives the done
|
|
213
|
+
items you confirm and deletes them; the archive keeps them tied to their commits.
|
|
214
|
+
|
|
215
|
+
Commits made from the terminal or an IDE are found by the git watcher (also those
|
|
216
|
+
made while the server was off) and become tasks of the Reviews plan.
|
|
217
|
+
|
|
218
|
+
## Search
|
|
219
|
+
|
|
220
|
+
| Mode | Finds | Needs the embedding model |
|
|
221
|
+
| --- | --- | --- |
|
|
222
|
+
| Default | the text as typed, in names, paths and descriptions | no |
|
|
223
|
+
| BM25 | entities sharing words with the query, in any order; rare words and matches in names weigh more; identifiers are split (`get_weather` → `get`, `weather`) | no |
|
|
224
|
+
| Semantic | entities close in meaning, in any language ("what happens when the city does not exist?") | yes |
|
|
225
|
+
| Hybrid | BM25 and semantic combined (reciprocal rank fusion) | yes |
|
|
226
|
+
|
|
227
|
+
`recall` (also the "All" mode in the wiki) groups its results: open planning first,
|
|
228
|
+
then guidelines, memory, code and the archive. It uses hybrid search when the
|
|
229
|
+
embedding model is ready and BM25 meanwhile.
|
|
230
|
+
|
|
231
|
+
Semantic and hybrid searches return at most 100 results. The indexes live in
|
|
232
|
+
`doc/sqlite/doctracker.db` and are updated incrementally, when a search needs
|
|
233
|
+
them: only entities and notes whose text changed are processed again.
|
|
234
|
+
|
|
235
|
+
### The embedding model
|
|
236
|
+
|
|
237
|
+
Nothing is downloaded until the first semantic or hybrid search. Then doctracker:
|
|
238
|
+
|
|
239
|
+
1. downloads the model (default: [Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B-GGUF), Q8, ~640 MB);
|
|
240
|
+
2. downloads the llama.cpp build for your machine (`device: "auto"` tries CUDA,
|
|
241
|
+
then any other GPU through Vulkan, then the CPU; NVIDIA libraries are never
|
|
242
|
+
downloaded, the installed CUDA runtime is used);
|
|
243
|
+
3. starts `llama-server` and embeds every entity and note.
|
|
244
|
+
|
|
245
|
+
On a recent GPU this takes about 25 seconds the first time, about 1 second when
|
|
246
|
+
the files are already there, and each search then takes a few milliseconds. The
|
|
247
|
+
server stops after `idle_timeout` seconds without use and starts again when needed.
|
|
248
|
+
|
|
249
|
+
To use your own **vLLM** server instead, set `embeddings.vllm_url` (and
|
|
250
|
+
`vllm_model`); it takes precedence and nothing is downloaded.
|
|
251
|
+
|
|
252
|
+
## The wiki
|
|
253
|
+
|
|
254
|
+
- **Tree** — AGENT NOTES, the views (architecture, classes, calls, git), and the
|
|
255
|
+
packages, folders and modules (with [Tabler](https://tabler.io/icons) icons),
|
|
256
|
+
classes (**C**), functions (**f**) and methods (**m**). Branches collapse; the
|
|
257
|
+
tree can be resized or hidden (☰).
|
|
258
|
+
- **Module pages** — description, public API (`__all__`) and members grouped by kind.
|
|
259
|
+
- **Entity pages** — description, signature, parameters table, returns, raises,
|
|
260
|
+
examples, notes, members (for classes) and the source code with syntax
|
|
261
|
+
highlighting. Every section can be collapsed from its badge.
|
|
262
|
+
- **Graphs** — architecture, class diagram and call graph, with a focus on any entity.
|
|
263
|
+
- **Git** — the branch graph, the history (also of one file) and each commit with
|
|
264
|
+
its message, files and diffs.
|
|
265
|
+
- **AGENT NOTES** — the Planner as cards and a dependency drawing, and the notes;
|
|
266
|
+
everything can be created and edited here as well as by the agent.
|
|
267
|
+
- **Code theme** — choose among the Pygments themes in the Source section; the
|
|
268
|
+
choice is saved in `config.json`.
|
|
269
|
+
- **Search** — pick a mode (Default, BM25, Semantic, Hybrid, All), press `/` anywhere,
|
|
270
|
+
type, use ↑/↓ and Enter; pages are at the bottom of the results.
|
|
271
|
+
|
|
272
|
+
## Configuration
|
|
273
|
+
|
|
274
|
+
`doc/config/config.json` (created by `doctracker init`):
|
|
275
|
+
|
|
276
|
+
| Key | Default | Description |
|
|
277
|
+
| --- | --- | --- |
|
|
278
|
+
| `packages` | detected | Top-level packages to document. |
|
|
279
|
+
| `search_paths` | `["src", "."]` | Folders where the packages are found, relative to the project root. |
|
|
280
|
+
| `host` | `"127.0.0.1"` | Address the server listens on. |
|
|
281
|
+
| `port` | `8765` | Port of the server (also `doctracker start --port`). |
|
|
282
|
+
| `docstring_style` | `"google"` | `google`, `numpy` or `sphinx`. |
|
|
283
|
+
| `show_private` | `true` | Show `_private` members. |
|
|
284
|
+
| `code_theme` | `"default"` | Pygments theme of the source code. |
|
|
285
|
+
| `ssl_certfile` / `ssl_keyfile` | `null` | Certificate and key files; when both are set, the server uses HTTPS. |
|
|
286
|
+
| `watch_interval` | `1.0` | Seconds between checks for changed files. |
|
|
287
|
+
| `embeddings` | see below | Settings of the embedding model. |
|
|
288
|
+
|
|
289
|
+
`embeddings` section:
|
|
290
|
+
|
|
291
|
+
| Key | Default | Description |
|
|
292
|
+
| --- | --- | --- |
|
|
293
|
+
| `vllm_url` | `null` | Base URL of a running vLLM server; when set, it is used instead of llama.cpp. |
|
|
294
|
+
| `vllm_model` | `"Qwen/Qwen3-Embedding-0.6B"` | Model name served by vLLM. |
|
|
295
|
+
| `model` | `"Qwen/Qwen3-Embedding-0.6B-GGUF/Qwen3-Embedding-0.6B-Q8_0.gguf"` | GGUF model for llama.cpp: `owner/repo/file.gguf` on Hugging Face, or a local file. |
|
|
296
|
+
| `models_dir` | `null` | Folder for models and llama.cpp binaries; `null` means `doc/models`. Point several projects to the same folder to download once. |
|
|
297
|
+
| `device` | `"auto"` | `auto` (CUDA, then Vulkan, then CPU), `cuda`, `vulkan` or `cpu`. |
|
|
298
|
+
| `llama_cpp_release` | `"b11887"` | llama.cpp release to download, or `latest`. |
|
|
299
|
+
| `port` | `8790` | Port of the managed `llama-server`. |
|
|
300
|
+
| `idle_timeout` | `600` | Seconds without use before `llama-server` is stopped. |
|
|
301
|
+
| `query_instruction` | (Qwen3 instruction) | Text added before every search query. |
|
|
302
|
+
|
|
303
|
+
### The `doc/` folder
|
|
304
|
+
|
|
305
|
+
```text
|
|
306
|
+
doc/
|
|
307
|
+
├── .gitignore # keeps local data out of git
|
|
308
|
+
├── config/
|
|
309
|
+
│ └── config.json # commit this file
|
|
310
|
+
├── sqlite/
|
|
311
|
+
│ ├── doctracker.db # search indexes
|
|
312
|
+
│ └── notes.db # notes, planner, commit records and archive
|
|
313
|
+
└── models/ # embedding model and llama.cpp (created on first semantic search)
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
`sqlite/` and `models/` are created only when a feature needs them, and are
|
|
317
|
+
ignored by `doc/.gitignore`.
|
|
318
|
+
|
|
319
|
+
## Documenting your code
|
|
320
|
+
|
|
321
|
+
doctracker shows what the code says, so the wiki is as good as the docstrings. In
|
|
322
|
+
short:
|
|
323
|
+
|
|
324
|
+
- a docstring for every module, public class, function and method;
|
|
325
|
+
- the first line is a one-sentence summary (it is used in lists and search);
|
|
326
|
+
- type hints on every parameter and return value;
|
|
327
|
+
- `Args`, `Returns`, `Raises`, `Attributes` and `Examples` sections as needed;
|
|
328
|
+
- constants documented with a string on the line after the assignment.
|
|
329
|
+
|
|
330
|
+
```python
|
|
331
|
+
def get_weather(city: str, units: str = "metric") -> Forecast:
|
|
332
|
+
"""Fetch the forecast for a city.
|
|
333
|
+
|
|
334
|
+
Args:
|
|
335
|
+
city: City name, e.g. `Lisbon`.
|
|
336
|
+
units: `metric` or `imperial`.
|
|
337
|
+
|
|
338
|
+
Returns:
|
|
339
|
+
Forecast data for the city.
|
|
340
|
+
|
|
341
|
+
Raises:
|
|
342
|
+
CityNotFound: When the city is unknown.
|
|
343
|
+
"""
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Agents get the complete guide from the `documentation_guide` tool.
|
|
347
|
+
|
|
348
|
+
## Security
|
|
349
|
+
|
|
350
|
+
- By default the server listens only on `127.0.0.1`, and the MCP endpoint
|
|
351
|
+
validates the `Host` and `Origin` headers (protection against DNS rebinding).
|
|
352
|
+
- The wiki only accepts changes (notes, planner, code theme) from its own pages.
|
|
353
|
+
- doctracker is a local development tool: there is no authentication, so do not
|
|
354
|
+
expose the server on a network.
|
|
355
|
+
|
|
356
|
+
## Roadmap
|
|
357
|
+
|
|
358
|
+
- Dead code analysis in the wiki.
|
|
359
|
+
|
|
360
|
+
## License
|
|
361
|
+
|
|
362
|
+
[MIT](LICENSE). The bundled [htmx](https://htmx.org) is distributed under the
|
|
363
|
+
Zero-Clause BSD license (`src/doctracker/wiki/static/htmx-LICENSE.txt`), the bundled
|
|
364
|
+
[Cytoscape.js](https://js.cytoscape.org), [dagre](https://github.com/dagrejs/dagre) and
|
|
365
|
+
[Tabler Icons](https://tabler.io/icons) under MIT (`cytoscape-LICENSE.txt`, `dagre-LICENSE.txt`,
|
|
366
|
+
`icons/tabler-icons-LICENSE.txt`). The
|
|
367
|
+
embedding model and llama.cpp are downloaded on use and keep their own licenses
|
|
368
|
+
(Apache-2.0 and MIT).
|