Examples

Seventeen questions, one small shop.

Every table on this page is the output of one glia command over examples-glia, a storefront that grew up beside its API: web (Angular), admin (a GraphQL console), api (Go: REST, GraphQL, a WebSocket hub, NATS order events) and contracts (the Solidity escrow orders settle through). Nothing was edited; columns were dropped where a row had many. The raw JSON of every answer sits beside this page in examples/.

The surprise is every place it taught me to hone my skill at chasing the thing perfected in my head. It shows the pile of implementations that are missing. It takes a few repos that were never one thing, links them into one app, and lets an agent run every unit and integration test across all of them, as if they always had been. It caught the storefront reading a field the API never sends, before anyone ran it.
James, on what glia turned up
Orient

What is here, and how does it talk?

The first two questions on an unknown repo. Services are keyed by project root; each link is one mechanism with the channel it crosses and the resolver's confidence in the pairing.

glia arch examples-glia --json
fromtomechanismchannelconfidence
webapiHTTP_CALLSGET /api/ordersmedium
webapiHTTP_CALLSPOST /api/ordersmedium
webapiHTTP_CALLSPATCH /api/orders/${…}/statusmedium
webapiWS_CONNECTS/live/ordersmedium
webcontractsRPC_CALLSabi:ESCROW_ABI.depositmedium
adminapiHTTP_CALLSPOST /graphqlstrong
adminapiGRAPHQL_CALLSRestockmedium
adminapiGRAPHQL_CALLSStockListmedium
apicontractsRPC_CALLSrecv:escrow.releaseweak
Eleven links; two more GET routes left out. The Go call into the contract pairs by a name hint, so it is weak: a rule violation through that edge would be advisory, never blocking.
glia flows examples-glia --json
entrykindreachmechanismsfile:line
GET /api/orders @apiROUTE3HANDLED_BY, CALLS, USEShandlers/orders.go:26
POST /api/orders @apiROUTE6HANDLED_BY, CALLS, USEShandlers/orders.go:28
evm:Escrow.depositRPC_PROCEDURE2HANDLED_BY, EVENT_FLOWScontracts/Escrow.sol:21
evm:Escrow.releaseRPC_PROCEDURE2HANDLED_BY, EVENT_FLOWScontracts/Escrow.sol:27
evm:Escrow.sellerRPC_PROCEDURE1HANDLED_BYcontracts/Escrow.sol:11
Every entry point's forward flow: the routes, the GraphQL resolvers, the contract's external functions and public getters. Nineteen entries in all; --features groups them by the feature word trace takes.
A change

What does changing the Order model affect?

A seed, a walk over the carry edges, every reached node with its depth. The Go struct and the TypeScript interface form one identity class, so the walk crosses from the API into the storefront without a guess. Then: which tests cover the handler, and what does it write outside the process?

glia blast-radius examples-glia "api::internal::models::order::Order" --json
depthkindnodefile:line
1METHODhandlers::orders::Orders::Placeapi/internal/handlers/orders.go:45
1METHODhandlers::orders::Orders::ChangeStatusapi/internal/handlers/orders.go:61
1METHODhandlers::orders::Orders::Listapi/internal/handlers/orders.go:32
1METHODhandlers::orders::Orders::Getapi/internal/handlers/orders.go:36
2METHODstore::memory::Memory::Orderapi/internal/store/memory.go:31
2METHODlive::hub::Hub::Broadcastapi/internal/live/hub.go:32
2METHODstore::memory::Memory::Ordersapi/internal/store/memory.go:19
2ROUTEGET /api/orders @apiapi/internal/handlers/orders.go:26
2METHODevents::publisher::Publisher::OrderPlacedapi/internal/events/publisher.go:22
2ROUTEGET /api/orders/:id @apiapi/internal/handlers/orders.go:27
2METHODstore::memory::Memory::SaveOrderapi/internal/store/memory.go:38
2ROUTEPOST /api/orders @apiapi/internal/handlers/orders.go:28
2STRUCTmodels::order::PlaceOrderRequestapi/internal/models/order.go:30
The first 13 ranked rows. With a history snapshot (glia history sync) the rows reorder by co-change first and the answer gains a files table; this demo repo has one commit, so the structural order stands. Watch the walk.
glia tests-for examples-glia "api::…::Orders::Place" --json
testkindreasontierfile
handlers::orders_testMODULEmodule_tests_edgeheuristichandlers/orders_test.go:1
One test module pairs by name with the handler's module; no test function calls Place directly, so the method is listed under untested too. With a test-report ingest the rows rank by recent failures.
glia effects examples-glia "api::…::Orders::Place" --json
classsinkdepthviatier
queue_producequeue_producer:unresolved:nats2Place → OrderPlaced (orders.go:56) → publisher.go:24derived
What the handler does outside the process: one NATS publish, two hops down, with the call site of each hop. Zero HTTP calls, zero DB writes, zero external hosts.
A flow

How does an order flow, end to end?

Distinct ranked paths from a seed. A path that leaves the process (a queue, a WebSocket, an external host) ranks first, since that is where a change stops being local. Then the two one-row questions every agent asks: who serves this, and what does this stack frame point at?

glia trace examples-glia "POST /api/orders @api" --json
pathdepthedgetokindfile:line
11handled_byOrders::PlaceMETHODhandlers/orders.go:45
12callsPublisher::OrderPlacedMETHODevents/publisher.go:22
13usesqueue_producer:unresolved:natsQUEUE_PRODUCERevents/publisher.go:32
22callshandlers::orders::newIDFUNCTIONhandlers/orders.go:77
32callsHub::BroadcastMETHODlive/hub.go:32
42callsMemory::SaveOrderMETHODstore/memory.go:38
Six paths, four shown. The NATS subject is built at runtime here, so the producer is the unresolved:nats tag anchored at its site rather than a guessed topic; gaps lists it below.
glia serves examples-glia "POST /api/orders" --json
routelivematchhandlerfile:line
POST /api/orders @apiyesroute_prefixOrders::Placehandlers/orders.go:45
glia resolve examples-glia "api/internal/handlers/orders.go:45" --json
nodekindscorelivefile:line
handlers::orders::Orders::PlaceMETHOD0.59yeshandlers/orders.go:45
resolve takes a signal: a stack trace, a failing test id, a diff, a file:line. find takes a name.
Contracts

Does the frontend's model match what the backend sends?

No OpenAPI document in this repo. The Go struct's encoding/json names and the TypeScript interface the Angular service reads were paired across the exchange, then compared field by field. The identity report lists every such pairing, and why shows the evidence of one.

glia contracts examples-glia --fields --json
pairingexchangefieldproducerconsumerrulebreaking
http_modelGET /api/orders response[].customerName—stringjson_field_missingyes
http_modelGET /api/orders response[].customer_namestring—json_field_unreadno
http_modelGET /api/orders response[].discountCode—stringjson_field_optional_absentno
graphql_selectionmutation Restockselection against schema type Productidenticalno
Nine field rows in all. The producer is api/internal/models/order.go:20, the consumer web/src/app/core/models/order.ts:9. The same comparison runs against a git revision in contract-breaks and in the PR report review.
glia identity examples-glia --json
classrulemembersdiverged
Orderhttp_modelapi STRUCT order.go:20 · web INTERFACE order.ts:9yes
OrderLinehttp_modelapi STRUCT order.go:14 · web INTERFACE order.ts:3no
PlaceOrderRequesthttp_modelapi STRUCT order.go:30 · web INTERFACE NewOrder order.ts:19yes
Five classes, eleven members, all derived by the models pass; three diverged. The two diverged classes are the two field drifts above.
glia why examples-glia "web::…::Order" "api::…::Order" --json
{ "category": "SAME_AS", "tier": "derived",
  "emitter": "resolver:models", "rule": "http_model/diverged",
  "basis": "site",
  "site": { "file": "web/src/app/core/services/order.service.ts", "line": 15 } }
The site is the Angular service's typed HttpClient call: the one line that ties the interface to the exchange, and so to the Go struct.
Health

Where is it blind, what carries the load, what clusters?

Three reports. gaps is what glia could not pair and what looks dead, each row with the overlay section that could repair it. hubs ranks structural load. communities is a Leiden clustering over the carry edges, a heuristic by construction.

glia gaps examples-glia --json
categorynodedetailsuggesttierfile:line
tag_only_queuequeue_producer:unresolved:nats @apitopic unreadable; owner Publisher::OrderPlacedconstants | wrapperfactevents/publisher.go:24
dead_symboladmin::src::inventory::lowStockno entrypoint reaches it; no incoming call or useentrypointsheuristicadmin/src/inventory.ts:5
dead_symboladmin::src::inventory::restockno entrypoint reaches it; no incoming call or useentrypointsheuristicadmin/src/inventory.ts:10
dead_symbolapi::internal::chain::escrow::Dialno entrypoint reaches it; no incoming call or useentrypointsheuristicapi/internal/chain/escrow.go:18
Twelve rows: one queue whose subject is built at runtime (fact: the site is known, the topic is not) and eleven symbols nothing reaches. Zero unpaired routes or endpoints, zero suspected edges. Dead-symbol rows are heuristic because an entry point glia does not know could reach them.
glia hubs examples-glia --json
listnodelabelinoutauthorityfile:line
fan-inmodels::order::Orderutility500.75models/order.go:20
fan-outcmd::server::main::mainorchestrator0100.00cmd/server/main.go:18
175 nodes, 106 carry edges. The struct everything uses and the main that wires everything up; no cross-service connector above the p99 degree in a repo this small.
glia communities examples-glia --json
idlabelsizecohesionkindstop member
0api370.80FUNCTION 11 · MODULE 11 · STRUCT 7 · METHOD 4cmd::server::main::main
Thirteen communities by seeded Leiden, modularity 0.74, 22 isolated nodes; the first shown. Each names its services, effect sinks and heaviest links to the others. heuristic, and labelled so.
Query

A question no command asks

Datalog over the built graph, with a prelude of predicates for the code domain. Every row carries a tier and the coverage caveats of what a negation read. Here: every route no handler serves.

glia query examples-glia -e 'unhandled(R) :- node(R, "ROUTE"), not edge(R, _, "HANDLED_BY").' --json
predicateRkindtierfile:line
unhandledGET /boom @apiROUTEfactapi/internal/handlers/orders_test.go:17
Two rows, one shown: a route only a test registers. The row's caveats name what the negation depended on (which consumer callbacks are HANDLED_BY, how Go route prefixes fold), so "no handler" is a claim with a stated scope. The same language writes a rule in .glia/overlay.toml that check and review gate on.
Absence

When the answer is nothing

An empty answer is never silent. It is a fact-tier reason, the nodes it might have meant, and the caveats of every mechanism the question depended on.

glia trace examples-glia "POST /orders" --json
{ "absence": { "tier": "FACT", "reason": "unknown_symbol",
    "note": "no node has the qname or name `POST /orders` in this graph",
    "suggestions": [ "POST /api/orders @api", "endpoint:POST:/api/orders @web" ],
    "nodes_searched": 178, "unparsed_files": 0 } }
The route exists under its real prefix. The absence says so, names the two nodes it might have meant and reports that every file parsed.
glia docs-for examples-glia Order --json
{ "absence": { "tier": "FACT", "reason": "no_edges",
    "note": "no DOCUMENTS edge reaches `api::internal::models::order::Order`",
    "mechanisms": [ "DOCUMENTS" ],
    "caveats": [ { "edge_category": "DOCUMENTS",
        "note": "repo markdown is ingested only from: the well-known files …, a docs/ tree …;
                 a section DOCUMENTS a symbol only when it names it in a single-backtick span",
        "verify": "grep the symbol name across the repo's markdown" } ] } }
No doc mentions the struct in backticks. The caveat states exactly which markdown was read and the rule a mention must satisfy, and what to grep instead.