@coinrithm/mcp-trading 0.7.14 → 0.7.16

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 (72) hide show
  1. package/CHANGELOG.md +811 -613
  2. package/README.md +415 -366
  3. package/dist/agent/bench/bench.d.ts +59 -0
  4. package/dist/agent/bench/bench.js +319 -0
  5. package/dist/agent/bench/cassette.d.ts +97 -0
  6. package/dist/agent/bench/cassette.js +181 -0
  7. package/dist/agent/bench/costs.d.ts +28 -0
  8. package/dist/agent/bench/costs.js +60 -0
  9. package/dist/agent/bench/labelBuilder.d.ts +123 -0
  10. package/dist/agent/bench/labelBuilder.js +282 -0
  11. package/dist/agent/bench/labels.d.ts +75 -0
  12. package/dist/agent/bench/labels.js +259 -0
  13. package/dist/agent/bench/recordingClient.d.ts +51 -0
  14. package/dist/agent/bench/recordingClient.js +193 -0
  15. package/dist/agent/bench/replayClient.d.ts +41 -0
  16. package/dist/agent/bench/replayClient.js +262 -0
  17. package/dist/agent/bench/report.d.ts +115 -0
  18. package/dist/agent/bench/report.js +435 -0
  19. package/dist/agent/cli.d.ts +25 -0
  20. package/dist/agent/cli.js +300 -2
  21. package/dist/agent/client.d.ts +14 -0
  22. package/dist/agent/client.js +113 -4
  23. package/dist/agent/configurationWarnings.js +11 -0
  24. package/dist/agent/decision.d.ts +3 -0
  25. package/dist/agent/decision.js +85 -3
  26. package/dist/agent/decisionReceipt.d.ts +5 -1
  27. package/dist/agent/decisionReceipt.js +52 -3
  28. package/dist/agent/decisionValidator.d.ts +30 -0
  29. package/dist/agent/decisionValidator.js +147 -2
  30. package/dist/agent/engine.d.ts +3 -3
  31. package/dist/agent/engine.js +3 -3
  32. package/dist/agent/futuresEligibility.d.ts +36 -0
  33. package/dist/agent/futuresEligibility.js +90 -0
  34. package/dist/agent/observe.d.ts +35 -2
  35. package/dist/agent/observe.js +969 -128
  36. package/dist/agent/pmContext.d.ts +10 -1
  37. package/dist/agent/pmContext.js +163 -1
  38. package/dist/agent/prompt.d.ts +18 -1
  39. package/dist/agent/prompt.js +229 -33
  40. package/dist/agent/promptTables.d.ts +1 -0
  41. package/dist/agent/promptTables.js +33 -0
  42. package/dist/agent/providerCapabilities.d.ts +9 -0
  43. package/dist/agent/providerCapabilities.js +57 -4
  44. package/dist/agent/providers.d.ts +28 -7
  45. package/dist/agent/providers.js +200 -50
  46. package/dist/agent/resolve.js +3 -0
  47. package/dist/agent/runner.d.ts +8 -0
  48. package/dist/agent/runner.js +159 -26
  49. package/dist/agent/setups.d.ts +2 -1
  50. package/dist/agent/setups.js +17 -16
  51. package/dist/agent/signals.d.ts +33 -0
  52. package/dist/agent/signals.js +89 -0
  53. package/dist/agent/skill.js +37 -0
  54. package/dist/agent/skillValidator.js +33 -0
  55. package/dist/agent/strictLint.js +29 -0
  56. package/dist/agent/templates.js +30 -30
  57. package/dist/agent/types.d.ts +266 -13
  58. package/dist/agent/types.js +4 -0
  59. package/dist/agent/universe.d.ts +78 -0
  60. package/dist/agent/universe.js +215 -0
  61. package/dist/client.d.ts +9 -2
  62. package/dist/client.js +22 -10
  63. package/dist/http.d.ts +1 -0
  64. package/dist/http.js +17 -2
  65. package/dist/httpCompletion.d.ts +1 -1
  66. package/dist/httpCompletion.js +1 -0
  67. package/dist/index.js +2 -1
  68. package/dist/instructions.d.ts +1 -0
  69. package/dist/instructions.js +16 -0
  70. package/dist/tools.d.ts +1 -0
  71. package/dist/tools.js +150 -66
  72. package/package.json +98 -97
package/CHANGELOG.md CHANGED
@@ -1,613 +1,811 @@
1
- # Changelog
2
-
3
- All notable changes to `@coinrithm/mcp-trading` are documented here. The package
4
- ships two binaries — `coinrithm-mcp` (the MCP server) and `coinrithm-agent` (the
5
- self-host agent runner) — versioned together. The CoinRithm **API contract** is
6
- versioned separately (see `openapi.yaml` `info.version`, currently `1.7.0`).
7
-
8
- ## 0.7.14
9
-
10
- - Scope permanent model-error streaks to the attempted provider/model. Discard
11
- legacy unattributed streaks and reset availability failures on a successful
12
- provider response, including malformed decisions. Old-route failures cannot
13
- request an early hold on a replacement model; agent risk limits are unchanged.
14
- - Attribute a routed permanent-error hold to the attempt that produced the error,
15
- even when a later fallback is rate-limited; keep actual-call metering unchanged.
16
- - Preflight futures protection updates against observed side, mark and liquidation
17
- prices, including retained triggers. Reject known invalid end-states with an
18
- actionable reason before a write; the API remains authoritative as prices move.
19
- - Add the optional `risk.pmMinEntryProbabilityPct` policy (0..100 points): the
20
- runner rejects `pm_open` when the chosen outcome's raw market probability at
21
- entry is below the floor, with a reason that names both numbers. Fees stay
22
- in the forecast-edge check, so a 19-point outcome fails a 20-point floor even
23
- when fees lift its cost above 20. Absent keeps today's behaviour; a set floor
24
- with no quoted probability fails closed. The floor is rendered in the prompt's
25
- hard caps.
26
- - Retain candle timestamps and compact coverage/interval evidence alongside
27
- indicators, separately from market-price freshness. Missing timestamps stay
28
- unknown; nominal five-minute cadence does not imply current or regular bars.
29
- Model input and private decision evidence retain the same context.
30
- - Load optional `character/entries.md`, `exits.md`, `sizing.md` and `research.md`
31
- from local bundles so Studio strategy sections reach the model, manifest and
32
- compiled definition. Existing bundles without these files are unchanged.
33
- - Include the exact compiled strategy definition and its digest in local
34
- inspection; expose the same snapshot builder to engine consumers.
35
- - Add `run --expect-definition` to reject a changed baseline before model or
36
- account access. The digest is not a full replay record or broker adapter.
37
- - Hosted validation accepts `limits.maxDailyLossMusd: 0` as no daily loss cap,
38
- matching the runner and the hosted API; negative and non-finite values are
39
- still rejected.
40
- - Tactic cap merges treat 0 as unlimited for `maxTradesPerDay` and
41
- `maxDailyLossMusd`: a tactic may tighten 0 to a positive cap but can no
42
- longer turn a positive cap into 0. Writes and margins keep lower-is-tighter.
43
-
44
- Publication and hosted deployment are verified separately. See the repository's
45
- [release status](https://github.com/CoinRithm/coinrithm-agent-trading#version-clarity)
46
- for registry availability and the hosted runtime evidence.
47
-
48
- ## 0.7.13
49
-
50
- - Preserve optional per-outcome venue terms in compact prediction-market output,
51
- including explicit unavailable values and valid false/zero facts.
52
- - Include candle volume coverage in agent fundamentals: positive counts identify
53
- missing expected venues; unknown coverage stays unknown. Preserve measured zero
54
- volume and keep each volume paired with its own coverage.
55
- - Classify provider capacity failures consistently, including HTTP 503
56
- resource exhaustion, in runner results and configured same-model retries.
57
- - Export `classifyProviderFailure` from the supported engine entry point.
58
- Retry counts and trading behavior are unchanged.
59
- - Surface signed cumulative futures funding and its applied-through timestamp to
60
- the agent observation so funding already reflected in balances is not counted twice.
61
- - Add public whale-wallet context to the 40-tool surface: bounded 7-day or
62
- 30-day wallet activity and source/wallet movement detail, with provenance and
63
- provider-reported context kept distinct from CoinRithm's observed trade flow.
64
- - Clarify `pm_data_calibration` as market-price calibration: the primary lane
65
- uses one complete-book snapshot in the inclusive 20–28 hour pre-resolution
66
- window, with event-weighted ECE and separate `finalPrice`/`ownCapture` lanes.
67
-
68
- Publication and hosted deployment are verified separately. See the repository's
69
- [release status](https://github.com/CoinRithm/coinrithm-agent-trading#version-clarity)
70
- for registry availability and the hosted runtime evidence.
71
-
72
- ## 0.7.12 — 2026-09-15
73
-
74
- Clarify `whoami`, `cancel_spot_order` and `report_pm_opportunity` descriptions,
75
- removing execution-cost prose unrelated to these operations. Document actual
76
- authentication, side effects, result fields and retry behavior.
77
-
78
- Spot cancellation now advertises its existing idempotent behavior. Opportunity
79
- reporting no longer advertises unconditional idempotency: duplicate protection
80
- requires `decisionId` (or `agentTrace.decisionId`) under the same API key; the
81
- first stored record wins. Reporting remains a write despite requiring only the
82
- `read` scope, and its evidence remains explicitly self-reported.
83
-
84
- Tool names, accepted inputs and execution behavior are unchanged. Published on
85
- npm and deployed to hosted MCP on 2026-09-15; registry and GitHub downloads match
86
- the CI archive. A clean registry installation passed startup and tool metadata
87
- checks. See the [release record](https://github.com/CoinRithm/coinrithm-agent-trading/releases/tag/mcp-trading-v0.7.12).
88
- Glama's evaluation score is separate from package delivery.
89
-
90
- ## 0.7.11 — 2026-09-15
91
-
92
- Fix opportunity reporting that previously treated resolved API failures as
93
- successful submissions. Only `ok: true` confirms a report. HTTP errors remain
94
- unconfirmed; transport failures and exceptions have an unknown delivery outcome.
95
-
96
- `CycleResult.opportunity` now contains confirmed reports only. The additive
97
- `opportunityReport` field preserves the attempted payload, outcome and status,
98
- without API error bodies or exception details. Existing consumers should use
99
- this field when they need attempted rather than confirmed evidence.
100
-
101
- The reporter retains its one-invocation-per-cycle latch and adds no retries.
102
- Focused regressions compare successful and failed reporting in skip/act cycles
103
- and verify unchanged trading results and runner state. SDK versions are unchanged.
104
- This source entry does not establish registry publication or hosted deployment.
105
-
106
- ## 0.7.10 — 2026-09-15
107
-
108
- Source changes following the published 0.7.9 release. The TypeScript SDK remains
109
- 0.3.1 and Python remains 1.8.1; their runtime source is unchanged.
110
-
111
- - Persist file-backed run identity before execution so a first-cycle process
112
- crash cannot discard the idempotency identity. Transport uncertainty is still
113
- not automatically replayed or recorded as a completed trade.
114
- - Fix runner startup on Node 18: use the imported Node crypto API instead of
115
- depending on a global crypto object. The installed-package matrix reproduced
116
- this failure on Linux, Windows and macOS.
117
- - Add the supported `@coinrithm/mcp-trading/engine` entry point, preserving
118
- existing deep imports, and separate observation accounting and opportunity
119
- reporting from cycle ordering.
120
- - Add opt-in, machine-checked crypto return predicates and visible warnings for
121
- inactive/reserved configuration. Existing agents are not automatically opted in.
122
- - Serialize scheduler migrations in a bounded transaction; add an offline
123
- credential-rotation helper and interruption/recovery rehearsal.
124
- - Pin workflow actions and verify release-tool checksums. Add installed-package
125
- compatibility and restart smoke checks across operating systems and runtimes.
126
-
127
- 0.7.10 was published and deployed on 2026-09-15. Registry and GitHub downloads
128
- matched the CI-tested archive; hosted MCP and scheduler deployments finished.
129
- See the [release record](https://github.com/CoinRithm/coinrithm-agent-trading/releases/tag/mcp-trading-v0.7.10).
130
-
131
- ## 0.7.9 - 2026-09-15
132
-
133
- Published on npm and verified on 2026-09-15: the registry archive matches the
134
- reviewed artifact and passes fresh-install checks. See the
135
- [combined release notes](https://github.com/CoinRithm/coinrithm-agent-trading/releases/tag/mcp-trading-v0.7.9)
136
- for source provenance, verification and community acknowledgments.
137
-
138
- Public market-data fidelity and runner reliability release. No MCP tool was
139
- renamed or removed, and the API **contract stays 1.7.0**.
140
-
141
- **PM evaluation budget.** Event-driven periodic prediction-market evaluations
142
- now respect `maxLlmCallsPerHour` after their cooldown elapses. Budget skips make
143
- no provider call and consume no call allowance. PM keeps its own cooldown;
144
- open-position management and explicit always-on behavior retain their existing
145
- exemptions. This runner gate is separate from hosted provider-capacity admission.
146
-
147
- **Retry-After parsing.** Missing, blank or malformed headers no longer become
148
- zero-delay retries. The runner API client uses its existing five-second fallback;
149
- explicit zero, numeric seconds and HTTP dates remain supported. Model-provider
150
- cooldowns share the parser and retain their existing one-hour cap.
151
-
152
- **API request deadlines.** Each runner API operation now has a 30-second total
153
- deadline covering response headers, body reads and all 429 retry waits. The
154
- same client serves the hosted scheduler. Embedded callers can set a finite
155
- `requestTimeoutMs` and supply an `AbortSignal`. A timeout or cancellation returns
156
- an uncertain transport result without automatically replaying a trading write.
157
- Timers and listeners are removed when the operation finishes.
158
-
159
- **State persistence.** Self-host state is serialized to a private temporary file
160
- and atomically renamed over the previous state. A failed serialization or rename
161
- leaves the prior state intact. This is atomic replacement, not a claim of durable
162
- storage across power loss.
163
-
164
- **Agent conversion.** `coinrithm-agent eject` preserves explicit `triggerPolicy`
165
- and `capitalSizing` blocks. Previously conversion could restore default hourly
166
- budgets and drop equity sizing.
167
-
168
- **Release verification.** All-source coverage gates, mandatory PostgreSQL CI,
169
- dependency updates and corrected client setup docs are included. See the
170
- [reliability record](https://github.com/CoinRithm/coinrithm-agent-trading/blob/main/docs/RELIABILITY.md).
171
-
172
- **Confirmed-action journal.** Completed-action memory now requires an action
173
- to be both accepted and executed. Failed writes and uncertain transport results
174
- retain their attempt evidence without becoming completed moves in the next
175
- decision prompt. Dry-run proposals remain unexecuted.
176
-
177
- **Direct NVIDIA retry.** One complete HTTP 500/502/503/504 response can be
178
- retried once on the identical direct NVIDIA route within the original deadline.
179
- Both attempts are retained. This does not retry trading writes or change the
180
- hosted shared-pool routing policy.
181
-
182
- **Capital reconciliation.** Frozen-balance rounding residue down to -1e-8 is
183
- normalized only in the sizing calculation after the independent reads agree.
184
- Negative spendable cash still fails closed; wallet balances are not changed.
185
-
186
- **Private decision input evidence.** The bounded numeric projection includes
187
- nested indicator inputs and context movers, with legacy v1 records still readable.
188
- It does not retain hidden reasoning or raw model output.
189
-
190
- **Compact prediction-market evidence.** Discovery and compact event-detail
191
- responses now retain the API's `source.quoteScale`, `source.methodology` and
192
- `source.supportsMarketMetrics`, plus `spreadPoints`, `probabilityBook` and
193
- each retained outcome's `normalizedProbability`. Venue-native bid/ask quotes
194
- are never rescaled or interpreted from magnitude. Normalization remains the
195
- API's calculation over the original full book, not the truncated top-five
196
- outcome list. Existing payload bounds and explicit `detail: full` behavior
197
- are unchanged.
198
-
199
- **Settlement-time provenance.** Compact events retain `resolvedAtBasis` and
200
- `settlementWindowClosedAt`, keeping provider expiration distinct from an
201
- announced settlement time. Null and absent upstream evidence stay null and
202
- absent; the MCP does not infer missing values.
203
-
204
- **Candle semantics.** The `get_candles` description now states that these are
205
- sampled composite-price bars. Each bar's `v` is a mean rolling 24-hour
206
- quote-volume observation in USD, not volume traded during the candle, and
207
- must not be summed across bars.
208
-
209
- **HTTP completion diagnostics.** The hosted HTTP
210
- entry now has a bounded, stderr-only completion observer with final SDK-result
211
- and finish/abort accounting. Initialization, discovery, tool failures and
212
- successful delivery are distinct; unknown tool names are normalized. Records
213
- contain no arguments, bodies, credentials, caller/RPC IDs or caller-origin labels.
214
- Credential presence is not authentication. Durations describe the HTTP request,
215
- shared by batch members; server finish does not prove client receipt or use.
216
- Stdio, tools, authentication and dependency versions are unchanged. See
217
- `DEPLOY.md` for the measurement and retention limits. Hosted source/image
218
- `18a0bb6a8a0665e91cebc10225fec6f7ebcdaaf7` passed a bounded anonymous smoke on
219
- 2026-09-13. Hosted verification and npm publication are separate release steps.
220
-
221
- **Deployment boundaries.** Hosted scheduler admission reasons are private
222
- scheduler telemetry, not a new SDK or MCP response field. The API's corrected
223
- comparison probabilities and enriched spread names use the existing response
224
- shape and reach current clients through fresh API reads. Outcome display names
225
- may change; use source/event/outcome identifiers for identity, never summed
226
- prices or matching labels alone. These fixes do not establish trading returns.
227
-
228
- ## 0.7.8
229
-
230
- Runner decision-quality, evidence and paper-capital release. Additive: no MCP
231
- tool was renamed or removed, and the API **contract stays 1.7.0**. This release
232
- contains all package changes since published 0.7.7 (`gitHead` `80d0cae`), not
233
- just the previously listed thesis work.
234
-
235
- **Thesis exits.** Every opening action (`futures_open`, `spot_order`,
236
- `pm_open`) now carries a `thesis`: a one-sentence summary plus an
237
- `invalidation` with at least one machine-checkable condition (`priceBelow` /
238
- `priceAbove` for coins, `probabilityBelow` / `probabilityAbove` for prediction
239
- markets, a `maxHoldMinutes` time stop, and a free-text `catalyst` the model
240
- re-judges itself). The runner binds the thesis to the position the server
241
- returns, sanitized side-aware (a rising price never invalidates a long; a
242
- wrong-side level is dropped rather than re-signed; the time stop is clamped to
243
- 60 minutes .. 30 days), persists it in the run state (`RunState.theses`, the
244
- same state file / `agent_state` JSON as before, no schema change) and
245
- re-evaluates it every cycle. A futures position whose price level or time stop
246
- is breached is closed by the runner before the model is asked anything, logged
247
- as a `thesis_invalidated` exit with its own idempotency key, after the
248
- kill-switch and drawdown checks and never instead of them. Prediction-market
249
- positions have no close endpoint, so a broken PM thesis is surfaced to the
250
- model instead (do not add, let it settle). The parser is tolerant (a malformed
251
- thesis never fails the open; a thesis copied onto a close is ignored) and the
252
- structured-output schema requires it, so schema-enforced hosted models always
253
- emit one.
254
-
255
- **Fundamentals in the observation.** Each watch entry now carries
256
- `fundamentals` sourced only from calls the runner already makes: `categories`,
257
- `marketCapRank` and `marketCapUsd` from the market context; `volume24hUsd` from
258
- the candles the `indicators` capability already fetches (live-probed
259
- 2026-09-02: each bar's `v` is a rolling 24h volume, so the latest bar is the
260
- 24h figure, never the sum); and up to three `headlines` with `publishedAt`
261
- timestamps from the one `news` call, attributed through the curated coin-news
262
- graph. Discovered PM markets carry `endDate` and `liquidityUsd`; open PM
263
- positions carry their title, side, entry and current probability and
264
- `openedAt`; open futures positions carry `openedAt`. The system prompt states
265
- the thesis contract, the runner-enforced exit and how to grade a trade on the
266
- fundamentals. Not carried, because no agent endpoint serves them: an "about"
267
- text per coin, a 24h probability change and a cross-venue divergence per PM
268
- market.
269
-
270
- **Fix:** the public movers feed serializes `change24h` / `currentPrice` as
271
- decimal strings; the universe-scan context rows read them strictly as numbers
272
- and shipped `undefined` for every mover.
273
-
274
- **Opt-in equity-based paper sizing.** A runner can size entries from a
275
- conservative fraction of its independently attributed paper book instead of a
276
- fixed stake/margin. The book is accepted only when wallet identity, cash
277
- partitions, held-position attribution and spot-mark coverage reconcile. Quotes
278
- then enforce per-entry, per-symbol, deployed-capital and daily-entry limits;
279
- fee buffers and the API's fee-inclusive quote evidence are included. Any
280
- missing or inconsistent evidence fails closed. Legacy positions on a different
281
- book remain visible for management but never inflate the current book's buying
282
- power.
283
-
284
- **Prediction-market decisions use executable economics.** PM opens now reject
285
- an invalid raw probability and a model forecast that does not clear the quoted
286
- entry price. Forecast edge is measured against the actual fee/slippage-adjusted
287
- fill, not the headline market probability. Quote-expiry outcomes are recorded
288
- separately from risk/balance rejection, and futures risk/reward validation uses
289
- fee-inclusive entry and stop economics.
290
-
291
- **Decision evidence is structured and bounded.** Cycles can expose a sanitized,
292
- partial private decision-input record: configuration and observation
293
- fingerprints, daily budget and guard state, plus bounded observation rows with
294
- explicit omission counts. It is not a prompt, transcript, raw model output or
295
- hidden reasoning record. The runner also reports quote/validation evidence for
296
- abstained, forecast-only and quote-expired PM opportunities. Hosted persistence
297
- and retention remain the caller's responsibility.
298
-
299
- **Runtime controls are more faithful.** The model sees the remaining daily
300
- entry/add budget rather than only static maxima. Entry caps still block new
301
- risk, while closes and other risk-reducing actions remain available. Direct
302
- provider HTTP 429 responses are capacity skips rather than model failures, so
303
- BYO agents do not build a failure streak during ordinary quota pressure.
304
- Structured-tool decisions remain required where the provider supports that
305
- contract.
306
-
307
- **Scorecard fix.** Maximum drawdown now measures decline from starting equity,
308
- so an immediate loss is no longer hidden by treating the first post-trade point
309
- as the high-water mark.
310
-
311
- ## 0.7.7
312
-
313
- Reliability release. Every change here came from a live production failure, not
314
- from a roadmap. Additive: no tool renamed or removed, and the API **contract
315
- stays 1.7.0** because nothing on the documented surface changed.
316
-
317
- **Model requests are now built from a declared capability table, not
318
- assumptions.** `providerCapabilities.ts` states, per model family, which
319
- parameter carries the completion budget, whether a non-default temperature is
320
- allowed, and what extra body fields the family needs. Two failures this fixes:
321
-
322
- - **OpenAI's current models rejected our requests outright.** `gpt-5*` and
323
- `o*` refuse `max_tokens` and any non-default `temperature`; they take
324
- `max_completion_tokens`. The family is detected by MODEL id, not just the
325
- provider name, so an OpenAI-compatible gateway serving `gpt-5` gets the same
326
- shape. If you brought your own OpenAI key, this is why it now works.
327
- - **NVIDIA Nemotron models emitted a think-chain where the JSON decision
328
- belonged**, which failed every cycle. The `chat_template_kwargs.enable_thinking=false`
329
- switch and the "detailed thinking off" system hint are now encoded as data
330
- rather than re-learned by failing.
331
-
332
- **New: `probeDecisionContract()`.** An HTTP 200 is not proof a route can run an
333
- agent. Both production failure modes returned 200s: a think-chain in the JSON
334
- slot, and an empty completion because a reasoning model spent its whole budget
335
- before answering. The probe sends a canned mini-observation through the REAL
336
- decision parser at a >=1024 completion allowance and classifies the result as
337
- `http`, `empty` or `parse`. Use it before adopting any model id; provider
338
- catalogs list ids that 404 on invoke.
339
-
340
- **Provider trouble no longer disables an agent.** A permanent-looking model
341
- error (404/410/decommissioned) used to disable the agent after a threshold. On
342
- 2026-08-26 NVIDIA end-of-lifed an entire model line and 35 agents died on that
343
- path. The runner now reports a hold and keeps retrying each cadence, recovering
344
- by itself when the provider does. Disables remain for what deserves them:
345
- revoked credentials, drawdown, kill-switch, user action.
346
-
347
- **Failures carry structured metadata.** A failed `decide()` now returns
348
- `status` and, when the provider sends one, `retryAfterMs` (parsed from
349
- `Retry-After` in both delta-seconds and HTTP-date form, capped at an hour), so
350
- a caller can tell a 429 from a 5xx without parsing strings. Error text is
351
- unchanged.
352
-
353
- **`ClientConfig.extraHeaders`.** Headers attached to every request, spread
354
- before auth so they can never clobber it. Self-host has nothing to put here;
355
- it exists so CoinRithm's own hosted scheduler can present its attestation
356
- channel.
357
-
358
- **Model names corrected throughout.** The retired Llama 3.x line is gone from
359
- the README, the runtime defaults and the `quant-reference` example, which is
360
- relocked onto `nvidia/nemotron-3-nano-30b-a3b`.
361
-
362
- ## 0.7.6
363
-
364
- Agent capability release: universe discovery, first-class behavioral guards,
365
- and the hosted prose budget made visible. Additive — no tool renamed or
366
- removed. Contract moves to **1.7.0** (two keyless paths declared).
367
-
368
- **New: agents can look beyond their own watchlist.**
369
-
370
- - **`get_crypto_movers` tool.** Keyless scan of the tracked coin universe for
371
- the biggest 24h gainers or losers. Rows carry `coinId`, `symbol`, `name`,
372
- `slug`, `change24hPct`, `priceUsd`.
373
- - **`universe_scan` capability** for the self-host runner. Each cycle it pulls
374
- the top movers, promotes the strongest few into full watch entries marked
375
- `discovered: true`, and passes the remainder as compact context. Watchlist
376
- and blocklist symbols are excluded up front, so a discovered row can never
377
- duplicate a configured pair or bypass the deny list.
378
- - **Both now carry the coinId through.** The movers row's `ucid` IS the
379
- `coinId` that `get_candles` / `get_market_context` / the futures quote path
380
- take. It was previously stripped from the tool response and re-derived from
381
- the SYMBOL via a resolve round-trip — a wasted call per discovered mover and
382
- a real correctness hazard, because symbols collide across listings and the
383
- resolver could return a different coin than the one that actually moved.
384
-
385
- **New: contract declares the endpoints the tools call.**
386
-
387
- - `/api/coins/top-gainers` and `/api/coins/top-losers` are now in
388
- `openapi.yaml` (tag `public-crypto-data`), so both SDKs can reach the
389
- surface `get_crypto_movers` uses. Probe-verified against prod: bare array,
390
- no envelope; `change24h` / `currentPrice` are decimal STRINGS; default
391
- `limit` is 3 and out-of-range values return 400 rather than clamping.
392
-
393
- **New: personality and boundaries are configurable, and documented.**
394
-
395
- - **`character/guards.md`** — first-class hard behavioral guards, merged into
396
- the strategy prose as a distinct section rather than buried in the thesis.
397
- - **`examples/agents/pia-pump-fader`** — a full bundle demonstrating
398
- capabilities plus boundary configuration (watchlist/blocklist interaction,
399
- the five-point risk gate, re-entry discipline).
400
- - **`examples/agents/FORKING.md`** — a file-by-file map of what is strategy
401
- and what is plumbing, so a fork knows what it is allowed to change.
402
- - **QUICKSTART** documents capabilities, and a docs-drift tripwire fails the
403
- suite when a capability ships undocumented (`universe_scan` shipped
404
- invisible in every user surface once; that cannot recur silently).
405
-
406
- **Fixed.**
407
-
408
- - **Hosted prose budget is validated, not discovered at deploy.**
409
- `coinrithm-agent validate --hosted` now checks the 8,000-character merged
410
- prose budget and reports the exact overage. A bundle could previously
411
- validate clean and still be undeployable. YAML frontmatter is stripped
412
- before the count (and before the model sees it — it was being fed in as if
413
- it were strategy). `pia-pump-fader` was rebuilt to fit at 7,932.
414
- - **Permanent failures stop being revived.** A disabled agent whose model is
415
- gone or whose key is invalid is no longer resurrected by the scheduler's
416
- revive pass; only transient failures are retried.
417
- - **Fresh scaffolds are no longer bricked** by the capabilities field, and
418
- action-confidence tolerance was widened to match what models actually emit.
419
- - **False market-data licensing assertion corrected** in both READMEs.
420
-
421
- ⚠ Publishing to npm remains a **manual** step — `publish-mcp.yml` pushes
422
- `server.json` to the MCP registry only.
423
-
424
- ## 0.7.5
425
-
426
- **Release-hygiene bump. Everything below was already merged but never
427
- reached npm** — the 0.7.4 tarball was published 2026-07-26T23:01:11Z and
428
- five commits landed after that instant without a version bump, so the
429
- repository's 0.7.4 and the published 0.7.4 were different code under one
430
- version number. This release makes the published artifact match the
431
- source again.
432
-
433
- - **Security.** MCP dependency audit fixes, 6 findings to 0 (`da65e9e`).
434
- Anyone on published 0.7.4 is running the pre-audit dependency set.
435
- - **`pm_data` Gemini exposure** for agents (`3ab04ae`).
436
- - **Venue methodology and health** exposed as tools (`74cc495`).
437
- - **Reproducible decision receipts** persisted by the agent runner
438
- (`8bebc9e`).
439
- - **Docs.** Contract version drift corrected and the placeholder SDK
440
- README replaced, so the docs stop advertising an install that 404s
441
- (`6d61b92`).
442
-
443
- No tool was renamed or removed; this is additive plus a dependency
444
- refresh.
445
-
446
- ⚠ Publishing this package is a **manual** step — `publish-mcp.yml` only
447
- pushes `server.json` to the MCP registry, it does not run `npm publish`.
448
- That asymmetry is exactly how the drift above accumulated unnoticed.
449
-
450
- ## 0.7.4
451
-
452
- Docs-only. No tool behavior change, no API-surface change.
453
-
454
- - **Acceptable Use of Market Data.** The README (root and this package) and
455
- `openapi.yaml` (`info.termsOfService`, `info.description`, and the
456
- `public-pm-data` tag) now reference and summarize CoinRithm's licensing
457
- flow-down restriction on Market Data from third-party prediction-market
458
- venues: read-only use for paper-trading context and settled-outcome
459
- scoring only — no model training/fine-tuning/benchmarking, no
460
- redistribution or bulk-extraction, no use to build a competing product.
461
- Full terms: <https://www.coinrithm.com/en/terms-of-use>
462
-
463
- ## 0.7.3
464
-
465
- Quality-engine surfaces + independent forecasts. Additive; no breaking change.
466
-
467
- - **Quality verdicts in tool responses.** `discover_pm_markets`, `pm_quote`, and
468
- the `pm_data_*` tools now surface the persisted truth-engine `quality` object
469
- (`decisionEligible`, warning/block reason codes, `policyVersion`, `assessedAt`).
470
- Markets with critical failures stay visible but cannot drive paper opens or
471
- alerts.
472
- - **`openBlocked` preview on `pm_quote`.** Quotes preview the open-time quality
473
- gate (`openBlocked` + `openBlockReasons`), so an agent can skip a market that
474
- would 422 before burning the open attempt. The self-host runner
475
- (`coinrithm-agent`) does this skip automatically.
476
- - **Independent forecasts in the runner.** The self-host agent runner elicits the
477
- model's OWN probability (judged from the question/resolution criteria/deadline,
478
- never anchored to the market price) and submits it as `forecastProbability` on
479
- PM opens — feeding the public calibration dataset with proper-scoring-rule
480
- forecasts. Clamped to [1,99]; omitted (never faked) when the model does not
481
- produce one; `HOUSE_AGENT_FORECAST_ENABLED=false` disables.
482
- - **`crossPlatform` on event lists** documented in the API contract: sibling
483
- venues pricing the same question, on list rows.
484
- - **ForecastEx venue truth.** Public MCP discovery copy and registry metadata
485
- now describe all 11 live venues, including ForecastEx.
486
- - **Contract synchronization.** Runner templates and example bundles pin the
487
- served OpenAPI 1.6.0 contract; canonical scorecard paths are unambiguous.
488
-
489
- ## 0.7.2
490
-
491
- Docs-truth + privacy release. No tool behavior change, no API-surface change.
492
-
493
- - **Ten venues in the public listing.** `pm_data_*` tool copy, the README, and
494
- `server.json` now name all ten venues (adds Futuur and Myriad). npm `0.7.1` was
495
- published before those landed, so the registry listing still advertised "eight
496
- venues"; npm versions are immutable, so correcting the public listing required
497
- a new release.
498
- - **`source` parameter description** on `pm_data_events` / `pm_data_event_detail`
499
- now enumerates all ten venue slugs. Accepted values are unchanged — this is
500
- description text only, which is why it is a patch and not a minor.
501
- - **Privacy.** Raw model output is no longer persisted, enforcing the package's
502
- no-chain-of-thought promise.
503
- - **New tripwire.** `server.json` (the MCP-registry listing) is now guarded
504
- against version and venue-count drift; it had no guard, which is how it went
505
- stale in the first place.
506
- - Refreshed stale Arena-gate example copy.
507
-
508
- ## 0.7.1
509
-
510
- Docs + registry-metadata release; no tool behavior changes.
511
-
512
- - **README refresh**: the keyless `pm_data_*` data surface is now front and
513
- center — 8 venues (Polymarket, Kalshi, Smarkets, Limitless, Manifold,
514
- Metaculus, PredictIt, Rothera — the "seven venues" line predated Rothera),
515
- the anonymous hosted-endpoint path, and the `referenceProbability` /
516
- `volumeHistory` fields the data tools return.
517
- - **`server.json`**: hosted endpoint's `Authorization` header marked optional
518
- (the `pm_data_*` tools work anonymously — verified live) and the server
519
- description now leads with the keyless data surface.
520
- - Ships the post-0.7.0 commits: `pm_data_event` advertises `volumeHistory`,
521
- `pm_data_events` advertises `referenceProbability` on list items, and the
522
- hosted MCP root (`GET /`) serves a self-describing JSON landing (with a
523
- 405 + hint on `GET /mcp`).
524
-
525
- ## 0.7.0
526
-
527
- (Retroactive entry — released 2026-07-05 without a changelog note.)
528
-
529
- - **Four keyless `pm_data_*` tools** — CoinRithm's free public cross-venue
530
- prediction-market dataset over MCP, no API key required and yours is never
531
- attached: `pm_data_overview` (market-wide stats), `pm_data_events`
532
- (cross-venue event list), `pm_data_event` (detail incl.
533
- `crossSourceMatches` + resolution evidence), `pm_data_whales`
534
- (large-trade tape).
535
-
536
- ## 0.5.0
537
-
538
- Agent-runner quality + reliability release. `coinrithm-agent` got materially
539
- smarter and less noisy; `coinrithm-mcp` is unchanged in shape. Bundles the work
540
- since 0.4.0.
541
-
542
- - **Prediction markets are a first-class venue** in the decide prompt: a short
543
- `pmN` ref so small models trade PM reliably, eligible-outcome filtering (only
544
- backend-openable outcomes reach the model), and futures-capped agents steered
545
- to PM (a separate budget) instead of re-rejecting.
546
- - **PM anti-churn — now actually effective.** The candidate list is pre-filtered
547
- to exclude markets the agent already holds, and the runner + server both block
548
- re-betting a held market+outcome (no more one-agent, 25-identical-bets churn).
549
- An earlier version read the wrong `/positions/pm` fields and was silently dead;
550
- fixed.
551
- - **Settlement-feedback learning loop.** The agent sees how its own recent bets
552
- actually resolved (win/loss/void + realized PnL) as reflective context, so it
553
- learns from outcomes across cycles.
554
- - **Per-trade reasoning stays honest about the market.** A multi-action decision
555
- no longer stamps its primary rationale onto a secondary trade about a different
556
- market — the trade's public Arena "why" always matches the market it's on.
557
- - **Futures reliability.** The model is unblinded to per-position mark /
558
- liquidation / stop / take-profit prices; take-profit is auto-clamped to a valid
559
- R:R target off the stop (kills the `take_profit_not_*_mark` reject waves); and a
560
- marking-down PM book now trips the equity-drawdown kill-switch too.
561
- - **News capability.** Recent high-importance news for the watchlist coins is fed
562
- into the decide context as a market-catalyst layer.
563
- - **Robustness + contract accuracy.** Scheduler/runner hardening, flat-state
564
- prompt steers (weak models stop hallucinating closes), manage-enum
565
- normalization, and the PM contract now documents real entry friction rather
566
- than a disclose-only stance.
567
- - **Security.** `hono` bumped to 4.12.27 (high-severity advisories: serve-static
568
- path traversal, CORS wildcard-with-credentials, body-limit bypass).
569
- - **Docs.** The npm README leads with value / free / OKF / Studio; stale
570
- scheduler and `minDecidedTrades` claims corrected.
571
-
572
- ## 0.4.0
573
-
574
- - **Deterministic scorecard engine (`computeScorecard`).** The reproducible-
575
- evaluation engine for `coinrithm.agent.scorecard.v1` — pure math over an
576
- agent's realized track record (no network, no model): realized PnL, win rate,
577
- expectancy, profit factor, reward-to-risk, Sharpe, Sortino, deflated /
578
- probabilistic Sharpe (Bailey & López de Prado — skill vs luck with a multiple-
579
- testing penalty), max drawdown, and Brier + ECE calibration for probabilistic
580
- calls. Same inputs → identical metrics **and** a sha256 `contentHash` of the
581
- canonicalized result, so a scorecard whose hash doesn't reproduce isn't
582
- trusted. Metrics are computed AFTER the run from immutable evidence (leakage-
583
- separation), so tuning-to-the-metric is structurally impossible. Returns
584
- `null` for thin records — never a fabricated number.
585
- - **Resolver: committable file metadata + functionality pin.** The OKF resolver
586
- now carries per-file metadata and pins functionality through resolution, so a
587
- bundle's behavior is reproducible from its committed files.
588
-
589
- ## 0.3.0
590
-
591
- - **Agent risk config: coin deny-list (`blocklist`).** `risk.blocklist` lets an
592
- agent name symbols it must never open, even if they are on the watchlist —
593
- deny wins over allow. Enforced in the runner's decision validator (rejects
594
- `futures_open` / `spot_order` on a denied symbol) and surfaced in the system
595
- prompt, so the model is told the boundary and the runner re-checks it.
596
- - **Docs: Open Knowledge Format positioning.** Clarified that a CoinRithm agent
597
- is an OKF bundle — a portable directory of markdown + frontmatter that is
598
- model-agnostic (run the same definition on any model). Develop and prove it
599
- free on paper, then run it anywhere.
600
- - npm keywords refreshed (`open-knowledge-format`, `okf`, `model-agnostic`,
601
- `gemini`) for registry discovery.
602
-
603
- ## 0.2.0
604
-
605
- - Added the **`coinrithm-agent`** self-host runner binary alongside the MCP
606
- server: a folder-as-architecture (OKF) agent you bring your own model key to,
607
- with caps enforced by the runner (not the model), dry-run by default,
608
- paper-only.
609
-
610
- ## 0.1.x
611
-
612
- - Initial `coinrithm-mcp` MCP server: reads, quotes, scoped spot/futures/PM
613
- writes, ledger export, and Agent Arena integration over a user-minted API key.
1
+ # Changelog
2
+
3
+ All notable changes to `@coinrithm/mcp-trading` are documented here. The package
4
+ ships two binaries — `coinrithm-mcp` (the MCP server) and `coinrithm-agent` (the
5
+ self-host agent runner) — versioned together. The CoinRithm **API contract** is
6
+ versioned separately (see `openapi.yaml` `info.version`, currently `1.7.0`).
7
+
8
+ ## 0.7.16 (unpublished)
9
+
10
+ - Preserve independently timed funding-by-venue context in watchlist and
11
+ discovered entries, including regular and compact prompts. Keep raw rates,
12
+ interval normalization and unknown source/next-funding times distinct from
13
+ settlement funding.
14
+ - Bench reports retain up to two safe route attempts with response source,
15
+ failure class, actions-string diagnostic and admission categories. Legacy
16
+ missing evidence remains unknown; error text, latency, prompts and raw model
17
+ output are excluded. Record explicit truncation for nonstandard providers.
18
+ - Carry open interest, positioning, sampled liquidations, macro proxies,
19
+ chain TVL, stablecoin supply and sampled order-book depth through the runner
20
+ with their separate freshness, coverage and provenance limits.
21
+ - Keep news source URLs/categories and every related PM coin in context; add
22
+ the opt-in per-coin-horizon PM cap. Objective guidance stays within the
23
+ authored strategy and hard caps. Use the supported MCP SDK 1.31 dependency.
24
+
25
+ - Bench: the PM baselines now preserve the recorded agent's PM board policy
26
+ (for house agents: depth 30, churn removed), the original opportunity set.
27
+ Before, they asked for the uncurated 12-row page a live mechanical agent
28
+ reads, and a cassette recorded without it (house Mia) reported the market
29
+ as missing. Originally mechanical recordings keep their uncurated board;
30
+ live mechanical agents are unchanged. New recordings need only the original
31
+ pass and mark PM baseline readiness after successful PM reads, rather than
32
+ assuming that an enabled PM venue guarantees recorded evidence.
33
+ - Bench: two more PM baselines, `baseline:base-rate` (uninformative 50%) and
34
+ `baseline:random` (seeded 20-80%), next to `baseline:skip` and
35
+ `baseline:market`. They replay the same recorded market pass, so existing
36
+ corpora need no re-recording; futures/spot-only corpora still get skip only.
37
+ - Add `coinrithm-agent label --corpus <dir> [--horizon-hours 24] [--overwrite]`:
38
+ writes `labels/<cassetteId>.json` price bars from candles published after
39
+ each cassette's asOf (reads only). It waits for the horizon to elapse, uses
40
+ the finest bar size the cassette's age still allows, keeps existing PM and
41
+ funding labels, and writes PM settlement only from the public event
42
+ verdict (settlement-eligible + "settle" + a provider won/lost outcome
43
+ result; anything else stays unlabelled). Only
44
+ bars that close by the horizon are stored, and an existing file for
45
+ another horizon is reported (`horizon_mismatch`), never kept silently.
46
+ - Bench futures scoring walks only bars that open after asOf and close by
47
+ the horizon end; a horizon off the bar grid stops at the last full bar
48
+ before it (`horizonFlooredToBar`), so no price after the horizon is used.
49
+ - Add optional per-agent `signals` thresholds (`rsiOversold`, `rsiOverbought`,
50
+ `strongMovePct`, `leanMovePct`, `minStrength`) and a `data.indicatorRange`
51
+ data diet (`1D` 5m bars, `1W` 15m, `1M` 1h, `3M` 4h). They change the setup
52
+ shortlist AND the gate that decides when the model is called, so personality
53
+ changes what an agent notices. Absent blocks keep the previous constants and
54
+ the 1D range exactly. Both are validated fail-closed, strict-linted and
55
+ `$ref`-able; the prompt names the agent's bar size and RSI levels.
56
+
57
+ - Every watch entry now carries perpetual open interest when the API serves it
58
+ (`openInterest`: single-side USD over Bybit and OKX, 1h and 24h change,
59
+ `asOf`, `stale`), read from the existing `/api/agent/market` call. The prompt
60
+ explains how to read it with price; it is context, never a trade rule. Older
61
+ APIs without the block leave entries unchanged.
62
+
63
+ - Add an agent test bench: `coinrithm-agent record` saves the read inputs of
64
+ dry-run cycles as cassettes (writes refused, no model call), and
65
+ `coinrithm-agent bench` replays them through the production runner for
66
+ several agent variants and repeats, next to skip and market-implied
67
+ baselines. The deterministic report gives reject codes, action overlap,
68
+ repeat consistency, seeded paired bootstrap CIs, a calibrated A/A null
69
+ rate, a chronological holdout and optional label scoring. Quotes are
70
+ synthesized and counted; see "Bench" in docs/agent-runner.md for the limits.
71
+
72
+ - Add an optional `universe` block (market boundaries): a market-cap rank
73
+ band, a minimum 24h volume, stablecoins in or out, curated sectors and chain
74
+ ecosystems in or out, and the sort that defines an opportunity. Each cycle
75
+ the runner asks `GET /api/agent/universe` for rows inside those boundaries,
76
+ resolves the top `resolveTop` (max 10) into full `discovered` watch entries
77
+ and passes the rest as context. Rows are re-checked client-side, so a server
78
+ can narrow the set but never widen it; the blocklist still wins and every
79
+ cap applies. A failed screener degrades to the watchlist only. The block
80
+ can live in its own file via `$ref`. Without it, `universe_scan` keeps the
81
+ previous top-gainers scan exactly. Needs backend-v2 with the screener.
82
+
83
+ - Add three optional, runner-enforced prediction-market policy fields, so
84
+ numbers that strategies stated only in prose become executable. Absent keeps
85
+ the previous behaviour exactly; malformed values fail closed.
86
+ - `risk.pmMinEdgeGapPct` (0..100): the forecast must beat the fee-inclusive
87
+ cost by that share of the room left to 100 (16 means cost 50 needs 58). It
88
+ never lowers the global minimum edge, and with it set a `pm_open` without
89
+ `forecastProbability` is rejected (`pm_forecast_required`,
90
+ `pm_edge_below_gap_rule`). Mechanical benchmarks are exempt.
91
+ - `risk.pmMaxEdgePoints` (0..100): overconfidence guard; the forecast may
92
+ beat the fee-inclusive cost by at most that many points, and a forecast
93
+ becomes mandatory (`pm_edge_overconfident`). This is an optional action
94
+ constraint; its effect on future performance requires separate evaluation.
95
+ - `risk.pmMaxOpenPerEvent` (1..50): open bets per event (source + slug),
96
+ counting held positions and opens accepted this cycle (`pm_event_cap`).
97
+ - `risk.pmMaxOpenPerCoinHorizon` (1..50): open bets on the same directly
98
+ linked coin whose events end within 24 h of each other, across different
99
+ events, counting held positions and opens accepted this cycle
100
+ (`pm_coin_horizon_cap`; a value outside 1..50 fails closed). Every linked
101
+ coin is kept. Reads the additive discover `relatedCoins` and
102
+ `/positions/pm` `relatedCoins` / `eventEndDate`; a missing coin, or an end
103
+ that is missing, past or over 5 years out, never blocks. A count cap, not
104
+ a correlation model, over the open positions the feed returns (at most
105
+ 200, newest first).
106
+ - `risk.pmMinMinutesToClose` (0..10080): reject a market whose known close is
107
+ nearer than that to the later of `observation.asOf` and the validation
108
+ clock after the model call (`pm_closes_too_soon`). An unknown or
109
+ unparseable close never blocks.
110
+
111
+ - Keep repeated provider 404/410 availability failures out of the generic model
112
+ failure kill-switch. BYO and self-hosted agents retain their configured model
113
+ and provider holds without entering a disable/revive loop. Transient failures
114
+ and invalid decisions still count toward the existing kill-switch.
115
+ - Keep rejected model text out of retained parser errors: JSON syntax errors
116
+ omit input excerpts, and schema errors omit rejected enum values and unknown
117
+ field names. Useful field/type diagnostics remain; validation is unchanged.
118
+ - Reject OpenAI-compatible and Anthropic responses that explicitly end at the
119
+ output token limit, and Anthropic responses stopped at the context-window
120
+ limit, even if their partial decision text happens to be valid JSON. No action
121
+ from that incomplete response reaches execution. Preserve reported token usage
122
+ and the hosted router's existing bounded malformed-response fallback. A
123
+ truncated direct-provider retry also retains its malformed classification.
124
+ - Classify rejected actions strings with bounded, fixed diagnostic categories.
125
+ JSON5 is used only for diagnostics; string-valued actions remain rejected.
126
+ No raw model output is retained by this diagnostic path.
127
+
128
+ ## 0.7.15 (published 2026-10-02)
129
+
130
+ The verified release includes source changes through 1 October 2026. Its public
131
+ archive and MCP Registry delivery are recorded in the repository publishing log.
132
+
133
+ - PM board rows carry event settlement context from discovery's optional
134
+ `resolution`. Where `scope` is `per_outcome`, each row also carries its own
135
+ provider-bound `outcomeRule`, preserving exact primary/secondary terms or
136
+ explicit unknown status. Event-level text does not substitute for another
137
+ outcome's rule. Missing fields on older APIs remain unknown.
138
+ - Futures agents see `futuresCapacity` in the user prompt: open vs maximum
139
+ positions, slots left and margin headroom, computed exactly as the runner
140
+ validates. With no slot or no margin left, the prompt says plainly that no
141
+ futures_open (new or add) can pass. Production showed agents at 3 of 3
142
+ positions proposing a new open on most cycles (max_positions 222 and
143
+ open_margin_exceeds_cap 116 rejections in 6h), each a wasted model call.
144
+ The validator still enforces both caps.
145
+ - The PM system prompt no longer claims a "genuine information edge" on crypto
146
+ price markets or makes a PM bet REQUIRED. It says the market already prices
147
+ the same public data, that short-dated price markets are usually efficient,
148
+ and that a bet needs a probability gap larger than costs plus a named reason;
149
+ skipping PM is always valid. The ref anti-hallucination rule is unchanged.
150
+ - Every non-mechanical agent (not only `objective.primary: calibration`) gets
151
+ the micro-contract churn filter and the deeper 30-row discovery page,
152
+ including the Bitcoin fallback. Mechanical baselines keep the unmodified
153
+ 12-row universe.
154
+ - PM board rows carry the discover event's optional `referenceProbability` as
155
+ event-level `consensus` (`prob` 0..1, `venues`, `spreadPts`, `kind`,
156
+ `outcome`), never mapped to or flipped for a specific outcome. Absent or
157
+ unusable stays unknown.
158
+ - Non-mechanical PM agents see their own settled forecast record
159
+ (`pmCalibration` from `GET /api/agent/performance`) when it has at least 20
160
+ settled forecasts. It is read at most once per 30 minutes per credential,
161
+ without retries, and omitted on any failure.
162
+
163
+ - Preflight new futures entries using informational reference eligibility;
164
+ validate the available position and margin capacity across actions in the
165
+ same cycle. Adds/exits retain their separate rules, and the API rechecks
166
+ execution-time eligibility. Preserve reported capacity and spot fill
167
+ receipts in decision evidence without claiming full historical replay.
168
+ - Describe forecasts as market-aware, not price-blinded. A capacity-limited
169
+ agent may still exit or adjust protection. Withheld-action diagnostics are
170
+ attributed to the provider response that produced them.
171
+ - Add `get_news` for scored crypto news, bringing the source MCP surface to
172
+ 41 tools. Arena reads work without a key; discovery defaults to open
173
+ markets. Default event results remain compact, with `detail: "full"` for
174
+ the complete event response. Preserve event subtitles and per-outcome
175
+ price basis in bounded output.
176
+
177
+ - The hosted HTTP server recovers the pasted-markdown descriptor link
178
+ (`/mcp` followed by `](`, literal or percent-encoded): GET/HEAD redirect to
179
+ the service descriptor and POST runs the same MCP handler as `POST /mcp`.
180
+ Every other unknown path stays 404 and `GET /mcp` stays 405.
181
+ - `pm_data_canonical` documents the canonical `consensus` (or null) and the
182
+ labelled `consensusHistory`, and names orientation `flipped` as the API does.
183
+
184
+ - Preserve optional observed-price flags and bounded source provenance in public
185
+ market summaries, including the exact sides of venue comparisons. A missing
186
+ observed price remains distinct from an observed zero and unknown provenance.
187
+ This source change is not included in published npm `0.7.14`.
188
+
189
+ - Hosted scheduler rollout supports the opt-in `whale_context` runner capability. After the deterministic
190
+ gate fires for a PM-scoped, non-mechanical cycle, it attaches bounded public
191
+ tape context and up to two validated wallet movement summaries to the
192
+ observation. Reads are best effort with explicit availability status and do
193
+ not widen candidates or change risk/write gates. The observation fingerprint
194
+ includes this context; the existing partial persisted audit projection does
195
+ not store raw whale or wallet samples. Published MCP `0.7.14` remains unchanged.
196
+
197
+ - Preserve full public `walletAddress` values in whale tape and default event
198
+ summaries for direct wallet-tool follow-up on Polymarket, Limitless and Myriad.
199
+ Anonymous/null and absent identities remain unchanged. This source fix is not
200
+ included in the published npm `0.7.14` package.
201
+ - Record explicit zero model calls, tokens, inference cost and action writes for
202
+ cycles that return before inference due to a kill switch, observed drawdown,
203
+ failed account reads or an empty market selection. Historical records remain
204
+ unchanged; failures after a possible provider call retain unknown evidence.
205
+
206
+ ## 0.7.14
207
+
208
+ - Scope permanent model-error streaks to the attempted provider/model. Discard
209
+ legacy unattributed streaks and reset availability failures on a successful
210
+ provider response, including malformed decisions. Old-route failures cannot
211
+ request an early hold on a replacement model; agent risk limits are unchanged.
212
+ - Attribute a routed permanent-error hold to the attempt that produced the error,
213
+ even when a later fallback is rate-limited; keep actual-call metering unchanged.
214
+ - Preflight futures protection updates against observed side, mark and liquidation
215
+ prices, including retained triggers. Reject known invalid end-states with an
216
+ actionable reason before a write; the API remains authoritative as prices move.
217
+ - Add the optional `risk.pmMinEntryProbabilityPct` policy (0..100 points): the
218
+ runner rejects `pm_open` when the chosen outcome's raw market probability at
219
+ entry is below the floor, with a reason that names both numbers. Fees stay
220
+ in the forecast-edge check, so a 19-point outcome fails a 20-point floor even
221
+ when fees lift its cost above 20. Absent keeps today's behaviour; a set floor
222
+ with no quoted probability fails closed. The floor is rendered in the prompt's
223
+ hard caps.
224
+ - Retain candle timestamps and compact coverage/interval evidence alongside
225
+ indicators, separately from market-price freshness. Missing timestamps stay
226
+ unknown; nominal five-minute cadence does not imply current or regular bars.
227
+ Model input and private decision evidence retain the same context.
228
+ - Load optional `character/entries.md`, `exits.md`, `sizing.md` and `research.md`
229
+ from local bundles so Studio strategy sections reach the model, manifest and
230
+ compiled definition. Existing bundles without these files are unchanged.
231
+ - Include the exact compiled strategy definition and its digest in local
232
+ inspection; expose the same snapshot builder to engine consumers.
233
+ - Add `run --expect-definition` to reject a changed baseline before model or
234
+ account access. The digest is not a full replay record or broker adapter.
235
+ - Hosted validation accepts `limits.maxDailyLossMusd: 0` as no daily loss cap,
236
+ matching the runner and the hosted API; negative and non-finite values are
237
+ still rejected.
238
+ - Tactic cap merges treat 0 as unlimited for `maxTradesPerDay` and
239
+ `maxDailyLossMusd`: a tactic may tighten 0 to a positive cap but can no
240
+ longer turn a positive cap into 0. Writes and margins keep lower-is-tighter.
241
+
242
+ Publication and hosted deployment are verified separately. See the repository's
243
+ [release status](https://github.com/CoinRithm/coinrithm-agent-trading#version-clarity)
244
+ for registry availability and the hosted runtime evidence.
245
+
246
+ ## 0.7.13
247
+
248
+ - Preserve optional per-outcome venue terms in compact prediction-market output,
249
+ including explicit unavailable values and valid false/zero facts.
250
+ - Include candle volume coverage in agent fundamentals: positive counts identify
251
+ missing expected venues; unknown coverage stays unknown. Preserve measured zero
252
+ volume and keep each volume paired with its own coverage.
253
+ - Classify provider capacity failures consistently, including HTTP 503
254
+ resource exhaustion, in runner results and configured same-model retries.
255
+ - Export `classifyProviderFailure` from the supported engine entry point.
256
+ Retry counts and trading behavior are unchanged.
257
+ - Surface signed cumulative futures funding and its applied-through timestamp to
258
+ the agent observation so funding already reflected in balances is not counted twice.
259
+ - Add public whale-wallet context to the 40-tool surface: bounded 7-day or
260
+ 30-day wallet activity and source/wallet movement detail, with provenance and
261
+ provider-reported context kept distinct from CoinRithm's observed trade flow.
262
+ - Clarify `pm_data_calibration` as market-price calibration: the primary lane
263
+ uses one complete-book snapshot in the inclusive 20–28 hour pre-resolution
264
+ window, with event-weighted ECE and separate `finalPrice`/`ownCapture` lanes.
265
+
266
+ Publication and hosted deployment are verified separately. See the repository's
267
+ [release status](https://github.com/CoinRithm/coinrithm-agent-trading#version-clarity)
268
+ for registry availability and the hosted runtime evidence.
269
+
270
+ ## 0.7.12 — 2026-09-15
271
+
272
+ Clarify `whoami`, `cancel_spot_order` and `report_pm_opportunity` descriptions,
273
+ removing execution-cost prose unrelated to these operations. Document actual
274
+ authentication, side effects, result fields and retry behavior.
275
+
276
+ Spot cancellation now advertises its existing idempotent behavior. Opportunity
277
+ reporting no longer advertises unconditional idempotency: duplicate protection
278
+ requires `decisionId` (or `agentTrace.decisionId`) under the same API key; the
279
+ first stored record wins. Reporting remains a write despite requiring only the
280
+ `read` scope, and its evidence remains explicitly self-reported.
281
+
282
+ Tool names, accepted inputs and execution behavior are unchanged. Published on
283
+ npm and deployed to hosted MCP on 2026-09-15; registry and GitHub downloads match
284
+ the CI archive. A clean registry installation passed startup and tool metadata
285
+ checks. See the [release record](https://github.com/CoinRithm/coinrithm-agent-trading/releases/tag/mcp-trading-v0.7.12).
286
+ Glama's evaluation score is separate from package delivery.
287
+
288
+ ## 0.7.11 — 2026-09-15
289
+
290
+ Fix opportunity reporting that previously treated resolved API failures as
291
+ successful submissions. Only `ok: true` confirms a report. HTTP errors remain
292
+ unconfirmed; transport failures and exceptions have an unknown delivery outcome.
293
+
294
+ `CycleResult.opportunity` now contains confirmed reports only. The additive
295
+ `opportunityReport` field preserves the attempted payload, outcome and status,
296
+ without API error bodies or exception details. Existing consumers should use
297
+ this field when they need attempted rather than confirmed evidence.
298
+
299
+ The reporter retains its one-invocation-per-cycle latch and adds no retries.
300
+ Focused regressions compare successful and failed reporting in skip/act cycles
301
+ and verify unchanged trading results and runner state. SDK versions are unchanged.
302
+ This source entry does not establish registry publication or hosted deployment.
303
+
304
+ ## 0.7.10 — 2026-09-15
305
+
306
+ Source changes following the published 0.7.9 release. The TypeScript SDK remains
307
+ 0.3.1 and Python remains 1.8.1; their runtime source is unchanged.
308
+
309
+ - Persist file-backed run identity before execution so a first-cycle process
310
+ crash cannot discard the idempotency identity. Transport uncertainty is still
311
+ not automatically replayed or recorded as a completed trade.
312
+ - Fix runner startup on Node 18: use the imported Node crypto API instead of
313
+ depending on a global crypto object. The installed-package matrix reproduced
314
+ this failure on Linux, Windows and macOS.
315
+ - Add the supported `@coinrithm/mcp-trading/engine` entry point, preserving
316
+ existing deep imports, and separate observation accounting and opportunity
317
+ reporting from cycle ordering.
318
+ - Add opt-in, machine-checked crypto return predicates and visible warnings for
319
+ inactive/reserved configuration. Existing agents are not automatically opted in.
320
+ - Serialize scheduler migrations in a bounded transaction; add an offline
321
+ credential-rotation helper and interruption/recovery rehearsal.
322
+ - Pin workflow actions and verify release-tool checksums. Add installed-package
323
+ compatibility and restart smoke checks across operating systems and runtimes.
324
+
325
+ 0.7.10 was published and deployed on 2026-09-15. Registry and GitHub downloads
326
+ matched the CI-tested archive; hosted MCP and scheduler deployments finished.
327
+ See the [release record](https://github.com/CoinRithm/coinrithm-agent-trading/releases/tag/mcp-trading-v0.7.10).
328
+
329
+ ## 0.7.9 - 2026-09-15
330
+
331
+ Published on npm and verified on 2026-09-15: the registry archive matches the
332
+ reviewed artifact and passes fresh-install checks. See the
333
+ [combined release notes](https://github.com/CoinRithm/coinrithm-agent-trading/releases/tag/mcp-trading-v0.7.9)
334
+ for source provenance, verification and community acknowledgments.
335
+
336
+ Public market-data fidelity and runner reliability release. No MCP tool was
337
+ renamed or removed, and the API **contract stays 1.7.0**.
338
+
339
+ **PM evaluation budget.** Event-driven periodic prediction-market evaluations
340
+ now respect `maxLlmCallsPerHour` after their cooldown elapses. Budget skips make
341
+ no provider call and consume no call allowance. PM keeps its own cooldown;
342
+ open-position management and explicit always-on behavior retain their existing
343
+ exemptions. This runner gate is separate from hosted provider-capacity admission.
344
+
345
+ **Retry-After parsing.** Missing, blank or malformed headers no longer become
346
+ zero-delay retries. The runner API client uses its existing five-second fallback;
347
+ explicit zero, numeric seconds and HTTP dates remain supported. Model-provider
348
+ cooldowns share the parser and retain their existing one-hour cap.
349
+
350
+ **API request deadlines.** Each runner API operation now has a 30-second total
351
+ deadline covering response headers, body reads and all 429 retry waits. The
352
+ same client serves the hosted scheduler. Embedded callers can set a finite
353
+ `requestTimeoutMs` and supply an `AbortSignal`. A timeout or cancellation returns
354
+ an uncertain transport result without automatically replaying a trading write.
355
+ Timers and listeners are removed when the operation finishes.
356
+
357
+ **State persistence.** Self-host state is serialized to a private temporary file
358
+ and atomically renamed over the previous state. A failed serialization or rename
359
+ leaves the prior state intact. This is atomic replacement, not a claim of durable
360
+ storage across power loss.
361
+
362
+ **Agent conversion.** `coinrithm-agent eject` preserves explicit `triggerPolicy`
363
+ and `capitalSizing` blocks. Previously conversion could restore default hourly
364
+ budgets and drop equity sizing.
365
+
366
+ **Release verification.** All-source coverage gates, mandatory PostgreSQL CI,
367
+ dependency updates and corrected client setup docs are included. See the
368
+ [reliability record](https://github.com/CoinRithm/coinrithm-agent-trading/blob/main/docs/RELIABILITY.md).
369
+
370
+ **Confirmed-action journal.** Completed-action memory now requires an action
371
+ to be both accepted and executed. Failed writes and uncertain transport results
372
+ retain their attempt evidence without becoming completed moves in the next
373
+ decision prompt. Dry-run proposals remain unexecuted.
374
+
375
+ **Direct NVIDIA retry.** One complete HTTP 500/502/503/504 response can be
376
+ retried once on the identical direct NVIDIA route within the original deadline.
377
+ Both attempts are retained. This does not retry trading writes or change the
378
+ hosted shared-pool routing policy.
379
+
380
+ **Capital reconciliation.** Frozen-balance rounding residue down to -1e-8 is
381
+ normalized only in the sizing calculation after the independent reads agree.
382
+ Negative spendable cash still fails closed; wallet balances are not changed.
383
+
384
+ **Private decision input evidence.** The bounded numeric projection includes
385
+ nested indicator inputs and context movers, with legacy v1 records still readable.
386
+ It does not retain hidden reasoning or raw model output.
387
+
388
+ **Compact prediction-market evidence.** Discovery and compact event-detail
389
+ responses now retain the API's `source.quoteScale`, `source.methodology` and
390
+ `source.supportsMarketMetrics`, plus `spreadPoints`, `probabilityBook` and
391
+ each retained outcome's `normalizedProbability`. Venue-native bid/ask quotes
392
+ are never rescaled or interpreted from magnitude. Normalization remains the
393
+ API's calculation over the original full book, not the truncated top-five
394
+ outcome list. Existing payload bounds and explicit `detail: full` behavior
395
+ are unchanged.
396
+
397
+ **Settlement-time provenance.** Compact events retain `resolvedAtBasis` and
398
+ `settlementWindowClosedAt`, keeping provider expiration distinct from an
399
+ announced settlement time. Null and absent upstream evidence stay null and
400
+ absent; the MCP does not infer missing values.
401
+
402
+ **Candle semantics.** The `get_candles` description now states that these are
403
+ sampled composite-price bars. Each bar's `v` is a mean rolling 24-hour
404
+ quote-volume observation in USD, not volume traded during the candle, and
405
+ must not be summed across bars.
406
+
407
+ **HTTP completion diagnostics.** The hosted HTTP
408
+ entry now has a bounded, stderr-only completion observer with final SDK-result
409
+ and finish/abort accounting. Initialization, discovery, tool failures and
410
+ successful delivery are distinct; unknown tool names are normalized. Records
411
+ contain no arguments, bodies, credentials, caller/RPC IDs or caller-origin labels.
412
+ Credential presence is not authentication. Durations describe the HTTP request,
413
+ shared by batch members; server finish does not prove client receipt or use.
414
+ Stdio, tools, authentication and dependency versions are unchanged. See
415
+ `DEPLOY.md` for the measurement and retention limits. Hosted source/image
416
+ `18a0bb6a8a0665e91cebc10225fec6f7ebcdaaf7` passed a bounded anonymous smoke on
417
+ 2026-09-13. Hosted verification and npm publication are separate release steps.
418
+
419
+ **Deployment boundaries.** Hosted scheduler admission reasons are private
420
+ scheduler telemetry, not a new SDK or MCP response field. The API's corrected
421
+ comparison probabilities and enriched spread names use the existing response
422
+ shape and reach current clients through fresh API reads. Outcome display names
423
+ may change; use source/event/outcome identifiers for identity, never summed
424
+ prices or matching labels alone. These fixes do not establish trading returns.
425
+
426
+ ## 0.7.8
427
+
428
+ Runner decision-quality, evidence and paper-capital release. Additive: no MCP
429
+ tool was renamed or removed, and the API **contract stays 1.7.0**. This release
430
+ contains all package changes since published 0.7.7 (`gitHead` `80d0cae`), not
431
+ just the previously listed thesis work.
432
+
433
+ **Thesis exits.** Every opening action (`futures_open`, `spot_order`,
434
+ `pm_open`) now carries a `thesis`: a one-sentence summary plus an
435
+ `invalidation` with at least one machine-checkable condition (`priceBelow` /
436
+ `priceAbove` for coins, `probabilityBelow` / `probabilityAbove` for prediction
437
+ markets, a `maxHoldMinutes` time stop, and a free-text `catalyst` the model
438
+ re-judges itself). The runner binds the thesis to the position the server
439
+ returns, sanitized side-aware (a rising price never invalidates a long; a
440
+ wrong-side level is dropped rather than re-signed; the time stop is clamped to
441
+ 60 minutes .. 30 days), persists it in the run state (`RunState.theses`, the
442
+ same state file / `agent_state` JSON as before, no schema change) and
443
+ re-evaluates it every cycle. A futures position whose price level or time stop
444
+ is breached is closed by the runner before the model is asked anything, logged
445
+ as a `thesis_invalidated` exit with its own idempotency key, after the
446
+ kill-switch and drawdown checks and never instead of them. Prediction-market
447
+ positions have no close endpoint, so a broken PM thesis is surfaced to the
448
+ model instead (do not add, let it settle). The parser is tolerant (a malformed
449
+ thesis never fails the open; a thesis copied onto a close is ignored) and the
450
+ structured-output schema requires it, so schema-enforced hosted models always
451
+ emit one.
452
+
453
+ **Fundamentals in the observation.** Each watch entry now carries
454
+ `fundamentals` sourced only from calls the runner already makes: `categories`,
455
+ `marketCapRank` and `marketCapUsd` from the market context; `volume24hUsd` from
456
+ the candles the `indicators` capability already fetches (live-probed
457
+ 2026-09-02: each bar's `v` is a rolling 24h volume, so the latest bar is the
458
+ 24h figure, never the sum); and up to three `headlines` with `publishedAt`
459
+ timestamps from the one `news` call, attributed through the curated coin-news
460
+ graph. Discovered PM markets carry `endDate` and `liquidityUsd`; open PM
461
+ positions carry their title, side, entry and current probability and
462
+ `openedAt`; open futures positions carry `openedAt`. The system prompt states
463
+ the thesis contract, the runner-enforced exit and how to grade a trade on the
464
+ fundamentals. Not carried, because no agent endpoint serves them: an "about"
465
+ text per coin, a 24h probability change and a cross-venue divergence per PM
466
+ market.
467
+
468
+ **Fix:** the public movers feed serializes `change24h` / `currentPrice` as
469
+ decimal strings; the universe-scan context rows read them strictly as numbers
470
+ and shipped `undefined` for every mover.
471
+
472
+ **Opt-in equity-based paper sizing.** A runner can size entries from a
473
+ conservative fraction of its independently attributed paper book instead of a
474
+ fixed stake/margin. The book is accepted only when wallet identity, cash
475
+ partitions, held-position attribution and spot-mark coverage reconcile. Quotes
476
+ then enforce per-entry, per-symbol, deployed-capital and daily-entry limits;
477
+ fee buffers and the API's fee-inclusive quote evidence are included. Any
478
+ missing or inconsistent evidence fails closed. Legacy positions on a different
479
+ book remain visible for management but never inflate the current book's buying
480
+ power.
481
+
482
+ **Prediction-market decisions use executable economics.** PM opens now reject
483
+ an invalid raw probability and a model forecast that does not clear the quoted
484
+ entry price. Forecast edge is measured against the actual fee/slippage-adjusted
485
+ fill, not the headline market probability. Quote-expiry outcomes are recorded
486
+ separately from risk/balance rejection, and futures risk/reward validation uses
487
+ fee-inclusive entry and stop economics.
488
+
489
+ **Decision evidence is structured and bounded.** Cycles can expose a sanitized,
490
+ partial private decision-input record: configuration and observation
491
+ fingerprints, daily budget and guard state, plus bounded observation rows with
492
+ explicit omission counts. It is not a prompt, transcript, raw model output or
493
+ hidden reasoning record. The runner also reports quote/validation evidence for
494
+ abstained, forecast-only and quote-expired PM opportunities. Hosted persistence
495
+ and retention remain the caller's responsibility.
496
+
497
+ **Runtime controls are more faithful.** The model sees the remaining daily
498
+ entry/add budget rather than only static maxima. Entry caps still block new
499
+ risk, while closes and other risk-reducing actions remain available. Direct
500
+ provider HTTP 429 responses are capacity skips rather than model failures, so
501
+ BYO agents do not build a failure streak during ordinary quota pressure.
502
+ Structured-tool decisions remain required where the provider supports that
503
+ contract.
504
+
505
+ **Scorecard fix.** Maximum drawdown now measures decline from starting equity,
506
+ so an immediate loss is no longer hidden by treating the first post-trade point
507
+ as the high-water mark.
508
+
509
+ ## 0.7.7
510
+
511
+ Reliability release. Every change here came from a live production failure, not
512
+ from a roadmap. Additive: no tool renamed or removed, and the API **contract
513
+ stays 1.7.0** because nothing on the documented surface changed.
514
+
515
+ **Model requests are now built from a declared capability table, not
516
+ assumptions.** `providerCapabilities.ts` states, per model family, which
517
+ parameter carries the completion budget, whether a non-default temperature is
518
+ allowed, and what extra body fields the family needs. Two failures this fixes:
519
+
520
+ - **OpenAI's current models rejected our requests outright.** `gpt-5*` and
521
+ `o*` refuse `max_tokens` and any non-default `temperature`; they take
522
+ `max_completion_tokens`. The family is detected by MODEL id, not just the
523
+ provider name, so an OpenAI-compatible gateway serving `gpt-5` gets the same
524
+ shape. If you brought your own OpenAI key, this is why it now works.
525
+ - **NVIDIA Nemotron models emitted a think-chain where the JSON decision
526
+ belonged**, which failed every cycle. The `chat_template_kwargs.enable_thinking=false`
527
+ switch and the "detailed thinking off" system hint are now encoded as data
528
+ rather than re-learned by failing.
529
+
530
+ **New: `probeDecisionContract()`.** An HTTP 200 is not proof a route can run an
531
+ agent. Both production failure modes returned 200s: a think-chain in the JSON
532
+ slot, and an empty completion because a reasoning model spent its whole budget
533
+ before answering. The probe sends a canned mini-observation through the REAL
534
+ decision parser at a >=1024 completion allowance and classifies the result as
535
+ `http`, `empty` or `parse`. Use it before adopting any model id; provider
536
+ catalogs list ids that 404 on invoke.
537
+
538
+ **Provider trouble no longer disables an agent.** A permanent-looking model
539
+ error (404/410/decommissioned) used to disable the agent after a threshold. On
540
+ 2026-08-26 NVIDIA end-of-lifed an entire model line and 35 agents died on that
541
+ path. The runner now reports a hold and keeps retrying each cadence, recovering
542
+ by itself when the provider does. Disables remain for what deserves them:
543
+ revoked credentials, drawdown, kill-switch, user action.
544
+
545
+ **Failures carry structured metadata.** A failed `decide()` now returns
546
+ `status` and, when the provider sends one, `retryAfterMs` (parsed from
547
+ `Retry-After` in both delta-seconds and HTTP-date form, capped at an hour), so
548
+ a caller can tell a 429 from a 5xx without parsing strings. Error text is
549
+ unchanged.
550
+
551
+ **`ClientConfig.extraHeaders`.** Headers attached to every request, spread
552
+ before auth so they can never clobber it. Self-host has nothing to put here;
553
+ it exists so CoinRithm's own hosted scheduler can present its attestation
554
+ channel.
555
+
556
+ **Model names corrected throughout.** The retired Llama 3.x line is gone from
557
+ the README, the runtime defaults and the `quant-reference` example, which is
558
+ relocked onto `nvidia/nemotron-3-nano-30b-a3b`.
559
+
560
+ ## 0.7.6
561
+
562
+ Agent capability release: universe discovery, first-class behavioral guards,
563
+ and the hosted prose budget made visible. Additive — no tool renamed or
564
+ removed. Contract moves to **1.7.0** (two keyless paths declared).
565
+
566
+ **New: agents can look beyond their own watchlist.**
567
+
568
+ - **`get_crypto_movers` tool.** Keyless scan of the tracked coin universe for
569
+ the biggest 24h gainers or losers. Rows carry `coinId`, `symbol`, `name`,
570
+ `slug`, `change24hPct`, `priceUsd`.
571
+ - **`universe_scan` capability** for the self-host runner. Each cycle it pulls
572
+ the top movers, promotes the strongest few into full watch entries marked
573
+ `discovered: true`, and passes the remainder as compact context. Watchlist
574
+ and blocklist symbols are excluded up front, so a discovered row can never
575
+ duplicate a configured pair or bypass the deny list.
576
+ - **Both now carry the coinId through.** The movers row's `ucid` IS the
577
+ `coinId` that `get_candles` / `get_market_context` / the futures quote path
578
+ take. It was previously stripped from the tool response and re-derived from
579
+ the SYMBOL via a resolve round-trip — a wasted call per discovered mover and
580
+ a real correctness hazard, because symbols collide across listings and the
581
+ resolver could return a different coin than the one that actually moved.
582
+
583
+ **New: contract declares the endpoints the tools call.**
584
+
585
+ - `/api/coins/top-gainers` and `/api/coins/top-losers` are now in
586
+ `openapi.yaml` (tag `public-crypto-data`), so both SDKs can reach the
587
+ surface `get_crypto_movers` uses. Probe-verified against prod: bare array,
588
+ no envelope; `change24h` / `currentPrice` are decimal STRINGS; default
589
+ `limit` is 3 and out-of-range values return 400 rather than clamping.
590
+
591
+ **New: personality and boundaries are configurable, and documented.**
592
+
593
+ - **`character/guards.md`** — first-class hard behavioral guards, merged into
594
+ the strategy prose as a distinct section rather than buried in the thesis.
595
+ - **`examples/agents/pia-pump-fader`** — a full bundle demonstrating
596
+ capabilities plus boundary configuration (watchlist/blocklist interaction,
597
+ the five-point risk gate, re-entry discipline).
598
+ - **`examples/agents/FORKING.md`** — a file-by-file map of what is strategy
599
+ and what is plumbing, so a fork knows what it is allowed to change.
600
+ - **QUICKSTART** documents capabilities, and a docs-drift tripwire fails the
601
+ suite when a capability ships undocumented (`universe_scan` shipped
602
+ invisible in every user surface once; that cannot recur silently).
603
+
604
+ **Fixed.**
605
+
606
+ - **Hosted prose budget is validated, not discovered at deploy.**
607
+ `coinrithm-agent validate --hosted` now checks the 8,000-character merged
608
+ prose budget and reports the exact overage. A bundle could previously
609
+ validate clean and still be undeployable. YAML frontmatter is stripped
610
+ before the count (and before the model sees it — it was being fed in as if
611
+ it were strategy). `pia-pump-fader` was rebuilt to fit at 7,932.
612
+ - **Permanent failures stop being revived.** A disabled agent whose model is
613
+ gone or whose key is invalid is no longer resurrected by the scheduler's
614
+ revive pass; only transient failures are retried.
615
+ - **Fresh scaffolds are no longer bricked** by the capabilities field, and
616
+ action-confidence tolerance was widened to match what models actually emit.
617
+ - **False market-data licensing assertion corrected** in both READMEs.
618
+
619
+ ⚠ Publishing to npm remains a **manual** step — `publish-mcp.yml` pushes
620
+ `server.json` to the MCP registry only.
621
+
622
+ ## 0.7.5
623
+
624
+ **Release-hygiene bump. Everything below was already merged but never
625
+ reached npm** — the 0.7.4 tarball was published 2026-07-26T23:01:11Z and
626
+ five commits landed after that instant without a version bump, so the
627
+ repository's 0.7.4 and the published 0.7.4 were different code under one
628
+ version number. This release makes the published artifact match the
629
+ source again.
630
+
631
+ - **Security.** MCP dependency audit fixes, 6 findings to 0 (`da65e9e`).
632
+ Anyone on published 0.7.4 is running the pre-audit dependency set.
633
+ - **`pm_data` Gemini exposure** for agents (`3ab04ae`).
634
+ - **Venue methodology and health** exposed as tools (`74cc495`).
635
+ - **Reproducible decision receipts** persisted by the agent runner
636
+ (`8bebc9e`).
637
+ - **Docs.** Contract version drift corrected and the placeholder SDK
638
+ README replaced, so the docs stop advertising an install that 404s
639
+ (`6d61b92`).
640
+
641
+ No tool was renamed or removed; this is additive plus a dependency
642
+ refresh.
643
+
644
+ ⚠ Publishing this package is a **manual** step — `publish-mcp.yml` only
645
+ pushes `server.json` to the MCP registry, it does not run `npm publish`.
646
+ That asymmetry is exactly how the drift above accumulated unnoticed.
647
+
648
+ ## 0.7.4
649
+
650
+ Docs-only. No tool behavior change, no API-surface change.
651
+
652
+ - **Acceptable Use of Market Data.** The README (root and this package) and
653
+ `openapi.yaml` (`info.termsOfService`, `info.description`, and the
654
+ `public-pm-data` tag) now reference and summarize CoinRithm's licensing
655
+ flow-down restriction on Market Data from third-party prediction-market
656
+ venues: read-only use for paper-trading context and settled-outcome
657
+ scoring only — no model training/fine-tuning/benchmarking, no
658
+ redistribution or bulk-extraction, no use to build a competing product.
659
+ Full terms: <https://www.coinrithm.com/en/terms-of-use>
660
+
661
+ ## 0.7.3
662
+
663
+ Quality-engine surfaces + independent forecasts. Additive; no breaking change.
664
+
665
+ - **Quality verdicts in tool responses.** `discover_pm_markets`, `pm_quote`, and
666
+ the `pm_data_*` tools now surface the persisted truth-engine `quality` object
667
+ (`decisionEligible`, warning/block reason codes, `policyVersion`, `assessedAt`).
668
+ Markets with critical failures stay visible but cannot drive paper opens or
669
+ alerts.
670
+ - **`openBlocked` preview on `pm_quote`.** Quotes preview the open-time quality
671
+ gate (`openBlocked` + `openBlockReasons`), so an agent can skip a market that
672
+ would 422 before burning the open attempt. The self-host runner
673
+ (`coinrithm-agent`) does this skip automatically.
674
+ - **Independent forecasts in the runner.** The self-host agent runner elicits the
675
+ model's OWN probability (judged from the question/resolution criteria/deadline,
676
+ never anchored to the market price) and submits it as `forecastProbability` on
677
+ PM opens — feeding the public calibration dataset with proper-scoring-rule
678
+ forecasts. Clamped to [1,99]; omitted (never faked) when the model does not
679
+ produce one; `HOUSE_AGENT_FORECAST_ENABLED=false` disables.
680
+ - **`crossPlatform` on event lists** documented in the API contract: sibling
681
+ venues pricing the same question, on list rows.
682
+ - **ForecastEx venue truth.** Public MCP discovery copy and registry metadata
683
+ now describe all 11 live venues, including ForecastEx.
684
+ - **Contract synchronization.** Runner templates and example bundles pin the
685
+ served OpenAPI 1.6.0 contract; canonical scorecard paths are unambiguous.
686
+
687
+ ## 0.7.2
688
+
689
+ Docs-truth + privacy release. No tool behavior change, no API-surface change.
690
+
691
+ - **Ten venues in the public listing.** `pm_data_*` tool copy, the README, and
692
+ `server.json` now name all ten venues (adds Futuur and Myriad). npm `0.7.1` was
693
+ published before those landed, so the registry listing still advertised "eight
694
+ venues"; npm versions are immutable, so correcting the public listing required
695
+ a new release.
696
+ - **`source` parameter description** on `pm_data_events` / `pm_data_event_detail`
697
+ now enumerates all ten venue slugs. Accepted values are unchanged — this is
698
+ description text only, which is why it is a patch and not a minor.
699
+ - **Privacy.** Raw model output is no longer persisted, enforcing the package's
700
+ no-chain-of-thought promise.
701
+ - **New tripwire.** `server.json` (the MCP-registry listing) is now guarded
702
+ against version and venue-count drift; it had no guard, which is how it went
703
+ stale in the first place.
704
+ - Refreshed stale Arena-gate example copy.
705
+
706
+ ## 0.7.1
707
+
708
+ Docs + registry-metadata release; no tool behavior changes.
709
+
710
+ - **README refresh**: the keyless `pm_data_*` data surface is now front and
711
+ center — 8 venues (Polymarket, Kalshi, Smarkets, Limitless, Manifold,
712
+ Metaculus, PredictIt, Rothera — the "seven venues" line predated Rothera),
713
+ the anonymous hosted-endpoint path, and the `referenceProbability` /
714
+ `volumeHistory` fields the data tools return.
715
+ - **`server.json`**: hosted endpoint's `Authorization` header marked optional
716
+ (the `pm_data_*` tools work anonymously — verified live) and the server
717
+ description now leads with the keyless data surface.
718
+ - Ships the post-0.7.0 commits: `pm_data_event` advertises `volumeHistory`,
719
+ `pm_data_events` advertises `referenceProbability` on list items, and the
720
+ hosted MCP root (`GET /`) serves a self-describing JSON landing (with a
721
+ 405 + hint on `GET /mcp`).
722
+
723
+ ## 0.7.0
724
+
725
+ (Retroactive entry — released 2026-07-05 without a changelog note.)
726
+
727
+ - **Four keyless `pm_data_*` tools** — CoinRithm's free public cross-venue
728
+ prediction-market dataset over MCP, no API key required and yours is never
729
+ attached: `pm_data_overview` (market-wide stats), `pm_data_events`
730
+ (cross-venue event list), `pm_data_event` (detail incl.
731
+ `crossSourceMatches` + resolution evidence), `pm_data_whales`
732
+ (large-trade tape).
733
+
734
+ ## 0.5.0
735
+
736
+ Agent-runner quality + reliability release. `coinrithm-agent` got materially
737
+ smarter and less noisy; `coinrithm-mcp` is unchanged in shape. Bundles the work
738
+ since 0.4.0.
739
+
740
+ - **Prediction markets are a first-class venue** in the decide prompt: a short
741
+ `pmN` ref so small models trade PM reliably, eligible-outcome filtering (only
742
+ backend-openable outcomes reach the model), and futures-capped agents steered
743
+ to PM (a separate budget) instead of re-rejecting.
744
+ - **PM anti-churn — now actually effective.** The candidate list is pre-filtered
745
+ to exclude markets the agent already holds, and the runner + server both block
746
+ re-betting a held market+outcome (no more one-agent, 25-identical-bets churn).
747
+ An earlier version read the wrong `/positions/pm` fields and was silently dead;
748
+ fixed.
749
+ - **Settlement-feedback learning loop.** The agent sees how its own recent bets
750
+ actually resolved (win/loss/void + realized PnL) as reflective context, so it
751
+ learns from outcomes across cycles.
752
+ - **Per-trade reasoning stays honest about the market.** A multi-action decision
753
+ no longer stamps its primary rationale onto a secondary trade about a different
754
+ market — the trade's public Arena "why" always matches the market it's on.
755
+ - **Futures reliability.** The model is unblinded to per-position mark /
756
+ liquidation / stop / take-profit prices; take-profit is auto-clamped to a valid
757
+ R:R target off the stop (kills the `take_profit_not_*_mark` reject waves); and a
758
+ marking-down PM book now trips the equity-drawdown kill-switch too.
759
+ - **News capability.** Recent high-importance news for the watchlist coins is fed
760
+ into the decide context as a market-catalyst layer.
761
+ - **Robustness + contract accuracy.** Scheduler/runner hardening, flat-state
762
+ prompt steers (weak models stop hallucinating closes), manage-enum
763
+ normalization, and the PM contract now documents real entry friction rather
764
+ than a disclose-only stance.
765
+ - **Security.** `hono` bumped to 4.12.27 (high-severity advisories: serve-static
766
+ path traversal, CORS wildcard-with-credentials, body-limit bypass).
767
+ - **Docs.** The npm README leads with value / free / OKF / Studio; stale
768
+ scheduler and `minDecidedTrades` claims corrected.
769
+
770
+ ## 0.4.0
771
+
772
+ - **Deterministic scorecard engine (`computeScorecard`).** The reproducible-
773
+ evaluation engine for `coinrithm.agent.scorecard.v1` — pure math over an
774
+ agent's realized track record (no network, no model): realized PnL, win rate,
775
+ expectancy, profit factor, reward-to-risk, Sharpe, Sortino, deflated /
776
+ probabilistic Sharpe (Bailey & López de Prado — skill vs luck with a multiple-
777
+ testing penalty), max drawdown, and Brier + ECE calibration for probabilistic
778
+ calls. Same inputs → identical metrics **and** a sha256 `contentHash` of the
779
+ canonicalized result, so a scorecard whose hash doesn't reproduce isn't
780
+ trusted. Metrics are computed AFTER the run from immutable evidence (leakage-
781
+ separation), so tuning-to-the-metric is structurally impossible. Returns
782
+ `null` for thin records — never a fabricated number.
783
+ - **Resolver: committable file metadata + functionality pin.** The OKF resolver
784
+ now carries per-file metadata and pins functionality through resolution, so a
785
+ bundle's behavior is reproducible from its committed files.
786
+
787
+ ## 0.3.0
788
+
789
+ - **Agent risk config: coin deny-list (`blocklist`).** `risk.blocklist` lets an
790
+ agent name symbols it must never open, even if they are on the watchlist —
791
+ deny wins over allow. Enforced in the runner's decision validator (rejects
792
+ `futures_open` / `spot_order` on a denied symbol) and surfaced in the system
793
+ prompt, so the model is told the boundary and the runner re-checks it.
794
+ - **Docs: Open Knowledge Format positioning.** Clarified that a CoinRithm agent
795
+ is an OKF bundle — a portable directory of markdown + frontmatter that is
796
+ model-agnostic (run the same definition on any model). Develop and prove it
797
+ free on paper, then run it anywhere.
798
+ - npm keywords refreshed (`open-knowledge-format`, `okf`, `model-agnostic`,
799
+ `gemini`) for registry discovery.
800
+
801
+ ## 0.2.0
802
+
803
+ - Added the **`coinrithm-agent`** self-host runner binary alongside the MCP
804
+ server: a folder-as-architecture (OKF) agent you bring your own model key to,
805
+ with caps enforced by the runner (not the model), dry-run by default,
806
+ paper-only.
807
+
808
+ ## 0.1.x
809
+
810
+ - Initial `coinrithm-mcp` MCP server: reads, quotes, scoped spot/futures/PM
811
+ writes, ledger export, and Agent Arena integration over a user-minted API key.