Skip to guide
OpenGrail.xyz
DIRECTION-MATCHED V2

Compare programs in one direction.

Freeze the method, retain every TRAIN result, lock selection, then consume one separate TEST.

Local method · hosted availability unverifiedAUTHOR_REPORTED · qualification NONE · no financial execution.

Choose the method before freezing

DIRECTION_MATCHED_TRAIN_RETURN_V1 selects by cost-aware account return within one exact direction, market, cost, risk and capital protocol. Failed, no-trade, interrupted or mismatching candidates stay visible and ineligible. The original SHORT noncomparability flag and LONG baseline remain intact. No cross-direction, benchmark-outperformance or live-performance rank is inferred.

The whole reference trading result accompanies the full original and fresh program evidence. First-party agreement does not establish independent operators. Virtual SHORT exposure does not model borrowing, funding or a broker's asset availability.

Retain, reconstruct and continue

node scripts/program-direction-search.mjs freeze /private/run/admission.json /private/run/new-ledger.json
node scripts/program-direction-search.mjs train /private/run/new-ledger.json
# Repeat once per remaining frozen TRAIN candidate.
node scripts/program-direction-search.mjs lock /private/run/new-ledger.json
node scripts/program-direction-search.mjs test /private/run/test-input.json /private/run/new-ledger.json
node scripts/program-direction-search.mjs verify /private/run/new-ledger.json
node scripts/program-direction-search.mjs reconstruct /private/run/new-ledger.json /private/run/new-reconstruction.json

Use canonical absolute mode-0600 files outside the reviewed checkout, its existing Node dependencies, Python 3 and Linux /proc/self/fd. Admission and full terminal evidence must be confirmed before advancing. Reconstruction retains all original/fresh results and never runs pending work or replaces TEST.

Local limits: 32 MiB per complete attempt, 164 MiB per complete ledger and one TEST. Oversize evidence is refused intact.

Carry the whole terminal handoff into V2 Plans and Programs Session. Plan import starts no guest, provider or public write. Public forward caps and truthful review blockers remain unchanged.

Complete invented input files

This is a newly declared four-bar stateful SHORT exercise. Its authors, sources and prices are invented. Save the admission first; supply the separate TEST only after selection is locked. Legacy ledgers are never upgraded into this method.

ADMISSION.json
{
  "version": 2,
  "kind": "LOCAL_PROGRAM_DIRECTION_SEARCH_ADMISSION",
  "method": "DIRECTION_MATCHED_TRAIN_RETURN_V1",
  "id": "a3500000-0000-4000-8000-000000000001",
  "createdAt": "2025-02-01T04:00:00.000Z",
  "candidates": [
    {
      "source": {
        "id": "a3500000-0000-4000-8000-000000000010",
        "digest": "3de596d73262aee1705dc127705f313ea8d42719184b3315ed9aead2512a7d67",
        "rootId": "a3500000-0000-4000-8000-000000000010",
        "revision": 1,
        "requestId": "a3500000-0000-4000-8000-000000000020",
        "createdAt": "2025-02-01T00:00:00.000Z",
        "author": {
          "kind": "HUMAN",
          "id": "human_0000000000000000000000000000000000000000000000000000000000000000",
          "sponsorId": "human_0000000000000000000000000000000000000000000000000000000000000000"
        },
        "state": "VISIBLE",
        "reason": null,
        "record": {
          "version": 2,
          "id": "a3500000-0000-4000-8000-000000000010",
          "rootId": "a3500000-0000-4000-8000-000000000010",
          "revision": 1,
          "requestId": "a3500000-0000-4000-8000-000000000020",
          "createdAt": "2025-02-01T00:00:00.000Z",
          "author": {
            "kind": "HUMAN",
            "id": "human_0000000000000000000000000000000000000000000000000000000000000000",
            "sponsorId": "human_0000000000000000000000000000000000000000000000000000000000000000"
          },
          "content": {
            "name": "Invented SHORT",
            "description": "Four invented bars.",
            "assumptions": "Stateful; no edge.",
            "falsification": "Reject edge claims.",
            "sources": [],
            "definition": {
              "schemaVersion": 1,
              "market": {
                "symbol": "BTC/USD",
                "timeframe": "1h",
                "direction": "SHORT"
              },
              "entry": {
                "type": "SIGNAL",
                "provider": "CUSTOM",
                "event": "BEARISH",
                "maxAgeBars": 1
              },
              "risk": {
                "positionPct": 10,
                "maxOpenPositions": 1,
                "stopLossPct": 2,
                "takeProfitPct": 4,
                "maxDailyLossPct": 5
              },
              "costs": {
                "feeBps": 10,
                "slippageBps": 10
              },
              "execution": {
                "mode": "DEMO",
                "leverage": 1,
                "ordersEnabled": false
              }
            },
            "relation": null,
            "program": {
              "profile": "opengrail-wasm-i32-f64-v1",
              "abi": "opengrail-causal-signal-wasm-v1",
              "bytesHex": "0061736d0100000001110260077f7c7c7c7c7c7c017f60027f7c0003030200010619027c014400000000000000000b7c014400000000000000000b071602066f6e5f626172000009636f6e66696775726500010a3c023301017f200045047f410005200523002301a064047f410105200523002301a163047f41020541000b0b0b21072005240020070b0600200124010b",
              "digest": "dd7cc623cb0b52bde512d203a8cfd3b2128cc3ee576baed842c45f49dc41134b",
              "parameters": [
                0.1
              ]
            }
          },
          "policyAccepted": "public-strategy-v1",
          "verification": "UNTESTED",
          "executionEnabled": false
        },
        "moderation": []
      },
      "attemptId": "a3500000-0000-4000-8000-000000000040",
      "requestId": "a3500000-0000-4000-8000-000000000050"
    },
    {
      "source": {
        "id": "a3500000-0000-4000-8000-000000000011",
        "digest": "f647bd37bcc08242269171baaab2bab23e2099d6376e36931ec1b39893c541fd",
        "rootId": "a3500000-0000-4000-8000-000000000011",
        "revision": 1,
        "requestId": "a3500000-0000-4000-8000-000000000021",
        "createdAt": "2025-02-01T00:00:00.000Z",
        "author": {
          "kind": "HUMAN",
          "id": "human_0000000000000000000000000000000000000000000000000000000000000000",
          "sponsorId": "human_0000000000000000000000000000000000000000000000000000000000000000"
        },
        "state": "VISIBLE",
        "reason": null,
        "record": {
          "version": 2,
          "id": "a3500000-0000-4000-8000-000000000011",
          "rootId": "a3500000-0000-4000-8000-000000000011",
          "revision": 1,
          "requestId": "a3500000-0000-4000-8000-000000000021",
          "createdAt": "2025-02-01T00:00:00.000Z",
          "author": {
            "kind": "HUMAN",
            "id": "human_0000000000000000000000000000000000000000000000000000000000000000",
            "sponsorId": "human_0000000000000000000000000000000000000000000000000000000000000000"
          },
          "content": {
            "name": "Silent SHORT",
            "description": "Four invented bars.",
            "assumptions": "Stateful; no edge.",
            "falsification": "Reject edge claims.",
            "sources": [],
            "definition": {
              "schemaVersion": 1,
              "market": {
                "symbol": "BTC/USD",
                "timeframe": "1h",
                "direction": "SHORT"
              },
              "entry": {
                "type": "SIGNAL",
                "provider": "CUSTOM",
                "event": "BEARISH",
                "maxAgeBars": 1
              },
              "risk": {
                "positionPct": 10,
                "maxOpenPositions": 1,
                "stopLossPct": 2,
                "takeProfitPct": 4,
                "maxDailyLossPct": 5
              },
              "costs": {
                "feeBps": 10,
                "slippageBps": 10
              },
              "execution": {
                "mode": "DEMO",
                "leverage": 1,
                "ordersEnabled": false
              }
            },
            "relation": null,
            "program": {
              "profile": "opengrail-wasm-i32-f64-v1",
              "abi": "opengrail-causal-signal-wasm-v1",
              "bytesHex": "0061736d01000000010c0160077f7c7c7c7c7c7c017f03020100070a01066f6e5f62617200000a0601040041000b",
              "digest": "d57ab3d2a830c5eb861d85119340d1b4705a7019c40b5a223f02a537f1b8c2bb",
              "parameters": []
            }
          },
          "policyAccepted": "public-strategy-v1",
          "verification": "UNTESTED",
          "executionEnabled": false
        },
        "moderation": []
      },
      "attemptId": "a3500000-0000-4000-8000-000000000041",
      "requestId": "a3500000-0000-4000-8000-000000000051"
    }
  ],
  "train": {
    "dataset": {
      "version": 1,
      "id": "a3500000-0000-4000-8000-000000000030",
      "provenance": "SYNTHETIC",
      "rights": {
        "permission": "CREATED_SYNTHETIC",
        "acknowledged": true,
        "note": "Created synthetic data."
      },
      "symbol": "BTC/USD",
      "timeframe": "1h",
      "bars": [
        {
          "closedAt": "2025-02-01T01:00:00.000Z",
          "open": 100,
          "close": 100,
          "high": 100.1,
          "low": 99.9,
          "volume": 1000
        },
        {
          "closedAt": "2025-02-01T02:00:00.000Z",
          "open": 99,
          "close": 99,
          "high": 99.09899999999999,
          "low": 98.901,
          "volume": 1000
        },
        {
          "closedAt": "2025-02-01T03:00:00.000Z",
          "open": 98,
          "close": 98,
          "high": 98.09799999999998,
          "low": 97.902,
          "volume": 1000
        },
        {
          "closedAt": "2025-02-01T04:00:00.000Z",
          "open": 94,
          "close": 94,
          "high": 94.094,
          "low": 93.906,
          "volume": 1000
        }
      ]
    }
  },
  "test": {
    "datasetId": "a3500000-0000-4000-8000-000000000031",
    "firstClosedAt": "2025-02-01T07:00:00.000Z",
    "barCount": 4,
    "gapBars": 2,
    "provenance": "SYNTHETIC",
    "permission": "CREATED_SYNTHETIC",
    "attemptId": "a3500000-0000-4000-8000-000000000060",
    "requestId": "a3500000-0000-4000-8000-000000000061"
  },
  "initialCapital": 1000,
  "hypothesis": "Test SHORT.",
  "falsification": "Reject missing trials.",
  "selection": {
    "objective": "MAX_RETURN_PCT",
    "minTrades": 1,
    "maxDrawdownPct": 5,
    "minReturnPct": 0,
    "tieTolerancePct": 1e-8,
    "tieBreak": "CANDIDATE_ORDER"
  }
}
TEST_INPUT.json
{
  "dataset": {
    "version": 1,
    "id": "a3500000-0000-4000-8000-000000000031",
    "provenance": "SYNTHETIC",
    "rights": {
      "permission": "CREATED_SYNTHETIC",
      "acknowledged": true,
      "note": "Created synthetic data."
    },
    "symbol": "BTC/USD",
    "timeframe": "1h",
    "bars": [
      {
        "closedAt": "2025-02-01T07:00:00.000Z",
        "open": 100,
        "close": 100,
        "high": 100.1,
        "low": 99.9,
        "volume": 1000
      },
      {
        "closedAt": "2025-02-01T08:00:00.000Z",
        "open": 99,
        "close": 99,
        "high": 99.09899999999999,
        "low": 98.901,
        "volume": 1000
      },
      {
        "closedAt": "2025-02-01T09:00:00.000Z",
        "open": 102,
        "close": 102,
        "high": 102.10199999999999,
        "low": 101.898,
        "volume": 1000
      },
      {
        "closedAt": "2025-02-01T10:00:00.000Z",
        "open": 105,
        "close": 105,
        "high": 105.10499999999999,
        "low": 104.895,
        "volume": 1000
      }
    ]
  }
}