Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
6 changes: 6 additions & 0 deletions .changeset/ci-diagnostics-symbol-refresh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"kibi-cli": patch
"kibi-mcp": patch
---

Add CI-only diagnostic logging for symbol coordinate refresh to help isolate the refreshCoordinatesForSymbolId coverage failure on GitHub Actions.
5 changes: 0 additions & 5 deletions .changeset/honor-sync-path-bootstrap.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/mcp-refresh-seam-isolation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kibi-mcp": patch
---

Replace mock.module-based symbol refresh mocking in MCP upsert tests with a test seam to prevent cross-file leakages under coverage.
12 changes: 0 additions & 12 deletions .changeset/opencode-plugin-logging-remediation.md

This file was deleted.

34 changes: 17 additions & 17 deletions documentation/symbols.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# symbols.yaml
# AUTHORED fields (edit freely):
# id, title, sourceFile, links, status, tags, owner, priority
# GENERATED fields (never edit manually — overwritten by kibi sync and kb_symbols_refresh):
# GENERATED fields (never edit manually — overwritten by kibi sync and kb.symbols.refresh):
# sourceLine, sourceColumn, sourceEndLine, sourceEndColumn, coordinatesGeneratedAt
# Run `kibi sync` or call the `kb_symbols_refresh` MCP tool to refresh coordinates.
# Run `kibi sync` or call the `kb.symbols.refresh` MCP tool to refresh coordinates.
symbols:
- id: SYM-001
title: PrologProcess
Expand All @@ -20,7 +20,7 @@ symbols:
sourceColumn: 13
sourceEndLine: 576
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-28T18:53:57.173Z'
coordinatesGeneratedAt: '2026-03-31T09:19:46.625Z'
- id: SYM-002
title: handleKbUpsert
sourceFile: packages/mcp/src/tools/upsert.ts
Expand All @@ -36,7 +36,7 @@ symbols:
sourceColumn: 22
sourceEndLine: 244
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-28T18:53:57.274Z'
coordinatesGeneratedAt: '2026-03-31T09:19:46.728Z'
- id: SYM-003
title: handleKbQuery
sourceFile: packages/mcp/src/tools/query.ts
Expand All @@ -49,7 +49,7 @@ symbols:
sourceColumn: 22
sourceEndLine: 91
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-28T18:53:57.275Z'
coordinatesGeneratedAt: '2026-03-31T09:19:46.729Z'
- id: SYM-004
title: handleKbCheck
sourceFile: packages/mcp/src/tools/check.ts
Expand All @@ -65,7 +65,7 @@ symbols:
sourceColumn: 22
sourceEndLine: 219
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-28T18:53:57.353Z'
coordinatesGeneratedAt: '2026-03-31T09:19:46.811Z'
- id: SYM-005
title: KibiTreeDataProvider
sourceFile: packages/vscode/src/treeProvider.ts
Expand All @@ -81,7 +81,7 @@ symbols:
sourceColumn: 13
sourceEndLine: 1002
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-28T18:53:57.481Z'
coordinatesGeneratedAt: '2026-03-31T09:19:46.978Z'
- id: SYM-007
title: extractFromManifest
sourceFile: packages/cli/src/extractors/manifest.ts
Expand All @@ -94,7 +94,7 @@ symbols:
sourceColumn: 16
sourceEndLine: 176
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-28T18:53:57.536Z'
coordinatesGeneratedAt: '2026-03-31T09:19:47.049Z'
- id: SYM-010
title: startServer
sourceFile: packages/mcp/src/server.ts
Expand All @@ -107,7 +107,7 @@ symbols:
sourceColumn: 22
sourceEndLine: 57
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-28T18:53:57.707Z'
coordinatesGeneratedAt: '2026-03-31T09:19:47.276Z'
- id: SYM-KibiTreeDataProvider
title: KibiTreeDataProvider
sourceFile: packages/vscode/src/treeProvider.ts
Expand All @@ -123,7 +123,7 @@ symbols:
sourceColumn: 13
sourceEndLine: 1002
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-28T18:53:57.707Z'
coordinatesGeneratedAt: '2026-03-31T09:19:47.276Z'
- id: SYM-KibiCodeActionProvider
title: KibiCodeActionProvider
sourceFile: packages/vscode/src/codeActionProvider.ts
Expand All @@ -138,7 +138,7 @@ symbols:
sourceColumn: 13
sourceEndLine: 106
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-28T18:53:57.708Z'
coordinatesGeneratedAt: '2026-03-31T09:19:47.277Z'
- id: SYM-handleKbQueryRelationships
title: handleKbQueryRelationships
sourceFile: packages/mcp/src/tools/query-relationships.ts
Expand Down Expand Up @@ -170,7 +170,7 @@ symbols:
sourceColumn: 16
sourceEndLine: 91
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-28T18:53:57.710Z'
coordinatesGeneratedAt: '2026-03-31T09:19:47.278Z'
- id: SYM-KibiCodeLensProvider
title: KibiCodeLensProvider
sourceFile: packages/vscode/src/codeLensProvider.ts
Expand All @@ -185,7 +185,7 @@ symbols:
sourceColumn: 13
sourceEndLine: 334
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-28T18:53:57.821Z'
coordinatesGeneratedAt: '2026-03-31T09:19:47.387Z'
- id: SYM-mergeStaticLinks
title: mergeStaticLinks
sourceFile: packages/vscode/src/codeLensProvider.ts
Expand Down Expand Up @@ -230,7 +230,7 @@ symbols:
sourceColumn: 16
sourceEndLine: 102
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-30T09:23:50.000Z'
coordinatesGeneratedAt: '2026-03-31T09:19:47.464Z'
- id: SYM-checkWorkspaceHealth
title: checkWorkspaceHealth
sourceFile: packages/opencode/src/workspace-health.ts
Expand All @@ -241,8 +241,8 @@ symbols:
target: REQ-opencode-kibi-plugin-v1
- type: covered_by
target: TEST-opencode-kibi-plugin-v1
sourceLine: 30
sourceLine: 31
sourceColumn: 16
sourceEndLine: 86
sourceEndLine: 87
sourceEndColumn: 1
coordinatesGeneratedAt: '2026-03-29T20:24:42.644Z'
coordinatesGeneratedAt: '2026-03-31T09:19:47.531Z'
23 changes: 23 additions & 0 deletions documentation/tests/TEST-mcp-upsert-coverage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
id: TEST-mcp-upsert-coverage
title: MCP upsert handler unit coverage exercises validation and failure paths
status: active
created_at: 2026-03-30T00:00:00Z
updated_at: 2026-03-30T00:00:00Z
priority: must
tags:
- mcp
- test
- upsert
- coverage
source: packages/mcp/tests/tools/upsert.test.ts
links:
- REQ-002
- REQ-011
---

Validation steps:
- run `bun test packages/mcp/tests/tools/upsert.test.ts packages/mcp/tests/tools/upsert-contradictions.test.ts packages/mcp/tests/tools/crud.test.ts`
- run `bun test --coverage packages/mcp/tests/tools/upsert.test.ts packages/mcp/tests/tools/upsert-contradictions.test.ts packages/mcp/tests/tools/crud.test.ts`
- verify `packages/mcp/src/tools/upsert.ts` reports 100% line coverage
- verify mocked paths cover validation, contradiction formatting, audit/save failures, and symbol refresh warnings
6 changes: 6 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# kibi-cli

## 0.4.2

### Patch Changes

- 7309d18: Export `__test__` helpers from `traceability/validate.ts` to enable unit testing of internal Prolog parsing utilities.

## 0.4.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kibi-cli",
"version": "0.4.1",
"version": "0.4.2",
"type": "module",
"description": "Kibi CLI for knowledge base management",
"engines": {
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/extractors/symbols-coordinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export async function enrichSymbolCoordinates(
entries: ManifestSymbolEntry[],
workspaceRoot: string,
): Promise<ManifestSymbolEntry[]> {
// implements REQ-vscode-traceability
const output = entries.map((entry) => ({ ...entry }));

const tsIndices: number[] = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/extractors/symbols-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ export async function enrichSymbolCoordinatesWithTsMorph(
entries: ManifestSymbolEntry[],
workspaceRoot: string,
): Promise<ManifestSymbolEntry[]> {
// implements REQ-vscode-traceability
const project = new Project({
skipAddingFilesFromTsConfig: true,
});
const sourceFileCache = new Map<string, SourceFile>();

const enriched: ManifestSymbolEntry[] = [];

for (const entry of entries) {
try {
const resolved = resolveSourcePath(entry.sourceFile, workspaceRoot);
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/src/traceability/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,11 @@ export function formatViolations(violations: Violation[]): string {
}
return lines.join("\n");
}

// Test helpers for edge-case coverage
export const __test__ = {
unquoteAtom,
splitTopLevelComma,
splitTopLevelLists,
parsePrologListOfLists,
};
Loading
Loading