openmerit 0.1.4 → 0.1.6-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +121 -386
  3. package/dist/core/src/index.d.ts +101 -0
  4. package/dist/core/src/index.js +1649 -0
  5. package/dist/core/src/store.d.ts +35 -0
  6. package/dist/core/src/store.js +102 -0
  7. package/dist/pi/src/index.d.ts +32 -0
  8. package/dist/pi/src/index.js +794 -0
  9. package/dist/pi/src/scheduler.d.ts +11 -0
  10. package/dist/pi/src/scheduler.js +137 -0
  11. package/dist/pi/src/wakeup.d.ts +2 -0
  12. package/dist/pi/src/wakeup.js +108 -0
  13. package/dist/protocol/src/index.d.ts +484 -0
  14. package/dist/protocol/src/index.js +47 -0
  15. package/dist/protocol/src/schemas.d.ts +576 -0
  16. package/dist/protocol/src/schemas.js +280 -0
  17. package/dist/terminal/public/app.js +297 -0
  18. package/dist/terminal/public/brands/anthropic.png +0 -0
  19. package/dist/terminal/public/brands/baai.png +0 -0
  20. package/dist/terminal/public/brands/baseten.png +0 -0
  21. package/dist/terminal/public/brands/cerebras.png +0 -0
  22. package/dist/terminal/public/brands/cohere.png +0 -0
  23. package/dist/terminal/public/brands/deepseek.ico +0 -0
  24. package/dist/terminal/public/brands/google.png +0 -0
  25. package/dist/terminal/public/brands/groq.ico +0 -0
  26. package/dist/terminal/public/brands/lm-studio.png +0 -0
  27. package/dist/terminal/public/brands/meta.ico +0 -0
  28. package/dist/terminal/public/brands/mistral.png +0 -0
  29. package/dist/terminal/public/brands/nomic.png +0 -0
  30. package/dist/terminal/public/brands/ollama.png +0 -0
  31. package/dist/terminal/public/brands/openai.png +0 -0
  32. package/dist/terminal/public/brands/openrouter.png +0 -0
  33. package/dist/terminal/public/brands/qwen.png +0 -0
  34. package/dist/terminal/public/brands/vllm.ico +0 -0
  35. package/dist/terminal/public/brands/vllm.png +0 -0
  36. package/dist/terminal/public/favicon.svg +1 -0
  37. package/dist/terminal/public/flow.css +1 -0
  38. package/dist/terminal/public/flow.js +770 -0
  39. package/dist/terminal/public/index.html +21 -0
  40. package/dist/terminal/public/styles.css +779 -0
  41. package/dist/terminal/src/activity-merge.mjs +64 -0
  42. package/dist/terminal/src/browser.mjs +29 -0
  43. package/dist/terminal/src/cli.mjs +60 -0
  44. package/dist/terminal/src/collect.mjs +311 -0
  45. package/dist/terminal/src/discovery.mjs +93 -0
  46. package/dist/terminal/src/hardware.mjs +57 -0
  47. package/dist/terminal/src/project-activity.mjs +156 -0
  48. package/dist/terminal/src/sample.mjs +171 -0
  49. package/dist/terminal/src/server.mjs +56 -0
  50. package/dist/terminal/src/services.mjs +62 -0
  51. package/dist/terminal/src/topology.mjs +30 -0
  52. package/docs/adapter-guide.md +189 -0
  53. package/docs/architecture.md +59 -0
  54. package/docs/automation.md +74 -0
  55. package/docs/budgets.md +37 -0
  56. package/docs/commands.md +85 -0
  57. package/docs/demo-backfill.md +29 -0
  58. package/docs/demo-fieldkit.md +47 -0
  59. package/docs/demo-placement.md +30 -0
  60. package/docs/demo-spam.md +15 -0
  61. package/docs/demo-support.md +42 -0
  62. package/docs/demo.md +57 -0
  63. package/docs/first-trial.md +60 -0
  64. package/docs/getting-started.md +65 -0
  65. package/docs/index.md +40 -0
  66. package/docs/inference-terminal.md +439 -0
  67. package/docs/lifecycle.md +30 -0
  68. package/docs/memo.md +126 -0
  69. package/docs/metrics-and-evidence.md +48 -0
  70. package/docs/operations.md +40 -0
  71. package/docs/pareto-spec.md +76 -0
  72. package/docs/pi-extension.md +54 -0
  73. package/docs/roadmap.md +28 -0
  74. package/docs/security.md +37 -0
  75. package/docs/site-artwork-linocut.md +23 -0
  76. package/docs/site-artwork-miniature-diverse.md +28 -0
  77. package/docs/site-artwork-miniature.md +26 -0
  78. package/docs/site-demo.md +177 -0
  79. package/docs/site-design.md +94 -0
  80. package/docs/site-documentation.md +83 -0
  81. package/docs/site-dynamic-og.md +35 -0
  82. package/docs/site-faq-maintenance.md +115 -0
  83. package/docs/site-hero-resolution.md +60 -0
  84. package/docs/site-illustration-sequences.md +227 -0
  85. package/docs/site-inference-terminal.md +203 -0
  86. package/docs/site-memo.md +39 -0
  87. package/docs/site-og-image.md +38 -0
  88. package/docs/site-og-workshop.md +21 -0
  89. package/docs/site-section-artwork.md +56 -0
  90. package/docs/site-skill-review.md +57 -0
  91. package/docs/site-terminal-preview.md +85 -0
  92. package/docs/testing.md +118 -0
  93. package/docs/troubleshooting.md +55 -0
  94. package/docs/ux-reference.md +32 -0
  95. package/package.json +74 -42
  96. package/benchmark/invoice_ocr/data/invoice_01_ground_truth.json +0 -38
  97. package/benchmark/invoice_ocr/data/invoice_01_row_2.jpg +0 -0
  98. package/benchmark/invoice_ocr/data/invoice_02_ground_truth.json +0 -32
  99. package/benchmark/invoice_ocr/data/invoice_02_row_5.jpg +0 -0
  100. package/benchmark/invoice_ocr/data/invoice_03_ground_truth.json +0 -26
  101. package/benchmark/invoice_ocr/data/invoice_03_row_6.jpg +0 -0
  102. package/benchmark/invoice_ocr/data/invoice_04_ground_truth.json +0 -26
  103. package/benchmark/invoice_ocr/data/invoice_04_row_7.jpg +0 -0
  104. package/benchmark/invoice_ocr/data/invoice_05_ground_truth.json +0 -38
  105. package/benchmark/invoice_ocr/data/invoice_05_row_947.jpg +0 -0
  106. package/benchmark/invoice_ocr/data/invoice_06_ground_truth.json +0 -38
  107. package/benchmark/invoice_ocr/data/invoice_06_row_948.jpg +0 -0
  108. package/benchmark/invoice_ocr/data/invoice_07_ground_truth.json +0 -20
  109. package/benchmark/invoice_ocr/data/invoice_07_row_949.jpg +0 -0
  110. package/benchmark/invoice_ocr/data/invoice_08_ground_truth.json +0 -38
  111. package/benchmark/invoice_ocr/data/invoice_08_row_1888.jpg +0 -0
  112. package/benchmark/invoice_ocr/data/invoice_09_ground_truth.json +0 -26
  113. package/benchmark/invoice_ocr/data/invoice_09_row_1890.jpg +0 -0
  114. package/benchmark/invoice_ocr/data/invoice_10_ground_truth.json +0 -20
  115. package/benchmark/invoice_ocr/data/invoice_10_row_1892.jpg +0 -0
  116. package/benchmark/invoice_ocr/data/manifest.json +0 -97
  117. package/dist/benchmarks.js +0 -98
  118. package/dist/catalog.js +0 -61
  119. package/dist/cli.js +0 -188
  120. package/dist/daemon.js +0 -407
  121. package/dist/diagnostics.js +0 -227
  122. package/dist/frontier.js +0 -56
  123. package/dist/harness.js +0 -1
  124. package/dist/integrations.js +0 -19
  125. package/dist/invoice-eval.js +0 -33
  126. package/dist/invoice-score.js +0 -124
  127. package/dist/judge.js +0 -43
  128. package/dist/llm.js +0 -207
  129. package/dist/pi-config.js +0 -46
  130. package/dist/pi-trials.js +0 -373
  131. package/dist/policy.js +0 -185
  132. package/dist/providers.js +0 -1
  133. package/dist/recommend.js +0 -76
  134. package/dist/routes.js +0 -74
  135. package/dist/standalone.js +0 -224
  136. package/dist/store.js +0 -89
  137. package/dist/strategist.js +0 -68
  138. package/dist/task-input.js +0 -54
  139. package/dist/traces.js +0 -127
  140. package/dist/trials.js +0 -140
  141. package/dist/types.js +0 -2
  142. package/examples/invoice-prompt.txt +0 -19
  143. package/examples/task.example.json +0 -7
  144. package/extension/openmerit.ts +0 -947
  145. package/instructions/OPENMERIT.md +0 -63
  146. package/instructions/openmerit.policy.json +0 -37
  147. package/rules.md +0 -43
package/CHANGELOG.md ADDED
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.1.6-preview.0 — 2026-10-09
6
+
7
+ A test prerelease of the existing `openmerit` npm package, installed with `npm install -g openmerit@preview`. Includes the compiled Inference Terminal, automatic browser opening, and a free loopback-port fallback. `latest` remains `0.1.5`.
8
+
9
+ - Add the Inference Terminal: `openmerit dash` serves a local, read-only view of models, request metadata, connections, capacity, and compute, sampled every 10–30 seconds. Agent and task identities come from supplied metadata; the terminal does not intercept inference or discover every call automatically.
10
+ - Bind task profiles, metrics, assessments, frontier artifacts, swaps, and
11
+ automation signals to a confirmed application LLM target; Pi's own model
12
+ telemetry cannot satisfy application evidence or become a swap target.
13
+ - Make Pi's automatic setup conditional on bounded source detection of an
14
+ application LLM call. Projects without a detected target remain idle until
15
+ `/openmerit setup` is requested.
16
+
17
+ ## 0.1.5 — 2026-09-23
18
+
19
+ OpenMerit now ships as one npm package with a Pi extension, a reusable
20
+ coordinator, and a harness-neutral protocol.
21
+
22
+ ### Changed
23
+
24
+ - Pi issues typed, bounded work to the coding harness and checks structured
25
+ results and durable evidence before advancing the model-improvement lifecycle.
26
+ - Project state, audit events, and evidence manifests live under `.openmerit/`
27
+ in the product repository.
28
+ - Baseline assessment, candidate trials, frontier verification, supervised
29
+ swaps, post-swap verification, and rollback follow a confirmed project policy.
30
+ - The package exposes `openmerit/core`, `openmerit/protocol`, and `openmerit/pi`.
31
+ - Node.js 22.19 or newer and Pi 0.87 are required for the Pi integration.
32
+
33
+ ### Removed from the 0.1.4 package
34
+
35
+ - The background watcher, direct provider clients, standalone CLI, and
36
+ session-bound route comparison flow.
37
+ - Automatic use of the earlier home-directory state. The new project-local
38
+ state starts with a confirmed task profile and leaves older files untouched.
39
+
40
+ See [the README](README.md) for installation and the current command surface.
package/README.md CHANGED
@@ -1,402 +1,137 @@
1
- # openmerit
2
-
3
- An **experimental model-merit harness** for [pi](https://pi.dev). Start
4
- pi with model A, and the OpenMerit extension observes
5
- its completed trace, trials B and C sequentially through pi, compares quality,
6
- price, and latency, and recommends a model for that exact pi session. The
7
- shipped policy is supervised: you review and apply a recommendation with
8
- `/openmerit apply`. Automatic swaps are available as an explicit opt-in.
9
-
10
- ```text
11
- pi task A → saved pi trace → extension trial job → pi trials B, C → scored frontier
12
- ↑ │
13
- └──── pi.setModel() ← approval/policy ← recommendation ┘
14
- ```
1
+ # OpenMerit
2
+
3
+ OpenMerit is a harness-neutral orchestration layer that helps a coding harness continuously find and maintain the Pareto frontier of models for a real product task.
4
+
5
+ OpenMerit does not perform the intelligent work. It nudges a connected coding harness, such as Pi, with typed outcome requests. The harness understands the project, establishes evaluations and observability, gathers evidence, discovers and tests candidates, calculates the Pareto frontier, and performs an authorized model change. OpenMerit validates the returned contracts, preserves evidence and preferences, and advances the approved lifecycle.
6
+
7
+ The npm package `openmerit` contains the Pi extension, the reusable coordinator,
8
+ and the protocol in one install. The Pi adapter is the first integration; other
9
+ harnesses can use the same core and protocol exports.
10
+
11
+ ## Why OpenMerit
12
+
13
+ The cheapest model, fastest model, and highest-quality model are often different. Public benchmarks are useful before product evidence exists, but they cannot establish which model is best for a particular workload. OpenMerit connects the initial choice to production evidence and repeated reassessment.
14
+
15
+ It distinguishes:
16
+
17
+ - one-run observations from rate, percentile, consistency, and reliability claims;
18
+ - missing evidence from poor performance;
19
+ - feasible candidates from dominated, unresolved, or ineligible candidates;
20
+ - an automatic nudge from an intelligent action performed by the harness;
21
+ - a recommendation from an authorized, verified model swap.
22
+
23
+ ## Current capabilities
15
24
 
16
- ## How it maps to the design
17
-
18
- 1. **Instruction file + policy file** — [`instructions/OPENMERIT.md`](instructions/OPENMERIT.md)
19
- goes into the main harness's context (AGENTS.md-style);
20
- [`instructions/openmerit.policy.json`](instructions/openmerit.policy.json)
21
- (copied to `~/.openmerit/policy.json` by `openmerit init`) gates autonomy:
22
- supervised recommendations by default, optional auto-apply thresholds,
23
- budgets, and provider allow-lists. Public-benchmark relevance lives in
24
- [`src/benchmarks.ts`](src/benchmarks.ts) (task category → benchmarks that
25
- matter) plus a refreshable digest at `~/.openmerit/benchmarks/digest.json`.
26
- 2. **Trial workflow** — the pi extension starts a session-bound comparison
27
- after a supported task settles. It runs candidate trials sequentially under
28
- configured candidate-trial caps. `openmerit watch` remains an optional CLI
29
- mode. Pi's traces and JSON event stream supply results, cost,
30
- latency, and errors; a judge or known-ground-truth scorer measures quality.
31
- 3. **Per-task pareto frontier** — trials are keyed by task signature
32
- ([`src/frontier.ts`](src/frontier.ts), 3 objectives: quality ↑, price ↓,
33
- latency ↓). The aggregate across all of an agent's tasks is the union of
34
- its task frontiers (`openmerit frontier`).
35
- 4. **Model discovery** — the active Pi session's scoped models (or Pi's
36
- authenticated available-model registry when unscoped) are the candidate
37
- pool. OpenRouter is an optional route and enrichment source: its catalog can
38
- be snapshotted and its benchmark signals can improve the shortlist
39
- ([`src/catalog.ts`](src/catalog.ts) + [`src/daemon.ts`](src/daemon.ts)).
40
- 5. **Informing the main harness** — recommendations land in
41
- `~/.openmerit/recommendations.jsonl`. The pi extension
42
- ([`extension/openmerit.ts`](extension/openmerit.ts)) reports progress, polls it, and applies
43
- swaps with `pi.setModel()` — automatically when the policy gate passes,
44
- otherwise after user approval (`/openmerit`, `/openmerit apply`). The same
45
- recommendation carries the updated fallback, used when the active model
46
- starts failing.
47
-
48
- ## Install from npm
49
-
50
- You need Node 22.18+, pi 0.85.1+, and at least two eligible model routes
51
- authenticated in Pi. OpenRouter is supported but not required. Install the
52
- package into pi, then initialize its policy and state:
53
-
54
- ```bash
25
+ - Pi 0.87 extension with a single `/openmerit` command surface.
26
+ - Harness-inferred, user-confirmed task profiles with explicit metrics, sampling designs, constraints, and evaluation budgets.
27
+ - The complete initial quality, reliability, cost, latency, efficiency, and human-intervention metric catalogue.
28
+ - Setup-time preliminary model research in the source checkout, followed by baseline evidence collection, refreshed candidate discovery, and controlled challenger trials. The published `0.1.5` package still begins candidate discovery after the baseline.
29
+ - A normative, uncertainty-aware Pareto definition owned by OpenMerit.
30
+ - Harness-calculated frontier results independently checked by OpenMerit's conformance verifier.
31
+ - Versioned result schemas for all ten intents, reusable across harness adapters and exposed dynamically by Pi.
32
+ - Configurable swap approval, post-swap verification requests, and policy-based rollback requests. Automatic swaps can begin immediately if explicitly enabled with a zero verified-swap threshold.
33
+ - Project-local snapshots, redacted append-only audit events, evidence manifests, and optional best-effort event exporters under `.openmerit/`.
34
+ - Model-catalog change detection that can nudge the harness to reassess a mature baseline.
35
+ - User-confirmed task-count, elapsed-time, regression, catalogue-change, and post-swap check policies.
36
+ - Idempotent harness signals, durable pending work, native wakeup planning, and explicit scheduler capability gaps.
37
+ - In the unreleased source checkout, an opt-in macOS Pi LaunchAgent for time-based checks and a durable pause; published `0.1.5` still requires an external scheduler and has a partial, session-local pause.
38
+
39
+ ## Responsibility boundary
40
+
41
+ | OpenMerit | Coding harness |
42
+ | --- | --- |
43
+ | Defines typed outcomes and Pareto conformance rules | Understands the product and user task |
44
+ | Tracks lifecycle, policy, budget, and evidence references | Builds evals and observability |
45
+ | Determines which approved nudge is due | Collects and calculates metrics |
46
+ | Verifies returned structure and frontier conformance | Discovers candidates and calculates the frontier |
47
+ | Selects intents according to confirmation and rollback policy | Applies and verifies an authorized model change |
48
+
49
+ Jev System One, when configured, belongs to the coding harness. Pi may use it aggressively for bounded ranking, triage, and fast judgment. OpenMerit contains no Jev client and accepts no Jev credential.
50
+
51
+ ## Install with Pi
52
+
53
+ Requirements:
54
+
55
+ - Node.js 22.19 or newer
56
+ - Pi 0.87 with a supported model provider configured
57
+
58
+ ```sh
55
59
  pi install npm:openmerit
56
- npx --yes openmerit init
57
- npx --yes openmerit verify
58
60
  pi list
59
61
  ```
60
62
 
61
- `pi install` makes the extension and its trial engine available to pi. The
62
- one-off `npx` command creates `~/.openmerit/policy.json`; install OpenMerit
63
- globally with `npm install --global openmerit` only if you also want persistent
64
- shell access to `openmerit status`, `doctor`, `verify`, `frontier`, or the optional watcher. Install
65
- the extension from only one source—remove any older copied `openmerit.ts` first
66
- so pi does not load it twice.
63
+ When Pi enters an unconfigured project with an interactive UI, the adapter first looks for an actual application LLM call pattern. If the project starts empty, the unreleased source checkout scans again after each settled build turn and automatically begins setup when Pi creates the application call. `/openmerit setup` remains a recovery command rather than a required demo step. Pi confirms the application target and exact incumbent application model, infers task-relevant metrics and their repeated-input or representative-case sampling designs, explains the proposed collection plan and estimated cost, and asks the user to confirm or edit it. It then establishes task-specific eval and observability artifacts, verifies them, and reports evidence to OpenMerit. Pi's own model is never the application target.
67
64
 
68
- For development from a local checkout instead, run:
65
+ Run `/openmerit doctor` inside Pi to check the installation. OpenMerit keeps
66
+ project evidence under `.openmerit/` in the product repository. Version 0.1.5
67
+ replaces the 0.1.4 background watcher and standalone CLI with this
68
+ harness-driven lifecycle; it does not migrate the earlier home-directory state.
69
69
 
70
- ```bash
71
- npm ci
72
- node dist/cli.js init
73
- pi install "$PWD"
74
- ```
70
+ ## Commands
75
71
 
76
- Keep that checkout available because pi loads a local package from its path.
77
-
78
- ## Run OpenMerit with pi
79
-
80
- 1. Initialize OpenMerit if you did not do so during installation:
81
-
82
- ```bash
83
- npx --yes openmerit init
84
- ```
85
-
86
- `init` creates `~/.openmerit/policy.json` if missing and **keeps an existing
87
- policy**. The shipped policy uses `"mode": "recommend"` and does not change
88
- the active model without approval.
89
-
90
- 2. Authenticate the providers you want to compare in Pi, using `/login` or
91
- Pi's normal environment/model configuration. OpenMerit takes its eligible
92
- model routes, capabilities, prices, and credentials from Pi; judge and
93
- strategist calls use the same routes and do not require duplicate keys.
94
-
95
- For example, verify one provider without printing its credential:
96
-
97
- ```bash
98
- pi auth check --provider openai --json
99
- ```
100
-
101
- Add an OpenRouter route the same way if you want its routed catalog:
102
-
103
- ```bash
104
- pi auth check --provider openrouter --json
105
- ```
106
-
107
- An `OPENROUTER_API_KEY` in the process environment or
108
- `~/.openmerit/.env` additionally enables OpenRouter catalog and public-
109
- benchmark enrichment. It is optional for native-provider comparisons. If
110
- using the file, protect it:
111
-
112
- ```bash
113
- nano ~/.openmerit/.env
114
- chmod 600 ~/.openmerit/.env
115
- ```
116
-
117
- Pi does not read OpenMerit's `.env` file for its ordinary sessions, so an
118
- OpenRouter route still needs Pi authentication. Older `model_search/.env`
119
- files are not read.
120
-
121
- 3. Verify the extension appears in `pi list`. The instruction file
122
- [`instructions/OPENMERIT.md`](instructions/OPENMERIT.md) can be added to a
123
- pi project's AGENTS.md for agent context, but the extension does
124
- not require it. Run `npx openmerit verify` for a provider-free core self-test,
125
- then `npx openmerit doctor` after starting Pi once to inspect the eligible
126
- route snapshot and configuration without printing secrets.
127
-
128
- 4. Start pi in one terminal with any configured model. For example:
129
-
130
- ```bash
131
- pi --provider openrouter --model openai/gpt-4o-mini
132
- ```
133
-
134
- For a first text task, ask: “Give the shortest valid word ladder from cat
135
- to dog. Each step changes one letter and must be a common English word.
136
- Return only the path.” Wait for A to finish and leave the pi session open.
137
- The extension automatically starts B and C **sequentially through their
138
- selected Pi routes**,
139
- reports each score in Pi, and writes a recommendation for this exact
140
- session. With the shipped supervised policy, use
141
- `/openmerit` inside pi to inspect the evidence and `/openmerit apply` to
142
- switch. Then send a second message to see which model actually handles it.
143
- You do not need a watcher terminal or the standalone `trial` command.
144
-
145
- Use `/openmerit pause` to stop the active comparison and suppress automatic
146
- comparisons, `/openmerit resume` to enable them for future completed tasks,
147
- and `/openmerit compare` to explicitly compare the latest completed task
148
- even while automatic comparisons are paused. `/openmerit doctor` runs the
149
- sanitized setup checks without leaving Pi.
150
-
151
- Candidate comparisons have no tools by default, even when the observed task
152
- used tools. See **Alpha boundaries** before explicitly enabling candidate
153
- tools.
154
-
155
- To opt in to automatic swaps, edit `~/.openmerit/policy.json`, set
156
- `"mode": "auto"` and `"auto_apply.enabled": true`, review the score-gain
157
- and price-ratio thresholds, and run the next task.
158
-
159
- ### Configure custom or local routes
160
-
161
- Pi normally supplies each route's price, context window, output limit, and
162
- modalities. Some custom and local providers omit that metadata. OpenMerit does
163
- not guess that a local model is free: add an override keyed by the exact
164
- `provider:modelId` route in `~/.openmerit/policy.json` instead:
165
-
166
- ```json
167
- {
168
- "route_overrides": {
169
- "ollama:qwen3:8b": {
170
- "cost": { "input": 0, "output": 0 },
171
- "context_window": 32768,
172
- "max_tokens": 4096,
173
- "input": ["text"]
174
- }
175
- }
176
- }
177
- ```
72
+ - `/openmerit` or `/openmerit status` — show evidence readiness and lifecycle stage.
73
+ - `/openmerit setup` — explicitly rerun or recover automatic setup.
74
+ - `/openmerit assess` — check stored application metric windows against the baseline thresholds now (in the unreleased source checkout); start candidate discovery only when ready. Published `0.1.5` still asks Pi to assess.
75
+ - `/openmerit logs` — show the canonical audit, exporter-error, evidence, and state paths.
76
+ - `/openmerit frontier` — ask the harness to calculate a frontier now; OpenMerit verifies it.
77
+ - `/openmerit approve` — approve a verified proposal during supervised graduation.
78
+ - `/openmerit pause` and `/openmerit resume` — control some proactive nudges in the current Pi session; task-triggered checks can still run in 0.1.5. See [pause limitations](docs/commands.md#pause-and-resume).
79
+ - `/openmerit doctor` — show sanitized adapter diagnostics.
178
80
 
179
- All fields are optional, but both `cost.input` and `cost.output` are required
180
- when declaring cost. Prices use Pi's dollars-per-million-token units. The
181
- override applies only to that exact route; it does not change the stable
182
- `vendor/model` identity or another provider's route to the same model.
183
-
184
- If the provider itself is registered at runtime by a Pi extension, explicitly
185
- allow that provider-registration file in the same policy. Paths must be
186
- absolute, existing files:
187
-
188
- ```json
189
- {
190
- "pi": {
191
- "provider_extensions": [
192
- "/absolute/path/to/ollama-provider.ts"
193
- ]
194
- }
195
- }
196
- ```
81
+ ## Inference Terminal (test preview)
197
82
 
198
- OpenMerit still launches subprocesses with extension discovery disabled, then
199
- loads only these explicit files. Do not add OpenMerit's own extension. An
200
- allowlisted extension executes code in every candidate, judge, and strategist
201
- Pi subprocess, so list only provider extensions you trust. Run
202
- `npx openmerit doctor` or `/openmerit doctor` to validate the files and confirm
203
- that route overrides match Pi's visible routes.
204
-
205
- Existing `0.1.x` policy files remain valid: missing `route_overrides` and
206
- `pi.provider_extensions` fields normalize to empty safe defaults. `openmerit init`
207
- continues to preserve an existing policy, so add these fields manually
208
- only when you need them.
209
-
210
- ### Try an invoice-to-JSON task
211
-
212
- Use the same one-terminal setup. Start pi with a vision-capable model, for
213
- example `openai/gpt-4o-mini`. In pi, type `@` to select
214
- [`benchmark/invoice_ocr/data/invoice_01_row_2.jpg`](benchmark/invoice_ocr/data/invoice_01_row_2.jpg)
215
- and paste the **entire, unchanged** text from
216
- [`examples/invoice-prompt.txt`](examples/invoice-prompt.txt) into the same
217
- message. Pi also accepts pasted or dragged images. Wait for the JSON answer;
218
- keep pi open while the extension trials two other vision models. OpenMerit uses
219
- the existing benchmark's visibility-audited exact-field scorer when the saved
220
- task contains the exact example prompt and original bytes of a pinned JPEG.
221
- Pi may resize an attached image or add a file header to the prompt; in that
222
- case, the run uses the vision judge that sees the image and answer. Other
223
- uploaded invoices also use that judge because they have no ground truth.
224
-
225
- A real pinned-invoice run produced this trial output (models and scores will
226
- vary between runs):
227
-
228
- ```text
229
- [openmerit] task 0e7642522dc5: A=openai/gpt-4o-mini score=1.00 from pi trace
230
- [openmerit] task 0e7642522dc5: google/gemma-3-12b-it score=0.31 cost=$0.0001
231
- [openmerit] task 0e7642522dc5: mistralai/ministral-14b-2512 score=1.00 cost=$0.0007
232
- [openmerit] task 0e7642522dc5: selected mistralai/ministral-14b-2512; auto=false
233
- ```
83
+ A local, dark-only overview of application inference inventory, connections, activity, and compute. Coding-harness usage is outside its scope. It reads existing metadata passively and makes no model calls.
234
84
 
235
- Pi candidate runs rely on the explicit invoice prompt for JSON structure.
236
- The standalone invoice benchmark sends a strict OpenRouter `response_format`
237
- schema, so its published scores are not directly comparable to these pi runs.
238
-
239
- ### Inspect or troubleshoot a run
240
-
241
- `npx openmerit doctor` checks Pi, policy, eligible routes and prices, saved
242
- session state, duplicate package sources, append-only files, and optional
243
- OpenRouter enrichment. Add `--json` for a sanitized diagnostic report suitable
244
- for a bug report; it contains no credentials, prompts, or trace contents.
245
- `npx openmerit verify` runs an offline self-test of atomic state, JSONL recovery,
246
- route preservation, policy evidence, and neutral events without contacting a
247
- provider. `npx openmerit status` shows the latest pi model and pending recommendations;
248
- `npx openmerit frontier` shows measured quality, blended price, latency, and
249
- the chosen frontier per task. `/openmerit` inside pi shows the current model,
250
- fallback, the model currently being compared, completed models with quality,
251
- cost, and latency, trial budget, pending recommendations, and any exact-task result
252
- measured in another session. When the gate declines an automatic swap, it
253
- prints reasons and `/openmerit apply` remains available. It also lists every
254
- route skipped during the current comparison with the relevant policy, pricing,
255
- modality, or per-trial budget reason.
256
-
257
- The daily trial-count and dollar limits come from `~/.openmerit/policy.json`.
258
- If a limit is reached, the extension reports why it skipped the comparison;
259
- the count resets at midnight UTC. You may raise `budgets.max_trials_per_day`
260
- for local experiments while keeping `budgets.max_usd_per_day` as a conservative
261
- candidate-spend threshold.
262
-
263
- If no comparison starts after Pi settles, confirm that pi loaded the extension
264
- (`pi list`), the task finished, and the pi session is saved (do not use
265
- `--no-session`). Image candidates must advertise image input in Pi's model
266
- registry. The extension queues
267
- completed tasks from its current session and runs one comparison at a time.
268
- Closing or switching the session cancels the active job.
269
- Candidate runs use the same text and uploaded image bytes, but they do not
270
- replay earlier answers or file changes. An exact task in another session
271
- (including identical image bytes) appears as **advice**, not a pending swap;
272
- the new session still gets its own comparison.
273
-
274
- The optional `trial` command runs controlled text-task comparisons through the
275
- same exact Pi provider routes and credential store as the automatic session
276
- path:
277
-
278
- ```bash
279
- npx openmerit trial examples/task.example.json --rounds 3
280
- ```
85
+ With Node.js 22.19+ installed, run this from your application's directory:
281
86
 
282
- `initial_model` is the stable `vendor/model` identity. When Pi exposes that
283
- model through more than one provider, set `initial_route` to
284
- `provider:model-id` (for example `openai:gpt-4o-mini` or
285
- `openrouter:openai/gpt-4o-mini`). Judge and strategist calls also run through
286
- Pi. An OpenRouter key only adds optional catalog and public-benchmark metadata.
287
-
288
- ## Alpha boundaries
289
-
290
- - With the extension installed and at least two eligible Pi routes, each
291
- supported settled task can start comparison calls automatically. Candidate,
292
- judge, and strategist requests send the task text, attached files or images,
293
- and candidate output to the configured providers and can incur charges. Use
294
- non-sensitive test tasks and conservative account limits while evaluating
295
- this alpha.
296
- - The extension queues tasks from its current pi session and compares one at a
297
- time. Candidate runs use isolated temporary copies of the original working
298
- directory and have no Pi tools by default. Their temporary changes are
299
- discarded and recorded as counts, and raw Pi JSON event streams are saved
300
- under `~/.openmerit/traces/trials/`.
301
- Candidate sessions replay the task text and images, not earlier conversation
302
- context or workspace changes.
303
- - Set `OPENMERIT_PI_TRIAL_TOOLS` to an explicit comma-separated allowlist such
304
- as `read,grep,find,ls` to let candidate models use tools; `none` keeps them
305
- disabled. Any tool access is an advanced opt-in: the copied working directory
306
- prevents ordinary project writes from touching the original, but it is not an
307
- OS sandbox. Tools may accept absolute paths, and shell tools may access the
308
- network. Keep the no-tools default for untrusted or sensitive projects.
309
- - File attachments that Pi records as `<file name="…">` are copied into every
310
- candidate sandbox and passed back to Pi as `@` file inputs. This covers PDFs,
311
- CSVs, spreadsheets, and other files that Pi can open; OpenMerit does not
312
- implement a separate parser for them.
313
- - `ledger.json` counts reported candidate, rubric, judge, and strategist spend
314
- for automatic session comparisons plus the daily candidate count.
315
- `max_usd_per_trial` is a conservative admission estimate based on known Pi
316
- prices and a 4K answer; it is not a provider-side hard cap. Routes without
317
- known pricing are excluded as candidates and cannot auto-apply. Use an exact
318
- `route_overrides` entry for a custom/local route whose price is known; zero
319
- cost must be stated explicitly.
320
- - Each comparison has one observed baseline plus a small candidate slate and
321
- one quality score per answer. Treat recommendations as experimental evidence,
322
- not a universal model ranking.
323
- - Candidate execution, judging, and strategy use the provider/model routes
324
- exposed by Pi. OpenRouter remains an optional route plus catalog/benchmark
325
- enrichment source. `HarnessAdapter`, `ModelProviderAdapter`,
326
- `ObservationSource`, and `EventSink` remain separate integration boundaries;
327
- Pi and local JSONL are the implementations shipped in this release.
328
- - Candidate subprocesses can use Pi built-ins, configured custom/local routes,
329
- and providers registered by explicitly allowlisted extension files. Normal
330
- extension discovery remains disabled, and OpenMerit refuses to load its own
331
- extension recursively.
332
- - JSON state snapshots are replaced atomically. Append-only readers skip and
333
- report malformed or interrupted lines while retaining later valid records.
334
- A job owned by a crashed process is reclaimable instead of remaining stuck
335
- in `running`; completed jobs remain final.
336
-
337
- ## State layout (`~/.openmerit/`)
338
-
339
- | file | contents |
340
- |---|---|
341
- | `policy.json` | gate thresholds, budgets, intervals, exact-route metadata overrides, and allowlisted Pi provider extensions |
342
- | `harness-state.json` | current/fallback routes, Pi's eligible route snapshot, pause state, latest session and settled task |
343
- | `recommendations.jsonl` | append-only session-bound recommendations, routes, evidence, gate reasons, and status updates |
344
- | `trials.jsonl` | every model trial point, including its provider route when known |
345
- | `traces/observations.jsonl` | task observations extracted from session traces |
346
- | `events.jsonl` | versioned provider-neutral observation, trial, and recommendation events for future sinks |
347
- | `traces/trials/*.jsonl` | raw Pi JSON event streams for candidate trials |
348
- | `catalog/snapshot.json` + `candidates.json` | catalog snapshot (including input modalities) + new-model queue |
349
- | `benchmarks/digest.json` | public-benchmark scores per model (seed + refresh) |
350
- | `ledger.json` | daily trial spend (budget enforcement) |
351
- | `watch/processed.json` | latest task handled by optional CLI watcher |
352
- | `watch/jobs/*.json` | per-session comparison status and retry marker |
353
-
354
- ## Benchmarks
355
-
356
- From a source checkout, the benchmark runners are TypeScript and execute
357
- directly on Node 22.18+; no transpilation step or Python environment is
358
- required. The slim npm artifact keeps only the pinned invoice data needed by
359
- runtime scoring; use the repository checkout for these developer commands:
360
-
361
- ```bash
362
- npm run benchmark:invoice -- --models google/gemini-3.8-flash
363
- npm run benchmark:invoice:round2 -- --verify-only
364
- npm run benchmark:text-to-sql -- --verify-only
365
- npm run benchmark:policy:validate
366
- npm run benchmark:policy -- --verify-only
367
- npm run benchmark:verify-recorded
87
+ ```sh
88
+ npm install -g openmerit@preview
89
+ openmerit dash
368
90
  ```
369
91
 
370
- - `benchmark/invoice_ocr/` — two real vision/OCR model slates over the same
371
- pinned 10-invoice dataset.
372
- - `benchmark/text_to_sql/` — executable SQLite evaluation over 10 analytical
373
- tasks.
374
- - `benchmark/policy_adjudication/` — 12 adversarial reimbursement-policy cases,
375
- including prompt-injection cases and frozen input hashes.
376
-
377
- All three benchmark families preserve raw JSONL observations, audited summaries,
378
- cost/latency/quality rankings, and Pareto layers. `npm run typecheck` covers both
379
- the application and every benchmark runner. `npm run benchmark:verify-recorded`
380
- replays the checked-in raw results locally and compares them with their audited
381
- artifacts without making provider calls or writing new results.
382
-
383
- ## Maintainer release
384
-
385
- OpenMerit follows pi's [package format](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/packages.md):
386
- the npm manifest has the `pi-package` keyword, a `pi.extensions` entry, and the
387
- pi API as a peer dependency. Public npm packages with that keyword are eligible
388
- for pi's package gallery; a separate approval from the pi team is not part of
389
- the standard listing flow.
390
-
391
- Before publishing a release:
392
-
393
- ```bash
394
- npm run check
395
- npm pack --dry-run
396
- npm publish --access public
92
+ The preview uses the existing `openmerit` npm package, including its coordinator, protocol, Pi adapter, and compiled terminal assets. It opens its localhost URL in your default browser. The stable npm package `openmerit@0.1.5` does not include this command. See the [Inference Terminal guide](docs/inference-terminal.md) for supported sources, updating or removing the preview, source builds, and read-only agent access.
93
+
94
+ ## Documentation
95
+
96
+ Read the searchable [OpenMerit documentation](https://openmerit.site/docs/). The Markdown sources below also ship with the package.
97
+
98
+ - [Getting started](docs/getting-started.md)
99
+ - [Your first trial](docs/first-trial.md)
100
+ - [Command reference](docs/commands.md)
101
+ - [Budgets and permissions](docs/budgets.md)
102
+ - [Troubleshooting](docs/troubleshooting.md)
103
+ - [Architecture and responsibility boundary](docs/architecture.md)
104
+ - [Metrics and evidence](docs/metrics-and-evidence.md)
105
+ - [Improvement lifecycle](docs/lifecycle.md)
106
+ - [Harness-neutral automation](docs/automation.md)
107
+ - [Pi extension guide](docs/pi-extension.md)
108
+ - [Building another harness adapter](docs/adapter-guide.md)
109
+ - [Pareto conformance specification](docs/pareto-spec.md)
110
+ - [Project state and operations](docs/operations.md)
111
+ - [Security](docs/security.md)
112
+ - [Testing](docs/testing.md)
113
+ - [Current limitations and roadmap](docs/roadmap.md)
114
+
115
+ ### Maintaining documentation
116
+
117
+ Edit the Markdown in `docs/` alongside product changes. The public documentation is generated from these same files; there is no separate article copy to update in `site/`. Run `npm run check:docs` to rebuild and validate it. The normal Cloudflare deployment rebuilds and publishes the documentation. See [the documentation workflow](docs/site-documentation.md) for adding guides and previewing changes.
118
+
119
+ ## Repository layout
120
+
121
+ - `packages/protocol` — harness-neutral types for intents, results, metrics, policies, and frontier evidence.
122
+ - `packages/core` — adapter SDK, durable coordinator, pluggable persistence, policy, and frontier conformance verification.
123
+ - `packages/pi` — Pi extension that turns OpenMerit intents into harness work.
124
+ - `docs` — user, operator, architecture, and normative documentation.
125
+
126
+ The workspace modules are private development boundaries. The published
127
+ package exposes `openmerit/core`, `openmerit/protocol`, and `openmerit/pi`.
128
+
129
+ ## Development from source
130
+
131
+ ```sh
132
+ npm ci
133
+ npm run verify
134
+ ./node_modules/.bin/pi --no-extensions -e ./packages/pi/src/index.ts
397
135
  ```
398
136
 
399
- Then verify the actual public artifact with `npm view openmerit` and a clean
400
- `pi install npm:openmerit`. Gallery indexing may not be immediate. A featured
401
- or curated mention in pi-owned documentation is separate and would require the
402
- maintainers to accept a contribution or request.
137
+ `--no-extensions` prevents an installed npm copy of OpenMerit from registering the same tools as the source extension. Credentials must never be committed. The repository intentionally contains no provider or Jev API key.