The 48-hour soak run at home kept being cut short by the host, never by Anubis.
The user will instead run a release for as long as they like and paste back a
report, so the bot now records what that report needs (ADR 0013).
- Every 5 minutes and at each start, a process sample goes to diagnostic_samples:
memory, GC, threads, handles, CPU, exceptions, database size, log warnings and
errors, and outbound HTTP calls by destination with duration buckets, read from
the System.Net.Http meter without any new package.
- Every scheduled job run goes to job_runs. Both tables keep 30 days.
- The Markdown report (at most 60 KB, redacted, user folders masked) adds
findings, the soak checks, starts and silences, jobs, calls, grouped log
warnings and errors, and resources over time with their slopes. It comes from
"anubis diagnostics", GET /api/diagnostica.md and a button in Diario e sistema.
- New {long} column token: SQLite STRICT tables reject BIGINT.
- "tasks release-win" builds the trial zip with a start script, a script that
writes the report, and Italian instructions. Version 0.7.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An independent review of the phase found nine defects. The ones that
could lose money or orders:
- Exits at the close of equity_meanrev are now planned orders written in
the same transaction that claims the decision, so a restart can neither
lose them nor send them twice. A sell with a deadline starts aggressive.
- Resume also finds a planned order not yet linked to its execution
(restart between sending and linking) and closes it before re-planning.
- An account is "ready" only after adopting the guard's stops, checking
the key, reconciling, resuming and aligning stops. Until then nothing is
decided on it or sent to it, and the loop retries its startup each
minute. The guard's note is deleted only when every stop it placed is in
the ledger.
- Each account's turn is cut after 45 s (60 s for a retried startup), so a
slow broker no longer silences the heartbeat until the guard kills a
healthy engine; the beat is also withheld when the scheduler has been
silent for 30 minutes.
Smaller ones: a stock decision made after the open is marked late; the
Telegram loops survive unexpected errors; a long absence is shown on the
Panoramica until "Ho visto" (SPEC 5.6); plain-http heartbeats are only
accepted to home-network addresses; the soak report gives a daily close
30 minutes to be decided before expecting it.
ADR 0012 point 12 records these choices; #51 and the two screen criteria
are ticked in the roadmap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Panoramica now follows mockup 01. Below "Finora" and "Adesso e dopo" it
shows:
- the two account cards with the invested/cash bar and a 30-day trend;
- the four risk limits;
- the open positions by value;
- the strategies;
- the news, learning and system tiles.
On the phone it follows mockup 09: Conti as a list, four positions with
"Vedi le altre", and two limits. Outside the demo, news and learning say
they are not active yet (Phases 7 and 8). The next moves are the scheduler's
moves only, no longer every interval job.
Diario e sistema follows mockup 08:
- the diary grouped by day, with search and filter chips (plain links, no
JavaScript) and older days on request;
- how each component is doing;
- the scheduled jobs;
- the host's processor, memory and disk;
- the technical logs as a zip, for signed-in users only.
In demo mode the screens show the values of appendix F.10. Tests cover the
demo figures, the filters and search, and the logs download.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every notice is written to the queue in the same transaction as what it
tells, then sent every ten seconds. Each has a state: pending, sent, or
failed with its error. Network failures and 429s are retried with growing
pauses (Telegram's own wait when it gives one). Refusals are final. A notice
that could not leave within a day is given up instead of arriving late. Every
fill now also reaches the phone, and so do pause, resume and restart.
Commands are read by long polling and obeyed only from the configured chat
and only when fresh, so yesterday's /pausa never pauses today. They are
/stato, /posizioni, /oggi, /pausa, /riprendi, /ferma (confirmed with
/conferma within two minutes) and /aiuto. Restarting after "Ferma tutto",
real money, limits and keys stay in the interface.
Also added:
- the heartbeat call every minute when an address is configured;
- the morning summary at 08:00, caught up within four hours;
- an optional hourly or evening status;
- a Telegram section in Impostazioni: test-before-save, a test button, the
queue's state and the last successful heartbeat;
- on desktop, the first-run page recommends the heartbeat.
Tests run against a fake Telegram server, including the commands through
the real server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An independent review found these, now fixed and tested:
- Risk limits could be raised through PUT /api/settings without the
phrase and the password. The API now refuses risk keys.
- The reference equity counted results twice after reduced to real and
after a demotion. Each ledger now keeps a baseline, and carried results
stay in the ledger's currency until the reference is computed.
- An instrument could be bought by a second strategy in the same account
(SPEC 8.6), and purchases under way did not hold their cash, so several
purchases sent together could exceed it. Both are refused or shrunk now.
- After an automatic trip of the switch there was no way to restart from
the interface. Rischio now shows the trip of both worlds and the restart.
- The fresh password of SPEC 12.4 could be tried without limit. Five wrong
attempts in 15 minutes now lock it.
- Observation to simulation skipped the 90 days of live signals.
- A new build changed the qualification of a strategy with real money,
"Ferma tutto" counted as a critical incident, raising risk ignored
demotion conditions in progress, and weekends counted as stock sessions.
- The 12.4 confirmation now summarises capital, first purchases and limits,
and live strategies show the gap with their simulated twin.
The backtest converts each bar with the rate fixed before it opens, the
day before, and the report now counts how often correctives and risk
changed a decision. crypto_trend is still not passed: the broad universe
now falls 32.8%. The outcome file also keeps the qualified parameters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The three screens follow mockups 03, 04 and 07.
Operazioni shows the balance of the closed trades, filters, a CSV export,
and for each trade why it was bought and sold. The reasons come from the
decision codes through fixed Italian templates.
Strategie shows the four stages towards real money, a card per strategy
with its requirements, the procedure of SPEC 12.4, and why each strategy in
observation waits. A strategy that failed its backtest cannot be moved into
the simulation.
Rischio shows the emergency switch, the automatic blocks, the use of each
limit, the fall from the peak, the scenarios and the risk events. Stop,
close and restart now go through the risk engine. A restart is refused
while the STOP file exists.
Impostazioni gains the limits, the day-trade guard and the scenarios.
Lowering a limit is always allowed. Raising a limit or the entrusted capital
while a strategy uses real money needs the phrase and the password.
The demo now holds the decisions behind its trades, the 58 days of
simulation and the indices of its curves, so it matches the mockups.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An error of the database (PostgreSQL restarting) no longer stops the
laboratory until the next start: the queue logs it, waits 30 seconds
on the injectable clock and tries the same trial again.
- Buy and hold, the comparison of every report, buys an instrument
whose history starts later at its first close, with the share kept
free for it; before, it was never bought and the others took its
weight. Its version goes to 2.
- The comparison page reads a and b as text: a malformed id shows
"two finished tests needed" instead of an error page.
- A trial re-checks the hash of its plan before running and refuses a
plan that no longer matches it.
- Parameters that count days take whole numbers only (10.5 would run
as 10 and count twice in the DSR); the capital starts from 1, as the
message says.
ADR 0010 says so, and corrects the estimated minimum of the research
history: 5 does refuse smaller orders, like the exchanges' minimums.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The laboratory starts with the host (off in demo mode) and runs its
queue next to market data and trading. The page lists every trial with
status, verdict and headline figures, refreshing itself while one is
queued or running, and offers the form for a new test: strategy, data
origin and market, instruments, period, initial capital and the grid,
with the thresholds stated before the run. The form posts with the
antiforgery token; errors come back as a short code.
The report page shows the protocol checks, the chosen variant against
buy and hold (table and chart), results per year, cost sensitivity,
the Deflated Sharpe Ratio, PBO, walk-forward windows, purged CV paths,
the look-ahead result, every variant with its zone score, what the
backtest does not model, the data used and the trades. A comparison
page puts two finished tests side by side and says whether they read
the same data. The improvements of 8.7 and the cost estimates of 11.6
have their sections, empty until Phases 9 and 8.
The equity chart takes amounts in their own currency and its labels as
parameters. The profit factor has no value without a losing trade.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The strategy contract of SPEC 5.3 (IStrategy, StrategyContext, Intent) is
shared by backtest and live: the context exposes bars only up to the
decision, adjusted and anchored to that day, and reading past it throws.
The engine runs each session as ordered events (corporate actions, open,
session, close), decides on the close and executes at the next open with
the simulator's price lists, slippage tiers, tick and lot rounding,
minimums and no leverage. Corrective and risk hooks are wired in and pass
everything through until Phase 5. One decision cycle can restart from a
recorded book (SPEC 12.3).
A scripted toy strategy reproduces a result computed by hand to the cent
on OKX and Alpaca costs. The Phase 3 class Trading.Strategies becomes
StrategyNames so the Anubis.Strategies namespace can exist.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Splits multiply only the shares held before the ex-date. Old splits in
the table no longer inflate positions bought later; the simulator's book
follows the same split once, together with the ledger.
- Dividends pay the simulator once on the ex-date holdings, and each
payment is marked in the same write, so a failure never pays twice.
- Positions are marked to market before every equity photograph; until
now equity, drawdown and the Conti screen stayed at the last fill.
- A sale with no price keeps its broker stops until it can really leave;
a purchase with no price is dropped.
- A refused sale is retried with pauses of 1, 2, 4, 8 and 15 minutes
instead of every tick, and one failing execution no longer stops the
stop alignment of the whole account.
- On Alpaca a purchase clears the sell stops of every strategy on the
symbol and holds them until it ends.
- OKX order lookups treat only 51603 as unknown; any other failure is an
error, so a lost order is never sent twice.
- The reconcile choice and key removal forms now require the antiforgery
token; the choice re-runs the comparison and is only offered after the
15 minutes; stale differences are dropped.
- A replaced key that cannot withdraw releases the prudent mode.
- Re-entering the same euro capital for Alpaca changes nothing; a new
amount converts only the euro difference at today's rate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Conti e posizioni screen follows mockup 02: totals split by strategy,
one card per account with key permissions and the last reconciliation,
positions with a per-account filter and CSV export, pending stops (Alpaca
grouped into permanent and day stops), residues, and exposure by currency.
It shows one world only, real accounts when there are any, so simulated
and real money never add up. Position values are rounded to the cent per
row, as the table shows them, so the figures add up on screen.
Settings gain "Conti e chiavi": practice keys are asked to the broker
before they are saved and refused when they may withdraw or cannot trade;
they are never shown again and the engine restarts to use them. The
capital entrusted to each broker is set there in euro. Until any capital
is set, the overview points to that section as the first step.
The overview now reads one world, nets capital flows out of its results
and uses the time-weighted index; open orders exclude protective stops.
The demo seed gains cash rows, closed trades, stops, the ECB rate and the
reconciliation state, so the ledger itself computes the mockup's figures.
Screenshots now capture the whole page and include Conti.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A "Dati" section lists every external source with its state, last answer
and the reason it is off (Alpaca without the paper keys, FRED and Finnhub
without theirs), links the 30-day quality report, and edits the Fed/ECB
meeting list; a list that does not parse is refused with an example.
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>