{"env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}, "height": 30, "timestamp": 0, "title": "contextweaver demo --scenario mcp-gateway-full  (60-tool architecture)", "version": 2, "width": 100}
[0.0, "o", "$ contextweaver demo --scenario mcp-gateway-full  (60-tool architecture)\r\n"]
[0.8172, "o", "============================================================\r\n"]
[1.1344, "o", "contextweaver demo — mcp-gateway-full scenario (60-tool reference architecture)\r\n"]
[1.4516, "o", "============================================================\r\n"]
[1.7688, "o", "\r\n"]
[2.086, "o", "============================================================================\r\n"]
[2.4032, "o", "contextweaver -- MCP Context Gateway reference architecture\r\n"]
[2.7204, "o", "============================================================================\r\n"]
[3.0376, "o", "(simulated MCP gateway flow using contextweaver primitives)\r\n"]
[3.3548, "o", "\r\n"]
[3.672, "o", "Loaded catalog: 60 tools across 10 namespaces\r\n"]
[3.9892, "o", "\r\n"]
[4.3065, "o", "============================================================================\r\n"]
[4.6237, "o", "[1/5] Route phase — model sees compact ChoiceCards, NOT schemas\r\n"]
[4.9409, "o", "============================================================================\r\n"]
[5.2581, "o", "user typed:    \"Why did customer C-12345's MRR drop last month?\"\r\n"]
[5.5753, "o", "routing query: 'Execute a BigQuery query to find MRR delta rows for customer C-12345'\r\n"]
[5.8925, "o", "(a production agent would LLM-rephrase the user question into the routing query;\r\n"]
[6.2097, "o", " here we hold both explicit so the demo is deterministic.)\r\n"]
[6.5269, "o", "shortlist (5 of 60): ['bigquery.run_query', 'bigquery.dry_run', 'analytics.events.query', 'bigquery.list_datasets', 'analytics.dashboards.get']\r\n"]
[6.8441, "o", "chosen:    bigquery.run_query  (intent='bigquery.run_query')\r\n"]
[7.1613, "o", "\r\n"]
[7.4785, "o", "ChoiceCards rendered to the model (536 chars, NO full schemas):\r\n"]
[7.7957, "o", "[1/5] bigquery.run_query (tool) — Execute a BigQuery SQL query and return rows [bigquery, read, sql] score=2.67\r\n"]
[8.1129, "o", "[2/5] bigquery.dry_run (tool) — Estimate cost of a BigQuery query [bigquery, plan, sql] score=1.65\r\n"]
[8.4301, "o", "[3/5] analytics.events.query (tool) — Query the events table for a customer [analytics, events, read] score=1.21\r\n"]
[8.7473, "o", "[4/5] bigquery.list_datasets (tool) — List BigQuery datasets in a project [bigquery, schema] score=1.17\r\n"]
[9.0645, "o", "[5/5] analytics.dashboards.get (tool) — Fetch a saved analytics dashboard [analytics, dashboards] score=0.00\r\n"]
[9.3817, "o", "\r\n"]
[9.6989, "o", "============================================================================\r\n"]
[10.0161, "o", "[2/5] Call phase — hydrate ONLY the selected tool's schema\r\n"]
[10.3333, "o", "============================================================================\r\n"]
[10.6505, "o", "tool: bigquery.run_query\r\n"]
[10.9677, "o", "hydrated schema for: 'bigquery.run_query'  (854 chars)\r\n"]
[11.2849, "o", "hydrated schema for the other 59 tools: 0 chars (skipped)\r\n"]
[11.6022, "o", "\r\n"]
[11.9194, "o", "Schema preview (first 200 chars):\r\n"]
[12.2366, "o", "  '{\\n  \"additionalProperties\": false,\\n  \"properties\": {\\n    \"dry_run\": {\\n      \"default\": false,\\n      \"description\": \"If true, return the query plan only.\",\\n      \"type\": \"boolean\"\\n    },\\n    \"labels\": '\r\n"]
[12.5538, "o", "  ...\r\n"]
[12.871, "o", "\r\n"]
[13.1882, "o", "============================================================================\r\n"]
[13.5054, "o", "[3/5] Tool call + [4/5] context firewall\r\n"]
[13.8226, "o", "============================================================================\r\n"]
[14.1398, "o", "called: bigquery.run_query(...)\r\n"]
[14.457, "o", "raw upstream result: 16,507 chars (MCP wire shape)\r\n"]
[14.7742, "o", "firewall: 16,507 chars  ->  194-char summary  (artifact artifact:result:tc1)\r\n"]
[15.0914, "o", "extracted facts (first 3 of 24):\r\n"]
[15.4086, "o", "  - rowset: bigquery.run_query\r\n"]
[15.7258, "o", "  - project: ops-analytics-prod\r\n"]
[16.043, "o", "  - rows_returned: 90\r\n"]
[16.3602, "o", "\r\n"]
[16.6774, "o", "============================================================================\r\n"]
[16.9946, "o", "[5/5] Answer phase — final prompt sees summary + handle, NOT raw rows\r\n"]
[17.3118, "o", "============================================================================\r\n"]
[17.629, "o", "answer prompt: included=3  tokens=142\r\n"]
[17.9462, "o", "final prompt length: 636 chars\r\n"]
[18.2634, "o", "contains raw rowset? no\r\n"]
[18.5806, "o", "contains artifact handle? yes\r\n"]
[18.8978, "o", "contains durable fact?    yes\r\n"]
[19.2151, "o", "contains user query?      yes\r\n"]
[19.5323, "o", "contains tool call?       yes\r\n"]
[19.8495, "o", "\r\n"]
[20.1667, "o", "--- Final answer-phase prompt ---\r\n"]
[20.4839, "o", "[FACTS]\r\n"]
[20.8011, "o", "- customer.C-12345.plan_change: growth -> starter (self-serve, day 47, -$450 MRR)\r\n"]
[21.1183, "o", "\r\n"]
[21.4355, "o", "[TOOL RESULT [artifact:result:tc1]]\r\n"]
[21.7527, "o", "rowset: bigquery.run_query\r\n"]
[22.0699, "o", "project: ops-analytics-prod\r\n"]
[22.3871, "o", "rows_returned: 90\r\n"]
[22.7043, "o", "schema: date STRING, customer_id STRING, plan STRING, mrr_delta_usd INT64, reason_code STRING, actor STRING, notes STRING\r\n"]
[23.0215, "o", "\r\n"]
[23.3387, "o", "[USER]\r\n"]
[23.6559, "o", "Why did customer C-12345's MRR drop last month?\r\n"]
[23.9731, "o", "\r\n"]
[24.2903, "o", "[TOOL CALL]\r\n"]
[24.6075, "o", "bigquery.run_query({\"sql\":\"SELECT date, plan, mrr_delta_usd, reason_code, actor, notes FROM `ops-analytics-prod.billing.mrr_changes` WHERE customer_id = 'C-12345' AND date BETWEEN '2026-02-01' AND '2026-04-30' ORDER BY date\",\"max_results\":1000})\r\n"]
[24.9247, "o", "--- end prompt ---\r\n"]
[25.2419, "o", "\r\n"]
[25.5591, "o", "============================================================================\r\n"]
[25.8763, "o", "Metrics summary\r\n"]
[26.1935, "o", "============================================================================\r\n"]
[26.5108, "o", "catalog_tools           = 60\r\n"]
[26.828, "o", "exposed_choice_cards    = 5\r\n"]
[27.1452, "o", "hydrated_schema_chars   = 854  (selected tool only)\r\n"]
[27.4624, "o", "raw_result_chars        = 16,507\r\n"]
[27.7796, "o", "injected_summary_chars  = 194\r\n"]
[28.0968, "o", "firewall_reduction_pct  = 98.8%\r\n"]
[28.414, "o", "artifact_handle         = artifact:result:tc1\r\n"]
[28.7312, "o", "final_prompt_tokens     = 142\r\n"]
[29.0484, "o", "final_prompt_chars      = 636\r\n"]
[29.3656, "o", "\r\n"]
[29.6828, "o", "============================================================\r\n"]
[30.0, "o", "Demo complete.\r\n"]
[30.0, "o", "$ "]
