jev-dev-harness 0.2.14 → 0.2.17

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 (59) hide show
  1. package/CHANGELOG.md +145 -88
  2. package/LICENSE +21 -21
  3. package/README.md +687 -656
  4. package/bin/jev-dev.js +3 -3
  5. package/bin/jev-mcp.js +8 -8
  6. package/dashboard/index.html +1122 -1122
  7. package/dist/cli/delegate.d.ts +4 -0
  8. package/dist/cli/delegate.d.ts.map +1 -0
  9. package/dist/cli/delegate.js +62 -0
  10. package/dist/cli/delegate.js.map +1 -0
  11. package/dist/cli/doctor.js +46 -46
  12. package/dist/cli/index.d.ts.map +1 -1
  13. package/dist/cli/index.js +25 -5
  14. package/dist/cli/index.js.map +1 -1
  15. package/dist/cli/setup.d.ts.map +1 -1
  16. package/dist/cli/setup.js +25 -9
  17. package/dist/cli/setup.js.map +1 -1
  18. package/dist/context-ranker/stage-a-filter.d.ts.map +1 -1
  19. package/dist/context-ranker/stage-a-filter.js +26 -29
  20. package/dist/context-ranker/stage-a-filter.js.map +1 -1
  21. package/dist/context-ranker/types.d.ts +1 -0
  22. package/dist/context-ranker/types.d.ts.map +1 -1
  23. package/dist/delegate/index.d.ts +129 -0
  24. package/dist/delegate/index.d.ts.map +1 -0
  25. package/dist/delegate/index.js +87 -0
  26. package/dist/delegate/index.js.map +1 -0
  27. package/dist/hooks/index.d.ts +29 -3
  28. package/dist/hooks/index.d.ts.map +1 -1
  29. package/dist/hooks/index.js +176 -48
  30. package/dist/hooks/index.js.map +1 -1
  31. package/dist/mcp/server.d.ts.map +1 -1
  32. package/dist/mcp/server.js +6 -0
  33. package/dist/mcp/server.js.map +1 -1
  34. package/dist/shared/efficiency.d.ts +4 -1
  35. package/dist/shared/efficiency.d.ts.map +1 -1
  36. package/dist/shared/efficiency.js +8 -4
  37. package/dist/shared/efficiency.js.map +1 -1
  38. package/dist/shared/telemetry.d.ts +6 -0
  39. package/dist/shared/telemetry.d.ts.map +1 -1
  40. package/dist/shared/telemetry.js +6 -0
  41. package/dist/shared/telemetry.js.map +1 -1
  42. package/dist/shared/typesafe-client.d.ts +2 -0
  43. package/dist/shared/typesafe-client.d.ts.map +1 -1
  44. package/dist/shared/typesafe-client.js +20 -9
  45. package/dist/shared/typesafe-client.js.map +1 -1
  46. package/dist/shared/version.js +1 -1
  47. package/dist/tool-guard/guard.d.ts.map +1 -1
  48. package/dist/tool-guard/guard.js +32 -8
  49. package/dist/tool-guard/guard.js.map +1 -1
  50. package/docs/RELEASING.md +250 -216
  51. package/docs/jev/DELEGATED-REVIEW.md +86 -0
  52. package/docs/jev/JEV-0.2.16-DEFAULTS.md +60 -0
  53. package/docs/jev/JEV-1.14-EVALUATION.md +99 -99
  54. package/docs/jev/MEASURED-USAGE.md +155 -155
  55. package/docs/jev/MULTI-HARNESS-USAGE.md +163 -163
  56. package/docs/jev/OPENROUTER-NATIVE.md +93 -93
  57. package/docs/jev/README.md +85 -85
  58. package/docs/jev/evaluation-jev-1.14-2026-10-15.json +1731 -1731
  59. package/package.json +139 -134
@@ -0,0 +1,60 @@
1
+ # Harness 0.2.16 model defaults
2
+
3
+ ## Selection and compatibility
4
+
5
+ Unpinned client defaults are TypeSafe `jev-1.14.0`, OpenRouter `typesafe/jev-1.14`,
6
+ and Vercel `typesafe-ai/jev-1.14.0`. Selection preserves explicit options first,
7
+ then provider model environment variables, the legacy shared
8
+ `TYPESAFE_DEFAULT_MODEL` environment fallback, and a saved model only when its
9
+ saved provider matches the selected provider. An existing explicit 1.13 pin is
10
+ not upgraded. Provider selection itself is unchanged.
11
+
12
+ TypeSafe accepts the known legacy `typesafe/jev-1.13` and `typesafe/jev-1.14`
13
+ slugs by converting them to native `jev-1.13.0` and `jev-1.14.0`; optional `.0`
14
+ and bare two-component Jev aliases normalize equivalently. This preserves the
15
+ pinned version rather than switching it. Explicit Vercel floating alias
16
+ `typesafe-ai/jev` and other existing custom model choices remain explicit choices.
17
+ The decision cache identity still includes provider, base URL, effective model
18
+ and decision mode. Changing any of these cannot reuse another model's cache.
19
+
20
+ Setup now carries TypeSafe/Vercel model choices through its generated settings,
21
+ just as it already did for OpenRouter. Running setup is an explicit action; merely
22
+ installing this package does not rewrite existing configuration files. Do not run
23
+ setup just to inspect defaults: instantiate the client with `disabled: true` for
24
+ an offline inspection, or inspect existing configuration locally without exposing
25
+ credentials. A model default change alone does not prove remote availability.
26
+
27
+ ## Deliberate upgrade or rollback
28
+
29
+ For a separately authorized provider configuration, set exactly one appropriate
30
+ model variable to select 1.14 explicitly:
31
+
32
+ - TypeSafe: `TYPESAFE_DEFAULT_MODEL=jev-1.14.0`.
33
+ - OpenRouter: `OPENROUTER_MODEL=typesafe/jev-1.14`.
34
+ - Vercel: `VERCEL_MODEL=typesafe-ai/jev-1.14.0`.
35
+
36
+ To retain or roll back a model pin, use the corresponding explicitly supported
37
+ 1.13 model identifier in that same configuration. A process inherits environment
38
+ at launch; a newly changed setting may require restarting that process. Do not
39
+ remove unrelated credentials, settings or existing user changes. A package rollback
40
+ is separate from a model pin rollback; retain the previous trusted package version.
41
+
42
+ Safety Pro Engine RC3 has an exact harness allowlist of 0.2.14 and 0.2.15. Harness
43
+ 0.2.16 is intentionally rejected by that unchanged gate. Keep Engine RC3 pointing
44
+ at a separately preserved trusted 0.2.15 package until a dedicated compatibility
45
+ update is reviewed. Agensi Native is a separate product and is not changed here.
46
+
47
+ ## Evidence and limits
48
+
49
+ This default was selected by the owner despite the limited prior benchmark; no
50
+ claim is made that 1.14 is more accurate, universally faster or less expensive.
51
+ Historical evaluation scripts, JSON receipts and `JEV-1.14-EVALUATION.md` retain
52
+ their original 1.13 production-default decision. They describe that earlier
53
+ checkpoint, not this later owner-directed default. Offline mocked tests verify
54
+ selection, payloads, pins and cache separation, not live provider quality/cost.
55
+ Setup regression tests use an in-memory filesystem and a mocked healthcheck; no real setup configuration or provider healthcheck is executed by those tests. No automatic hook, interception or global MCP/skill registration is implied.
56
+
57
+ Official model identifier references:
58
+ - https://docs.typesafe.ai/models
59
+ - https://openrouter.ai/typesafe/jev-1.14
60
+ - https://vercel.com/ai-gateway/models/jev-1.14.0
@@ -1,99 +1,99 @@
1
- # SDK 0.7 migration and Jev 1.14 evaluation
2
-
3
- ## Release policy
4
-
5
- Harness 0.2.12 requires Node.js 22+ and pins `@typesafe-ai/sdk` to 0.7.0.
6
- The native TypeSafe default is `jev-1.13.0`, not `jev-latest`. Explicit constructor
7
- or `TYPESAFE_DEFAULT_MODEL` overrides still work for controlled experiments.
8
- Existing deployments must restart their MCP process to load new configuration.
9
-
10
- OpenRouter retains `typesafe/jev-1.13`. Vercel retains its supported
11
- `typesafe-ai/jev` ID; that is a floating gateway identifier, not a verified version
12
- pin. Do not assume a native versioned ID is supported by a gateway. The experiment
13
- below uses only the native TypeSafe endpoint and does not certify either gateway.
14
- Use native TypeSafe with an exact versioned ID when a strict pin is required.
15
-
16
- Images, Box and long-context modes remain disabled by default. The wrapper
17
- supports only Noul/Choice/Score and rejects unsupported question types before
18
- transport. SDK compression is explicitly disabled for both SDK-backed transports
19
- to preserve existing wire behavior; OpenRouter's custom transport is unchanged.
20
- SDK 0.7's new experimental capabilities are not enabled by updating the package.
21
-
22
- ## Nullable usage contract
23
-
24
- A valid decision may have `usage.input_tokens` or `output_tokens` set to null.
25
- The wrapper preserves it as a successful decision, keeps null on the corresponding
26
- `inputTokens`/`outputTokens`, and continues to validate actual decision fields.
27
- Malformed, missing, negative, fractional and string counters remain invalid.
28
- Missing/null cost is unknown; an explicit numeric zero remains a reported cost.
29
-
30
- `TelemetryMetrics.tokensSent` / `tokensReceived` and dashboard summary totals are
31
- now nullable. A null in any validated response keeps that direction's aggregate
32
- unknown. `inputTokenRequests` / `outputTokenRequests` count validated responses
33
- with each counter present. MCP efficiency schemaVersion 2 keeps the same fields
34
- and adds `tokenCoverage`; `newTokens.input` / `output` may be null. CLI and
35
- dashboard render those as not informed. Consumers must not use `?? 0` to report a
36
- complete total. Old numeric telemetry remains readable; old records do not gain
37
- invented coverage counts.
38
-
39
- Jev measurement ledgers preserve partial token counts and independently reported
40
- cost. A request with either unknown token count increments `missingUsage` when
41
- imported. Known subtotals remain reported subtotals; net pipeline token differences
42
- stay null. Cached decisions still create no new calls or duplicated usage/cost.
43
-
44
- ## Live evidence: 2026-10-15
45
-
46
- The [machine-readable evidence](evaluation-jev-1.14-2026-10-15.json) records actual
47
- requests using the upgraded SDK/wrapper. Inputs were synthetic fixtures only;
48
- no project source, private prompts or credentials are included in the artifact.
49
-
50
- - 14 labeled fixtures: 7 English and 7 Portuguese, covering relevant/unrelated
51
- context, file roles, read-only/destructive commands and safe/unsafe auth diffs.
52
- - Each fixture repeated 3 times per model: 42 calls per version, 84 total.
53
- - Identical state/question construction for both versions, expected labels omitted
54
- from requests, alternating pair order, no cache, no retries, 5-second deadline.
55
- - Exact requested and returned models recorded; no model mismatch or fallback.
56
-
57
- | Observed result | Jev 1.13.0 | Jev 1.14.0 |
58
- | --- | --- | --- |
59
- | Fixture checks passed | 42/42 | 42/42 |
60
- | Portuguese checks | 21/21 | 21/21 |
61
- | English checks | 21/21 | 21/21 |
62
- | Fallbacks | 0 | 0 |
63
- | Mean response latency | 252.2 ms | 238.6 ms |
64
- | p95 response latency | 315 ms | 257 ms |
65
- | Reported input tokens | 18,546 | 18,546 |
66
- | Reported output tokens | 2,826 | 2,826 |
67
- | Reported cost | Not informed (0/42 calls) | Not informed (0/42 calls) |
68
-
69
- These are 14 distinct simple cases, not 42 independent scenarios. This is a small
70
- compatibility smoke evaluation, not a production acceptance test or statistically
71
- established improvement. It does not cover the complete ranking pipeline, large
72
- repositories, provider outages, all guard/lint rules or ambiguous real-world tasks.
73
- Language results do not establish a general multilingual gain. Latency is specific
74
- to this run's network/server conditions. Equal token counts are not token savings;
75
- no monetary comparison is possible without reported costs/billing evidence.
76
-
77
- **Decision: keep Jev 1.13.0 as the native production default.** Jev 1.14 completed
78
- the smoke comparison successfully but was not promoted. Before promotion, evaluate
79
- representative task fixtures, full ranking Precision/Recall@K, confidence thresholds,
80
- security false negatives, deadline failures and repeated latency/cost observations.
81
-
82
- ## Reproduce (explicit paid API calls)
83
-
84
- From the repository with native TypeSafe credentials configured:
85
-
86
- ```sh
87
- npm ci
88
- npm run eval:jev -- --live --repetitions 3 --output new-evaluation.json
89
- ```
90
-
91
- The command refuses to overwrite evidence and does not change default model or
92
- global configuration. It uses the exact 1.13/1.14 model IDs and TypeSafe endpoint.
93
- Output contains fixture IDs, observed judgments, model IDs, counters and timings.
94
- Missing credentials or transport failures must not be reported as successful tests.
95
- Synthetic scoring tests run offline in the normal test suite; live calls require
96
- `--live` and are never made by `npm test` or release checks.
97
-
98
- Sources: [SDK migration changelog](https://docs.typesafe.ai/sdk/javascript/changelog),
99
- [models and aliases](https://docs.typesafe.ai/models).
1
+ # SDK 0.7 migration and Jev 1.14 evaluation
2
+
3
+ ## Release policy
4
+
5
+ Harness 0.2.12 requires Node.js 22+ and pins `@typesafe-ai/sdk` to 0.7.0.
6
+ The native TypeSafe default is `jev-1.13.0`, not `jev-latest`. Explicit constructor
7
+ or `TYPESAFE_DEFAULT_MODEL` overrides still work for controlled experiments.
8
+ Existing deployments must restart their MCP process to load new configuration.
9
+
10
+ OpenRouter retains `typesafe/jev-1.13`. Vercel retains its supported
11
+ `typesafe-ai/jev` ID; that is a floating gateway identifier, not a verified version
12
+ pin. Do not assume a native versioned ID is supported by a gateway. The experiment
13
+ below uses only the native TypeSafe endpoint and does not certify either gateway.
14
+ Use native TypeSafe with an exact versioned ID when a strict pin is required.
15
+
16
+ Images, Box and long-context modes remain disabled by default. The wrapper
17
+ supports only Noul/Choice/Score and rejects unsupported question types before
18
+ transport. SDK compression is explicitly disabled for both SDK-backed transports
19
+ to preserve existing wire behavior; OpenRouter's custom transport is unchanged.
20
+ SDK 0.7's new experimental capabilities are not enabled by updating the package.
21
+
22
+ ## Nullable usage contract
23
+
24
+ A valid decision may have `usage.input_tokens` or `output_tokens` set to null.
25
+ The wrapper preserves it as a successful decision, keeps null on the corresponding
26
+ `inputTokens`/`outputTokens`, and continues to validate actual decision fields.
27
+ Malformed, missing, negative, fractional and string counters remain invalid.
28
+ Missing/null cost is unknown; an explicit numeric zero remains a reported cost.
29
+
30
+ `TelemetryMetrics.tokensSent` / `tokensReceived` and dashboard summary totals are
31
+ now nullable. A null in any validated response keeps that direction's aggregate
32
+ unknown. `inputTokenRequests` / `outputTokenRequests` count validated responses
33
+ with each counter present. MCP efficiency schemaVersion 2 keeps the same fields
34
+ and adds `tokenCoverage`; `newTokens.input` / `output` may be null. CLI and
35
+ dashboard render those as not informed. Consumers must not use `?? 0` to report a
36
+ complete total. Old numeric telemetry remains readable; old records do not gain
37
+ invented coverage counts.
38
+
39
+ Jev measurement ledgers preserve partial token counts and independently reported
40
+ cost. A request with either unknown token count increments `missingUsage` when
41
+ imported. Known subtotals remain reported subtotals; net pipeline token differences
42
+ stay null. Cached decisions still create no new calls or duplicated usage/cost.
43
+
44
+ ## Live evidence: 2026-10-15
45
+
46
+ The [machine-readable evidence](evaluation-jev-1.14-2026-10-15.json) records actual
47
+ requests using the upgraded SDK/wrapper. Inputs were synthetic fixtures only;
48
+ no project source, private prompts or credentials are included in the artifact.
49
+
50
+ - 14 labeled fixtures: 7 English and 7 Portuguese, covering relevant/unrelated
51
+ context, file roles, read-only/destructive commands and safe/unsafe auth diffs.
52
+ - Each fixture repeated 3 times per model: 42 calls per version, 84 total.
53
+ - Identical state/question construction for both versions, expected labels omitted
54
+ from requests, alternating pair order, no cache, no retries, 5-second deadline.
55
+ - Exact requested and returned models recorded; no model mismatch or fallback.
56
+
57
+ | Observed result | Jev 1.13.0 | Jev 1.14.0 |
58
+ | --- | --- | --- |
59
+ | Fixture checks passed | 42/42 | 42/42 |
60
+ | Portuguese checks | 21/21 | 21/21 |
61
+ | English checks | 21/21 | 21/21 |
62
+ | Fallbacks | 0 | 0 |
63
+ | Mean response latency | 252.2 ms | 238.6 ms |
64
+ | p95 response latency | 315 ms | 257 ms |
65
+ | Reported input tokens | 18,546 | 18,546 |
66
+ | Reported output tokens | 2,826 | 2,826 |
67
+ | Reported cost | Not informed (0/42 calls) | Not informed (0/42 calls) |
68
+
69
+ These are 14 distinct simple cases, not 42 independent scenarios. This is a small
70
+ compatibility smoke evaluation, not a production acceptance test or statistically
71
+ established improvement. It does not cover the complete ranking pipeline, large
72
+ repositories, provider outages, all guard/lint rules or ambiguous real-world tasks.
73
+ Language results do not establish a general multilingual gain. Latency is specific
74
+ to this run's network/server conditions. Equal token counts are not token savings;
75
+ no monetary comparison is possible without reported costs/billing evidence.
76
+
77
+ **Decision: keep Jev 1.13.0 as the native production default.** Jev 1.14 completed
78
+ the smoke comparison successfully but was not promoted. Before promotion, evaluate
79
+ representative task fixtures, full ranking Precision/Recall@K, confidence thresholds,
80
+ security false negatives, deadline failures and repeated latency/cost observations.
81
+
82
+ ## Reproduce (explicit paid API calls)
83
+
84
+ From the repository with native TypeSafe credentials configured:
85
+
86
+ ```sh
87
+ npm ci
88
+ npm run eval:jev -- --live --repetitions 3 --output new-evaluation.json
89
+ ```
90
+
91
+ The command refuses to overwrite evidence and does not change default model or
92
+ global configuration. It uses the exact 1.13/1.14 model IDs and TypeSafe endpoint.
93
+ Output contains fixture IDs, observed judgments, model IDs, counters and timings.
94
+ Missing credentials or transport failures must not be reported as successful tests.
95
+ Synthetic scoring tests run offline in the normal test suite; live calls require
96
+ `--live` and are never made by `npm test` or release checks.
97
+
98
+ Sources: [SDK migration changelog](https://docs.typesafe.ai/sdk/javascript/changelog),
99
+ [models and aliases](https://docs.typesafe.ai/models).
@@ -1,155 +1,155 @@
1
- # Measured Codex task comparisons
2
-
3
- For other clients, see the [multi-harness bridge and collectors](MULTI-HARNESS-USAGE.md).
4
-
5
- This workflow compares observed usage, not file-count estimates. It runs locally,
6
- does not upload rollout content and does not make new model requests. Codex
7
- rollout JSONL is an observed local format, not a guaranteed public API. Unknown,
8
- incomplete, reset or ambiguous counters are rejected rather than guessed.
9
-
10
- ## Developer workflow
11
-
12
- 1. Choose a small task with an objective validation (the same tests/checks on
13
- both results). Start both runs from the same commit, with the same agent model,
14
- reasoning effort, instructions and tool configuration, except the Jev change
15
- being evaluated. Keep cache conditions comparable and document them.
16
- 2. Run the baseline with Jev disabled. Use separate chats; reused history is a
17
- confounder. If a task uses several turns/subagents/reviewers, include every
18
- related interval in the manifest. The importer does not discover completeness
19
- or prove equivalence automatically.
20
- 3. Before the Jev run, start a unique ledger:
21
-
22
- ```sh
23
- jev-dev efficiency begin --run-id auth-jev-001
24
- ```
25
-
26
- Include `measurementRunId: "auth-jev-001"` on **every** Jev MCP call during
27
- that run. For CLI calls, set `JEV_MEASUREMENT_RUN_ID=auth-jev-001` in that
28
- process. All model-based harnesses use the same scoped collector. Concurrent
29
- MCP calls with different IDs stay isolated. Cache/heuristic calls do not
30
- create model-request records. No state, prompts, answers or keys enter the
31
- ledger. Missing/in-progress calls are not treated as zero usage.
32
- 4. Wait for all calls to complete, validate the task result, then close the ledger:
33
-
34
- ```sh
35
- jev-dev efficiency finish --run-id auth-jev-001
36
- jev-dev efficiency list --repo . --json
37
- ```
38
-
39
- `list` finds local logs by repository and gives session/turn IDs, timestamps,
40
- model, initial revision, counters and absolute rollout paths. It does not
41
- print messages or infer a baseline. It scans at most 200 recent files; use
42
- `--sessions-path` for a particular date or archived logs.
43
- Internal `codex-auto-review` intervals are excluded from this list by default;
44
- use `--include-internal` to locate them when reconciling task overhead.
45
- 5. Create the comparison manifest and validation receipts below. Your assistant
46
- can assemble them after you identify the two runs; you need not find JSONL
47
- files by hand. Run:
48
-
49
- ```sh
50
- jev-dev efficiency compare --manifest comparison.json --json
51
- ```
52
-
53
- Codex can also call `jev_compare_usage` with `manifestPath`. The comparison is
54
- recorded in local telemetry and shown as the latest paired task comparison in
55
- the dashboard. `--no-record` prevents telemetry writes. Reimporting a pair
56
- does not add its differences to a cumulative savings figure.
57
-
58
- ## Manifest and receipts
59
-
60
- Illustrative manifest; replace the paths/IDs with actual records. Relative paths
61
- are resolved against this manifest, not the caller's working directory.
62
-
63
- ```json
64
- {
65
- "schemaVersion": 1,
66
- "taskId": "auth-validation",
67
- "initialRevision": "exact-starting-commit-hash",
68
- "environmentId": "same-model-tools-prompt-and-cache-conditions",
69
- "allRelatedSessionsIncluded": true,
70
- "baseline": {
71
- "rollouts": [{ "path": "baseline.jsonl", "turnId": "baseline-turn-id" }],
72
- "jevDisabled": true,
73
- "validationReceipt": "baseline-validation.json"
74
- },
75
- "withJev": {
76
- "rollouts": [{ "path": "with-jev.jsonl", "turnId": "jev-turn-id" }],
77
- "validationReceipt": "jev-validation.json",
78
- "measurementRunId": "auth-jev-001",
79
- "ledgerPath": "path-to-auth-jev-001.jsonl",
80
- "allJevCallsRecorded": true
81
- }
82
- }
83
- ```
84
-
85
- Each validation receipt is tied to its exact session/turn IDs:
86
-
87
- ```json
88
- {
89
- "taskId": "auth-validation",
90
- "criterionId": "same-test-suite-and-functional-check",
91
- "passed": true,
92
- "runIds": ["actual-session-id:actual-turn-id"],
93
- "evidenceReference": "actual-test-report-artifact"
94
- }
95
- ```
96
-
97
- These are explicit user/evaluator attestations. The importer verifies matching
98
- IDs and fields, hashes the source files and checks the counters, but does not
99
- execute the validation command or independently verify the task quality, disabled
100
- Jev, declared environment equivalence or completeness of related sessions. Do
101
- not declare them true before those conditions are verified.
102
-
103
- ## What the report means
104
-
105
- - `agentTokenDelta`: baseline agent total minus Jev-run agent total, within the
106
- imported intervals. Positive means lower observed consumption; negative means
107
- higher. Repeated cumulative snapshots count once; earlier session usage is
108
- subtracted. Forks without a prior baseline snapshot, counter resets, incomplete
109
- turns, duplicate intervals, model/effort/revision mismatches and failed quality
110
- receipts are rejected.
111
- - Cached input is already included in input; reasoning is already included in
112
- output. They are reported as breakdowns, not added again. Missing cache-write
113
- details stay unknown. See [OpenAI usage definitions](https://developers.openai.com/api/docs/guides/agents-api/observability)
114
- and [prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching).
115
- - `pipelineTokenDelta`: agent delta minus **reported** Jev tokens. Available only
116
- with a finished ledger, no request with unknown usage, and declared full Jev
117
- coverage. Different tokenizers produce reported token units, not identical text
118
- lengths. Provider-unreported retries/failures remain outside this figure.
119
- - `moneyDeltaUsd`: unknown by default. Codex local token counters are not a bill
120
- and do not establish how ChatGPT subscription limits are calculated. Full cost
121
- for both runs must come from billing receipts, not fixed tokens-per-file or an
122
- assumed rate. Jev's reported response cost remains separately visible with
123
- coverage; it is not automatically a complete task cost.
124
-
125
- Optional billing receipts, referenced by `billingReceipt` on each run, use:
126
-
127
- ```json
128
- {
129
- "runFingerprint": "fingerprint-returned-for-this-run-by-compare",
130
- "currency": "USD",
131
- "amount": 0.0123,
132
- "coverage": "all_agent_and_jev_costs",
133
- "sourceReference": "actual-provider-billing-export"
134
- }
135
- ```
136
-
137
- The amount above is an example only. Both receipts must include all agent,
138
- subagent/reviewer, Jev and retry charges. Matching fingerprints prevent mixing
139
- receipts with different logs/ledgers. Receipts are imported and explicitly marked
140
- as not independently verified. Unknown cost is never zero; negative differences
141
- are retained. A single pair describes that experiment, not causal proof or a
142
- general savings claim. Repeat controlled pairs to evaluate consistency.
143
-
144
- ## Installation
145
-
146
- The new importer is prepared for 0.2.10. Installing 0.2.9 fixes reporting but
147
- does not add these commands. After installing the build containing this feature,
148
- restart Codex's MCP process and confirm `jev_compare_usage` is listed. Do not
149
- publish a changed artifact under the already published 0.2.9 version.
150
-
151
- `JEV_MEASUREMENT_DIR` can redirect local ledgers; otherwise they live in
152
- `~/.jev-dev/measurements`. Use a new run ID for each experiment. Collection is
153
- opt-in and errors on invalid IDs, missing begun runs or closed ledgers. Check
154
- local logs before sharing them: the original Codex rollout may contain private
155
- prompts even though comparison results contain only selected metadata/usage.
1
+ # Measured Codex task comparisons
2
+
3
+ For other clients, see the [multi-harness bridge and collectors](MULTI-HARNESS-USAGE.md).
4
+
5
+ This workflow compares observed usage, not file-count estimates. It runs locally,
6
+ does not upload rollout content and does not make new model requests. Codex
7
+ rollout JSONL is an observed local format, not a guaranteed public API. Unknown,
8
+ incomplete, reset or ambiguous counters are rejected rather than guessed.
9
+
10
+ ## Developer workflow
11
+
12
+ 1. Choose a small task with an objective validation (the same tests/checks on
13
+ both results). Start both runs from the same commit, with the same agent model,
14
+ reasoning effort, instructions and tool configuration, except the Jev change
15
+ being evaluated. Keep cache conditions comparable and document them.
16
+ 2. Run the baseline with Jev disabled. Use separate chats; reused history is a
17
+ confounder. If a task uses several turns/subagents/reviewers, include every
18
+ related interval in the manifest. The importer does not discover completeness
19
+ or prove equivalence automatically.
20
+ 3. Before the Jev run, start a unique ledger:
21
+
22
+ ```sh
23
+ jev-dev efficiency begin --run-id auth-jev-001
24
+ ```
25
+
26
+ Include `measurementRunId: "auth-jev-001"` on **every** Jev MCP call during
27
+ that run. For CLI calls, set `JEV_MEASUREMENT_RUN_ID=auth-jev-001` in that
28
+ process. All model-based harnesses use the same scoped collector. Concurrent
29
+ MCP calls with different IDs stay isolated. Cache/heuristic calls do not
30
+ create model-request records. No state, prompts, answers or keys enter the
31
+ ledger. Missing/in-progress calls are not treated as zero usage.
32
+ 4. Wait for all calls to complete, validate the task result, then close the ledger:
33
+
34
+ ```sh
35
+ jev-dev efficiency finish --run-id auth-jev-001
36
+ jev-dev efficiency list --repo . --json
37
+ ```
38
+
39
+ `list` finds local logs by repository and gives session/turn IDs, timestamps,
40
+ model, initial revision, counters and absolute rollout paths. It does not
41
+ print messages or infer a baseline. It scans at most 200 recent files; use
42
+ `--sessions-path` for a particular date or archived logs.
43
+ Internal `codex-auto-review` intervals are excluded from this list by default;
44
+ use `--include-internal` to locate them when reconciling task overhead.
45
+ 5. Create the comparison manifest and validation receipts below. Your assistant
46
+ can assemble them after you identify the two runs; you need not find JSONL
47
+ files by hand. Run:
48
+
49
+ ```sh
50
+ jev-dev efficiency compare --manifest comparison.json --json
51
+ ```
52
+
53
+ Codex can also call `jev_compare_usage` with `manifestPath`. The comparison is
54
+ recorded in local telemetry and shown as the latest paired task comparison in
55
+ the dashboard. `--no-record` prevents telemetry writes. Reimporting a pair
56
+ does not add its differences to a cumulative savings figure.
57
+
58
+ ## Manifest and receipts
59
+
60
+ Illustrative manifest; replace the paths/IDs with actual records. Relative paths
61
+ are resolved against this manifest, not the caller's working directory.
62
+
63
+ ```json
64
+ {
65
+ "schemaVersion": 1,
66
+ "taskId": "auth-validation",
67
+ "initialRevision": "exact-starting-commit-hash",
68
+ "environmentId": "same-model-tools-prompt-and-cache-conditions",
69
+ "allRelatedSessionsIncluded": true,
70
+ "baseline": {
71
+ "rollouts": [{ "path": "baseline.jsonl", "turnId": "baseline-turn-id" }],
72
+ "jevDisabled": true,
73
+ "validationReceipt": "baseline-validation.json"
74
+ },
75
+ "withJev": {
76
+ "rollouts": [{ "path": "with-jev.jsonl", "turnId": "jev-turn-id" }],
77
+ "validationReceipt": "jev-validation.json",
78
+ "measurementRunId": "auth-jev-001",
79
+ "ledgerPath": "path-to-auth-jev-001.jsonl",
80
+ "allJevCallsRecorded": true
81
+ }
82
+ }
83
+ ```
84
+
85
+ Each validation receipt is tied to its exact session/turn IDs:
86
+
87
+ ```json
88
+ {
89
+ "taskId": "auth-validation",
90
+ "criterionId": "same-test-suite-and-functional-check",
91
+ "passed": true,
92
+ "runIds": ["actual-session-id:actual-turn-id"],
93
+ "evidenceReference": "actual-test-report-artifact"
94
+ }
95
+ ```
96
+
97
+ These are explicit user/evaluator attestations. The importer verifies matching
98
+ IDs and fields, hashes the source files and checks the counters, but does not
99
+ execute the validation command or independently verify the task quality, disabled
100
+ Jev, declared environment equivalence or completeness of related sessions. Do
101
+ not declare them true before those conditions are verified.
102
+
103
+ ## What the report means
104
+
105
+ - `agentTokenDelta`: baseline agent total minus Jev-run agent total, within the
106
+ imported intervals. Positive means lower observed consumption; negative means
107
+ higher. Repeated cumulative snapshots count once; earlier session usage is
108
+ subtracted. Forks without a prior baseline snapshot, counter resets, incomplete
109
+ turns, duplicate intervals, model/effort/revision mismatches and failed quality
110
+ receipts are rejected.
111
+ - Cached input is already included in input; reasoning is already included in
112
+ output. They are reported as breakdowns, not added again. Missing cache-write
113
+ details stay unknown. See [OpenAI usage definitions](https://developers.openai.com/api/docs/guides/agents-api/observability)
114
+ and [prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching).
115
+ - `pipelineTokenDelta`: agent delta minus **reported** Jev tokens. Available only
116
+ with a finished ledger, no request with unknown usage, and declared full Jev
117
+ coverage. Different tokenizers produce reported token units, not identical text
118
+ lengths. Provider-unreported retries/failures remain outside this figure.
119
+ - `moneyDeltaUsd`: unknown by default. Codex local token counters are not a bill
120
+ and do not establish how ChatGPT subscription limits are calculated. Full cost
121
+ for both runs must come from billing receipts, not fixed tokens-per-file or an
122
+ assumed rate. Jev's reported response cost remains separately visible with
123
+ coverage; it is not automatically a complete task cost.
124
+
125
+ Optional billing receipts, referenced by `billingReceipt` on each run, use:
126
+
127
+ ```json
128
+ {
129
+ "runFingerprint": "fingerprint-returned-for-this-run-by-compare",
130
+ "currency": "USD",
131
+ "amount": 0.0123,
132
+ "coverage": "all_agent_and_jev_costs",
133
+ "sourceReference": "actual-provider-billing-export"
134
+ }
135
+ ```
136
+
137
+ The amount above is an example only. Both receipts must include all agent,
138
+ subagent/reviewer, Jev and retry charges. Matching fingerprints prevent mixing
139
+ receipts with different logs/ledgers. Receipts are imported and explicitly marked
140
+ as not independently verified. Unknown cost is never zero; negative differences
141
+ are retained. A single pair describes that experiment, not causal proof or a
142
+ general savings claim. Repeat controlled pairs to evaluate consistency.
143
+
144
+ ## Installation
145
+
146
+ The new importer is prepared for 0.2.10. Installing 0.2.9 fixes reporting but
147
+ does not add these commands. After installing the build containing this feature,
148
+ restart Codex's MCP process and confirm `jev_compare_usage` is listed. Do not
149
+ publish a changed artifact under the already published 0.2.9 version.
150
+
151
+ `JEV_MEASUREMENT_DIR` can redirect local ledgers; otherwise they live in
152
+ `~/.jev-dev/measurements`. Use a new run ID for each experiment. Collection is
153
+ opt-in and errors on invalid IDs, missing begun runs or closed ledgers. Check
154
+ local logs before sharing them: the original Codex rollout may contain private
155
+ prompts even though comparison results contain only selected metadata/usage.