News is the first input of Phase 7. Every two minutes the "notizie" job asks each
enabled feed conditionally and backs off a failing one up to an hour.
- Parsing: RSS 2.0, RSS 1.0 and Atom are read without DTDs or entity expansion, so a
hostile feed reads nothing from disk.
- Deduplication: articles are deduplicated by canonical URL.
- Grouping: retold titles join one story by word similarity within 48 hours, and
independent publishers are counted by registrable domain.
- Linking: stories are linked to instruments by source symbols, cashtags, exchange
tickers, coin tickers and capitalised company names; to the crypto or equity class
or to the market by theme; to the source topic as a fallback.
ADR 0014 records the thresholds. The tests read a synthetic archive in each source's
real format and run on both engines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 3 needs books the bot can trust before any strategy trades. This adds:
- schema 0003: executions, order events, trades, residues, account status,
reconciliations, capital changes, applied corporate actions, simulator books;
- the broker interface with the internal simulator and the Alpaca paper and
OKX demo adapters, all behind the live guard (SPEC 2.2);
- the append-only ledger with lots, trades from zero to zero, residues,
dividends, splits and reversals; capital entrusted per broker and equity
photographs with time-weighted return and FX effect;
- the order manager (chasing limit, pacing, sells never abandoned, server
stops, breached-stop rule) and the reconciler with prudent mode;
- the trading service wired into the host, off in demo mode and in tests.
Ids made with one clock in the same millisecond now carry a counter (RFC 9562
method 1): two lots of one order kept a random order, which broke LIFO.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Migration 0002 adds the market data tables on both engines: daily and
one-minute bars, corporate actions, FX rates, the exchange calendar,
calendar events, mood indicators, spread samples, data issues, source
state and universe members, plus the trading rules on instruments.
The data layer is format-independent so the venue clients can build on
it: the instrument catalogue (rules from the venue, delisted kept), bar
upserts with ON CONFLICT, the SPEC 6.4 checks with an issue register
that blocks entries until a second reading, freshness by age of the last
datum (trap 10), research history in .csv.gz with exact decimals, and
adjusted series anchored at the decision day with level and quantity
conversion across splits and dividends.
Recorded API responses from OKX, the Alpaca docs and the free sources
are kept byte for byte as test fixtures; the secret scan now ignores
pagination cursors such as Alpaca's next_page_token.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>