Skip to content

Integration tests for annotation, audit, cache, and CallGraphFromTo tools#170

Merged
data-douser merged 6 commits intodd/sqlite-annotation-cachefrom
dd/integration-tests
Mar 29, 2026
Merged

Integration tests for annotation, audit, cache, and CallGraphFromTo tools#170
data-douser merged 6 commits intodd/sqlite-annotation-cachefrom
dd/integration-tests

Conversation

@data-douser
Copy link
Copy Markdown
Collaborator

Summary

Add client integration test fixtures and extension integration tests for all new annotation, audit, cache, and CallGraphFromTo tools introduced in #169.

Changes

Client integration test fixtures (16 new test cases)

  • annotation_create/basic_create — verify annotation creation with categories
  • annotation_delete/delete_by_prefix — verify prefix-based deletion
  • annotation_list/filter_by_category_and_prefix — verify filtered listing
  • annotation_search/full_text_search — verify full-text search across annotations
  • audit_store_findings/mrva_findings_across_repos — verify MRVA finding storage
  • audit_list_findings/mrva_findings_for_repo — verify per-repo listing
  • audit_add_notes/mrva_triage_notes — verify triage note attachment
  • audit_clear_repo/clear_single_repo — verify per-repo cleanup
  • query_results_cache_lookup/lookup_by_query_name — verify cache key lookup
  • query_results_cache_retrieve/retrieve_with_subset — verify subset retrieval
  • query_results_cache_clear/clear_all — verify cache clearing
  • query_results_cache_compare/compare_across_databases — verify cross-DB comparison
  • codeql_query_run/cpp_call_graph_from_to_example1 — CallGraphFromTo for C++
  • codeql_query_run/javascript_call_graph_from_to_example1 — CallGraphFromTo for JS
  • codeql_query_run/python_call_graph_from_to_example1 — CallGraphFromTo for Python

Workflow integration test

  • mrva_finding_triage/mrva_triage_workflow — end-to-end MRVA finding triage

Extension integration test

  • Updated mcp-tool-e2e.integration.test.ts with tool availability checks and MRVA e2e workflow

Test runner update

  • client/scripts/run-integration-tests.sh — added annotation mode support

Dependencies

Review order

Review after #169 is merged.

Closes #166
Part of #163

@data-douser data-douser force-pushed the dd/sqlite-annotation-cache branch 2 times, most recently from 7c71547 to 5c4f5b8 Compare March 27, 2026 20:35
data-douser and others added 5 commits March 29, 2026 10:44
Replace lowdb with sql.js (asm.js build) for zero-dependency SQLite persistence.
Bundle inline with esbuild — no native modules, no external deps at runtime.

SqliteStore provides three tables:
- sessions: session tracking (migrated from lowdb)
- annotations: key-value annotation store with categories and metadata
- query_result_cache: BQRS/SARIF result caching with subset retrieval

New tools (gated by ENABLE_ANNOTATION_TOOLS env var):
- annotation_create, annotation_list, annotation_search, annotation_delete
- audit_store_findings, audit_list_findings, audit_add_notes, audit_clear_repo
- query_results_cache_lookup, query_results_cache_retrieve,
  query_results_cache_clear, query_results_cache_compare

Code refactoring for maintainability:
- Extract database-resolver.ts from cli-tool-registry.ts
- Extract query-resolver.ts from cli-tool-registry.ts
- Extract result-processor.ts from cli-tool-registry.ts
- Extract codeql-version.ts from cli-executor.ts

Bug fixes:
- Fix params.output not propagated to proce- Fix params.output not propagated to proce- Fix params.output not propagated txternal predicate conditions for direct query paths

Closes #165
…To tools

Client integration test fixtures:
- annotation_create, annotation_delete, annotation_list, annotation_search
- audit_store_findings, audit_list_findings, audit_add_notes, audit_clear_repo
- query_results_cache_lookup, query_results_cache_retrieve,
  query_results_cache_clear, query_results_cache_compare
- codeql_query_run CallGraphFromTo for cpp, javascript, python

Workflow integration test:
- mrva_finding_triage end-to-end workflow

Extension integration tests:
- mcp-tool-e2e: tool availability and MRVA workflow validation

Updated client/scripts/run-integration-tests.sh with annotation mode support.

Closes #166
…ics; always apply SARIF path for SARIF format

Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/219712ee-4c28-4b51-9da5-961020112e6e

Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
Brings in all review feedback fixes (FTS safety, offset-only LIMIT,
cache limit param, int/positive Zod schemas, store lifecycle fix)
and the rebuilt dist.
@data-douser data-douser force-pushed the dd/integration-tests branch from 901a192 to 47979aa Compare March 29, 2026 16:49
@data-douser data-douser marked this pull request as ready for review March 29, 2026 18:26
@data-douser data-douser requested review from a team and enyil as code owners March 29, 2026 18:26
@data-douser data-douser merged commit 445d057 into dd/sqlite-annotation-cache Mar 29, 2026
@data-douser data-douser deleted the dd/integration-tests branch March 29, 2026 20:02
data-douser added a commit that referenced this pull request Mar 30, 2026
…ools (#170)

* feat: SqliteStore backend with annotation, audit, and cache tools

Replace lowdb with sql.js (asm.js build) for zero-dependency SQLite persistence.
Bundle inline with esbuild — no native modules, no external deps at runtime.

SqliteStore provides three tables:
- sessions: session tracking (migrated from lowdb)
- annotations: key-value annotation store with categories and metadata
- query_result_cache: BQRS/SARIF result caching with subset retrieval

New tools (gated by ENABLE_ANNOTATION_TOOLS env var):
- annotation_create, annotation_list, annotation_search, annotation_delete
- audit_store_findings, audit_list_findings, audit_add_notes, audit_clear_repo
- query_results_cache_lookup, query_results_cache_retrieve,
  query_results_cache_clear, query_results_cache_compare

Code refactoring for maintainability:
- Extract database-resolver.ts from cli-tool-registry.ts
- Extract query-resolver.ts from cli-tool-registry.ts
- Extract result-processor.ts from cli-tool-registry.ts
- Extract codeql-version.ts from cli-executor.ts

Bug fixes:
- Fix params.output not propagated to proce- Fix params.output not propagated to proce- Fix params.output not propagated txternal predicate conditions for direct query paths

Closes #165

* Add integration tests for annotation, audit, cache, and CallGraphFromTo tools

Client integration test fixtures:
- annotation_create, annotation_delete, annotation_list, annotation_search
- audit_store_findings, audit_list_findings, audit_add_notes, audit_clear_repo
- query_results_cache_lookup, query_results_cache_retrieve,
  query_results_cache_clear, query_results_cache_compare
- codeql_query_run CallGraphFromTo for cpp, javascript, python

Workflow integration test:
- mrva_finding_triage end-to-end workflow

Extension integration tests:
- mcp-tool-e2e: tool availability and MRVA workflow validation

Updated client/scripts/run-integration-tests.sh with annotation mode support.

Closes #166

* Fix server build

* Remove grep from cache tools; fix annotation_search API to FTS semantics; always apply SARIF path for SARIF format

Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/219712ee-4c28-4b51-9da5-961020112e6e

Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>

* Sync server src/test/dist to dd/sqlite-annotation-cache tip

Brings in all review feedback fixes (FTS safety, offset-only LIMIT,
cache limit param, int/positive Zod schemas, store lifecycle fix)
and the rebuilt dist.

* Fix extension integration tests

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
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.

Integration tests for annotation, audit, cache, and CallGraphFromTo tools

2 participants