Skip to content

Work on unit test coverage, fixed vscode extension#89

Merged
Looted merged 6 commits intomasterfrom
develop
Mar 19, 2026
Merged

Work on unit test coverage, fixed vscode extension#89
Looted merged 6 commits intomasterfrom
develop

Conversation

@Looted
Copy link
Copy Markdown
Owner

@Looted Looted commented Mar 19, 2026

No description provided.

Looted added 3 commits March 18, 2026 17:50
- Add tests to cover embedded scenario detection (multi-line Given/When/Then)
- Add tests for session summary logging and reset when expired
- Add tests for targeted checks with all file types (req, scen, test, adr, fact)
- Add tests for system-transform and chat.params hook execution
- Update regex pattern to support multi-line scenario detection
- Configure .kb/config.json in tests for proper file path matching
All tests pass (131 pass, 0 fail)

Covers lines: 39-42, 109-110, 175-184, 186, 196-203, 209-217
Use canonical entity statuses across schemas, runtime checks, docs, and fixtures so valid kb_upsert updates no longer fail and tooling agrees on lifecycle semantics.

Remove internal MCP tool modules that are no longer part of the supported surface and add regression coverage around config, resolver, and traceability helpers.
Copilot AI review requested due to automatic review settings March 19, 2026 12:53
@Looted Looted changed the title Enhance test coverage to 100% for index.ts and align KB status handling Work on unit test coverage, fixed vscode extension Mar 19, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns KB “status” handling across the CLI/MCP/core/fixtures (moving to documented, entity-specific lifecycle values like open / passing / accepted while retaining legacy compatibility) and expands/adjusts tests (notably for VS Code navigation/traceability and MCP schema behavior) to improve coverage and reflect the live tool surface.

Changes:

  • Expand accepted status values in the shared entity schema and update extractors to use type-specific default statuses.
  • Remove unused/internal MCP tool modules and update MCP tool schemas/tests to avoid advertising a stale fixed status enum.
  • Enhance VS Code extension navigation/traceability (open symbol source location + new command) and broaden unit/E2E test coverage accordingly.

Reviewed changes

Copilot reviewed 121 out of 124 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/fixtures/tests/TEST-002.md Update test fixture status to pending.
test/fixtures/tests/TEST-001.md Update test fixture status to pending.
test/fixtures/test-example.md Update test fixture status to pending.
test/fixtures/symbols.yaml Update symbol fixture status to active.
test/fixtures/symbols-manifest.yaml Update symbol fixture status to active.
test/fixtures/symbol-example.md Update symbol fixture status to active.
test/fixtures/flags/FLAG-001.md Update flag fixture status to inactive.
test/fixtures/flag-example.md Update flag fixture status to active.
test/fixtures/events/EVT-002.md Update event fixture status to active.
test/fixtures/events/EVT-001.md Update event fixture status to active.
test/fixtures/event-example.md Update event fixture status to active.
scripts/populate-kb.ts Align seeded entity statuses + tweak typings/output formatting.
packages/vscode/tests/hover.test.ts Tighten mock typings, update expected statuses, add null guards.
packages/vscode/tests/helpers.test.ts Update hover markdown expectations for new statuses.
packages/vscode/tests/extension.test.ts Add coverage for opening local docs and symbol source locations.
packages/vscode/src/types/js-yaml.d.ts Add local type stub for js-yaml.
packages/vscode/src/shared/manifestResolver.ts Prefer paths.symbols and add documentation/symbols.yaml default.
packages/vscode/src/extension.ts Register new navigation command in activation subscriptions.
packages/vscode/src/codeActionProvider.ts Allow navigation targets with optional line numbers.
packages/vscode/src/activation/treeView.ts Pass output channel into tree provider (constructor change).
packages/vscode/src/activation/traceability.ts Prefer navigation targets (path + optional line) for linked entities.
packages/vscode/src/activation/navigation.ts Add kibi.openTreeItemSource command and line-aware opening by ID.
packages/vscode/package.json Bump version + contribute kibi.openTreeItemSource command/menu item.
packages/vscode/media/kibi-activitybar.svg Update activity bar icon SVG (mask-based cutout).
packages/vscode/icon.svg Replace extension icon SVG asset.
packages/opencode/tests/session-tracker.test.ts Add new unit tests for session tracker behavior and singleton.
packages/opencode/tests/prompt.test.ts Expand prompt injection coverage and reformat assertions.
packages/opencode/src/index.ts Improve embedded scenario regex to match across newlines.
packages/mcp/tests/workspace.test.ts Remove tests for deleted resolveWorkspaceRootInfo; reorder imports.
packages/mcp/tests/tools/symbols.test.ts Add coverage for manifest resolution + symbol coordinate refresh.
packages/mcp/tests/tools/prolog-list.test.ts Drop parseTriples tests (function removed).
packages/mcp/tests/tools/idempotency.test.ts Update test entity statuses to open.
packages/mcp/tests/tools/crud.test.ts Update statuses + add test asserting documented status variants are accepted.
packages/mcp/tests/tools/check.test.ts Update statuses used in check tool tests.
packages/mcp/tests/server.test.ts Add helper to write an empty KB snapshot + tighten schema assertions.
packages/mcp/test/fixtures/tests/TEST-002.md Update test fixture status to pending.
packages/mcp/test/fixtures/tests/TEST-001.md Update test fixture status to pending.
packages/mcp/test/fixtures/test-example.md Update test fixture status to pending.
packages/mcp/test/fixtures/symbols.yaml Update symbol fixture status to active.
packages/mcp/test/fixtures/symbols-manifest.yaml Update symbol fixture status to active.
packages/mcp/test/fixtures/symbol-example.md Update symbol fixture status to active.
packages/mcp/test/fixtures/flags/FLAG-001.md Update flag fixture status to inactive.
packages/mcp/test/fixtures/flag-example.md Update flag fixture status to active.
packages/mcp/test/fixtures/events/EVT-002.md Update event fixture status to active.
packages/mcp/test/fixtures/events/EVT-001.md Update event fixture status to active.
packages/mcp/test/fixtures/event-example.md Update event fixture status to active.
packages/mcp/src/workspace.ts Remove resolveWorkspaceRootInfo; add traceability comments.
packages/mcp/src/tools/suggest-shared-facts.ts Delete unused internal tool module.
packages/mcp/src/tools/query-relationships.ts Delete unused internal tool module.
packages/mcp/src/tools/prolog-list.ts Add traceability comments; remove parseTriples.
packages/mcp/src/tools/list-types.ts Delete unused internal tool module.
packages/mcp/src/tools/impact.ts Delete unused internal tool module.
packages/mcp/src/tools/derive.ts Delete unused internal tool module.
packages/mcp/src/tools/coverage-report.ts Delete unused internal tool module.
packages/mcp/src/tools/context.ts Delete unused internal tool module.
packages/mcp/src/tools/branch.ts Delete unused internal tool module.
packages/mcp/src/tools-config.ts Stop advertising fixed status enum in MCP tool schema.
packages/core/src/kb.pl Update ADR/REQ lifecycle semantics (current_adr, current_req, deprecated rules).
packages/core/src/checks.pl Update check rule wording for ADR successor guidance.
packages/cli/tests/utils/rule-registry.test.ts Add extensive unit coverage for rule registry utilities.
packages/cli/tests/traceability/temp-kb.test.ts Add tests for temp KB overlay creation/cleanup and escaping behavior.
packages/cli/tests/schemas.test.ts Update schema tests for new status values and add status coverage cases.
packages/cli/tests/fixtures/requirements/REQ-001.md Update fixture requirement status to open.
packages/cli/tests/extractors/markdown.test.ts Update expected defaults + add type-specific default status test.
packages/cli/tests/extractors/manifest.test.ts Update symbol status expectations to active + reformat relationship assertions.
packages/cli/tests/commands/sync.test.ts Update fixture statuses + adjust manifest symbol status.
packages/cli/tests/commands/query.test.ts Update fixture statuses + adjust manifest symbol status.
packages/cli/tests/commands/check.test.ts Update fixture statuses + adjust symbol status.
packages/cli/src/schemas/entity.schema.json Expand status enum with documented + legacy-compatible values.
packages/cli/src/public/schemas/entity.ts Mirror entity schema status enum updates in public TS schema.
packages/cli/src/extractors/markdown.ts Add type-specific default statuses for extracted markdown entities.
packages/cli/src/extractors/manifest.ts Default symbol status to active instead of draft.
packages/cli/src/commands/check.ts Update ADR successor rule wording.
documentation/tests/e2e/packed/mcp-protocol-regression.test.ts Update statuses in protocol regression assertions.
documentation/tests/e2e/packed/mcp-crud.test.ts Update statuses in E2E CRUD fixtures.
documentation/tests/e2e/packed/init-sync-check.test.ts Update statuses in init/sync/check E2E fixtures.
documentation/tests/e2e/packed/hook-integration.test.ts Update statuses in hook E2E fixtures (but see review comments).
documentation/tests/e2e/packed/branch-workflow.test.ts Update statuses in branch workflow E2E fixtures (but see review comments).
documentation/tests/e2e/opencode-plugin-local.test.ts Update requirement fixture status to open.
documentation/tests/benchmarks/sync.bench.ts Update benchmark requirement status to open.
documentation/tests/benchmarks/query.bench.ts Update benchmark requirement status to open.
documentation/tests/benchmarks/mcp-latency.bench.ts Update benchmark requirement status to open.
documentation/tests/TEST-vscode-traceability.md Update updated_at + add note about added tree view coverage.
documentation/tests/TEST-013.md Update ADR status expectations from active→accepted.
documentation/symbols.yaml Refresh coordinates + update symbol line ranges (but see review comments).
documentation/scenarios/SCEN-vscode-open-entity.md Update scenario steps to include symbol line navigation + expandability.
documentation/scenarios/SCEN-011.md Update wording to “accepted ADRs” for current_adr.
documentation/scenarios/SCEN-004.md Update example kb_upsert status to open.
documentation/requirements/REQ-vscode-traceability.md Update status/updated_at + clarify symbol navigation requirements.
documentation/requirements/REQ-MAIN-ONLY.md Update requirement status to open.
documentation/requirements/REQ-019.md Update requirement status to open.
documentation/requirements/REQ-016.md Update requirement status to open + update ADR successor wording.
documentation/requirements/REQ-015.md Update requirement status to open.
documentation/requirements/REQ-014.md Update requirement status to open.
documentation/requirements/REQ-013.md Update requirement status to open.
documentation/requirements/REQ-012.md Update requirement status to open.
documentation/requirements/REQ-011.md Update requirement status to open.
documentation/requirements/REQ-010.md Update requirement status to open.
documentation/requirements/REQ-009.md Update requirement status to open.
documentation/requirements/REQ-008.md Update requirement status to open.
documentation/requirements/REQ-007.md Update requirement status to open.
documentation/requirements/REQ-006.md Update requirement status to open.
documentation/requirements/REQ-005.md Update requirement status to open.
documentation/requirements/REQ-004.md Update requirement status to open.
documentation/requirements/REQ-003.md Update requirement status to open.
documentation/requirements/REQ-002.md Update requirement status to open.
documentation/requirements/REQ-001.md Update requirement status to open.
documentation/adr/ADR-annotation-strategy.md Update ADR status to accepted.
documentation/adr/ADR-008.md Update ADR status to accepted.
documentation/adr/ADR-007.md Update ADR status to accepted.
documentation/adr/ADR-006.md Update ADR status to accepted.
documentation/adr/ADR-003.md Update ADR status to accepted.
documentation/adr/ADR-002.md Update ADR status to accepted.
documentation/adr/ADR-001.md Update ADR status to accepted.
docs/mcp-reference.md Clarify status values depend on entity type and legacy values may be accepted.
bunfig.toml Ignore nested dist/ and build/ paths in coverage.
.changeset/remove-unused-mcp-internal-tools.md Changeset for removing unused internal MCP tools.
.changeset/fix-kb-upsert-status-validation.md Changeset for status validation/schema alignment.
.changeset/core-status-semantics.md Changeset for core lifecycle semantics alignment.
Comments suppressed due to low confidence (1)

documentation/symbols.yaml:146

  • documentation/symbols.yaml still lists SYM-handleKbQueryRelationships pointing at packages/mcp/src/tools/query-relationships.ts, but that module is deleted in this PR. This will leave stale navigation targets and potentially break any tooling that expects sourceFile to exist. Remove this symbol entry or update it to the new location/status (e.g., mark as removed).

You can also share your feedback on Copilot code review. Take the survey.

Comment thread scripts/populate-kb.ts
Comment on lines 292 to 309
// ── Domain Events ─────────────────────────────────────────────────────────
{
type: "event",
id: "EVT-001",
properties: {
title: "v0.0.1 released as Functional Alpha",
status: "active",
status: "passing",
source: ".sisyphus/CONTINUATION-PLAN.md",
tags: ["release", "v0"],
},
},
{
type: "event",
id: "EVT-002",
properties: {
title: "KB initialized on repository with kibi init",
status: "active",
status: "passing",
source: "README.md",
Comment on lines 129 to 133
`---
title: Initial Requirement
type: req
status: approved
status: open
---
Comment on lines 80 to 85
`---
title: Develop Branch Requirement
type: req
status: approved
status: open
---

Comment thread packages/core/src/kb.pl
Comment on lines 606 to 613
%% current_req(+Id)
% Requirement is current when active and not superseded by another requirement.
% Requirement is current when not deprecated and not superseded by another requirement.
current_req(Id) :-
kb_entity(Id, req, Props),
memberchk(status=Status, Props),
normalize_term_atom(Status, active),
normalize_term_atom(Status, StatusAtom),
memberchk(StatusAtom, [open, in_progress, closed]),
\+ kb_relationship(supersedes, _, Id).
@Looted
Copy link
Copy Markdown
Owner Author

Looted commented Mar 19, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Also please fix failing unit tests.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 19, 2026

@Looted I've opened a new pull request, #90, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits March 19, 2026 13:09
…cy req statuses

Co-authored-by: Looted <6255880+Looted@users.noreply.github.com>
fix: YAML frontmatter indentation in E2E tests, event statuses, and legacy req status support
@Looted Looted merged commit b2d5be4 into master Mar 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants