Skip to content

Deepen tests (54->270), demos (5->20), and error handling - #4

Open
cognis-digital wants to merge 2 commits into
masterfrom
enhance/depth-4x
Open

Deepen tests (54->270), demos (5->20), and error handling#4
cognis-digital wants to merge 2 commits into
masterfrom
enhance/depth-4x

Conversation

@cognis-digital

Copy link
Copy Markdown
Owner

Summary

A depth pass on the existing tool: roughly 5x the test coverage, 4x the runnable demos, and clearer error handling — all with the public API unchanged and CI green.

Tests: 54 -> 270

New edge-case and error-path suites covering:

  • Store queries — search ranking, impact depth limits, orphans/hotspots/project-graph on empty and populated graphs, stats reconciliation, cascade deletes, edge de-dup.
  • Indexer — missing/invalid roots, unknown extensions, ignore-dir pruning, broken-source recording, re-index idempotency, and descriptive git-failure messages.
  • Extractors — deeper cases for all six languages (async, varargs, nested containers, comment/string brace handling, keyword filtering, annotation routes) and the route normalizer.
  • Tokens / audit — empty-scope and blank-label rejection, revocation, multi-scope auth; empty-log verify, monotonic seq, and tamper/delete/reorder detection.
  • Cross-language, graph diff (endpoint moves, removed edges), visualizer (validation, empty graphs, impact rendering).
  • MCP server — every tool, JSON-RPC error codes, notifications, the scope matrix, and audit fingerprints.
  • HTTP transport — routing, parse errors, scope-over-HTTP, require_token.
  • Full CLI surface (index/stats/query/diff/viz/token/audit), the benchmark, and package exports.

Demos: 5 -> 20

Added 15 runnable scenarios (MCP wire protocol, scoped-token lifecycle, graph diff, incremental indexing, HTTP transport, find-references, offline audit re-verification, Mermaid blast-radius, endpoint inventory, benchmark recall, agent edit plan, dead-code report, polyglot symbol search, tamper forensics, module architecture). run_all.py and docs/DEMOS.md updated. Each exits 0.

Hardening (API stable)

  • index_path: clear FileNotFoundError / NotADirectoryError messages.
  • indexer / diff: git invocations now raise a descriptive RuntimeError (missing git, failed clone/checkout) instead of a buried CalledProcessError.
  • tokens.issue: reject empty scope sets and blank labels — an empty scope set previously minted an unusable token that matched no scope check.
  • viz.render: validate view/format instead of silently defaulting to the project Mermaid view.

Verification

  • python -m pytest -q -> 270 passed.
  • PYTHONUTF8=1 python demos/run_all.py -> all 20 scenarios exit 0.

Left for review; not merged.

Tests: 54 -> 270. New edge-case and error-path coverage for the Store
queries, indexer (missing/invalid roots, ignore rules, broken sources,
git-failure messages), all six extractors, tokens, the audit chain,
cross-language resolution, graph diff, the visualizer, the MCP server
(every tool, error codes, scope matrix, audit fingerprints), the HTTP
transport, the full CLI surface, the benchmark, and package exports.

Demos: 5 -> 20 runnable scenarios. Added MCP wire protocol, scoped-token
lifecycle, graph diff, incremental indexing, HTTP transport, find-
references, offline audit re-verification, Mermaid blast-radius, endpoint
inventory, benchmark recall, agent edit plan, dead-code report, polyglot
symbol search, tamper forensics, and the module architecture map.
run_all.py and docs/DEMOS.md updated.

Hardening (public API unchanged):
- index_path: clear FileNotFoundError / NotADirectoryError messages.
- indexer/diff: wrap git invocations so a missing git or a failed clone/
  checkout raises a descriptive RuntimeError instead of a buried
  CalledProcessError.
- tokens.issue: reject empty scope sets and blank labels (an empty scope
  set previously produced an unusable token that no scope check matched).
- viz.render: validate view/format instead of silently defaulting.
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.

1 participant