feat: add autonomous paper-trading and calibration pipeline

This commit is contained in:
ImBenji
2026-08-03 14:03:27 +01:00
parent 5a9a2e4c6d
commit c4028cc394
46 changed files with 2246 additions and 115 deletions
+14 -1
View File
@@ -6,7 +6,20 @@ let statusCacheAt = 0;
const STATUS_CACHE_TTL_MS = 30 * 1000;
async function statusRoutes(fastify) {
fastify.get('/status', async () => {
fastify.get('/status', async (request) => {
const deep = String(request.query?.deep || '').toLowerCase() === 'true';
if (!deep) {
const sequence = db.prepare("SELECT seq FROM sqlite_sequence WHERE name = 'articles'").get();
return {
total: sequence ? sequence.seq : 0,
usable: null,
lastIngestionBySource: getLastIngestionBySource(),
bySource: null,
embeddingModels: null,
mode: 'lightweight',
deep_status_url: '/status?deep=true',
};
}
const now = Date.now();
if (statusCache && now - statusCacheAt < STATUS_CACHE_TTL_MS) {
return statusCache;