Rename Java packages from com.cameleer3 to com.cameleer, module directories from cameleer3-* to cameleer-*, and all references throughout workflows, Dockerfiles, docs, migrations, and pom.xml. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7.5 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, gap_closure, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | gap_closure | requirements | must_haves | |||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-transaction-search-diagrams | 04 | execute | 1 |
|
|
true | true |
|
|
Purpose: DIAG-02 requirement is architecturally complete but never populated. The test suite breaks in CI due to ELK static init poisoning the shared JVM.
Output: Working diagram linking during ingestion + green mvn clean verify
<execution_context> @C:/Users/Hendrik/.claude/get-shit-done/workflows/execute-plan.md @C:/Users/Hendrik/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/02-transaction-search-diagrams/02-VERIFICATION.mdPrior plan summaries (needed — touches same files): @.planning/phases/02-transaction-search-diagrams/02-01-SUMMARY.md @.planning/phases/02-transaction-search-diagrams/02-03-SUMMARY.md
From cameleer-server-core/.../storage/DiagramRepository.java:
Optional<String> findContentHashForRoute(String routeId, String agentId);
From cameleer-server-app/.../storage/ClickHouseExecutionRepository.java (line 141):
ps.setString(col++, ""); // diagram_content_hash (wired later)
The class is @Repository annotated, constructor takes JdbcTemplate only. It needs DiagramRepository injected to perform the lookup.
From cameleer-server-app/.../storage/ClickHouseDiagramRepository.java:
@Repository
public class ClickHouseDiagramRepository implements DiagramRepository {
public Optional<String> findContentHashForRoute(String routeId, String agentId) { ... }
}
1. Modify `ClickHouseExecutionRepository` constructor to accept `DiagramRepository` as a second parameter alongside `JdbcTemplate`. The class is `@Repository` and both dependencies are Spring-managed beans, so constructor injection will autowire both.
2. In `insertBatch()`, inside the `BatchPreparedStatementSetter.setValues()` method, replace line 141:
```java
ps.setString(col++, ""); // diagram_content_hash (wired later)
```
with a lookup:
```java
String diagramHash = diagramRepository
.findContentHashForRoute(exec.getRouteId(), exec.getAgentId())
.orElse("");
ps.setString(col++, diagramHash); // diagram_content_hash
```
Note: `findContentHashForRoute` returns the most recent content_hash for the route+agent pair from `route_diagrams` table (ORDER BY created_at DESC LIMIT 1). If no diagram exists yet, it returns empty Optional, and we fall back to empty string.
3. Performance consideration: The lookup happens per-execution in the batch. Since batches are flushed periodically (not per-request) and diagram lookups hit ClickHouse with a simple indexed query, this is acceptable. If profiling shows issues later, a per-batch cache of routeId+agentId -> hash can be added.
4. Create `DiagramLinkingIT` integration test extending `AbstractClickHouseIT`:
- Test 1: Insert a RouteGraph via `ClickHouseDiagramRepository.store()`, then insert a RouteExecution for the same routeId+agentId via `ClickHouseExecutionRepository.insertBatch()`, then query `SELECT diagram_content_hash FROM route_executions WHERE execution_id = ?` and assert it equals the expected SHA-256 hash.
- Test 2: Insert a RouteExecution without any prior RouteGraph for that route. Assert `diagram_content_hash` is empty string.
**Gap 2 — Surefire classloader isolation:**
5. In `cameleer-server-app/pom.xml`, add a `<build><plugins>` section (after the existing `spring-boot-maven-plugin`) with `maven-surefire-plugin` configuration:
```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
</configuration>
</plugin>
```
This forces Surefire to fork a fresh JVM for each test class, isolating ELK's static initializer (LayeredMetaDataProvider + xtext CollectionLiterals) from Spring Boot's classloader. Trade-off: slightly slower test execution, but correct results.
cd C:/Users/Hendrik/Documents/projects/cameleer-server && mvn clean verify -pl cameleer-server-app -am 2>&1 | tail -30
- diagram_content_hash is populated with the active diagram's SHA-256 hash during ingestion (not empty string)
- DiagramLinkingIT passes with both positive and negative cases
- `mvn clean verify` passes for cameleer-server-app (no classloader failures from ElkDiagramRendererTest)
1. `mvn clean verify` passes end-to-end (no test failures)
2. DiagramLinkingIT confirms diagram hash is stored during execution ingestion
3. All existing tests still pass (search, detail, diagram render)
<success_criteria>
- DIAG-02 fully satisfied: transactions link to their active RouteGraph version via diagram_content_hash
mvn clean verifyis green (all ~40+ tests pass without classloader errors)- No regression in existing search, detail, or diagram functionality </success_criteria>