Changelog¶
All notable changes are documented here, following Keep a Changelog and Semantic Versioning.
Unreleased¶
Changed¶
- Importing
financial_agent.trading.config.configno longer scrapes Wikipedia and Yahoo for a live S&P 500 top 100.SP500_100_TICKERandSP500_20_TICKERare now always the 10-name fallback list that the savedLSTM_predictionandrl_portfolio_trading_phase2outputs show. Callingget_sp500_top_n_by_marketcap(100)still fetches a live ranking; it needslxml, which therlextra installs. - The RL examples moved from
example/rl/toexamples/rl/.
Removed¶
- Unused names from the historical
financial_agent.tradingpackage, which the wheel ships. Nothing in the repository or its notebooks referenced them:DEFAULT_DATA_COLUMNSand every ticker list inconfig.configexceptSP500_100_TICKERandSP500_20_TICKER;backtest.convert_daily_return_to_pyfolio_tsandbacktest.trx_plot;preprocessing.data.load_datasetandconvert_to_datetime;YahooDownloader.select_equal_rows_stock; andconfigure_mixed_precision,get_optimal_batch_size,create_device_aware_modelandtrain_on_deviceinutils.gpu_config. - The unreferenced
pure_prompt_coding/archive from March 2026. Its two prompt runs are byte-identical copies of the ones kept inagents/equity/output; the archive, with its two notes files, remains in git history. - The unused environments
env.env_portfolio,env.env_stocktrading_cashpenaltyandenv.env_stocktrading_stoploss,model.models.DRLEnsembleAgent, theautotrainpackage,utils.main,utils.setup_gpu_for_notebooksandconfig.config.DOW_30_TICKERleftfinancial_agent.trading. The autotraintrain_onewas broken;utils.mainwas its only caller, and only those two usedDOW_30_TICKER. - The unused
financial_agent.dlpackage (theBaselinemodel andWindowGenerator) no longer ships in the wheel. Nothing in the repository or its notebooks imported it. Thedlextra still installs TensorFlow for the LSTM notebook.
Fixed¶
- Run by hand, as
rules.mdtells every daily run to,settlement_ledger.pyleaves out a package whoserun_dateis present but not a string, such as20260902,nullorNaN, as REFLECTION does. It used to raiseTypeErroron most such packages and keep the rest in the manifest. Its effective-sample-size projection no longer raisesOverflowErrorwhen the last target date it selected is less than one 28-day horizon before 9999-12-31; it reports no next window (next_window_opensandeff_n_increments_onarenull). kernel equityand the MCPbuild_equity_recordstool refuse a name with nokelly_rawwhosesigmasquares to 0.0 (1e-200) or overflows (1e200), with aKernelErrornaming thesigma(KERNEL ERROR: KernelError: sigma 1e-200 out of range: ...), since it has nomu / sigma^2Kelly fallback; the command used to stop with aZeroDivisionErrororOverflowErrortraceback and the tool answered with JSON-RPC error -32603. The market calendar reports a date with no trading day on or before it,0001-01-01, as aValueError(no trading day on or before 0001-01-01) instead of raisingOverflowError: the MCPsessiontool answers with an error result instead of -32603, andrun --date 0001-01-01halts at PRECHECK with that reason instead ofPRECHECK handler failed: OverflowError: date value out of range.sessionprints oneSESSION ERROR: ValueError: ...line and exits 1 for that date and for one it cannot parse, such as2026-13-01, where it used to print a traceback.- The MCP
schema_checktool answers a15_predictions.jsonnested too deeply to parse with an error result,ToolError: 15_predictions.json: not valid JSON: maximum recursion depth exceeded ..., as it answers other ledgers it cannot parse, such as{not json, one that is not UTF-8 or one holding a 5000-digit integer. It used to answer with JSON-RPC error -32603 (RecursionError). - A wrongly typed field in an earlier package no longer halts
runat REFLECTION (REFLECTION handler failed: TypeError: ...orValueError: ...); until someone fixed that package, every later run halted the same way. REFLECTION leaves out an earlier package whoserun_dateis present but not a string, such as20260903,nullorNaN. The settlement ledger skips a prediction or settlement row whosemodel,ticker,typeortarget_date, or a prediction'srun_date, is not a string once the package'smodelandrun_dateand theEQUITY_ALPHAdefault apply, as it already skipped a row with noticker. Such a row used to raise, or to be kept under that value; now it counts nowhere: not in the due inventory, the canonical or rejected settlements, or the conflicts, so two such rows that disagree no longer halt REFLECTION as a conflict. A list or objectmodelno longer breaks duplicate-book detection, a numericsettle_price_dateisMALFORMEDlike any other price date that is not a date, and the effective-sample-size projection skips a predictiontarget_datethe calendar has no day for, such as2026-02-30. - Schema v1 no longer raises
TypeError: unhashable typeon a15_predictions.jsonwhoseregimeis a list or an object, such as["BULL"], and that holds a SPYMARKET_FORECASTrecord. It reports that regime as not one of the policy's regimes, as it does a string such as"SIDEWAYS", so a v1 ledger holding one fails the publish gate.gate,gate --json,manifestandschemaused to stop with that traceback, and the MCPgate,manifestandschema_checktools answered with the error instead of a result. - The harness no longer crashes on these extreme numbers and dates in a
15_predictions.json. An integer too large for a float, such as a 401-digitmu, counts as not a number, like a non-numeric string, in the audit, the publish gate, the status replay and the settlement ledger; schema v1 also reports it (is not number) in the number fields it only shape-checked, such asentry_priceandsettle_price, so a v1 ledger holding one there now fails the gate. Asigmawhose square underflows to 0.0 (1e-200) or overflows (1e200) has nomu / sigma^2Kelly fallback: the audit skips onlylineage.kelly_raw_method, schema v1 only thekelly_rawcheck of aMU_OVER_SIGMA2record, and the replay's fallback Kelly gate is unsettleable, as for asigmaof 0. A beta-scaled ETFmuprior too large for a float, alone or plusmu_adjustment, is a v1 finding. Arun_datethe market calendar cannot place (0001-01-01) makes the replay fall back to the package name's date; a settlement row whosetarget_datehas no earlier close (0001-01-01,0001-01-02) isMALFORMED, and aTARGET_DATE_CLOSErow whosesettled_atcannot be shown in New York time is invalid.gate,gate --json,manifest,schema,auditandreplayused to stop withOverflowErrororZeroDivisionError, and the MCPgate,manifest,schema_checkandreplay_historytools answered with JSON-RPC error -32603. When an earlier package held such an int or settlement row,runhalted at REFLECTION (REFLECTION handler failed: OverflowError: ...), and when its own package held such a number it raised from the publish gate. - The wheel and sdist now include
financial_agent.trading.env. A virtual-environment rule in.gitignore(env/) kept it out of every build, so an installedfa-quantcould not importtrading.env.env_stocktrading. KILL,risk_state.jsonand each session report's.jsonfile are now also fsynced to their directory where the filesystem allows, and none of these writes, norpaper.json's, fails any more after the file is in place.- A malformed
15_predictions.jsonno longer crashes the harness. A ledger that is not valid JSON, has nopredictionslist, or holds a prediction or settlement row that is not an object fails the publish gate with a message ingate,gate --json, the MCPgatetool andrun.auditreports it as onepackage.ledgererror andreplayskips it, where both used to stop, andmanifestandschemasay it cannot be read. A list or object where a field expects one value is now an ordinary gate failure or audit finding instead of aTypeError. An object ledger without apredictionslist is reported or skipped like any unreadable one, instead of being audited and replayed as empty. - The market-data cache raises a data error naming the symbol and field when the
metadata record of a symbol it is fetching is missing a field the cache needs for
it or holds a coverage date that is not an ISO date. It used to fail with an
uncaught
KeyError,TypeErrororValueError. Records the cache already refetched, such as one written by another provider, are still refetched. A retrieval time outside the range that converts to New York time now counts as unreadable, so the last bar is fetched again instead of raisingOverflowError. examples/rl/run_all_examples.pycounts only the examples that exit 0, and exits with status 1 when any of them fails or the run is interrupted. It used to report4/4 examples completed successfullyand exit 0 even when an example failed.fundamental_diagnostics.pyandsentiment_diagnostics.pyupper-case, trim and comma-split--tickersvalues like--tickers-filelines, and drop empty ones.--tickers aaplused to find no SEC CIK mapping,--tickers SPY,QQQstayed one ticker, and--tickers ""ran with an empty ticker instead of reporting none.- Both MCP servers answer a request containing
NaN,Infinityor-Infinity, which are not JSON, or a number too large for a float such as1e999, with the same parse error as any other malformed line and keep serving.fa-quant mcpused to exit witherror: ValueError, andpython -m financial_agent.harness mcpechoed the value back as non-JSON. - The quant MCP tools default
todayto the current New York date, asfa-quant rundoes, instead of the host's local date. On a host whose date differs from New York's,quant_preview_orderswithouttodayused to plan the wrong session; ahead of New York it planned off an unfinished close and failed its freshness gate. AlpacaBrokerrejects amax_retriesthat is not an integer, such as1.5orTrue, withValueErrorat construction, asIBKRBrokerdoes. A fractional count used to be accepted and fail the first request withTypeError.fa-quant run --dry-runstill reports a dry run when another session holds the lock. The halted report used to say"dry_run": falseandDry run: False, and list its orders underOrdersinstead ofPlanned orders.- A
KILLfile written mid-session now stops the remaining orders: each submission loop checks the kill switch before every order and halts. Orders already submitted stay submitted and journalled; kill still cancels nothing. fa-quant killengages the stop even while a session is running. It used to fail withSessionLockedand write noKILLfile. If the session lock is held the journal entry is skipped and the command says so.- The NYSE calendar no longer closes on the Friday before a Saturday January 1, so 2021-12-31 and 2027-12-31 are trading days; a Sunday January 1 is still observed on Monday.
- Yahoo downloads retry four times over about 30 seconds (2 s backoff, doubling)
instead of twice over 1.5 seconds. A scheduled session that starts just after
the host wakes no longer halts because DNS is not resolving yet. The 2026-10-30
paper session halted that way. Callers can still pass
retriesandbackoff. - The launchd template runs the session wrapper under
/usr/bin/caffeinate -i, so the Mac doesn't idle-sleep in the middle of a session. The operations guide says to keep a laptop host on power. - The live gate rejects a certificate whose
policy_sha256differs from the packaged policy file, socertify --policywith looser thresholds can no longer authorize live. - A paper
session_outcomecounts as live evidence only when its journal timestamp falls on that session's New York date, so replayingrun --today <old date>adds no sessions. - The paper-slippage allowance caps the config's half-spread and slippage at the packaged
CostModeldefaults, so inflating[backtest.costs]can no longer loosen it. - The market-data cache refetches a last bar retrieved on or before its session's New York date, or with no readable retrieval time. A bar cached while the market was open used to be served for that end date forever, so the next session could decide on an intraday price.
- The market-data cache fetches a symbol again in full when its cached bars came
from another provider. A cache filled by
--provider csvused to be served for--provider yahoowithout contacting Yahoo, labelledcsv. - A same-day rerun of a broker-backed session after the opening auction filled no longer halts. The next session journals those fills against their session's open.
1.3.0 - 2026-10-28¶
Fixed¶
- Research CLI commands honor
--provider yahoowhen--csv-diris also set. - Non-object cache metadata raises a data error instead of an uncaught attribute error.
Added¶
- A documentation site at https://bichengwang.github.io/financial-agent/, built
with MkDocs Material and deployed from
mainby the Pages workflow: on push, and within 30 minutes of an auto-merge, whoseGITHUB_TOKENpush starts no workflows. It serves the README,docs/(quant guides, releasing, equity research reports), the quant evidence reports and this changelog. Repository links that aren't site pages open on GitHub. Pull requests that touch these files run a strict build. Preview locally withuv run --only-group docs mkdocs serve. - Two agent skills for the quant platform, discoverable through
.agents/skills/:quant-strategy-research(backtest, validate and certify a strategy, read the eight promotion checks, write dated evidence) andquant-paper-operations(dry-run and scheduled paper sessions, status and live readiness, and the kill/unkill incident runbook). Neither can enable live trading. - Contributor and security docs:
CONTRIBUTING.md(setup, checks, quant and pull request rules),SECURITY.md(private vulnerability reporting, now enabled),CODE_OF_CONDUCT.md, issue forms for bugs and features, and a pull request template. The README shows CI, PyPI, Python, docs and license badges. [promotion] disclosed_trialslists every variant tried when the certified grid is narrower, e.g. one frozen identity. DSR then deflates by all of them: their count and the variance of their full-period Sharpes on the certified data. The certificate recordsn_trialsandtrial_sharpe_variancein its diagnostics; certificates without a disclosure are unchanged. The disclosure must list each grid variant once.evaluate_promotiontakes it as the keyworddisclosed_trials.
Changed¶
- The
Documentationproject URL and the README link to the site. - The Alpaca and IBKR example configs freeze the certified identity
(
target_vol=0.12, max_weight=0.25): it is the configured strategy and the only grid variant, with the four searched variants disclosed. A re-certification can no longer switch parameters and restart paper evidence. Pass the four-variant--gridto rerun the original search. - The README opens with the current paper-to-live status, installs from PyPI, compares the four-variant and frozen-identity gate results, lists the live gate's conditions and documents the scheduler wrapper.
- Saved notebooks shrank from 10.9 MB to 3.1 MB without re-execution: training logs keep their first and last 40 lines, very long printed lines are clipped, and plots are 256-colour PNGs. Each cut is marked in the output.
- GitHub language statistics exclude
.ipynbfiles (linguist-documentation), so the repository reports as Python rather than Jupyter Notebook. - The notebooks README lists each notebook and how to run it.
Removed¶
- Six research notebooks: the three AI4Finance FinRL tutorial copies in
archive/, the upstreamCrypto_Binance_Historical_Datatutorial, andmultistock_variant_2andthis_works_1_18, which largely duplicatemultistock_docker. They remain in git history.
1.2.1 - 2026-10-20¶
Added¶
- The Release workflow can publish to PyPI through trusted publishing once the
PYPI_PUBLISHrepository variable istrue. Manual dispatch rehearses the upload on TestPyPI. Pull requests and releases runtwine check --strict. Seedocs/releasing.md.
Changed¶
- The distribution is renamed
fa-quant, becausefinancial-agenton PyPI is an unrelated project. Thefinancial_agentimport package (declared as PEP 794import-names) and thefa-quantcommand are unchanged. Certificates and MCP report thefa-quantversion. Runuv syncafter pulling. - Packaging uses the SPDX license expression
MIT. The sdist holds only what building the wheel needs (31.7 MB to 0.2 MB). The PyPI description links to the tagged repository files.
1.2.0 - 2026-10-19¶
Added¶
fa-quant statusshows live readiness for Alpaca and IBKR paper configs: clean sessions, halts and breaks in the evidence window, mean and per-fill slippage against the allowance, certificate verdict, identity match, age and expiry, and every unmet reason. It reads only the journal and certificate, makes no broker call and grants nothing.deploy/quant/run-session.py, a stdlib-only scheduler wrapper. It loads credentials from a chmod 600 env file (refused when a symlink, group/other-accessible or not user-owned), runsfa-quant run --json, passes output and the exit code through (128 + N after signal N), and on a non-zero exit posts one sanitized JSON alert (status, session, reasons) toFA_QUANT_ALERT_WEBHOOKwhen set. The launchd, cron and systemd templates call it; the launchd template gives a Pacific-host example (Hour=5,Minute=45) and thepmsetwake command.
Changed¶
live_readiness(config, *, now)holds the certificate and paper-evidence evaluation;authorize_liveadds theFA_QUANT_ALLOW_LIVEopt-in and the grant. Thresholds and reasons are unchanged.
1.1.1 - 2026-10-19¶
Fixed¶
- Broker-backed (Alpaca, IBKR) sessions submit opening-auction orders only when
the New York date equals the session date and the time is before the packaged
09:25 ET
[execution] opening_auction_cutoff. The check runs before journaling submission intents and before every submission, including interrupted-submission recovery; otherwise the session halts with the observed time. Late or replayed runs can no longer queue orders for a later auction. Local paper and the demo are unchanged. fa-quant run --todaydefaults to the current New York date instead of the host-local date.- CHANGELOG link references cover every release.
Changed¶
run_sessionacceptsnow, an injectable clock returning timezone-aware datetimes. Adding the policy section changesquant_policy.tomlbytes, so new certificates record a differentpolicy_sha256; thresholds are unchanged and existing certificates still verify.
1.1.0 - 2026-10-13¶
Added¶
- IBKR Client Portal Gateway execution with guarded paper/live accounts, USD portfolio observation, whole-share opening-auction orders, contract resolution, precaution allow-lists, order recovery and gateway operations guidance.
Changed¶
- Public broker
lookup(client_order_id)supports runner recovery across adapters. - Live evidence must come from the same broker as the live configuration; local simulation never authorizes live execution.
Fixed¶
- Finalize broker-backed opening-auction intents after observing their auction session, preventing vanished zero-fill or partial orders from halting later runs. Reconciliation still halts on unreported fills.
- Validate IBKR account metadata once per adapter and cache authentication status for 60 seconds, refreshing immediately after HTTP 401, to reduce gateway pacing delays without bypassing live guards.
1.0.1 - 2026-10-13¶
Fixed¶
- Wheel installations can run trading sessions and the offline demo outside a
source checkout without failing with
FileNotFoundErrorfor missing helper scripts.
1.0.0 - 2026-10-13¶
Added¶
- Risk-managed systematic ETF platform with binding strategy/data/broker contracts and research → certify → paper → live delivery plan (#91).
- Adjusted Yahoo/CSV data, incremental revision-aware cache, quality checks and deterministic synthetic fixtures (#92).
- Cost-aware, next-bar portfolio backtesting, shared weight-to-share sizing, trend/volatility targeting, dual momentum and fixed-weight benchmarks (#93).
- Tighten-only pre-trade limits, account loss/drawdown state and persistent operator-released kill switch (#94).
- Embargoed walk-forward validation, DSR, CSCV/PBO diagnostics, bootstrap, execution stress, policy gates and hashed certificates (#95).
- Dated research-forecast adapter and honest failing short-history evidence (#97).
- Persisted paper broker, guarded Alpaca REST execution, idempotent orders, reconciliation and hash-chained audit journal (#98).
- Operator CLI, session runner, live authorization from certificate and clean Alpaca-paper evidence, offline demo, paper-only MCP previews and deployment templates (#99).
- Release documentation, real-data comparison with unchanged gate verdicts, wheel installation smoke and tag-triggered release workflow.
Changed¶
- Core installation is separated from optional RL, deep-learning, notebook and development stacks; NumPy/pandas pins remain unchanged (#96).
- Package metadata now describes the platform and uses the existing maintainer identity. Version 1.0.0 is classified beta: live performance is unproven.
- CLI help describes every command/option; session reports retain every attempt and show last planned targets on off-cadence days.
- MCP initialization reports the installed package version.
Fixed¶
- A single pre-registered parameter set can clear the promotion gate: CSCV now computes its absolute OOS loss frequency instead of rejecting one-column input. PBO and degradation slope remain not applicable; multi-variant calculations and every promotion threshold are unchanged.