@coinrithm/mcp-trading 0.7.10 → 0.7.11

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ ships two binaries — `coinrithm-mcp` (the MCP server) and `coinrithm-agent` (t
5
5
  self-host agent runner) — versioned together. The CoinRithm **API contract** is
6
6
  versioned separately (see `openapi.yaml` `info.version`, currently `1.7.0`).
7
7
 
8
+ ## 0.7.11 — 2026-09-15
9
+
10
+ Fix opportunity reporting that previously treated resolved API failures as
11
+ successful submissions. Only `ok: true` confirms a report. HTTP errors remain
12
+ unconfirmed; transport failures and exceptions have an unknown delivery outcome.
13
+
14
+ `CycleResult.opportunity` now contains confirmed reports only. The additive
15
+ `opportunityReport` field preserves the attempted payload, outcome and status,
16
+ without API error bodies or exception details. Existing consumers should use
17
+ this field when they need attempted rather than confirmed evidence.
18
+
19
+ The reporter retains its one-invocation-per-cycle latch and adds no retries.
20
+ Focused regressions compare successful and failed reporting in skip/act cycles
21
+ and verify unchanged trading results and runner state. SDK versions are unchanged.
22
+ This source entry does not establish registry publication or hosted deployment.
23
+
8
24
  ## 0.7.10 — 2026-09-15
9
25
 
10
26
  Source changes following the published 0.7.9 release. The TypeScript SDK remains
@@ -26,8 +42,9 @@ Source changes following the published 0.7.9 release. The TypeScript SDK remains
26
42
  - Pin workflow actions and verify release-tool checksums. Add installed-package
27
43
  compatibility and restart smoke checks across operating systems and runtimes.
28
44
 
29
- Source/CI checks, registry publication and production deployment are separate.
30
- This entry does not claim that 0.7.10 is published or deployed.
45
+ 0.7.10 was published and deployed on 2026-09-15. Registry and GitHub downloads
46
+ matched the CI-tested archive; hosted MCP and scheduler deployments finished.
47
+ See the [release record](https://github.com/CoinRithm/coinrithm-agent-trading/releases/tag/mcp-trading-v0.7.10).
31
48
 
32
49
  ## 0.7.9 - 2026-09-15
33
50
 
package/README.md CHANGED
@@ -42,11 +42,13 @@ This package ships two binaries:
42
42
 
43
43
  > **Paper trading only** — virtual funds (50,000 mUSD). Not financial advice.
44
44
 
45
- ## Version 0.7.10
45
+ ## Version 0.7.11
46
46
 
47
- This source version adds restart identity persistence, a supported engine
48
- import, opt-in entry predicates and configuration warnings. It also fixes
49
- runner startup on Node 18 by importing the Node crypto API explicitly. See
47
+ This patch corrects opportunity-report status: only a successful API result
48
+ confirms submission. HTTP errors remain unconfirmed, and transport failures
49
+ have an unknown outcome. Attempt evidence is available in
50
+ `CycleResult.opportunityReport`; `opportunity` contains confirmed reports only.
51
+ Trading behavior and the one-report-method-call-per-cycle limit are preserved. See
50
52
  [CHANGELOG.md](./CHANGELOG.md). Check `npm view @coinrithm/mcp-trading
51
53
  version` for the latest published version. Hosted deployments and npm releases
52
54
  are separate.
@@ -12,4 +12,4 @@ export { newState, rollDay, loadState, saveState } from "./state.js";
12
12
  export { makeRunId } from "./runEvidence.js";
13
13
  export { parseCadenceMs } from "./util.js";
14
14
  export { BENCHMARK_AGENTS, BENCHMARK_STRATEGIES, decideMechanical, isBenchmarkStrategy, type BenchmarkStrategy, type BenchmarkAgentDefinition, } from "./mechanical.js";
15
- export type { AgentSpec, RunState, CycleResult, PlannedAction, Venue, ProviderName, ModelConfig, } from "./types.js";
15
+ export type { AgentSpec, RunState, CycleResult, OpportunityReport, PostedOpportunity, PlannedAction, Venue, ProviderName, ModelConfig, } from "./types.js";
@@ -1,5 +1,5 @@
1
1
  import type { CoinRithmClient, ProvenanceReport } from "./client.js";
2
- import type { AgentSpec, AgentTrace, PostedOpportunity } from "./types.js";
2
+ import type { AgentSpec, AgentTrace, OpportunityReport, PostedOpportunity } from "./types.js";
3
3
  export declare function createOpportunityReporter({ client, spec, live, enabled, runId, decisionId, provenance, baseTrace, log, }: {
4
4
  client: CoinRithmClient;
5
5
  spec: AgentSpec;
@@ -13,4 +13,5 @@ export declare function createOpportunityReporter({ client, spec, live, enabled,
13
13
  }): {
14
14
  post: (o: PostedOpportunity) => Promise<void>;
15
15
  readonly posted: PostedOpportunity | undefined;
16
+ readonly report: OpportunityReport | undefined;
16
17
  };
@@ -1,13 +1,12 @@
1
1
  export function createOpportunityReporter({ client, spec, live, enabled, runId, decisionId, provenance, baseTrace, log, }) {
2
- let opportunityPosted = false;
3
- let postedOpportunity;
2
+ let attempted = false;
3
+ let report;
4
4
  const post = async (o) => {
5
- if (!enabled || !live || opportunityPosted)
5
+ if (!enabled || !live || attempted)
6
6
  return;
7
- opportunityPosted = true;
8
- postedOpportunity = o;
7
+ attempted = true;
9
8
  try {
10
- await client.reportPmOpportunity({
9
+ const result = await client.reportPmOpportunity({
11
10
  kind: o.kind,
12
11
  source: o.source,
13
12
  slug: o.slug,
@@ -23,16 +22,38 @@ export function createOpportunityReporter({ client, spec, live, enabled, runId,
23
22
  runId,
24
23
  provenance,
25
24
  }, baseTrace);
26
- log(`reported ${o.kind} opportunity (universe ${o.universeSize ?? "?"})`);
25
+ report = {
26
+ opportunity: o,
27
+ outcome: result.ok
28
+ ? "confirmed"
29
+ : result.status === 0
30
+ ? "unknown"
31
+ : "http_error",
32
+ status: result.status,
33
+ };
34
+ if (result.ok) {
35
+ log(`reported ${o.kind} opportunity (universe ${o.universeSize ?? "?"})`);
36
+ }
37
+ else if (result.status === 0) {
38
+ log("opportunity report outcome unknown (transport failure)");
39
+ }
40
+ else {
41
+ log(`opportunity report received HTTP ${result.status}; delivery unconfirmed`);
42
+ }
27
43
  }
28
- catch (err) {
29
- log(`opportunity post failed: ${err instanceof Error ? err.message : String(err)}`);
44
+ catch {
45
+ report = { opportunity: o, outcome: "unknown", status: 0 };
46
+ // Exceptions and API error bodies may contain private request details.
47
+ log("opportunity report outcome unknown (exception)");
30
48
  }
31
49
  };
32
50
  return {
33
51
  post,
34
52
  get posted() {
35
- return postedOpportunity;
53
+ return report?.outcome === "confirmed" ? report.opportunity : undefined;
54
+ },
55
+ get report() {
56
+ return report;
36
57
  },
37
58
  };
38
59
  }
@@ -866,6 +866,9 @@ async function runCycleCore(deps, capture) {
866
866
  writeAttempted: decision.actions.length,
867
867
  writeAccepted: 0,
868
868
  ...(opportunities.posted ? { opportunity: opportunities.posted } : {}),
869
+ ...(opportunities.report
870
+ ? { opportunityReport: opportunities.report }
871
+ : {}),
869
872
  ...observationReceipt,
870
873
  };
871
874
  }
@@ -1276,6 +1279,9 @@ async function runCycleCore(deps, capture) {
1276
1279
  writeAttempted: decision.actions.length,
1277
1280
  writeAccepted: planned.filter((p) => p.accepted).length,
1278
1281
  ...(opportunities.posted ? { opportunity: opportunities.posted } : {}),
1282
+ ...(opportunities.report
1283
+ ? { opportunityReport: opportunities.report }
1284
+ : {}),
1279
1285
  ...observationReceipt,
1280
1286
  };
1281
1287
  }
@@ -504,6 +504,12 @@ export interface CycleResult {
504
504
  writeAttempted?: number;
505
505
  writeAccepted?: number;
506
506
  opportunity?: PostedOpportunity;
507
+ opportunityReport?: OpportunityReport;
508
+ }
509
+ export interface OpportunityReport {
510
+ opportunity: PostedOpportunity;
511
+ outcome: "confirmed" | "http_error" | "unknown";
512
+ status: number;
507
513
  }
508
514
  export interface PostedOpportunity {
509
515
  kind: "abstained" | "forecast_only" | "quote_expired";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinrithm/mcp-trading",
3
- "version": "0.7.10",
3
+ "version": "0.7.11",
4
4
  "mcpName": "io.github.CoinRithm/mcp-trading",
5
5
  "description": "CoinRithm paper-trading toolkit: an MCP server (coinrithm-mcp) AND a self-host agent runner (coinrithm-agent) for spot, futures, and prediction markets with a user-minted API key.",
6
6
  "type": "module",