knoblog 0.1.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.
Files changed (34) hide show
  1. knoblog-0.1.1/LICENSE +21 -0
  2. knoblog-0.1.1/PKG-INFO +171 -0
  3. knoblog-0.1.1/README.md +145 -0
  4. knoblog-0.1.1/knoblog/__init__.py +2 -0
  5. knoblog-0.1.1/knoblog/__main__.py +3 -0
  6. knoblog-0.1.1/knoblog/analyze.py +403 -0
  7. knoblog-0.1.1/knoblog/cli.py +240 -0
  8. knoblog-0.1.1/knoblog/config.py +133 -0
  9. knoblog-0.1.1/knoblog/extractors.py +377 -0
  10. knoblog-0.1.1/knoblog/gitio.py +161 -0
  11. knoblog-0.1.1/knoblog/posttext.py +458 -0
  12. knoblog-0.1.1/knoblog/presets/_template.yml +42 -0
  13. knoblog-0.1.1/knoblog/presets/ardupilot.yml +12 -0
  14. knoblog-0.1.1/knoblog/presets/generic.yml +6 -0
  15. knoblog-0.1.1/knoblog/presets/px4.yml +15 -0
  16. knoblog-0.1.1/knoblog/presets/ros2.yml +13 -0
  17. knoblog-0.1.1/knoblog/presets/x-algorithm.yml +43 -0
  18. knoblog-0.1.1/knoblog/render.py +367 -0
  19. knoblog-0.1.1/knoblog/static/style.css +38 -0
  20. knoblog-0.1.1/knoblog/summarize.py +270 -0
  21. knoblog-0.1.1/knoblog/yamlmini.py +248 -0
  22. knoblog-0.1.1/knoblog.egg-info/PKG-INFO +171 -0
  23. knoblog-0.1.1/knoblog.egg-info/SOURCES.txt +32 -0
  24. knoblog-0.1.1/knoblog.egg-info/dependency_links.txt +1 -0
  25. knoblog-0.1.1/knoblog.egg-info/entry_points.txt +2 -0
  26. knoblog-0.1.1/knoblog.egg-info/requires.txt +6 -0
  27. knoblog-0.1.1/knoblog.egg-info/top_level.txt +1 -0
  28. knoblog-0.1.1/pyproject.toml +43 -0
  29. knoblog-0.1.1/setup.cfg +4 -0
  30. knoblog-0.1.1/tests/test_analyze.py +36 -0
  31. knoblog-0.1.1/tests/test_extractors.py +144 -0
  32. knoblog-0.1.1/tests/test_pipeline.py +142 -0
  33. knoblog-0.1.1/tests/test_posttext.py +110 -0
  34. knoblog-0.1.1/tests/test_yamlmini.py +62 -0
knoblog-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Joshua Almeida
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.
knoblog-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,171 @@
1
+ Metadata-Version: 2.4
2
+ Name: knoblog
3
+ Version: 0.1.1
4
+ Summary: Plain-English changelogs, feeds and X-ready post text for parameter, gain, threshold, flag and config changes in any git repo.
5
+ Author: Joshua Almeida
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/fitzyracing1/knoblog
8
+ Project-URL: Demo, https://fitzyracing1.github.io/x-algorithm-changelog/
9
+ Keywords: changelog,parameters,ros2,px4,ardupilot,robotics,config,release-notes,atom,jsonfeed,x,twitter
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Scientific/Engineering
16
+ Classifier: Topic :: Software Development :: Documentation
17
+ Classifier: Topic :: Software Development :: Version Control :: Git
18
+ Requires-Python: >=3.11
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Provides-Extra: yaml
22
+ Requires-Dist: PyYAML>=6; extra == "yaml"
23
+ Provides-Extra: test
24
+ Requires-Dist: pytest>=7; extra == "test"
25
+ Dynamic: license-file
26
+
27
+ # knoblog
28
+
29
+ **Plain-English release notes for the knobs in your repo.** knoblog walks a git history, pulls every
30
+ parameter, gain, threshold, flag and config default out of each commit, and tells you exactly what changed:
31
+ `max_vel_x 0.26 → 0.5 (92% higher)`, with the commit link, file and percent change. It writes a static site,
32
+ an Atom feed, a JSON feed of structured changes, and X-ready post text, and it never posts anything.
33
+
34
+ Deterministic first: every value is read from the diff and quoted verbatim. An LLM summary is optional, and
35
+ the post-text gate rejects any number that isn't an analysed value or derived from one.
36
+
37
+ **Live demos** (rebuilt weekly by this repo's own Action):
38
+ [Nav2 default parameters](https://fitzyracing1.github.io/knoblog/demo/nav2/) ·
39
+ [PX4 controller parameters](https://fitzyracing1.github.io/knoblog/demo/px4/) ·
40
+ [post text](https://fitzyracing1.github.io/knoblog/demo/nav2/posts.html) ·
41
+ [changes.json](https://fitzyracing1.github.io/knoblog/demo/nav2/changes.json)
42
+
43
+ ![knoblog demo: Nav2 default-parameter changelog](screenshot.png)
44
+
45
+ ## Who it's for
46
+
47
+ **Robotics teams.** Someone retunes `inflation_radius`, bumps `MC_ROLL_P`, or flips `consider_footprint`, and
48
+ the change ships in a commit called "update params". knoblog gives you a running changelog of every
49
+ default your robot actually ships with, built from:
50
+
51
+ - ROS 2 parameter YAML (`ros__parameters`, including nav2/MoveIt-style multi-node files). Numeric arrays are
52
+ diffed per element (`max_accel[0] 2.5 → 3.0`), renamed sections are recognised, and `1` vs `1.0` is kept
53
+ distinct, because ROS 2 cares about int vs double.
54
+ - PX4 parameters: `module.yaml` / `*_params.yaml` definitions and legacy `PARAM_DEFINE_FLOAT/INT32`.
55
+ Moving a parameter from `.c` to `.yaml` is shown as a move, not as delete plus add.
56
+ - ArduPilot `AP_GROUPINFO` tables (`AC_PosControl._ACC_XY`) and `GSCALAR`/`ASCALAR` defaults.
57
+ - C/C++ `#define`, `constexpr`, `static const`; Python constants; Rust `const`/`param!`; Scala/Java constants;
58
+ plain YAML, JSON and TOML.
59
+
60
+ Point it at your config repo in CI and you get a browsable history ("when did the decel limit change, and
61
+ from what?"), an Atom feed for the team channel, and `changes.json` for your own tooling.
62
+
63
+ **X-bot builders.** `posts.json` / `posts.txt` contain one ready-to-post thread per meaningful commit:
64
+
65
+ ```
66
+ Nav2 update (Dec 13): global_costmap/global_costmap/inflation_layer/inflation_radius 0.55 → 0.7 (27% higher)
67
+ - local_costmap/local_costmap/inflation_layer/inflation_radius 0.55 → 0.70 (27% higher)
68
+ ```
69
+
70
+ - Lengths use X's weighted counting (links count as 23, characters like `→` count as 2), with a 280 limit.
71
+ Long updates split into a thread of up to 4 posts.
72
+ - Exact old and new numbers; derived figures (percent, ratio, durations) are computed from them.
73
+ - Accuracy gates: any number not traceable to the diff blocks the post. So do @mentions and hashtags,
74
+ domain-like tokens X would auto-link (`a.b` keys become `a/b`), and conflicting mirrored values.
75
+ Bulk imports and initial commits are skipped with a stated reason.
76
+ - knoblog only writes text. Posting is up to you.
77
+
78
+ The same engine runs <https://fitzyracing1.github.io/x-algorithm-changelog/> (`--config x-algorithm`
79
+ reproduces all 45 entries and all 45 post texts of that site exactly).
80
+
81
+ ## Quickstart
82
+
83
+ ```bash
84
+ pip install knoblog # Python 3.11+, no dependencies
85
+ knoblog init --preset ros2 # writes knoblog.yml
86
+ # edit watch.paths in knoblog.yml, then:
87
+ knoblog run --repo https://github.com/ros-navigation/navigation2 --config knoblog.yml --out site
88
+ open site/index.html # or: python -m http.server -d site
89
+ ```
90
+
91
+ Try a built-in demo without writing any config:
92
+
93
+ ```bash
94
+ knoblog run --config examples/nav2.yml --out site-nav2 # ~30 s including a blob-less clone
95
+ knoblog run --config examples/px4.yml --out site-px4
96
+ knoblog extract path/to/params.yaml # see what knoblog reads from one file
97
+ ```
98
+
99
+ Remote repos are cloned blob-less into `.knoblog-cache/`, so only the watched files are downloaded. That keeps
100
+ PX4 and ArduPilot fast. A local path is used in place.
101
+
102
+ ## Outputs
103
+
104
+ | File | What |
105
+ |---|---|
106
+ | `index.html`, `entries/<sha>.html`, `params.html`, `posts.html` | Static site: summaries, a changes table per commit (old, new, Δ%, file link), full parameter history, post previews |
107
+ | `feed.xml` | Atom 1.0 |
108
+ | `feed.json` | JSON Feed 1.1; each item carries `_knoblog.changes` (structured records) and `_knoblog.post` |
109
+ | `changes.json` | Flat list: `name, old, new, pct_change, ratio, kind, file, file_url, commit, commit_url, date, extractor` |
110
+ | `posts.json`, `posts.txt` | X-ready text per commit with weighted lengths, or a skip reason |
111
+ | `entries.json` | Full analysis |
112
+
113
+ ## Configuration
114
+
115
+ ```yaml
116
+ extends: ros2 # generic | ros2 | px4 | ardupilot | x-algorithm
117
+ name: My Robot # post header: "My Robot update (Oct 9): ..."
118
+ repo: https://github.com/you/robot
119
+ history: {max_commits: 300, since: 2026-01-01}
120
+ watch:
121
+ paths: ['config/**/*.yaml', 'include/**/*.hpp']
122
+ exclude: ['**/test/**']
123
+ extractors: # auto picks by extension and content; or pin them per path
124
+ - use: auto
125
+ - {use: c_const, paths: ['firmware/**/*.h']}
126
+ noise:
127
+ line_patterns: ['generated at \d{4}-\d{2}-\d{2}'] # lines that never count as a change
128
+ highlight: # what leads summaries and posts
129
+ - {pattern: '(^|[._/])(k[pid]|.*_gain)$', label: gain, noun: gain}
130
+ summaries:
131
+ notes_dir: notes # notes/<short-sha>.md overrides the automatic summary
132
+ llm: false # true: XAI_API_KEY or OPENAI_API_KEY writes summaries for un-noted commits (cached)
133
+ site: {title: My Robot parameter changelog, url: https://you.github.io/robot/}
134
+ post:
135
+ names: raw # raw: exact names and literals | human: "click weight" style
136
+ min_change_pct: 5 # smaller changes never lead a post
137
+ max_posts: 4
138
+ ```
139
+
140
+ Comment-only, whitespace-only and noise-only commits are collapsed as no-ops. A value removed from one file
141
+ but still defined in another is marked as moved, not deleted.
142
+
143
+ ## GitHub Action
144
+
145
+ ```yaml
146
+ - uses: actions/checkout@v7
147
+ with: {fetch-depth: 0}
148
+ - uses: fitzyracing1/knoblog@v0
149
+ with:
150
+ config: knoblog.yml
151
+ site-url: https://you.github.io/robot/
152
+ ```
153
+
154
+ Outputs: `entries`, `changes`, `posts_ready`, `site_dir`. A complete Pages workflow is in
155
+ [`examples/workflows/knoblog-pages.yml`](examples/workflows/knoblog-pages.yml). It builds, deploys to Pages,
156
+ and uploads `posts.json` as an artifact, and posts nothing. This repo's own
157
+ [`demo.yml`](.github/workflows/demo.yml) uses the Action to build the live demos.
158
+
159
+ ## Development
160
+
161
+ ```bash
162
+ python -m unittest discover -s tests # or: pytest
163
+ ```
164
+
165
+ Stdlib only: the YAML reader (`knoblog/yamlmini.py`) is a raw-literal parser so values are quoted exactly as
166
+ written. It has been cross-checked against PyYAML on 230 historical versions of the nav2 params files and on
167
+ every PX4 `module.yaml`/`*_params.yaml` default.
168
+
169
+ ## License
170
+
171
+ MIT © Joshua Almeida
@@ -0,0 +1,145 @@
1
+ # knoblog
2
+
3
+ **Plain-English release notes for the knobs in your repo.** knoblog walks a git history, pulls every
4
+ parameter, gain, threshold, flag and config default out of each commit, and tells you exactly what changed:
5
+ `max_vel_x 0.26 → 0.5 (92% higher)`, with the commit link, file and percent change. It writes a static site,
6
+ an Atom feed, a JSON feed of structured changes, and X-ready post text, and it never posts anything.
7
+
8
+ Deterministic first: every value is read from the diff and quoted verbatim. An LLM summary is optional, and
9
+ the post-text gate rejects any number that isn't an analysed value or derived from one.
10
+
11
+ **Live demos** (rebuilt weekly by this repo's own Action):
12
+ [Nav2 default parameters](https://fitzyracing1.github.io/knoblog/demo/nav2/) ·
13
+ [PX4 controller parameters](https://fitzyracing1.github.io/knoblog/demo/px4/) ·
14
+ [post text](https://fitzyracing1.github.io/knoblog/demo/nav2/posts.html) ·
15
+ [changes.json](https://fitzyracing1.github.io/knoblog/demo/nav2/changes.json)
16
+
17
+ ![knoblog demo: Nav2 default-parameter changelog](screenshot.png)
18
+
19
+ ## Who it's for
20
+
21
+ **Robotics teams.** Someone retunes `inflation_radius`, bumps `MC_ROLL_P`, or flips `consider_footprint`, and
22
+ the change ships in a commit called "update params". knoblog gives you a running changelog of every
23
+ default your robot actually ships with, built from:
24
+
25
+ - ROS 2 parameter YAML (`ros__parameters`, including nav2/MoveIt-style multi-node files). Numeric arrays are
26
+ diffed per element (`max_accel[0] 2.5 → 3.0`), renamed sections are recognised, and `1` vs `1.0` is kept
27
+ distinct, because ROS 2 cares about int vs double.
28
+ - PX4 parameters: `module.yaml` / `*_params.yaml` definitions and legacy `PARAM_DEFINE_FLOAT/INT32`.
29
+ Moving a parameter from `.c` to `.yaml` is shown as a move, not as delete plus add.
30
+ - ArduPilot `AP_GROUPINFO` tables (`AC_PosControl._ACC_XY`) and `GSCALAR`/`ASCALAR` defaults.
31
+ - C/C++ `#define`, `constexpr`, `static const`; Python constants; Rust `const`/`param!`; Scala/Java constants;
32
+ plain YAML, JSON and TOML.
33
+
34
+ Point it at your config repo in CI and you get a browsable history ("when did the decel limit change, and
35
+ from what?"), an Atom feed for the team channel, and `changes.json` for your own tooling.
36
+
37
+ **X-bot builders.** `posts.json` / `posts.txt` contain one ready-to-post thread per meaningful commit:
38
+
39
+ ```
40
+ Nav2 update (Dec 13): global_costmap/global_costmap/inflation_layer/inflation_radius 0.55 → 0.7 (27% higher)
41
+ - local_costmap/local_costmap/inflation_layer/inflation_radius 0.55 → 0.70 (27% higher)
42
+ ```
43
+
44
+ - Lengths use X's weighted counting (links count as 23, characters like `→` count as 2), with a 280 limit.
45
+ Long updates split into a thread of up to 4 posts.
46
+ - Exact old and new numbers; derived figures (percent, ratio, durations) are computed from them.
47
+ - Accuracy gates: any number not traceable to the diff blocks the post. So do @mentions and hashtags,
48
+ domain-like tokens X would auto-link (`a.b` keys become `a/b`), and conflicting mirrored values.
49
+ Bulk imports and initial commits are skipped with a stated reason.
50
+ - knoblog only writes text. Posting is up to you.
51
+
52
+ The same engine runs <https://fitzyracing1.github.io/x-algorithm-changelog/> (`--config x-algorithm`
53
+ reproduces all 45 entries and all 45 post texts of that site exactly).
54
+
55
+ ## Quickstart
56
+
57
+ ```bash
58
+ pip install knoblog # Python 3.11+, no dependencies
59
+ knoblog init --preset ros2 # writes knoblog.yml
60
+ # edit watch.paths in knoblog.yml, then:
61
+ knoblog run --repo https://github.com/ros-navigation/navigation2 --config knoblog.yml --out site
62
+ open site/index.html # or: python -m http.server -d site
63
+ ```
64
+
65
+ Try a built-in demo without writing any config:
66
+
67
+ ```bash
68
+ knoblog run --config examples/nav2.yml --out site-nav2 # ~30 s including a blob-less clone
69
+ knoblog run --config examples/px4.yml --out site-px4
70
+ knoblog extract path/to/params.yaml # see what knoblog reads from one file
71
+ ```
72
+
73
+ Remote repos are cloned blob-less into `.knoblog-cache/`, so only the watched files are downloaded. That keeps
74
+ PX4 and ArduPilot fast. A local path is used in place.
75
+
76
+ ## Outputs
77
+
78
+ | File | What |
79
+ |---|---|
80
+ | `index.html`, `entries/<sha>.html`, `params.html`, `posts.html` | Static site: summaries, a changes table per commit (old, new, Δ%, file link), full parameter history, post previews |
81
+ | `feed.xml` | Atom 1.0 |
82
+ | `feed.json` | JSON Feed 1.1; each item carries `_knoblog.changes` (structured records) and `_knoblog.post` |
83
+ | `changes.json` | Flat list: `name, old, new, pct_change, ratio, kind, file, file_url, commit, commit_url, date, extractor` |
84
+ | `posts.json`, `posts.txt` | X-ready text per commit with weighted lengths, or a skip reason |
85
+ | `entries.json` | Full analysis |
86
+
87
+ ## Configuration
88
+
89
+ ```yaml
90
+ extends: ros2 # generic | ros2 | px4 | ardupilot | x-algorithm
91
+ name: My Robot # post header: "My Robot update (Oct 9): ..."
92
+ repo: https://github.com/you/robot
93
+ history: {max_commits: 300, since: 2026-01-01}
94
+ watch:
95
+ paths: ['config/**/*.yaml', 'include/**/*.hpp']
96
+ exclude: ['**/test/**']
97
+ extractors: # auto picks by extension and content; or pin them per path
98
+ - use: auto
99
+ - {use: c_const, paths: ['firmware/**/*.h']}
100
+ noise:
101
+ line_patterns: ['generated at \d{4}-\d{2}-\d{2}'] # lines that never count as a change
102
+ highlight: # what leads summaries and posts
103
+ - {pattern: '(^|[._/])(k[pid]|.*_gain)$', label: gain, noun: gain}
104
+ summaries:
105
+ notes_dir: notes # notes/<short-sha>.md overrides the automatic summary
106
+ llm: false # true: XAI_API_KEY or OPENAI_API_KEY writes summaries for un-noted commits (cached)
107
+ site: {title: My Robot parameter changelog, url: https://you.github.io/robot/}
108
+ post:
109
+ names: raw # raw: exact names and literals | human: "click weight" style
110
+ min_change_pct: 5 # smaller changes never lead a post
111
+ max_posts: 4
112
+ ```
113
+
114
+ Comment-only, whitespace-only and noise-only commits are collapsed as no-ops. A value removed from one file
115
+ but still defined in another is marked as moved, not deleted.
116
+
117
+ ## GitHub Action
118
+
119
+ ```yaml
120
+ - uses: actions/checkout@v7
121
+ with: {fetch-depth: 0}
122
+ - uses: fitzyracing1/knoblog@v0
123
+ with:
124
+ config: knoblog.yml
125
+ site-url: https://you.github.io/robot/
126
+ ```
127
+
128
+ Outputs: `entries`, `changes`, `posts_ready`, `site_dir`. A complete Pages workflow is in
129
+ [`examples/workflows/knoblog-pages.yml`](examples/workflows/knoblog-pages.yml). It builds, deploys to Pages,
130
+ and uploads `posts.json` as an artifact, and posts nothing. This repo's own
131
+ [`demo.yml`](.github/workflows/demo.yml) uses the Action to build the live demos.
132
+
133
+ ## Development
134
+
135
+ ```bash
136
+ python -m unittest discover -s tests # or: pytest
137
+ ```
138
+
139
+ Stdlib only: the YAML reader (`knoblog/yamlmini.py`) is a raw-literal parser so values are quoted exactly as
140
+ written. It has been cross-checked against PyYAML on 230 historical versions of the nav2 params files and on
141
+ every PX4 `module.yaml`/`*_params.yaml` default.
142
+
143
+ ## License
144
+
145
+ MIT © Joshua Almeida
@@ -0,0 +1,2 @@
1
+ """knoblog: plain-English changelogs and X-ready post text for parameter, gain, threshold, flag and config changes."""
2
+ __version__ = "0.1.1"
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())