git-to-doc 0.2.1__tar.gz → 0.2.2__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.
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/PKG-INFO +1 -1
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc/evaluate.py +9 -10
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc/model.py +7 -9
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc/renderer.py +30 -10
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc.egg-info/PKG-INFO +1 -1
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/pyproject.toml +1 -1
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/README.md +0 -0
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc/__init__.py +0 -0
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc/cli.py +0 -0
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc/compare.py +0 -0
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc/validate.py +0 -0
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc.egg-info/SOURCES.txt +0 -0
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc.egg-info/dependency_links.txt +0 -0
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc.egg-info/entry_points.txt +0 -0
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc.egg-info/requires.txt +0 -0
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/git_to_doc.egg-info/top_level.txt +0 -0
- {git_to_doc-0.2.1 → git_to_doc-0.2.2}/setup.cfg +0 -0
|
@@ -14,17 +14,16 @@ from git_to_doc.model import _client, _resolve_model
|
|
|
14
14
|
DEFAULT_JUDGE = "gpt-oss:120b"
|
|
15
15
|
|
|
16
16
|
RUBRIC = [
|
|
17
|
-
("
|
|
18
|
-
"Commit header matches Conventional Commits, valid type, imperative, "
|
|
19
|
-
|
|
20
|
-
("type_accuracy", 0.15,
|
|
21
|
-
"type/scope correctly reflect the change. 5 = right, 1 = wrong."),
|
|
22
|
-
("semantic_accuracy", 0.30,
|
|
17
|
+
("conventional_commit", 0.15,
|
|
18
|
+
"Commit header matches Conventional Commits, valid type/scope, imperative mood. 5 = perfect, 1 = invalid."),
|
|
19
|
+
("semantic_accuracy", 0.25,
|
|
23
20
|
"Truthfully describes the diff, no hallucination/omission. 5 = faithful, 1 = fabricated."),
|
|
24
|
-
("
|
|
25
|
-
"
|
|
26
|
-
("
|
|
27
|
-
"
|
|
21
|
+
("changelog_quality", 0.15,
|
|
22
|
+
"Valid markdown, user-facing, accurate changelog entry. 5 = useful, 1 = missing/wrong."),
|
|
23
|
+
("plain_english_quality", 0.25,
|
|
24
|
+
"The 'What changed' section explains the change clearly to a human reader, and file notes accurately summarize file changes. 5 = excellent, 1 = confusing/absent."),
|
|
25
|
+
("reviewer_utility", 0.20,
|
|
26
|
+
"The review notes highlight tricky parts, design decisions, and are highly actionable for reviewers. 5 = highly useful, 1 = generic/empty."),
|
|
28
27
|
]
|
|
29
28
|
|
|
30
29
|
|
|
@@ -84,24 +84,22 @@ class CommitDoc(BaseModel):
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
SYSTEM_PROMPT = """
|
|
87
|
-
|
|
88
87
|
You are a senior developer and expert technical writer.
|
|
89
88
|
Given a raw git diff, output ONLY a valid JSON object with no explanation, no markdown fences, no preamble.
|
|
90
89
|
|
|
91
90
|
Rules for each field:
|
|
92
91
|
- type: one of feat|fix|docs|refactor|perf|test|chore|ci|build|revert
|
|
93
92
|
- scope: lowercase name of the module or folder most affected (null if unclear)
|
|
94
|
-
- subject: imperative mood, lowercase, no trailing period, max 72 chars.
|
|
95
|
-
- body:
|
|
93
|
+
- subject: imperative mood, lowercase, no trailing period, max 72 chars. Write it like a human developer would — natural and specific, not robotic.
|
|
94
|
+
- body: 2-4 sentences of precise technical detail explaining WHAT was changed and WHY. Reference specific function names, file paths, or patterns you see in the diff. Never be vague. null if truly trivial.
|
|
96
95
|
- breaking: true ONLY if existing public API contracts are removed or changed incompatibly
|
|
97
|
-
- changelog_entry: a
|
|
98
|
-
- plain_english:
|
|
99
|
-
- human_title: A
|
|
100
|
-
- review_notes:
|
|
101
|
-
- file_notes: A dictionary mapping the
|
|
96
|
+
- changelog_entry: a user-facing markdown bullet starting with "- " that summarizes the change for a CHANGELOG.md. Be specific and helpful — mention the feature, fix, or improvement by name. For large changes, use multiple sub-bullets with " - " to break down the key items.
|
|
97
|
+
- plain_english: 3-5 sentences explaining this change to a developer who hasn't seen the code. Cover: (1) what the code did before, (2) what it does now, and (3) why this matters. Use concrete language, not vague summaries. Reference module names and behaviors.
|
|
98
|
+
- human_title: A clear, specific title for the document. Bad: "Code Update". Good: "Refactor: Simplified checkpoint loading to return checkpointer objects directly". The title should tell someone exactly what happened without opening the doc.
|
|
99
|
+
- review_notes: 2-3 paragraphs for code reviewers. Paragraph 1: the overall approach and key design decisions. Paragraph 2: specific areas that need careful review (e.g., edge cases, error handling, concurrency). Paragraph 3 (optional): suggestions for follow-up work or things that were intentionally left out.
|
|
100
|
+
- file_notes: A dictionary mapping up to 10 of the MOST IMPORTANT changed file paths to a 1-sentence summary of what changed in each. Focus on files where the logic actually changed, not config or boilerplate. If the diff has more than 10 files, pick the ones with the most substantive changes.
|
|
102
101
|
|
|
103
102
|
Output format: raw JSON only. No ```json fences. No commentary.
|
|
104
|
-
|
|
105
103
|
"""
|
|
106
104
|
|
|
107
105
|
|
|
@@ -170,23 +170,41 @@ def render_markdown_file(doc: CommitDoc, model: str = "gemma4",
|
|
|
170
170
|
section = _SECTION.get(doc.type, "Changed")
|
|
171
171
|
changelog_block = f"### {section}\n{doc.changelog_entry}"
|
|
172
172
|
|
|
173
|
+
# 5. Files section — key files with notes shown prominently, rest collapsed
|
|
173
174
|
files_section = ""
|
|
174
175
|
if stats and stats.get("files"):
|
|
175
|
-
|
|
176
|
+
noted_lines = []
|
|
177
|
+
other_lines = []
|
|
176
178
|
for f in stats["files"]:
|
|
177
179
|
note = doc.file_notes.get(f)
|
|
178
180
|
if note:
|
|
179
|
-
|
|
181
|
+
noted_lines.append(f"| `{f}` | {note} |")
|
|
180
182
|
else:
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
other_lines.append(f"- `{f}`")
|
|
184
|
+
|
|
185
|
+
parts = []
|
|
186
|
+
if noted_lines:
|
|
187
|
+
parts.append("### Key files\n")
|
|
188
|
+
parts.append("| File | Change |")
|
|
189
|
+
parts.append("|------|--------|")
|
|
190
|
+
parts.extend(noted_lines)
|
|
191
|
+
parts.append("")
|
|
192
|
+
|
|
193
|
+
if other_lines:
|
|
194
|
+
other_text = "\n".join(other_lines)
|
|
195
|
+
parts.append(f"<details>\n<summary>Other files changed ({len(other_lines)})</summary>\n")
|
|
196
|
+
parts.append(other_text)
|
|
197
|
+
parts.append("\n</details>\n")
|
|
198
|
+
|
|
199
|
+
if parts:
|
|
200
|
+
files_section = "\n".join(parts) + "\n"
|
|
201
|
+
|
|
202
|
+
# 6. Review notes
|
|
186
203
|
review_section = ""
|
|
187
204
|
if doc.review_notes:
|
|
188
|
-
review_section = f"## Review
|
|
205
|
+
review_section = f"## Review notes\n\n{doc.review_notes}\n\n"
|
|
189
206
|
|
|
207
|
+
# 7. Metadata (always collapsed)
|
|
190
208
|
src_row = f"| Source | {source} |\n" if source else ""
|
|
191
209
|
meta_section = (f"<details>\n<summary>Metadata</summary>\n\n"
|
|
192
210
|
f"| Field | Value |\n|-------|-------|\n"
|
|
@@ -208,7 +226,7 @@ def render_markdown_file(doc: CommitDoc, model: str = "gemma4",
|
|
|
208
226
|
|
|
209
227
|
{doc.plain_english}
|
|
210
228
|
|
|
211
|
-
## Commit message
|
|
229
|
+
{review_section}## Commit message
|
|
212
230
|
|
|
213
231
|
```
|
|
214
232
|
{commit_block}
|
|
@@ -220,5 +238,7 @@ def render_markdown_file(doc: CommitDoc, model: str = "gemma4",
|
|
|
220
238
|
{changelog_block}
|
|
221
239
|
```
|
|
222
240
|
|
|
223
|
-
|
|
241
|
+
## Files
|
|
242
|
+
|
|
243
|
+
{files_section}{meta_section}"""
|
|
224
244
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "git-to-doc"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "Conventional Commit messages, changelogs & PRs from git diffs using Gemma (local or cloud)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|