mirror of
https://github.com/mksglu/context-mode.git
synced 2026-11-23 13:11:14 +08:00
bench: plain-language case pages built from stored results and replies (D-BENCH-PAGES-1)
Each case section now says what you do, what goes into the chat without Context Mode (bytes, about-tokens, first lines of the real input), what the agent got back with it (stored reply text, bytes, % kept out), the tool with a docs link, the rerun command and a small proof line. Anchors stay. Reply text lives in results/<tag>-replies.json; node run.mjs --pages rebuilds the pages, --save-replies captures replies without touching the numbers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
30459be223
commit
9b8e8d607b
20 files changed
+3015
-275
No files matched your search
+1
-1
@@ -23,7 +23,7 @@ starts the built MCP server over stdio and runs the built hooks as separate proc
|
||||
|
||||
Output: `results/<date>-<os>-<arch>.json` (raw samples, median, min, max, sigma, n, node, os, cpu, context-mode version and git
|
||||
commit, dirty flag, sha256 of every input) and `results/<date>-<os>-<arch>.md` (one table per group, each with a footnote line).
|
||||
Each table row links to its scenario in the group README, which lists the command and the input hashes.
|
||||
Each table row links to its case in the group README: what the case does, a sample of the raw output, the reply the agent got, the rerun command and the input hashes. `node run.mjs --pages` rebuilds those pages from the newest results file and its `-replies.json`.
|
||||
|
||||
Method notes.
|
||||
- Tokens are bytes / 4. That is an estimate. No tokenizer is vendored.
|
||||
|
||||
+1118
-86
File diff suppressed because it is too large.
Load diff
@@ -58,7 +58,7 @@ export default {
|
||||
const h = runHook(bundle, sb, "claude-code", hp);
|
||||
const seen = seenAfterHook(raw, h);
|
||||
if (seen.error) return { error: seen.error };
|
||||
return { metrics: { raw_bytes: bytes(raw), ctx_bytes: bytes(r.text), hook_bytes: bytes(seen.seen), exec_ms: r.ms, hook_ms: h.ms, v1_bytes: v1Row(s.name)?.v1_context_bytes ?? null }, ok: true, note: seen.replaced ? "" : "hook allowed (below its threshold)" };
|
||||
return { metrics: { raw_bytes: bytes(raw), ctx_bytes: bytes(r.text), hook_bytes: bytes(seen.seen), exec_ms: r.ms, hook_ms: h.ms, v1_bytes: v1Row(s.name)?.v1_context_bytes ?? null }, reply: r.text, ok: true, note: seen.replaced ? "" : "hook allowed (below its threshold)" };
|
||||
},
|
||||
})),
|
||||
table(rows) {
|
||||
|
||||
+386
-29
@@ -1,64 +1,421 @@
|
||||
# B. Knowledge retrieval (ctx_index + ctx_search)
|
||||
|
||||
The document goes into the FTS5 store; the agent asks fixed queries and gets the best chunks back. Native = the whole document entering the context. ctx_fetch_and_index is not run: it needs the network and the suite is offline. The same index path serves it (the page body is indexed the same way).
|
||||
Each case here is a document the agent needs a few answers from: library docs, a skill file, a tool list, a docs page.
|
||||
Without Context Mode the whole document goes into the chat. With Context Mode it goes into a local search index.
|
||||
The agent asks its questions and gets back only the parts that match.
|
||||
|
||||
Run this group: `cd bench && node run.mjs b-retrieval`. Latest tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
Run this group: `cd bench && node run.mjs b-retrieval`. All tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
|
||||
## b-supabase-edge-functions-5-examples
|
||||
|
||||
Supabase Edge Functions (5 examples)
|
||||
**Supabase Edge Functions (5 examples)**
|
||||
|
||||
- Command: `node run.mjs b-supabase-edge-functions-5-examples`
|
||||
- Input: `fixtures/data/context7-supabase-edge.md`, 3988 B, sha256 c2baf87451f27eaf7737a2319f01577c577893c72479f70e656b86c8e47f610d
|
||||
**What you do:** Find answers in 5 Supabase Edge Functions examples.
|
||||
|
||||
**Without Context Mode:** The whole document goes into the chat: 3,988 B, about 997 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
````text
|
||||
### Deno Unit Test Example for Supabase Edge Functions
|
||||
|
||||
Source: https://github.com/supabase/supabase/blob/master/apps/docs/content/guides/functions/unit-test.mdx
|
||||
|
||||
This TypeScript example demonstrates a unit test for Supabase Edge Functions using Deno. It shows how to initialize a Supabase client with environment variables ...
|
||||
|
||||
```typescript
|
||||
import { assert, assertEquals } from 'jsr:@std/assert@1'
|
||||
````
|
||||
|
||||
First 8 of 101 lines. Lines over 160 characters are cut.
|
||||
|
||||
**With Context Mode:** The document goes into a local search index. The agent asks 3 questions and gets back only the parts that match (3 of 3 questions got a hit). The agent gets 3,493 B, about 873 tokens. That keeps 12.4% of it out of the chat.
|
||||
|
||||
````text
|
||||
Query "CORS handling edge function":
|
||||
Context7: Supabase #4: ### Supabase Edge Functions - Serverless Drivers
|
||||
|
||||
Supabase Edge Functions use the Deno runtime which has native support for TCP connections, providing flexibility in choosing your database client. You can use supabase-js, Deno Postgres driver, Postgr ...
|
||||
Query "database connection Deno Postgres":
|
||||
Context7: Supabase #1: ### Connect to Supabase Postgres with supabase-js in Deno Edge Function
|
||||
|
||||
Source: https://github.com/supabase/supabase/blob/master/apps/docs/content/guides/functions/connect-to-postgres.mdx
|
||||
|
||||
```typescript
|
||||
import { createClient } from 'npm:@supabase/supabase-js@2'
|
||||
````
|
||||
|
||||
First 12 of 72 lines. Lines over 200 characters are cut.
|
||||
|
||||
**Tool:** ctx_index + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=b-supabase-edge-functions-5-examples)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs b-supabase-edge-functions-5-examples
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/context7-supabase-edge.md](../fixtures/data/context7-supabase-edge.md), 3,988 B, sha256 c2baf87451f27eaf7737a2319f01577c577893c72479f70e656b86c8e47f610d. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## b-react-useeffect-docs
|
||||
|
||||
React useEffect docs
|
||||
**React useEffect docs**
|
||||
|
||||
- Command: `node run.mjs b-react-useeffect-docs`
|
||||
- Input: `fixtures/data/context7-react-docs.md`, 6075 B, sha256 c0ee0d81f97dd86973cb8355a37ffa58eb1a3efad82371e2128ccdd75c9f3d4f
|
||||
**What you do:** Find answers in the React useEffect docs.
|
||||
|
||||
**Without Context Mode:** The whole document goes into the chat: 6,075 B, about 1,519 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
````text
|
||||
### useEffect Hook Reference
|
||||
|
||||
Source: https://react.dev/reference/react/useEffect
|
||||
|
||||
The useEffect Hook allows you to declare side effects in functional components. It accepts a setup function and optional dependencies array, running the setup a ...
|
||||
|
||||
```APIDOC
|
||||
## useEffect Hook
|
||||
````
|
||||
|
||||
First 8 of 161 lines. Lines over 160 characters are cut.
|
||||
|
||||
**With Context Mode:** The document goes into a local search index. The agent asks 3 questions and gets back only the parts that match (3 of 3 questions got a hit). The agent gets 3,356 B, about 839 tokens. That keeps 44.8% of it out of the chat.
|
||||
|
||||
````text
|
||||
Query "useEffect cleanup function":
|
||||
Context7: React #0: ### useEffect Hook Reference
|
||||
|
||||
Source: https://react.dev/reference/react/useEffect
|
||||
|
||||
The useEffect Hook allows you to declare side effects in functional components. It accepts a setup function and optional dependencies array, running the setup after component commits and cleanup befor ...
|
||||
|
||||
```APIDOC
|
||||
## useEffect Hook
|
||||
|
||||
### Description
|
||||
A React Hook that synchronizes a component with an external system by running side effects after render commits.
|
||||
````
|
||||
|
||||
First 12 of 89 lines. Lines over 200 characters are cut.
|
||||
|
||||
**Tool:** ctx_index + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=b-react-useeffect-docs)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs b-react-useeffect-docs
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/context7-react-docs.md](../fixtures/data/context7-react-docs.md), 6,075 B, sha256 c0ee0d81f97dd86973cb8355a37ffa58eb1a3efad82371e2128ccdd75c9f3d4f. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## b-next-js-app-router-docs
|
||||
|
||||
Next.js App Router docs
|
||||
**Next.js App Router docs**
|
||||
|
||||
- Command: `node run.mjs b-next-js-app-router-docs`
|
||||
- Input: `fixtures/data/context7-nextjs-docs.md`, 6658 B, sha256 b687675406d856b451d05ccb702c345a47849969295d19b2b21d2fede213620b
|
||||
**What you do:** Find answers in the Next.js App Router docs.
|
||||
|
||||
**Without Context Mode:** The whole document goes into the chat: 6,658 B, about 1,665 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
````text
|
||||
### Create Server Component Page with Data Fetching in Next.js App Directory
|
||||
|
||||
Source: https://github.com/vercel/next.js/blob/canary/docs/01-app/02-guides/migrating/app-router-migration.mdx
|
||||
|
||||
Shows how to create a new page.tsx file in the app directory that acts as a Server Component by default. This component imports the Client Component and handles ...
|
||||
|
||||
```typescript
|
||||
// Import your Client Component
|
||||
````
|
||||
|
||||
First 8 of 223 lines. Lines over 160 characters are cut.
|
||||
|
||||
**With Context Mode:** The document goes into a local search index. The agent asks 3 questions and gets back only the parts that match (3 of 3 questions got a hit). The agent gets 4,463 B, about 1,116 tokens. That keeps 33.0% of it out of the chat.
|
||||
|
||||
````text
|
||||
Query "App Router data fetching":
|
||||
Context7: Next.js #0: ### Create Server Component Page with Data Fetching in Next.js App Directory
|
||||
|
||||
Source: https://github.com/vercel/next.js/blob/canary/docs/01-app/02-guides/migrating/app-router-migration.mdx
|
||||
|
||||
Shows how to create a new page.tsx file in the app directory that acts as a Server Component by default. This component imports the Client Component and handles data fetching using the new data fetchi ...
|
||||
|
||||
```typescript
|
||||
// Import your Client Component
|
||||
import HomePage from './home-page'
|
||||
|
||||
async function getPosts() {
|
||||
````
|
||||
|
||||
First 12 of 157 lines. Lines over 200 characters are cut.
|
||||
|
||||
**Tool:** ctx_index + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=b-next-js-app-router-docs)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs b-next-js-app-router-docs
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/context7-nextjs-docs.md](../fixtures/data/context7-nextjs-docs.md), 6,658 B, sha256 b687675406d856b451d05ccb702c345a47849969295d19b2b21d2fede213620b. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## b-tailwind-css-docs
|
||||
|
||||
Tailwind CSS docs
|
||||
**Tailwind CSS docs**
|
||||
|
||||
- Command: `node run.mjs b-tailwind-css-docs`
|
||||
- Input: `fixtures/data/context7-tailwind-docs.md`, 4102 B, sha256 d0307fa05b356fbd45451317ffeb324dcbf959577772a9da0b7c87d9c98d7a02
|
||||
**What you do:** Find answers in the Tailwind CSS docs.
|
||||
|
||||
**Without Context Mode:** The whole document goes into the chat: 4,102 B, about 1,026 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
````text
|
||||
### Apply responsive flex layout with Tailwind CSS
|
||||
|
||||
Source: https://github.com/tailwindlabs/tailwindcss.com/blob/main/src/docs/responsive-design.mdx
|
||||
|
||||
Demonstrates how to create a responsive layout that switches from block display on mobile to flex display on medium screens and larger. Uses md:flex to enable f ...
|
||||
|
||||
```html
|
||||
<div class="md:flex">
|
||||
````
|
||||
|
||||
First 8 of 87 lines. Lines over 160 characters are cut.
|
||||
|
||||
**With Context Mode:** The document goes into a local search index. The agent asks 2 questions and gets back only the parts that match (2 of 2 questions got a hit). The agent gets 1,429 B, about 357 tokens. That keeps 65.2% of it out of the chat.
|
||||
|
||||
````text
|
||||
Query "responsive breakpoints":
|
||||
Context7: Tailwind #1: ### Create responsive grid layouts with breakpoint variants
|
||||
|
||||
Source: https://github.com/tailwindlabs/tailwindcss.com/blob/main/src/docs/hover-focus-and-other-states.mdx
|
||||
|
||||
Use Tailwind's responsive variants (md, lg, etc.) to apply different grid column counts at specific viewport breakpoints. This example renders a 3-column grid on mobile, 4 columns on medium screens, a ...
|
||||
|
||||
```html
|
||||
<div class="grid grid-cols-3 md:grid-cols-4 lg:grid-cols-6">
|
||||
<!-- ... -->
|
||||
</div>
|
||||
```
|
||||
````
|
||||
|
||||
First 12 of 29 lines. Lines over 200 characters are cut.
|
||||
|
||||
**Tool:** ctx_index + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=b-tailwind-css-docs)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs b-tailwind-css-docs
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/context7-tailwind-docs.md](../fixtures/data/context7-tailwind-docs.md), 4,102 B, sha256 d0307fa05b356fbd45451317ffeb324dcbf959577772a9da0b7c87d9c98d7a02. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## b-skill-context-mode-main-prompt
|
||||
|
||||
Skill: context-mode (main prompt)
|
||||
**Skill: context-mode (main prompt)**
|
||||
|
||||
- Command: `node run.mjs b-skill-context-mode-main-prompt`
|
||||
- Input: `fixtures/data/skills/skill-main.md`, 16683 B, sha256 ce26cb01de7a116eab256f916620935f029e850771f3fb6cb7d40a3ce8d1f7ff
|
||||
**What you do:** Find answers in the context-mode skill prompt.
|
||||
|
||||
**Without Context Mode:** The whole document goes into the chat: 16,683 B, about 4,171 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
---
|
||||
name: context-mode
|
||||
description: |
|
||||
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing
|
||||
large outputs. Triggers: "analyze logs", "summarize output", "process data",
|
||||
"parse JSON", "filter results", "extract errors", "check build output",
|
||||
"analyze dependencies", "process API response", "large file analysis",
|
||||
"page snapshot", "browser snapshot", "DOM structure", "inspect page",
|
||||
```
|
||||
|
||||
First 8 of 300 lines.
|
||||
|
||||
**With Context Mode:** The document goes into a local search index. The agent asks 3 questions and gets back only the parts that match (3 of 3 questions got a hit). The agent gets 4,496 B, about 1,124 tokens. That keeps 73.1% of it out of the chat.
|
||||
|
||||
````text
|
||||
Query "when to use execute vs execute_file":
|
||||
Skill: context-mode #3: ```
|
||||
│ └── Use Bash
|
||||
│
|
||||
├── Output MIGHT be large or you're UNSURE?
|
||||
│ └── Use context-mode ctx_execute or ctx_execute_file
|
||||
│
|
||||
├── Fetching web documentation or HTML page?
|
||||
│ └── Use ctx_fetch_and_index → ctx_search
|
||||
│
|
||||
├── Using Playwright (navigate, snapshot, console, network)?
|
||||
│ └── ALWAYS use filename parameter to save to file, then:
|
||||
````
|
||||
|
||||
First 12 of 83 lines.
|
||||
|
||||
**Tool:** ctx_index + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=b-skill-context-mode-main-prompt)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs b-skill-context-mode-main-prompt
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/skills/skill-main.md](../fixtures/data/skills/skill-main.md), 16,683 B, sha256 ce26cb01de7a116eab256f916620935f029e850771f3fb6cb7d40a3ce8d1f7ff. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## b-skill-references-4-files-combined
|
||||
|
||||
Skill references (4 files combined)
|
||||
**Skill references (4 files combined)**
|
||||
|
||||
- Command: `node run.mjs b-skill-references-4-files-combined`
|
||||
- Input: `fixtures/data/skills/patterns-javascript.md`, 9598 B, sha256 e0e6e6d17d2df8d93cff0922fb42b21382328d3d14a9bc32f62f0b3f127fc723
|
||||
- Input: `fixtures/data/skills/patterns-python.md`, 9282 B, sha256 8d76144c9e812a54c884b815f526fea85179839fcc70b205bfde1e757ae95fec
|
||||
- Input: `fixtures/data/skills/patterns-shell.md`, 6814 B, sha256 34be33127c296b273e03cf1d8c373c57083e160a1a2ac3876dca010c74689877
|
||||
- Input: `fixtures/data/skills/anti-patterns.md`, 10368 B, sha256 fd6112a5d73375ff2bb3029479766b9927cab48db982fa2a3019682c1c8a3a7d
|
||||
**What you do:** Find answers in 4 skill reference files.
|
||||
|
||||
**Without Context Mode:** The whole document goes into the chat: 36,090 B, about 9,023 tokens.
|
||||
|
||||
The first of the 4 inputs starts like this:
|
||||
|
||||
```text
|
||||
# JavaScript / TypeScript Patterns for execute
|
||||
|
||||
Practical patterns for using `execute` with `language: javascript`.
|
||||
All examples assume Node.js runtime with native fetch (Node 18+).
|
||||
|
||||
---
|
||||
|
||||
## API Response Processing
|
||||
```
|
||||
|
||||
First 8 of 298 lines.
|
||||
|
||||
**With Context Mode:** The document goes into a local search index. The agent asks 3 questions and gets back only the parts that match (3 of 3 questions got a hit). The agent gets 8,212 B, about 2,053 tokens. That keeps 77.2% of it out of the chat.
|
||||
|
||||
````text
|
||||
Query "JSON parse transform pattern":
|
||||
Skill Refs: context-mode #45: ## 3. Using Bash When JS/Python Would Be Cleaner
|
||||
|
||||
**Problem:** Complex data processing in Bash quickly becomes unreadable and error-prone.
|
||||
|
||||
```shell
|
||||
# BAD — parsing JSON in Bash is fragile:
|
||||
cat data.json | python3 -c "
|
||||
import sys, json
|
||||
data = json.load(sys.stdin)
|
||||
for item in data:
|
||||
if item['status'] == 'error':
|
||||
````
|
||||
|
||||
First 12 of 250 lines.
|
||||
|
||||
**Tool:** ctx_index + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=b-skill-references-4-files-combined)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs b-skill-references-4-files-combined
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/skills/patterns-javascript.md](../fixtures/data/skills/patterns-javascript.md), 9,598 B, sha256 e0e6e6d17d2df8d93cff0922fb42b21382328d3d14a9bc32f62f0b3f127fc723; input [fixtures/data/skills/patterns-python.md](../fixtures/data/skills/patterns-python.md), 9,282 B, sha256 8d76144c9e812a54c884b815f526fea85179839fcc70b205bfde1e757ae95fec; input [fixtures/data/skills/patterns-shell.md](../fixtures/data/skills/patterns-shell.md), 6,814 B, sha256 34be33127c296b273e03cf1d8c373c57083e160a1a2ac3876dca010c74689877; input [fixtures/data/skills/anti-patterns.md](../fixtures/data/skills/anti-patterns.md), 10,368 B, sha256 fd6112a5d73375ff2bb3029479766b9927cab48db982fa2a3019682c1c8a3a7d. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## b-mcp-tools-list-40-tools
|
||||
|
||||
MCP tools/list (40 tools)
|
||||
**MCP tools/list (40 tools)**
|
||||
|
||||
- Command: `node run.mjs b-mcp-tools-list-40-tools`
|
||||
- Input: `fixtures/data/mcp-tools.json`, 17362 B, sha256 290dac23e92d735bfc532c6e757df79725217e4871326cdffcb878c0ada973ef
|
||||
**What you do:** Find the right tool in a list of 40 MCP tools.
|
||||
|
||||
**Without Context Mode:** The whole document goes into the chat: 2,509 B, about 627 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
[
|
||||
{
|
||||
"name": "search_codebase",
|
||||
"description": "Search for code patterns across the codebase using ripgrep",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pattern": { "type": "string", "description": "Regex pattern to search for" },
|
||||
```
|
||||
|
||||
First 8 of 491 lines.
|
||||
|
||||
**With Context Mode:** The document goes into a local search index. The agent asks 3 questions and gets back only the parts that match (3 of 3 questions got a hit). The agent gets 1,153 B, about 288 tokens. That keeps 54.0% of it out of the chat.
|
||||
|
||||
```text
|
||||
Query "browser screenshot tool":
|
||||
MCP: tools/list #26: ### take_screenshot
|
||||
|
||||
Take a screenshot of a web page
|
||||
|
||||
---
|
||||
MCP: tools/list #25: ### open_browser
|
||||
|
||||
Open a URL in the browser for testing
|
||||
|
||||
---
|
||||
Query "file search glob":
|
||||
```
|
||||
|
||||
First 12 of 64 lines.
|
||||
|
||||
**Tool:** ctx_index + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=b-mcp-tools-list-40-tools)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs b-mcp-tools-list-40-tools
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/mcp-tools.json](../fixtures/data/mcp-tools.json), 17,362 B, sha256 290dac23e92d735bfc532c6e757df79725217e4871326cdffcb878c0ada973ef. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## b-html-docs-page-sqlite-org-fts5-215-kb
|
||||
|
||||
HTML docs page (sqlite.org FTS5, 215 KB)
|
||||
**HTML docs page (sqlite.org FTS5, 215 KB)**
|
||||
|
||||
- Command: `node run.mjs b-html-docs-page-sqlite-org-fts5-215-kb`
|
||||
- Input: `fixtures/data/sqlite-fts5-docs.html`, 215354 B, sha256 de3092630358518a6869bf047055b3938e18b476e3fbc54f4e2146d1e593497f
|
||||
**What you do:** Find answers in the 215 KB SQLite FTS5 docs page.
|
||||
|
||||
**Without Context Mode:** The whole document goes into the chat: 215,354 B, about 53,839 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
<!DOCTYPE html>
|
||||
<html><head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<link href="sqlite.css" rel="stylesheet">
|
||||
<title>SQLite FTS5 Extension</title>
|
||||
<!-- path= -->
|
||||
</head>
|
||||
```
|
||||
|
||||
First 8 of 4,332 lines.
|
||||
|
||||
**With Context Mode:** The document goes into a local search index. The agent asks 3 questions and gets back only the parts that match (3 of 3 questions got a hit). The agent gets 14,188 B, about 3,547 tokens. That keeps 93.4% of it out of the chat.
|
||||
|
||||
````text
|
||||
Query "bm25 ranking function weights":
|
||||
data/sqlite-fts5-docs.html #42: ```
|
||||
-- The following queries are logically equivalent. But the second may
|
||||
-- be faster, particularly if the caller abandons the query before
|
||||
-- all rows have been returned (or if the queries were modified to
|
||||
-- include LIMIT clauses).
|
||||
SELECT * FROM ft WHERE ft MATCH ? ORDER BY bm25(ft);
|
||||
SELECT * FROM ft WHERE ft MATCH ? ORDER BY rank;
|
||||
```
|
||||
|
||||
Instead of using bm25() with no trailing arguments, the specific auxiliary function mapped to the rank column may be configured either on a per-query basis, or by setting a different persistent defaul ...
|
||||
````
|
||||
|
||||
First 12 of 210 lines. Lines over 200 characters are cut.
|
||||
|
||||
**Tool:** ctx_index + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=b-html-docs-page-sqlite-org-fts5-215-kb)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs b-html-docs-page-sqlite-org-fts5-215-kb
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/sqlite-fts5-docs.html](../fixtures/data/sqlite-fts5-docs.html), 215,354 B, sha256 de3092630358518a6869bf047055b3938e18b476e3fbc54f4e2146d1e593497f. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
ok = metrics.queries_hit === queries.length && found === expect.length && !markup;
|
||||
if (found < expect.length) note = `answer string missing for ${expect.length - found} query(ies)`;
|
||||
}
|
||||
return { metrics, ok, note };
|
||||
return { metrics, ok, note, reply: se.text };
|
||||
},
|
||||
})),
|
||||
table(rows) {
|
||||
|
||||
+133
-16
@@ -1,31 +1,148 @@
|
||||
# C. Batch (ctx_batch_execute equivalent: ctx_batch)
|
||||
|
||||
Native = the sum of the raw outputs of the same commands run as separate Bash calls. The last row has tiny outputs on purpose: the batch reply header is a fixed cost and there is nothing to save.
|
||||
Each case here runs a few commands to check the state of a project.
|
||||
Without Context Mode each command is its own call, and all output goes into the chat.
|
||||
With Context Mode one ctx_batch call runs them all and answers the questions in one short reply.
|
||||
|
||||
Run this group: `cd bench && node run.mjs c-batch`. Latest tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
Run this group: `cd bench && node run.mjs c-batch`. All tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
|
||||
## c-triage
|
||||
|
||||
Triage: tests, tsc, build, nginx log, git log (5 commands, 5 queries)
|
||||
**Triage: tests, tsc, build, nginx log, git log (5 commands, 5 queries)**
|
||||
|
||||
- Command: `node run.mjs c-triage`
|
||||
- Input: `fixtures/data/test-output.txt`, 6185 B, sha256 bc0fd4973ba5a401025c7979d05183f6c7f2a5d7b0f4d4d023b4e933f2e06b0d
|
||||
- Input: `fixtures/data/tsc-errors.txt`, 5023 B, sha256 3ebc05d31d9ac68d3b950d05546f29b01586322660c38c8c94c4447c60cc359f
|
||||
- Input: `fixtures/data/build-output.txt`, 6594 B, sha256 0e6a2387c978b36d37a4a3bc9030d0d0467ad43b8acd99d4a85a607fdc2e885e
|
||||
- Input: `fixtures/data/access.log`, 46216 B, sha256 6e4fa9285b3435ff5f1bb28938124737a0e39035a2f535003b69c46f9e5ff085
|
||||
- Input: `fixtures/data/git-log.txt`, 11895 B, sha256 d767dbdb990c98070c617a9c8d2263d267c596d3ecfcda4cc0a79743815e45ae
|
||||
**What you do:** Check tests, type errors, the build, a server log and the git log in one step.
|
||||
|
||||
**Without Context Mode:** Each command runs as its own call, and all output goes into the chat: 75,913 B, about 18,978 tokens.
|
||||
|
||||
The first of the 5 inputs starts like this:
|
||||
|
||||
```text
|
||||
RUN v2.1.8 /Users/mert/projects/my-saas-app
|
||||
|
||||
✓ src/components/Button.test.tsx (3 tests) 45ms
|
||||
✓ renders correctly 12ms
|
||||
✓ handles click events 18ms
|
||||
✓ applies variant classes 15ms
|
||||
✓ src/components/Avatar.test.tsx (3 tests) 38ms
|
||||
✓ renders with image 14ms
|
||||
```
|
||||
|
||||
First 8 of 168 lines.
|
||||
|
||||
**With Context Mode:** One ctx_batch call runs all 5 commands, keeps the output in a local search index and answers the questions. The agent gets 6,222 B, about 1,556 tokens. That keeps 91.8% of it out of the chat.
|
||||
|
||||
```text
|
||||
## failed tests
|
||||
Test Files 4 failed | 26 passed (30)
|
||||
Tests 4 failed | 108 passed (112)
|
||||
Start at 10:23:45
|
||||
Duration 4.21s (transform 1.23s, setup 0.89s, collect 2.09s, tests 3.87s, environment 0.34s, prepare 0.56s)
|
||||
at Object.<anonymous> (src/api/trpc/routers/user.test.ts:89:18)
|
||||
✓ deletes user 52ms
|
||||
✓ validates input schema 58ms
|
||||
✓ src/api/trpc/routers/project.test.ts (4 tests) 178ms
|
||||
✓ lists projects for user 34ms
|
||||
✓ creates project with defaults 45ms
|
||||
✓ updates project settings 48ms
|
||||
```
|
||||
|
||||
First 12 of 119 lines.
|
||||
|
||||
**Tool:** ctx_batch. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=c-triage)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs c-triage
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/test-output.txt](../fixtures/data/test-output.txt), 6,185 B, sha256 bc0fd4973ba5a401025c7979d05183f6c7f2a5d7b0f4d4d023b4e933f2e06b0d; input [fixtures/data/tsc-errors.txt](../fixtures/data/tsc-errors.txt), 5,023 B, sha256 3ebc05d31d9ac68d3b950d05546f29b01586322660c38c8c94c4447c60cc359f; input [fixtures/data/build-output.txt](../fixtures/data/build-output.txt), 6,594 B, sha256 0e6a2387c978b36d37a4a3bc9030d0d0467ad43b8acd99d4a85a607fdc2e885e; input [fixtures/data/access.log](../fixtures/data/access.log), 46,216 B, sha256 6e4fa9285b3435ff5f1bb28938124737a0e39035a2f535003b69c46f9e5ff085; input [fixtures/data/git-log.txt](../fixtures/data/git-log.txt), 11,895 B, sha256 d767dbdb990c98070c617a9c8d2263d267c596d3ecfcda4cc0a79743815e45ae. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## c-install-log
|
||||
|
||||
Install log and big git log (2 commands, 3 queries)
|
||||
**Install log and big git log (2 commands, 3 queries)**
|
||||
|
||||
- Command: `node run.mjs c-install-log`
|
||||
- Input: `fixtures/data/npm-install-log.txt`, 37761 B, sha256 54fe053a4c8ece97a96bef23b019a9120a230af1e17eddd70d4a046dd48a9af0
|
||||
- Input: `fixtures/data/git-log-large.txt`, 191120 B, sha256 028317819bc1a93fcfbeeba2d5ffea829fe4c439e3889d688f76fbb11bb913ad
|
||||
**What you do:** Check an install log and a long git log in one step.
|
||||
|
||||
**Without Context Mode:** Each command runs as its own call, and all output goes into the chat: 228,881 B, about 57,220 tokens.
|
||||
|
||||
The first of the 2 inputs starts like this:
|
||||
|
||||
```text
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@clack%2fprompts 326ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@modelcontextprotocol%2fsdk 74ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/npm 458ms
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@cfworker%2fjson-schema 129ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@modelcontextprotocol%2fserver 723ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@types%2fnode 488ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/esbuild 169ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/htmlparser2 85ms (cache miss)
|
||||
```
|
||||
|
||||
First 8 of 399 lines.
|
||||
|
||||
**With Context Mode:** One ctx_batch call runs all 2 commands, keeps the output in a local search index and answers the questions. The agent gets 12,797 B, about 3,199 tokens. That keeps 94.4% of it out of the chat.
|
||||
|
||||
```text
|
||||
## cache miss
|
||||
y.npmjs.org/@esbuild%2fwin32-x64 282ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2flinux-s390x 79ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fopenbsd-x64 101ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fwin32-arm64 99ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fdarwin-arm64 99ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fopenbsd-arm64 91ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2flinux-mips64el 84ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fandroid-arm64 128ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2flinux-riscv64 102ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2flinux-loong64 121ms (cache miss)
|
||||
npm http fetch GET 200 https://registry.npmjs.org/entities 86ms (cache miss)
|
||||
```
|
||||
|
||||
First 12 of 154 lines.
|
||||
|
||||
**Tool:** ctx_batch. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=c-install-log)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs c-install-log
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/npm-install-log.txt](../fixtures/data/npm-install-log.txt), 37,761 B, sha256 54fe053a4c8ece97a96bef23b019a9120a230af1e17eddd70d4a046dd48a9af0; input [fixtures/data/git-log-large.txt](../fixtures/data/git-log-large.txt), 191,120 B, sha256 028317819bc1a93fcfbeeba2d5ffea829fe4c439e3889d688f76fbb11bb913ad. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## c-small
|
||||
|
||||
Small outputs (3 tiny commands, 2 queries): batch has fixed overhead
|
||||
**Small outputs (3 tiny commands, 2 queries): batch has fixed overhead**
|
||||
|
||||
- Command: `node run.mjs c-small`
|
||||
- Input: none (small payloads built in the scenario)
|
||||
**What you do:** Run 3 tiny commands in one step.
|
||||
|
||||
**Without Context Mode:** Each command runs as its own call, and all output goes into the chat: 19 B, about 5 tokens.
|
||||
|
||||
The command output looks like this:
|
||||
|
||||
```text
|
||||
v26.8.1
|
||||
true
|
||||
ready
|
||||
```
|
||||
|
||||
**With Context Mode:** One ctx_batch call runs all 3 commands, keeps the output in a local search index and answers the questions. The agent gets 81 B, about 20 tokens. Here the reply is a bit larger than the raw output: small outputs are cheap to read as they are.
|
||||
|
||||
```text
|
||||
## node version
|
||||
v26.8.1
|
||||
## ready
|
||||
ready
|
||||
$ git rev-parse --is-inside-work-tree
|
||||
true
|
||||
```
|
||||
|
||||
**Tool:** ctx_batch. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=c-small)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs c-small
|
||||
```
|
||||
|
||||
<sub>Proof: input: small payloads built in the scenario. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
@@ -1,4 +1,5 @@
|
||||
// Group C: ctx_batch (several commands + queries in one call) against separate raw Bash calls.
|
||||
import { execSync } from "node:child_process";
|
||||
import { bytes, read, pct, kb, rng3 } from "../suite/lib.mjs";
|
||||
|
||||
const CASES = [
|
||||
@@ -10,6 +11,8 @@ const CASES = [
|
||||
queries: ["node version", "ready"], expect: ["v"] },
|
||||
];
|
||||
|
||||
const execOut = (cmd) => { try { return execSync(cmd, { encoding: "utf8" }); } catch { return ""; } };
|
||||
|
||||
export default {
|
||||
id: "c-batch",
|
||||
title: "C. Batch (ctx_batch_execute equivalent: ctx_batch)",
|
||||
@@ -28,7 +31,7 @@ export default {
|
||||
}
|
||||
const found = c.expect.every((e) => r.text.includes(e));
|
||||
const sections = r.text.split(/^## /m).length - 1;
|
||||
return { metrics: { raw_bytes: native, ctx_bytes: bytes(r.text), batch_ms: r.ms, commands: commands.length, query_sections: sections }, ok: found, note: found ? "" : "expected string missing" };
|
||||
return { metrics: { raw_bytes: native, ctx_bytes: bytes(r.text), batch_ms: r.ms, commands: commands.length, query_sections: sections }, reply: r.text, ...(c.cmds ? { sample: commands.map((cmd) => execOut(cmd)).join("") } : {}), ok: found, note: found ? "" : "expected string missing" };
|
||||
},
|
||||
})),
|
||||
table(rows) {
|
||||
|
||||
+192
-14
@@ -1,33 +1,211 @@
|
||||
# D. Large output externalization (>100 KB kept whole in FTS5)
|
||||
|
||||
The script prints everything; the agent gets a capped reply with a pointer, and the full output is searchable. 'Found' counts the first, middle and last line markers returned by ctx_search. For the real files the markers are the first, middle and last line of the file.
|
||||
Each case here prints a very large output, more than 100 KB.
|
||||
Without Context Mode all of it goes into the chat. With Context Mode the full output goes into a local search index.
|
||||
The agent gets the start and a pointer, and a search finds any line later: here the first, middle and last line.
|
||||
|
||||
Run this group: `cd bench && node run.mjs d-externalize`. Latest tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
Run this group: `cd bench && node run.mjs d-externalize`. All tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
|
||||
## d-synth-120k
|
||||
|
||||
Synthetic log, about 120 KB (seeded)
|
||||
**Synthetic log, about 120 KB (seeded)**
|
||||
|
||||
- Command: `node run.mjs d-synth-120k`
|
||||
- Input: synthetic, generated in the scenario with a fixed seed (20261031)
|
||||
**What you do:** Print a 120 KB log from a script.
|
||||
|
||||
**Without Context Mode:** The whole printed output goes into the chat: 80,008 B, about 20,002 tokens.
|
||||
|
||||
It starts like this (the scenario makes this text with a fixed seed):
|
||||
|
||||
```text
|
||||
FIRSTMARK-7c1e req 1abd494f latency=367ms upstream=api-7 status=200
|
||||
req 27dd34af latency=471ms upstream=api-17 status=200
|
||||
req 14fa64db latency=252ms upstream=api-7 status=200
|
||||
req 24d54255 latency=287ms upstream=api-2 status=200
|
||||
req 1a4a1c03 latency=595ms upstream=api-8 status=200
|
||||
req 10e959cc latency=205ms upstream=api-34 status=200
|
||||
req 4c33a72 latency=115ms upstream=api-30 status=200
|
||||
req 21870d96 latency=130ms upstream=api-7 status=200
|
||||
```
|
||||
|
||||
**With Context Mode:** The full output goes into a local search index. The agent gets the start and a pointer. A search later finds the first, middle and last line (3 of 3). The agent gets 2,319 B, about 580 tokens. That keeps 97.1% of it out of the chat.
|
||||
|
||||
```text
|
||||
exit 0 · 80008 B
|
||||
ncy=233ms upstream=api-34 status=200
|
||||
req 300c511 latency=124ms upstream=api-31 status=200
|
||||
req 26df78fb latency=112ms upstream=api-13 status=200
|
||||
req 1fc6d6c2 latency=455ms upstream=api-29 status=200
|
||||
req 162a56b1 latency=307ms upstream=api-28 status=200
|
||||
req 6e31970 latency=315ms upstream=api-27 status=200
|
||||
req b91e313 latency=123ms upstream=api-31 status=200
|
||||
req 16780925 latency=315ms upstream=api-24 status=500
|
||||
req 408ef88 latency=229ms upstream=api-18 status=200
|
||||
req 3309ee8e latency=457ms upstream=api-16 status=200
|
||||
req 1d17e7c9 latency=142ms upstream=api-20 status=200
|
||||
```
|
||||
|
||||
First 12 of 43 lines.
|
||||
|
||||
**Tool:** ctx_execute + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=d-synth-120k)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs d-synth-120k
|
||||
```
|
||||
|
||||
<sub>Proof: input made in the scenario with a fixed seed (20261031). Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## d-synth-1m
|
||||
|
||||
Synthetic log, about 1 MB (seeded)
|
||||
**Synthetic log, about 1 MB (seeded)**
|
||||
|
||||
- Command: `node run.mjs d-synth-1m`
|
||||
- Input: synthetic, generated in the scenario with a fixed seed (20261031)
|
||||
**What you do:** Print a 1 MB log from a script.
|
||||
|
||||
**Without Context Mode:** The whole printed output goes into the chat: 666,796 B, about 166,699 tokens.
|
||||
|
||||
It starts like this (the scenario makes this text with a fixed seed):
|
||||
|
||||
```text
|
||||
FIRSTMARK-7c1e req 1abd494f latency=367ms upstream=api-7 status=200
|
||||
req 27dd34af latency=471ms upstream=api-17 status=200
|
||||
req 14fa64db latency=252ms upstream=api-7 status=200
|
||||
req 24d54255 latency=287ms upstream=api-2 status=200
|
||||
req 1a4a1c03 latency=595ms upstream=api-8 status=200
|
||||
req 10e959cc latency=205ms upstream=api-34 status=200
|
||||
req 4c33a72 latency=115ms upstream=api-30 status=200
|
||||
req 21870d96 latency=130ms upstream=api-7 status=200
|
||||
```
|
||||
|
||||
**With Context Mode:** The full output goes into a local search index. The agent gets the start and a pointer. A search later finds the first, middle and last line (3 of 3). The agent gets 3,380 B, about 845 tokens. That keeps 99.5% of it out of the chat.
|
||||
|
||||
```text
|
||||
exit 0 · 666796 B
|
||||
=186ms upstream=api-29 status=200
|
||||
req 2d53e958 latency=256ms upstream=api-39 status=200
|
||||
req 1b238e02 latency=429ms upstream=api-15 status=200
|
||||
req 1bebd687 latency=731ms upstream=api-24 status=200
|
||||
req f12033e latency=32ms upstream=api-34 status=200
|
||||
req 3297ebfa latency=685ms upstream=api-27 status=200
|
||||
req 3243a24 latency=95ms upstream=api-15 status=200
|
||||
req 27eec629 latency=613ms upstream=api-14 status=200
|
||||
req 1316d51a latency=281ms upstream=api-21 status=200
|
||||
req 14e5401d latency=248ms upstream=api-28 status=200
|
||||
req 896328b latency=692ms upstream=api-10 status=200
|
||||
```
|
||||
|
||||
First 12 of 63 lines.
|
||||
|
||||
**Tool:** ctx_execute + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=d-synth-1m)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs d-synth-1m
|
||||
```
|
||||
|
||||
<sub>Proof: input made in the scenario with a fixed seed (20261031). Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## d-real-github-json
|
||||
|
||||
Real GitHub API payload printed whole (219 KB)
|
||||
**Real GitHub API payload printed whole (219 KB)**
|
||||
|
||||
- Command: `node run.mjs d-real-github-json`
|
||||
- Input: `fixtures/data/github-api-issues-large.json`, 219175 B, sha256 bd2bdb943de007b7bb57d4e4a53a01ad801cf57606a3228682b39d05eb8a5e16
|
||||
**What you do:** Print a 219 KB GitHub API reply from a script.
|
||||
|
||||
**Without Context Mode:** The whole printed output goes into the chat: 219,175 B, about 54,794 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
[
|
||||
{
|
||||
"url": "https://api.github.com/repos/vercel/next.js/issues/101008",
|
||||
"repository_url": "https://api.github.com/repos/vercel/next.js",
|
||||
"labels_url": "https://api.github.com/repos/vercel/next.js/issues/101008/labels{/name}",
|
||||
"comments_url": "https://api.github.com/repos/vercel/next.js/issues/101008/comments",
|
||||
"events_url": "https://api.github.com/repos/vercel/next.js/issues/101008/events",
|
||||
"html_url": "https://github.com/vercel/next.js/pull/101008",
|
||||
```
|
||||
|
||||
First 8 of 3,432 lines.
|
||||
|
||||
**With Context Mode:** The full output goes into a local search index. The agent gets the start and a pointer. A search later finds the first, middle and last line (3 of 3). The agent gets 4,060 B, about 1,015 tokens. That keeps 98.1% of it out of the chat.
|
||||
|
||||
```text
|
||||
exit 0 · 219175 B
|
||||
],
|
||||
"state": "open",
|
||||
"locked": false,
|
||||
"assignees": [
|
||||
"state": "open",
|
||||
"locked": false,
|
||||
"assignees": [
|
||||
],
|
||||
"state": "open",
|
||||
"locked": false,
|
||||
"assignees": [
|
||||
```
|
||||
|
||||
First 12 of 122 lines.
|
||||
|
||||
**Tool:** ctx_execute + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=d-real-github-json)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs d-real-github-json
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/github-api-issues-large.json](../fixtures/data/github-api-issues-large.json), 219,175 B, sha256 bd2bdb943de007b7bb57d4e4a53a01ad801cf57606a3228682b39d05eb8a5e16. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## d-real-git-log
|
||||
|
||||
Real git log printed whole (191 KB)
|
||||
**Real git log printed whole (191 KB)**
|
||||
|
||||
- Command: `node run.mjs d-real-git-log`
|
||||
- Input: `fixtures/data/git-log-large.txt`, 191120 B, sha256 028317819bc1a93fcfbeeba2d5ffea829fe4c439e3889d688f76fbb11bb913ad
|
||||
**What you do:** Print a 191 KB git log from a script.
|
||||
|
||||
**Without Context Mode:** The whole printed output goes into the chat: 191,120 B, about 47,780 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
efe519b1 2026-10-31 ci: remove the temporary D5 proof workflow
|
||||
3afc09ed 2026-10-31 ci: temporary D5 proof 3, hard stop of the load loop, 40x (removed after the run)
|
||||
b49b870c 2026-10-31 ci: temporary D5 proof, print quiet-loop failures (removed after the run)
|
||||
9c84763a 2026-10-31 ci: temporary D5 proof loop (removed after the run)
|
||||
37a48049 2026-10-31 fix(doctor): D5 runs 3 to 9 hook/bare pairs, more only while over the bound (D-D5-MORE-PAIRS-1)
|
||||
0fed73b1 2026-10-31 ci: temporary D5 probe 3, estimators from raw walls (removed after the run)
|
||||
773f8b11 2026-10-31 ci: temporary D5 probe 2, pair count under load (removed after the run)
|
||||
1691b4cc 2026-10-31 ci: temporary D5 probe workflow (removed after the run)
|
||||
```
|
||||
|
||||
First 8 of 2,000 lines.
|
||||
|
||||
**With Context Mode:** The full output goes into a local search index. The agent gets the start and a pointer. A search later finds the first, middle and last line (3 of 3). The agent gets 2,842 B, about 711 tokens. That keeps 98.5% of it out of the chat.
|
||||
|
||||
```text
|
||||
exit 0 · 191120 B
|
||||
view/issues-P1.json
|
||||
857d0057 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-P3.json
|
||||
97b70365 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-new.json
|
||||
ca22fc31 2026-10-14 docs(v2): low-token review-lite workflow reusing saved round-1 results
|
||||
454aac8c 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-P2.json
|
||||
7b440891 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-I3.json
|
||||
25147226 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-I1.json
|
||||
175a5c2e 2026-10-14 review: docs/v2/review/out/r2/round1/review/v1-migration-sim.json
|
||||
9bb3b9d1 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-I1.json
|
||||
2044952d 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-I2.json
|
||||
9965f8be 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-P0.json
|
||||
```
|
||||
|
||||
First 12 of 36 lines.
|
||||
|
||||
**Tool:** ctx_execute + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=d-real-git-log)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs d-real-git-log
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/git-log-large.txt](../fixtures/data/git-log-large.txt), 191,120 B, sha256 028317819bc1a93fcfbeeba2d5ffea829fe4c439e3889d688f76fbb11bb913ad. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
@@ -1,5 +1,6 @@
|
||||
// Group D: large output externalization. An output over the cap stays whole in FTS5; the reply is a head plus a pointer.
|
||||
// Proof nothing is lost: a query finds the first, a middle and the last line.
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { bytes, read, rng, pct, kb, rng3 } from "../suite/lib.mjs";
|
||||
|
||||
// Deterministic synthetic output (seed 20261031): `lines` log lines with unique markers on the first, middle and last line.
|
||||
@@ -7,6 +8,9 @@ const synth = (lines) => `const s=${20261031};let a=s>>>0;const r=()=>{a=(a+0x6d
|
||||
const N=${lines};const out=[];for(let i=0;i<N;i++){let m="req "+Math.floor(r()*1e9).toString(16)+" latency="+Math.floor(r()*900)+"ms upstream=api-"+Math.floor(r()*40)+" status="+(r()<0.05?500:200);
|
||||
if(i===0)m="FIRSTMARK-7c1e "+m;if(i===Math.floor(N/2))m="MIDMARK-52ab "+m;if(i===N-1)m="LASTMARK-9f3a "+m;out.push(m)}console.log(out.join("\\n"))`;
|
||||
|
||||
// The first lines of the synthetic output, for the case page (the same seeded script, run once here).
|
||||
const sampleOf = (code) => execFileSync(process.execPath, ["-e", code], { encoding: "utf8", maxBuffer: 1 << 26 }).split("\n").slice(0, 8).join("\n");
|
||||
|
||||
const CASES = [
|
||||
{ id: "d-synth-120k", title: "Synthetic log, about 120 KB (seeded)", synthetic: true, lines: 1500, marks: ["FIRSTMARK-7c1e", "MIDMARK-52ab", "LASTMARK-9f3a"] },
|
||||
{ id: "d-synth-1m", title: "Synthetic log, about 1 MB (seeded)", synthetic: true, lines: 12500, marks: ["FIRSTMARK-7c1e", "MIDMARK-52ab", "LASTMARK-9f3a"] },
|
||||
@@ -43,7 +47,7 @@ export default {
|
||||
searchBytes += bytes(s.text ?? ""); searchMs += s.ms ?? 0;
|
||||
if ((s.text ?? "").includes(m.split(" ")[0]) || (s.text ?? "").includes(m)) found++;
|
||||
}
|
||||
return { metrics: { raw_bytes: fullBytes, ctx_bytes: bytes(r.text), exec_ms: r.ms, markers: marks.length, markers_found: found, search_bytes_per_query: Math.round(searchBytes / marks.length), search_ms_per_query: searchMs / marks.length }, ok: found === marks.length };
|
||||
return { metrics: { raw_bytes: fullBytes, ctx_bytes: bytes(r.text), exec_ms: r.ms, markers: marks.length, markers_found: found, search_bytes_per_query: Math.round(searchBytes / marks.length), search_ms_per_query: searchMs / marks.length }, reply: r.text, ...(c.synthetic ? { sample: sampleOf(code) } : {}), ok: found === marks.length };
|
||||
},
|
||||
})),
|
||||
table(rows) {
|
||||
|
||||
@@ -1,24 +1,106 @@
|
||||
# E. Session continuity (compaction and resume)
|
||||
|
||||
Native = the raw tool outputs that a transcript replay would carry. context-mode = the SessionStart(compact) state block, ctx_resume, and the UserPromptSubmit recall block. 'Recall found' means the recall block for a prompt holds a line that answers it. This measures bytes and presence of the answer, not whether a model keeps working well after compaction.
|
||||
Each case here is a work session that grows until the agent compacts the chat.
|
||||
Without Context Mode the agent needs the old tool outputs back to pick up the work.
|
||||
With Context Mode the hooks keep a journal of the session, and ctx_resume gives back a short summary.
|
||||
|
||||
Run this group: `cd bench && node run.mjs e-continuity`. Latest tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
Run this group: `cd bench && node run.mjs e-continuity`. All tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
|
||||
## e-debug-session
|
||||
|
||||
Debugging session: 6 real outputs, then compaction
|
||||
**Debugging session: 6 real outputs, then compaction**
|
||||
|
||||
- Command: `node run.mjs e-debug-session`
|
||||
- Input: `fixtures/data/test-output.txt`, 6185 B, sha256 bc0fd4973ba5a401025c7979d05183f6c7f2a5d7b0f4d4d023b4e933f2e06b0d
|
||||
- Input: `fixtures/data/tsc-errors.txt`, 5023 B, sha256 3ebc05d31d9ac68d3b950d05546f29b01586322660c38c8c94c4447c60cc359f
|
||||
- Input: `fixtures/data/build-output.txt`, 6594 B, sha256 0e6a2387c978b36d37a4a3bc9030d0d0467ad43b8acd99d4a85a607fdc2e885e
|
||||
- Input: `fixtures/data/git-log.txt`, 11895 B, sha256 d767dbdb990c98070c617a9c8d2263d267c596d3ecfcda4cc0a79743815e45ae
|
||||
- Input: `fixtures/data/access.log`, 46216 B, sha256 6e4fa9285b3435ff5f1bb28938124737a0e39035a2f535003b69c46f9e5ff085
|
||||
- Input: `fixtures/data/github-issues.json`, 60310 B, sha256 2765ceace4b127b15ece4309eb1c91279f85b6107562a498a551657411cb182b
|
||||
**What you do:** Debug with 6 tool outputs, then compact the chat.
|
||||
|
||||
**Without Context Mode:** To pick up the work, the agent needs the old tool outputs back in the chat: 136,223 B, about 34,056 tokens.
|
||||
|
||||
The first of the 6 inputs starts like this:
|
||||
|
||||
```text
|
||||
RUN v2.1.8 /Users/mert/projects/my-saas-app
|
||||
|
||||
✓ src/components/Button.test.tsx (3 tests) 45ms
|
||||
✓ renders correctly 12ms
|
||||
✓ handles click events 18ms
|
||||
✓ applies variant classes 15ms
|
||||
✓ src/components/Avatar.test.tsx (3 tests) 38ms
|
||||
✓ renders with image 14ms
|
||||
```
|
||||
|
||||
First 8 of 168 lines.
|
||||
|
||||
**With Context Mode:** The hooks keep a journal of the session. After compaction, ctx_resume gives the agent a short summary. The agent gets 522 B, about 131 tokens. That keeps 99.6% of it out of the chat.
|
||||
|
||||
```text
|
||||
<context_mode_state session="bench-e-debug-session" upto="6">
|
||||
source s6: Bash:cat data/github-issues.json#toolu_bench_006 (60309 B)
|
||||
source s5: Bash:cat data/access.log#toolu_bench_005 (46215 B)
|
||||
source s4: Bash:cat data/git-log.txt#toolu_bench_004 (11894 B)
|
||||
source s3: Bash:cat data/build-output.txt#toolu_bench_003 (6583 B)
|
||||
source s2: Bash:cat data/tsc-errors.txt#toolu_bench_002 (5022 B)
|
||||
source s1: Bash:cat data/test-output.txt#toolu_bench_001 (6174 B)
|
||||
more: ctx_search(queries:[], scope:"session")
|
||||
</context_mode_state>
|
||||
```
|
||||
|
||||
**Tool:** hooks + ctx_resume. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=e-debug-session)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs e-debug-session
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/test-output.txt](../fixtures/data/test-output.txt), 6,185 B, sha256 bc0fd4973ba5a401025c7979d05183f6c7f2a5d7b0f4d4d023b4e933f2e06b0d; input [fixtures/data/tsc-errors.txt](../fixtures/data/tsc-errors.txt), 5,023 B, sha256 3ebc05d31d9ac68d3b950d05546f29b01586322660c38c8c94c4447c60cc359f; input [fixtures/data/build-output.txt](../fixtures/data/build-output.txt), 6,594 B, sha256 0e6a2387c978b36d37a4a3bc9030d0d0467ad43b8acd99d4a85a607fdc2e885e; input [fixtures/data/git-log.txt](../fixtures/data/git-log.txt), 11,895 B, sha256 d767dbdb990c98070c617a9c8d2263d267c596d3ecfcda4cc0a79743815e45ae; input [fixtures/data/access.log](../fixtures/data/access.log), 46,216 B, sha256 6e4fa9285b3435ff5f1bb28938124737a0e39035a2f535003b69c46f9e5ff085; input [fixtures/data/github-issues.json](../fixtures/data/github-issues.json), 60,310 B, sha256 2765ceace4b127b15ece4309eb1c91279f85b6107562a498a551657411cb182b. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## e-long-session
|
||||
|
||||
Long session: 40 synthetic outputs (seeded), then compaction
|
||||
**Long session: 40 synthetic outputs (seeded), then compaction**
|
||||
|
||||
- Command: `node run.mjs e-long-session`
|
||||
- Input: synthetic, generated in the scenario with a fixed seed (20261031)
|
||||
**What you do:** Work through 40 tool outputs, then compact the chat.
|
||||
|
||||
**Without Context Mode:** To pick up the work, the agent needs the old tool outputs back in the chat: 442,893 B, about 110,723 tokens.
|
||||
|
||||
It starts like this (the scenario makes this text with a fixed seed):
|
||||
|
||||
```text
|
||||
step 0 line 0 id=1abd494f took=367ms ok
|
||||
step 0 line 1 id=3353a954 took=601ms ok
|
||||
step 0 line 2 id=1a10c792 took=573ms ok
|
||||
step 0 line 3 id=10bcbe3b took=164ms ok
|
||||
step 0 line 4 id=24d54255 took=287ms ok
|
||||
step 0 line 5 id=3804fb41 took=396ms ok
|
||||
step 0 line 6 id=cbe81f3 took=326ms ok
|
||||
step 0 line 7 id=d95a711 took=769ms ok
|
||||
```
|
||||
|
||||
First 8 of 260 lines.
|
||||
|
||||
**With Context Mode:** The hooks keep a journal of the session. After compaction, ctx_resume gives the agent a short summary. The agent gets 2,019 B, about 505 tokens. That keeps 99.5% of it out of the chat.
|
||||
|
||||
```text
|
||||
<context_mode_state session="bench-e-long-session" upto="40">
|
||||
source s14: Bash:run step 39#toolu_bench_040 (11045 B)
|
||||
source s13: Bash:run step 38#toolu_bench_039 (11162 B)
|
||||
source s12: Bash:run step 37#toolu_bench_038 (11159 B)
|
||||
source s11: Bash:run step 36#toolu_bench_037 (11189 B)
|
||||
source s10: Bash:run step 35#toolu_bench_036 (11133 B)
|
||||
source sz: Bash:run step 34#toolu_bench_035 (11186 B)
|
||||
source sy: Bash:run step 33#toolu_bench_034 (11146 B)
|
||||
source sx: Bash:run step 32#toolu_bench_033 (11159 B)
|
||||
source sw: Bash:run step 31#toolu_bench_032 (11062 B)
|
||||
source sv: Bash:run step 30#toolu_bench_031 (11117 B)
|
||||
source su: Bash:run step 29#toolu_bench_030 (11147 B)
|
||||
```
|
||||
|
||||
First 12 of 38 lines.
|
||||
|
||||
**Tool:** hooks + ctx_resume. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=e-long-session)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs e-long-session
|
||||
```
|
||||
|
||||
<sub>Proof: input made in the scenario with a fixed seed (20261031). Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
const up = runHook(bundle, sb, "claude-code", { hook_event_name: "UserPromptSubmit", prompt: c.question, session_id: session, cwd: sb.project });
|
||||
if (resume.error || resume.isError || ss.status !== 0 || up.status !== 0) return { error: resume.error ?? resume.text ?? "hook exit " + ss.status + "/" + up.status };
|
||||
const found = up.stdout.includes(c.expect) ? 1 : 0;
|
||||
return { metrics: { raw_bytes: raw, hook_bytes_total: hookBytes, resume_bytes: bytes(resume.text), compact_block_bytes: bytes(ss.stdout), recall_bytes: bytes(up.stdout), recall_found: found, resume_ms: resume.ms, events: texts.length }, ok: found === 1, note: found ? "" : "recall block does not hold the expected line" };
|
||||
return { metrics: { raw_bytes: raw, hook_bytes_total: hookBytes, resume_bytes: bytes(resume.text), compact_block_bytes: bytes(ss.stdout), recall_bytes: bytes(up.stdout), recall_found: found, resume_ms: resume.ms, events: texts.length }, reply: resume.text, ...(c.synthetic ? { sample: texts[0] } : {}), ok: found === 1, note: found ? "" : "recall block does not hold the expected line" };
|
||||
},
|
||||
})),
|
||||
table(rows) {
|
||||
|
||||
+308
-26
@@ -1,61 +1,343 @@
|
||||
# F. Hook redirect (flooding calls denied or replaced)
|
||||
|
||||
Hooks run as the claude-code adapter. For WebFetch the body size is the size of the captured page the URL serves (the fixture); the real network is not used. The deny text is all the model gets; the follow-up call in the sandbox costs what group A or B shows for the same input.
|
||||
Each case here is a tool call that would put a large file, page or output into the chat.
|
||||
Without Context Mode the whole thing goes in. With Context Mode a hook steps in first.
|
||||
It sends the call to a context-mode tool, or it swaps the output for a short summary.
|
||||
|
||||
Run this group: `cd bench && node run.mjs f-hook-redirect`. Latest tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
Run this group: `cd bench && node run.mjs f-hook-redirect`. All tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
|
||||
## f-read-large-file
|
||||
|
||||
Read of a 46 KB log (denied, routed to ctx_execute)
|
||||
**Read of a 46 KB log (denied, routed to ctx_execute)**
|
||||
|
||||
- Command: `node run.mjs f-read-large-file`
|
||||
- Input: `fixtures/data/access.log`, 46216 B, sha256 6e4fa9285b3435ff5f1bb28938124737a0e39035a2f535003b69c46f9e5ff085
|
||||
**What you do:** Open a 46 KB log file with Read.
|
||||
|
||||
**Without Context Mode:** Read puts the whole file into the chat: 46,216 B, about 11,554 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
192.168.1.100 - - [23/Feb/2026:10:00:01 +0000] "GET /api/users HTTP/1.1" 200 892 209ms
|
||||
10.0.0.55 - - [23/Feb/2026:10:00:03 +0000] "GET /api/users/42 HTTP/1.1" 200 1234 138ms
|
||||
172.16.0.23 - - [23/Feb/2026:10:00:05 +0000] "GET /api/users/999 HTTP/1.1" 404 56 1ms
|
||||
192.168.1.45 - - [23/Feb/2026:10:00:07 +0000] "POST /api/auth/login HTTP/1.1" 200 3456 452ms
|
||||
10.0.1.12 - - [23/Feb/2026:10:00:09 +0000] "POST /api/auth/login HTTP/1.1" 401 123 92ms
|
||||
192.168.2.78 - - [23/Feb/2026:10:00:11 +0000] "POST /api/auth/register HTTP/1.1" 201 1234 533ms
|
||||
10.0.0.99 - - [23/Feb/2026:10:00:13 +0000] "POST /api/auth/register HTTP/1.1" 400 234 51ms
|
||||
172.16.1.34 - - [23/Feb/2026:10:00:15 +0000] "POST /api/auth/logout HTTP/1.1" 200 7890 69ms
|
||||
```
|
||||
|
||||
First 8 of 500 lines.
|
||||
|
||||
**With Context Mode:** The hook stops the call and tells the agent which context-mode tool to use. This is the whole reply. The agent gets 371 B, about 93 tokens. That keeps 99.2% of it out of the chat.
|
||||
|
||||
```text
|
||||
{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"context-mode: 46216-byte file, over the one-read limit. Run mcp__plugin_context-mode_context-mode__ctx_execute(language, code, file=\"/private/var/folders/df/nbmn_hp51n177rvbz8zh44sh0000gn/T/cm-bench-wSYFNy/project/data/access.log\") and print only the answer."}}
|
||||
```
|
||||
|
||||
**Tool:** hook redirect (PreToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=f-read-large-file)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs f-read-large-file
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/access.log](../fixtures/data/access.log), 46,216 B, sha256 6e4fa9285b3435ff5f1bb28938124737a0e39035a2f535003b69c46f9e5ff085. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## f-read-big-source
|
||||
|
||||
Read of a 61 KB source file (denied, routed to ctx_execute)
|
||||
**Read of a 61 KB source file (denied, routed to ctx_execute)**
|
||||
|
||||
- Command: `node run.mjs f-read-big-source`
|
||||
- Input: `fixtures/data/source-big.ts`, 61576 B, sha256 7b4ba6812418434b9c682875de2454668ed98f3e0791f9e2b528ac034ec6e725
|
||||
**What you do:** Open a 61 KB source file with Read.
|
||||
|
||||
**Without Context Mode:** Read puts the whole file into the chat: 61,576 B, about 15,394 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
// impl/01 §3, impl/00 §3.2, TECH-SPEC §11, DECISIONS-r9. Every constant lives here; no other module writes these literals.
|
||||
import type { AgentId } from "./agents.js";
|
||||
|
||||
export const SERVER_KEY = "context-mode"; // TECH-SPEC §3.8 rule 3
|
||||
export const TOOL_ORDER = Object.freeze(["ctx_execute","ctx_batch","ctx_index","ctx_search","ctx_resume","ctx_stats","ctx_doctor","ctx_upgrade","ctx_purge"] as ...
|
||||
/** D-HL-NAMES-1: a fixed hook text with each own tool name as the host calls it (prefix + name), by split/join. */
|
||||
export function prefixToolNames(text: string, prefix: string): string {
|
||||
if (prefix === "") return text;
|
||||
```
|
||||
|
||||
First 8 of 726 lines. Lines over 160 characters are cut.
|
||||
|
||||
**With Context Mode:** The hook stops the call and tells the agent which context-mode tool to use. This is the whole reply. The agent gets 374 B, about 94 tokens. That keeps 99.4% of it out of the chat.
|
||||
|
||||
```text
|
||||
{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"context-mode: 61576-byte file, over the one-read limit. Run mcp__plugin_context-mode_context-mode__ctx_execute(language, code, file=\"/private/var/folders/df/nbmn_hp51n177rvbz8zh44sh0000gn/T/cm-bench-o6o2Oo/project/data/source-big.ts\") and print only the answer."}}
|
||||
```
|
||||
|
||||
**Tool:** hook redirect (PreToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=f-read-big-source)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs f-read-big-source
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/source-big.ts](../fixtures/data/source-big.ts), 61,576 B, sha256 7b4ba6812418434b9c682875de2454668ed98f3e0791f9e2b528ac034ec6e725. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## f-read-small-file
|
||||
|
||||
Read of a small file (allowed: nothing to save)
|
||||
**Read of a small file (allowed: nothing to save)**
|
||||
|
||||
- Command: `node run.mjs f-read-small-file`
|
||||
- Input: `fixtures/data/SOURCE.md`, 1764 B, sha256 393bd16d6603959c06d2bbc8e1f7c0a61b0d66a034874e69f2dd6e1e0858e8af
|
||||
**What you do:** Open a small file with Read.
|
||||
|
||||
**Without Context Mode:** Read puts the whole file into the chat: 1,764 B, about 441 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
# Fixture source
|
||||
|
||||
Copied byte for byte from github.com/mksglu/context-mode at commit
|
||||
90af14e34bf35120c3310f7a75f54fa99d2cabba (origin/main):
|
||||
|
||||
- `tests/fixtures/*` (15 files) -> `bench/fixtures/data/`
|
||||
- `skills/context-mode/SKILL.md` (as `skill-main.md`, GS5 allows no other SKILL.md) and `skills/context-mode/references/{anti-patterns,patterns-javascript,patte ...
|
||||
```
|
||||
|
||||
First 8 of 24 lines. Lines over 160 characters are cut.
|
||||
|
||||
**With Context Mode:** The file is small, so the hook lets Read run as usual. The agent gets the file. The agent gets 1,764 B, about 441 tokens. Here the reply is a bit larger than the raw output: small outputs are cheap to read as they are.
|
||||
|
||||
```text
|
||||
# Fixture source
|
||||
|
||||
Copied byte for byte from github.com/mksglu/context-mode at commit
|
||||
90af14e34bf35120c3310f7a75f54fa99d2cabba (origin/main):
|
||||
|
||||
- `tests/fixtures/*` (15 files) -> `bench/fixtures/data/`
|
||||
- `skills/context-mode/SKILL.md` (as `skill-main.md`, GS5 allows no other SKILL.md) and `skills/context-mode/references/{anti-patterns,patterns-javascript,patterns-python,patterns-shell}.md` -> `bench ...
|
||||
|
||||
The skill files are inputs to two v1 index+search scenarios (tests/live-benchmark.ts).
|
||||
They are fixtures here, not v2 skills.
|
||||
|
||||
## Added for the bench suite (2026-10-31)
|
||||
```
|
||||
|
||||
First 12 of 24 lines. Lines over 200 characters are cut.
|
||||
|
||||
**Tool:** hook redirect (PreToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=f-read-small-file)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs f-read-small-file
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/SOURCE.md](../fixtures/data/SOURCE.md), 1,764 B, sha256 393bd16d6603959c06d2bbc8e1f7c0a61b0d66a034874e69f2dd6e1e0858e8af. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## f-webfetch
|
||||
|
||||
WebFetch of a docs page (denied, routed to ctx_index + ctx_search)
|
||||
**WebFetch of a docs page (denied, routed to ctx_index + ctx_search)**
|
||||
|
||||
- Command: `node run.mjs f-webfetch`
|
||||
- Input: `fixtures/data/sqlite-fts5-docs.html`, 215354 B, sha256 de3092630358518a6869bf047055b3938e18b476e3fbc54f4e2146d1e593497f
|
||||
**What you do:** Fetch the SQLite FTS5 docs page with WebFetch.
|
||||
|
||||
**Without Context Mode:** WebFetch puts the whole page into the chat: 215,354 B, about 53,839 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
<!DOCTYPE html>
|
||||
<html><head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<link href="sqlite.css" rel="stylesheet">
|
||||
<title>SQLite FTS5 Extension</title>
|
||||
<!-- path= -->
|
||||
</head>
|
||||
```
|
||||
|
||||
First 8 of 4,332 lines.
|
||||
|
||||
**With Context Mode:** The hook stops the call and tells the agent which context-mode tool to use. This is the whole reply. The agent gets 435 B, about 109 tokens. That keeps 99.8% of it out of the chat.
|
||||
|
||||
```text
|
||||
{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"context-mode: WebFetch sends its body into the conversation.\nRun it here instead; the full output is indexed and only the part that matches your intent comes back.\nTool: mcp__plugin_context-mode_context-mode__ctx_index, then mcp__plugin_context-mode_context-mode__ctx_search\n{\"url\":\"https://www.sqlite.org/fts5.html\"}"}}
|
||||
```
|
||||
|
||||
**Tool:** hook redirect (PreToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=f-webfetch)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs f-webfetch
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/sqlite-fts5-docs.html](../fixtures/data/sqlite-fts5-docs.html), 215,354 B, sha256 de3092630358518a6869bf047055b3938e18b476e3fbc54f4e2146d1e593497f. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## f-bash-dump-post
|
||||
|
||||
Bash dump of a 191 KB git log (PostToolUse replace)
|
||||
**Bash dump of a 191 KB git log (PostToolUse replace)**
|
||||
|
||||
- Command: `node run.mjs f-bash-dump-post`
|
||||
- Input: `fixtures/data/git-log-large.txt`, 191120 B, sha256 028317819bc1a93fcfbeeba2d5ffea829fe4c439e3889d688f76fbb11bb913ad
|
||||
**What you do:** Print a 191 KB git log with Bash.
|
||||
|
||||
**Without Context Mode:** The whole command output goes into the chat: 191,120 B, about 47,780 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
efe519b1 2026-10-31 ci: remove the temporary D5 proof workflow
|
||||
3afc09ed 2026-10-31 ci: temporary D5 proof 3, hard stop of the load loop, 40x (removed after the run)
|
||||
b49b870c 2026-10-31 ci: temporary D5 proof, print quiet-loop failures (removed after the run)
|
||||
9c84763a 2026-10-31 ci: temporary D5 proof loop (removed after the run)
|
||||
37a48049 2026-10-31 fix(doctor): D5 runs 3 to 9 hook/bare pairs, more only while over the bound (D-D5-MORE-PAIRS-1)
|
||||
0fed73b1 2026-10-31 ci: temporary D5 probe 3, estimators from raw walls (removed after the run)
|
||||
773f8b11 2026-10-31 ci: temporary D5 probe 2, pair count under load (removed after the run)
|
||||
1691b4cc 2026-10-31 ci: temporary D5 probe workflow (removed after the run)
|
||||
```
|
||||
|
||||
First 8 of 2,000 lines.
|
||||
|
||||
**With Context Mode:** The command runs, then the hook swaps its output for a short summary. The agent gets 204 B, about 51 tokens. That keeps 99.9% of it out of the chat.
|
||||
|
||||
```text
|
||||
00ecd0d7 2026-10-14 review: docs/v2/review/TEST-TRIAGE-r2.md
|
||||
|
||||
mcp__plugin_context-mode_context-mode__ctx_search({queries:["cat data/git-log-large.txt"], source:"s1"}) searches the whole output (191120 B).
|
||||
```
|
||||
|
||||
**Tool:** hook redirect (PostToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=f-bash-dump-post)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs f-bash-dump-post
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/git-log-large.txt](../fixtures/data/git-log-large.txt), 191,120 B, sha256 028317819bc1a93fcfbeeba2d5ffea829fe4c439e3889d688f76fbb11bb913ad. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## f-bash-curl-post
|
||||
|
||||
Bash curl of a 219 KB API payload (allowed before, replaced after)
|
||||
**Bash curl of a 219 KB API payload (allowed before, replaced after)**
|
||||
|
||||
- Command: `node run.mjs f-bash-curl-post`
|
||||
- Input: `fixtures/data/github-api-issues-large.json`, 219175 B, sha256 bd2bdb943de007b7bb57d4e4a53a01ad801cf57606a3228682b39d05eb8a5e16
|
||||
**What you do:** Fetch a 219 KB GitHub API reply with curl in Bash.
|
||||
|
||||
**Without Context Mode:** The whole command output goes into the chat: 219,175 B, about 54,794 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
[
|
||||
{
|
||||
"url": "https://api.github.com/repos/vercel/next.js/issues/101008",
|
||||
"repository_url": "https://api.github.com/repos/vercel/next.js",
|
||||
"labels_url": "https://api.github.com/repos/vercel/next.js/issues/101008/labels{/name}",
|
||||
"comments_url": "https://api.github.com/repos/vercel/next.js/issues/101008/comments",
|
||||
"events_url": "https://api.github.com/repos/vercel/next.js/issues/101008/events",
|
||||
"html_url": "https://github.com/vercel/next.js/pull/101008",
|
||||
```
|
||||
|
||||
First 8 of 3,432 lines.
|
||||
|
||||
**With Context Mode:** The command runs, then the hook swaps its output for a short summary. The agent gets 291 B, about 73 tokens. That keeps 99.9% of it out of the chat.
|
||||
|
||||
```text
|
||||
"push",
|
||||
"status",
|
||||
|
||||
"workflow_run"
|
||||
]
|
||||
},
|
||||
|
||||
"state_reason": null
|
||||
}
|
||||
]
|
||||
mcp__plugin_context-mode_context-mode__ctx_search({queries:["curl -s https://api.github.com/repos/vercel/next.js/issues?per_page=30"], source:"s1"}) searches the whole output (219175 B).
|
||||
```
|
||||
|
||||
**Tool:** hook redirect (PostToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=f-bash-curl-post)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs f-bash-curl-post
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/github-api-issues-large.json](../fixtures/data/github-api-issues-large.json), 219,175 B, sha256 bd2bdb943de007b7bb57d4e4a53a01ad801cf57606a3228682b39d05eb8a5e16. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## f-read-vite-config
|
||||
|
||||
Read of the 89 KB vite config source (denied, routed to ctx_execute)
|
||||
**Read of the 89 KB vite config source (denied, routed to ctx_execute)**
|
||||
|
||||
- Command: `node run.mjs f-read-vite-config`
|
||||
- Input: `fixtures/data/vite-config.ts`, 91362 B, sha256 65a62e65875835fbdd66ae3b0b1de9638dc1c046f9688422922a239ca72dce84
|
||||
**What you do:** Open the 89 KB vite config source with Read.
|
||||
|
||||
**Without Context Mode:** Read puts the whole file into the chat: 91,362 B, about 22,841 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
import crypto from 'node:crypto'
|
||||
import fs from 'node:fs'
|
||||
import fsp from 'node:fs/promises'
|
||||
import { createRequire } from 'node:module'
|
||||
import path from 'node:path'
|
||||
import { performance } from 'node:perf_hooks'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
import { inspect, isDeepStrictEqual, promisify } from 'node:util'
|
||||
```
|
||||
|
||||
First 8 of 2,930 lines.
|
||||
|
||||
**With Context Mode:** The hook stops the call and tells the agent which context-mode tool to use. This is the whole reply. The agent gets 375 B, about 94 tokens. That keeps 99.6% of it out of the chat.
|
||||
|
||||
```text
|
||||
{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"context-mode: 91362-byte file, over the one-read limit. Run mcp__plugin_context-mode_context-mode__ctx_execute(language, code, file=\"/private/var/folders/df/nbmn_hp51n177rvbz8zh44sh0000gn/T/cm-bench-3dp66j/project/data/vite-config.ts\") and print only the answer."}}
|
||||
```
|
||||
|
||||
**Tool:** hook redirect (PreToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=f-read-vite-config)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs f-read-vite-config
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/vite-config.ts](../fixtures/data/vite-config.ts), 91,362 B, sha256 65a62e65875835fbdd66ae3b0b1de9638dc1c046f9688422922a239ca72dce84. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## f-webfetch-vite-docs
|
||||
|
||||
WebFetch of the 265 KB Vite features guide (denied, routed to ctx_index + ctx_search)
|
||||
**WebFetch of the 265 KB Vite features guide (denied, routed to ctx_index + ctx_search)**
|
||||
|
||||
- Command: `node run.mjs f-webfetch-vite-docs`
|
||||
- Input: `fixtures/data/vite-docs-features.html`, 271731 B, sha256 1dca10c0a7b348c1b9ddb46733cfde706f46bee0554175716a415fe8609187c8
|
||||
**What you do:** Fetch the 265 KB Vite features guide with WebFetch.
|
||||
|
||||
**Without Context Mode:** WebFetch puts the whole page into the chat: 271,731 B, about 67,933 tokens.
|
||||
|
||||
It starts like this:
|
||||
|
||||
```text
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US" dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Features | Vite</title>
|
||||
<meta name="description" content="Next Generation Frontend Tooling">
|
||||
<meta name="generator" content="VitePress v2.0.0-alpha.20">
|
||||
```
|
||||
|
||||
First 8 of 224 lines.
|
||||
|
||||
**With Context Mode:** The hook stops the call and tells the agent which context-mode tool to use. This is the whole reply. The agent gets 439 B, about 110 tokens. That keeps 99.8% of it out of the chat.
|
||||
|
||||
```text
|
||||
{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"context-mode: WebFetch sends its body into the conversation.\nRun it here instead; the full output is indexed and only the part that matches your intent comes back.\nTool: mcp__plugin_context-mode_context-mode__ctx_index, then mcp__plugin_context-mode_context-mode__ctx_search\n{\"url\":\"https://vite.dev/guide/features.html\"}"}}
|
||||
```
|
||||
|
||||
**Tool:** hook redirect (PreToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=f-webfetch-vite-docs)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs f-webfetch-vite-docs
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/vite-docs-features.html](../fixtures/data/vite-docs-features.html), 271,731 B, sha256 1dca10c0a7b348c1b9ddb46733cfde706f46bee0554175716a415fe8609187c8. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
@@ -23,7 +23,7 @@ export default {
|
||||
id: c.id, title: c.title, inputs: [c.file], command: `node run.mjs ${c.id}`,
|
||||
async run({ bundle, sb }) {
|
||||
const raw = read(c.file);
|
||||
let h, ctxBytes, decision, note = "";
|
||||
let h, ctxBytes, decision, reply, note = "";
|
||||
if (c.kind === "read") { h = runHook(bundle, sb, "claude-code", pre(sb, "Read", { file_path: sb.project + "/data/" + c.file })); }
|
||||
else if (c.kind === "webfetch") { h = runHook(bundle, sb, "claude-code", pre(sb, "WebFetch", { url: c.url, prompt: "summarize" })); }
|
||||
else { h = runHook(bundle, sb, "claude-code", postToolUse(sb, raw, { command: c.command ?? "cat data/" + c.file })); }
|
||||
@@ -31,15 +31,15 @@ export default {
|
||||
if (c.kind === "post") {
|
||||
const s = seenAfterHook(raw, h);
|
||||
if (s.error) return { error: s.error };
|
||||
ctxBytes = bytes(s.seen); decision = s.replaced ? 1 : 0;
|
||||
ctxBytes = bytes(s.seen); reply = s.seen; decision = s.replaced ? 1 : 0;
|
||||
const pre2 = runHook(bundle, sb, "claude-code", pre(sb, "Bash", { command: c.command ?? "cat data/" + c.file }));
|
||||
note = "PreToolUse " + (pre2.stdout.trim() === "" ? "allowed" : "answered");
|
||||
} else {
|
||||
const denied = h.stdout.includes('"deny"');
|
||||
ctxBytes = denied ? bytes(h.stdout) : bytes(raw); decision = denied ? 1 : 0;
|
||||
ctxBytes = denied ? bytes(h.stdout) : bytes(raw); reply = denied ? h.stdout : raw; decision = denied ? 1 : 0;
|
||||
}
|
||||
const expectDecision = c.id === "f-read-small-file" ? 0 : 1;
|
||||
return { metrics: { raw_bytes: bytes(raw), ctx_bytes: ctxBytes, decision, hook_ms: h.ms }, ok: decision === expectDecision, note };
|
||||
return { metrics: { raw_bytes: bytes(raw), ctx_bytes: ctxBytes, decision, hook_ms: h.ms }, reply, ok: decision === expectDecision, note };
|
||||
},
|
||||
})),
|
||||
table(rows) {
|
||||
|
||||
+261
-57
@@ -1,112 +1,316 @@
|
||||
# G. Overhead (hook latency, search latency, index time, full session)
|
||||
|
||||
Each hook row is the median of 5 hook processes inside one run, a fresh process each (no daemon), minus the median of 5 bare `node -e ""` starts. The small payload is an allowed command, so this is the fixed cost of every tool call.
|
||||
Each case here shows what Context Mode costs: the time a hook adds to each tool call, search time and index time.
|
||||
The hook cases compare a hook process with a bare Node start, for each of the 10 agents.
|
||||
The last case adds up a full debugging session: what went into the chat and what stayed out.
|
||||
|
||||
Run this group: `cd bench && node run.mjs g-overhead`. Latest tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
Run this group: `cd bench && node run.mjs g-overhead`. All tables: [results/2026-11-01-darwin-arm64.md](../results/2026-11-01-darwin-arm64.md).
|
||||
|
||||
## g-hook-claude-code
|
||||
|
||||
Hook latency, claude-code adapter (PostToolUse, small payload)
|
||||
**Hook latency, claude-code adapter (PostToolUse, small payload)**
|
||||
|
||||
- Command: `node run.mjs g-hook-claude-code`
|
||||
- Input: none (small payloads built in the scenario)
|
||||
**What you do:** Run any tool call in Claude Code. Its hook runs each time.
|
||||
|
||||
**Without Context Mode:** a bare Node start takes 32.0 ms.
|
||||
|
||||
**With Context Mode:** the Claude Code hook takes 43.8 ms, so it adds about 12.3 ms to each tool call. Each number is the median of 5 hook runs.
|
||||
|
||||
**Tool:** hook (PostToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-hook-claude-code)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-hook-claude-code
|
||||
```
|
||||
|
||||
<sub>Proof: input: small payloads built in the scenario. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-hook-codex
|
||||
|
||||
Hook latency, codex adapter (PreToolUse, small payload)
|
||||
**Hook latency, codex adapter (PreToolUse, small payload)**
|
||||
|
||||
- Command: `node run.mjs g-hook-codex`
|
||||
- Input: none (small payloads built in the scenario)
|
||||
**What you do:** Run any tool call in Codex. Its hook runs each time.
|
||||
|
||||
**Without Context Mode:** a bare Node start takes 32.5 ms.
|
||||
|
||||
**With Context Mode:** the Codex hook takes 41.6 ms, so it adds about 8.1 ms to each tool call. Each number is the median of 5 hook runs.
|
||||
|
||||
**Tool:** hook (PreToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-hook-codex)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-hook-codex
|
||||
```
|
||||
|
||||
<sub>Proof: input: small payloads built in the scenario. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-hook-gemini
|
||||
|
||||
Hook latency, gemini adapter (AfterTool, small payload)
|
||||
**Hook latency, gemini adapter (AfterTool, small payload)**
|
||||
|
||||
- Command: `node run.mjs g-hook-gemini`
|
||||
- Input: none (small payloads built in the scenario)
|
||||
**What you do:** Run any tool call in Gemini CLI. Its hook runs each time.
|
||||
|
||||
**Without Context Mode:** a bare Node start takes 34.7 ms.
|
||||
|
||||
**With Context Mode:** the Gemini CLI hook takes 43.8 ms, so it adds about 9.2 ms to each tool call. Each number is the median of 5 hook runs.
|
||||
|
||||
**Tool:** hook (AfterTool). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-hook-gemini)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-hook-gemini
|
||||
```
|
||||
|
||||
<sub>Proof: input: small payloads built in the scenario. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-hook-qwen
|
||||
|
||||
Hook latency, qwen adapter (PreToolUse, small payload)
|
||||
**Hook latency, qwen adapter (PreToolUse, small payload)**
|
||||
|
||||
- Command: `node run.mjs g-hook-qwen`
|
||||
- Input: none (small payloads built in the scenario)
|
||||
**What you do:** Run any tool call in Qwen Code. Its hook runs each time.
|
||||
|
||||
**Without Context Mode:** a bare Node start takes 31.1 ms.
|
||||
|
||||
**With Context Mode:** the Qwen Code hook takes 39.9 ms, so it adds about 8.0 ms to each tool call. Each number is the median of 5 hook runs.
|
||||
|
||||
**Tool:** hook (PreToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-hook-qwen)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-hook-qwen
|
||||
```
|
||||
|
||||
<sub>Proof: input: small payloads built in the scenario. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-hook-copilot-cli
|
||||
|
||||
Hook latency, copilot-cli adapter (postToolUse, small payload)
|
||||
**Hook latency, copilot-cli adapter (postToolUse, small payload)**
|
||||
|
||||
- Command: `node run.mjs g-hook-copilot-cli`
|
||||
- Input: none (small payloads built in the scenario)
|
||||
**What you do:** Run any tool call in Copilot CLI. Its hook runs each time.
|
||||
|
||||
**Without Context Mode:** a bare Node start takes 31.0 ms.
|
||||
|
||||
**With Context Mode:** the Copilot CLI hook takes 39.2 ms, so it adds about 8.2 ms to each tool call. Each number is the median of 5 hook runs.
|
||||
|
||||
**Tool:** hook (postToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-hook-copilot-cli)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-hook-copilot-cli
|
||||
```
|
||||
|
||||
<sub>Proof: input: small payloads built in the scenario. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-hook-vscode
|
||||
|
||||
Hook latency, vscode adapter (PreToolUse, small payload)
|
||||
**Hook latency, vscode adapter (PreToolUse, small payload)**
|
||||
|
||||
- Command: `node run.mjs g-hook-vscode`
|
||||
- Input: none (small payloads built in the scenario)
|
||||
**What you do:** Run any tool call in VS Code. Its hook runs each time.
|
||||
|
||||
**Without Context Mode:** a bare Node start takes 30.6 ms.
|
||||
|
||||
**With Context Mode:** the VS Code hook takes 38.8 ms, so it adds about 8.8 ms to each tool call. Each number is the median of 5 hook runs.
|
||||
|
||||
**Tool:** hook (PreToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-hook-vscode)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-hook-vscode
|
||||
```
|
||||
|
||||
<sub>Proof: input: small payloads built in the scenario. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-hook-kiro
|
||||
|
||||
Hook latency, kiro adapter (PreToolUse, small payload)
|
||||
**Hook latency, kiro adapter (PreToolUse, small payload)**
|
||||
|
||||
- Command: `node run.mjs g-hook-kiro`
|
||||
- Input: none (small payloads built in the scenario)
|
||||
**What you do:** Run any tool call in Kiro. Its hook runs each time.
|
||||
|
||||
**Without Context Mode:** a bare Node start takes 31.6 ms.
|
||||
|
||||
**With Context Mode:** the Kiro hook takes 38.8 ms, so it adds about 7.5 ms to each tool call. Each number is the median of 5 hook runs.
|
||||
|
||||
**Tool:** hook (PreToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-hook-kiro)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-hook-kiro
|
||||
```
|
||||
|
||||
<sub>Proof: input: small payloads built in the scenario. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-hook-zcode
|
||||
|
||||
Hook latency, zcode adapter (PreToolUse, small payload)
|
||||
**Hook latency, zcode adapter (PreToolUse, small payload)**
|
||||
|
||||
- Command: `node run.mjs g-hook-zcode`
|
||||
- Input: none (small payloads built in the scenario)
|
||||
**What you do:** Run any tool call in ZCode. Its hook runs each time.
|
||||
|
||||
**Without Context Mode:** a bare Node start takes 31.7 ms.
|
||||
|
||||
**With Context Mode:** the ZCode hook takes 40.1 ms, so it adds about 7.6 ms to each tool call. Each number is the median of 5 hook runs.
|
||||
|
||||
**Tool:** hook (PreToolUse). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-hook-zcode)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-hook-zcode
|
||||
```
|
||||
|
||||
<sub>Proof: input: small payloads built in the scenario. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-hook-pi
|
||||
|
||||
Hook latency, pi adapter (tool_result, small payload)
|
||||
**Hook latency, pi adapter (tool_result, small payload)**
|
||||
|
||||
- Command: `node run.mjs g-hook-pi`
|
||||
- Input: none (small payloads built in the scenario)
|
||||
**What you do:** Run any tool call in Pi. Its hook runs each time.
|
||||
|
||||
**Without Context Mode:** a bare Node start takes 30.6 ms.
|
||||
|
||||
**With Context Mode:** the Pi hook takes 39.4 ms, so it adds about 8.6 ms to each tool call. Each number is the median of 5 hook runs.
|
||||
|
||||
**Tool:** hook (tool_result). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-hook-pi)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-hook-pi
|
||||
```
|
||||
|
||||
<sub>Proof: input: small payloads built in the scenario. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-hook-opencode
|
||||
|
||||
Hook latency, opencode adapter (execute.before, small payload)
|
||||
**Hook latency, opencode adapter (execute.before, small payload)**
|
||||
|
||||
- Command: `node run.mjs g-hook-opencode`
|
||||
- Input: none (small payloads built in the scenario)
|
||||
**What you do:** Run any tool call in OpenCode. Its hook runs each time.
|
||||
|
||||
**Without Context Mode:** a bare Node start takes 28.4 ms.
|
||||
|
||||
**With Context Mode:** the OpenCode hook takes 35.7 ms, so it adds about 7.6 ms to each tool call. Each number is the median of 5 hook runs.
|
||||
|
||||
**Tool:** hook (execute.before). [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-hook-opencode)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-hook-opencode
|
||||
```
|
||||
|
||||
<sub>Proof: input: small payloads built in the scenario. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-search-latency
|
||||
|
||||
ctx_search latency (20 queries over 8 indexed fixtures)
|
||||
**ctx_search latency (20 queries over 8 indexed fixtures)**
|
||||
|
||||
- Command: `node run.mjs g-search-latency`
|
||||
- Input: `fixtures/data/test-output.txt`, 6185 B, sha256 bc0fd4973ba5a401025c7979d05183f6c7f2a5d7b0f4d4d023b4e933f2e06b0d
|
||||
- Input: `fixtures/data/tsc-errors.txt`, 5023 B, sha256 3ebc05d31d9ac68d3b950d05546f29b01586322660c38c8c94c4447c60cc359f
|
||||
- Input: `fixtures/data/build-output.txt`, 6594 B, sha256 0e6a2387c978b36d37a4a3bc9030d0d0467ad43b8acd99d4a85a607fdc2e885e
|
||||
- Input: `fixtures/data/git-log.txt`, 11895 B, sha256 d767dbdb990c98070c617a9c8d2263d267c596d3ecfcda4cc0a79743815e45ae
|
||||
- Input: `fixtures/data/access.log`, 46216 B, sha256 6e4fa9285b3435ff5f1bb28938124737a0e39035a2f535003b69c46f9e5ff085
|
||||
- Input: `fixtures/data/github-issues.json`, 60310 B, sha256 2765ceace4b127b15ece4309eb1c91279f85b6107562a498a551657411cb182b
|
||||
- Input: `fixtures/data/analytics.csv`, 87517 B, sha256 6dae0fc8f09d26e767e58ab0ba2a53aaaa014ddc7a2027aa3ca2f80111a19e54
|
||||
- Input: `fixtures/data/playwright-snapshot.txt`, 57521 B, sha256 ff62ad78ab7fff91de94fb3e5a4c38cd4b030aa01c4cdc3b305705e46dad1bec
|
||||
**What you do:** Search 8 indexed tool outputs 20 times.
|
||||
|
||||
**Without Context Mode:** the agent reads the 8 outputs in full: 281,261 B, about 70,315 tokens.
|
||||
|
||||
**With Context Mode:** the 8 outputs go into a local search index. A search takes 1.6 ms (the slowest 6.7 ms), and a reply is about 3,664 B. The last reply:
|
||||
|
||||
````text
|
||||
Query "export":
|
||||
playwright-snapshot.txt #4: ```yaml
|
||||
- generic [ref=e130]:
|
||||
- text: 13 points by
|
||||
- link "matt_d" [ref=e131] [cursor=pointer]:
|
||||
- /url: user?id=matt_d
|
||||
- generic "2026-02-18T21:10:09 1771449009" [ref=e132]:
|
||||
- link "1 hour ago" [ref=e133] [cursor=pointer]:
|
||||
- /url: item?id=47066446
|
||||
- text: "|"
|
||||
- link "hide" [ref=e134] [cursor=pointer]:
|
||||
- /url: hide?id=47066446&goto=news
|
||||
````
|
||||
|
||||
First 12 of 57 lines.
|
||||
|
||||
**Tool:** ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-search-latency)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-search-latency
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/test-output.txt](../fixtures/data/test-output.txt), 6,185 B, sha256 bc0fd4973ba5a401025c7979d05183f6c7f2a5d7b0f4d4d023b4e933f2e06b0d; input [fixtures/data/tsc-errors.txt](../fixtures/data/tsc-errors.txt), 5,023 B, sha256 3ebc05d31d9ac68d3b950d05546f29b01586322660c38c8c94c4447c60cc359f; input [fixtures/data/build-output.txt](../fixtures/data/build-output.txt), 6,594 B, sha256 0e6a2387c978b36d37a4a3bc9030d0d0467ad43b8acd99d4a85a607fdc2e885e; input [fixtures/data/git-log.txt](../fixtures/data/git-log.txt), 11,895 B, sha256 d767dbdb990c98070c617a9c8d2263d267c596d3ecfcda4cc0a79743815e45ae; input [fixtures/data/access.log](../fixtures/data/access.log), 46,216 B, sha256 6e4fa9285b3435ff5f1bb28938124737a0e39035a2f535003b69c46f9e5ff085; input [fixtures/data/github-issues.json](../fixtures/data/github-issues.json), 60,310 B, sha256 2765ceace4b127b15ece4309eb1c91279f85b6107562a498a551657411cb182b; input [fixtures/data/analytics.csv](../fixtures/data/analytics.csv), 87,517 B, sha256 6dae0fc8f09d26e767e58ab0ba2a53aaaa014ddc7a2027aa3ca2f80111a19e54; input [fixtures/data/playwright-snapshot.txt](../fixtures/data/playwright-snapshot.txt), 57,521 B, sha256 ff62ad78ab7fff91de94fb3e5a4c38cd4b030aa01c4cdc3b305705e46dad1bec. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-index-per-mb
|
||||
|
||||
ctx_index time per MB (3 real files, 0.6 MB)
|
||||
**ctx_index time per MB (3 real files, 0.6 MB)**
|
||||
|
||||
- Command: `node run.mjs g-index-per-mb`
|
||||
- Input: `fixtures/data/github-api-issues-large.json`, 219175 B, sha256 bd2bdb943de007b7bb57d4e4a53a01ad801cf57606a3228682b39d05eb8a5e16
|
||||
- Input: `fixtures/data/git-log-large.txt`, 191120 B, sha256 028317819bc1a93fcfbeeba2d5ffea829fe4c439e3889d688f76fbb11bb913ad
|
||||
- Input: `fixtures/data/sqlite-fts5-docs.html`, 215354 B, sha256 de3092630358518a6869bf047055b3938e18b476e3fbc54f4e2146d1e593497f
|
||||
**What you do:** Put 0.6 MB of real files into the search index.
|
||||
|
||||
**Without Context Mode:** the agent reads the 3 files in full: 625,649 B, about 156,412 tokens.
|
||||
|
||||
**With Context Mode:** the files go into a local search index once. That takes 89 ms, or 150 ms per MB.
|
||||
|
||||
**Tool:** ctx_index. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-index-per-mb)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-index-per-mb
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/github-api-issues-large.json](../fixtures/data/github-api-issues-large.json), 219,175 B, sha256 bd2bdb943de007b7bb57d4e4a53a01ad801cf57606a3228682b39d05eb8a5e16; input [fixtures/data/git-log-large.txt](../fixtures/data/git-log-large.txt), 191,120 B, sha256 028317819bc1a93fcfbeeba2d5ffea829fe4c439e3889d688f76fbb11bb913ad; input [fixtures/data/sqlite-fts5-docs.html](../fixtures/data/sqlite-fts5-docs.html), 215,354 B, sha256 de3092630358518a6869bf047055b3938e18b476e3fbc54f4e2146d1e593497f. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
|
||||
## g-session-total
|
||||
|
||||
Full debugging session: 8 outputs through the hooks, 3 follow-up searches
|
||||
**Full debugging session: 8 outputs through the hooks, 3 follow-up searches**
|
||||
|
||||
- Command: `node run.mjs g-session-total`
|
||||
- Input: `fixtures/data/test-output.txt`, 6185 B, sha256 bc0fd4973ba5a401025c7979d05183f6c7f2a5d7b0f4d4d023b4e933f2e06b0d
|
||||
- Input: `fixtures/data/tsc-errors.txt`, 5023 B, sha256 3ebc05d31d9ac68d3b950d05546f29b01586322660c38c8c94c4447c60cc359f
|
||||
- Input: `fixtures/data/build-output.txt`, 6594 B, sha256 0e6a2387c978b36d37a4a3bc9030d0d0467ad43b8acd99d4a85a607fdc2e885e
|
||||
- Input: `fixtures/data/git-log.txt`, 11895 B, sha256 d767dbdb990c98070c617a9c8d2263d267c596d3ecfcda4cc0a79743815e45ae
|
||||
- Input: `fixtures/data/access.log`, 46216 B, sha256 6e4fa9285b3435ff5f1bb28938124737a0e39035a2f535003b69c46f9e5ff085
|
||||
- Input: `fixtures/data/github-issues.json`, 60310 B, sha256 2765ceace4b127b15ece4309eb1c91279f85b6107562a498a551657411cb182b
|
||||
- Input: `fixtures/data/analytics.csv`, 87517 B, sha256 6dae0fc8f09d26e767e58ab0ba2a53aaaa014ddc7a2027aa3ca2f80111a19e54
|
||||
- Input: `fixtures/data/playwright-snapshot.txt`, 57521 B, sha256 ff62ad78ab7fff91de94fb3e5a4c38cd4b030aa01c4cdc3b305705e46dad1bec
|
||||
**What you do:** Debug for a full session: 8 tool outputs, then 3 searches.
|
||||
|
||||
**Without Context Mode:** All outputs go into the chat: 281,261 B, about 70,315 tokens.
|
||||
|
||||
The first of the 8 inputs starts like this:
|
||||
|
||||
```text
|
||||
RUN v2.1.8 /Users/mert/projects/my-saas-app
|
||||
|
||||
✓ src/components/Button.test.tsx (3 tests) 45ms
|
||||
✓ renders correctly 12ms
|
||||
✓ handles click events 18ms
|
||||
✓ applies variant classes 15ms
|
||||
✓ src/components/Avatar.test.tsx (3 tests) 38ms
|
||||
✓ renders with image 14ms
|
||||
```
|
||||
|
||||
First 8 of 168 lines.
|
||||
|
||||
**With Context Mode:** The hooks swap each output for a short summary (1,305 B in total). 3 searches bring back what the agent needs (1,961 B). Below are the 3 search replies. The agent gets 3,266 B, about 817 tokens. That keeps 98.8% of it out of the chat.
|
||||
|
||||
```text
|
||||
Query "failed tests":
|
||||
Bash:cat data/test-output.txt#toolu_bench_001 #157: Tests 4 failed | 108 passed (112)
|
||||
Bash:cat data/test-output.txt#toolu_bench_001 #156: Test Files 4 failed | 26 passed (30)
|
||||
Bash:cat data/test-output.txt#toolu_bench_001 #9: ✓ src/components/Card.test.tsx (4 tests) 52ms
|
||||
More: ctx_search({queries:["failed tests"], scope:"session", offset:3})
|
||||
Query "TS2339 property":
|
||||
Bash:cat data/tsc-errors.txt#toolu_bench_002 #1: src/components/UserList.tsx(45,8): error TS2339: Property 'fullName' does not exist on type 'User'.
|
||||
Bash:cat data/tsc-errors.txt#toolu_bench_002 #23: src/lib/auth.ts(41,18): error TS2339: Property 'accessToken' does not exist on type 'JWT'.
|
||||
Bash:cat data/tsc-errors.txt#toolu_bench_002 #32: src/utils/helpers.ts(71,14): error TS2339: Property 'trim' does not exist on type 'number'.
|
||||
Bash:cat data/tsc-errors.txt#toolu_bench_002 #8: src/components/Dashboard.tsx(34,19): error TS2339: Property 'metrics' does not exist on type 'DashboardData'.
|
||||
Bash:cat data/tsc-errors.txt#toolu_bench_002 #37: src/lib/database.ts(42,9): error TS2339: Property 'transaction' does not exist on type 'PrismaClient'.
|
||||
More: ctx_search({queries:["TS2339 property"], scope:"session", offset:5})
|
||||
```
|
||||
|
||||
First 12 of 19 lines.
|
||||
|
||||
**Tool:** hooks + ctx_search. [How it works](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=g-session-total)
|
||||
|
||||
**Rerun it yourself:**
|
||||
|
||||
```sh
|
||||
cd bench && node run.mjs g-session-total
|
||||
```
|
||||
|
||||
<sub>Proof: input [fixtures/data/test-output.txt](../fixtures/data/test-output.txt), 6,185 B, sha256 bc0fd4973ba5a401025c7979d05183f6c7f2a5d7b0f4d4d023b4e933f2e06b0d; input [fixtures/data/tsc-errors.txt](../fixtures/data/tsc-errors.txt), 5,023 B, sha256 3ebc05d31d9ac68d3b950d05546f29b01586322660c38c8c94c4447c60cc359f; input [fixtures/data/build-output.txt](../fixtures/data/build-output.txt), 6,594 B, sha256 0e6a2387c978b36d37a4a3bc9030d0d0467ad43b8acd99d4a85a607fdc2e885e; input [fixtures/data/git-log.txt](../fixtures/data/git-log.txt), 11,895 B, sha256 d767dbdb990c98070c617a9c8d2263d267c596d3ecfcda4cc0a79743815e45ae; input [fixtures/data/access.log](../fixtures/data/access.log), 46,216 B, sha256 6e4fa9285b3435ff5f1bb28938124737a0e39035a2f535003b69c46f9e5ff085; input [fixtures/data/github-issues.json](../fixtures/data/github-issues.json), 60,310 B, sha256 2765ceace4b127b15ece4309eb1c91279f85b6107562a498a551657411cb182b; input [fixtures/data/analytics.csv](../fixtures/data/analytics.csv), 87,517 B, sha256 6dae0fc8f09d26e767e58ab0ba2a53aaaa014ddc7a2027aa3ca2f80111a19e54; input [fixtures/data/playwright-snapshot.txt](../fixtures/data/playwright-snapshot.txt), 57,521 B, sha256 ff62ad78ab7fff91de94fb3e5a4c38cd4b030aa01c4cdc3b305705e46dad1bec. Numbers: median of 5 runs in [results/2026-11-01-darwin-arm64.json](../results/2026-11-01-darwin-arm64.json).</sub>
|
||||
@@ -30,10 +30,10 @@ export default {
|
||||
async run({ client }) {
|
||||
for (const f of SESSION) { const r = await client.call("ctx_index", { content: read(f), source: f }); if (r.error || r.isError) return { error: r.error ?? r.text }; }
|
||||
const qs = ["failed tests", "TS2339", "build warnings", "status 500", "revert", "label bug", "sessions", "button", "error", "cache", "timeout", "import", "commit", "page", "request", "login", "price", "user", "route", "export"];
|
||||
const ms = [], by = [];
|
||||
for (const q of qs) { const r = await client.call("ctx_search", { queries: [q] }); if (r.error || r.isError) return { error: r.error ?? r.text }; ms.push(r.ms); by.push(bytes(r.text)); }
|
||||
const ms = [], by = []; let last = "";
|
||||
for (const q of qs) { const r = await client.call("ctx_search", { queries: [q] }); if (r.error || r.isError) return { error: r.error ?? r.text }; ms.push(r.ms); by.push(bytes(r.text)); last = r.text; }
|
||||
const s = stats(ms);
|
||||
return { metrics: { search_ms_median: s.median, search_ms_max: s.max, reply_bytes_median: stats(by).median }, ok: true };
|
||||
return { metrics: { search_ms_median: s.median, search_ms_max: s.max, reply_bytes_median: stats(by).median }, reply: last, ok: true };
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -57,9 +57,9 @@ export default {
|
||||
const s = seenAfterHook(t, h); if (s.error) return { error: s.error };
|
||||
seen += bytes(s.seen); hookMs += h.ms;
|
||||
}
|
||||
let follow = 0;
|
||||
for (const q of ["failed tests", "TS2339 property", "status 500"]) { const r = await client.call("ctx_search", { queries: [q], scope: "session" }, session); if (r.error || r.isError) return { error: r.error ?? r.text }; follow += bytes(r.text); }
|
||||
return { metrics: { raw_bytes: raw, ctx_bytes: seen + follow, hook_left_bytes: seen, follow_up_bytes: follow, hook_ms_total: hookMs }, ok: true };
|
||||
let follow = 0; const replies = [];
|
||||
for (const q of ["failed tests", "TS2339 property", "status 500"]) { const r = await client.call("ctx_search", { queries: [q], scope: "session" }, session); if (r.error || r.isError) return { error: r.error ?? r.text }; follow += bytes(r.text); replies.push(r.text); }
|
||||
return { metrics: { raw_bytes: raw, ctx_bytes: seen + follow, hook_left_bytes: seen, follow_up_bytes: follow, hook_ms_total: hookMs }, reply: replies.join("\n"), ok: true };
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
{
|
||||
"date": "2026-11-03",
|
||||
"replies": {
|
||||
"a-context7-react-docs": {
|
||||
"reply": "Context7 — React Docs Summary\nLines: 162 | Sections: 4 | Code blocks: 5\nAPIs mentioned: useLayoutEffect, useEffect, useChatRoom\nKey topics:\n - Cleanup functions\n - Dependency arrays\n - Data fetching patterns\nTotal size: 6075 chars → 5 examples extracted\n"
|
||||
},
|
||||
"a-context7-nextjs-docs": {
|
||||
"reply": "Context7 — Next.js App Router Summary\nLines: 224 | Sections: 5 | Code blocks: 9\nData fetching patterns: async components, caching strategies, ISR/revalidation, no-cache SSR\nMigration from Pages Router: Yes\nTotal size: 6658 chars → summary above\n"
|
||||
},
|
||||
"a-context7-tailwind-docs": {
|
||||
"reply": "Context7 — Tailwind CSS Summary\nLines: 88 | Code blocks: 6\nTotal classes found: 56\nResponsive variants: 8 → md, lg, sm\nFlex/Grid classes: 13\nTotal size: 4102 chars → summary above\n"
|
||||
},
|
||||
"a-playwright-snapshot": {
|
||||
"reply": "Playwright — Page Snapshot Summary\nLines: 1044 | DOM refs: 647\nLinks: 219 | Buttons: 0 | Text nodes: 162\nStories found: 30\nTop 5:\n 1. Hacker News\n 2. I built Timeframe, our family e-paper dashboard\n 3. hawksley.org\n 4. saeedesmaili\n 5. 8 hours ago\nRaw snapshot: 57515 chars → summary above\n"
|
||||
},
|
||||
"a-playwright-network": {
|
||||
"reply": "Playwright — Network Summary\nRequests: 7\nStatus: https://news.ycombinator.com/:1, https://news.ycombinator.com/news.css?u2KnqsTjKhcQjbDNi8PU:1, https://news.ycombinator.com/y18.svg:2, https://news.ycombinator.com/s.gif:1, https://news.ycombinator.com/hn.js?u2KnqsTjKhcQjbDNi8PU:1, https://news.ycombinator.com/triangle.svg:1\nTypes: doc:1, other:6\n"
|
||||
},
|
||||
"a-github-prs": {
|
||||
"reply": "GitHub — PR List Summary\nPRs: 5 | Repo: vercel/next.js\n #90342 docs: add middleware overview guide\n by youngsyre26 | +59 -0 | 1 files | labels: Documentation\n #90322 Identify actionable bugs and technical debt in core packages\n by poria-lang | +0 -0 | 0 files | labels: none\n #90316 Add PR tarball install note to stats comment\n by devjiwonchoi | +20 -0 | 1 files | labels: created-by: Next.js team\n #90312 Fix route.replace crash with --debug-build-paths\n by devjiwonchoi | +4 -1 | 1 files | labels: type: next, created-by: Next.js team\n #90290 fix: handle file:// URLs in cacheHandler for ESM configs\n by TheAbMehta | +83 -20 | 5 files | labels: type: next, tests\nTotal: +166 -21 across 8 files\n"
|
||||
},
|
||||
"a-github-issues": {
|
||||
"reply": "GitHub — Issues Summary\nIssues: 20 | Repo: facebook/react\n\nBy label:\n Status: Unconfirmed: 19\n Type: Bug: 7\n Component: Developer Tools: 3\n Component: Suspense: 1\n\nRecent issues:\n #35855 Bug: ViewTransition onExit cleanup not called on unmount\n by rickhanlonii [Status: Unconfirmed]\n #35854 [Compiler Bug]: NaN in dependency list of useMemo always cau\n by jugglingcats [Type: Bug, Status: Unconfirmed]\n #35821 Bug: useDeferredValue gets stuck with a stale value\n by gaearon [Type: Bug, Component: Suspense]\n #35818 [DevTools Bug] Could not find node with id \"3119\" in commit \n by stella-yessensei [Type: Bug, Status: Unconfirmed, Component: Developer Tools]\n #35814 Bug: Memory leak in attribute-behavior fixture - wrong varia\n by AmitSingh-5600 [Status: Unconfirmed]\n #35813 [eslint-plugin-react-hooks] Bug: `react-hooks/refs` rule rep\n by ej612 [Status: Unconfirmed]\n #35793 Bug: Malformed `private` field in react-devtools-fusebox pac\n by MohammadBinAftab [Status: Unconfirmed]\n #35762 [Compiler Bug]: Closure dependency cache keys eagerly evalua\n by MatiasCiccone [Type: Bug, Status: Unconfirmed]\n"
|
||||
},
|
||||
"a-test-output": {
|
||||
"reply": "vitest — Test Results Summary\nSuites: 26 passed, 4 failed\nTests: 132 passed, 8 failed\nFailures:\n ✗ src/components/UserList.test.tsx (4 tests) 234ms\n ✗ handles empty state 156ms\n ✗ src/components/DataGrid.test.tsx (5 tests) 345ms\n ✗ filters with complex queries 198ms\n ✗ src/api/trpc/routers/user.test.ts (5 tests) 456ms\n"
|
||||
},
|
||||
"a-tsc-errors": {
|
||||
"reply": "tsc — Error Summary\nErrors: 50 in 8 files\nBy file:\n src/components/UserList.tsx: 7\n src/components/Dashboard.tsx: 7\n src/api/trpc/routers/user.ts: 7\n src/lib/auth.ts: 7\n src/utils/helpers.ts: 7\n src/lib/database.ts: 7\n src/config/config.ts: 4\n src/types/types.ts: 4\nTop codes:\n TS2345: 7\n TS2532: 7\n TS2322: 7\n TS2339: 6\n TS2554: 5\n"
|
||||
},
|
||||
"a-build-output": {
|
||||
"reply": "next build — Summary\nLines: 123 | Routes: 2 | Warnings: 12 | Errors: 5\nError lines:\n ✓ Compiled src/app/error.tsx (52ms)\n ERROR in src/api/trpc/routers/user.ts(45,12): TS2345: Argument of type 'string' is not assignable to parameter of type 'UserRole'.\n ERROR in src/middleware.ts(23,8): TS2345: Argument of type '{ callbackUrl: string; }' is not assignable to parameter of type 'URLSearchParams'.\n"
|
||||
},
|
||||
"a-mcp-tools": {
|
||||
"reply": "MCP — Tools Discovery Summary\nTotal tools: 40\nCategories: search:2, read:1, write:1, edit:1, list:1, run:3, git:5, lint:1, format:1, typecheck:1, deploy:1, database:2, create:2, find:2, get:1, install:1, uninstall:1, view:1, open:1, take:1, check:2, generate:2, analyze:1, manage:1, start:1, stop:1, docker:1, rename:1\n\nTool signatures:\n search_codebase(pattern, path?, fileType?)\n read_file(path, startLine?, endLine?)\n write_file(path, content)\n edit_file(path, oldText, newText)\n list_directory(path, recursive?, maxDepth?)\n run_command(command, cwd?, timeout?)\n run_tests(testPath?, filter?, watch?, coverage?)\n git_status(short?)\n git_diff(path?, staged?, base?)\n git_log(maxCount?, oneline?, author?, since?)\n ... +30 more\n"
|
||||
},
|
||||
"a-access": {
|
||||
"reply": "nginx — Access Log Summary\nRequests: 500 | Errors: 88 (17.6%)\nAvg latency: 300ms\nStatus: 200:361, 201:38, 401:25, 403:24, 204:13, 400:13, 404:13, 500:13\n"
|
||||
},
|
||||
"a-git-log": {
|
||||
"reply": "git — Log Summary\nCommits: 153\nBy type: feat:57, fix:28, refactor:19, chore:17, test:15, perf:10, docs:7\n"
|
||||
},
|
||||
"a-analytics": {
|
||||
"reply": "analytics — CSV Summary\nEvents: 500 | Users: 50 | Avg latency: 3717ms\nActions: {'view': 150, 'update': 100, 'search': 100, 'create': 50, 'delete': 50, 'export': 50}\nStatuses: {'success': 400, 'error': 50, 'timeout': 50}\n"
|
||||
},
|
||||
"a-github-api-issues-large": {
|
||||
"reply": "issues: 30 | keys per item: 33\ntop labels: Turbopack x12, created-by: Turbopack team x11, tests x11, type: next x6, Documentation x3\n#101008 open comments=1 turbo-tasks: add lazy cell reads via LazyReadRef\n#101007 open comments=0 docs: note that og:url is not derived from alternates.canonical\n#101006 open comments=0 docs: correct the use cache prerender timeout and its error message\n#101005 open comments=0 docs: say which value wins when cacheLife runs more than once\n#101004 open comments=0 fix: exclude non-prefetchable cache entries from RDC\n#101003 open comments=1 [no-unsafe-inline] Test streaming without framework JavaScript\n#101001 open comments=1 feat(turbopack): Add EmitOption trait for extensible chunking context configurat\n#100997 open comments=1 [ci] Use latest Node.js in future compatibility mode\n"
|
||||
},
|
||||
"a-npm-install-log": {
|
||||
"reply": "lines: 398 | GET: 258 | cache miss: 257 | non-200: 0\nslowest:\n 4644ms https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz\n 2771ms https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz\n 2200ms https://registry.npmjs.org/zod/-/zod-4.6.7.tgz\n 2065ms https://registry.npmjs.org/@modelcontextprotocol/server/-/server-2.3.1.tgz\n 2034ms https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.32.2.tgz\n"
|
||||
},
|
||||
"a-source-big": {
|
||||
"reply": "lines: 727 | exports: 455\nfirst 25: SERVER_KEY, TOOL_ORDER, prefixToolNames, OUTPUT_CAP, STATE_BUDGET, RESUME_CAP, REPORT_CAP, POINTER_MIN, STATE_CLOSE_TAG, INDEX_WRITE_CHUNK, SYNC_INDEX_MAX_BYTES, REPLACE_TRIGGER_BYTES, REPLACE_RETURN_BYTES, SHAPE_RETURN_BYTES, REPLACE_CHUNK_BYTES, REPLACE_HANDLE_LINE, HANDLE_PROMPT_WORDS, MAX_CHUNK_BYTES, SEARCH_PAGE_SIZE, SEARCH_REPLY_HITS, SNIPPET_MAX_BYTES, SNIPPET_CODE_MAX_BYTES, READ_MAX_LINES, INSTRUCTIONS_CAP, DESCRIPTION_CAP\n"
|
||||
},
|
||||
"a-git-log-large": {
|
||||
"reply": "commits: 2000 | by month: {\"2026-10\":2000}\ntop prefixes: impl 471, docs 434, review 257, test 223, fix 187, bench 141, feat 64, merge 42\n"
|
||||
},
|
||||
"a-devtools-mcp-snapshot": {
|
||||
"reply": "lines: 1781 | links: 616 | root: uid=1_0 RootWebArea \"SQLite - Wikipedia\" url=\"https://en.wikipedia.org/wiki/SQLite\"\nroles: link 616, \" 315, \". 186, \".\" 80, generic 73, \", 20, heading 19, \" \" 18\nheadings: uid=1_22 heading \"Contents\" level=\"2\" | uid=1_63 heading \"SQLite\" level=\"1\" | uid=1_397 heading \"History\" level=\"2\" | uid=1_493 heading \"Design\" level=\"2\" | uid=1_625 heading \"Features\" level=\"2\" | uid=1_789 heading \"Development and distribution\" level=\"2\"\n"
|
||||
},
|
||||
"a-gh-issue-list-vite": {
|
||||
"reply": "issues: 40 | oldest: 2026-09-29T06:59:34Z | body bytes: 139807\ntop labels: pending triage x12, p2-edge-case x3, feat: bundled-dev x2, feat: dev x2, p2-nice-to-have x2\n#23958 OPEN Errors thrown in `config`, `configResolved`, `configureServer` or a dev server's\n#23955 OPEN Allow for `lightningcss-wasm` support\n#23946 OPEN Dep optimizer resolves a pre-bundled package's #subpath imports without resolve.\n#23945 OPEN Vite drops css chunks in output when not using dynamic imports\n#23943 OPEN Version dev modules with a per-module counter that moves only when content chang\n#23942 OPEN After an HMR update, a module above a self-accepting boundary runs a second time\n#23941 OPEN `reloadModule()` during an in-flight transform serves and caches the previous co\n#23940 OPEN Dev server on macOS adds a new FSEvents watch listener for an out-of-root file o\n"
|
||||
},
|
||||
"a-gh-pr-list-vite": {
|
||||
"reply": "prs: 25 | additions: 2080 | deletions: 81 | files: 109\nchecks: {\"SKIPPED\":99,\"SUCCESS\":326,\"FAILURE\":29,\"NEUTRAL\":54}\n#23962 +100/-2 fix(optimizer): preserve explicit asset queries in dependencies (fix #20285)\n#23961 +120/-1 feat(css): fall back to `lightningcss-wasm` when the native package can't be loa\n#23959 +40/-1 fix(optimizer): resolve subpath imports (#) with Vite's resolver\n#23957 +234/-3 fix(hmr): preserve importer identity above boundaries (fix #23942)\n#23956 +37/-7 fix(worker): keep nested workers still used by a live worker\n#23954 +2/-2 docs: fix ViteConf tag hover resize loop (fix #23905)\n#23950 +58/-1 fix(hmr): invalidate module in `reloadModule` to discard in-flight transforms (f\n#23947 +1/-1 docs: clarify configLoader for monorepo TypeScript imports\n"
|
||||
},
|
||||
"a-context7-query-docs-vite": {
|
||||
"reply": "sections: 5 | code fences: 4\n- Configure server.proxy rules <- vitejs/vite/blob/main/docs/config/server-options.md\n- Dev server /api proxy configuration <- vitejs/vite/blob/main/docs/config/server-options.md\n- Configuring plugins in vite.config.js <- vitejs/vite/blob/main/docs/guide/api-plugin.md\n- Proxy API requests to a separate backend server <- vitejs/vite/blob/main/docs/config/server-options.md\n- server.proxy <- vitejs/vite/blob/main/docs/config/server-options.md\n"
|
||||
},
|
||||
"a-vitest-run-vite": {
|
||||
"reply": "Test Files 1 failed | 73 passed (74)\nTests 25 failed | 1078 passed | 3 skipped (1106)\nDuration 1.99s (tests 70%, import 18%, transform 11%)\nfailing files: {\" packages/create-vite/__tests__/cli.spec.ts\":25}\nfirst failure: FAIL packages/create-vite/__tests__/cli.spec.ts > prompts for the project name if none supplied\ncause: ExecaSyncError: Command failed with exit code 1: node /work/vite/packages/create-vite --interactive\n"
|
||||
},
|
||||
"a-biome-lint-vite": {
|
||||
"reply": "summary: {\"errors\":118,\"warnings\":826,\"infos\":119,\"files\":542} | diagnostics: 1063\ntop rules: lint/style/noNonNullAssertion 359, lint/suspicious/noExplicitAny 325, lint/style/useTemplate 103, lint/suspicious/noAssignInExpressions 52, lint/suspicious/useIterableCallbackReturn 28, lint/complexity/useOptionalChain 27, lint/complexity/noBannedTypes 24, lint/suspicious/noTemplateCurlyInString 20\ntop files: packages/vite/src/node/plugins/css.ts 67, packages/vite/src/node/__tests__/config.spec.ts 51, packages/vite/src/node/utils.ts 48, packages/vite/src/node/plugins/html.ts 45\n"
|
||||
},
|
||||
"a-pnpm-install-vite": {
|
||||
"reply": "lines: 173 | progress lines: 25 | warnings: 40\nlast progress: Progress: resolved 1080, reused 0, downloaded 958, added 1080, done\ntail: + vitest 5.0.5 | Done in 2m 25.1s using pnpm v12.15.0 | exit 0\n"
|
||||
},
|
||||
"a-docker-logs-mongo": {
|
||||
"reply": "entries: 174 | severity: {\"I\":109,\"D1\":55,\"W\":10}\ncomponents: WTWRTLOG 49, STORAGE 40, CONTROL 18, NETWORK 11, WTCHKPT 11, COMMAND 11\nW NETWORK Overriding max connections to honor `capMemoryConsumptionForPreAuthBuffers` settings\nW CONTROL Access control is not enabled for the database. Read and write access to data and configur\nW CONTROL For customers running the current memory allocator, we suggest changing the contents of th\nW CONTROL We suggest setting the contents of sysfsFile to 0.\nW CONTROL We suggest setting swappiness to 0 or 1, as swapping can cause performance problems.\n"
|
||||
},
|
||||
"a-terraform-plan": {
|
||||
"reply": "Plan: 72 to add, 0 to change, 0 to destroy.\nto create by type: {\"local_file\":24,\"random_password\":24,\"random_pet\":24} | unknown after apply: 240\nsensitive values: 48\n"
|
||||
},
|
||||
"a-git-log-stat-vite": {
|
||||
"reply": "commits: 300 | authors: 76 | from 2026-08-07 to 2026-10-30\nmost touched: packages/vite/src 328, .../vite/src 60, packages/create-vite/src 23, pnpm-lock.yaml 22, .../src/node 21, package.json 16\n"
|
||||
},
|
||||
"b-supabase-edge-functions-5-examples": {
|
||||
"reply": "Query \"CORS handling edge function\":\nContext7: Supabase #4: ### Supabase Edge Functions - Serverless Drivers\n\nSupabase Edge Functions use the Deno runtime which has native support for TCP connections, providing flexibility in choosing your database client. You can use supabase-js, Deno Postgres driver, Postgres.js, or Drizzle ORM.\nQuery \"database connection Deno Postgres\":\nContext7: Supabase #1: ### Connect to Supabase Postgres with supabase-js in Deno Edge Function\n\nSource: https://github.com/supabase/supabase/blob/master/apps/docs/content/guides/functions/connect-to-postgres.mdx\n\n```typescript\nimport { createClient } from 'npm:@supabase/supabase-js@2'\n\nDeno.serve(async (req) => {\n try {\n const supabase = createClient(\n Deno.env.get('SUPABASE_URL') ?? '',\n Deno.env.get('SUPABASE_PUBLISHABLE_KEY') ?? '',\n { global: { headers: { Authorization: req.headers.get('Authorization')! } } }\n )\n const { data, error } = await supabase.from('countries').select('*')\n if (error) throw error\n return new Response(JSON.stringify({ data }), { headers: { 'Content-Type': 'application/json' }, status: 200 })\n } catch (err) {\n return new Response(String(err?.message ?? err), { status: 500 })\n }\n})\n```\nSame as above: Context7: Supabase (chunk 4)\nQuery \"unit test edge function invoke\":\nContext7: Supabase #0: ### Deno Unit Test Example for Supabase Edge Functions\n\nSource: https://github.com/supabase/supabase/blob/master/apps/docs/content/guides/functions/unit-test.mdx\n\nThis TypeScript example demonstrates a unit test for Supabase Edge Functions using Deno. It shows how to initialize a Supabase client with environment variables, test client creation and database connectivity, and invoke an Edge Function to assert its response.\n\n```typescript\nimport { assert, assertEquals } from 'jsr:@std/assert@1'\nimport { createClient, SupabaseClient } from 'npm:@supabase/supabase-js@2'\nimport 'jsr:@std/dotenv/load'\n\nconst supabaseUrl = Deno.env.get('SUPABASE_URL') ?? ''\nconst supabaseKey = Deno.env.get('SUPABASE_PUBLISHABLE_KEY') ?? ''\nconst options = {\n auth: {\n autoRefreshToken: false,\n persistSession: false,\n detectSessionInUrl: false,\n },\n}\n\nconst testClientCreation = async () => {\n var client: SupabaseClient = createClient(supabaseUrl, supabaseKey, options)\n if (!supabaseUrl) throw new Error('supabaseUrl is required.')\n if (!supabaseKey) throw new Error('supabaseKey is required.')\n const { data: table_data, error: table_error } = await client.from('my_table').select('*').limit(1)\n if (table_error) throw new Error('Invalid Supabase client: ' + table_error.message)\n assert(table_data, 'Data should be returned from the query.')\n}\n\nconst testHelloWorld = async () => {\n var client: SupabaseClient = createClient(supabaseUrl, supabaseKey, options)\n const { data: func_data, error: func_error } = await client.functions.invoke('hello-world', { body: { name: 'bar' } })\n if (func_error) throw new Error('Invalid response: ' + func_error.message)\n console.log(JSON.stringify(func_data, null, 2))\n assertEquals(func_data.message, 'Hello bar!')\n}\n\nDeno.test('Client Creation Test', testClientCreation)\nDeno.test('Hello-world Function Test', testHelloWorld)\n```\nMore: ctx_search({queries:[\"CORS handling edge function\",\"unit test edge function invoke\"], scope:\"worktree\", source:\"Context7: Supabase\", offset:1})\nMore: ctx_search({queries:[\"database connection Deno Postgres\"], scope:\"worktree\", source:\"Context7: Supabase\", offset:2})"
|
||||
},
|
||||
"b-react-useeffect-docs": {
|
||||
"reply": "Query \"useEffect cleanup function\":\nContext7: React #0: ### useEffect Hook Reference\n\nSource: https://react.dev/reference/react/useEffect\n\nThe useEffect Hook allows you to declare side effects in functional components. It accepts a setup function and optional dependencies array, running the setup after component commits and cleanup before re-runs or unmounting.\n\n```APIDOC\n## useEffect Hook\n\n### Description\nA React Hook that synchronizes a component with an external system by running side effects after render commits.\n\n### Syntax\n```js\nuseEffect(setup, dependencies?)\n```\nQuery \"fetch data ignore stale\":\nContext7: React #13: ### Fetch Data with Cleanup Function in React useEffect\n\nSource: https://react.dev/learn/synchronizing-with-effects\n\nDemonstrates a React useEffect hook that fetches data asynchronously while using a cleanup function to ignore stale responses when dependencies change. The `ignore` flag prevents state updates from outdated requests, ensuring that if the userId changes, previous responses are discarded even if they arrive later.\n\n```javascript\nuseEffect(() => {\n let ignore = false;\n\n async function startFetching() {\n const json = await fetchTodos(userId);\n if (!ignore) {\n setTodos(json);\n }\n }\n\n startFetching();\n\n return () => {\n ignore = true;\n };\n}, [userId]);\n```\nQuery \"dependency array rules\":\nContext7: React #3: #### dependencies (Array) - Optional\nList of all reactive values referenced in setup code (props, state, variables, functions declared in component body).\n- If omitted: Effect re-runs after every commit\n- If empty array `[]`: Effect runs once after initial mount\n- If array with values `[dep1, dep2]`: Effect re-runs when dependencies change\n- Compared using `Object.is()` comparison\n- Must have constant number of items and be written inline\nContext7: React #12: ### Caveats\n- Effects only run on client, not during server rendering\n- Strict Mode adds extra setup+cleanup cycle in development\n- Object/function dependencies may cause excessive re-runs\n- Visual Effects may need `useLayoutEffect` instead\n- Browser repaint timing depends on Effect cause (interaction vs non-interaction)\n```\n\n--------------------------------\n\n### useEffect with External System Connection and Cleanup\n\nSource: https://react.dev/reference/react/useEffect\n\nShows a practical example of using useEffect to establish a connection to an external system (chat room) with proper cleanup. Demonstrates dependency array usage with serverUrl and roomId, and includes a cleanup function that disconnects when dependencies change or component unmounts.\n\n```javascript\nimport { useState, useEffect } from 'react';\nimport { createConnection } from './chat.js';\n\nfunction ChatRoom({ roomId }) {\n const [serverUrl, setServerUrl] = useState('https://localhost:1234');\n\n useEffect(() => {\n const connection = createConnection(serverUrl, roomId);\n connection.connect();\n return () => {\n connection.disconnect();\n };\n }, [serverUrl, roomId]);\n // ...\n}\n```\n\n--------------------------------\nContext7: React #6: ### Important Rules\nSame as above: Context7: React (chunk 0)\nMore: ctx_search({queries:[\"useEffect cleanup function\"], scope:\"worktree\", source:\"Context7: React\", offset:1})\nMore: ctx_search({queries:[\"dependency array rules\"], scope:\"worktree\", source:\"Context7: React\", offset:4})"
|
||||
},
|
||||
"b-next-js-app-router-docs": {
|
||||
"reply": "Query \"App Router data fetching\":\nContext7: Next.js #0: ### Create Server Component Page with Data Fetching in Next.js App Directory\n\nSource: https://github.com/vercel/next.js/blob/canary/docs/01-app/02-guides/migrating/app-router-migration.mdx\n\nShows how to create a new page.tsx file in the app directory that acts as a Server Component by default. This component imports the Client Component and handles data fetching using the new data fetching APIs. The fetched data is then passed as props to the Client Component.\n\n```typescript\n// Import your Client Component\nimport HomePage from './home-page'\n\nasync function getPosts() {\n const res = await fetch('https://...')\n const posts = await res.json()\n return posts\n}\n\nexport default async function Page() {\n // Fetch data directly in a Server Component\n const recentPosts = await getPosts()\n // Forward fetched data to your Client Component\n return <HomePage recentPosts={recentPosts} />\n}\n```\n\n```javascript\n// Import your Client Component\nimport HomePage from './home-page'\n\nasync function getPosts() {\n const res = await fetch('https://...')\n const posts = await res.json()\n return posts\n}\n\nexport default async function Page() {\n // Fetch data directly in a Server Component\n const recentPosts = await getPosts()\n // Forward fetched data to your Client Component\n return <HomePage recentPosts={recentPosts} />\n}\n```\n\n--------------------------------\nQuery \"server components\":\nContext7: Next.js #3: ### Server-Side Rendering with App Router\n\nSource: https://github.com/vercel/next.js/blob/canary/docs/01-app/02-guides/migrating/app-router-migration.mdx\n\nDemonstrates implementing server-side rendering in the app directory using async Server Components with fetch and cache: 'no-store'. This replaces getServerSideProps functionality while allowing data fetching to be colocated within components.\n\n```typescript\n// `app` directory\n\n// This function can be named anything\nasync function getProjects() {\n const res = await fetch(`https://...`, { cache: 'no-store' })\n const projects = await res.json()\n\n return projects\n}\n\nexport default async function Dashboard() {\n const projects = await getProjects()\n\n return (\n <ul>\n {projects.map((project) => (\n <li key={project.id}>{project.name}</li>\n ))}\n </ul>\n )\n}\n```\n\n```javascript\n// `app` directory\n\n// This function can be named anything\nasync function getProjects() {\n const res = await fetch(`https://...`, { cache: 'no-store' })\n const projects = await res.json()\n\n return projects\n}\n\nexport default async function Dashboard() {\n const projects = await getProjects()\n\n return (\n <ul>\n {projects.map((project) => (\n <li key={project.id}>{project.name}</li>\n ))}\n </ul>\n )\n}\n```\n\n--------------------------------\nSame as above: Context7: Next.js (chunk 0)\nQuery \"route handlers\":\nContext7: Next.js #1: ### Migrate getServerSideProps to App Router Server Component\n\nSource: https://github.com/vercel/next.js/blob/canary/docs/01-app/02-guides/migrating/app-router-migration.mdx\n\nShows how to replace getServerSideProps from pages directory with an async Server Component in the app directory. Data fetching is colocated within the component using fetch with cache: 'no-store' to ensure fresh data on every request, reducing client-side JavaScript.\n\n```javascript\n// `pages` directory\n\nexport async function getServerSideProps() {\n const res = await fetch(`https://...`)\n const projects = await res.json()\n\n return { props: { projects } }\n}\n\nexport default function Dashboard({ projects }) {\n return (\n <ul>\n {projects.map((project) => (\n <li key={project.id}>{project.name}</li>\n ))}\n </ul>\n )\n}\n```\n\n```javascript\n// `app` directory\n\n// This function can be named anything\nasync function getProjects() {\n const res = await fetch(`https://...`, { cache: 'no-store' })\n const projects = await res.json()\n\n return projects\n}\n\nexport default async function Dashboard() {\n const projects = await getProjects()\n\n return (\n <ul>\n {projects.map((project) => (\n <li key={project.id}>{project.name}</li>\n ))}\n </ul>\n )\n}\n```\n\n--------------------------------\nSame as above: Context7: Next.js (chunk 3)\nMore: ctx_search({queries:[\"App Router data fetching\"], scope:\"worktree\", source:\"Context7: Next.js\", offset:1})\nMore: ctx_search({queries:[\"server components\",\"route handlers\"], scope:\"worktree\", source:\"Context7: Next.js\", offset:2})"
|
||||
},
|
||||
"b-tailwind-css-docs": {
|
||||
"reply": "Query \"responsive breakpoints\":\nContext7: Tailwind #1: ### Create responsive grid layouts with breakpoint variants\n\nSource: https://github.com/tailwindlabs/tailwindcss.com/blob/main/src/docs/hover-focus-and-other-states.mdx\n\nUse Tailwind's responsive variants (md, lg, etc.) to apply different grid column counts at specific viewport breakpoints. This example renders a 3-column grid on mobile, 4 columns on medium screens, and 6 columns on large screens. Breakpoint variants enable mobile-first responsive design patterns.\n\n```html\n<div class=\"grid grid-cols-3 md:grid-cols-4 lg:grid-cols-6\">\n <!-- ... -->\n</div>\n```\n\n--------------------------------\nQuery \"custom colors theme\":\nContext7: Tailwind #2: ### Apply Custom Tailwind CSS Breakpoints in HTML\n\nSource: https://github.com/tailwindlabs/tailwindcss.com/blob/main/src/docs/responsive-design.mdx\n\nThis HTML snippet illustrates how to utilize custom breakpoints defined in your Tailwind CSS theme. Once breakpoints like `xs` and `3xl` are configured, you can apply responsive utility classes by prefixing them with the custom breakpoint name, such as `xs:grid-cols-2` or `3xl:grid-cols-6`, to control layout changes at specific screen sizes.\n\n```html\n<div class=\"grid xs:grid-cols-2 3xl:grid-cols-6\">\n <!-- ... -->\n</div>\n```\n\n--------------------------------\nMore: ctx_search({queries:[\"responsive breakpoints\"], scope:\"worktree\", source:\"Context7: Tailwind\", offset:1})"
|
||||
},
|
||||
"b-skill-context-mode-main-prompt": {
|
||||
"reply": "Query \"when to use execute vs execute_file\":\nSkill: context-mode #3: ```\n│ └── Use Bash\n│\n├── Output MIGHT be large or you're UNSURE?\n│ └── Use context-mode ctx_execute or ctx_execute_file\n│\n├── Fetching web documentation or HTML page?\n│ └── Use ctx_fetch_and_index → ctx_search\n│\n├── Using Playwright (navigate, snapshot, console, network)?\n│ └── ALWAYS use filename parameter to save to file, then:\n│ browser_snapshot(filename) → ctx_index(path) or ctx_execute_file(path)\n│ browser_console_messages(filename) → ctx_execute_file(path)\n│ browser_network_requests(filename) → ctx_execute_file(path)\n│ ⚠ browser_navigate returns a snapshot automatically — ignore it,\n│ use browser_snapshot(filename) for any inspection.\n│ ⚠ Playwright MCP uses a SINGLE browser instance — NOT parallel-safe.\n│ For parallel browser ops, use agent-browser via execute instead.\n│\n├── Using agent-browser (parallel-safe browser automation)?\n│ └── Run via execute (shell) — each call gets its own subprocess:\n│ execute(\"agent-browser open example.com && agent-browser snapshot -i -c\")\n│ ✓ Supports sessions for isolated browser instances\n│ ✓ Safe for parallel subagent execution\n│ ✓ Lightweight accessibility tree with ref-based interaction\n│\n├── Processing output from another MCP tool (Context7, GitHub API, etc.)?\n│ ├── Output already in context from a previous tool call?\n│ │ └── Use it directly. Do NOT re-index with ctx_index(content: ...).\n│ ├── Need to search the output multiple times?\n│ │ └── Save to file via ctx_execute, then ctx_index(path) → ctx_search\n│ └── One-shot extraction?\n│ └── Save to file via ctx_execute, then ctx_execute_file(path)\n│\n└── Reading a file to analyze/summarize (not edit)?\n └── Use ctx_execute_file (file loads into FILE_CONTENT, not context)\n```\n[lines 4-38 of 38]\nQuery \"language selection guide\":\nSkill: context-mode #6: ## Language Selection\n\n| Situation | Language | Why |\n|-----------|----------|-----|\n| HTTP/API calls, JSON | `javascript` | Native fetch, JSON.parse, async/await |\n| Data analysis, CSV, stats | `python` | csv, statistics, collections, re |\n| Shell commands with pipes | `shell` | grep, awk, jq, native tools |\n| File pattern matching | `shell` | find, wc, sort, uniq |\nSkill: context-mode #18: ### Workflow B: Snapshot → File → Execute File (one-shot extraction)\n\n```\nStep 1: browser_snapshot(filename: \"/tmp/playwright-snapshot.md\")\n → saves to file, returns ~50B confirmation\n\nStep 2: ctx_execute_file(path: \"/tmp/playwright-snapshot.md\", language: \"javascript\", code: \"\n const links = [...FILE_CONTENT.matchAll(/- link \\\"([^\\\"]+)\\\"/g)].map(m => m[1]);\n const buttons = [...FILE_CONTENT.matchAll(/- button \\\"([^\\\"]+)\\\"/g)].map(m => m[1]);\n const inputs = [...FILE_CONTENT.matchAll(/- textbox|- checkbox|- radio/g)];\n console.log('Links:', links.length, '| Buttons:', buttons.length, '| Inputs:', inputs.length);\n console.log('Navigation:', links.slice(0, 10).join(', '));\n \")\n → processes in sandbox, returns ~200B summary\n```\n\n**Total context: ~250B** instead of 135K tokens.\nQuery \"anti-patterns avoid\":\nSkill: context-mode #24: ## Reference Files\n\n- [JavaScript/TypeScript Patterns](./references/patterns-javascript.md)\n- [Python Patterns](./references/patterns-python.md)\n- [Shell Patterns](./references/patterns-shell.md)\n- [Anti-Patterns & Common Mistakes](./references/anti-patterns.md)\nSkill: context-mode #7: ## Search Query Strategy\n\n- BM25 uses **OR semantics** — results matching more terms rank higher automatically\n- Use 2-4 specific technical terms per query\n- **Always use `source` parameter** when multiple docs are indexed to avoid cross-source contamination\n - Partial match works: `source: \"Node\"` matches `\"Node.js v22 CHANGELOG\"`\n- **Always use `queries` array** — batch ALL search questions in ONE call:\n - `ctx_search(queries: [\"transform pipe\", \"refine superRefine\", \"coerce codec\"], source: \"Zod\")`\n - NEVER make multiple separate ctx_search() calls — put all queries in one array\nSkill: context-mode #23: ## Anti-Patterns\nMore: ctx_search({queries:[\"when to use execute vs execute_file\"], scope:\"worktree\", source:\"Skill: context-mode\", offset:1})"
|
||||
},
|
||||
"b-skill-references-4-files-combined": {
|
||||
"reply": "Query \"JSON parse transform pattern\":\nSkill Refs: context-mode #45: ## 3. Using Bash When JS/Python Would Be Cleaner\n\n**Problem:** Complex data processing in Bash quickly becomes unreadable and error-prone.\n\n```shell\n# BAD — parsing JSON in Bash is fragile:\ncat data.json | python3 -c \"\nimport sys, json\ndata = json.load(sys.stdin)\nfor item in data:\n if item['status'] == 'error':\n print(item['id'], item['message'])\n\"\n# If you're already using Python inline, just use language: python\n```\n\n```javascript\n// GOOD — use the right language for the job:\n// language: javascript\nconst data = require('./data.json');\ndata.filter(x => x.status === 'error')\n .forEach(x => console.log(`${x.id}: ${x.message}`));\n```\n\n**Rule:** If your Bash script contains inline Python/Node or complex `jq`/`awk` chains, switch to `language: python` or `language: javascript` instead.\n\nSigns you should switch from shell:\n- Using `python3 -c` or `node -e` inside the shell script\n- More than 3 pipes chained together\n- Using `jq` for complex JSON transformations\n- Nested loops in Bash\n- String manipulation beyond simple `cut`/`sed`\n\n---\nSkill Refs: context-mode #6: ### Diff two JSON files\n\n```javascript\nconst fs = require('fs');\nconst a = JSON.parse(fs.readFileSync('config.prod.json', 'utf8'));\nconst b = JSON.parse(fs.readFileSync('config.staging.json', 'utf8'));\n\nfunction diffObjects(obj1, obj2, path = '') {\n const allKeys = new Set([...Object.keys(obj1 || {}), ...Object.keys(obj2 || {})]);\n for (const key of allKeys) {\n const fullPath = path ? `${path}.${key}` : key;\n if (!(key in (obj1 || {}))) {\n console.log(`+ ${fullPath}: ${JSON.stringify(obj2[key])}`);\n } else if (!(key in (obj2 || {}))) {\n console.log(`- ${fullPath}: ${JSON.stringify(obj1[key])}`);\n } else if (typeof obj1[key] === 'object' && typeof obj2[key] === 'object') {\n diffObjects(obj1[key], obj2[key], fullPath);\n } else if (JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])) {\n console.log(`~ ${fullPath}: ${JSON.stringify(obj1[key])} -> ${JSON.stringify(obj2[key])}`);\n }\n }\n}\n\nconsole.log('=== Config Diff: prod vs staging ===');\ndiffObjects(a, b);\n```\n> summary_prompt: \"List all configuration differences between prod and staging environments\"\n\n---\nSkill Refs: context-mode #13: ### Run tests and extract failures\n\n```javascript\nconst { execSync } = require('child_process');\n\nlet output;\ntry {\n output = execSync('npx jest --json 2>/dev/null', { encoding: 'utf8', maxBuffer: 50 * 1024 * 1024 });\n} catch (e) {\n output = e.stdout || '';\n}\n\ntry {\n const results = JSON.parse(output);\n console.log(`=== Test Results ===`);\n console.log(`Suites: ${results.numPassedTestSuites} passed, ${results.numFailedTestSuites} failed`);\n console.log(`Tests: ${results.numPassedTests} passed, ${results.numFailedTests} failed`);\n console.log(`Time: ${(results.testResults || []).reduce((s, t) => s + (t.endTime - t.startTime), 0)}ms`);\n\n const failures = (results.testResults || []).filter(t => t.status === 'failed');\n if (failures.length > 0) {\n console.log('\\n=== Failed Tests ===');\n failures.forEach(suite => {\n console.log(`\\nSuite: ${suite.name}`);\n (suite.assertionResults || [])\n .filter(a => a.status === 'failed')\n .forEach(a => {\n console.log(` FAIL: ${a.ancestorTitles.join(' > ')} > ${a.title}`);\n console.log(` ${(a.failureMessages || []).join('\\n ').slice(0, 200)}`);\n });\n });\n }\n} catch {\n console.log('Could not parse JSON output. Raw output:');\n console.log(output.slice(0, 5000));\n}\n```\n> summary_prompt: \"Report test pass/fail counts, list each failing test with its error message\"\n> timeout_ms: 60000\n\n\n---\nQuery \"CSV analysis Python\":\nSkill Refs: context-mode #18: ## CSV / Log File Analysis\nSkill Refs: context-mode #19: ### Analyze a CSV file\n\n```python\nimport csv\nfrom collections import Counter, defaultdict\nfrom datetime import datetime\n\nwith open('data/transactions.csv') as f:\n reader = csv.DictReader(f)\n rows = list(reader)\n\nprint(f\"Total records: {len(rows)}\")\nprint(f\"Columns: {', '.join(rows[0].keys()) if rows else 'none'}\")\n\n# Summary statistics for numeric column\namounts = [float(r['amount']) for r in rows if r.get('amount')]\nif amounts:\n print(f\"\\n=== Amount Statistics ===\")\n print(f\" Min: ${min(amounts):,.2f}\")\n print(f\" Max: ${max(amounts):,.2f}\")\n print(f\" Mean: ${sum(amounts)/len(amounts):,.2f}\")\n print(f\" Median: ${sorted(amounts)[len(amounts)//2]:,.2f}\")\n print(f\" Total: ${sum(amounts):,.2f}\")\n\n# Group by category\nif 'category' in rows[0]:\n by_cat = defaultdict(list)\n for r in rows:\n by_cat[r['category']].append(float(r.get('amount', 0)))\n print(\"\\n=== By Category ===\")\n for cat, vals in sorted(by_cat.iteLine truncated
|
||||
},
|
||||
"b-mcp-tools-list-40-tools": {
|
||||
"reply": "Query \"browser screenshot tool\":\nMCP: tools/list #26: ### take_screenshot\n\nTake a screenshot of a web page\n\n---\nMCP: tools/list #25: ### open_browser\n\nOpen a URL in the browser for testing\n\n---\nQuery \"file search glob\":\nMCP: tools/list #3: ### edit_file\n\nApply targeted edits to a file using search and replace\n\n---\nMCP: tools/list #33: ### search_docs\n\nSearch project documentation\n\n---\nMCP: tools/list #0: ### search_codebase\n\nSearch for code patterns across the codebase using ripgrep\n\n---\nMCP: tools/list #18: ### create_file\n\nCreate a new file from a template\n\n---\nMCP: tools/list #1: ### read_file\n\nRead the contents of a file at the given path\n\n---\nQuery \"git commit tool\":\nMCP: tools/list #10: ### git_commit\n\nCreate a new commit with staged changes\n\n---\nMCP: tools/list #9: ### git_log\n\nShow commit logs\n\n---\nMCP: tools/list #8: ### git_diff\n\nShow changes between commits, working tree, etc.\n\n---\nMCP: tools/list #7: ### git_status\n\nShow the working tree status\n\n---\nMCP: tools/list #11: ### git_branch\n\nList, create, or delete branches\n\n---\nMore: ctx_search({queries:[\"file search glob\"], scope:\"worktree\", source:\"MCP: tools/list\", offset:5})"
|
||||
},
|
||||
"b-html-docs-page-sqlite-org-fts5-215-kb": {
|
||||
"reply": "Query \"bm25 ranking function weights\":\ndata/sqlite-fts5-docs.html #42: ```\n-- The following queries are logically equivalent. But the second may\n-- be faster, particularly if the caller abandons the query before\n-- all rows have been returned (or if the queries were modified to\n-- include LIMIT clauses).\nSELECT * FROM ft WHERE ft MATCH ? ORDER BY bm25(ft);\nSELECT * FROM ft WHERE ft MATCH ? ORDER BY rank;\n```\n\nInstead of using bm25() with no trailing arguments, the specific auxiliary function mapped to the rank column may be configured either on a per-query basis, or by setting a different persistent default for the FTS table.\n\nIn order to change the mapping of the rank column for a single query, a term similar to either of the following is added to the WHERE clause of a query:\n\n```\nrank MATCH 'auxiliary-function-name(arg1, arg2, ...)'\nrank = 'auxiliary-function-name(arg1, arg2, ...)'\n```\n\nThe right-hand-side of the MATCH or = operator must be a constant expression that evaluates to a string consisting of the auxiliary function to invoke, followed by zero or more comma separated arguments within parentheses. Arguments must be SQL literals. For example:\n\n```\n-- The following queries are logically equivalent. But the second may\n-- be faster. See above.\nSELECT * FROM ft WHERE ft MATCH ? ORDER BY bm25(ft, 10.0, 5.0);\nSELECT * FROM ft WHERE ft MATCH ? AND rank MATCH 'bm25(10.0, 5.0)' ORDER BY rank;\n```\n\nThe table-valued function syntax may also be used to specify an alternative ranking function. In this case the text describing the ranking function should be specified as the second table-valued function argument. The following three queries are equivalent:\n\n```\nSELECT * FROM ft WHERE ft MATCH ? AND rank MATCH 'bm25(10.0, 5.0)' ORDER BY rank;\nSELECT * FROM ft WHERE ft = ? AND rank = 'bm25(10.0, 5.0)' ORDER BY rank;\nSELECT * FROM ft WHERE ft(?, 'bm25(10.0, 5.0)') ORDER BY rank;\n```\n\nThe default mapping of the rank column for a table may be modified using the [FTS5 rank configuration option](fts5.html#the_rank_configuration_option).\ndata/sqlite-fts5-docs.html #37: ### 5.1.1. The bm25() function\n\nThe built-in auxiliary function bm25() returns a real value indicating how well the current row matches the full-text query. The better the match, the numerically smaller the value returned. A query such as the following may be used to return matches in order from best to worst match:\n\n```\nSELECT * FROM ft WHERE ft MATCH ? ORDER BY bm25(ft)\n```\n\nIn order to calculate a documents score, the full-text query is separated into its component phrases. The bm25 score for document D and query Q is then calculated as follows:\n\nIn the above, nPhrase is the number of phrases in the query. |D| is the number of tokens in the current document, and avgdl is the average number of tokens in all documents within the FTS5 table. k1 and b are both constants, hard-coded at 1.2 and 0.75 respectively.\n\nThe \"-1\" term at the start of the formula is not found in most implementations of the BM25 algorithm. Without it, a better match is assigned a numerically higher BM25 score. Since the default sorting order is \"ascending\", this means that appending \"ORDER BY bm25(ft)\" to a query would cause results to be returned in order from worst to best. The \"DESC\" keyword would be required in order to return the best matches first. In order to avoid this pitfall, the FTS5 implementation of BM25 multiplies the result by -1 before returning it, ensuring that better matches are assigned numerically lower scores.\n\nIDF(qi) is the inverse-document-frequency of query phrase i. It is calculated as follows, where N is the total number of rows in the FTS5 table and n(qi) is the total number of rows that contain at least one instance of phrase i:\n\nFinally, f(qi,D) is the phrase frequency of phrase i. By default, this is simply the number of occurrences of the phrase within the current row. However, by passing extra real value arguments to the bm25() SQL function, each column of the table may be assigned a different weight and the phrase frequency calculated as follows:\ndata/sqlite-fts5-docs.html #36: - The [bm25() auxiliary function](fts5.html#the_bm25_function) returns a real value reflecting the accuracy of the current match. Better matches are assigned numerically lower values.\n- The [highlight() auxiliary function](fts5.html#the_highlight_function) returns a copy of the text from one of the columns of the current match with each instance of a queried term within the result surrounded by specified markup (for example \"<b>\" and \"</b>\").\ndata/sqlite-fts5-docs.html #54: ## 6.11. The 'rank' Configuration Option\n\nThis command is used to set the persistent \"rank\" option.\n\nThe rank option is used to change the default auxiliary function mapping for the rank column. The option should be set to a text value in the same format as described for [\"rank MATCH ?\"](fts5.html#sorting_by_auxilLine truncated
|
||||
},
|
||||
"c-triage": {
|
||||
"reply": "## failed tests\n Test Files 4 failed | 26 passed (30)\n Tests 4 failed | 108 passed (112)\n Start at 10:23:45\n Duration 4.21s (transform 1.23s, setup 0.89s, collect 2.09s, tests 3.87s, environment 0.34s, prepare 0.56s)\n at Object.<anonymous> (src/api/trpc/routers/user.test.ts:89:18)\n ✓ deletes user 52ms\n ✓ validates input schema 58ms\n ✓ src/api/trpc/routers/project.test.ts (4 tests) 178ms\n ✓ lists projects for user 34ms\n ✓ creates project with defaults 45ms\n ✓ updates project settings 48ms\n ✓ handles authorization 51ms\n ✓ src/api/trpc/routers/billing.test.ts (3 tests) 267ms\n ✓ creates checkout session 89ms\n ✓ handles webhook events 98ms\n ✓ retrieves subscription status 80ms\n ✓ src/api/trpc/routers/analytics.test.ts (4 tests) 189ms\n ✓ tracks page views 34ms\n ✓ aggregates daily stats 56ms\n ✓ filters by date range 48ms\n ✓ exports report 51ms\n ✓ src/lib/auth.test.ts (4 tests) 156ms\n ✓ validates JWT tokens 38ms\n ✓ handles expired tokens 42ms\n ✓ creates session 36ms\n ✓ checks permissions 40ms\n ✓ src/lib/database.test.ts (3 tests) 312ms\n ✓ connects to database 98ms\n ✓ handles connection pooling 112ms\n ✓ retries on failure 102ms\n ✗ src/lib/email.test.ts (4 tests) 567ms\n ✓ sends welcome email 89ms\n ✗ sends password reset email 312ms\n → Error: Resend API returned 429: Rate limit exceeded\n at sendEmail (src/lib/email.ts:45:11)\n at Object.<anonymous> (src/lib/email.test.ts:56:14)\n ✓ validates email templates 78ms\n ✓ handles bounce notifications 88ms\n ✓ src/lib/stripe.test.ts (3 tests) 234ms\n ✓ creates payment intent 78ms\n ✓ processes refund 89ms\n ✓ validates webhook signature 67ms\n ✓ src/utils/helpers.test.ts (5 tests) 34ms\n ✓ formats currency 6ms\n ✓ truncates text 5ms\n ✓ generates slug 8ms\n ✓ validates email format 7ms\n ✓ deep merges objects 8ms\n ✓ src/utils/date.test.ts (4 tests) 28ms\n ✓ formats relative time 7ms\n ✓ parses ISO strings 6ms\n ✓ handles timezone conversion 8ms\n ✓ calculates date ranges 7ms\n ✓ src/utils/validation.test.ts (3 tests) 19ms\n ✓ validates required fields 6ms\n ✓ validates email format 7ms\n ✓ validates password strength 6ms\n ✓ src/middleware/rateLimit.test.ts (3 tests) 145ms\n ✓ allows requests under limit 42ms\n ✓ blocks requests over limit 56ms\n ✓ resets after window expires 47ms\n ✓ src/middleware/cors.test.ts (3 tests) 23ms\n ✓ allows whitelisted origins 8ms\n ✓ blocks unknown origins 7ms\n ✓ handles preflight requests 8ms\n ✓ src/middleware/logging.test.ts (3 tests) 31ms\n ✓ logs request details 10ms\n ✓ masks sensitive headers 11ms\n ✓ tracks request duration 10ms\n RUN v2.1.8 /Users/mert/projects/my-saas-app\n## TS2339 property does not exist\nlib/database.ts(103,31): error TS2741: Property 'connectionString' is missing in type '{}' but required in type 'DatabaseConfig'.\nsrc/config/config.ts(9,12): error TS2322: Type 'string | undefined' is not assignable to type 'string'.\nsrc/config/config.ts(24,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'AppConfig'.\nsrc/config/config.ts(39,18): error TS2532: Object is possibly 'undefined'.\nsrc/config/config.ts(54,9): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'FeatureFlags'.\nsrc/types/types.ts(12,3): error TS2300: Duplicate identifier 'id'.\nsrc/types/types.ts(28,10): error TS2456: Type alias 'RecursivePartial' circularly references itself.\nsrc/types/types.ts(43,5): error TS2430: Interface 'AdminUser' incorrectly extends interface 'User'.\nsrc/types/types.ts(59,18): error TS2344: Type 'string' does not satisfy the constraint 'keyof User'.\n## build warnings\n Build completed with 3 errors and 12 warnings.\n Total build time: 12.34s\n ▲ Next.js 15.1.0\n - Environments: .env.local\n; }' is not assignable to parameter of type 'URLSearchParams'.\n ⚠ Warning: src/middleware.ts - Middleware should not redirect to external URLs\n ✓ Compiled src/config/config.ts (28ms)\n ✓ Compiled src/config/navigation.ts (15ms)\n ✓ Compiled src/config/constants.ts (12ms)\n ✓ Compiled src/types/index.ts (18ms)\n ✓ Compiled src/types/api.ts (22ms)\n ⚠ Warning: src/types/api.ts - This type is declared but never used\n ✓ Compiled src/styles/globals.css (234ms)\n ERROR in src/components/DataGrid.tsx(89,23): TS18047: 'data' is possibly 'null'.\n ⚠ Warning: src/app/dashboard/page.tsx - Async Server Component props should be awaited before use\n ✓ Compiled src/app/api/webhooks/stripe/route.ts (123ms)\n ✓ Compiled src/app/api/uploadthing/route.ts (89ms)\n ✓ Compiled src/app/api/health/route.ts (23ms)\n ⚠ Warning: src/app/api/webhooks/stripe/route.ts - Unhandled 'default' case in switch statement\n ✓ CoLine truncated
|
||||
},
|
||||
"c-install-log": {
|
||||
"reply": "## cache miss\ny.npmjs.org/@esbuild%2fwin32-x64 282ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/@esbuild%2flinux-s390x 79ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fopenbsd-x64 101ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fwin32-arm64 99ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fdarwin-arm64 99ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fopenbsd-arm64 91ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/@esbuild%2flinux-mips64el 84ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fandroid-arm64 128ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/@esbuild%2flinux-riscv64 102ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/@esbuild%2flinux-loong64 121ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/entities 86ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/domelementtype 52ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/domhandler 81ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/eslint-visitor-keys 54ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/@esbuild%2ffreebsd-arm64 264ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/domutils 259ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/fast-string-truncated-width 64ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/vary 57ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/json-schema-traverse 59ms (cache miss)\nnpm http cache https://registry.npmjs.org/eventsource-parser 5ms (cache hit)\nnpm http fetch GET 200 https://registry.npmjs.org/require-from-string 64ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/fast-deep-equal 65ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/shebang-command 66ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/object-assign 70ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/path-key 70ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/which 71ms (cache miss)\nnpm http cache https://registry.npmjs.org/vary 5ms (cache hit)\nnpm http fetch GET 200 https://registry.npmjs.org/fast-uri 76ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/etag 68ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/once 70ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/depd 73ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/fresh 65ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/cookie 67ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/router 71ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/send 83ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/qs 95ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/debug 86ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/parseurl 75ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/encodeurl 70ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/statuses 75ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/accepts 81ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/mime-types 67ms (cache miss)\nnpm http cache https://registry.npmjs.org/content-type 4ms (cache hit)\nnpm http fetch GET 200 https://registry.npmjs.org/escape-html 67ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/proxy-addr 73ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/body-parser 87ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/on-finished 61ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/http-errors 63ms (cache miss)\nnpm http cache https://registry.npmjs.org/debug 4ms (cache hit)\nnpm http fetch GET 200 https://registry.npmjs.org/finalhandler 66ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/range-parser 67ms (cache miss)\nnp\ny.npmjs.org/@modelcontextprotocol/server/-/server-2.3.1.tgz 2065ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/zod/-/zod-4.6.7.tgz 2200ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz 2771ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz 4644ms (cache miss)\n## registry.npmjs.org GET 200\nm http fetch GET 200 https://registry.npmjs.org/serve-static 67ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/cookie-signature 62ms (cache miss)\nnpm http cache https://registry.npmjs.org/http-errors 2ms (cache hit)\nnpm http fetch GET 200 https://registry.npmjs.org/merge-descriptors 64ms (cache miss)\nnpm http fetch GET 200 https://registry.npmjs.org/content-dispositioLine truncated
|
||||
},
|
||||
"c-small": {
|
||||
"reply": "## node version\nv26.8.1\n## ready\nready\n$ git rev-parse --is-inside-work-tree\ntrue",
|
||||
"sample": "v26.8.1\ntrue\nready\n"
|
||||
},
|
||||
"d-synth-120k": {
|
||||
"reply": "exit 0 · 80008 B\nncy=233ms upstream=api-34 status=200\nreq 300c511 latency=124ms upstream=api-31 status=200\nreq 26df78fb latency=112ms upstream=api-13 status=200\nreq 1fc6d6c2 latency=455ms upstream=api-29 status=200\nreq 162a56b1 latency=307ms upstream=api-28 status=200\nreq 6e31970 latency=315ms upstream=api-27 status=200\nreq b91e313 latency=123ms upstream=api-31 status=200\nreq 16780925 latency=315ms upstream=api-24 status=500\nreq 408ef88 latency=229ms upstream=api-18 status=200\nreq 3309ee8e latency=457ms upstream=api-16 status=200\nreq 1d17e7c9 latency=142ms upstream=api-20 status=200\nreq 2b7e0b8c latency=345ms upstream=api-37 status=200\nreq 1b15ae4a latency=271ms upstream=api-27 status=200\nreq 30ae9dd9 latency=143ms upstream=api-39 status=200\nreq 371cc4d4 latency=810ms upstream=api-28 status=200\nreq 34f3cfe latency=581ms upstream=api-2 status=200\nreq 161e06fd latency=142ms upstream=api-16 status=200\nreq 25cc9ef0 latency=170ms upstream=api-4 status=200\nreq 602686a latency=379ms upstream=api-32 status=200\nreq 3ab5c750 latency=595ms upstream=api-24 status=200\nreq 2bebe70c latency=134ms upstream=api-39 status=200\nreq 2f934f57 latency=719ms upstream=api-22 status=200\nreq 1917f3d8 latency=894ms upstream=api-9 status=200\nreq 98d80d4 latency=52ms upstream=api-0 status=200\nreq c5f3a4e latency=134ms upstream=api-24 status=200\nreq 8635336 latency=683ms upstream=api-1 status=200\nreq 1f59d81 latency=312ms upstream=api-20 status=200\nreq 18e05195 latency=723ms upstream=api-36 status=200\nreq 6b9fc42 latency=118ms upstream=api-32 status=500\nreq 2ce9f847 latency=71ms upstream=api-21 status=200\nreq 2dfa02eb latency=396ms upstream=api-32 status=200\nreq 23f4d6fd latency=533ms upstream=api-22 status=200\nreq ea2cb9b latency=48ms upstream=api-16 status=200\nreq 33374c7c latency=506ms upstream=api-15 status=200\nreq 1a7ee8da latency=65ms upstream=api-19 status=200\nreq 1d65c733 latency=512ms upstream=api-2 status=200\nreq 3b16da51 latency=559ms upstream=api-36 status=200\nreq 35440185 latency=393ms upstream=api-24 status=200\nreq 3393bdf4 latency=4ms upstream=api-8 status=200\nreq 21d53d67 latency=690ms upstream=api-30 status=200\nLASTMARK-9f3a req 1deabd9d latency=17ms upstream=api-6 status=200\nctx_search({queries:[\"\"], source:\"ctx_execute:const s=20261031;let a=s>>>0;const r=()=>{a=(a+0x6d2b79f5)>>>0;let t\"})",
|
||||
"sample": "FIRSTMARK-7c1e req 1abd494f latency=367ms upstream=api-7 status=200\nreq 27dd34af latency=471ms upstream=api-17 status=200\nreq 14fa64db latency=252ms upstream=api-7 status=200\nreq 24d54255 latency=287ms upstream=api-2 status=200\nreq 1a4a1c03 latency=595ms upstream=api-8 status=200\nreq 10e959cc latency=205ms upstream=api-34 status=200\nreq 4c33a72 latency=115ms upstream=api-30 status=200\nreq 21870d96 latency=130ms upstream=api-7 status=200"
|
||||
},
|
||||
"d-synth-1m": {
|
||||
"reply": "exit 0 · 666796 B\n=186ms upstream=api-29 status=200\nreq 2d53e958 latency=256ms upstream=api-39 status=200\nreq 1b238e02 latency=429ms upstream=api-15 status=200\nreq 1bebd687 latency=731ms upstream=api-24 status=200\nreq f12033e latency=32ms upstream=api-34 status=200\nreq 3297ebfa latency=685ms upstream=api-27 status=200\nreq 3243a24 latency=95ms upstream=api-15 status=200\nreq 27eec629 latency=613ms upstream=api-14 status=200\nreq 1316d51a latency=281ms upstream=api-21 status=200\nreq 14e5401d latency=248ms upstream=api-28 status=200\nreq 896328b latency=692ms upstream=api-10 status=200\nreq 1e8cd5d8 latency=535ms upstream=api-2 status=200\nreq 29eeebe9 latency=45ms upstream=api-11 status=200\nreq 27c1992e latency=498ms upstream=api-25 status=200\nreq 3a95eb8e latency=159ms upstream=api-26 status=200\nreq 32bf9947 latency=212ms upstream=api-9 status=200\nreq 11bf6de0 latency=739ms upstream=api-39 status=200\nreq 13b59b32 latency=597ms upstream=api-39 status=200\nreq fff0d2 latency=46ms upstream=api-3 status=200\nreq b9d54b0 latency=667ms upstream=api-4 status=200\nreq 1730c8f2 latency=504ms upstream=api-6 status=200\nreq 2eb30db6 latency=437ms upstream=api-8 status=200\nreq 8236e43 latency=558ms upstream=api-24 status=200\nreq 888d9a3 latency=810ms upstream=api-8 status=200\nreq 75f8be6 latency=153ms upstream=api-10 status=200\nreq 1216497c latency=790ms upstream=api-39 status=200\nreq 19ee5f72 latency=87ms upstream=api-10 status=200\nreq 6b1b95c latency=190ms upstream=api-39 status=200\nreq 4d7d3fd latency=805ms upstream=api-16 status=200\nreq 2a143297 latency=151ms upstream=api-37 status=200\nreq 101411c4 latency=433ms upstream=api-20 status=200\nreq 322fc057 latency=404ms upstream=api-7 status=200\nreq 2b3b8cf4 latency=715ms upstream=api-17 status=200\nreq 1877e586 latency=272ms upstream=api-13 status=200\nreq 1c4ee7fd latency=418ms upstream=api-29 status=200\nreq 22d3c0cc latency=16ms upstream=api-4 status=500\nreq d750f6e latency=514ms upstream=api-36 status=200\nreq 1fc286d8 latency=45ms upstream=api-1 status=200\nreq 3855331b latency=857ms upstream=api-26 status=200\nreq 1f1d8d25 latency=564ms upstream=api-18 status=200\nreq 5d84f63 latency=662ms upstream=api-9 status=200\nreq 20217511 latency=69ms upstream=api-5 status=200\nreq ddbf743 latency=564ms upstream=api-31 status=200\nreq 93eaf86 latency=762ms upstream=api-34 status=200\nreq 36c34f52 latency=581ms upstream=api-31 status=200\nreq d5fb0c3 latency=652ms upstream=api-36 status=200\nreq 3a52987 latency=660ms upstream=api-0 status=200\nreq 1d7f6e10 latency=179ms upstream=api-25 status=200\nreq 2341830d latency=569ms upstream=api-15 status=200\nreq 745d687 latency=291ms upstream=api-39 status=200\nreq 1aece1e8 latency=85ms upstream=api-11 status=200\nreq 8cb992e latency=566ms upstream=api-19 status=200\nreq 359869c7 latency=49ms upstream=api-30 status=200\nreq 268c0bad latency=506ms upstream=api-11 status=200\nreq 2e999417 latency=407ms upstream=api-28 status=200\nreq 1bd4e974 latency=577ms upstream=api-39 status=200\nreq 810ad2d latency=383ms upstream=api-16 status=200\nreq 181e5eb9 latency=518ms upstream=api-22 status=200\nreq 1ef2cc6b latency=439ms upstream=api-34 status=200\nreq 1531fa65 latency=184ms upstream=api-39 status=200\nLASTMARK-9f3a req 2adcc57 latency=108ms upstream=api-24 status=200\nctx_search({queries:[\"\"], source:\"ctx_execute:const s=20261031;let a=s>>>0;const r=()=>{a=(a+0x6d2b79f5)>>>0;let t\"})",
|
||||
"sample": "FIRSTMARK-7c1e req 1abd494f latency=367ms upstream=api-7 status=200\nreq 27dd34af latency=471ms upstream=api-17 status=200\nreq 14fa64db latency=252ms upstream=api-7 status=200\nreq 24d54255 latency=287ms upstream=api-2 status=200\nreq 1a4a1c03 latency=595ms upstream=api-8 status=200\nreq 10e959cc latency=205ms upstream=api-34 status=200\nreq 4c33a72 latency=115ms upstream=api-30 status=200\nreq 21870d96 latency=130ms upstream=api-7 status=200"
|
||||
},
|
||||
"d-real-github-json": {
|
||||
"reply": "exit 0 · 219175 B\n ],\n \"state\": \"open\",\n \"locked\": false,\n \"assignees\": [\n \"state\": \"open\",\n \"locked\": false,\n \"assignees\": [\n ],\n \"state\": \"open\",\n \"locked\": false,\n \"assignees\": [\nes\": 0\n },\n \"timeline_url\": \"https://api.github.com/repos/vercel/next.js/issues/100960/timeline\",\n \"performed_via_github_app\": null,\n \"state_reason\": null\n },\n {\n \"url\": \"https://api.github.com/repos/vercel/next.js/issues/100959\",\n \"repository_url\": \"https://api.github.com/repos/vercel/next.js\",\n \"labels_url\": \"https://api.github.com/repos/vercel/next.js/issues/100959/labels{/name}\",\n \"comments_url\": \"https://api.github.com/repos/vercel/next.js/issues/100959/comments\",\n \"events_url\": \"https://api.github.com/repos/vercel/next.js/issues/100959/events\",\n \"html_url\": \"https://github.com/vercel/next.js/issues/100959\",\n \"id\": 6120263378,\n \"node_id\": \"I_kwDOBC3Cis8AAAABbMvO0g\",\n \"number\": 100959,\n \"title\": \"cacheComponents: Link header from next.config headers() is duplicated and grows on every ISR regeneration\",\n \"user\": {\n \"login\": \"linyiru\",\n \"id\": 8616,\n \"node_id\": \"MDQ6VXNlcjg2MTY=\",\n \"avatar_url\": \"https://avatars.githubusercontent.com/u/8616?v=4\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/linyiru\",\n \"html_url\": \"https://github.com/linyiru\",\n \"followers_url\": \"https://api.github.com/users/linyiru/followers\",\n \"following_url\": \"https://api.github.com/users/linyiru/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/linyiru/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/linyiru/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/linyiru/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/linyiru/orgs\",\n \"repos_url\": \"https://api.github.com/users/linyiru/repos\",\n \"events_url\": \"https://api.github.com/users/linyiru/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/linyiru/received_events\",\n \"type\": \"User\",\n \"user_view_type\": \"public\",\n \"site_admin\": false\n },\n \"labels\": [\n {\n \"id\": 8259487517,\n \"node_id\": \"LA_kwDOBC3Cis8AAAAB7E3HHQ\",\n \"url\": \"https://api.github.com/repos/vercel/next.js/labels/Headers\",\n \"name\": \"Headers\",\n \"color\": \"0052cc\",\n \"default\": false,\n \"description\": \"Related to the async headers() function.\",\n \"archived_at\": null,\n \"archived_by\": null\n }\n ],\n \"state\": \"open\",\n \"locked\": false,\n \"assignees\": [\n ],\n \"milestone\": null,\n \"comments\": 0,\n \"created_at\": \"2026-10-30T13:46:40Z\",\n \"updated_at\": \"2026-10-30T13:46:56Z\",\n \"closed_at\": null,\n \"assignee\": null,\n \"author_association\": \"NONE\",\n \"issue_field_values\": [\n ],\n \"milestone\": null,\n \"comments\": 1,\n \"created_at\": \"2026-10-30T13:27:23Z\",\n \"updated_at\": \"2026-10-30T15:59:09Z\",\n \"closed_at\": null,\n \"assignee\": null,\n \"author_association\": \"MEMBER\",\n \"issue_field_values\": [\n\n \"updated_at\": \"2026-10-14T17:23:14Z\",\n \"permissions\": {\n \"actions\": \"write\",\n \"checks\": \"read\",\n \"contents\": \"write\",\n \"deployments\": \"read\",\n \"issues\": \"write\",\n \"metadata\": \"read\",\n \"pull_requests\": \"write\",\n \"statuses\": \"read\",\n \"workflows\": \"write\"\n },\n \"events\": [\n \"check_run\",\n \"check_suite\",\n \"commit_comment\",\n \"delete\",\n \"deployment\",\n \"deployment_status\",\n \"issues\",\n \"issue_comment\",\n \"issue_dependencies\",\n \"pull_request\",\n \"pull_request_review\",\n \"pull_request_review_comment\",\n \"pull_request_review_thread\",\n \"push\",\n \"status\",\n \"sub_issues\",\n \"workflow_job\",\n \"workflow_run\"\n ]\n },\n \"state_reason\": null\n }\n]\nctx_search({queries:[\"\"], source:\"ctx_execute:process.stdout.write(require(\\\"fs\\\").readFileSync(process.env.CTX_FILE\"})"
|
||||
},
|
||||
"d-real-git-log": {
|
||||
"reply": "exit 0 · 191120 B\nview/issues-P1.json\n857d0057 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-P3.json\n97b70365 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-new.json\nca22fc31 2026-10-14 docs(v2): low-token review-lite workflow reusing saved round-1 results\n454aac8c 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-P2.json\n7b440891 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-I3.json\n25147226 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-I1.json\n175a5c2e 2026-10-14 review: docs/v2/review/out/r2/round1/review/v1-migration-sim.json\n9bb3b9d1 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-I1.json\n2044952d 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-I2.json\n9965f8be 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-P0.json\n872b2c84 2026-10-14 review: docs/v2/review/out/r2/round1/review/agent-issue-form.json\nfb72ed3d 2026-10-14 review: docs/v2/review/out/r2/round1/review/issues-I0.json\n41fff459 2026-10-14 review: docs/v2/review/out/r2/round1/review/security.json\nf39d3e28 2026-10-14 review: docs/v2/review/out/r2/round1/review/release-premortem.json\n610c58b5 2026-10-14 review: docs/v2/review/out/r2/round1/review/windows.json\naf3b35a4 2026-10-14 review: docs/v2/review/out/r2/round1/review/dx-docs.json\nad4e089c 2026-10-14 review: docs/v2/review/out/r2/round1/review/prompt.json\n2f54e284 2026-10-14 review: docs/v2/review/out/r2/round1/review/qa.json\n43afdb08 2026-10-14 review: docs/v2/review/out/r2/round1/review/algorithms.json\n9aebf588 2026-10-14 review: docs/v2/review/out/r2/round1/review/agent-gemini-cli.json\n7d7aa3f4 2026-10-14 review: docs/v2/review/out/r2/round1/review/agent-pi.json\na232e842 2026-10-14 review: docs/v2/review/out/r2/round1/review/hooks-perf.json\nfd498eff 2026-10-14 review: docs/v2/review/out/r2/round1/review/agent-qwen-code.json\n317242fe 2026-10-14 review: docs/v2/review/out/r2/round1/review/agent-opencode-2.json\ndc3a4966 2026-10-14 review: docs/v2/review/out/r2/round1/review/storage.json\n57cb5442 2026-10-14 review: docs/v2/review/out/r2/round1/review/agent-zcode.json\nf08f81c9 2026-10-14 review: docs/v2/review/out/r2/round1/review/agent-vs-code-copilot.json\n212b81f0 2026-10-14 review: docs/v2/review/out/r2/round1/review/agent-kiro.json\n51243aa2 2026-10-14 review: docs/v2/review/out/r2/round1/review/agent-copilot-cli.json\nc5afe97a 2026-10-14 review: docs/v2/review/out/r2/round1/review/evidence.json\nee914bf7 2026-10-14 review: docs/v2/review/out/r2/round1/review/agent-claude-code.json\n21cbf21e 2026-10-14 review: docs/v2/review/out/r2/round1/review/consistency.json\nac25a4b5 2026-10-14 review: docs/v2/review/out/r2/round1/review/agent-codex-cli.json\nctx_search({queries:[\"\"], source:\"ctx_execute:process.stdout.write(require(\\\"fs\\\").readFileSync(process.env.CTX_FILE\"})"
|
||||
},
|
||||
"e-debug-session": {
|
||||
"reply": "<context_mode_state session=\"bench-e-debug-session\" upto=\"6\">\nsource s6: Bash:cat data/github-issues.json#toolu_bench_006 (60309 B)\nsource s5: Bash:cat data/access.log#toolu_bench_005 (46215 B)\nsource s4: Bash:cat data/git-log.txt#toolu_bench_004 (11894 B)\nsource s3: Bash:cat data/build-output.txt#toolu_bench_003 (6583 B)\nsource s2: Bash:cat data/tsc-errors.txt#toolu_bench_002 (5022 B)\nsource s1: Bash:cat data/test-output.txt#toolu_bench_001 (6174 B)\nmore: ctx_search(queries:[], scope:\"session\")\n</context_mode_state>"
|
||||
},
|
||||
"e-long-session": {
|
||||
"reply": "<context_mode_state session=\"bench-e-long-session\" upto=\"40\">\nsource s14: Bash:run step 39#toolu_bench_040 (11045 B)\nsource s13: Bash:run step 38#toolu_bench_039 (11162 B)\nsource s12: Bash:run step 37#toolu_bench_038 (11159 B)\nsource s11: Bash:run step 36#toolu_bench_037 (11189 B)\nsource s10: Bash:run step 35#toolu_bench_036 (11133 B)\nsource sz: Bash:run step 34#toolu_bench_035 (11186 B)\nsource sy: Bash:run step 33#toolu_bench_034 (11146 B)\nsource sx: Bash:run step 32#toolu_bench_033 (11159 B)\nsource sw: Bash:run step 31#toolu_bench_032 (11062 B)\nsource sv: Bash:run step 30#toolu_bench_031 (11117 B)\nsource su: Bash:run step 29#toolu_bench_030 (11147 B)\nsource st: Bash:run step 28#toolu_bench_029 (11237 B)\nsource ss: Bash:run step 27#toolu_bench_028 (11097 B)\nsource sr: Bash:run step 26#toolu_bench_027 (11127 B)\nsource sq: Bash:run step 25#toolu_bench_026 (11125 B)\nsource sp: Bash:run step 24#toolu_bench_025 (11140 B)\nsource so: Bash:run step 23#toolu_bench_024 (11152 B)\nsource sn: Bash:run step 22#toolu_bench_023 (11084 B)\nsource sm: Bash:run step 21#toolu_bench_022 (11150 B)\nsource sl: Bash:run step 20#toolu_bench_021 (11135 B)\nsource sk: Bash:run step 19#toolu_bench_020 (11234 B)\nsource sj: Bash:run step 18#toolu_bench_019 (11063 B)\nsource si: Bash:run step 17#toolu_bench_018 (11106 B)\nsource sh: Bash:run step 16#toolu_bench_017 (11100 B)\nsource sg: Bash:run step 15#toolu_bench_016 (11149 B)\nsource sf: Bash:run step 14#toolu_bench_015 (11160 B)\nsource se: Bash:run step 13#toolu_bench_014 (11069 B)\nsource sd: Bash:run step 12#toolu_bench_013 (11124 B)\nsource sc: Bash:run step 11#toolu_bench_012 (11209 B)\nsource sb: Bash:run step 10#toolu_bench_011 (11134 B)\nsource sa: Bash:run step 9#toolu_bench_010 (10848 B)\nsource s9: Bash:run step 8#toolu_bench_009 (10900 B)\nsource s8: Bash:run step 7#toolu_bench_008 (10863 B)\nsource s7: Bash:run step 6#toolu_bench_007 (10882 B)\nsource s6: Bash:run step 5#toolu_bench_006 (10877 B)\nmore: ctx_search(queries:[], scope:\"session\")\n</context_mode_state>",
|
||||
"sample": "step 0 line 0 id=1abd494f took=367ms ok\nstep 0 line 1 id=3353a954 took=601ms ok\nstep 0 line 2 id=1a10c792 took=573ms ok\nstep 0 line 3 id=10bcbe3b took=164ms ok\nstep 0 line 4 id=24d54255 took=287ms ok\nstep 0 line 5 id=3804fb41 took=396ms ok\nstep 0 line 6 id=cbe81f3 took=326ms ok\nstep 0 line 7 id=d95a711 took=769ms ok\nstep 0 line 8 id=4c33a72 took=115ms ok\nstep 0 line 9 id=334c9539 took=506ms ok\nstep 0 line 10 id=b3a77b0 took=468ms ok\nstep 0 line 11 id=2ef7e665 took=379ms ok\nstep 0 line 12 id=2421d419 took=732ms ok\nstep 0 line 13 id=38e143c took=19ms ok\nstep 0 line 14 id=d28c36f took=170ms ok\nstep 0 line 15 id=157644a1 took=753ms ok\nstep 0 line 16 id=29e4c0c9 took=645ms ok\nstep 0 line 17 id=2497b3f1 took=747ms ok\nstep 0 line 18 id=336cc386 took=280ms ok\nstep 0 line 19 id=198538e9 took=278ms ok\nstep 0 line 20 id=28007538 took=671ms ok\nstep 0 line 21 id=259b7911 took=282ms ok\nstep 0 line 22 id=2865356 took=159ms ok\nstep 0 line 23 id=10170d08 took=258ms ok\nstep 0 line 24 id=240da5cc took=721ms ok\nstep 0 line 25 id=22fa521f took=558ms ok\nstep 0 line 26 id=192296db took=729ms ok\nstep 0 line 27 id=25ae3a72 took=445ms ok\nstep 0 line 28 id=1032b396 took=22ms ok\nstep 0 line 29 id=2638141b took=335ms ok\nstep 0 line 30 id=1ad01242 took=637ms ok\nstep 0 line 31 id=26d3b897 took=78ms ok\nstep 0 line 32 id=833aae0 took=849ms ok\nstep 0 line 33 id=4a94eed took=254ms ok\nstep 0 line 34 id=125b1e44 took=693ms ok\nstep 0 line 35 id=f08e52b took=309ms ok\nstep 0 line 36 id=4c2899b took=806ms ok\nstep 0 line 37 id=396f1550 took=519ms ok\nstep 0 line 38 id=1c6f1aad took=724ms ok\nstep 0 line 39 id=26f4c9d0 took=448ms ok\nstep 0 line 40 id=19fb04da took=533ms ok\nstep 0 line 41 id=b00b186 took=114ms ok\nstep 0 line 42 id=1a923d74 took=729ms ok\nstep 0 line 43 id=2894a82a took=319ms ok\nstep 0 line 44 id=1d58ddb7 took=496ms WARN slow upstream\nstep 0 line 45 id=3414d9e8 took=888ms ok\nstep 0 line 46 id=1c5254b took=395ms ok\nstep 0 line 47 id=23b6a382 took=298ms ok\nstep 0 line 48 id=1e1554fa took=128ms ok\nstep 0 line 49 id=2a4a6a59 took=300ms ok\nstep 0 line 50 id=11783a5b took=184ms ok\nstep 0 line 51 id=b792053 took=244ms ok\nstep 0 line 52 id=1ee7ad5b took=189ms ok\nstep 0 line 53 id=2ded71b0 took=19ms ok\nstep 0 line 54 id=1b2e9f82 took=339ms ok\nstep 0 line 55 id=11b2d58 took=464ms ok\nstep 0 line 56 id=2cc0c26 took=816ms ok\nstep 0 line 57 id=beb66df took=29ms ok\nstep 0 line 58 id=1a075484 took=181ms ok\nstep 0 line 59 id=384d857d took=193ms ok\nstep 0 line 60 id=24868b3a took=873ms ok\nstep 0 line 61 id=3af8e6f7 took=557ms ok\nstep 0 line 62 id=32be555 took=496ms ok\nstep 0 line 63 id=c7925e4 took=10ms ok\nstep 0 line 64 id=1f1e9eb4 took=376ms ok\nstep 0 line 65 id=2e057735 took=639ms ok\nstep 0 line 66 id=398e4fc1 took=808ms ok\nstep 0 line 67 id=315bee7d took=217ms ok\nstep 0 line 68 id=223a5ded took=793ms ok\nstep 0 line 69 id=3241919f took=669ms ok\nstep 0 line 70 id=21cff44e took=105ms ok\nstep 0 line 71 id=5e6885c took=691ms ok\nstep 0 line 72 id=9e5ddae took=324ms ok\nstep 0 line 73 id=109832e0 took=356ms ok\nstep 0 line 74 id=28db4043 took=22ms ok\nstep 0 line 75 id=1ec6fc34 took=409ms ok\nstep 0 line 76 id=27d46512 took=402ms ok\nstep 0 line 77 id=1f49a27a took=627ms ok\nstep 0 line 78 id=eaac22e took=525ms ok\nstep 0 line 79 id=233865c7 took=53ms ok\nstep 0 line 80 id=2c0bfccd took=721ms ok\nstep 0 line 81 id=13fd104b took=760ms ok\nstep 0 line 82 id=2b961317 took=9ms ok\nstep 0 line 83 id=2603e426 took=787ms ok\nstep 0 line 84 id=122bd2e took=667ms ok\nstep 0 line 85 id=3b4af8d0 took=821ms ok\nstep 0 line 86 id=1f68f448 took=732ms ok\nstep 0 line 87 id=36d86731 took=783ms ok\nstep 0 line 88 id=19114d68 took=172ms ok\nstep 0 line 89 id=12fc5423 took=47ms ok\nstep 0 line 90 id=582674c took=815ms ok\nstep 0 line 91 id=dab881 took=321ms ok\nstep 0 line 92 id=15bf6b4 took=109ms ok\nstep 0 line 93 id=b0e69fd took=165ms ok\nstep 0 line 94 id=312296de took=165ms ok\nstep 0 line 95 id=161f7eaa took=621ms ok\nstep 0 line 96 id=1619c9a9 took=164ms ok\nstep 0 line 97 id=104eb2cf took=154ms ok\nstep 0 line 98 id=a5501c took=419ms ok\nstep 0 line 99 id=27925411 took=538ms ok\nstep 0 line 100 id=2c10c327 took=255ms ok\nstep 0 line 101 id=32b16183 took=678ms ok\nstep 0 line 102 id=9fb6f46 took=641ms ok\nstep 0 line 103 id=74a0917 took=328ms ok\nstep 0 line 104 id=4442d6b took=138ms ok\nstep 0 line 105 id=1c2f076f took=160ms ok\nstep 0 line 106 id=3270b543 took=503ms ok\nstep 0 line 107 id=125fbc4f took=741ms ok\nstep 0 line 108 id=1b3857d8 took=69ms ok\nstep 0 line 109 id=2002f70e took=518ms ok\nstep 0 line 110 id=31bcb38f took=394ms ok\nstep 0 line 111 id=1242e7a0 took=685ms ok\nstep 0 line 112 id=d905203 took=215ms ok\nstep 0 line 113 id=2a76a9dc took=812ms ok\nstep 0 line 114 id=142aa9c7 took=722ms ok\nstep 0 line 115 id=2797b7b9 took=684ms ok\nstep 0 line 116 id=33f1b3db took=528ms ok\nstep 0 line 117 id=1b813687 took=755ms ok\nstep 0 line 118 id=2f93c6dc took=191ms ok\nstep Line truncated
|
||||
},
|
||||
"f-read-large-file": {
|
||||
"reply": "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"context-mode: 46216-byte file, over the one-read limit. Run mcp__plugin_context-mode_context-mode__ctx_execute(language, code, file=\\\"/private/var/folders/df/nbmn_hp51n177rvbz8zh44sh0000gn/T/cm-bench-wSYFNy/project/data/access.log\\\") and print only the answer.\"}}"
|
||||
},
|
||||
"f-read-big-source": {
|
||||
"reply": "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"context-mode: 61576-byte file, over the one-read limit. Run mcp__plugin_context-mode_context-mode__ctx_execute(language, code, file=\\\"/private/var/folders/df/nbmn_hp51n177rvbz8zh44sh0000gn/T/cm-bench-o6o2Oo/project/data/source-big.ts\\\") and print only the answer.\"}}"
|
||||
},
|
||||
"f-read-small-file": {
|
||||
"reply": "# Fixture source\n\nCopied byte for byte from github.com/mksglu/context-mode at commit\n90af14e34bf35120c3310f7a75f54fa99d2cabba (origin/main):\n\n- `tests/fixtures/*` (15 files) -> `bench/fixtures/data/`\n- `skills/context-mode/SKILL.md` (as `skill-main.md`, GS5 allows no other SKILL.md) and `skills/context-mode/references/{anti-patterns,patterns-javascript,patterns-python,patterns-shell}.md` -> `bench/fixtures/data/skills/`\n\nThe skill files are inputs to two v1 index+search scenarios (tests/live-benchmark.ts).\nThey are fixtures here, not v2 skills.\n\n## Added for the bench suite (2026-10-31)\n\nCaptured on 2026-10-31. No tokens, emails or home paths in any file (checked with grep).\n\n| File | Source | Bytes | sha256 |\n|---|---|---:|---|\n| sqlite-fts5-docs.html | https://www.sqlite.org/fts5.html, as served | 215354 | de3092630358518a6869bf047055b3938e18b476e3fbc54f4e2146d1e593497f |\n| github-api-issues-large.json | `GET https://api.github.com/repos/vercel/next.js/issues?per_page=30&state=open`, unauthenticated | 219175 | bd2bdb943de007b7bb57d4e4a53a01ad801cf57606a3228682b39d05eb8a5e16 |\n| source-big.ts | src/core/contracts/constants.ts of this repo at efe519b1 | 61576 | 7b4ba6812418434b9c682875de2454668ed98f3e0791f9e2b528ac034ec6e725 |\n| git-log-large.txt | `git log -n 2000 --format='%h %ad %s' --date=short` of this repo at efe519b1 | 191120 | 028317819bc1a93fcfbeeba2d5ffea829fe4c439e3889d688f76fbb11bb913ad |\n| npm-install-log.txt | `npm install --no-package-lock --loglevel http --no-audit --no-fund` of this repo's devDependencies, clean cache home | 37761 | 54fe053a4c8ece97a96bef23b019a9120a230af1e17eddd70d4a046dd48a9af0 |\n\nSynthetic inputs (seed 20261031, generated in the scenario code, not stored): d-synth-120k, d-synth-1m, e-long-session.\n"
|
||||
},
|
||||
"f-webfetch": {
|
||||
"reply": "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"context-mode: WebFetch sends its body into the conversation.\\nRun it here instead; the full output is indexed and only the part that matches your intent comes back.\\nTool: mcp__plugin_context-mode_context-mode__ctx_index, then mcp__plugin_context-mode_context-mode__ctx_search\\n{\\\"url\\\":\\\"https://www.sqlite.org/fts5.html\\\"}\"}}"
|
||||
},
|
||||
"f-bash-dump-post": {
|
||||
"reply": "00ecd0d7 2026-10-14 review: docs/v2/review/TEST-TRIAGE-r2.md\n\nmcp__plugin_context-mode_context-mode__ctx_search({queries:[\"cat data/git-log-large.txt\"], source:\"s1\"}) searches the whole output (191120 B)."
|
||||
},
|
||||
"f-bash-curl-post": {
|
||||
"reply": " \"push\",\n \"status\",\n\n \"workflow_run\"\n ]\n },\n\n \"state_reason\": null\n }\n]\nmcp__plugin_context-mode_context-mode__ctx_search({queries:[\"curl -s https://api.github.com/repos/vercel/next.js/issues?per_page=30\"], source:\"s1\"}) searches the whole output (219175 B)."
|
||||
},
|
||||
"f-read-vite-config": {
|
||||
"reply": "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"context-mode: 91362-byte file, over the one-read limit. Run mcp__plugin_context-mode_context-mode__ctx_execute(language, code, file=\\\"/private/var/folders/df/nbmn_hp51n177rvbz8zh44sh0000gn/T/cm-bench-3dp66j/project/data/vite-config.ts\\\") and print only the answer.\"}}"
|
||||
},
|
||||
"f-webfetch-vite-docs": {
|
||||
"reply": "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"context-mode: WebFetch sends its body into the conversation.\\nRun it here instead; the full output is indexed and only the part that matches your intent comes back.\\nTool: mcp__plugin_context-mode_context-mode__ctx_index, then mcp__plugin_context-mode_context-mode__ctx_search\\n{\\\"url\\\":\\\"https://vite.dev/guide/features.html\\\"}\"}}"
|
||||
},
|
||||
"g-search-latency": {
|
||||
"reply": "Query \"export\":\nplaywright-snapshot.txt #4: ```yaml\n - generic [ref=e130]:\n - text: 13 points by\n - link \"matt_d\" [ref=e131] [cursor=pointer]:\n - /url: user?id=matt_d\n - generic \"2026-02-18T21:10:09 1771449009\" [ref=e132]:\n - link \"1 hour ago\" [ref=e133] [cursor=pointer]:\n - /url: item?id=47066446\n - text: \"|\"\n - link \"hide\" [ref=e134] [cursor=pointer]:\n - /url: hide?id=47066446&goto=news\n - text: \"|\"\n - link \"1 comment\" [ref=e135] [cursor=pointer]:\n - /url: item?id=47066446\n - row [ref=e136]\n - 'row \"6. upvote Show HN: CIA World Factbook Archive (1990-2025), searchable and exportable (cia-factbook-archive.fly.dev)\" [ref=e137]':\n - cell \"6.\" [ref=e138]\n - cell \"upvote\" [ref=e139]:\n - link \"upvote\" [ref=e141] [cursor=pointer]:\n - /url: vote?id=47114530&how=up&goto=news\n - generic \"upvote\" [ref=e142]\n - 'cell \"Show HN: CIA World Factbook Archive (1990-2025), searchable and exportable (cia-factbook-archive.fly.dev)\" [ref=e143]':\n - generic [ref=e144]:\n - 'link \"Show HN: CIA World Factbook Archive (1990-2025), searchable and exportable\" [ref=e145] [cursor=pointer]':\n - /url: https://cia-factbook-archive.fly.dev/\n - generic [ref=e146]:\n - text: (\n - link \"cia-factbook-archive.fly.dev\" [ref=e147] [cursor=pointer]:\n - /url: from?site=cia-factbook-archive.fly.dev\n - text: )\n - row \"187 points by MilkMp 7 hours ago | hide | 40 comments\" [ref=e148]:\n - cell [ref=e149]\n - cell \"187 points by MilkMp 7 hours ago | hide | 40 comments\" [ref=e150]:\n - generic [ref=e151]:\n - text: 187 points by\n\n```\n[lines 37-71 of 71]\nanalytics.csv #7: 166,2026-02-23T11:15:15Z,user_16,export,project,1258,success,10.0.3.201,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\n167,2026-02-23T11:18:22Z,user_17,view,task,191,success,10.0.4.10,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\n168,2026-02-23T11:21:29Z,user_18,view,document,68,error,10.0.4.11,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15\n169,2026-02-23T11:24:36Z,user_19,update,comment,34000,timeout,10.0.5.75,Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0\nanalytics.csv #4: 96,2026-02-23T09:45:05Z,user_46,export,project,1148,success,10.0.3.201,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\n97,2026-02-23T09:48:12Z,user_47,view,task,81,success,10.0.4.10,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\n98,2026-02-23T09:51:19Z,user_48,view,document,58,error,10.0.4.11,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15\n99,2026-02-23T09:54:26Z,user_49,update,comment,34000,timeout,10.0.5.75,Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0\nanalytics.csv #16: 0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\n376,2026-02-23T15:45:45Z,user_26,export,project,1188,success,10.0.3.201,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\n377,2026-02-23T15:48:52Z,user_27,view,task,121,success,10.0.4.10,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\n378,2026-02-23T15:51:59Z,user_28,view,document,68,error,10.0.4.11,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15\n379,2026-02-23T15:54:06Z,user_29,update,comment,34000,timeout,10.0.5.75,Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0\nanalytics.csv #1: 26,2026-02-23T08:15:55Z,user_26,export,project,1238,success,10.0.3.201,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\n27,2026-02-23T08:18:02Z,user_27,view,task,171,success,10.0.4.10,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\n28,2026-02-23T08:21:09Z,user_28,view,document,78,error,10.0.4.11,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 SafarLine truncated
|
||||
},
|
||||
"g-session-total": {
|
||||
"reply": "Query \"failed tests\":\nBash:cat data/test-output.txt#toolu_bench_001 #157: Tests 4 failed | 108 passed (112)\nBash:cat data/test-output.txt#toolu_bench_001 #156: Test Files 4 failed | 26 passed (30)\nBash:cat data/test-output.txt#toolu_bench_001 #9: ✓ src/components/Card.test.tsx (4 tests) 52ms\nMore: ctx_search({queries:[\"failed tests\"], scope:\"session\", offset:3})\nQuery \"TS2339 property\":\nBash:cat data/tsc-errors.txt#toolu_bench_002 #1: src/components/UserList.tsx(45,8): error TS2339: Property 'fullName' does not exist on type 'User'.\nBash:cat data/tsc-errors.txt#toolu_bench_002 #23: src/lib/auth.ts(41,18): error TS2339: Property 'accessToken' does not exist on type 'JWT'.\nBash:cat data/tsc-errors.txt#toolu_bench_002 #32: src/utils/helpers.ts(71,14): error TS2339: Property 'trim' does not exist on type 'number'.\nBash:cat data/tsc-errors.txt#toolu_bench_002 #8: src/components/Dashboard.tsx(34,19): error TS2339: Property 'metrics' does not exist on type 'DashboardData'.\nBash:cat data/tsc-errors.txt#toolu_bench_002 #37: src/lib/database.ts(42,9): error TS2339: Property 'transaction' does not exist on type 'PrismaClient'.\nMore: ctx_search({queries:[\"TS2339 property\"], scope:\"session\", offset:5})\nQuery \"status 500\":\nBash:cat data/test-output.txt#toolu_bench_001 #102: ✓ retrieves subscription status 80ms\nBash:cat data/playwright-snapshot.txt#toolu_bench_008 #943: - /url: https://twitter.com/Gavriel_Cohen/status/2025603982769410356\nBash:cat data/analytics.csv#toolu_bench_007 #0: id,timestamp,user_id,action,resource,duration_ms,status,ip,user_agent\nBash:cat data/access.log#toolu_bench_005 #15: 192.168.4.101 - - [23/Feb/2026:10:00:31 +0000] \"GET /api/dashboard/analytics HTTP/1.1\" 500 234 25ms\nBash:cat data/access.log#toolu_bench_005 #55: 192.168.4.101 - - [23/Feb/2026:10:01:51 +0000] \"GET /api/dashboard/analytics HTTP/1.1\" 500 345 55ms\nMore: ctx_search({queries:[\"status 500\"], scope:\"session\", offset:5})"
|
||||
}
|
||||
}
|
||||
}
|
||||
+32
-18
@@ -5,14 +5,17 @@
|
||||
// node run.mjs --runs 5 n runs per scenario (the median, min, max and sigma are over these)
|
||||
// node run.mjs --bundle <dir> built bundle dir (default ../release-out; built if missing)
|
||||
// node run.mjs --no-write print the tables, write nothing
|
||||
// node run.mjs --pages rebuild the group READMEs from the newest results file and its -replies.json
|
||||
// node run.mjs --save-replies <id...> run cases once, store their reply text in the newest -replies.json, then rebuild pages
|
||||
// Writes results/<date>-<os>-<arch>.json (raw samples) and results/<date>-<os>-<arch>.md (tables), and one README.md per
|
||||
// group folder (inputs with sha256, commands). Exit 1 only when a scenario errors; numbers never fail a run.
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { devVersionLabel } from "../scripts/release/dev-version.mjs";
|
||||
import { BENCH, REPO, DATA, sandbox, startServer, stats, sha256, tokens, qualityMisses } from "./suite/lib.mjs";
|
||||
import { groupPage } from "./suite/pages.mjs";
|
||||
|
||||
const argv = process.argv.slice(2);
|
||||
const opt = (name, d) => { const i = argv.indexOf(name); return i >= 0 ? argv[i + 1] : d; };
|
||||
@@ -22,14 +25,27 @@ const WRITE = !argv.includes("--no-write");
|
||||
const skip = new Set(["--runs", "--bundle"].flatMap((f) => (argv.includes(f) ? [argv[argv.indexOf(f) + 1]] : [])));
|
||||
const filters = argv.filter((a) => !a.startsWith("--") && !skip.has(a));
|
||||
if (!Number.isInteger(RUNS) || RUNS < 1) { console.error("--runs needs a positive integer"); process.exit(2); }
|
||||
|
||||
if (!existsSync(path.join(BUNDLE, "server.mjs"))) {
|
||||
execFileSync(process.execPath, [path.join(REPO, "build", "build.mjs"), "--out", BUNDLE], { cwd: REPO, stdio: "inherit" });
|
||||
}
|
||||
const PAGES = argv.includes("--pages"), SAVE_REPLIES = argv.includes("--save-replies");
|
||||
const GROUPS = ["a-sandbox", "b-retrieval", "c-batch", "d-externalize", "e-continuity", "f-hook-redirect", "g-overhead"];
|
||||
const groups = [];
|
||||
for (const g of GROUPS) groups.push({ dir: g, ...(await import(`./${g}/index.mjs`)).default });
|
||||
|
||||
// Group pages are built from stored data only: the newest results file, its -replies.json twin and the input files.
|
||||
const RESULTS = path.join(BENCH, "results");
|
||||
const newestResults = () => readdirSync(RESULTS).filter((f) => /^\d{4}-\d{2}-\d{2}-[a-z0-9]+-[a-z0-9]+\.json$/.test(f)).sort().at(-1);
|
||||
const repliesPath = (f) => path.join(RESULTS, f.replace(/\.json$/, "-replies.json"));
|
||||
function writePages(file) {
|
||||
const r = JSON.parse(readFileSync(path.join(RESULTS, file), "utf8"));
|
||||
const rp = existsSync(repliesPath(file)) ? JSON.parse(readFileSync(repliesPath(file), "utf8")) : { date: r.date, replies: {} };
|
||||
const ctx = { results: r.results, manifest: r.fixtures, runs: r.runs, resultsFile: file, replies: rp.replies, repliesDate: rp.date };
|
||||
for (const g of groups) writeFileSync(path.join(BENCH, g.dir, "README.md"), groupPage(g, ctx));
|
||||
console.log(`pages: ${groups.length} group READMEs from results/${file}`);
|
||||
}
|
||||
if (PAGES) { writePages(newestResults()); process.exit(0); }
|
||||
|
||||
if (!existsSync(path.join(BUNDLE, "server.mjs"))) {
|
||||
execFileSync(process.execPath, [path.join(REPO, "build", "build.mjs"), "--out", BUNDLE], { cwd: REPO, stdio: "inherit" });
|
||||
}
|
||||
const git = (...a) => { try { return execFileSync("git", a, { cwd: REPO, encoding: "utf8" }).trim(); } catch { return null; } };
|
||||
const commit = git("rev-parse", "HEAD");
|
||||
const OWN = /^(\?\? |.. )(release-out\/?|bench\/results\/.*|bench\/[a-z-]+\/README\.md)$/; // files this run writes or builds do not make the tree dirty
|
||||
@@ -45,6 +61,7 @@ const T0 = performance.now();
|
||||
const matches = (g, s) => filters.length === 0 || filters.some((f) => g.dir === f || s.id === f || s.id.startsWith(f));
|
||||
|
||||
const results = [];
|
||||
const replies = {};
|
||||
let errors = 0;
|
||||
for (const g of groups) {
|
||||
for (const s of g.scenarios) {
|
||||
@@ -60,6 +77,7 @@ for (const g of groups) {
|
||||
if (r.error) { err = r.error; break; }
|
||||
for (const [k, v] of Object.entries(r.metrics)) if (v !== null && v !== undefined) (samples[k] ??= []).push(typeof v === "boolean" ? Number(v) : v);
|
||||
ok = ok && r.ok !== false; if (r.note) note = r.note;
|
||||
if (r.reply !== undefined) replies[s.id] = { reply: r.reply, ...(r.sample !== undefined ? { sample: r.sample } : {}) };
|
||||
} catch (e) { err = String(e.message ?? e); }
|
||||
finally { try { await client?.close(); } catch { /* gone */ } sb.dispose(); }
|
||||
}
|
||||
@@ -93,22 +111,18 @@ for (const g of groups) {
|
||||
}
|
||||
console.log("\n" + md.join("\n"));
|
||||
|
||||
if (WRITE) {
|
||||
if (SAVE_REPLIES) {
|
||||
// Keep the committed numbers; add only the reply text of the cases just run (one run each is enough: bytes repeat).
|
||||
const file = newestResults(), p = repliesPath(file);
|
||||
const old = existsSync(p) ? JSON.parse(readFileSync(p, "utf8")) : { date, replies: {} };
|
||||
writeFileSync(p, JSON.stringify({ date: old.date ?? date, replies: { ...old.replies, ...replies } }, null, 2) + "\n");
|
||||
writePages(file);
|
||||
} else if (WRITE) {
|
||||
mkdirSync(path.join(BENCH, "results"), { recursive: true });
|
||||
writeFileSync(path.join(BENCH, "results", `${tag}.json`), JSON.stringify(out, null, 2) + "\n");
|
||||
writeFileSync(path.join(BENCH, "results", `${tag}.md`), md.join("\n") + "\n");
|
||||
for (const g of groups) {
|
||||
const rs = g.scenarios.filter((s) => filters.length === 0 || matches(g, s));
|
||||
if (filters.length) continue; // group READMEs are written only by a full run
|
||||
const l = [`# ${g.title}`, "", g.blurb, "", `Run this group: \`cd bench && node run.mjs ${g.dir}\`. Latest tables: [results/${tag}.md](../results/${tag}.md).`, ""];
|
||||
for (const s of rs) {
|
||||
l.push(`## ${s.id}`, "", s.title, "", `- Command: \`${s.command}\``);
|
||||
if ((s.inputs ?? []).length) for (const f of s.inputs) l.push(`- Input: \`fixtures/data/${f}\`${manifest[f] ? `, ${manifest[f].bytes} B, sha256 ${manifest[f].sha256}` : ""}`);
|
||||
else l.push(s.synthetic ? "- Input: synthetic, generated in the scenario with a fixed seed (20261031)" : "- Input: none (small payloads built in the scenario)");
|
||||
l.push("");
|
||||
}
|
||||
writeFileSync(path.join(BENCH, g.dir, "README.md"), l.join("\n"));
|
||||
}
|
||||
writeFileSync(repliesPath(`${tag}.json`), JSON.stringify({ date, replies }, null, 2) + "\n");
|
||||
if (filters.length === 0) writePages(`${tag}.json`); // group READMEs are written only by a full run
|
||||
}
|
||||
const misses = qualityMisses(results);
|
||||
if (misses.length) {
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
// Group README pages (D-BENCH-PAGES-1): one plain-language section per case, built only from stored data: the results
|
||||
// file (numbers), its -replies.json twin (the reply text the agent got back) and the input files (sample, sha256).
|
||||
import { existsSync, readFileSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { DATA, bytes } from "./lib.mjs";
|
||||
|
||||
const fmt = (n) => Math.round(n).toLocaleString("en-US");
|
||||
const ms1 = (n) => n.toFixed(1);
|
||||
export const keptOut = (raw, after) => (Math.round((1 - after / raw) * 1000) / 10).toFixed(1);
|
||||
export const docsLink = (id) => `https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=bench&utm_content=${id}`;
|
||||
|
||||
/** A fenced block whose fence is longer than any backtick run inside the text. */
|
||||
export function fence(text, lang = "text") {
|
||||
const run = Math.max(2, ...(text.match(/`+/g) ?? []).map((s) => s.length));
|
||||
const f = "`".repeat(run + 1);
|
||||
return [f + lang, text.replace(/\s+$/, ""), f];
|
||||
}
|
||||
|
||||
/** The first lines of a text, long lines cut; a one-line file shows its first characters instead. */
|
||||
export function head(text, { lines = 8, width = 160, chars = 480 } = {}) {
|
||||
const all = text.replace(/\n$/, "").split("\n");
|
||||
if (all.length === 1) {
|
||||
const cut = text.length > chars;
|
||||
return { body: cut ? text.slice(0, chars) + " ..." : text, note: cut ? `The output is one line of ${fmt(bytes(text))} B. These are its first ${chars} characters.` : "" };
|
||||
}
|
||||
const pick = all.slice(0, lines);
|
||||
const cut = pick.some((l) => l.length > width);
|
||||
const body = pick.map((l) => (l.length > width ? l.slice(0, width) + " ..." : l)).join("\n");
|
||||
const notes = [];
|
||||
if (all.length > lines) notes.push(`First ${lines} of ${fmt(all.length)} lines.`);
|
||||
if (cut) notes.push(`Lines over ${width} characters are cut.`);
|
||||
return { body, note: notes.join(" ") };
|
||||
}
|
||||
|
||||
export const INTRO = {
|
||||
"a-sandbox": [
|
||||
"Each case here is one tool output an agent reads every day: docs, test runs, logs, API replies.",
|
||||
"Without Context Mode the whole output goes into the chat. With Context Mode a short script reads it in a sandbox.",
|
||||
"The agent gets only the lines the script prints, and the raw output stays out of the chat.",
|
||||
],
|
||||
"b-retrieval": [
|
||||
"Each case here is a document the agent needs a few answers from: library docs, a skill file, a tool list, a docs page.",
|
||||
"Without Context Mode the whole document goes into the chat. With Context Mode it goes into a local search index.",
|
||||
"The agent asks its questions and gets back only the parts that match.",
|
||||
],
|
||||
"c-batch": [
|
||||
"Each case here runs a few commands to check the state of a project.",
|
||||
"Without Context Mode each command is its own call, and all output goes into the chat.",
|
||||
"With Context Mode one ctx_batch call runs them all and answers the questions in one short reply.",
|
||||
],
|
||||
"d-externalize": [
|
||||
"Each case here prints a very large output, more than 100 KB.",
|
||||
"Without Context Mode all of it goes into the chat. With Context Mode the full output goes into a local search index.",
|
||||
"The agent gets the start and a pointer, and a search finds any line later: here the first, middle and last line.",
|
||||
],
|
||||
"e-continuity": [
|
||||
"Each case here is a work session that grows until the agent compacts the chat.",
|
||||
"Without Context Mode the agent needs the old tool outputs back to pick up the work.",
|
||||
"With Context Mode the hooks keep a journal of the session, and ctx_resume gives back a short summary.",
|
||||
],
|
||||
"f-hook-redirect": [
|
||||
"Each case here is a tool call that would put a large file, page or output into the chat.",
|
||||
"Without Context Mode the whole thing goes in. With Context Mode a hook steps in first.",
|
||||
"It sends the call to a context-mode tool, or it swaps the output for a short summary.",
|
||||
],
|
||||
"g-overhead": [
|
||||
"Each case here shows what Context Mode costs: the time a hook adds to each tool call, search time and index time.",
|
||||
"The hook cases compare a hook process with a bare Node start, for each of the 10 agents.",
|
||||
"The last case adds up a full debugging session: what went into the chat and what stayed out.",
|
||||
],
|
||||
};
|
||||
|
||||
const WHAT = {
|
||||
"a-context7-react-docs": "Look up the React useEffect docs through Context7.",
|
||||
"a-context7-nextjs-docs": "Look up the Next.js App Router docs through Context7.",
|
||||
"a-context7-tailwind-docs": "Look up the Tailwind CSS docs through Context7.",
|
||||
"a-playwright-snapshot": "Take a Playwright snapshot of the Hacker News front page.",
|
||||
"a-playwright-network": "List the network requests of a page in Playwright.",
|
||||
"a-github-prs": "List the open pull requests of vercel/next.js.",
|
||||
"a-github-issues": "List the open issues of facebook/react.",
|
||||
"a-test-output": "Run a test suite of 30 test files.",
|
||||
"a-tsc-errors": "Type-check a project that has 50 TypeScript errors.",
|
||||
"a-build-output": "Build a Next.js app.",
|
||||
"a-mcp-tools": "Read the list of 40 tools that an MCP server offers.",
|
||||
"a-access": "Read 500 lines of an nginx access log.",
|
||||
"a-git-log": "Read 150 commits of a git log.",
|
||||
"a-analytics": "Read an analytics CSV file with 500 rows.",
|
||||
"a-github-api-issues-large": "Fetch 30 open issues of vercel/next.js from the GitHub API.",
|
||||
"a-npm-install-log": "Install packages with npm and read the log.",
|
||||
"a-source-big": "Read a 61 KB TypeScript source file.",
|
||||
"a-git-log-large": "Read 2,000 commits of a git log.",
|
||||
"a-devtools-mcp-snapshot": "Take a snapshot of the Wikipedia SQLite page with Chrome DevTools MCP.",
|
||||
"a-gh-issue-list-vite": "List 40 open issues of vitejs/vite with gh.",
|
||||
"a-gh-pr-list-vite": "List 25 open pull requests of vitejs/vite with their CI checks.",
|
||||
"a-context7-query-docs-vite": "Look up the Vite build and proxy docs through Context7.",
|
||||
"a-vitest-run-vite": "Run the 1,106 Vitest tests of vitejs/vite (25 of them fail).",
|
||||
"a-biome-lint-vite": "Lint the vitejs/vite source with Biome.",
|
||||
"a-pnpm-install-vite": "Install the vitejs/vite workspace with pnpm.",
|
||||
"a-docker-logs-mongo": "Read the logs of a MongoDB container.",
|
||||
"a-terraform-plan": "Plan 72 new resources with Terraform.",
|
||||
"a-git-log-stat-vite": "Read 300 commits of vitejs/vite with file stats.",
|
||||
"b-supabase-edge-functions-5-examples": "Find answers in 5 Supabase Edge Functions examples.",
|
||||
"b-react-useeffect-docs": "Find answers in the React useEffect docs.",
|
||||
"b-next-js-app-router-docs": "Find answers in the Next.js App Router docs.",
|
||||
"b-tailwind-css-docs": "Find answers in the Tailwind CSS docs.",
|
||||
"b-skill-context-mode-main-prompt": "Find answers in the context-mode skill prompt.",
|
||||
"b-skill-references-4-files-combined": "Find answers in 4 skill reference files.",
|
||||
"b-mcp-tools-list-40-tools": "Find the right tool in a list of 40 MCP tools.",
|
||||
"b-html-docs-page-sqlite-org-fts5-215-kb": "Find answers in the 215 KB SQLite FTS5 docs page.",
|
||||
"c-triage": "Check tests, type errors, the build, a server log and the git log in one step.",
|
||||
"c-install-log": "Check an install log and a long git log in one step.",
|
||||
"c-small": "Run 3 tiny commands in one step.",
|
||||
"d-synth-120k": "Print a 120 KB log from a script.",
|
||||
"d-synth-1m": "Print a 1 MB log from a script.",
|
||||
"d-real-github-json": "Print a 219 KB GitHub API reply from a script.",
|
||||
"d-real-git-log": "Print a 191 KB git log from a script.",
|
||||
"e-debug-session": "Debug with 6 tool outputs, then compact the chat.",
|
||||
"e-long-session": "Work through 40 tool outputs, then compact the chat.",
|
||||
"f-read-large-file": "Open a 46 KB log file with Read.",
|
||||
"f-read-big-source": "Open a 61 KB source file with Read.",
|
||||
"f-read-small-file": "Open a small file with Read.",
|
||||
"f-webfetch": "Fetch the SQLite FTS5 docs page with WebFetch.",
|
||||
"f-bash-dump-post": "Print a 191 KB git log with Bash.",
|
||||
"f-bash-curl-post": "Fetch a 219 KB GitHub API reply with curl in Bash.",
|
||||
"f-read-vite-config": "Open the 89 KB vite config source with Read.",
|
||||
"f-webfetch-vite-docs": "Fetch the 265 KB Vite features guide with WebFetch.",
|
||||
"g-search-latency": "Search 8 indexed tool outputs 20 times.",
|
||||
"g-index-per-mb": "Put 0.6 MB of real files into the search index.",
|
||||
"g-session-total": "Debug for a full session: 8 tool outputs, then 3 searches.",
|
||||
};
|
||||
|
||||
const HOST = { "claude-code": "Claude Code", codex: "Codex", gemini: "Gemini CLI", qwen: "Qwen Code", "copilot-cli": "Copilot CLI", vscode: "VS Code", kiro: "Kiro", zcode: "ZCode", pi: "Pi", opencode: "OpenCode" };
|
||||
const hostOf = (id) => id.slice("g-hook-".length);
|
||||
|
||||
/** One-line job of a case, in plain words. */
|
||||
export function whatYouDo(id) {
|
||||
if (id.startsWith("g-hook-")) return `Run any tool call in ${HOST[hostOf(id)] ?? hostOf(id)}. Its hook runs each time.`;
|
||||
return WHAT[id] ?? null;
|
||||
}
|
||||
|
||||
const m = (row, k) => row.metrics[k]?.median;
|
||||
const fRead = (id) => id.startsWith("f-read") || id.startsWith("f-webfetch");
|
||||
|
||||
/** The before and after bytes a case page shows, from the results row. `after` names the metric it came from. */
|
||||
export function beforeAfter(row) {
|
||||
if (row.group === "e-continuity") return { before: m(row, "raw_bytes"), after: m(row, "resume_bytes"), afterKey: "resume_bytes" };
|
||||
if (row.id.startsWith("g-hook-") || row.id === "g-search-latency" || row.id === "g-index-per-mb") return null;
|
||||
return { before: m(row, "raw_bytes"), after: m(row, "ctx_bytes"), afterKey: "ctx_bytes" };
|
||||
}
|
||||
|
||||
function toolOf(row) {
|
||||
const g = row.group, id = row.id;
|
||||
if (g === "a-sandbox") return "ctx_execute";
|
||||
if (g === "b-retrieval") return "ctx_index + ctx_search";
|
||||
if (g === "c-batch") return "ctx_batch";
|
||||
if (g === "d-externalize") return "ctx_execute + ctx_search";
|
||||
if (g === "e-continuity") return "hooks + ctx_resume";
|
||||
if (g === "f-hook-redirect") return fRead(id) ? "hook redirect (PreToolUse)" : "hook redirect (PostToolUse)";
|
||||
if (id.startsWith("g-hook-")) return `hook (${(row.title.match(/\((\S+),/) ?? [])[1] ?? "hook"})`;
|
||||
if (id === "g-search-latency") return "ctx_search";
|
||||
if (id === "g-index-per-mb") return "ctx_index";
|
||||
return "hooks + ctx_search";
|
||||
}
|
||||
|
||||
function withoutLine(row, n) {
|
||||
const id = row.id, g = row.group;
|
||||
const size = `${fmt(n)} B, about ${fmt(n / 4)} tokens`;
|
||||
if (g === "a-sandbox") return `The whole tool output goes into the chat: ${size}.`;
|
||||
if (g === "b-retrieval") return `The whole document goes into the chat: ${size}.`;
|
||||
if (g === "c-batch") return `Each command runs as its own call, and all output goes into the chat: ${size}.`;
|
||||
if (g === "d-externalize") return `The whole printed output goes into the chat: ${size}.`;
|
||||
if (g === "e-continuity") return `To pick up the work, the agent needs the old tool outputs back in the chat: ${size}.`;
|
||||
if (id.startsWith("f-read")) return `Read puts the whole file into the chat: ${size}.`;
|
||||
if (id.startsWith("f-webfetch")) return `WebFetch puts the whole page into the chat: ${size}.`;
|
||||
if (g === "f-hook-redirect") return `The whole command output goes into the chat: ${size}.`;
|
||||
return `All outputs go into the chat: ${size}.`;
|
||||
}
|
||||
|
||||
function withLine(row) {
|
||||
const id = row.id, g = row.group;
|
||||
if (g === "a-sandbox") return "A short script reads the output in a sandbox. The agent gets only what the script prints.";
|
||||
if (g === "b-retrieval") return `The document goes into a local search index. The agent asks ${m(row, "queries")} questions and gets back only the parts that match (${m(row, "queries_hit")} of ${m(row, "queries")} questions got a hit).`;
|
||||
if (g === "c-batch") return `One ctx_batch call runs all ${m(row, "commands")} commands, keeps the output in a local search index and answers the questions.`;
|
||||
if (g === "d-externalize") return `The full output goes into a local search index. The agent gets the start and a pointer. A search later finds the first, middle and last line (${m(row, "markers_found")} of ${m(row, "markers")}).`;
|
||||
if (g === "e-continuity") return "The hooks keep a journal of the session. After compaction, ctx_resume gives the agent a short summary.";
|
||||
if (id === "f-read-small-file") return "The file is small, so the hook lets Read run as usual. The agent gets the file.";
|
||||
if (fRead(id)) return "The hook stops the call and tells the agent which context-mode tool to use. This is the whole reply.";
|
||||
if (g === "f-hook-redirect") return "The command runs, then the hook swaps its output for a short summary.";
|
||||
return `The hooks swap each output for a short summary (${fmt(m(row, "hook_left_bytes"))} B in total). 3 searches bring back what the agent needs (${fmt(m(row, "follow_up_bytes"))} B). Below are the 3 search replies.`;
|
||||
}
|
||||
|
||||
function sample(row, rep) {
|
||||
if (rep?.sample) return { ...head(rep.sample), what: row.synthetic ? "It starts like this (the scenario makes this text with a fixed seed):" : "The command output looks like this:" };
|
||||
const f = row.inputs[0];
|
||||
if (!f || !existsSync(path.join(DATA, f))) return null;
|
||||
const h = head(readFileSync(path.join(DATA, f), "utf8"));
|
||||
const what = row.inputs.length > 1 ? `The first of the ${row.inputs.length} inputs starts like this:` : "It starts like this:";
|
||||
return { ...h, what };
|
||||
}
|
||||
|
||||
/** The markdown of one case section. */
|
||||
export function caseSection(row, rep, ctx) {
|
||||
const id = row.id;
|
||||
const l = [`## ${id}`, "", `**${row.title}**`, ""];
|
||||
l.push(`**What you do:** ${whatYouDo(id) ?? row.title + "."}`, "");
|
||||
const ba = beforeAfter(row);
|
||||
const showReply = () => {
|
||||
if (!rep?.reply) return;
|
||||
const h = head(rep.reply, { lines: 12, width: 200, chars: 1200 });
|
||||
l.push(...fence(h.body), "");
|
||||
if (h.note) l.push(h.note, "");
|
||||
if (ba && bytes(rep.reply) !== ba.after && id !== "g-session-total") l.push(`This reply text comes from a rerun on ${ctx.repliesDate} (${fmt(bytes(rep.reply))} B). The numbers above are the median of the committed run.`, "");
|
||||
};
|
||||
if (ba) {
|
||||
l.push(`**Without Context Mode:** ${withoutLine(row, ba.before)}`, "");
|
||||
const s = sample(row, rep);
|
||||
if (s) { l.push(s.what, "", ...fence(s.body), ""); if (s.note) l.push(s.note, ""); }
|
||||
const saved = ba.after < ba.before
|
||||
? `That keeps ${keptOut(ba.before, ba.after)}% of it out of the chat.`
|
||||
: `Here the reply is a bit larger than the raw output: small outputs are cheap to read as they are.`;
|
||||
l.push(`**With Context Mode:** ${withLine(row)} The agent gets ${fmt(ba.after)} B, about ${fmt(ba.after / 4)} tokens. ${saved}`, "");
|
||||
showReply();
|
||||
} else if (id.startsWith("g-hook-")) {
|
||||
const name = HOST[hostOf(id)] ?? hostOf(id);
|
||||
l.push(`**Without Context Mode:** a bare Node start takes ${ms1(m(row, "bare_node_ms"))} ms.`, "");
|
||||
l.push(`**With Context Mode:** the ${name} hook takes ${ms1(m(row, "hook_ms"))} ms, so it adds about ${ms1(m(row, "overhead_ms"))} ms to each tool call. Each number is the median of 5 hook runs.`, "");
|
||||
} else if (id === "g-search-latency") {
|
||||
const total = row.inputs.reduce((a, f) => a + (ctx.manifest[f]?.bytes ?? 0), 0);
|
||||
l.push(`**Without Context Mode:** the agent reads the 8 outputs in full: ${fmt(total)} B, about ${fmt(total / 4)} tokens.`, "");
|
||||
l.push(`**With Context Mode:** the 8 outputs go into a local search index. A search takes ${ms1(m(row, "search_ms_median"))} ms (the slowest ${ms1(m(row, "search_ms_max"))} ms), and a reply is about ${fmt(m(row, "reply_bytes_median"))} B. The last reply:`, "");
|
||||
showReply();
|
||||
} else if (id === "g-index-per-mb") {
|
||||
l.push(`**Without Context Mode:** the agent reads the 3 files in full: ${fmt(m(row, "total_bytes"))} B, about ${fmt(m(row, "total_bytes") / 4)} tokens.`, "");
|
||||
l.push(`**With Context Mode:** the files go into a local search index once. That takes ${fmt(m(row, "index_ms"))} ms, or ${fmt(m(row, "index_ms_per_mb"))} ms per MB.`, "");
|
||||
}
|
||||
l.push(`**Tool:** ${toolOf(row)}. [How it works](${docsLink(id)})`, "");
|
||||
l.push("**Rerun it yourself:**", "", ...fence(`cd bench && node run.mjs ${id}`, "sh"), "");
|
||||
const proof = row.inputs.length
|
||||
? row.inputs.map((f) => `input [fixtures/data/${f}](../fixtures/data/${f})${ctx.manifest[f] ? `, ${fmt(ctx.manifest[f].bytes)} B, sha256 ${ctx.manifest[f].sha256}` : ""}`).join("; ")
|
||||
: row.synthetic ? "input made in the scenario with a fixed seed (20261031)" : "input: small payloads built in the scenario";
|
||||
l.push(`<sub>Proof: ${proof}. Numbers: median of ${ctx.runs} runs in [results/${ctx.resultsFile}](../results/${ctx.resultsFile}).</sub>`, "");
|
||||
return l;
|
||||
}
|
||||
|
||||
/** The whole README of one group folder. */
|
||||
export function groupPage(g, ctx) {
|
||||
const rows = ctx.results.filter((r) => r.group === g.dir);
|
||||
const l = [`# ${g.title}`, "", ...INTRO[g.dir].map((s, i, a) => (i < a.length - 1 ? s + " " : s)), "",
|
||||
`Run this group: \`cd bench && node run.mjs ${g.dir}\`. All tables: [results/${ctx.resultsFile.replace(/\.json$/, ".md")}](../results/${ctx.resultsFile.replace(/\.json$/, ".md")}).`, ""];
|
||||
for (const row of rows) l.push(...caseSection(row, ctx.replies[row.id], ctx));
|
||||
return l.join("\n");
|
||||
}
|
||||
@@ -154,6 +154,45 @@ describe("ADR-0012 / bench suite (bench/run.mjs)", () => {
|
||||
assert.equal(indexedLabel("no label here"), null);
|
||||
});
|
||||
|
||||
// D-BENCH-PAGES-1: each case section on a group page speaks plainly and its numbers equal the committed results file.
|
||||
test("group pages: each case has plain lines, numbers equal to the results JSON, a fenced sample and the rerun command", async () => {
|
||||
const { beforeAfter, keptOut, docsLink, whatYouDo } = await import("../bench/suite/pages.mjs");
|
||||
const file = files.at(-1);
|
||||
const r = JSON.parse(readFileSync(path.join(BENCH, "results", file), "utf8"));
|
||||
const rp = JSON.parse(readFileSync(path.join(BENCH, "results", file.replace(/\.json$/, "-replies.json")), "utf8"));
|
||||
const fmt = (n) => Math.round(n).toLocaleString("en-US");
|
||||
for (const g of GROUPS) {
|
||||
const readme = readFileSync(path.join(BENCH, g, "README.md"), "utf8");
|
||||
const top = readme.split("\n## " + r.results.find((x) => x.group === g).id + "\n")[0];
|
||||
const intro = top.split("\n").filter((l) => l.trim() && !l.startsWith("#") && !l.startsWith("Run this group"));
|
||||
assert.equal(intro.length, 3, g + ": a 3-line intro");
|
||||
assert.doesNotMatch(top, /\bv2\b|Engine/, g + ": intro has no v2 or Engine");
|
||||
const rows = r.results.filter((x) => x.group === g);
|
||||
for (const [i, row] of rows.entries()) {
|
||||
// cut at the next case anchor: samples may hold "## " lines inside their fences
|
||||
const sec = readme.split("\n## " + row.id + "\n")[1]?.split(rows[i + 1] ? "\n## " + rows[i + 1].id + "\n" : "\0")[0];
|
||||
assert.ok(sec, row.id + ": section with its anchor");
|
||||
assert.ok(whatYouDo(row.id), row.id + ": a plain one-line job");
|
||||
assert.ok(sec.includes("**What you do:** " + whatYouDo(row.id)), row.id + ": What you do");
|
||||
assert.match(sec, /\*\*Without Context Mode:\*\*/, row.id);
|
||||
assert.match(sec, /\*\*With Context Mode:\*\*/, row.id);
|
||||
assert.ok(sec.includes("```sh\ncd bench && node run.mjs " + row.id + "\n```"), row.id + ": rerun command");
|
||||
assert.ok(sec.includes("](" + docsLink(row.id) + ")"), row.id + ": docs link with UTM");
|
||||
assert.match(sec, /<sub>Proof: /, row.id + ": proof line");
|
||||
for (const f of row.inputs) assert.ok(sec.includes(r.fixtures[f].sha256), row.id + ": sha256 of " + f);
|
||||
const ba = beforeAfter(row);
|
||||
if (!ba) continue;
|
||||
assert.ok(sec.includes(`${fmt(ba.before)} B, about ${fmt(ba.before / 4)} tokens`), row.id + ": before bytes and tokens");
|
||||
assert.ok(sec.includes(`The agent gets ${fmt(ba.after)} B, about ${fmt(ba.after / 4)} tokens.`), row.id + ": after bytes");
|
||||
if (ba.after < ba.before) assert.ok(sec.includes(`keeps ${keptOut(ba.before, ba.after)}% of it out`), row.id + ": % kept out");
|
||||
assert.ok((sec.match(/^`{3,}text$/gm) ?? []).length >= 2, row.id + ": a fenced sample and a fenced reply");
|
||||
assert.ok(rp.replies[row.id]?.reply, row.id + ": stored reply text");
|
||||
const first = rp.replies[row.id].reply.split("\n")[0].slice(0, 60);
|
||||
assert.ok(sec.includes(first), row.id + ": the stored reply is on the page");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("a one-scenario run works and a bad --runs is refused", () => {
|
||||
const bad = spawnSync(process.execPath, [path.join(BENCH, "run.mjs"), "--runs", "0", "--no-write"], { encoding: "utf8" });
|
||||
assert.equal(bad.status, 2);
|
||||
|
||||
@@ -1177,6 +1177,8 @@ describe("ADR-0015 / ADR-0024 repo: no dev folders, no v2 dir names (D-REPO-CLEA
|
||||
// These may name the old paths: history rows, frozen data, the changelog, and the guards themselves.
|
||||
const EXEMPT = (f) => f === "docs/architecture/DEVIATIONS.md" || f === "docs/architecture/modules/DEVIATIONS.md" ||
|
||||
f.startsWith("bench/fixtures/data/") || f.startsWith("CHANGELOG") ||
|
||||
// generated case pages and their stored replies quote those fixture bytes word for word (D-BENCH-PAGES-1)
|
||||
/^bench\/[a-g]-[a-z-]+\/README\.md$/.test(f) || /^bench\/results\/[^/]+-replies\.json$/.test(f) ||
|
||||
f === "tests/0014-repo-hygiene.test.mjs" || f === "build/check-removed.mjs";
|
||||
const HEX = "0123456789abcdef";
|
||||
// True when the text just before position i ends with "/blob/<40 hex>/" or "/tree/<40 hex>/".
|
||||
|
||||
Reference in new issue
Block a user