Spaces:
Sleeping
Sleeping
Commit History
-
fix: retrospective agent evaluated wrong month and crashed; persist its analysis to Reports tab
Bibhu Mishra +1: Claude Sonnet 5The retrospective always evaluated (current month - 1), so when trading went live mid-June it kept evaluating an empty May instead of June where the real trades were, silently skipping strategy tuning. Now falls back to the current in-progress month when trading started after the naive previous month. Also fixes a MultipleResultsFound crash once a month has more than one portfolio snapshot, and a "^SPY" ticker typo (the caret prefix is for indices, not the SPY ETF) that made get_spy_monthly_return always return None. Also adds a retrospective_reports table + /retrospective-reports API + a "Monthly Retrospective" tab on the Reports page, so the pattern analysis, tuning rationale, and PDF that the agent already produces are persisted and visible in the UI instead of living only inside the PDF and the raw run log. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>a381fc9
-
fix: replace @nestjs/schedule with node-cron to fix HF startup crash
Bibhu Mishra +1: Claude Sonnet 4.6@nestjs/schedule caused npm to hoist @nestjs/core and @nestjs/common to root node_modules, while @nestjs/platform-express stayed in api/node_modules. Root @nestjs/core could not resolve @nestjs/platform-express, causing 'No driver (HTTP) has been selected' on startup and process.exit(1). Switch to node-cron (no @nestjs peer deps) via OnModuleInit. Restore the package-lock.json @nestjs layout to api/node_modules only. Remove ScheduleModule.forRoot() from AppModule. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>e182237 -
feat: add NestJS in-process scheduler to replace unreliable GitHub cron
Bibhu Mishra +1: Claude Sonnet 4.6GitHub Actions scheduled workflows were firing hours late or not at all. This adds @nestjs/schedule with four @Cron jobs inside the NestJS process (which stays live via the keepalive workflow) to dispatch the same workflow_dispatch calls at the correct UTC times: - Market Analyst: 13:30 UTC Mon-Fri - Paper Trader: 14:30, 17:00, 19:45 UTC Mon-Fri Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>fd6fef0
-
fix: PDF proxy, 0-qty positions, portfolio chart dedup, SQLite UTC dates
Bibhu Mishra +1: Claude Sonnet 4.6- PDF: remove partial select in getPdfPath (TypeORM select:{} quirk returned null even when row exists); fall back to GH_TOKEN env var in addition to GITHUB_TOKEN so HuggingFace secret naming doesn't matter - Positions: filter quantity > 0 in portfolio service so 0-qty open positions are hidden from dashboard and the open-positions table - Portfolio chart: deduplicate snapshots to one per calendar day (last value wins) to avoid repeated X labels and a cluttered line; rotate labels when many days; proper $ formatter on Y axis - SQLite dates: add SqliteDateSubscriber that undoes the local-timezone shift Node applies when parsing bare "YYYY-MM-DD HH:MM:SS" strings, so local dev times match the PostgreSQL pg-type-parser fix in production Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>73e0e3c -
fix: correct UTC timestamp parsing — pg treated bare timestamps as local time
Bibhu Mishra +1: Claude Sonnet 4.6Root cause: PostgreSQL's pg driver returns TIMESTAMP WITHOUT TIME ZONE (OID 1114) as a bare string like "2026-06-19 14:45:00" with no timezone indicator. Node's Date constructor then treated it as *local* time, baking the server's TZ offset into the JSON before the browser saw it. A CDT user would see "02:45 PM" instead of "9:45 AM" for a value stored as 14:45 UTC. Fix: register pg type parsers in app.module.ts that append 'Z' before constructing the Date, so timestamps are always interpreted as UTC. Also tighten format.ts to use the same normalisation as a defence-in-depth for the local SQLite dev path and any remaining edge cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b2f5bb7
-
Replace ServeStaticModule with plain Express middleware for SPA routing
Bibhu Mishra +1: Claude Sonnet 4.6@nestjs/serve-static v5 has incompatible wildcard syntax issues with Express 5 / path-to-regexp v8 (/* and /{*path} both cause errors). Instead, serve static files with express.static() before NestJS routes, then add a catch-all Express handler after app.init() that serves index.html for any request not handled by API routes or static files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>eda9962 -
Fix ServeStaticModule renderPath for Express 5 / path-to-regexp v8
Bibhu Mishra +1: Claude Sonnet 4.6path-to-regexp v8 rejects unnamed wildcards (/* is invalid). Use /{*path} which is the Express 5 named-wildcard syntax. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>34d7c8b -
Fix SPA refresh 500 and agent trigger error handling
Bibhu Mishra +1: Claude Sonnet 4.6- ServeStaticModule: fix exclude pattern from glob '/api*' to path-to-regexp '/api/(.*)' and add renderPath '/*' for SPA fallback; v5 uses path-to-regexp so the old glob was silently not matching - Agent trigger: throw InternalServerErrorException instead of returning 200 with error message when GITHUB_TOKEN is missing or dispatch fails - AdminView: surface the server error message in the error toast Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>6bc99c7 -
Add GitHub Actions CI/CD, HF Space deployment, market hours guard, and static serving
Bibhu Mishra +1: Claude Sonnet 4.6- Dockerfile (multi-stage Node build, port 7860 for HuggingFace) - .github/workflows/deploy-hf.yml — force-push to HF Space on every main push - .github/workflows/market_analyst.yml — cron 9:30 AM CST Mon–Fri + workflow_dispatch - .github/workflows/paper_trader.yml — crons 10 AM / 12 PM / 2:45 PM CST Mon–Fri - .github/workflows/retrospective.yml — cron Mon 5 AM UTC (Sun 11 PM CST), no market gate - agents/core/market_hours.py — check_or_exit() exits cleanly when market is closed; FORCE_RUN=true bypasses (set automatically on workflow_dispatch from admin) - Market Analyst and Paper Trader call check_or_exit() at startup - api/src/app.module.ts — ServeStaticModule serves ui/dist when present (production) - api/src/main.ts — add HuggingFace Space origin to CORS - api/src/agent-runs/agent-runs.service.ts — trigger() now dispatches GitHub Actions workflow_dispatch with force=true instead of spawning local shell scripts - ui/src/views/AdminView.vue — live market-hours banner + market tag…abc493d