# MCP GhostCrab Perso Non-Regression Cases

Target workspace: `mindbrain-seo-audit`
Rule: all checks use MCP GhostCrab Perso read-only tools only. No direct SQLite queries are allowed for business answers.

## Runtime And Catalog

1. `ghostcrab_status({ agent_id })`
   - Expected: returns `database_kind=sqlite`, health, active workspace, and backend readiness.
   - Must clarify whether `active_workspace_id=default` can be overridden per call.

2. `ghostcrab_tool_search({ query: "", visibility: ["basic"], limit: 20 })`
   - Expected: returns the basic callable tools and current `catalog_size`.

3. `ghostcrab_tool_search({ query: "", visibility: ["extended"], limit: 20 })`
   - Expected: returns extended tools and either a cursor/offset for more results or a clear statement that the response is partial.

4. `ghostcrab_tool_search({ query: "", limit: 50 })`
   - Expected: either succeeds for full catalog export or fails with validation plus a documented pagination alternative.

## Workspace Routing

5. `ghostcrab_search({ workspace_id: "mindbrain-seo-audit", query: "demo timeline", limit: 5 })`
   - Expected: searches only `mindbrain-seo-audit`.

6. `ghostcrab_search({ workspace_id: "workspace-that-does-not-exist", query: "ghostcrab", limit: 5 })`
   - Expected: explicit unknown-workspace error or response metadata `workspace_found=false`.

7. `ghostcrab_pack({ workspace_id: "workspace-that-does-not-exist", query: "ghostcrab", limit: 5 })`
   - Expected: explicit unknown-workspace error or strict empty result. It must not return default/global context.

## Facets/Search/Count Consistency

8. `ghostcrab_search({ workspace_id: "mindbrain-seo-audit", query: "", limit: 10 })`
   - Expected: if source/facet records are visible, follow-up counts can count the same rows.

9. `ghostcrab_count({ workspace_id: "mindbrain-seo-audit", group_by: ["schema_id"] })`
   - Expected: counts schemas for rows visible to search, or returns an explicit unsupported-dimension error.

10. `ghostcrab_count({ workspace_id: "mindbrain-seo-audit", group_by: ["audit_phase"] })`
    - Expected: returns phase counts if phase is a facet, or clearly says `audit_phase` is not indexed in the facets layer.

## Graph And Projection Read

11. `ghostcrab_tool_search({ query: "", subsystem: ["graph"], access: ["read"], limit: 20 })`
    - Expected: every returned tool is callable or marked with `callable=false` and a reason.

12. `ghostcrab_tool_search({ query: "", name_prefix: "ghostcrab_projection", limit: 20 })`
    - Expected: returns a read-only projection retrieval tool, or docs explicitly confirm none exists.

13. `ghostcrab_search({ workspace_id: "mindbrain-seo-audit", query: "ProjectionResult", schema_id: "ProjectionResult", limit: 10 })`
    - Expected: returns projection entities or response metadata explaining that graph entities are excluded from `ghostcrab_search`.

14. `ghostcrab_pack({ workspace_id: "mindbrain-seo-audit", query: "proj_keyword_opportunities", limit: 15 })`
    - Expected: either returns the projection context or explicitly states that materialized projection results require another tool.

15. `ghostcrab_pack({ workspace_id: "mindbrain-seo-audit", scope: "proj_keyword_opportunities", query: "proj_keyword_opportunities", limit: 15 })`
    - Expected: either resolves the projection-like scope or clearly explains that `scope` is not a projection id.

## Tool Safety Metadata

16. Every `ghostcrab_tool_search(... include_input_schema=true)` result should include reliable mutability metadata.
    - Expected: `access` and descriptions agree.
    - Preferred: add explicit `mutates: true|false`.

17. Tools with `apply`, `execute`, `register`, `remember`, `upsert`, `learn`, `patch`, or `ingest` semantics should be visibly marked as mutating unless they are guaranteed dry-run/read-only.

## Documentation

18. Documentation must not hardcode stale tool counts.
    - Expected: docs describe "compact basic surface plus discoverable extended catalog" instead of "same 24 tools".

19. Projection docs must distinguish:
    - active working projections from `ghostcrab_project`;
    - compact packs from `ghostcrab_pack`;
    - materialized SEO `ProjectionResult` graph/runtime records;
    - graph entities vs facets/BM25 facts.

20. Empty MCP responses should describe searched backend layers.
    - Expected example: `searched_layers=["facets"]`, `excluded_layers=["graph_entity","graph_relation","projection_result"]`.
