boyan 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 (49) hide show
  1. boyan-0.1.0/LICENSE +21 -0
  2. boyan-0.1.0/PKG-INFO +247 -0
  3. boyan-0.1.0/README.md +230 -0
  4. boyan-0.1.0/boyan/__init__.py +3 -0
  5. boyan-0.1.0/boyan/cli.py +222 -0
  6. boyan-0.1.0/boyan/corpus.py +147 -0
  7. boyan-0.1.0/boyan/detail.py +231 -0
  8. boyan-0.1.0/boyan/gaps.py +191 -0
  9. boyan-0.1.0/boyan/index.py +180 -0
  10. boyan-0.1.0/boyan/masks.py +157 -0
  11. boyan-0.1.0/boyan/neighbours.py +63 -0
  12. boyan-0.1.0/boyan/netguard.py +566 -0
  13. boyan-0.1.0/boyan/progress.py +94 -0
  14. boyan-0.1.0/boyan/search.py +303 -0
  15. boyan-0.1.0/boyan/server.py +232 -0
  16. boyan-0.1.0/boyan/text.py +50 -0
  17. boyan-0.1.0/boyan/transfer.py +290 -0
  18. boyan-0.1.0/boyan/vocab.py +169 -0
  19. boyan-0.1.0/boyan/webui/app.js +224 -0
  20. boyan-0.1.0/boyan/webui/bubbles.js +346 -0
  21. boyan-0.1.0/boyan/webui/i18n.js +35 -0
  22. boyan-0.1.0/boyan/webui/index.html +99 -0
  23. boyan-0.1.0/boyan/webui/lang/de.js +82 -0
  24. boyan-0.1.0/boyan/webui/lang/en.js +82 -0
  25. boyan-0.1.0/boyan/webui/lang/es.js +82 -0
  26. boyan-0.1.0/boyan/webui/lang/fr.js +82 -0
  27. boyan-0.1.0/boyan/webui/lang/pt.js +82 -0
  28. boyan-0.1.0/boyan/webui/lang/uk.js +82 -0
  29. boyan-0.1.0/boyan/webui/style.css +145 -0
  30. boyan-0.1.0/boyan/webui/themes/beach.css +19 -0
  31. boyan-0.1.0/boyan/webui/themes/dark.css +19 -0
  32. boyan-0.1.0/boyan/webui/themes/light.css +19 -0
  33. boyan-0.1.0/boyan/webui/themes/mono-dark.css +19 -0
  34. boyan-0.1.0/boyan/webui/themes/mono-light.css +19 -0
  35. boyan-0.1.0/boyan/webui/themes/ocean.css +19 -0
  36. boyan-0.1.0/boyan/webui/themes/soft.css +19 -0
  37. boyan-0.1.0/boyan/webui/themes/summer.css +19 -0
  38. boyan-0.1.0/boyan.egg-info/PKG-INFO +247 -0
  39. boyan-0.1.0/boyan.egg-info/SOURCES.txt +47 -0
  40. boyan-0.1.0/boyan.egg-info/dependency_links.txt +1 -0
  41. boyan-0.1.0/boyan.egg-info/entry_points.txt +2 -0
  42. boyan-0.1.0/boyan.egg-info/requires.txt +9 -0
  43. boyan-0.1.0/boyan.egg-info/top_level.txt +1 -0
  44. boyan-0.1.0/pyproject.toml +30 -0
  45. boyan-0.1.0/setup.cfg +4 -0
  46. boyan-0.1.0/tests/test_boyan.py +331 -0
  47. boyan-0.1.0/tests/test_magura.py +20 -0
  48. boyan-0.1.0/tests/test_netguard.py +138 -0
  49. boyan-0.1.0/tests/test_transfer.py +71 -0
boyan-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Stanislav Zholobetskyi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
boyan-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,247 @@
1
+ Metadata-Version: 2.4
2
+ Name: boyan
3
+ Version: 0.1.0
4
+ Summary: The project's own vocabulary, learned from its files and its tasks: the names that say where a task lives, and a translator from anyone's words to them.
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: mokosh
10
+ Requires-Dist: flask>=3.0
11
+ Requires-Dist: waitress>=2.1
12
+ Provides-Extra: masks
13
+ Requires-Dist: gensim>=4.3; extra == "masks"
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest>=7.0; extra == "dev"
16
+ Dynamic: license-file
17
+
18
+ ![boyan](https://raw.githubusercontent.com/szholobetsky/simrgl/main/images/logo/boyan.png)
19
+
20
+ # boyan
21
+
22
+ **The project's own vocabulary.** From a repository's files and its task history, boyan learns the
23
+ names a project uses for its parts. It also learns a translator from anyone's words (a newcomer, a
24
+ user, a small model) to those names, and from the names to the files.
25
+
26
+ Boyan is the bard of the *Lay of Igor's Campaign*, "Veles's grandson". He sings the old words to the
27
+ new listeners.
28
+
29
+ boyan is part of the SIMARGL pantheon (simargl, gamayun, svitovyd, mokosh, magura). It reads what
30
+ mokosh and svitovyd write and writes only its own index. magura uses it as a fifth, independent source.
31
+
32
+ ## What it builds
33
+
34
+ `boyan index <repo> --db <mokosh db>` writes `<repo>/.boyan/<project>/` (a few minutes for
35
+ thousands of files):
36
+
37
+ - **The vocabulary.** A *name* is a word that the tracker uses (in past task titles) and that the
38
+ code points to files: a word of a file's path, or a name a file defines (from the svitovyd map), or
39
+ a part of such a name.
40
+ - A name explains a past task by the Dice coefficient of their file sets.
41
+ - The names are chosen greedily (facility location) until a new name adds little. This gives the
42
+ smallest set that explains the most tasks.
43
+ - Names nest where they nest: a name's parent holds ≥ 80 % of its files.
44
+ - **The D-masks model.** word2vec (CBOW) trained on the code together with "bags" that join a task's
45
+ words with the characteristic words of each file the task changed.
46
+ - Each word of a query is hidden in turn, and the other words guess it.
47
+ - The best guesses that are names of today's code are the query's *project words*.
48
+ - **RM3 and the vote** (`--words-mode vote`, what magura asks for). The words of the 10 past tasks nearest
49
+ by bm25, each weighed by how rare it is among the past tasks (else `support`, `add`, `fix`, `test`
50
+ win), voted with the D-masks guesses: the words both give first, then each list's best in turns.
51
+ `--n-words` sets how many (10, 20, 50…; the web UI's Search tab has both). The default mode stays
52
+ `masks`, 10 words.
53
+ - **The neighbours.** These are the past tasks nearest to a query. They vote for the names:
54
+ similarity × Dice.
55
+ - By default, boyan's own word index (SQLite FTS5).
56
+ - With `--simargl <store>/<index>`, simargl's semantic index of past tasks. This is how it was
57
+ measured.
58
+
59
+ Nothing is hand-made: there are no project word lists and no rules about the layout. The only stop
60
+ list is English function words and programming keywords. No index uses the user's language: queries
61
+ are only read.
62
+
63
+ ## Use
64
+
65
+ ```
66
+ pip install -e .[masks] # [masks] = gensim; without it: the vocabulary only
67
+ svitovyd index <repo> # the map: the code's defined names (recommended)
68
+ mokosh clean <db> # the task texts without GitHub / Jira noise (recommended)
69
+ boyan index <repo> --db <db> [--simargl <repo>/.simargl/default]
70
+ boyan search "warning for very long alias names" # names, their files, the project's words
71
+ boyan expand "..." # the project's words only
72
+ boyan terms "long alias names should warn" # the project's words for a query, to choose from
73
+ boyan detail length alias # chosen words -> narrower words, or (<= 12 files) the files + their own words
74
+ boyan detail duckdb dialect --query "DuckDB: support CHECKPOINT" # ... + GAP: where a new file would go
75
+ boyan gaps # recompute only gaps.json (from the db's CHANGE_TYPE)
76
+ boyan names [--tree] # the vocabulary
77
+ boyan ui [--port 8094] # Search · Concepts (the map of names) · Build · Export
78
+ ```
79
+
80
+ **terms and detail** (`boyan/detail.py`) are for a model that narrows a task down step by step — 1bcoder's
81
+ `/flow boyan` ("you give it a word, it gives you ten"):
82
+
83
+ - `terms` = the vocabulary's names for the query (as `search`), the query's own words the project knows
84
+ (rarest first) and the D-masks words;
85
+ - `detail` = the files the chosen words lead to (a name → its files, a group → its files, any other word →
86
+ the files whose path holds it or that define a name holding it, one stem: alias / aliases / aliasing; a
87
+ word unknown as a whole → its parts together), narrowed to the files every word leads to;
88
+ - many files → `TERMS:` the words that pick out a part of them and little else; few files (≤ 12) →
89
+ `FILES` and `WORDS:` — the names defined in them that few other files define, those holding a chosen
90
+ word first (`length alias` → `min_alias_length max_alias_length`; `alias long` → `AL06.yml`,
91
+ `test_fail_alias_too_long`).
92
+
93
+ - GAP (`gaps.py`): with few files, the folder a new file of such a task went to in the past (rules
94
+ "a changed file -> (folder, extension) of the files created with it", learned at index time into
95
+ `gaps.json`) and a name from `--query` the folder does not have yet:
96
+ `GAP: test/fixtures/dialects/duckdb/<checkpoint | …>.sql + .yml (like: anti_semi_join, asof_join)`.
97
+ The place is predictable (simrgl exp17.15: the folder among 3 for 87 % of created files), the exact
98
+ name rarely — the name says what the file is about.
99
+
100
+ No model inside boyan: the choosing is the caller's. Why a choice and not an expansion: adding every narrower
101
+ word (exp17.11) or ten guessed words (exp17.12) to the query did not help the search — a poor query has to be
102
+ understood (pgvector or postgis?).
103
+
104
+ **magura** (`magura triangulate`, its web UI; also `simargl triangulate` and 1bcoder's `/search_code`
105
+ through magura) finds `<folder>/.boyan/` by itself. boyan answers first:
106
+
107
+ - its files are the fifth list of the fusion;
108
+ - its project words are appended to the query the other sources get — the vote, 20 words (an index
109
+ without `tasks.db`: the 10 D-masks words).
110
+
111
+ On magura's Remote tab, boyan is a source like the others (port 8094, the index name).
112
+
113
+ **Groups** (simrgl exp17.11): a broad word of the project that the vocabulary never takes as a name — a
114
+ folder's name, used in ≥ 5 past task titles, that holds ≥ 2 whole names (≥ 80 % of each name's files):
115
+ postgres = psql, domain, publication, pgvector, postgis, owned, pg, variadic. On sqlfluff 33 groups hold 213
116
+ of 348 names (61 %): the dialects, `rules`, `templater`, `parser`, `cli`, `reflow`… They are for people — the
117
+ top level of the map, a group's card, "group: postgres" beside a name in the answer, colour and filter in the
118
+ bubbles. Search does not unfold them: in magura's fusion the group's names added nothing (the other tools
119
+ read the word themselves), and a group used as a filter lost files. Indexes built before 2026-11-05 have no
120
+ groups until rebuilt.
121
+
122
+ **The Concepts tab** shows the vocabulary three ways: nested (a name inside a broader one), in the order the
123
+ greedy choice took them, and as **bubbles** (`/api/graph`, `webui/bubbles.js`):
124
+
125
+ - a circle per name, its area ~ the name's files;
126
+ - its colour = the folder most of its files lie in (3 levels; the ten most common, the rest grey);
127
+ - a dark line = parent -> child, a light line = two names that share files (Dice >= 0.2, each name's 4 strongest);
128
+ - laid out in the page by a small force simulation (no library, no network: it works on a phone);
129
+ - wheel or pinch = zoom, drag = move, a click opens the name's card and lights its lines.
130
+ - a folder in the legend = only its names; a circle = only it and the names it has a line with (its card opens; a neighbour moves the focus on). The shown names are laid out again to fill the picture, and every circle large enough on the screen gets its name (all of them when 60 or fewer are shown), so zooming names the small ones too. Esc or "show all" brings back the rest.
131
+
132
+ Names that share no files with any other (on sqlfluff 126 of 352: mostly a dialect's own word, `flink`,
133
+ `grant`) drift to the rim; the connected core sits in the middle.
134
+
135
+ ## Open it to the network
136
+
137
+ By default `boyan ui` listens on `127.0.0.1`: only this computer can open http://127.0.0.1:8094/.
138
+ To let other devices open it (a phone, a teammate's laptop):
139
+
140
+ ```bash
141
+ boyan ui --bind 0.0.0.0
142
+ ```
143
+
144
+ or once for every start, by hand in `~/.boyan/config.json`:
145
+
146
+ ```json
147
+ {"bind": "0.0.0.0"}
148
+ ```
149
+
150
+ `--bind` wins over the file. No page can write `bind` — only a person editing the file. Then open
151
+ `http://<this machine's IP>:8094/` on the other device. With no password every page warns where
152
+ it is visible: set one with the lock button in the corner (HTTP Basic auth, kept in the same file
153
+ as `auth_user` / `auth_pass`), or mark the network as private there.
154
+
155
+ Whatever the address, requests are checked:
156
+
157
+ - a `Host` that is not this machine gets 421 (the guard against DNS rebinding). An IP, `localhost`,
158
+ a name without a dot (`minipc`), `.local` / `.lan` and this computer's own name pass; a name of
159
+ yours with dots (a domain behind a proxy) goes into `"allowed_hosts": ["tools.example.org"]` in
160
+ the same file;
161
+ - a browser request from another site gets 403; curl and the other tools pass.
162
+
163
+ `--host` is never where a pantheon tool listens: where a tool has `--host`, it is the Ollama address.
164
+
165
+ ## Evidence (simrgl, sqlfluff, a time split: everything built before the 100 tasks it is tested on)
166
+
167
+ | query | plain magura | + boyan | per task |
168
+ |---|---|---|---|
169
+ | the developers' own task text | 141 | 145 | 11 better / 7 worse (n.s.) |
170
+ | a newcomer's paraphrases | 119 | **144** | 21 / 5, p = 0.002 |
171
+ | a small model's paraphrases | 94 | **109** | 13 / 2, p = 0.007 |
172
+
173
+ The numbers are gold files in the fused top 10, summed over 100 tasks (exp17.8, the experiments' own code). The
174
+ package itself (exp17.9): developers 141 → 155, newcomer 119 → 133 (17 / 6, p = 0.035), small model 94 → 107 with
175
+ its default bm25 neighbours (simargl's are not better); the newcomer gain is smaller than exp17.8's because the
176
+ D-masks model is trained on every file (half the guessed words differ) — an ablation on the corpus is next. The vocabulary
177
+ The vote with rare RM3 words (exp17.16, the same stand): 20 words give 157 / 137 / 108 gold files against
178
+ 153 / 131 / 109 with the 10 D-masks words (402 vs 393; not significant); 10 voted words give 393 — the gain
179
+ is the rare RM3 words added, not the vote. The vocabulary
180
+ explains a future task's files far better than folders or clustered module trees (exp17.5): the best
181
+ name's Dice is 0.50, against 0.11 for folders and 0.20–0.27 for tree nodes. The package's own rerun
182
+ is exp17.9.
183
+
184
+ ## Web UI and safety
185
+
186
+ `boyan ui` listens on 127.0.0.1 by default. It has the pantheon's netguard: a password, a network
187
+ warning and trusted addresses, kept in `~/.boyan/config.json`. It also has the shared Export tab:
188
+ an index as a zip, and a zip back as `<start>/.boyan/<name>`. The Build tab builds only from
189
+ paths inside the folder boyan was started in. `~/.boyan/projects.json` registers the indexes
190
+ (`$BOYAN_HOME` for the tests).
191
+
192
+ ## Tests
193
+
194
+ `pytest` — 24 tests: a small git project with a mokosh database and a map, plus the shared netguard
195
+ and transfer tests and magura's use of boyan.
196
+
197
+ ---
198
+
199
+ ## Part of the SIMARGL toolkit
200
+
201
+ boyan is one of thirteen tools that together form an **intellectual development support system**:
202
+
203
+ | Tool | Role |
204
+ |---|---|
205
+ | **[simargl](https://github.com/szholobetsky/simargl)** | Task-to-code retrieval — given a task description, finds which files and modules are likely affected, using semantic similarity over git history |
206
+ | **[svitovyd](https://github.com/szholobetsky/svitovyd)** | Project map — scans any codebase and produces a structural map of definitions and cross-file dependencies; queried from the CLI, a web UI with a layered map, or an MCP server |
207
+ | **[1bcoder](https://github.com/szholobetsky/1bcoder)** | AI coding assistant for small local models — surgical context management, agents, parallel inference, proc scripts |
208
+ | **[yasna](https://github.com/szholobetsky/yasna)** | Session memory — indexes conversations from all AI agents so you can find what was discussed, when, and where |
209
+ | **[radogast](https://github.com/szholobetsky/radogast)** | Context drift monitor — measures how far an AI agent's conversation has drifted from the original task |
210
+ | **[vyrii](https://github.com/szholobetsky/vyrii)** | Local AI web UI — chat, translate, web research, RAG and file management in the browser (Flask); powered by Ollama or any OpenAI-compatible backend |
211
+ | **[syryn](https://github.com/szholobetsky/syryn)** | Bluetooth identity beacon for headless devices — the device's IP is its Bluetooth name; hostname, mDNS and network interfaces on request |
212
+ | **[alkonost](https://github.com/szholobetsky/alkonost)** | Browser cockpit for 1bcoder's flows — the `deepagent_*` spec pipeline (plan tree → specs → task board) and the glossary (build, browse, search), tuned for small local models |
213
+ | **[gamayun](https://github.com/szholobetsky/gamayun)** | Statistical ontology without an LLM — builds triples of terms, identifiers, files and modules from task history or a folder of documents and code; every triple carries its significance test |
214
+ | **[mokosh](https://github.com/szholobetsky/mokosh)** | Dataset gathering — commits of a git repository and the tasks of its tracker (Jira, GitHub, GitLab, YouTrack) in one SQLite database that the other tools read |
215
+ | **[magura](https://github.com/szholobetsky/magura)** | The image of a term across the code, without a build — glossary term → code names → files; triangulation of simargl, gamayun, svitovyd, the glossary and boyan with each source's singles; a field traced through the layers |
216
+ | **[boyan](https://github.com/szholobetsky/boyan)** | The project's own vocabulary — the names a project uses for its parts, learned from its files and task history without an LLM, and a translator (word2vec on the project) from anyone's words to those names and their files; magura's fifth, independent source |
217
+ | **[khors](https://github.com/szholobetsky/khors)** | Markdown document editor inside vyrii and alkonost — write beside the chat, a small local model rewrites the selection or writes at the cursor (shown as a diff to accept), Save as md / ODT / ODP in a theme with formulas and diagrams as LibreOffice objects |
218
+
219
+ - **simargl** finds the code related to a task by vector search over the task history (embeddings).
220
+ - **svitovyd** answers: *how is the code structured and what depends on what?*
221
+ - **1bcoder** answers: *how do I work with local models efficiently?*
222
+ - **yasna** answers: *where did I already discuss this?*
223
+ - **radogast** answers: *is the AI agent still on track toward the goal?*
224
+ - **vyrii** answers: *how do I access all of this through a browser?*
225
+ - **syryn** answers: *what is the address of this headless device?*
226
+ - **alkonost** answers: *how do I turn one task description into a reviewed, working plan — and see the project's glossary — without a big model or a big context window?*
227
+ - **gamayun** finds the code related to a task through an ontology of significant links between words, files and modules (no LLM).
228
+ - **mokosh** prepares the initial dataset from version control and the issue tracker.
229
+ - **magura** answers: *where does this business term live in the code, and which files do all the tools point to?*
230
+ - **boyan** answers: *what does this project call the thing I am describing, and where does it live?*
231
+ - **khors** answers: *how do I turn a chat, a plan or my notes into a document I can hand over — a text or slides — with a small model's help?*
232
+
233
+ Together they cover the full development loop: gather the history, understand the codebase, find relevant history, work with AI locally, remember what was decided, and verify the context stays on target.
234
+
235
+ The name comes from Slavic mythology. Boyan (Боян) is the bard of the *Lay of Igor's Campaign*, "Veles's grandson", who sang the old words to new listeners. A fitting name for a tool that keeps the project's own words and passes them on to anyone who comes to the project.
236
+
237
+ ---
238
+
239
+ ## License
240
+
241
+ MIT. See [LICENSE](LICENSE).
242
+
243
+ ## About
244
+
245
+ (c) 2026 Stanislav Zholobetskyi, Oleh Andriichuk
246
+ Institute for Information Recording, National Academy of Sciences of Ukraine, Kyiv
247
+ PhD research: «Intelligent Technology for Software Development and Maintenance Support»
boyan-0.1.0/README.md ADDED
@@ -0,0 +1,230 @@
1
+ ![boyan](https://raw.githubusercontent.com/szholobetsky/simrgl/main/images/logo/boyan.png)
2
+
3
+ # boyan
4
+
5
+ **The project's own vocabulary.** From a repository's files and its task history, boyan learns the
6
+ names a project uses for its parts. It also learns a translator from anyone's words (a newcomer, a
7
+ user, a small model) to those names, and from the names to the files.
8
+
9
+ Boyan is the bard of the *Lay of Igor's Campaign*, "Veles's grandson". He sings the old words to the
10
+ new listeners.
11
+
12
+ boyan is part of the SIMARGL pantheon (simargl, gamayun, svitovyd, mokosh, magura). It reads what
13
+ mokosh and svitovyd write and writes only its own index. magura uses it as a fifth, independent source.
14
+
15
+ ## What it builds
16
+
17
+ `boyan index <repo> --db <mokosh db>` writes `<repo>/.boyan/<project>/` (a few minutes for
18
+ thousands of files):
19
+
20
+ - **The vocabulary.** A *name* is a word that the tracker uses (in past task titles) and that the
21
+ code points to files: a word of a file's path, or a name a file defines (from the svitovyd map), or
22
+ a part of such a name.
23
+ - A name explains a past task by the Dice coefficient of their file sets.
24
+ - The names are chosen greedily (facility location) until a new name adds little. This gives the
25
+ smallest set that explains the most tasks.
26
+ - Names nest where they nest: a name's parent holds ≥ 80 % of its files.
27
+ - **The D-masks model.** word2vec (CBOW) trained on the code together with "bags" that join a task's
28
+ words with the characteristic words of each file the task changed.
29
+ - Each word of a query is hidden in turn, and the other words guess it.
30
+ - The best guesses that are names of today's code are the query's *project words*.
31
+ - **RM3 and the vote** (`--words-mode vote`, what magura asks for). The words of the 10 past tasks nearest
32
+ by bm25, each weighed by how rare it is among the past tasks (else `support`, `add`, `fix`, `test`
33
+ win), voted with the D-masks guesses: the words both give first, then each list's best in turns.
34
+ `--n-words` sets how many (10, 20, 50…; the web UI's Search tab has both). The default mode stays
35
+ `masks`, 10 words.
36
+ - **The neighbours.** These are the past tasks nearest to a query. They vote for the names:
37
+ similarity × Dice.
38
+ - By default, boyan's own word index (SQLite FTS5).
39
+ - With `--simargl <store>/<index>`, simargl's semantic index of past tasks. This is how it was
40
+ measured.
41
+
42
+ Nothing is hand-made: there are no project word lists and no rules about the layout. The only stop
43
+ list is English function words and programming keywords. No index uses the user's language: queries
44
+ are only read.
45
+
46
+ ## Use
47
+
48
+ ```
49
+ pip install -e .[masks] # [masks] = gensim; without it: the vocabulary only
50
+ svitovyd index <repo> # the map: the code's defined names (recommended)
51
+ mokosh clean <db> # the task texts without GitHub / Jira noise (recommended)
52
+ boyan index <repo> --db <db> [--simargl <repo>/.simargl/default]
53
+ boyan search "warning for very long alias names" # names, their files, the project's words
54
+ boyan expand "..." # the project's words only
55
+ boyan terms "long alias names should warn" # the project's words for a query, to choose from
56
+ boyan detail length alias # chosen words -> narrower words, or (<= 12 files) the files + their own words
57
+ boyan detail duckdb dialect --query "DuckDB: support CHECKPOINT" # ... + GAP: where a new file would go
58
+ boyan gaps # recompute only gaps.json (from the db's CHANGE_TYPE)
59
+ boyan names [--tree] # the vocabulary
60
+ boyan ui [--port 8094] # Search · Concepts (the map of names) · Build · Export
61
+ ```
62
+
63
+ **terms and detail** (`boyan/detail.py`) are for a model that narrows a task down step by step — 1bcoder's
64
+ `/flow boyan` ("you give it a word, it gives you ten"):
65
+
66
+ - `terms` = the vocabulary's names for the query (as `search`), the query's own words the project knows
67
+ (rarest first) and the D-masks words;
68
+ - `detail` = the files the chosen words lead to (a name → its files, a group → its files, any other word →
69
+ the files whose path holds it or that define a name holding it, one stem: alias / aliases / aliasing; a
70
+ word unknown as a whole → its parts together), narrowed to the files every word leads to;
71
+ - many files → `TERMS:` the words that pick out a part of them and little else; few files (≤ 12) →
72
+ `FILES` and `WORDS:` — the names defined in them that few other files define, those holding a chosen
73
+ word first (`length alias` → `min_alias_length max_alias_length`; `alias long` → `AL06.yml`,
74
+ `test_fail_alias_too_long`).
75
+
76
+ - GAP (`gaps.py`): with few files, the folder a new file of such a task went to in the past (rules
77
+ "a changed file -> (folder, extension) of the files created with it", learned at index time into
78
+ `gaps.json`) and a name from `--query` the folder does not have yet:
79
+ `GAP: test/fixtures/dialects/duckdb/<checkpoint | …>.sql + .yml (like: anti_semi_join, asof_join)`.
80
+ The place is predictable (simrgl exp17.15: the folder among 3 for 87 % of created files), the exact
81
+ name rarely — the name says what the file is about.
82
+
83
+ No model inside boyan: the choosing is the caller's. Why a choice and not an expansion: adding every narrower
84
+ word (exp17.11) or ten guessed words (exp17.12) to the query did not help the search — a poor query has to be
85
+ understood (pgvector or postgis?).
86
+
87
+ **magura** (`magura triangulate`, its web UI; also `simargl triangulate` and 1bcoder's `/search_code`
88
+ through magura) finds `<folder>/.boyan/` by itself. boyan answers first:
89
+
90
+ - its files are the fifth list of the fusion;
91
+ - its project words are appended to the query the other sources get — the vote, 20 words (an index
92
+ without `tasks.db`: the 10 D-masks words).
93
+
94
+ On magura's Remote tab, boyan is a source like the others (port 8094, the index name).
95
+
96
+ **Groups** (simrgl exp17.11): a broad word of the project that the vocabulary never takes as a name — a
97
+ folder's name, used in ≥ 5 past task titles, that holds ≥ 2 whole names (≥ 80 % of each name's files):
98
+ postgres = psql, domain, publication, pgvector, postgis, owned, pg, variadic. On sqlfluff 33 groups hold 213
99
+ of 348 names (61 %): the dialects, `rules`, `templater`, `parser`, `cli`, `reflow`… They are for people — the
100
+ top level of the map, a group's card, "group: postgres" beside a name in the answer, colour and filter in the
101
+ bubbles. Search does not unfold them: in magura's fusion the group's names added nothing (the other tools
102
+ read the word themselves), and a group used as a filter lost files. Indexes built before 2026-11-05 have no
103
+ groups until rebuilt.
104
+
105
+ **The Concepts tab** shows the vocabulary three ways: nested (a name inside a broader one), in the order the
106
+ greedy choice took them, and as **bubbles** (`/api/graph`, `webui/bubbles.js`):
107
+
108
+ - a circle per name, its area ~ the name's files;
109
+ - its colour = the folder most of its files lie in (3 levels; the ten most common, the rest grey);
110
+ - a dark line = parent -> child, a light line = two names that share files (Dice >= 0.2, each name's 4 strongest);
111
+ - laid out in the page by a small force simulation (no library, no network: it works on a phone);
112
+ - wheel or pinch = zoom, drag = move, a click opens the name's card and lights its lines.
113
+ - a folder in the legend = only its names; a circle = only it and the names it has a line with (its card opens; a neighbour moves the focus on). The shown names are laid out again to fill the picture, and every circle large enough on the screen gets its name (all of them when 60 or fewer are shown), so zooming names the small ones too. Esc or "show all" brings back the rest.
114
+
115
+ Names that share no files with any other (on sqlfluff 126 of 352: mostly a dialect's own word, `flink`,
116
+ `grant`) drift to the rim; the connected core sits in the middle.
117
+
118
+ ## Open it to the network
119
+
120
+ By default `boyan ui` listens on `127.0.0.1`: only this computer can open http://127.0.0.1:8094/.
121
+ To let other devices open it (a phone, a teammate's laptop):
122
+
123
+ ```bash
124
+ boyan ui --bind 0.0.0.0
125
+ ```
126
+
127
+ or once for every start, by hand in `~/.boyan/config.json`:
128
+
129
+ ```json
130
+ {"bind": "0.0.0.0"}
131
+ ```
132
+
133
+ `--bind` wins over the file. No page can write `bind` — only a person editing the file. Then open
134
+ `http://<this machine's IP>:8094/` on the other device. With no password every page warns where
135
+ it is visible: set one with the lock button in the corner (HTTP Basic auth, kept in the same file
136
+ as `auth_user` / `auth_pass`), or mark the network as private there.
137
+
138
+ Whatever the address, requests are checked:
139
+
140
+ - a `Host` that is not this machine gets 421 (the guard against DNS rebinding). An IP, `localhost`,
141
+ a name without a dot (`minipc`), `.local` / `.lan` and this computer's own name pass; a name of
142
+ yours with dots (a domain behind a proxy) goes into `"allowed_hosts": ["tools.example.org"]` in
143
+ the same file;
144
+ - a browser request from another site gets 403; curl and the other tools pass.
145
+
146
+ `--host` is never where a pantheon tool listens: where a tool has `--host`, it is the Ollama address.
147
+
148
+ ## Evidence (simrgl, sqlfluff, a time split: everything built before the 100 tasks it is tested on)
149
+
150
+ | query | plain magura | + boyan | per task |
151
+ |---|---|---|---|
152
+ | the developers' own task text | 141 | 145 | 11 better / 7 worse (n.s.) |
153
+ | a newcomer's paraphrases | 119 | **144** | 21 / 5, p = 0.002 |
154
+ | a small model's paraphrases | 94 | **109** | 13 / 2, p = 0.007 |
155
+
156
+ The numbers are gold files in the fused top 10, summed over 100 tasks (exp17.8, the experiments' own code). The
157
+ package itself (exp17.9): developers 141 → 155, newcomer 119 → 133 (17 / 6, p = 0.035), small model 94 → 107 with
158
+ its default bm25 neighbours (simargl's are not better); the newcomer gain is smaller than exp17.8's because the
159
+ D-masks model is trained on every file (half the guessed words differ) — an ablation on the corpus is next. The vocabulary
160
+ The vote with rare RM3 words (exp17.16, the same stand): 20 words give 157 / 137 / 108 gold files against
161
+ 153 / 131 / 109 with the 10 D-masks words (402 vs 393; not significant); 10 voted words give 393 — the gain
162
+ is the rare RM3 words added, not the vote. The vocabulary
163
+ explains a future task's files far better than folders or clustered module trees (exp17.5): the best
164
+ name's Dice is 0.50, against 0.11 for folders and 0.20–0.27 for tree nodes. The package's own rerun
165
+ is exp17.9.
166
+
167
+ ## Web UI and safety
168
+
169
+ `boyan ui` listens on 127.0.0.1 by default. It has the pantheon's netguard: a password, a network
170
+ warning and trusted addresses, kept in `~/.boyan/config.json`. It also has the shared Export tab:
171
+ an index as a zip, and a zip back as `<start>/.boyan/<name>`. The Build tab builds only from
172
+ paths inside the folder boyan was started in. `~/.boyan/projects.json` registers the indexes
173
+ (`$BOYAN_HOME` for the tests).
174
+
175
+ ## Tests
176
+
177
+ `pytest` — 24 tests: a small git project with a mokosh database and a map, plus the shared netguard
178
+ and transfer tests and magura's use of boyan.
179
+
180
+ ---
181
+
182
+ ## Part of the SIMARGL toolkit
183
+
184
+ boyan is one of thirteen tools that together form an **intellectual development support system**:
185
+
186
+ | Tool | Role |
187
+ |---|---|
188
+ | **[simargl](https://github.com/szholobetsky/simargl)** | Task-to-code retrieval — given a task description, finds which files and modules are likely affected, using semantic similarity over git history |
189
+ | **[svitovyd](https://github.com/szholobetsky/svitovyd)** | Project map — scans any codebase and produces a structural map of definitions and cross-file dependencies; queried from the CLI, a web UI with a layered map, or an MCP server |
190
+ | **[1bcoder](https://github.com/szholobetsky/1bcoder)** | AI coding assistant for small local models — surgical context management, agents, parallel inference, proc scripts |
191
+ | **[yasna](https://github.com/szholobetsky/yasna)** | Session memory — indexes conversations from all AI agents so you can find what was discussed, when, and where |
192
+ | **[radogast](https://github.com/szholobetsky/radogast)** | Context drift monitor — measures how far an AI agent's conversation has drifted from the original task |
193
+ | **[vyrii](https://github.com/szholobetsky/vyrii)** | Local AI web UI — chat, translate, web research, RAG and file management in the browser (Flask); powered by Ollama or any OpenAI-compatible backend |
194
+ | **[syryn](https://github.com/szholobetsky/syryn)** | Bluetooth identity beacon for headless devices — the device's IP is its Bluetooth name; hostname, mDNS and network interfaces on request |
195
+ | **[alkonost](https://github.com/szholobetsky/alkonost)** | Browser cockpit for 1bcoder's flows — the `deepagent_*` spec pipeline (plan tree → specs → task board) and the glossary (build, browse, search), tuned for small local models |
196
+ | **[gamayun](https://github.com/szholobetsky/gamayun)** | Statistical ontology without an LLM — builds triples of terms, identifiers, files and modules from task history or a folder of documents and code; every triple carries its significance test |
197
+ | **[mokosh](https://github.com/szholobetsky/mokosh)** | Dataset gathering — commits of a git repository and the tasks of its tracker (Jira, GitHub, GitLab, YouTrack) in one SQLite database that the other tools read |
198
+ | **[magura](https://github.com/szholobetsky/magura)** | The image of a term across the code, without a build — glossary term → code names → files; triangulation of simargl, gamayun, svitovyd, the glossary and boyan with each source's singles; a field traced through the layers |
199
+ | **[boyan](https://github.com/szholobetsky/boyan)** | The project's own vocabulary — the names a project uses for its parts, learned from its files and task history without an LLM, and a translator (word2vec on the project) from anyone's words to those names and their files; magura's fifth, independent source |
200
+ | **[khors](https://github.com/szholobetsky/khors)** | Markdown document editor inside vyrii and alkonost — write beside the chat, a small local model rewrites the selection or writes at the cursor (shown as a diff to accept), Save as md / ODT / ODP in a theme with formulas and diagrams as LibreOffice objects |
201
+
202
+ - **simargl** finds the code related to a task by vector search over the task history (embeddings).
203
+ - **svitovyd** answers: *how is the code structured and what depends on what?*
204
+ - **1bcoder** answers: *how do I work with local models efficiently?*
205
+ - **yasna** answers: *where did I already discuss this?*
206
+ - **radogast** answers: *is the AI agent still on track toward the goal?*
207
+ - **vyrii** answers: *how do I access all of this through a browser?*
208
+ - **syryn** answers: *what is the address of this headless device?*
209
+ - **alkonost** answers: *how do I turn one task description into a reviewed, working plan — and see the project's glossary — without a big model or a big context window?*
210
+ - **gamayun** finds the code related to a task through an ontology of significant links between words, files and modules (no LLM).
211
+ - **mokosh** prepares the initial dataset from version control and the issue tracker.
212
+ - **magura** answers: *where does this business term live in the code, and which files do all the tools point to?*
213
+ - **boyan** answers: *what does this project call the thing I am describing, and where does it live?*
214
+ - **khors** answers: *how do I turn a chat, a plan or my notes into a document I can hand over — a text or slides — with a small model's help?*
215
+
216
+ Together they cover the full development loop: gather the history, understand the codebase, find relevant history, work with AI locally, remember what was decided, and verify the context stays on target.
217
+
218
+ The name comes from Slavic mythology. Boyan (Боян) is the bard of the *Lay of Igor's Campaign*, "Veles's grandson", who sang the old words to new listeners. A fitting name for a tool that keeps the project's own words and passes them on to anyone who comes to the project.
219
+
220
+ ---
221
+
222
+ ## License
223
+
224
+ MIT. See [LICENSE](LICENSE).
225
+
226
+ ## About
227
+
228
+ (c) 2026 Stanislav Zholobetskyi, Oleh Andriichuk
229
+ Institute for Information Recording, National Academy of Sciences of Ukraine, Kyiv
230
+ PhD research: «Intelligent Technology for Software Development and Maintenance Support»
@@ -0,0 +1,3 @@
1
+ """boyan — the project's own vocabulary: from its files and its tasks, the names that say where a
2
+ task lives, and a translator from anyone's words to them (simrgl exp16.3–exp17.8)."""
3
+ __version__ = "0.1.0"