diff --git a/gitnexus/src/mcp/tools.ts b/gitnexus/src/mcp/tools.ts index 5db37438e..9591213c6 100644 --- a/gitnexus/src/mcp/tools.ts +++ b/gitnexus/src/mcp/tools.ts @@ -476,7 +476,7 @@ SERVICE: optional monorepo path prefix (case-sensitive path segments). When "rep // statement anchor" and is tolerated on the callgraph path. minimum: 0, description: - "1-based source line — PDG statement anchor (mode:'pdg'). Seeds affectedStatements on the statement at this line; inter-procedural symbols are still returned in interproceduralByDepth/pdgInterprocedural and the compatibility byDepth bucket. 0 (or omitted) means no statement anchor; mode:'pdg' requires a positive line.", + "1-based source line — PDG statement anchor (mode:'pdg'). Seeds affectedStatements on the statement at this line; inter-procedural symbols are still returned in interproceduralByDepth/pdgInterprocedural and the compatibility byDepth bucket. Omit line for whole-symbol pdg (whole-symbol reach + diagnostics); a positive line anchors a statement slice. Literal 0 is tolerated only as an omitted-line compatibility sentinel on the callgraph path and is rejected for mode:'pdg'.", }, file_path: { type: 'string', diff --git a/gitnexus/test/unit/tools.test.ts b/gitnexus/test/unit/tools.test.ts index 0b90061a8..076c4dae2 100644 --- a/gitnexus/test/unit/tools.test.ts +++ b/gitnexus/test/unit/tools.test.ts @@ -146,10 +146,15 @@ describe('GITNEXUS_TOOLS', () => { // Statement-anchored slice is optional — never required. expect(impactTool.inputSchema.required).not.toContain('line'); // The description names the mode:'pdg' statement-anchor semantics and the - // 0/omitted = no-anchor compatibility convention. + // literal-0 compatibility convention — without contradicting the top-level + // "omit line for whole-symbol pdg" contract (#2283). expect(line.description).toMatch(/statement anchor/i); expect(line.description).toMatch(/pdg/i); - expect(line.description).toMatch(/0 \(or omitted\) means no statement anchor/i); + expect(line.description).toMatch(/literal 0 is tolerated only .* on the callgraph path/i); + expect(line.description).toMatch(/omit line for whole-symbol pdg/i); + // Must NOT claim pdg "requires a positive line" — that contradicts the valid + // no-line whole-symbol pdg call documented in the top-level description. + expect(line.description).not.toMatch(/requires a positive line/i); // The top-level description mentions the statement-anchored slice and result shape. expect(impactTool.description).toMatch(/statement-anchored|STATEMENT-ANCHORED/); expect(impactTool.description).toContain('affectedStatements');