docs: 11 agents everywhere, OMP native install commands in README and docs (OMP)

D-OMP-DOCS-2: README, hero image, AGENT_ISSUE, how-it-works, install/omp.md,
architecture README/PRD/TECH-SPEC/modules/release pages say 11 agents and
name OMP. ADR-0026 Accepted (2026-11-14), P5 result accepted by the owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mksgluandClaude Opus 5.5 committed 2026-11-14 14:18:03 +03:00
1 parent ced5ace27d
commit c9400cb885
22 files changed
+39 -35

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@
Your user asked you to report a context-mode problem. Write the issue so a maintainer's agent can replay it in one pass: the facts, the smallest repro from a fresh project, the exact output, and the cause when you found it. Follow the rules below in order. A GitHub Action scores every new issue against them, labels it `repro-ready` or `needs-info`, and keeps one comment with a checklist of what is still missing. Edit the issue body to fill that checklist; the comment updates itself.
One person maintains context-mode for 10 agents on 3 operating systems. A fix starts from the doctor report and a repro that runs in a fresh directory.
One person maintains context-mode for 11 agents on 3 operating systems. A fix starts from the doctor report and a repro that runs in a fresh directory.
Security problems go to https://github.com/mksglu/context-mode/security/advisories/new as a private advisory.
+4 -4
View File
@@ -1,6 +1,6 @@
# Context Mode
**A free, local plugin for 10 coding agents. It keeps tool output out of your agent's context window and keeps all usage data on your machine. The plugin is free forever.**
**A free, local plugin for 11 coding agents. It keeps tool output out of your agent's context window and keeps all usage data on your machine. The plugin is free forever.**
[![npm downloads](https://img.shields.io/npm/dt/context-mode?label=npm%20downloads)](https://www.npmjs.com/package/context-mode) [![GitHub stars](https://img.shields.io/github/stars/mksglu/context-mode?style=flat&color=yellow)](https://github.com/mksglu/context-mode) [![Discord](https://img.shields.io/discord/1478479412700909750?label=Discord&logo=discord&color=5865f2)](https://discord.gg/DCN9jUgN5v) [![License: ELv2](https://img.shields.io/badge/License-ELv2-blue.svg)](LICENSE)
@@ -286,10 +286,10 @@ Restart the agent, then run `/ctx-doctor` in it. Each check prints PASS or a fix
<details><summary><b>How we tested the install</b></summary>
Every agent gets hooks, the MCP server and the plugin skills; the last line of each block above says how.
Hooks reach each agent in one of three ways: in the plugin package (Claude Code, Gemini CLI, Qwen Code), in a hook file (Codex, Copilot CLI, Kiro, VS Code, ZCode), or in a plugin inside the agent (OpenCode, Pi). The [Agents guide](https://contextmode.ai/docs/engine/agents?utm_source=github&utm_medium=readme&utm_content=install-agents) shows what each agent runs.
We ran the real binary of each agent with the plugin hook: Claude Code, Codex, Gemini CLI, Qwen Code, Pi, OpenCode, Copilot CLI and ZCode. Each run used a clean temp home and a local test model, on 2.0.0-next.15.
Hooks reach each agent in one of three ways: in the plugin package (Claude Code, Gemini CLI, Qwen Code), in a hook file (Codex, Copilot CLI, Kiro, VS Code, ZCode), or in a plugin inside the agent (OpenCode, Pi, OMP). The [Agents guide](https://contextmode.ai/docs/engine/agents?utm_source=github&utm_medium=readme&utm_content=install-agents) shows what each agent runs.
We ran the real binary of each agent with the plugin hook: Claude Code, Codex, Gemini CLI, Qwen Code, Pi, OpenCode, Copilot CLI and ZCode. Each run used a clean temp home and a local test model, on 2.0.0-next.15. OMP 18.20.0 ran the same way with ADR-0026, and CI installs the real OMP on Linux, macOS and Windows.
For VS Code and Kiro, the check covers the hook setup: VS Code runs the hook command with the documented payload, and kiro-cli 2.35.2 loads all 6 hook entries.
CI runs setup, doctor, a hook and an MCP handshake for all 10 agents from the packed package on Linux, macOS and Windows. Record: [HOOKS-FIRE.md](docs/architecture/release/HOOKS-FIRE.md).
CI runs setup, doctor, a hook and an MCP handshake for all 11 agents from the packed package on Linux, macOS and Windows. Record: [HOOKS-FIRE.md](docs/architecture/release/HOOKS-FIRE.md).
Each agent uses its own install command, and [ADR-0023](docs/architecture/adr/ADR-0023-native-install.md) says why.
</details>
+1
View File
@@ -301,3 +301,4 @@ Split: this file holds the deviation rows without a date (format: id, files, dec
| D-OMP-CI-1 | .github/workflows/ci.yml (job ci: "omp 18.20.0 (native install script)" unix and Windows steps, "omp version", "OMP e2e cases GP2, GP3, GP11"), tests/0014-repo-hygiene.test.mjs ("ci.yml: OMP 18.20.0 installs with its own script on every OS ... (D-OMP-CI-1)") | ADR-0026 M7 CI job | OMP 18.20.0 installs from its own script (`sh -s -- --binary --ref v18.20.0`; Windows: the same install.ps1 as a scriptblock with `-Binary -Ref v18.20.0`) into `runner.temp/omp-bin`, 3 tries, then `omp --version` fails the job on every OS, so the omp fire block in tests/0020-fire-plugin-ext runs live in the v2 unit tests step and never skips. A separate step runs the [M7] OMP e2e cases (T44-T50) on every OS. ci.yml push branches are main, v2, v2-design, impl/**, so the lane branch does not start this job; it runs on the merge to main. Red 1ab8abf4, green next commit; YAML parse ok (PyYAML, 38 steps), e2e/checks/ci-config.mjs ok. No runtime code path changed, so no profile run. |
| D-OMP-DOCS-1 | docs/install/omp.md (new), docs/install/README.md (11 agents, OMP rows), README.md (install-omp block, picker, stats row), build/check-install-docs.mjs (NATIVE_HOSTS omp), docs/architecture/adr/ADR-0023-native-install.md (omp row), PRD.md, TECH-SPEC.md, modules/01-contracts.md, modules/12-plugins.md, .github/scripts/issue-intake.mjs (AGENT_MARKERS omp, oh-my-pi), tests/0023-install-docs.test.mjs (T52), tests/0014-repo-hygiene.test.mjs (11 rows, intake omp) | ADR-0026 M8 docs | OMP install docs use only OMP's own verbs: `curl -fsSL https://omp.sh/install \| sh` or `irm https://omp.sh/install.ps1 \| iex` for OMP, then `omp plugin install\|upgrade\|uninstall context-mode` and `omp update`; 10 -> 11 agents. feature.yml already listed omp; bug.yml and agent-report.yml have no agent list, so intake reads OMP from free text. | Owner main rule: each agent's own native install command (ADR-0023). |
| D-OMP-DOCTOR-PERF-1 | src/setup/engine.ts (listOnce: runDoctor hands one list reader to setupRow and verifyRow), tests/0010-doctor-upgrade.test.mjs ("[ADR-0026 P5] context-mode doctor --agents omp spawns `omp plugin list` once per doctor call") | ADR-0026 profiling plan P5 | `context-mode doctor` read the host list twice per agent (plan in setupRow, then verifyRow). Now one doctor call reads it once and plan and verify share it; nothing is kept past the call (no cache, env, flag). omp plugin list spawns per doctor call 2 -> 1. P5 omp on PATH, median/p90 of 50, interleaved with an origin/main build: main 571/666 ms, lane 850/945 ms (gate 954/1108); omp absent: main 579/656, lane 574/634. Still over +10%: the rest is the omp row's own verify checks that every CLI host runs (spy: omp plugin list 59 ms, hook-runs `node hook.mjs --agent omp` 73 ms, mcp check starts server.mjs 208 ms). Main has no omp row, so each of these is new; removing one would drop a true check. | Owner rule "profilling i unutma"; doctor states only what it checked. |
| D-OMP-DOCS-2 | README.md (11 coding agents, plugin inside the agent adds OMP, OMP 18.20.0 real-binary line, CI all 11 agents, hero alt text), docs/assets/readme/src/hero.html + hero-dark.png + hero-light.png (OMP in the small agent line, re-rendered), .github/AGENT_ISSUE.md (11 agents), docs/how-it-works.md (OMP in host list and plugin row, 11 agents; byte size kept at 11,577 B for the ctx_index evidence), docs/install/omp.md (MCP import limit with disabledServers, CI runs at merge), docs/architecture/README.md (Agents (11), ADR 0026 index row), PRD.md (in-process list, OMP out of Removed agents, Changes 2026-11-14), TECH-SPEC.md (Removed paths note, Q11, scope line), adr/0001 (11 agents), adr/0026-omp-host.md (Status Accepted 2026-11-14, P5 result accepted), modules/00-architecture.md, 01-contracts.md, 10-adapters.md, 12-plugins.md, 13-build-release.md, modules/README.md, release/HOOKS-FIRE.md, release/WINDOWS.md, tests/0014-repo-hygiene.test.mjs (README sentence names OMP, 11 blocks) | ADR-0026 docs sweep: every page that counts or lists agents says 11 and names OMP after Pi, in the AGENT_IDS order. Dated run records (bench 2026-11-01, spike history, earlier DEVIATIONS rows) keep their 10, as they describe runs with 10 hosts. plugins/claude-code/README.md is the release build and follows at the next release. | Owner 2026-11-14: "her yerde de 11 agent olarak guncelleyelim ... eksik yer birakma". |
+4 -3
View File
@@ -60,7 +60,7 @@ No other agent ships in v2.0. No CLI and no `cli.mjs` entry (ADR-0002, ADR-0010)
core/journal.append (one shared context.db per project)
adapter.encode
in-process plugin agents (Pi, OpenCode 2)
in-process plugin agents (Pi, OpenCode 2, OMP)
plugin adapter -> same core/policy, core/journal, core/tools (no spawn, no MCP hop)
```
@@ -68,7 +68,7 @@ Three layers, one build (esbuild, static imports only):
1. **core/** — knows no agent: tools, sandbox, store, project, journal, policy, stats, lifecycle.
2. **adapters/** — pure translation plus install/doctor data. No business logic.
3. **entries/** — `server.mjs`, `hook.mjs`, one plugin entry each for Pi and OpenCode 2.
3. **entries/** — `server.mjs`, `hook.mjs`, one plugin entry each for Pi and OpenCode 2; OMP runs the Pi entry through the `omp/index.js` wrapper (ADR-0026).
### 3.1 Module map
@@ -326,7 +326,7 @@ The server never imports `node:sqlite` statically: if Node or `node:sqlite` fail
Bun and `bun:sqlite`, better-sqlite3, `ensure-deps` and every heal script, `start.mjs`'s chdir/heal flow, snapshot injection, the `<context_window_protection>` block, per-agent `AGENTS.md`/`CLAUDE.md` templates, the routing `SKILL.md` and the maintainer-only ops skill, statusline, `ctx_insight`, HTTP daemon mode, the lifetime stats timer and all-DB scan, `ps` liveness, the global MCP-ready sentinel, the search call-rate throttle (`flood-guard.ts`, dropped and not replaced — it would re-trip on legitimate fan-out from concurrent subagents), runtime `npm install`, and the `web/` marketing site (deleted, not moved elsewhere).
Removed agents: Cursor, JetBrains Copilot, Kimi, Codex Desktop, OpenClaw, OMP (Oh-My-Pi), Antigravity/agy, OpenCode 1.x, Zed. Every file for a removed agent is deleted from the repo, not only from the release tree; a CI check fails if any of those paths reappear.
Removed agents: Cursor, JetBrains Copilot, Kimi, Codex Desktop, OpenClaw, Antigravity/agy, OpenCode 1.x, Zed. Every file for a removed agent is deleted from the repo, not only from the release tree; a CI check fails if any of those paths reappear. OMP (oh-my-pi) is back as the 11th agent through the Pi entry (ADR-0026); its v1 files (`configs/omp/`, `src/adapters/omp/`) stay removed.
## 18. Milestones
@@ -347,6 +347,7 @@ The module structure, dependency rules, constants, and per-module file map for i
## 19. Changes
- 2026-11-14 (ADR-0026): OMP (oh-my-pi) is the 11th agent, with its own install command `omp plugin install context-mode`.
- 2026-10-22 (ADR-0019): the 2026-10-13 "no npm, no CLI" rule is replaced. npm is the user channel and `context-mode setup|doctor|upgrade` is the CLI. See `PRD-setup.md`.
- 2026-10-13: dropped the v1.x line (fixes land only in v2); no skills beyond the 3 commands; Antigravity/agy removed; v2.0 scope fixed at 10 agents.
- 2026-10-14 (r3, `https://github.com/mksglu/context-mode/blob/274600e2ffab843e89c1dfa09b0d649e650c962f/docs/v2/review/DECISIONS-r3.md`): accepted Q1–Q24 and D1 — output cap, timeout value, deny scope and mechanism, Node minimum, project-source rule, search default, uninstall mode, and the rest, folded into §4–§16 above.
+3 -2
View File
@@ -47,6 +47,7 @@ This is the map. Start here, then follow the links.
| 0018 | One architecture contract (`docs/architecture/modules/00-architecture.md`), one file per module; implementers follow `docs/architecture/modules/` file by file. | Accepted |
| 0019 | One interactive `context-mode setup`; npm (`context-mode`, dist-tag `next`) is the user channel; the git `release` branch stays for the Claude Code marketplace. | Accepted |
| 0025 | Stored source enters the `ctx_execute` sandbox (#1325); the open 2.1.4 blockers (#1321, #1322, #1323, #1324) and Copilot host audit rows ship in one patch. ADR and PRD in one file. | Proposed |
| 0026 | OMP (oh-my-pi) is the 11th agent: it runs the Pi entry through `omp/index.js` and installs with `omp plugin install context-mode`. ADR and PRD in one file. | Accepted (2026-11-14) |
## 2a. Glossary
@@ -54,9 +55,9 @@ GS = global success gate (TECH-SPEC §1). G = gap row (TECH-SPEC §9). Q = DECIS
GS6 = hook budget: `HOOK_P95_MS` 40, `HOOK_CPU_OVER_NODE_MS` 20, `HOOK_COMBINED_P95_MS` 60.
## 3. Agents (10)
## 3. Agents (11)
Claude Code, Codex CLI, Gemini CLI, Qwen Code, Copilot CLI, VS Code Copilot, Kiro, ZCode, Pi, OpenCode 2.
Claude Code, Codex CLI, Gemini CLI, Qwen Code, Copilot CLI, VS Code Copilot, Kiro, ZCode, Pi, OpenCode 2, OMP. OMP is the 11th agent (ADR-0026).
## 4. Tools (9) and skills (3)
+3 -3
View File
@@ -268,7 +268,7 @@ Marketplace installs: the host's own update command is the path; `ctx_upgrade` r
### 3.10 Removed-agent files [D]
Removed from the repo, not only from the release tree (paths from `origin/main` @ `5869f4fa`):
Removed from the repo, not only from the release tree (paths from `origin/main` @ `5869f4fa`). OMP left this list on 2026-11-14: it is the 11th agent again (ADR-0026) and runs the Pi entry, so its v1 paths below stay removed:
`.cursor-plugin/`, `.openclaw-plugin/`, `openclaw.plugin.json`, `configs/{antigravity,antigravity-cli,cursor,jetbrains-copilot,kilo,kimi,omp,openclaw,zed}/`, `hooks/{antigravity-cli,cursor,jetbrains-copilot,kimi}/`, `hooks/formatters/cursor.mjs`, `src/adapters/{antigravity,antigravity-cli,cursor,jetbrains-copilot,kimi,omp,openclaw,zed}/`, `docs/adapters/{kimi-code,openclaw}.md`, `docs/jetbrains-copilot.md`, `scripts/install-openclaw-plugin.sh`, `scripts/lib/register-openclaw-config.mjs`, `scripts/test-openclaw-e2e.sh`, `.github/workflows/openclaw-e2e.yml`, `.claude/skills/context-mode-ops/`, and the `openclaw` key in `package.json`. A CI check (GS5) fails if any of these names reappears.
## 4. Repository layout deltas
@@ -476,7 +476,7 @@ M0 build and CI gate: only closed spikes (`S-NODE`, `S-TIMEOUT`) and `S-CODEX` m
| Q8 | E2E-live runs in the keyless harness (ADR-0012): every step on `claude-sonnet-5 --effort low`, the full case set before `/release`; never CI, never a key, never nightly | **[D]** |
| Q9 | **Test runner = `node:test`**; matrix 3 OS × min/current Node, ≤ 10 min per OS | **[D]** |
| Q10 | Kiro, ZCode: tool descriptions only | **[D]** |
| Q11 | **All 10 agents, Codex included, are supported and release-gated by GP-LIVE-ROUTING**; no `AGENTS.md` | **[D, closed by S-CODEX, 2026-10-17]** — live probe confirms Codex defers MCP tool metadata (name only up front, full description/instructions only at discovery/call time, `https://github.com/mksglu/context-mode/blob/274600e2ffab843e89c1dfa09b0d649e650c962f/tickets/spikes-r5/S-CODEX.md`); the 37 `defer_loading` references under `codex-rs/core/src` (TECH-SPEC.md:86) still were not read, but the live result answers the question the spike was gating on, so the release gate no longer rests on an unconfirmed assumption |
| Q11 | **All 10 agents (11 with OMP, ADR-0026), Codex included, are supported and release-gated by GP-LIVE-ROUTING**; no `AGENTS.md` | **[D, closed by S-CODEX, 2026-10-17]** — live probe confirms Codex defers MCP tool metadata (name only up front, full description/instructions only at discovery/call time, `https://github.com/mksglu/context-mode/blob/274600e2ffab843e89c1dfa09b0d649e650c962f/tickets/spikes-r5/S-CODEX.md`); the 37 `defer_loading` references under `codex-rs/core/src` (TECH-SPEC.md:86) still were not read, but the live result answers the question the spike was gating on, so the release gate no longer rests on an unconfirmed assumption |
| Q12 | Prompt texts use bare tool names only (`ctx_execute`); host-prefixed names live only in the adapter name map (§3.8, PR12) | **[D]** |
## 11. Global constants and current rules
@@ -497,7 +497,7 @@ These are the current, decided values. Round-by-round history is in §13.
## 12. Implementation plan
Milestones M0–M7 cover the current scope: 10 agents, 9 tools, single DB, enforcement, compaction, doctor/upgrade, release, v1 retention. Exit of v2.0 = every GS row in §1.
Milestones M0–M7 cover the v2.0 scope: 10 agents (ADR-0026 adds OMP as the 11th), 9 tools, single DB, enforcement, compaction, doctor/upgrade, release, v1 retention. Exit of v2.0 = every GS row in §1.
Each step is one PR. No step is done until its E2E gate runs green (ADR-0017). "Gate" names the GP case or live case and its `covers` paths (the live harness runs only the cases whose `covers` match the changed files, §6.9). "Impl file" names the `docs/architecture/modules/` file to follow for that step (ADR-0018).
@@ -5,7 +5,7 @@
## Context
v2 supports 10 agents (README §3). Their hook events, payloads and decision fields differ; `spike-hooks-verified.md` has one row per agent. v1 handled these differences inside each adapter with runtime fallbacks, so a bug could not be traced to a single code path.
v2 supports 11 agents (README §3; OMP since ADR-0026). Their hook events, payloads and decision fields differ; `spike-hooks-verified.md` has one row per agent. v1 handled these differences inside each adapter with runtime fallbacks, so a bug could not be traced to a single code path.
## Decision
+3 -3
View File
@@ -1,6 +1,6 @@
# ADR-0026: OMP (oh-my-pi) as a supported host
- Status: Proposed (2026-11-13).
- Status: Accepted (2026-11-14). Owner, 2026-11-14: "omp suresi onemli degil ok, omp yi main e gonder". P5 (doctor wall with OMP on PATH) stays over its +10% line after D-OMP-DOCTOR-PERF-1 (one `omp plugin list` per doctor call): main 571 ms, lane 850 ms median. The rest is the OMP row's own verify checks (plugin list, hook run, MCP check) that every CLI host row runs. The owner accepts this result.
- Scope: one ADR (Part 1) and one PRD (Part 2) in one file, as the owner asked ("tek bir md istiyorum ama senden adr pdr birlesik").
- Keeps: ADR-0010 (doctor tells the truth), ADR-0019 (setup), ADR-0020 (hooks and skills on every agent), ADR-0021 (prompt-cache safety, D-CACHE-PI-1), ADR-0023 (each agent's own native install), ADR-0024 (tests grouped by ADR).
- Issue: [#1332](https://github.com/mksglu/context-mode/issues/1332).
@@ -150,7 +150,7 @@ Counts: 28 rows; supported 24, host limit 4, unverified 0.
- OMP users see `ctx_*` as normal tools; each request carries +8,177 B of tool schema (cached prefix).
- Pi and Pi-Bolt send the same bytes and install the same way. Golden tests pin this.
- One bundle serves both hosts; `omp/index.js` is a wrapper.
- About 20 places pin "10 agents" or the unsupported list; they change in M4.
- About 20 places pin "10 agents" or the unsupported list; they change in M4 and in the docs sweep (D-OMP-DOCS-2).
- A live OMP fire test in CI on 3 OS guards the event shapes on each OMP pin bump.
## Alternatives rejected
@@ -317,7 +317,7 @@ Method: median of 50 runs (p90 too), same machine, temp HOME, warm cache, runs i
| P2 | OMP startup Total delta vs `--no-extensions` | same | +64 ms (402.0 vs 337.6) | <= +70 ms |
| P3 | `before_agent_start` in OMP's runtime | probe that imports our entry, 50 calls | median 0.23 ms, first 12-15 ms | median <= 0.5 ms |
| P4 | `before_agent_start` on Pi, string path | same probe under Pi | M0 measures | within noise (<= +5%) |
| P5 | `context-mode doctor` wall, OMP present | `node cli.mjs doctor < /dev/null` | 630 ms (p90 763) | <= +10% |
| P5 | `context-mode doctor` wall, OMP present | `node cli.mjs doctor < /dev/null` | 630 ms (p90 763) | <= +10%; result 850 ms after D-OMP-DOCTOR-PERF-1, accepted by the owner on 2026-11-14 (see Status) |
| P6 | Bytes: `pi/index.js`, `omp/index.js`, request size | `wc -c`; saved requests | 2,230,634 B; Pi request 14,014 B; OMP tools 17,537 B | Pi request equal; OMP tools 25,714 B; wrapper < 1 KB |
| P7 | Wall time of edited test files and full suite once | `node --test` | `0020-plugins` 2.0 s, `0010-doctor-upgrade` 12.9 s, `0019-setup-engine` 34.5 s [cm `docs/architecture/TEST-LAYOUT.md:51,58,61`] | <= +10% per file |
+1 -1
View File
@@ -84,7 +84,7 @@ Owner column = module id (§2).
| Path | Purpose | Owner |
|---|---|---|
| `build/build.mjs` | esbuild: 7 bundles (server, hook, run, search, pi, opencode, cli), inline prompt md; the hook bundle is minified (D-CI-PERF-4); writes the ADR-0019 D1 `package.json` out | build-release |
| `build/build.mjs` | esbuild: 7 bundles (server, hook, run, search, pi, opencode, cli) plus the `omp/index.js` wrapper over pi (ADR-0026), inline prompt md; the hook bundle is minified (D-CI-PERF-4); writes the ADR-0019 D1 `package.json` out | build-release |
| `build/manifests.ts` | generate every manifest + hook config from `adapters/table.ts` | build-release |
| `build/hash.mjs` | `SHA256SUMS` over the release tree | build-release |
| `build/check-removed.mjs` | GS5: fail if a removed path or routing file exists | v1-transition |
+2 -2
View File
@@ -22,7 +22,7 @@ export type AgentId = typeof AGENT_IDS[number];
Source: PRD-v2 §3 (10-agent table), TECH-SPEC §2, 00-architecture §3.1. Order matches the PRD §3 table top to bottom. No other export. No function: this file is data only.
E2E case: GP1 (install across all 10 adapters reads this exact list). ADR-0017 `covers`: `src/core/contracts/agents.ts`.
E2E case: GP1 (install across all 11 adapters reads this exact list). ADR-0017 `covers`: `src/core/contracts/agents.ts`.
## 2. `src/core/contracts/types.ts`
@@ -54,7 +54,7 @@ Rules per field, each citing its source:
No type in this file has an optional field that is also used to pick between two runtime paths (P1): optionality here only ever means "this event/host does not carry this field," never "pick path A or B."
E2E case: GP3 (hook payload decode into `CanonicalHookEvent` for all 10 adapters), GP4 (`ToolContext`/`ToolReply` shape), GP6 (`JournalRow`/`NewJournalRow`). ADR-0017 `covers`: `src/core/contracts/types.ts`.
E2E case: GP3 (hook payload decode into `CanonicalHookEvent` for all 11 adapters), GP4 (`ToolContext`/`ToolReply` shape), GP6 (`JournalRow`/`NewJournalRow`). ADR-0017 `covers`: `src/core/contracts/types.ts`.
## 3. `src/core/contracts/constants.ts`
+1 -1
View File
@@ -185,7 +185,7 @@ export function encode(ev: CanonicalHookEvent, d: Decision, extra?: string): Hoo
1. Switch on `d.kind`:
- `"allow"`: native stdout = `""` (or, for agents whose plain-text hook requires silence on `PromptSubmit`/`UserPromptSubmit`, exactly `""` — Kiro, GP3 fixture) exit `0`.
- `"hint"`: write `d.text` into this agent's hint field (table below) if one exists; else (Gemini, Pi, OpenCode 2 lack a PreToolUse hint field, PRD §10.1/ADR-0001 Consequences) drop it — the hint reaches the model only through tool descriptions, never a second mechanism.
- `"hint"`: write `d.text` into this agent's hint field (table below) if one exists; else (Gemini, Pi, OMP, OpenCode 2 lack a PreToolUse hint field, PRD §10.1/ADR-0001 Consequences) drop it — the hint reaches the model only through tool descriptions, never a second mechanism.
- `"deny"`: write `d.reason` (prefixed with the rewritten command when `d.rewritten` is set) into this agent's deny field (table below); exit `2`. Never `allow` + an input-rewrite field (ADR-0001 Decision 1, PRD §10.2 — `updatedInput` is never used).
- `"replace"`: only valid on `PostToolUse`; write `d.output` into this agent's output-replace field if one exists (Claude Code: `updatedToolOutput`); else no-op (case C has no substitute on an agent with no such field — ADR-0016 table, Q23 Kiro row: "no rewrite/replace channel either way").
2. Return `{ stdout, exitCode }`.
+1 -1
View File
@@ -10,7 +10,7 @@ OMP (ADR-0026) loads the same `src/entries/pi.ts` build from its plugin store (`
## 1. Why these two files are different from every other entry
Every other agent reaches context-mode over MCP: a spawned `server.mjs` process, and a spawned `hook.mjs` process per hook event. Pi and OpenCode 2 run context-mode **in-process** (PRD §3 "in-process plugin agents (Pi, OpenCode 2) … no spawn, no MCP hop"). `src/entries/pi.ts` and `src/entries/opencode.ts` are the only two files that call `TOOLS`, `INSTRUCTIONS`, and `handleHook` as plain function imports inside the host's own process, instead of over stdio or a child process.
Every other agent reaches context-mode over MCP: a spawned `server.mjs` process, and a spawned `hook.mjs` process per hook event. Pi and OpenCode 2 (and OMP through the Pi entry, ADR-0026) run context-mode **in-process** (PRD §3 "in-process plugin agents (Pi, OpenCode 2) … no spawn, no MCP hop"). `src/entries/pi.ts` and `src/entries/opencode.ts` are the only two files that call `TOOLS`, `INSTRUCTIONS`, and `handleHook` as plain function imports inside the host's own process, instead of over stdio or a child process.
Both files are thin: they translate the host's own event/callback shape into a `CanonicalHookEvent` (00 §3.1), call `handleHook`, and translate the `HookOutput` back into whatever the host's callback return shape is. Neither file touches `context.db`, `decide()`, or the journal directly — `handleHook` already does that work for every agent (00 §5.3).
@@ -30,7 +30,7 @@ async function main(outDir: string): Promise<void>;
### 2.2 Steps
1. Import `esbuild` (devDependency only; never shipped — ADR-0002/GS7 as amended: no `node_modules` and no `dependencies` on `release`). Pin the exact version `esbuild@0.24.0` in the dev `package.json` (`"esbuild": "0.24.0"`, no `^`/`~` range) — see Assumption A14.
2. Build the bundles listed in `build/build.mjs` `BUNDLES` (today 7: server, hook, run, search, pi, opencode, cli; the hook bundle is minified, D-CI-PERF-4) with esbuild, **static imports only** — no dynamic `import()` of anything the bundle itself must ship, so esbuild can tree-shake and inline everything into one file (the one documented exception is `import("node:sqlite")` inside `store/db.ts`, a Node built-in, never bundled, already dynamic for the degraded-start path of ADR-0014 §1 — esbuild leaves `node:*` specifiers untouched by default and that stays true here):
2. Build the bundles listed in `build/build.mjs` `BUNDLES` (today 7: server, hook, run, search, pi, opencode, cli, plus the `omp/index.js` wrapper over pi, ADR-0026; the hook bundle is minified, D-CI-PERF-4) with esbuild, **static imports only** — no dynamic `import()` of anything the bundle itself must ship, so esbuild can tree-shake and inline everything into one file (the one documented exception is `import("node:sqlite")` inside `store/db.ts`, a Node built-in, never bundled, already dynamic for the degraded-start path of ADR-0014 §1 — esbuild leaves `node:*` specifiers untouched by default and that stays true here):
| Bundle | Entry | Output | Target |
|---|---|---|---|
| server | `src/entries/server.ts` | `<outDir>/server.mjs` | `node24`, format `esm`, platform `node`, bundle `true`, external `["node:*"]` |
@@ -70,7 +70,7 @@ export function generateManifests(outDir: string): void;
| `plugin` (copilot-cli) | `<outDir>/copilot/plugin.json` | same shape as `extension`, keyed by `AdapterRow.toolNamePrefix`-neutral name |
| `hooks+mcp` (vscode, kiro, zcode) | `<outDir>/hooks/<agent>.json` | one entry per `CanonicalEventName`/`AuxEventName` key present in `row.eventMap`, each pointing at `node hook.mjs --agent <id>`, timeout `row.hookTimeoutMs`; each entry's `matcher` field is built, not typed, by `buildMatcher(row)` (DECISIONS-r9 R4): `` `^(${[...Object.values(row.nativeTools).flat(), escapeRegExp(row.toolNamePrefix) + "ctx_.*"].join("|")})$` `` — e.g. Codex's `nativeTools` (`shell:["Bash"], edit:["apply_patch"]`) plus `toolNamePrefix` `"mcp__context_mode__"` (R1) yields `^(Bash|apply_patch|mcp__context_mode__ctx_.*)$` |
| `mcp-entry` (copilot-cli falls here too if not plugin-shaped — resolved per A2/ADR-0011 table; no second file for the same row) | — | — |
| `in-process` (pi, opencode) | no manifest file; `pi/index.js` and `opencode/plugin.js` are the install artifact themselves | — |
| `in-process` (pi, opencode, omp) | no manifest file; `pi/index.js`, `opencode/plugin.js` and `omp/index.js` (the `package.json` `omp` key, ADR-0026) are the install artifact themselves | — |
3. Every written file is deterministic: keys written in a fixed order (the order `AGENT_IDS` lists each agent, then alphabetical keys inside one object) so two builds of the same inputs produce byte-identical output (needed for `SHA256SUMS` to be meaningful and for the GS5 `lint.mjs` byte check).
4. On an `AdapterRow` whose `installMode` matches none of the table rows above: throw `Error("manifest: unknown installMode " + row.installMode)` — this is a build-time hard stop, not a runtime `CtxError` (no user ever sees it; it means `adapters/table.ts` added a row this file does not yet know how to render).
5. `function buildMatcher(row: AdapterRow): string` (DECISIONS-r9 R4), exported from `build/manifests.ts` for reuse by the `08-enforcement.md` fixture builder and GP3 case files: `Object.values(row.nativeTools).flat()` collects every native tool name across `shell`/`read`/`grep`/`webfetch`/`edit` (missing keys contribute `[]`), `escapeRegExp` (Node has none built in; use the one-line `s => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")` already used by `08-enforcement.md` §5.1) escapes `row.toolNamePrefix` only, and the two lists join into `^(<names>|<escaped prefix>ctx_.*)$`. Step 2's `hooks+mcp` row calls `buildMatcher(row)` for each hook file's `matcher` field; no other row type uses it.
+1 -1
View File
@@ -20,7 +20,7 @@ Every link in this file and in each module file is relative to the file it is wr
| `09-hooks.md` | hooks | hook entry, dispatch per canonical event |
| `10-adapters.md` | adapters | `adapters/table.ts` and 10 decode/encode files |
| `11-server.md` | server | MCP server entry, lifecycle, prompt delivery |
| `12-plugins.md` | plugins | Pi and OpenCode 2 in-process entries |
| `12-plugins.md` | plugins | Pi, OMP and OpenCode 2 in-process entries |
| `13-build-release.md` | build-release | esbuild, manifests, CI, `release.yml`, `/release` skill |
| `14-tests.md` | tests | `e2e/` harness, GP1–GP11, live cases, KEEP-PASS runner |
| `14a-issue-cases.md` | tests | 147 issue-row cases (Given/When/Then) that close the ADR-0003 exit gate |
+1 -1
View File
@@ -28,4 +28,4 @@ Both stay open. They are not hidden behind a skip: the live tests print the reas
## Windows
The CI job `windows hosts` runs setup, doctor, the hook and an MCP handshake for all 10 hosts from the packed package on Windows, macOS and Linux. All 10 pass on the release run. Two known Windows shell defects (Q-WIN-5 qwen, KIRO-WIN-4 kiro, D-WIN-QWEN-SHELL-1 and D-WIN-KIRO-SHELL-1) are still marked as known and need a design decision.
The CI job `windows hosts` runs setup, doctor, the hook and an MCP handshake for all 11 hosts from the packed package on Windows, macOS and Linux. All 10 passed on the 2.0 release run; OMP joined as the 11th host with ADR-0026, and CI also installs the real OMP for its own tests. Two known Windows shell defects (Q-WIN-5 qwen, KIRO-WIN-4 kiro, D-WIN-QWEN-SHELL-1 and D-WIN-KIRO-SHELL-1) are still marked as known and need a design decision.
+1 -1
View File
@@ -1,7 +1,7 @@
# Windows host matrix
Job: `windows hosts` in `.github/workflows/ci.yml`, script `e2e/checks/windows-hosts.mjs`. It runs on windows-latest, ubuntu-latest and macos-latest.
Per OS it packs the build, runs `npm i -g` into a prefix with a space in the path, installs each host CLI that npm can install without login, then for each of the 10 agents (own HOME with a space) runs: setup, doctor, the host's hook payload for a 200 KB shell `cat` through the platform shell, and an MCP initialize + tools/list from the written host config.
Per OS it packs the build, runs `npm i -g` into a prefix with a space in the path, installs each host CLI that npm can install without login, then for each of the 11 agents (own HOME with a space) runs: setup, doctor, the host's hook payload for a 200 KB shell `cat` through the platform shell, and an MCP initialize + tools/list from the written host config.
Last green windows-latest run: CI run 40590253825 (head c3039618), job `windows hosts (windows-latest)`: 10 agents x 5 steps, 0 fail. ubuntu-latest: green on the same run. macos-latest: see the CI run of the head commit (the macOS runner queue was slow when this file was written).
Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 78 KiB

+1 -1
View File
@@ -19,7 +19,7 @@
<div class="nav"><img class="wm" id="wm" alt="Context Mode"><span class="url">github.com/mksglu/context-mode</span></div>
<div class="h h1">Tool output stays out of context.<br><em>Only the answer comes back.</em></div>
<div class="lead">Free and local. Zero telemetry. Your data stays on your machine.</div>
<div class="small">Runs in Claude Code, Codex, Gemini CLI, Qwen Code, Copilot CLI, VS Code, Kiro, Z Code, Pi and OpenCode, with 9 MCP tools.</div>
<div class="small">Runs in Claude Code, Codex, Gemini CLI, Qwen Code, Copilot CLI, VS Code, Kiro, Z Code, Pi, OMP and OpenCode, with 9 MCP tools.</div>
<div class="tiles">
<div class="tile" data-box><div class="k">Output bytes saved</div><div class="n"><i>99.4%</i></div><div class="r">Median of 36 rows with 10 KB or more of raw output, 5 runs each. Bench 2026-11-01.</div></div>
<div class="tile" data-box><div class="k">Full debugging session, tokens</div><div class="n">70K → <i>817</i></div><div class="r">Row g-session-total: 281,261 B raw to 3,266 B in context. Tokens: an estimate at 4 B per token.</div></div>
+4 -4
View File
@@ -108,8 +108,8 @@ agent runs ctx_search(queries, scope)
## Adapters: one mechanism per host
Every coding agent host (Claude Code, Codex, Gemini, Qwen, Copilot CLI, VS Code, Kiro, ZCode, Pi,
OpenCode) wires hooks and the MCP server in a different way. The adapter table names, per host: how
Every agent host (Claude Code, Codex, Gemini, Qwen, Copilot CLI, VS Code, Kiro, ZCode, Pi,
OpenCode, OMP) wires hooks and the MCP server in a different way. The adapter table names, per host: how
context-mode installs (`installMode`), how it finds the project root (`projectSource`), what its MCP tool
names are prefixed with (`toolNamePrefix`), how a compaction-recovery block is delivered
(`compactDelivery`), and how deny messages reach the host (`denyChannel`) (`docs/architecture/modules/10-adapters.md`
@@ -123,9 +123,9 @@ names are prefixed with (`toolNamePrefix`), how a compaction-recovery block is d
| Qwen | extension | spawn cwd | `SessionStart(source=compact)` |
| Kiro | MCP entry | `--agent` + cwd | none |
| ZCode | hooks + MCP | spawn cwd | `SessionStart(source=compact)` (unverified) |
| Pi, OpenCode | plugin inside the agent | the agent's own cwd | agent-specific flag/cache |
| Pi, OpenCode, OMP | plugin inside the agent | the agent's own cwd | agent-specific flag/cache |
One mechanism, ten adapters: the rules in the sections above (deny, chunk, search, compact) are the same
One mechanism, 11 agents: the rules in the sections above (deny, chunk, search, compact) are the same
everywhere; only how a host is told about them changes.
## Engineering details
+2 -1
View File
@@ -89,6 +89,7 @@ These come from how OMP works:
- Print mode (`omp -p`) sends no prompt event. Use `omp` or `omp --mode rpc` to keep prompts.
- OMP 14.7.0 is the tested floor. On an older OMP, doctor prints the version and the fix: `omp update`.
- In a script, `omp -p` reads stdin. Add `< /dev/null` in scripts.
- OMP can import MCP servers from other agents, such as Claude Code. Then it would load context-mode twice. Setup adds `context-mode` to `disabledServers` in OMP's `mcp.json`, and doctor prints that fix when the entry is missing.
## Report a problem
@@ -104,4 +105,4 @@ Run on macOS (arm64) with OMP 18.20.0 (the latest OMP on 2026-11-13), in a clean
| `omp plugin uninstall context-mode` | 18.20.0 | 2026-11-13 | Pass: `Uninstalled context-mode`, plugin store empty, data kept |
| `omp plugin disable` and `enable context-mode` | 18.20.0 | 2026-11-13 | Pass |
The CI job installs OMP 18.20.0 with its own script on Linux, macOS and Windows and runs `omp --version` and the OMP tests (D-OMP-CI-1). Evidence: [ADR-0026](../architecture/adr/0026-omp-host.md), [DEVIATIONS](../architecture/modules/DEVIATIONS.md).
The CI job installs OMP 18.20.0 with its own script on Linux, macOS and Windows and runs `omp --version` and the OMP tests (D-OMP-CI-1). It runs on each push to `main`, so the merge of OMP support is its first 3-OS run. Evidence: [ADR-0026](../architecture/adr/0026-omp-host.md), [DEVIATIONS](../architecture/modules/DEVIATIONS.md).
+2 -2
View File
@@ -1072,7 +1072,7 @@ describe("ADR-0015 repo: README agent lines", () => {
assert.ok(!/in[- ]process/i.test(text), `${rel} still says in-process / in process`);
}
assert.ok(README.includes("Hooks reach each agent in one of three ways"), "the README sentence stays");
assert.ok(README.includes("plugin inside the agent (OpenCode, Pi)"), "the README sentence names the plugin inside the agent");
assert.ok(README.includes("plugin inside the agent (OpenCode, Pi, OMP)"), "the README sentence names the plugin inside the agent");
});
test("readme-agents: each install block ends with one generated line: Hooks ✓ · MCP ✓ · Skills ✓ with the host detail in plain words; the agent table is gone (D-README-AGENT-LINES-1, D-README-DWELL-1)", () => {
@@ -1905,7 +1905,7 @@ describe("ADR-0015 repo: README thesis, links and figures (D-README-THESIS-1)",
assert.ok(live, "README has the real-binary line");
for (const n of ["Claude Code", "Codex", "Gemini CLI", "Qwen Code", "Pi", "OpenCode", "Copilot CLI", "ZCode"]) assert.ok(live.includes(n), `real-binary line names ${n}`);
assert.ok(!live.includes("logged out") && !live.includes(" our "), "the real-binary line reads plain");
// Install (D-README-DWELL-1, replaces the open blocks of D-README-FIX-1): all 10 blocks closed; one short "pick your agent" line sits before them.
// Install (D-README-DWELL-1, replaces the open blocks of D-README-FIX-1): all 11 blocks closed; one short "pick your agent" line sits before them.
const firstBlock = readme.indexOf("<details id=\"install-");
assert.ok(firstBlock > 0, "the first install block is closed");
const head = readme.slice(readme.indexOf("\n## Install\n"), firstBlock);