fix(ai-context): emit compact markdown tables

This commit is contained in:
azizur100389 2026-07-27 08:47:38 +01:00
parent 4906daf27b
commit 02ebf8f199
2 changed files with 15 additions and 2 deletions

View file

@ -175,7 +175,7 @@ export function generateGitNexusContent(
const tableBody = [standardSkillsRows, generatedRows].filter(Boolean).join('\n');
const skillsTable = tableBody
? `| Task | Read this skill file |
|------|---------------------|
| --- | --- |
${tableBody}`
: '';
// Docs reference the project-local runner `gitnexus analyze` writes (#1945):
@ -222,7 +222,7 @@ This project is indexed by GitNexus as **${projectName}**${noStats ? '' : ` (${s
## Resources
| Resource | Use for |
|----------|---------|
| --- | --- |
| \`gitnexus://repo/${projectName}/context\` | Codebase overview, check index freshness |
| \`gitnexus://repo/${projectName}/clusters\` | All functional areas |
| \`gitnexus://repo/${projectName}/processes\` | All execution flows |

View file

@ -166,6 +166,19 @@ describe('generateAIContextFiles', () => {
expect(withoutPdg).toContain('explain(');
});
it('emits MD060-compatible compact tables in generated docs (#2709)', () => {
const content = generateGitNexusContent('MarkdownProject', {
nodes: 50,
edges: 100,
processes: 5,
});
expect(content).toContain('| Resource | Use for |\n| --- | --- |\n');
expect(content).toContain('| Task | Read this skill file |\n| --- | --- |\n');
expect(content).not.toContain('|----------|---------|');
expect(content).not.toContain('|------|---------------------|');
});
it('degrades gracefully when the runner copy fails (#1945)', async () => {
// A read-only/full-disk storage dir must not abort generation. The copy is
// best-effort + logged; the generated docs still carry the inline bootstrap