code-graph MCP: sample outputs (real calls via the MCP Python SDK stdio client)
Server: code-graph, DB: combined graph of examples/bookstore-api + examples/bookstore-web. Generated by tests/mcp_e2e.py. Volatile values (index timestamps and durations) are replaced by placeholders, so regenerating the file on unchanged code gives identical bytes.
tools/list
reaches: Use before changing a column, table, connection, env key or symbol: everything that depends on it.impact: Use before editing a function: what a change to it affects. Reverse callers of a method (Class::method, short or FQN) up to entry points, with the shortest call pathcallers: Use to see who calls X right now. Direct callers of a function / method / class (one level: CALLS, INSTANTIATES, dispatch and framework edgessiblings: Code parallel to a symbol that often needs the same change: classes sharing its parent/interface/trait,resolutions: Every place a concept (e.g. 'timezone', 'locale') is resolved, deterministically: assignment/return sitesroundtrip: Heuristic (#88): does a stored propertyType.propround-trip through a lossy transform? Each write site withlint_async_state: Heuristic (#88 phase 3);rulesis a comma-separated subset (default all). stale-async-result: a write ofreaders: Who reads a DB table, a column or a stored property.propistable,table:X,table.column/column:table.columnwriters: Who writes a DB table, a column or a stored property.tableistable,table:X,table.column/column:table.columnchannels: Broadcast channels (Laravel Broadcast::channel, events' broadcastOn, Echo / pusher-js subscriptions on a combinedbridges: Web / native bridge calls: Capacitor plugins (registerPlugin / Plugins.X -> @CapacitorPlugin @PluginMethod,protocol_links: Every protocol endpoint in one view (#31 model): HTTP client endpoints and routes (http / ws / graphql), Pusherexternal_systems: External systems the code connects to (#40): databases, caches, brokers, mail relays, directories, file-transferattack_surface: Security views over recorded facts (#47): findings plus the inbound / outbound attack surface, with file:linellm_tools: LLM tools and MCP primitives (#66): tools offered to a model (OpenAI / Anthropic schema literals, LangChain @tool /tests_covering: Tests that exercise a symbol, route or table. DIRECT: the test code itself calls / instantiates it or sends anaffected: Tests and entry points a change reaches. files are whole repo-relative paths; base is a gitnode: Use to inspect a symbol without reading its file. Details of one node: kind, FQN, file:line span, module, entry kinds, docblock (PHPDoc), and edge countssnippet: Use instead of opening a whole file. Source of one symbol: apath:start-endheader then the body with line numbers. Resolves asearch: Use first to find a symbol instead of grep. Finds nodes by name / FQN substring (case-insensitive), optionally filtered by kindexplore: Start here for a broad question ("how does X work") or a spec you have not pinned down.routes: Use for route, auth and middleware questions. Routes with their middleware / guards / auth, in one call. Optional scope: writes="*" (routes that reach anydoctor: What this cg installation can index: versions of cg and the tools it uses, whether the Node / PHP / Dartcoverage: Use when cg finds nothing or you need to know if a file is indexed. Which languages and files this index covers. Per language: parser mode (exact, heuristic only when anstarters: Starter queries derived from this graph, each with the tool call to run: the write route without an auth guardstats: Index metadata and node/edge counts by kind.downstream: Use to see what X ends up calling or reading (page -> routes -> tables). Forward dependencies of a node. On a combined graph a frontend page goespath: Use to answer "how does A reach B". Shortest forward evidence chain from source to target (e.g. page:/reports/:id ->platforms: Platform-specific code in this graph: the targets (declared in .cg.yaml platforms.targets, or detected fromplatform_divergence: Where per-platform implementations diverge: VARIANTS (a symbol implemented per platform, by platform files,api_calls: Frontend HTTP calls (method + path template) with call sites, request keys and the matched backendplan_list: List planned-change files (plans/*.yaml): name, status, title, counts, schema errors.plan_load: Show one plan (name or path): planned nodes (+), modified targets with intent (~), planned edges, forbiddenplan_validate: Schema check + does every referenced existing node resolve in the graph (unresolved / ambiguous specs withplan_check: Deterministic check of a plan against the real graph. Default reply: a compact summary (counts per section andplan_baseline: Fingerprint (sha1 of source lines) every modified target of a plan before implementing it, soindex: Use after editing so later answers see the change. Re-index (static analysis only: never boots the app or touches a database).graphs: Use when unsure which graph a question belongs to. Lists the graphs this server can query: name, repo roots, languages, indexed commit and freshness.
stats {} (1337 chars)
project=bookstore-api+bookstore-web root=None indexed_at=<indexed_at> index_seconds=None
nodes: method×53, column×30, class×27, config×18, property×14, route×14, request_key×12, external_class×10, http×10, env×8, function×7, module×6, script×6, composable×5, table×5, resolution×4, connection×3, page×3, setting×3, external×2, field×2, i18n×2, type×2, admin×1, channel×1, channel_sub×1, command×1, component×1, event×1, layout×1, store×1
edges: CONTAINS×114, CALLS×30, READS_COLUMN×28(gated 1), EXTENDS×21, WRITES_COLUMN×20, VALIDATES×17, REFERENCES×16, READS_ENV×16, ROUTES_TO×14, READS_PROP×14, CONFIG_CONTAINS×14, READS_INPUT×12, HTTP_CALLS×10, WRITES_TABLE×8, CONNECTS_TO×7, USES_COMPOSABLE×6, FALLS_BACK_TO×6, CONFIGURED_BY×6, USES_CONNECTION×5(gated 1), MATCHES_ROUTE×5, INJECTS×5, VALIDATED_BY×4, MAPS_TO_TABLE×4, INSTANTIATES×4, HAS_RESOLUTION×4, HANDLED_BY×4, USES_LAYOUT×3, READS_SETTING×3, READS_CONFIG×3, WRITES_PROP×2, USES_TRAIT×2, USES_I18N×2, REGISTERS_CONNECTION×2, REFERS_TO×2, REFERENCES_TYPE×2, IMPORTS×2, WRITES_CONFIG×1, USES_STORE×1, SUBSCRIBES_CHANNEL×1, RENDERS×1, READS_TABLE×1, MENTIONS_COLUMN×1, MATCHES_CHANNEL×1, LISTENS_FOR×1, IMPLEMENTS×1, HAS_RELATION×1, DISPATCHES×1, BROADCASTS_ON×1, BINDS×1
coverage bookstore-api: php 32 exact
coverage bookstore-web: typescript 12 exact | generated: 4 files excluded
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
search {'name': 'reserve'} (516 chars)
route route:POST /v1/stock/reserve bookstore-api/routes/api.php:22
method method:App\Services\StockService::reserve bookstore-api/app/Services/StockService.php:10
method method:App\Services\StockService::reserveLocal bookstore-api/app/Services/StockService.php:20
method method:App\Http\Controllers\StockController::reserve bookstore-api/app/Http/Controllers/StockController.php:14
method method:App\Services\StockService::reserveFromWarehouse bookstore-api/app/Services/StockService.php:30
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
search {'name': 'auth'} (217 chars)
middleware / guards / auth matching 'auth' (route attributes): 2 name(s) on 2 route(s)
auth:api (middleware) on 1 route(s): POST /v1/orders
auth:sanctum (middleware) on 1 route(s): POST /v1/orders/{order}/refund
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
routes {'writes': '*'} (2509 chars)
routes reaching a write (any table): 6 of 14 routes
auth guard: 3 with, 3 without (auth = a framework preset auth guard or a name matching the auth pattern)
auth guards by source: preset laravel 2
DELETE /v1/{store}/admin/reports/{report} @bookstore-api/routes/api.php:15 NO AUTH
guards: (none)
writes orders via Services\SalesReportService::remove conf=resolved ROUTES_TO@api.php:15 → CALLS@ReportController.php:40~r → WRITES_TABLE@SalesReportService.php:24~r → table:orders
called from: page:app/pages/index.vue @index.vue:4
POST /v1/admin/books @bookstore-api/routes/api.php:26 NO AUTH
guards: (none)
writes books via Http\Controllers\Admin\BookController::store conf=resolved ROUTES_TO@api.php:26 → WRITES_COLUMN@BookController.php:15~r → column:books.store_id
PUT /v1/admin/books/{id} @bookstore-api/routes/api.php:27 NO AUTH
guards: (none)
writes books via Http\Controllers\Admin\BookController::update conf=resolved ROUTES_TO@api.php:27 → WRITES_TABLE@BookController.php:30~r → table:books
POST /v1/warehouse/sync @bookstore-api/routes/api.php:29
guards: (none)
inline: ensureValidSecret (hash_equals config:bookstore.sync_secret) [secret] WarehouseSyncController::ensureValidSecret
writes orders via Http\Controllers\WarehouseSyncController::__invoke conf=resolved ROUTES_TO@api.php:29 → WRITES_TABLE@WarehouseSyncController.php:13~r → table:orders
POST /v1/orders @bookstore-api/routes/api.php:24
guards: auth:api [auth]
writes books via Services\StockService::recordSale conf=resolved ROUTES_TO@api.php:24 → CALLS@OrderController.php:26~r → WRITES_COLUMN@StockService.php:42~r → column:books.sold_count
writes orders via Http\Controllers\OrderController::store conf=resolved ROUTES_TO@api.php:24 → WRITES_COLUMN@OrderController.php:20~r → column:orders.user_id
POST /v1/orders/{order}/refund @bookstore-api/routes/api.php:28
guards: auth:sanctum [auth]
inline: hasPermission('orders.refund') [permission] RefundController::store
writes orders via Http\Controllers\RefundController::store conf=resolved ROUTES_TO@api.php:28 → WRITES_COLUMN@RefundController.php:13~r → column:orders.user_id
guards: route-level and global enhancers per framework; Laravel kernel middleware and Django's MIDDLEWARE setting apply to every route and are not repeated per route.
inline: access checks the handler runs before its own work (Laravel). --unguarded hides an unconditional one; --unguarded --strict counts route guards only.
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
routes {'reaches': ['connection:warehouse'], 'unguarded': True} (880 chars)
routes reaching connection:warehouse: 3 of 14 routes | filter: no auth guard -> 2
auth guard: 0 with, 2 without (auth = a framework preset auth guard or a name matching the auth pattern)
GET /v1/{store}/admin/inventory @bookstore-api/routes/api.php:16 NO AUTH
guards: (none)
reaches connection:warehouse [gated-only] conf=resolved ROUTES_TO@api.php:16 → USES_CONNECTION@InventoryController.php:17~r → connection:warehouse
POST /v1/stock/reserve @bookstore-api/routes/api.php:22 NO AUTH
guards: (none)
reaches connection:warehouse conf=resolved ROUTES_TO@api.php:22 → CALLS@StockController.php:16~r → CALLS@StockService.php:17 → USES_CONNECTION@StockService.php:32~r → connection:warehouse
guards: route-level and global enhancers per framework; Laravel kernel middleware and Django's MIDDLEWARE setting apply to every route and are not repeated per route.
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
routes {'writes': 'books', 'missing': 'auth:api'} (866 chars)
routes reaching a write to books: 3 of 14 routes | filter: missing a guard matching 'auth:api' -> 2
auth guard: 0 with, 2 without (auth = a framework preset auth guard or a name matching the auth pattern)
POST /v1/admin/books @bookstore-api/routes/api.php:26 NO AUTH
guards: (none)
writes books via Http\Controllers\Admin\BookController::store conf=resolved ROUTES_TO@api.php:26 → WRITES_COLUMN@BookController.php:15~r → column:books.store_id
PUT /v1/admin/books/{id} @bookstore-api/routes/api.php:27 NO AUTH
guards: (none)
writes books via Http\Controllers\Admin\BookController::update conf=resolved ROUTES_TO@api.php:27 → WRITES_TABLE@BookController.php:30~r → table:books
guards: route-level and global enhancers per framework; Laravel kernel middleware and Django's MIDDLEWARE setting apply to every route and are not repeated per route.
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
reaches {'targets': ['connection:warehouse', 'table:warehouse_stock'], 'max_per_group': 12} (1531 chars)
targets: connection:warehouse→1, table:warehouse_stock→1 | gate=new_inventory | conf>=heuristic
dependents: 7 code (operator 1, runtime 5, gated 1); entry points 4 (3 live): command×1, route×3
## RUNTIME (5)
[Http/Controllers]
Http\Controllers\OrderController::store route×1 d3 CALLS@OrderController.php:19~r → CALLS@StockService.php:17 → USES_CONNECTION@StockService.php:32~r → connection:warehouse
Http\Controllers\StockController::reserve route×1 d3 CALLS@StockController.php:16~r → CALLS@StockService.php:17 → USES_CONNECTION@StockService.php:32~r → connection:warehouse
[Models/Warehouse]
Models\Warehouse\WarehouseItem::isSoldOut route×2 d1 READS_COLUMN@WarehouseItem.php:16~h conn=warehouse → column:warehouse_stock.stock
[Services]
Services\StockService::reserveFromWarehouse route×2 d1 USES_CONNECTION@StockService.php:32~r → connection:warehouse
Services\StockService::reserve route×2 d2 CALLS@StockService.php:17 → USES_CONNECTION@StockService.php:32~r → connection:warehouse
## OPERATOR (1)
[Console/Commands]
Console\Commands\SyncWarehouseCommand::handle cmd×1 d1 READS_TABLE@SyncWarehouseCommand.php:16~r conn=warehouse → table:warehouse_stock
## GATED (1)
[Http/Controllers/Admin]
Http\Controllers\Admin\InventoryController::index route×1 d1 gated_target guard InventoryController.php:16 hop USES_CONNECTION@InventoryController.php:17
## ENTRY POINTS (4)
command (1): bookstore:sync-warehouse
route (3): GET /v1/{store}/admin/inventory [gated]; POST /v1/orders; POST /v1/stock/reserve
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}}}
reaches {'targets': ['env:WAREHOUSE_DB_*'], 'group_by': 'entry_kind'} (1711 chars)
targets: env:WAREHOUSE_DB_*→2 | gate=new_inventory | conf>=heuristic
dependents: 7 code (no-entry 1, operator 1, runtime 4, gated 1); entry points 4 (3 live): command×1, route×3
## RUNTIME (4)
[route]
Services\StockService::reserveFromWarehouse route×2 d3 USES_CONNECTION@StockService.php:32~r → CONNECTS_TO@database.php:11~h → CONFIGURED_BY@None:None~h → env:WAREHOUSE_DB_HOST
Services\StockService::reserve route×2 d4 CALLS@StockService.php:17 → USES_CONNECTION@StockService.php:32~r → CONNECTS_TO@database.php:11~h → CONFIGURED_BY@None:None~h → env:WAREHOUSE_DB_HOST
Http\Controllers\OrderController::store route×1 d5 CALLS@OrderController.php:19~r → CALLS@StockService.php:17 → USES_CONNECTION@StockService.php:32~r → CONNECTS_TO@database.php:11~h → CONFIGURED_BY@None:None~h → env:WAREHOUSE_DB_HOST
Http\Controllers\StockController::reserve route×1 d5 CALLS@StockController.php:16~r → CALLS@StockService.php:17 → USES_CONNECTION@StockService.php:32~r → CONNECTS_TO@database.php:11~h → CONFIGURED_BY@None:None~h → env:WAREHOUSE_DB_HOST
## OPERATOR (1)
[cmd]
Console\Commands\SyncWarehouseCommand::handle cmd×1 d3 READS_TABLE@SyncWarehouseCommand.php:16~r conn=warehouse → CONNECTS_TO@None:None~h → CONFIGURED_BY@None:None~h → env:WAREHOUSE_DB_HOST
## GATED (1)
[route]
Http\Controllers\Admin\InventoryController::index route×1 d3 gated_target guard InventoryController.php:16 hop USES_CONNECTION@InventoryController.php:17
## NO-ENTRY (1)
[-]
script:config/database.php - d1 READS_ENV@database.php:13 → env:WAREHOUSE_DB_HOST
## ENTRY POINTS (4)
command (1): bookstore:sync-warehouse
route (3): GET /v1/{store}/admin/inventory [gated]; POST /v1/orders; POST /v1/stock/reserve
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}}}
impact {'method': 'StockService::recordSale'} (248 chars)
targets: Services\StockService::recordSale
transitive callers: 1; entry points: 1
## http_route (1)
POST /v1/orders ROUTES_TO@api.php:24 → CALLS@OrderController.php:26~r → Services\StockService::recordSale
callers by module: Http/Controllers×1
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}}}
callers {'symbol': 'StockService::reserve'} (219 chars)
targets: Services\StockService::reserve
direct callers: 2 (2 sites)
Http\Controllers\OrderController::store CALLS@OrderController.php:19 ~r
Http\Controllers\StockController::reserve CALLS@StockController.php:16 ~r
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}}}
tests_covering {'target': 'StockService::reserve'} (382 chars)
targets: 1 node(s): Services\StockService::reserve
tests: 0 direct, 0 nearby transitive (app depth <= 3) (of 0 test cases in the graph)
no indexed test reaches the target (the graph has no test code: no test files or test cases were indexed)
coverage: every source file cg found is indexed (php, typescript); code outside these languages or generated at runtime is not in the graph.
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}}}
coverage {} (553 chars)
coverage bookstore-api: php 32 exact
frameworks: laravel | presets: common, php, laravel | config: no .cg.yaml
coverage bookstore-web: typescript 12 exact | generated: 4 files excluded
frameworks: nuxt | presets: common, typescript, nuxt | config: no .cg.yaml
generated: 4 files excluded (Nuxt build output (.nuxt/) 4)
Nuxt build output (.nuxt/): .nuxt/axios-shim.d.ts, .nuxt/nuxt.d.ts, .nuxt/types/components.d.ts, .nuxt/types/imports.d.ts
every source file cg found is indexed; edges still carry their own exact / resolved / heuristic label.
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
siblings {'symbol': 'StockService::reserveLocal', 'limit': 6} (478 chars)
target: Services\StockService::reserveLocal
shared resources:
Http\Controllers\Admin\BookController::store: column:books.is_active, column:books.isbn, column:books.price
Http\Controllers\Admin\BookController::update: column:books.is_active, column:books.isbn, column:books.price
Services\StockService::recordSale: column:books.id
Http\Controllers\Admin\InventoryController::index: column:books.is_active
Console\Commands\SyncWarehouseCommand::handle: column:books.isbn
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
siblings {'symbol': 'StockService::reserve'} (793 chars)
target: Services\StockService::reserve
no siblings found for Services\StockService::reserve: its class has no parent class, interface or trait shared with other classes; it touches no table, column, config, env key or connection directly; all 2 of its callees are in its own class, which co-caller matching skips.
try: siblings('Services\StockService::reserveLocal') (a callee that touches data); siblings('Services\StockService::reserveFromWarehouse') (a callee that touches data); impact('Services\StockService::reserve') for its callers and entry points; downstream('Services\StockService::reserve') for the tables, config and connections it reaches
coverage: every source file cg found is indexed (php, typescript); code outside these languages or generated at runtime is not in the graph.
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
writers {'table': 'books'} (605 chars)
table books: 17 write edges from 4 writers
[Console/Commands]
Console\Commands\SyncWarehouseCommand::handle cmd×1 cols: (row) @ SyncWarehouseCommand.php:19 conf=resolved
[Http/Controllers/Admin]
Http\Controllers\Admin\BookController::store route×1 cols: is_active,isbn,price,stock,store_id,title @ BookController.php:15 conf=resolved
Http\Controllers\Admin\BookController::update route×1 cols: age_rating,is_active,isbn,price,stock,title @ BookController.php:30 conf=resolved
[Services]
Services\StockService::recordSale route×1 cols: sold_count @ StockService.php:42 conf=resolved
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
writers {'table': 'books.age_rating'} (441 chars)
column books.age_rating: 2 write edges from 2 writers
[Http/Controllers/Admin]
App\Http\Controllers\Admin\BookController::update WRITES_COLUMN column:books.age_rating @BookController.php:30 (resolved) entries: http_route
table-level writes of books (columns not recorded):
[Console/Commands]
App\Console\Commands\SyncWarehouseCommand::handle WRITES_TABLE table:books @SyncWarehouseCommand.php:19 (resolved) entries: artisan_command
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
readers {'prop': 'books.is_active'} (374 chars)
column books.is_active: 2 read edges from 2 readers
[Http/Controllers/Admin]
App\Http\Controllers\Admin\InventoryController::index READS_COLUMN column:books.is_active @InventoryController.php:20 (resolved) entries: http_route
[Services]
App\Services\StockService::reserveLocal READS_COLUMN column:books.is_active @StockService.php:22 (resolved) entries: http_route
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
readers {'prop': 'books.titel'} (158 chars)
table books has no column 'titel'; similar: title. columns: id, store_id, isbn, title, price, is_active, stock, sold_count, age_rating, created_at, updated_at
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
node {'id_or_symbol': 'App\\Http\\Controllers\\Admin\\InventoryController::index'} (675 chars)
method:App\Http\Controllers\Admin\InventoryController::index
kind=method module=Http/Controllers/Admin at bookstore-api/app/Http/Controllers/Admin/InventoryController.php:13-21
reached by: route×1
attrs: {"repo":"bookstore-api"}
doc:
/** Stock list; stores still on the old warehouse read it from there. */
out: CALLS×1, READS_COLUMN×2, READS_SETTING×1, USES_CONNECTION×1
CALLS: Models\Store::getSetting@16
READS_COLUMN: column:warehouse_stock.is_active@17!g; column:books.is_active@20
READS_SETTING: setting:features.new_inventory.enabled@16
USES_CONNECTION: connection:warehouse@17!g
in: CONTAINS×1, ROUTES_TO×1
ROUTES_TO: route:GET /v1/{store}/admin/inventory@16
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
path {'source': 'page:/', 'target': 'SalesReportService::remove'} (460 chars)
page:app/pages/index.vue
-HTTP_CALLS[resolved @ bookstore-web/app/pages/index.vue:4]-> http:DELETE /api/v1/main/admin/reports/{id}
-MATCHES_ROUTE[resolved @ bookstore-api/routes/api.php:15]-> route:DELETE /v1/{store}/admin/reports/{report}
-ROUTES_TO[exact @ bookstore-api/routes/api.php:15]-> Http\Controllers\ReportController::destroy
-CALLS[resolved @ bookstore-api/app/Http/Controllers/ReportController.php:40]-> Services\SalesReportService::remove
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
downstream {'target': 'page:/reports/:id', 'max_per_kind': 10} (570 chars)
targets: page:app/pages/reports/[id].vue | reached 35 nodes | gate=new_inventory
tables touched (2): orders, stores
## route (2)
route:GET /v1/{store}/admin/reports/top d3 CALLS@[id].vue:10~r → HTTP_CALLS@useReports.ts:9~r → MATCHES_ROUTE@api.php:12~r → route:GET /v1/{store}/admin/reports/top
route:GET /v1/{store}/admin/reports/top/export.{format} d3 CALLS@[id].vue:19~r → HTTP_CALLS@useReports.ts:12~r → MATCHES_ROUTE@api.php:14~r → route:GET /v1/{store}/admin/reports/top/export.{format}
## column (2)
column:orders.placed_at d7
column:stores.settings d8
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
api_calls {'filter': 'unmatched'} (692 chars)
5 client endpoints (0 matched)
GET /api/v1/main/admin/session ⇒ UNMATCHED
← useSessionStore.load (useSessionStore.ts) @ useSessionStore.ts:7
GET /version.json ⇒ UNMATCHED
← useAppVersion (useReports.ts) @ useReports.ts:19
query keys: t
POST /payments ⇒ UNMATCHED
← Services\PaymentsClient::createPayment @ PaymentsClient.php:14 via PaymentsClient::request
body keys: order_id, amount
POST /payments/{id}/cancel ⇒ UNMATCHED
← Services\PaymentsClient::cancelPayment @ PaymentsClient.php:19 via PaymentsClient::request
POST /refunds ⇒ UNMATCHED
← Services\PaymentsClient::createRefund @ PaymentsClient.php:24 via PaymentsClient::send
body keys: reason, note
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
resolutions {'concept': 'timezone'} (2934 chars)
concept: timezone (head-word forms: timezone, timezones)
backend resolution sites: 2 in 2 distinct fallback chains; request keys of the concept: timezone; request-driven chains: A, B
== FALLBACK CHAINS (deterministic, grouped by signature)
[A] input:timezone > column:orders.customer_timezone > setting:locale.timezone > column:stores.default_timezone > 'UTC' (1 site)
ReportController::resolveTimezone return (returns) @bookstore-api/app/Http/Controllers/ReportController.php:43
1. request key 'timezone' via $validated[...] (param $explicit from 1 call site(s)) @app/Http/Controllers/ReportController.php:28
2. column orders.customer_timezone (->value() (argument of Http\Controllers\ReportController::summary)) @app/Http/Controllers/ReportController.php:49
3. setting 'locale.timezone' (Store::getSetting) default '' [trim] @app/Http/Controllers/ReportController.php:54
4. column stores.default_timezone (Store->default_timezone) [trim] @app/Http/Controllers/ReportController.php:58
5. literal 'UTC' @app/Http/Controllers/ReportController.php:64
reached from 1 route(s): GET /v1/{store}/admin/reports/summary
[B] input:timezone > setting:reports.timezone > 'UTC' (1 site)
SalesReportService::build $timezone (expr) @bookstore-api/app/Services/SalesReportService.php:17
1. request key 'timezone' via $filters[...]; flow: Services\SalesReportService::report @app/Services/SalesReportService.php:12 passes param $filters <- Http\Controllers\ReportController::top @app/Http/Controllers/ReportController.php:21 passes $request->validated() @app/Services/SalesReportService.php:17
2. setting 'reports.timezone' (Store::getSetting) default 'UTC' @app/Services/SalesReportService.php:17
3. literal 'UTC' (getSetting default) @app/Services/SalesReportService.php:17
reached from 1 route(s): GET /v1/{store}/admin/reports/top
== DIVERGENCE between request-driven chains (A, B)
[A] vs [B]: same up to input:timezone; then [A] column:orders.customer_timezone vs [B] setting:reports.timezone; same final fallback 'UTC'
== CLIENT (frontend endpoints reaching request-driven sites)
GET /api/v1/main/admin/reports/top -> chain B via GET /v1/{store}/admin/reports/top
app/composables/useReports.ts#useReports.fetchTop @bookstore-web/app/composables/useReports.ts:9 (1 caller(s)) => 'timezone': never sent (builder key is conditional and no call site passes it); client fallback @bookstore-web/app/pages/reports/[id].vue:12: rows.value[0]?.timezone ?? 'UTC'
== SENT BUT NOT FORWARDED (a call site passes the key; the request it calls never sends it)
app/pages/reports/[id].vue @bookstore-web/app/pages/reports/[id].vue:10 passes date_from to app/composables/useReports.ts#useReports.fetchTop; the request @bookstore-web/app/composables/useReports.ts:9 (GET /api/v1/main/admin/reports/top) sends only category_id, mode, timezone
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
plan_list {} (180 chars)
preorders [agreed] Pre-order books: signed-in customers only, never filled from warehouse stock | +1 nodes ~3 modified +3 edges 1 forbidden 1 required | issues #7 | schema errors 0
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}, "bookstore-web/typescript": {"complete": true, "discovered": 12, "excluded": 1, "indexed": 11, "mode": "exact"}}}
plan_check {'name': 'preorders'} (2193 chars)
PLAN CHECK preorders [plan mode] Pre-order books: signed-in customers only, never filled from warehouse stock
plan examples/plans/preorders.yaml | graph bookstore-api+bookstore-web indexed <indexed_at>
summary: refs 15/15 resolve | MISSING FROM PLAN 10 | review 10 | covered 7 | forbidden paths present 1 | open findings touching 2 (unlinked 1) | requirements failed 1
require POST /v1/stock/reserve: MISSING auth:api (has none @api.php:22)
middleware: POST /v1/stock/reserve lacks auth:api which peer route(s) POST /v1/orders have
2 MISSING FROM PLAN (10) by check: caller 2, entry_point 2, admin_surface 1, api_resource 1, external_client 1, model_fillable 1, table_writer 1, validation 1
- [admin_surface] Filament\Resources\BookResource::form: Filament form for Book ($model @BookResource.php:11); saves bypass the graph's WRITES edges — must expose preorder_until @ bookstore-api/app/Filament/Resources/BookResource.php:13
- [api_resource] Http\Resources\BookResource::toArray: serializes Book in API responses (built at BookController.php:24, BookController.php:32); decide whether to expose preorder_until @ bookstore-api/app/Http/Resources/BookResource.php:9
- [caller] OrderController::store: calls modified StockService::reserve @ bookstore-api/app/Http/Controllers/OrderController.php:19
- [caller] StockController::reserve: calls modified StockService::reserve @ bookstore-api/app/Http/Controllers/StockController.php:16
- [entry_point] route:POST /v1/admin/books: http_route reaching modified Admin\BookController::store @ bookstore-api/routes/api.php:26
… +5 more
REVIEW (10) by check: table_reader 3, parallel_method 2, text_mention 2, referencing_column 1, relation 1, table_writer 1
3 CONFLICTS
forbid no-warehouse-for-preorders: path STILL PRESENT (when the book is a pre-order (books.preorder_until set))
#7 [open, linked in plan] Pre-orders can be reserved without an account
#8 [open, NOT LINKED in plan] Sold-out check ignores pending reservations
#9 [closed, touches gaps only] Order book relation (closed)
details=true for every item with file:line evidence and call chains (CLI: plan check without --summary); max_items=N shows more top items.
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}}}
plan_check {'name': 'preorders', 'details': True, 'max_items': 30} (5991 chars)
PLAN CHECK preorders [plan mode] Pre-order books: signed-in customers only, never filled from warehouse stock
graph bookstore-api+bookstore-web indexed <indexed_at>; plan examples/plans/preorders.yaml
summary: refs 15/15 resolve | MISSING FROM PLAN 10 | review 10 | covered 7 | forbidden paths present 1 | open findings touching 2 (unlinked 1) | requirements failed 1
1 RESOLVE: all plan references resolve to graph nodes
planned column:books.preorder_until: new
changed tables: books (+preorder_until)
modified: StockService::reserve, StockService::reserveLocal, Admin\BookController::store
require POST /v1/stock/reserve [auth:api]: MISSING auth:api (has @api.php:22)
middleware: POST /v1/stock/reserve lacks auth:api which peer route(s) POST /v1/orders have (both reach StockService::reserve)
2 MISSING FROM PLAN (10): affected by the planned change, not covered by any plan entry
- [admin_surface] Filament\Resources\BookResource::form: Filament form for Book ($model @BookResource.php:11); saves bypass the graph's WRITES edges — must expose preorder_until
@ bookstore-api/app/Filament/Resources/BookResource.php:13
- [api_resource] Http\Resources\BookResource::toArray: serializes Book in API responses (built at BookController.php:24, BookController.php:32); decide whether to expose preorder_until
@ bookstore-api/app/Http/Resources/BookResource.php:9, bookstore-api/app/Http/Controllers/Admin/BookController.php:24, bookstore-api/app/Http/Controllers/Admin/BookController.php:32
- [caller] OrderController::store: calls modified StockService::reserve
@ bookstore-api/app/Http/Controllers/OrderController.php:19
- [caller] StockController::reserve: calls modified StockService::reserve
@ bookstore-api/app/Http/Controllers/StockController.php:16
- [entry_point] route:POST /v1/admin/books: http_route reaching modified Admin\BookController::store
@ bookstore-api/routes/api.php:26
- [entry_point] route:POST /v1/orders: http_route reaching modified StockService::reserve
@ bookstore-api/routes/api.php:24
- [external_client] client:example/bookstore-mobile/pages/cart.vue: POST /stock/reserve -> POST /v1/stock/reserve [snapshot, read]; sends isbn
@ example/bookstore-mobile@4f2c9e1:pages/cart.vue:12
- [model_fillable] Book::$fillable [property]: Book::$fillable lacks preorder_until (mass assignment would drop it)
@ bookstore-api/app/Models/Book.php:9
- [table_writer] Admin\BookController::update: writes books (age_rating, is_active, isbn, price, stock…); must set/keep new preorder_until [bypasses StockService::reserve]
@ bookstore-api/app/Http/Controllers/Admin/BookController.php:30
- [validation] Admin\UpdateBookRequest::rules: validates 6 books fields (age_rating, is_active, isbn, price…) but not preorder_until
@ bookstore-api/app/Http/Requests/Admin/UpdateBookRequest.php:11
REVIEW (10): related; confirm unaffected or add to covers/out_of_scope
- [parallel_method] Warehouse\WarehouseItem::isSoldOut: mirror of Book::isSoldOut; reached from modified code
@ bookstore-api/app/Models/Warehouse/WarehouseItem.php:14
- [parallel_method] StockService::reserveFromWarehouse: same-class sibling of modified StockService::reserve (reserve*)
@ bookstore-api/app/Services/StockService.php:30
- [referencing_column] OrderController::store: writes column orders.book_id (refers to books)
@ bookstore-api/app/Http/Controllers/OrderController.php:20
- [relation] Order::book: Eloquent relation to Book
@ bookstore-api/app/Models/Order.php:15
- [table_reader] Admin\InventoryController::index: reads books (is_active) [bypasses StockService::reserve]
@ bookstore-api/app/Http/Controllers/Admin/InventoryController.php:20
- [table_reader] Book::isSoldOut: reads books (sold_count, stock)
@ bookstore-api/app/Models/Book.php:13
- [table_reader] ArchiveService::legacyBooks: reads books (store_id) [bypasses StockService::reserve]
@ bookstore-api/app/Services/ArchiveService.php:13
- [table_writer] SyncWarehouseCommand::handle: writes books (row) [bypasses StockService::reserve]
@ bookstore-api/app/Console/Commands/SyncWarehouseCommand.php:19
- [text_mention] OrderController::place: mentions book_id (text-match, no graph edge)
@ bookstore-api/app/Http/Controllers/OrderController.php:36
- [text_mention] StoreOrderRequest::rules: mentions book_id (text-match, no graph edge)
@ bookstore-api/app/Http/Requests/StoreOrderRequest.php:12
COVERED by plan (7 items, 7 nodes): Admin\BookController::store, Admin\StoreBookRequest::rules, StockService::recordSale, StockService::reserve, StockService::reserveLocal, route:POST /v1/stock/reserve, table:warehouse_stock
PRECEDENT atomic counter /increment\(/: 1 hit(s)
StockService::recordSale @StockService.php:42: Book::where('id', $bookId)->increment('sold_count');
3 CONFLICTS
forbid no-warehouse-for-preorders: path STILL PRESENT (when the book is a pre-order (books.preorder_until set)); guard (StockService::reserve reads column:books.preorder_until): ABSENT
StockService::reserve -CALLS@StockService.php:17-> StockService::reserveFromWarehouse -READS_COLUMN@StockService.php:32-> column:warehouse_stock.is_active
#7 [open, linked in plan] Pre-orders can be reserved without an account
StockService::reserve* L10-18
#8 [open, NOT LINKED in plan] Sold-out check ignores pending reservations
StockService::reserveLocal* L22
#9 [closed, touches gaps only] Order book relation (closed)
Order::book L13
(* = node the plan modifies/references)
ENTRY CHAINS (entry point -> modified code)
route:POST /v1/admin/books -ROUTES_TO@api.php:26-> Admin\BookController::store
route:POST /v1/orders -ROUTES_TO@api.php:24-> OrderController::store -CALLS@OrderController.php:19-> StockService::reserve
route:POST /v1/stock/reserve -ROUTES_TO@api.php:22-> StockController::reserve -CALLS@StockController.php:16-> StockService::reserve
structured completeness: {"complete": true, "languages": {"bookstore-api/php": {"complete": true, "discovered": 32, "indexed": 32, "mode": "exact"}}}
index (gating fixture, temp db) (554 chars)
indexed tests/gating_fixture -> fixture.db: 25 nodes, 78 edges in <s>s; gated edges {'new_inventory': 20}
project=gating_fixture root=tests/gating_fixture indexed_at=<indexed_at> index_seconds=<s>
nodes: method×16, class×5, property×3, constant×1
edges: CALLS×30(gated 10), READS_PROP×23(gated 10), CONTAINS×20, INJECTS×3, USES_VALUE×1, REFERENCES×1
gate predicates: [new_inventory] Support\FeatureGate::oldMode=false; [new_inventory] Support\FeatureGate::usesNewInventory=true; [new_inventory] Support\Flags::on=true
coverage gating_fixture: php 1 exact
MCP server
code-graph ships a stdio Model Context Protocol server. An agent gets callers, entry points and file:line evidence from the graph. It needs the mcp Python SDK (2.x). Use the installed cg-mcp command from Install.
Rust, C and C++
What Rust, C, and C++ add beyond Install, CLI specs, and Graph schema: heuristic vs rust-analyzer / scip-clang, the indexer flags, and the ids those pages do not spell out. Toolchain fit: cg doctor -h. Why a file stayed heuristic: cg coverage.