Skip to content

Commit 3711f06

Browse files
aksOpsclaude
andcommitted
docs: update CLAUDE.md and README.md with current project state
CLAUDE.md: - Add new detector base classes (AbstractPythonAntlrDetector, AbstractTypeScriptDetector, etc.) - Add shared detector helpers (DetectorDbHelper, FrontendDetectorHelper, StructuresDetectorHelper) - Update test count from 1440 to 3219 - Add gotchas: H2 reserved words, cache versioning, SHA-256 hashes, SnakeYAML Boolean.TRUE, regex possessive quantifiers, parallel agent conflicts, SonarCloud config, CI workflow - Add PROP_* string constant convention README.md: - Update test count from 1,440 to 3,219 - Update MCP tool count from 31 to 34 (added intelligence tools) - Update REST API endpoint count from 34 to 37 - Add Intelligence tools section (get_evidence_pack, get_artifact_metadata, get_capabilities) - Update architecture diagram counts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 82e8d95 commit 3711f06

2 files changed

Lines changed: 32 additions & 9 deletions

File tree

CLAUDE.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ io.github.randomcodespace.iq
9696
|-- grammar/ # ANTLR parser factory + generated parsers
9797
|-- graph/ # GraphStore (Neo4j facade), GraphRepository (SDN, writes only)
9898
|-- health/ # GraphHealthIndicator (Spring Actuator)
99-
|-- mcp/ # McpTools (34 @McpTool methods, read-only)
99+
|-- mcp/ # McpTools (34 @McpTool methods, read-only, includes intelligence tools)
100100
|-- model/ # CodeNode, CodeEdge, NodeKind (32), EdgeKind (27)
101101
|-- intelligence/ # Intelligence enrichment (Phase 2-5)
102102
| |-- lexical/ # LexicalEnricher, LexicalQueryService, DocCommentExtractor, SnippetStore
@@ -250,11 +250,22 @@ code-iq serve /path/to/repo # needs enrich if using index
250250
| `AbstractJavaParserDetector` | Java AST via JavaParser (Spring, JPA, etc.) |
251251
| `AbstractAntlrDetector` | ANTLR grammar-based (TS, Python, Go, C#, Rust, C++) |
252252
| `AbstractStructuredDetector` | Structured file parsing (YAML, JSON, TOML, etc.) |
253+
| `AbstractPythonAntlrDetector` | Python ANTLR detectors (shared parse, getBaseClassesText, extractClassBody) |
254+
| `AbstractPythonDbDetector` | Python ORM detectors (adds ensureDbNode/addDbEdge via DetectorDbHelper) |
255+
| `AbstractTypeScriptDetector` | TypeScript regex detectors (shared getSupportedLanguages, detect→detectWithRegex) |
256+
| `AbstractJavaMessagingDetector` | Java messaging detectors (shared CLASS_RE, extractClassName, addMessagingEdge) |
257+
258+
### Shared Detector Helpers
259+
| Class | Purpose |
260+
|-------|---------|
261+
| `DetectorDbHelper` | Static ensureDbNode/addDbEdge for any detector emitting DATABASE_CONNECTION nodes |
262+
| `FrontendDetectorHelper` | Static createComponentNode/lineAt for Angular, React, Vue detectors |
263+
| `StructuresDetectorHelper` | Static addImportEdge/createStructureNode for Scala/Kotlin structures |
253264

254265
## Testing
255266

256267
```bash
257-
# Run all tests (~1440 tests)
268+
# Run all tests (~3219 tests)
258269
mvn test
259270

260271
# Run a specific test class
@@ -352,6 +363,7 @@ mvn dependency-check:check
352363
- Neo4j properties round-trip via `prop_*` prefix (written by `bulkSave`, read by `nodeFromNeo4j`)
353364
- Jackson `FAIL_ON_UNKNOWN_PROPERTIES` disabled globally for MCP protocol compatibility
354365
- UTF-8 encoding everywhere (explicit `StandardCharsets.UTF_8`)
366+
- Property key constants: `private static final String PROP_FRAMEWORK = "framework"` — extract when a string literal appears 3+ times in a file
355367

356368
## Configuration
357369

@@ -384,6 +396,14 @@ Placed in the codebase root, loaded by `ProjectConfigLoader` before analysis.
384396
- **ANTLR generated sources**: Generated during `mvn generate-sources` from `.g4` files. Do not edit.
385397
- **`@ActiveProfiles("test")`**: Required on any `@SpringBootTest` to avoid Neo4j startup conflicts.
386398
- **Dead code detection**: Must filter by semantic edges only (calls, imports, depends_on). Exclude structural edges (contains, defines) and entry points (endpoints, config files).
399+
- **H2 reserved words**: `key`, `value`, `order` are reserved in H2 SQL. Use `meta_key`, `meta_value` etc. in CREATE TABLE statements.
400+
- **Cache versioning**: `AnalysisCache` has a `CACHE_VERSION` constant (currently 2). Bump it when changing hash algorithms or schema to auto-clear stale caches.
401+
- **FileHasher uses SHA-256**: Changed from MD5. Hash output is 64 hex chars (not 32). Tests must expect 64-char hashes.
402+
- **SnakeYAML parses `on` as Boolean.TRUE**: In YAML files, bare `on` key becomes `Boolean.TRUE`. Use `String.valueOf(key)` comparisons, not `Boolean.TRUE.equals(key)` (SonarCloud S2159).
403+
- **Regex possessive quantifiers**: Use `*+` instead of `*` for nested quantifiers like `([^"\\]*(?:\\.[^"\\]*)*)``([^"\\]*+(?:\\.[^"\\]*+)*+)` to prevent stack overflow (SonarCloud S5998).
404+
- **Parallel agent conflicts**: Don't dispatch multiple agents editing the same files concurrently. Use worktree isolation or sequential execution.
405+
- **SonarCloud project key**: `RandomCodeSpace_code-iq`, org: `randomcodespace`
406+
- **CI workflow**: Single `ci-java.yml` runs build + SonarCloud analysis. No cross-platform builds needed (JVM).
387407

388408
## Updating This File
389409

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
---
2020

21-
**OSSCodeIQ** scans codebases to build a deterministic knowledge graph of code relationships -- classes, methods, endpoints, entities, dependencies, infrastructure resources, auth patterns, service topology, and more. 97 detectors across 35+ languages, Neo4j Embedded graph database, Spring AI MCP server (31 tools), REST API (34 endpoints), React web UI, and zero AI dependency.
21+
**OSSCodeIQ** scans codebases to build a deterministic knowledge graph of code relationships -- classes, methods, endpoints, entities, dependencies, infrastructure resources, auth patterns, service topology, and more. 97 detectors across 35+ languages, Neo4j Embedded graph database, Spring AI MCP server (34 tools), REST API (37 endpoints), React web UI, and zero AI dependency.
2222

2323
## Quick Start
2424

@@ -49,8 +49,8 @@ java -jar target/code-iq-*-cli.jar serve /path/to/repo
4949
- **ANTLR grammars** for 10 languages (TypeScript, JavaScript, Python, Go, C#, Rust, Kotlin, Scala, C++)
5050
- **Neo4j Embedded** graph database -- full Cypher query support, no external server needed
5151
- **H2 analysis cache** -- batched streaming for memory-efficient indexing on CI runners
52-
- **Spring AI MCP server** -- 31 tools via streamable HTTP for AI-powered triage
53-
- **REST API** -- 34 endpoints for programmatic access
52+
- **Spring AI MCP server** -- 34 tools via streamable HTTP for AI-powered triage
53+
- **REST API** -- 37 endpoints for programmatic access
5454
- **React UI** -- Dashboard, Topology (Cytoscape.js), Explorer, Flow, MCP Console, API Docs (Swagger)
5555
- **Service Topology** -- AppDynamics-style service map with blast radius, circular deps, bottleneck detection
5656
- **CLI with 15 commands** -- analyze, index, enrich, serve, stats, graph, query, find, cypher, flow, topology, bundle, cache, plugins, version
@@ -61,7 +61,7 @@ java -jar target/code-iq-*-cli.jar serve /path/to/repo
6161
- **Bundle & distribute** -- package graph DB + source + interactive HTML into a ZIP
6262
- **100% deterministic** -- same input, same output, every time
6363
- **Incremental analysis** -- H2-backed file hash cache, only re-analyzes changed files
64-
- **1,440 tests** passing
64+
- **3,219 tests** passing
6565

6666
## Three-Command Architecture
6767

@@ -196,7 +196,7 @@ code-iq serve /path/to/repo
196196
| | |
197197
v v v
198198
REST API MCP React UI
199-
(34 ep) (31 tools) (6 pages)
199+
(37 ep) (34 tools) (6 pages)
200200
```
201201

202202
## Server
@@ -234,14 +234,17 @@ Modern React 18 + TypeScript + Tailwind CSS interface:
234234
- `/api/topology/path` -- find path between services
235235

236236
### MCP Server (`/mcp`)
237-
31 tools via Spring AI streamable HTTP for AI-powered code triage:
237+
34 tools via Spring AI streamable HTTP for AI-powered code triage:
238238

239239
**Core (21 tools):**
240240
`get_stats`, `get_detailed_stats`, `query_nodes`, `query_edges`, `get_node_neighbors`, `get_ego_graph`, `find_cycles`, `find_shortest_path`, `find_consumers`, `find_producers`, `find_callers`, `find_dependencies`, `find_dependents`, `find_dead_code`, `generate_flow`, `run_cypher`, `find_component_by_file`, `trace_impact`, `find_related_endpoints`, `search_graph`, `read_file`
241241

242242
**Topology (10 tools):**
243243
`get_topology`, `service_detail`, `service_dependencies`, `service_dependents`, `blast_radius`, `find_path`, `find_bottlenecks`, `find_circular_deps`, `find_dead_services`, `find_node`
244244

245+
**Intelligence (3 tools):**
246+
`get_evidence_pack`, `get_artifact_metadata`, `get_capabilities`
247+
245248
## Service Topology
246249

247250
AppDynamics-style service topology from static code analysis:
@@ -342,7 +345,7 @@ cd code-iq
342345
# Build
343346
mvn clean package
344347

345-
# Run tests (1,440 tests)
348+
# Run tests (3,219 tests)
346349
mvn test
347350

348351
# Analyze this repo

0 commit comments

Comments
 (0)