Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function renderMarkdown(report: BoundReport): string {

if (report.findings.length === 0) {
lines.push('No task scope creep findings.');
lines.push('', ...feedbackFooter());
return `${lines.join('\n')}\n`;
}

Expand Down Expand Up @@ -115,9 +116,21 @@ function renderMarkdown(report: BoundReport): string {
lines.push('');
}

lines.push(...feedbackFooter());
return `${lines.join('\n').trimEnd()}\n`;
}

function feedbackFooter(): string[] {
return [
'## Help improve TaskBound',
'',
'- False positive: https://github.com/Conalh/TaskBound/issues/new?template=false-positive.yml',
'- Missing signal: https://github.com/Conalh/TaskBound/issues/new?template=missing-signal.yml',
'- Team pilot or workflow need: https://github.com/Conalh/TaskBound/issues/new?template=team-pilot.yml',
'- Validation tracker: https://github.com/Conalh/TaskBound/issues/8'
];
}

function renderText(report: BoundReport): string {
const lines = [`TaskBound scope review: ${report.rating.toUpperCase()}`];
if (report.taskScopeSummary.length > 0) {
Expand Down
17 changes: 17 additions & 0 deletions test/cli-output.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ test('CLI emits Markdown task scope summary', async () => {
assert.match(stdout, /header\.css|css/i);
});

test('CLI Markdown report links feedback and team pilot intake', async () => {
const oldDir = join(testDir, 'fixtures', 'on-task', 'old');
const newDir = join(testDir, 'fixtures', 'on-task', 'new');

const { stdout } = await execFileAsync(
process.execPath,
['dist/index.js', 'review', '--task', TASK, '--old', oldDir, '--new', newDir, '--format', 'markdown'],
{ cwd: packageRoot }
);

assert.match(stdout, /## Help improve TaskBound/);
assert.match(stdout, /template=false-positive\.yml/);
assert.match(stdout, /template=missing-signal\.yml/);
assert.match(stdout, /template=team-pilot\.yml/);
assert.match(stdout, /\/issues\/8/);
});

test('CLI emits GitHub warning annotations', async () => {
const oldDir = join(testDir, 'fixtures', 'scope-creep', 'old');
const newDir = join(testDir, 'fixtures', 'scope-creep', 'new');
Expand Down
Loading