ticketlens 0.43.3 → 0.43.4
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
CHANGED
|
@@ -4,6 +4,17 @@ import { detectBase } from './branch-scanner.mjs';
|
|
|
4
4
|
const TICKET_KEY_RE = /^[A-Z][A-Z0-9]+-\d+$/;
|
|
5
5
|
const SPAWN_OPTS = { encoding: 'utf8', timeout: 10_000 };
|
|
6
6
|
|
|
7
|
+
// Backlog #26b: markdown never carries source evidence for an acceptance
|
|
8
|
+
// criterion, so unrelated doc edits must not leak into `analyzeDiff` or the
|
|
9
|
+
// raw diff sent to `--consensus`'s external AI providers.
|
|
10
|
+
//
|
|
11
|
+
// `top` anchors the pattern to the repo root; without it `*.md` resolves
|
|
12
|
+
// relative to `cwd`, and callers routinely run from a monorepo subdirectory.
|
|
13
|
+
//
|
|
14
|
+
// Scoped to `.md`, not `docs/**`: non-markdown files under `docs/` can be
|
|
15
|
+
// real evidence (e.g. a docs site's own source).
|
|
16
|
+
const EXCLUDED_DIFF_PATHSPECS = [':(exclude,top)*.md'];
|
|
17
|
+
|
|
7
18
|
function run(execFn, cmd, args, cwd) {
|
|
8
19
|
const result = execFn(cmd, args, { ...SPAWN_OPTS, cwd });
|
|
9
20
|
return result.status === 0 ? (result.stdout || '') : null;
|
|
@@ -19,10 +30,10 @@ function computeDiff(execFn, cwd) {
|
|
|
19
30
|
if (base) {
|
|
20
31
|
const mergeBase = run(execFn, 'git', ['merge-base', 'HEAD', base], cwd)?.trim();
|
|
21
32
|
if (mergeBase) {
|
|
22
|
-
return run(execFn, 'git', ['diff', mergeBase], cwd);
|
|
33
|
+
return run(execFn, 'git', ['diff', mergeBase, '--', ...EXCLUDED_DIFF_PATHSPECS], cwd);
|
|
23
34
|
}
|
|
24
35
|
}
|
|
25
|
-
return run(execFn, 'git', ['diff', 'HEAD'], cwd);
|
|
36
|
+
return run(execFn, 'git', ['diff', 'HEAD', '--', ...EXCLUDED_DIFF_PATHSPECS], cwd);
|
|
26
37
|
}
|
|
27
38
|
|
|
28
39
|
export function findLinkedCommits(ticketKey, opts = {}) {
|