agentforge-graph 0.6.4 — ask the graph anything structural
Theme: query. The CKG already answered questions through fixed, typed verbs
(ckg search, ckg impact, ckg routes, …) — each great for the question it
was built for, but a closed set. 0.6.4 adds the escape hatch: a read-only,
guard-railed structural query surface so any exact question over the graph is
answerable directly, without us shipping a new verb.
Highlights
ckg query --graph / ckg_query — a read-only Cypher subset (feat-015)
# "classes tagged Repository with no inbound CALLS", "interfaces implemented by many classes", …
ckg query --graph 'MATCH (c:Class)-[:IMPLEMENTS]->(i:Interface)
RETURN i.name, count(c) AS impls ORDER BY impls DESC'
ckg query --graph 'MATCH (f:Function) WHERE NOT (f)<-[:CALLS]-() RETURN f.name, f.path'
ckg query --graph '<q>' --format json # {columns, rows, truncated, stopped_reason}
ckg query --schema # the queryable vocabulary- The escape hatch, not a replacement. For semantic "find code about X" use
ckg_search; for "who calls this" useckg_impact.ckg_queryis for precise
structural questions with exact predicates —MATCHpatterns (directions,
bounded var-length[:CALLS*1..3]),WHERE(comparisons,AND/OR/NOT,IN,
STARTS/ENDS WITH,CONTAINS, pattern existence),RETURNwith
count/min/max/avg/collect,ORDER BY/SKIP/LIMIT. - Safe by construction. Caller text is never executed. It is parsed into a
validated AST (the single trust boundary), then compiled to native Cypher
(Kuzu, Neo4j) or interpreted over the storage API (SurrealDB, and any
backend without a query language). Writes/DDL, procedure calls, unbounded paths,
and un-joined Cartesian products are rejected with a clear reason — never a
stack trace. - Identical on every backend. A shared conformance suite proves Kuzu, Neo4j,
and SurrealDB return the same rows for the same query. - Bounded, no silent caps.
query.max_rows/timeout_ms/max_expansions
are enforced on every backend and reported viatruncated+stopped_reason,
so a partial answer is never mistaken for a complete one. - For agents too. A capability-gated
ckg_queryMCP tool (present only when
the backend is query-capable andquery.allow_in_mcpis on) with the usual
staleness envelope;ckg statusreports the query-language version.
See the new guide: Ad-hoc structural queries.
Fixed
- Re-exported base classes now resolve. A base class imported via an absolute
path and re-exported through a package__init__.py(e.g.
class KuzuGraphStore(GraphStore)) previously produced noINHERITSedge. The
resolver now binds through a package re-export namespace — improvingINHERITS
andCALLSrecall for every consumer (retrieval, impact, repo-map), not
just the query surface.