Skip to content

COCOA v1 epic: static polyglot system graph + cross-service blast radius #1

Description

@rahlk

Goal

Build COCOA (Code Context Agent) as CLDK's plug-and-play agent product: one unified, precise, static system graph of a polyglot k8s-native codebase, with cross-service blast radius grounded through the database as the hero capability. Fresh repo; stack pattern (fastmcp + typer + cldk + MCP-client tests) ported from upstream codellm-devkit/cocoa-mcp. Competitive frame: graphify — match its frictionless UX and distribution mechanics, beat it on fidelity: every edge derived from real static analysis (DERIVED-STATIC) or explicitly INFERRED — never guessed. Graphify indexes files; COCOA understands systems.

Status — v1 engine COMPLETE (2026-07-08)

14 tasks + final whole-branch review merged (#16#29, #34). 79 tests green. Real Online Boutique evidence: cross-service RPC edges derived, blast radius {'emailservice': 9, 'recommendationservice': 1} on hipstershop.Money.units, token headline ~25,772× vs naive read. E2E launch gate stays strict pending the Go analyzer prerequisite.

Scope (v1)

  • System graph — nodes: Service, K8sWorkload, Function, RPCEndpoint, ProtoMessage/ProtoField, Datastore, Table, KeyPattern. Edges: intra-service CALLS (codeanalyzer-* backends via canonical analysis.json), cross-service RPC_CALLS/HANDLES/HOSTS (proto + stub call sites + k8s/helm/kustomize/compose wiring, statically rendered), data access READS/WRITES (Redis client calls + SQL/ORM).
  • Provenance: DERIVED-STATIC / INFERRED (fallback only, always labeled) + DECLARED-UNUSED annotation. Skipped services recorded, never silent. Single-source topology rollup (cocoa.system.topology) keeps report/map/MCP surfaces agreeing.
  • Artifacts: .cocoa/system-graph.json, system-map.html, SYSTEM_REPORT.md.
  • Surfaces: MCP tools (build_graph, blast_radius, service_graph, data_access, query_subgraph — bounded outputs, honest totals); cocoa map|blast|serve|demo CLI; skillset plugin modeled on the obra/superpowers paradigm (plan 2); one-command installer + Docker all-in-one runtime (plan 2).
  • Hero demo + golden fixture: Online Boutique v0.10.5 (cocoa demo).

Build stages → child issues

''- [x] Stage 1 — Runtime image: #39 image · #40 CI (real smoke: container mapped a fixture; unit CI live and green)''

'## Follow-ups from review (non-blocking)

Prerequisites (cross-repo)

Success criteria

  1. cocoa demo runs unattended on a clean machine (Docker path gates plan-2 launch; host-native path works today).
  2. Money-field blast radius on Online Boutique complete and correct across ≥4 languages, with call sites; zero unlabeled guesses. (Pending Go + dotnet prereqs for full breadth; derived edges today carry honest provenance.)
  3. A blast-radius query costs ≤5k tokens; headline ratio ≥50× vs. naive. (Measured: ~25,772×.)
  4. A useful graph on a polyglot repo without k8s manifests. (Static-only mode tested.)
  5. The skillset installs and answers correctly on Claude Code, Codex, and Cursor. (Plan 2.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions