The guard (SPEC 9.3, 9.4) is now the container's main process and the parent
of the engine. It listens on a named pipe for the engine's heartbeat and
startup steps, and steps in after two minutes of silence, ten minutes of a
startup that does not move, or an exit without notice. It stops the engine,
cancels our purchases and sales left open on demo accounts, puts back the
stops the positions need from the state file the engine writes every ten
seconds, writes a note, warns the user and restarts the engine without any
injected fault. The third forced restart within an hour writes the STOP
file. The container's stop is passed on to the engine, which closes in order.
At restart the engine adopts the guard's stops before reconciling, cancels
the orders it left open and plans again the exits already decided, so the
rules of SPEC 5.6 apply to them.
The acceptance test blocks the main loop right after a sale leaves: in
process on a demo-like broker, and with real processes in the drill, which
also runs inside the Docker image (tasks ci and the CI workflow). The guard
uses the ASP.NET shared runtime so both programs share /app.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crypto_trend now has a backtest report and an outcome file, computed by
"anubis backtest base" on the Binance daily archives from 2019 to October
2026. Prices are converted from USDT to euro with the ECB rate of the day,
and delisted coins stay in the universe, so survivors do not flatter the
result. The protocol runs the broad universe and BTC, ETH and SOL, with
costs doubled and tripled and buy and hold beside. Both universes must pass.
The outcome is "not passed": the broad universe falls 29.1% (limit 25%) and
the narrow one has a probability of overfitting of 0.84 (limit 0.40). The
strategy therefore stays in observation. The stock strategies wait for the
Alpaca keys and stay in observation too. The bot reads the outcome files at
every start.
Trials now read 450 days of history before their start, only so the
indicators and the 400-day listing age are ready on the first day. Before
this, 2019 was spent warming up and BTC and ETH could not be chosen until
2020. A daily series also stops at a hole longer than a week, so the LUNA
relaunched in 2022 is not mistaken for the coin that collapsed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 1 completed on top of the library foundations:
- Server: startup state machine (config, first run, database down, schema,
identity, ready) with an error page that retries by itself; the configured
database is the only one ever opened, and a vanished SQLite file is never
recreated. REST API and status WebSocket; session cookie auth, CSRF on
every form and write call; desktop and demo answer only the computer itself.
- Interface: static Blazor rendering with plain forms (no interactive
runtime), menu, top bar and phone bottom bar as in the mockups, light and
dark themes with appendix C tokens and a contrast test, Panoramica, Diario,
Rischio, Impostazioni; service pages for sign-in, first access, desktop
first run and the database error page with its choices.
- Demo mode (tasks seed-demo): appendix F in a database of its own under the
temp folder, frozen clock, never touches the configured installation.
- Docker: entrypoint gives /data to PUID:PGID and drops root with setpriv,
HEALTHCHECK through bash /dev/tcp; proven with SQLite, PostgreSQL, a wrong
configuration and a database that goes away and comes back.
- tasks screenshots drives the installed Edge/Chrome through DevTools for
exact 1440 and 390 pixel shots; anubis db export|import on the command line.
Fixes from the independent review: return paths without control characters,
Host check against DNS rebinding, attempt limit counted before the check and
also on the error-page password, one-use TOTP codes and a code to switch the
second factor off, error-page choices serialized with the startup loop,
identity checked before migrating, restore restarts with "Ferma tutto" on,
damaged archives reported instead of crashing. Running the server tests on
PostgreSQL exposed pages rendered before their data arrived; data-loading
components now load first (LoadedComponent).
Decisions in ADR 0007. Tests: 100 on SQLite and on PostgreSQL.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Empty but complete solution so every later phase starts from a working
toolchain: analyzers as errors, locked restore, format check, policy tests
that keep packages within ADR 0004 and keep live trading switched off,
a /health endpoint served from Docker, and a Gitea workflow with only
run steps. API facts of SPEC section 4 re-checked in docs/API-NOTES.md;
ADR 0006 records what changed (MSTest base packages, Ubuntu images,
OKX WebSocket on 443, Alpaca margin-only accounts).
refs #1 refs #2 refs #3 refs #4 refs #5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user prefers C# and asked for no SDKs or extra components without
permission. Speed is not a factor at this trading frequency and Python's
advantages were exactly the SDKs now excluded, so ADR 0003 adopts the
appendix D variant with Blazor instead of React, in-house broker clients,
ADO.NET, .csv.gz research storage, a C# task runner instead of make and an
in-house Windows installer instead of Inno Setup.
ADR 0004 lists the only packages the user authorized (Microsoft.Data.Sqlite,
ProtectedData, WebView2, MSTest, Npgsql, ML.NET with LightGBM/FastTree,
ONNX Runtime, Tokenizers) and the ask-first rule for anything else.
ADR 0005 records why the bot is called Anubis (he weighs and protects) and
replaces the two-semicircle mark with the scale of the weighing of the
heart: SVG, PNG, ICO and Unraid icon, applied to all nine screens.
CLAUDE.md, SVILUPPO, STATE, README, ROADMAP and templates follow; the 84
Gitea issues were rewritten to match and verified against the source.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Load the full project specification renamed from the provisional "Giano"
to "Anubis" (ADR 0001), the nine reference screens with the new name,
the Unraid template draft pointing at the Gitea container registry, and
the working documents the development phases rely on: CLAUDE.md,
ROADMAP (linked to the 84 Gitea issues and 12 milestones), STATE,
development rules (SVILUPPO), ADR 0002 on Gitea issues, packages and
installer, and Gitea issue/PR templates. No application code yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>