feat: tell the coordinator which instruments it can actually trade
96% of rejected proposals name something untradable: indices (SPX, DXY, ^TNX), fx (EURUSD, XAU/USD), futures (CL=F, BZ=F) and home listings (VOW3.DE, RHM.DE, 1211.HK, 688169.SS). The analysis behind those is usually sound, it is the ticker that cannot be used, and nothing in the prompt ever said so. We were paying for the call and discarding the result at validation. The rules point the model at what the allowlist actually holds: US listings and ADRs for foreign companies, and US listed ETFs as the tradable expression of an index, currency, rate or commodity. Every symbol named in the rules was checked against the live allowlist first, so VWAGY, BABA, TM, SONY, SPY, QQQ, GLD, USO, UUP and TLT all genuinely resolve. It also forbids predicting SPY itself, which is the benchmark and whose excess return is zero by construction. Shared between the coordinator and replay prompts rather than written twice, since a rule that drifts between the two lanes is worse than no rule. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WnNxwxfXSbeNtjvtz5gayb
This commit is contained in:
@@ -5,7 +5,7 @@ const { openRuntimeDb } = require('../src/db/runtime');
|
||||
const { initAutonomySchema } = require('../src/autonomy/schema');
|
||||
const { leaseNextJob, completeJob, failJob } = require('../src/autonomy/jobs');
|
||||
const { callCoordinator } = require('../src/autonomy/llm');
|
||||
const { acceptProposal, recordRejectedProposal } = require('../src/autonomy/coordinator');
|
||||
const { acceptProposal, recordRejectedProposal, INSTRUMENT_RULES } = require('../src/autonomy/coordinator');
|
||||
const { EVENT_FAMILY_NAMES } = require('../src/autonomy/calibration');
|
||||
|
||||
function sleep(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); }
|
||||
@@ -30,7 +30,7 @@ function buildPrompt(event, articles) {
|
||||
causal_channel: '<short description>', horizon_days: '<one of 1, 5, 10, 20, 30, 60, 90>',
|
||||
evidence_article_ids: ['<article_id values from the evidence above>'],
|
||||
invalidation_condition: '<what would falsify this>',
|
||||
}] }, null, 2)}\n\nEvery value in that shape is a placeholder describing the field. Do not copy them. Choose instrument, direction and horizon_days from the evidence in front of you.\n\nevent_type must be exactly one of: ${EVENT_FAMILY_NAMES.join(', ')}. Pick the closest one. Use "other" only when none of them genuinely apply, and never invent a value outside this list.\n\nUse only instruments and evidence directly supported by the articles. Return an empty predictions array when there is no clear, tradable hypothesis. Never include probabilities, returns, confidence, position sizes, or actions.`;
|
||||
}] }, null, 2)}\n\nEvery value in that shape is a placeholder describing the field. Do not copy them. Choose instrument, direction and horizon_days from the evidence in front of you.\n\nevent_type must be exactly one of: ${EVENT_FAMILY_NAMES.join(', ')}. Pick the closest one. Use "other" only when none of them genuinely apply, and never invent a value outside this list.\n\n${INSTRUMENT_RULES}\n\nUse only instruments and evidence directly supported by the articles. Return an empty predictions array when there is no clear, tradable hypothesis. Never include probabilities, returns, confidence, position sizes, or actions.`;
|
||||
}
|
||||
|
||||
async function runCoordinatorWorker({ archivePath, intelligencePath, workerId = `coordinator-${os.hostname()}-${process.pid}`, pollMs = 1000 } = {}) {
|
||||
|
||||
@@ -5,7 +5,7 @@ const { openRuntimeDb } = require('../src/db/runtime');
|
||||
const { initAutonomySchema } = require('../src/autonomy/schema');
|
||||
const { enqueueJob, leaseNextJob, completeJob, failJob } = require('../src/autonomy/jobs');
|
||||
const { callCoordinator } = require('../src/autonomy/llm');
|
||||
const { acceptProposal, recordRejectedProposal } = require('../src/autonomy/coordinator');
|
||||
const { acceptProposal, recordRejectedProposal, INSTRUMENT_RULES } = require('../src/autonomy/coordinator');
|
||||
const { EVENT_FAMILY_NAMES } = require('../src/autonomy/calibration');
|
||||
|
||||
function sleep(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); }
|
||||
@@ -39,6 +39,7 @@ function replayPrompt(article) {
|
||||
}] }, null, 2)}\n\n` +
|
||||
'Every value in that shape is a placeholder describing the field. Do not copy them. Choose instrument, direction and horizon_days from the evidence in front of you.\n\n' +
|
||||
`event_type must be exactly one of: ${EVENT_FAMILY_NAMES.join(', ')}. Pick the closest one. Use "other" only when none of them genuinely apply, and never invent a value outside this list.\n\n` +
|
||||
`${INSTRUMENT_RULES}\n\n` +
|
||||
'Use only this dated evidence. Return an empty predictions array when there is no clear, tradable hypothesis. Never include probabilities, returns, confidence, position sizes, or actions.';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user