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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-to-doc
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Conventional Commit messages, changelogs & PRs from git diffs using Gemma (local or cloud)
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -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
- ("format_compliance", 0.20,
18
- "Commit header matches Conventional Commits, valid type, imperative, "
19
- "no trailing period, <= 72 chars. 5 = perfect, 1 = not conventional."),
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
- ("conciseness", 0.15,
25
- "Terse, free of filler/preamble. 5 = clean, 1 = bloated."),
26
- ("changelog_quality", 0.20,
27
- "Valid markdown, user-facing, accurate. 5 = useful, 1 = missing/wrong."),
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. Make it read naturally like a human wrote it.
95
- - body: 1-3 sentences of technical detail (null if simple). Be descriptive but concise.
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 detailed markdown bullet like "- feat(scope): humanized description" ready for CHANGELOG.md. Make it user-focused.
98
- - plain_english: 1-2 sentences a non-technical person could understand explaining WHAT changed and WHY.
99
- - human_title: A highly understandable, plain English title for the document (e.g. "New Feature: Added user authentication" or "Bug Fix: Resolved crash on startup").
100
- - review_notes: 1-2 paragraphs highlighting tricky parts, design decisions, or areas reviewers should focus on.
101
- - file_notes: A dictionary mapping the most important changed file paths to a 1-sentence summary of what changed in that file. (e.g. {"src/main.py": "Added initialization logic for the new auth flow."})
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
- file_lines = []
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
- file_lines.append(f"- `{f}` {note}")
181
+ noted_lines.append(f"| `{f}` | {note} |")
180
182
  else:
181
- file_lines.append(f"- `{f}`")
182
- files_list = "\n".join(file_lines)
183
- files_section = (f"<details>\n<summary>Files changed ({n_files})</summary>\n\n"
184
- f"{files_list}\n\n</details>\n\n")
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 Notes\n\n{doc.review_notes}\n\n"
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
- {review_section}{files_section}{meta_section}"""
241
+ ## Files
242
+
243
+ {files_section}{meta_section}"""
224
244
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-to-doc
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Conventional Commit messages, changelogs & PRs from git diffs using Gemma (local or cloud)
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "git-to-doc"
7
- version = "0.2.1"
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