cli-changescribe 0.2.0 → 0.2.1
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.
- package/package.json +1 -1
- package/src/pr-summary.js +15 -9
package/package.json
CHANGED
package/src/pr-summary.js
CHANGED
|
@@ -79,19 +79,25 @@ function runGit(command) {
|
|
|
79
79
|
// ---------------------------------------------------------------------------
|
|
80
80
|
|
|
81
81
|
function getCommitDiffInfo(sha, title) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return { stat: '(merge commit)', diff: '' };
|
|
85
|
-
}
|
|
82
|
+
const isMerge = title.toLowerCase().startsWith('merge');
|
|
83
|
+
|
|
86
84
|
try {
|
|
87
|
-
|
|
85
|
+
// For merge commits, diff against the first parent to see what the merge introduced.
|
|
86
|
+
// For normal commits, use git show which diffs against the single parent.
|
|
87
|
+
const statCmd = isMerge
|
|
88
|
+
? `git diff ${sha}^1..${sha} --stat`
|
|
89
|
+
: `git show ${sha} --stat --format=""`;
|
|
90
|
+
const stat = execSync(statCmd, {
|
|
88
91
|
encoding: 'utf8',
|
|
89
92
|
maxBuffer: LARGE_BUFFER_SIZE,
|
|
90
93
|
}).trim();
|
|
91
94
|
|
|
92
95
|
let diff = '';
|
|
93
96
|
try {
|
|
94
|
-
|
|
97
|
+
const diffCmd = isMerge
|
|
98
|
+
? `git diff ${sha}^1..${sha} -U3 --diff-filter=ACMRT`
|
|
99
|
+
: `git show ${sha} -U3 --format="" --diff-filter=ACMRT`;
|
|
100
|
+
diff = execSync(diffCmd, {
|
|
95
101
|
encoding: 'utf8',
|
|
96
102
|
maxBuffer: LARGE_BUFFER_SIZE,
|
|
97
103
|
});
|
|
@@ -304,7 +310,7 @@ function buildPass2Messages(commitsChunk) {
|
|
|
304
310
|
{
|
|
305
311
|
role: 'system',
|
|
306
312
|
content:
|
|
307
|
-
'You are producing compact, high-signal summaries per commit. Use the diff and file stats to understand exactly what changed in the code. Produce 2-3 bullets each (change, rationale, risk/test note). Flag any breaking changes or migrations.',
|
|
313
|
+
'You are producing compact, high-signal summaries per commit. Use the diff and file stats to understand exactly what changed in the code. Produce 2-3 bullets each (change, rationale, risk/test note). Flag any breaking changes or migrations. IMPORTANT: Only reference technologies, frameworks, and patterns that are explicitly visible in the diff or file names. Do not infer or guess technologies that are not shown (e.g., do not mention GraphQL unless you see .graphql files or GraphQL client imports in the diff).',
|
|
308
314
|
},
|
|
309
315
|
{
|
|
310
316
|
role: 'user',
|
|
@@ -333,7 +339,7 @@ function buildPass3Messages(
|
|
|
333
339
|
{
|
|
334
340
|
role: 'system',
|
|
335
341
|
content:
|
|
336
|
-
'You write PR summaries that are easy to review. Be concise, specific, and action-oriented. Do not include markdown fences.',
|
|
342
|
+
'You write PR summaries that are easy to review. Be concise, specific, and action-oriented. Do not include markdown fences. Only reference technologies and patterns that appear in the commit summaries provided. Never fabricate or assume technologies not explicitly mentioned (e.g., do not mention GraphQL, Apollo, Relay, or similar unless the summaries explicitly reference them).',
|
|
337
343
|
},
|
|
338
344
|
{
|
|
339
345
|
role: 'user',
|
|
@@ -382,7 +388,7 @@ function buildReleaseMessages(
|
|
|
382
388
|
{
|
|
383
389
|
role: 'system',
|
|
384
390
|
content:
|
|
385
|
-
'You write release PR summaries for QA to production. Be concise, concrete, and action-oriented. Do not include markdown fences.',
|
|
391
|
+
'You write release PR summaries for QA to production. Be concise, concrete, and action-oriented. Do not include markdown fences. Only reference technologies and patterns that appear in the commit summaries provided. Never fabricate or assume technologies not explicitly mentioned.',
|
|
386
392
|
},
|
|
387
393
|
{
|
|
388
394
|
role: 'user',
|