Commit Graph
140 Commits
Author SHA1 Message Date
Alby96andClaude Opus 5.5 d1ae650043 Add the Italian report of the basket family
basket_reversion.md has to be written whatever the verdict and must show
what the phase measures: the replica of appendix G against the document's
15 totals with the binding rows counted, the control against chance of
G.5, and the trial of the basket engine with its exit reasons, orphan legs
(counted, also when zero), liquidations, account stops and refusals. The
comparison is zero (no trading), never buy and hold (ADR 0026 point 5),
and the share of baskets closed at the target is shown, never judged.
The report reads only BacktestReport, so it does not depend on the engine
being written in parallel; there is no outcome file for baskets yet.

A test checks the report and this source never contain the name of the
product the research document describes, through a hash of the name.

refs #131

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 18:17:13 +01:00
Alby96andClaude Opus 5.5 acc9efe39d Add the basket_reversion family and its trial engine
The trial machinery of Phase 13 judges a family through an ITrialEngine;
the baskets need one so their variants go through the same judge, cost
stress, control and look-ahead check as the daily families.

BasketReversionFamily ("Rientro tra strumenti") has one identifier for
every sub-variant: generation A (the five documented spreads) or B (ten
single symbols), signal, target, distance, growth, averagings, window,
entry threshold, exit rule, profile, open baskets and lot. The choice
axes are decimal codes marked as choices, so the plan never treats them
as a range to explore. Rules() turns parameters into BasketRules and
refuses a combination the family does not accept.

BasketTrialEngine runs the basket engine on the plan's data with the
plan's mode (come_dal_vivo by default) and venue costs (eToro by
default): one equity point a day on the same days for every variant,
260 points a year, zero as the comparison (the account is not long
anything), a surrogate that flips each day's changes for the control,
and a look-ahead check that compares the decisions taken before each
cut with those taken on the cut data. Its fingerprint carries the
market, the engine version, the costs and the mode.

refs #129

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 18:17:13 +01:00
Alby96andClaude Opus 5.5 44639e3f49 Add the basket engine: a margin account that trades the document's baskets
Phase 14 needs an engine that simulates the research document's baskets
with the frictions of the venue, so the trial judge can say whether they
earn anything once those frictions are paid.

BasketEngine walks a BasketMarket (the bars of a BarDataset without the
moments no symbol trades) bar by bar: decisions on the closed bar,
execution at the next open, buys at the ask and sells at the bid (bid and
ask rebuilt from the venue spread when the source gives one price, as the
ECB fixings do). Every leg of every level is its own position with the
venue's mandatory stop; a stop that leaves one leg of a two-leg basket
alone closes the rest at the next execution as an orphan leg. Commission
on both sides, financing at every rollover crossed (Wednesday triple, from
the VenueCosts calendar), liquidation below half the initial margin.

On top, the document's account rules (9% stop on the open loss over the
balance, on mid prices in the daily pause, entries back at the next server
day; 2% gate on new baskets only; open baskets, Rvol, correlation, three
costs) and, «come dal vivo», SPEC 9.2 through RiskMonitor (day, week, fall
from the high, trip with the seven-day restart), the 40% margin limit,
nine positions, no opposite positions, net exposure per currency and the
Prudente basket stops. One equity point a day for every variant.

Signals come from the replica's RollingZ and RollingSigma on each unit's
compressed series; a rolling Rvol joins them, equal to BasketIndex.Rvol.
The comparison configuration (same close, no cost, no protection) makes
the replica's baskets on 200 seeded series and its total to 1e-9; on the
ECB fixture it gives the replica's 535.54 targets over 1,259 baskets.
TrialPlan gains optional Mode and Costs, left out when null, so the plans
of the daily families keep their hashes.

refs #127

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 18:17:13 +01:00
Alby96andClaude Opus 5.5 63bd5b9635 Add the stylised replica of appendix G and the shared rolling signals
Phase 14 must reproduce the 15 "Forex 1999-2026" totals of table G.4 and
check the basket engine against a yardstick that follows G.3 to the
letter. StylisedReplica runs generation B on each series of ln(close),
entry and exit on the same close, no costs, with the conventions a numpy
prototype found to reproduce every row: z over the last 100 values with
the sample deviation, sigma as the population deviation of the 99
differences inside them, stop before target (per position against the
mean of entries) before averaging, no reopening on the closing bar, open
baskets valued at the last close. On the ECB history up to 2 Dec 2026 it
gives the prototype's totals, positions and baskets on all 15 rows; the
13 binding totals are within their band (largest gap 3.4 targets).

BasketIndex.RollingZ and RollingSigma compute the signals in one pass
with anchored sliding sums rebuilt every window, so the replica and the
engine can read the same bits; they equal the exact two-pass values to
1e-9 and refuse a series with a gap. The control of G.5 flips the first
differences of all series with one sign per bar (not centred) and
measures the share of replicas whose break-even is equal or better.

refs #130

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 17:04:38 +01:00
Alby96andClaude Opus 5.5 47e08d6778 Add venue costs and the financing calendar for the basket engine
The basket engine needs the costs and margin rules of the venue it
simulates, dated and sourced, so a basket trial can copy them into its
plan and its fingerprint changes when any value does.

VenueCosts holds, per pair, the eToro values of the research document
(appendix A and section 6.3, 1-2 December 2026): instrument id, real
account leverage, bid/ask in normal hours and in the daily pause,
commission per side (0.005%, 0.002% on USDJPY) and overnight financing
in USD per 100,000 USD a night. The twelve legs of section 6.3 are
stored as the document's pips x pip value per 1,000 USD x 100 (EURUSD
buy 8.096, the 8.10 USD of section 6.7); the sixteen pairs without a
rate pay the largest known charge on both sides and are marked
estimated. Venue-wide: minimum 1,000 USD, default leverage 5, allowed
leverages, mandatory stop at 50% of the margin, account liquidation
at 50% of the initial margin. VenueCosts.None is the comparison
configuration: no costs, no mandatory stop, no liquidation.

Scaled(m) multiplies spread, pause spread, commission and financing
charges only; credits stay. Margin, stop distance (none for a buy at
leverage 1, as section 6.5 says) and a leverage check that refuses, in
Italian, a leverage the venue or the pair does not allow. The JSON
uses the plan's options and the fingerprint is its SHA-256.

FinancingCalendar counts the rollovers at 17:00 New York (the server
day change) on Monday to Friday, Wednesday triple, in closed form: a
position held from Tuesday to Friday pays five nights.

refs #128

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 17:04:38 +01:00
Alby96andClaude Opus 5.5 19a9a049f4 Add the ECB history of the research document as test data
The reference rates of the seven currencies against the euro from
1999-01-04 to 2026-12-02 (7,149 fixings), cut from the ECB history
downloaded on 2026-12-04. These are the data behind the "Forex
1999-2026" column of appendix G that Phase 14 must reproduce; no test
uses the network. SHA-256 f298c1dcc4be41a4545174e3e1b3ba5977f9cab23a7fbde622955404b3b03fd8.

refs #130

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 16:29:51 +01:00
Alby96andClaude Opus 5.5 cfa2a4da0e Fase 13 — Campionato: unità di lavoro, piano e statistica (#188)
ci / test (postgres) (push) Successful in 9m13s
ci / test (sqlite) (push) Successful in 7m33s
ci / image (push) Successful in 2m48s
The tournament judge before the contenders (ADR 0029): the trial judge split into resumable work units on a pool of low-priority workers, the common count of trials and field statistics, the control against chance on surrogate prices, and the immutable tournament plan with a final tract read once.

refs #122, refs #123, refs #124, refs #125, refs #126

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
fase-13
2026-12-04 15:53:40 +01:00
Alby96andClaude Opus 5.5 e0a438a0b2 Fase 12 — Dati e matematica dei panieri (#187)
ci / test (postgres) (push) Successful in 9m14s
ci / test (sqlite) (push) Successful in 6m40s
ci / image (push) Successful in 2m18s
Research-only data and maths for basket mean reversion (ADR 0028): a seam between the trial judge and the engines, the basket maths in src/Anubis/Baskets, sub-day research bars, ECB crosses and FX minute import.

refs #118, refs #119, refs #120, refs #121

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
fase-12
2026-12-04 11:29:00 +01:00
Alby96andClaude Opus 5.5 93cdf7850d Fase 11 — Decisioni solo matematiche (#186)
ci / test (postgres) (push) Successful in 7m36s
ci / test (sqlite) (push) Successful in 6m41s
ci / image (push) Successful in 1m49s
News, the economic calendar and earnings dates no longer change any decision (ADR 0023, choices in ADR 0027). The outside rules are measured in the shadow; a switch in the settings turns them back on.

refs #116, refs #117

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
fase-11
2026-12-04 09:14:11 +01:00
Alby96andClaude Opus 5.5 ed22d1c8b5 Test dello scheduler: giudica la lettura che ha visto (#185)
ci / test (postgres) (push) Successful in 5m50s
ci / test (sqlite) (push) Successful in 4m46s
ci / image (push) Successful in 1m21s
WaitUntil read the condition twice, and the scheduler's first round leaves the clock waited on only for an instant: the test failed once on the CI (run 586). It now judges the reading it saw; AStateSeenOnceIsEnoughForTheWait keeps it so. Reproduced 20 times in 3,000 parallel runs before the fix, never in 18,000 after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
2026-12-03 21:19:16 +01:00
Alby96andClaude Opus 5.5 1bc7e067fd Fase 10 — Nuova rotta: solo Docker (#184)
ci / test (postgres) (push) Successful in 4m50s
ci / test (sqlite) (push) Failing after 4m21s
ci / image (push) Skipped
ADR 0021-0026 for the new course of 2 December 2026, roadmap of phases 10-24. The desktop application is gone: Docker is the only form, and outside a container the server runs only for development and tests with --data-dir, on this computer only. Lighter image (829 MB to 410 MB), rotating logs, backtest and learning as one-shot commands.

refs #113 #114 #115 #78 #80 #81

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
fase-10
2026-12-03 19:59:00 +01:00
Alby96 3c57b3e84c CI: anche i dati del servizio PostgreSQL stanno in memoria (#112)
ci / test (postgres) (push) Successful in 4m53s
ci / test (sqlite) (push) Successful in 4m23s
ci / image (push) Successful in 1m25s
2026-12-03 15:33:29 +01:00
Alby96andClaude Opus 5.5 46e4a2bf6a Keep the data of the CI's PostgreSQL service in memory
ci / test (postgres) (push) Successful in 5m50s
ci / test (sqlite) (push) Successful in 5m11s
ci / test (postgres) (pull_request) Successful in 5m40s
ci / test (sqlite) (pull_request) Successful in 5m0s
ci / image (push) Successful in 2m37s
ci / image (pull_request) Successful in 1m0s
The PostgreSQL job of the Phase 9 CI failed once on a read timeout while a
test connected: the service log showed the runner's disk stalled, with a
25-second checkpoint even with fsync off and a forced DROP DATABASE
waiting on a stuck backend. The data of the service now live on a tmpfs
at /var/lib/postgresql, which holds PGDATA in PostgreSQL 18, like the
SQLite test databases already do (ADR 0019).

Tried in the CI's SDK container against postgres:18 with the same
options: 706 tests passed of 709 (3 skipped), peak use 295 MB, no stall.
The limit is 1 GB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 14:29:00 +01:00
Alby96 db563a0ebf Fase 9 — Rifinitura e consegna in Docker (#111)
ci / test (postgres) (push) Successful in 7m30s
ci / test (sqlite) (push) Successful in 5m8s
ci / image (push) Successful in 2m21s
fase-9
2026-12-03 14:07:14 +01:00
Alby96andClaude Opus 5.5 76c19d533b Let the tests run their fake tools from the CI's memory folder
ci / test (postgres) (push) Successful in 7m50s
ci / test (sqlite) (push) Successful in 5m23s
ci / test (sqlite) (pull_request) Successful in 5m24s
ci / image (push) Successful in 3m54s
ci / test (postgres) (pull_request) Successful in 7m19s
ci / image (pull_request) Successful in 1m36s
Docker mounts a tmpfs noexec by default. The publish script tests of
Phase 9 write fake git and docker into the temp folder and run them;
on /test-tmp they could not, the real git ran instead and 18 tests
failed. Reproduced in the CI's SDK container: 18 of 37 delivery tests
fail without exec, all 37 pass with it. ADR 0019 says why.

refs #75

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 13:13:23 +01:00
Alby96andClaude Opus 5.5 4aea2d0be7 Merge main into fase-9: SQLite test databases in memory on the CI
ci / test (postgres) (push) Failing after 6m53s
ci / test (sqlite) (push) Failing after 5m26s
ci / image (push) Skipped
ci / test (postgres) (pull_request) Failing after 7m47s
ci / test (sqlite) (pull_request) Canceled after 1m49s
ci / image (pull_request) Canceled after 0s
The CI of Phase 9 failed on seven tests that start the server on a SQLite
file: on the runner's disk the migrations alone took 24 seconds, past the
30-second start limit. PR #110 (ADR 0019), now in main, keeps the test
databases in a tmpfs folder on the CI. STATE.md no longer lists #110 as
waiting for the user.

refs #75

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 12:51:40 +01:00
Alby96 34cf307b74 CI: i database SQLite delle prove stanno in memoria (#110)
ci / test (postgres) (push) Successful in 5m33s
ci / test (sqlite) (push) Successful in 4m24s
ci / image (push) Successful in 4m5s
2026-12-03 12:51:14 +01:00
Alby96andClaude Fable 5.2 f3a603d491 Close Phase 9 and record the new route of 2 December 2026
ci / test (postgres) (push) Failing after 7m12s
ci / test (sqlite) (push) Successful in 11m19s
ci / image (push) Skipped
ci / test (postgres) (pull_request) Failing after 7m46s
ci / test (sqlite) (pull_request) Successful in 10m6s
ci / image (pull_request) Skipped
Phase 9 ends with its last documents: the review fixes in ADR 0020
(points 35-49), the publication rule in SVILUPPO.md and the state.

The user changed the project's route on 2 December 2026: maths-only
decisions, the basket mean-reversion logic of a research document, a
championship of strategies, leverage and short selling only on margin
accounts that can never be real, currencies on the eToro Demo, and
Docker only. The approved plan (phases 10-24) and the document now live
in docs/piani and docs/ricerca, so the route does not stay on one disk.
STATE.md points the next session to Phase 10 "Nuova rotta: solo Docker";
ROADMAP.md marks the old desktop phase as superseded and keeps #70 and
#71 open while they wait for the user.

refs #75

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-03 11:40:39 +01:00
Alby96andClaude Opus 5.5 8d7efe425d Settle what the checks of the review fixes found
A difference that comes and goes no longer makes the account ask about a stop
the user has already chosen on. The balance of the restrictions adds each
period to what was published, so a change of capital does not rewrite the
past. An image is published only under a tag that exists, and a file that is
not part of it no longer marks it as unclean.

refs #70 #74 #75

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:16:14 +01:00
Alby96andClaude Opus 5.5 d26d945818 Merge branch 'fase9-fix-ombra' into fase-9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:12:28 +01:00
Alby96andClaude Opus 5.5 76b64ef147 Replay the past of a rebuilt account in its order
What an account did while the bot was off is now written before the splits and
the dividends of those days, once and without acting on it; an attempt cut
halfway is taken up from the same point. Until then the account is not valued
at today's price, the guard keeps the last figures it knew with their time,
and a stop order only cancels what is open. Protective sales of the archive
are not continued, and the rest of a stop that fired in part is sold.

Also the decisions of the phase (ADR 0020), the manuals and the dates under
the equity chart.

refs #69 #72 #75

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 22:58:08 +01:00
Alby96 e58a26e8fa Merge branch 'fase9-fix-conti' into fase-9 2026-12-01 22:28:59 +01:00
Alby96andClaude Opus 5.5 3543f29aba Judge the variant in use and count the shadow cases for what they are
The quarterly review judged the best variant of the grid instead of the one
that trades: the plan now fixes the variant in use and the protocol measures
that one, while the tries are still those of the grid. A failure while the
history is prepared is a reason in the report and no longer stops the review,
and a strategy whose protocol does not exist says so when its data are there.

The volatility improvement compared books of different days and stages: the
book keeps its stage and its previous day, and a case without a book valid on
its day is left out. Fewer than six months give no interval, the others use
the clustered error with the Student t.

The restriction balance counts a case in the period in which its outcome
became known, so no case is lost or counted twice between two reviews.

The contact given to the SEC travels only on the client that never follows a
redirect, so it cannot reach another site.

refs #75

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 22:26:06 +01:00
Alby96andClaude Opus 5.5 5ef54b6f2a Finish an interrupted rebuild and replay the past without acting on it
The independent review found that a rebuild cut halfway was never finished
(stops canceled or lowered), that old stop executions replayed from the broker
queued a real sale, that a pending "close all" survived the restore, and that
reconciliation and corporate actions touched accounts not rebuilt yet. The
rebuild now keeps its starting point until it ends, protects the bot before the
first row, meets the splits at their date and leaves the ledger alone until it
is done. Dividends count the shares of after a split. A failed restore of a
missing SQLite file leaves no empty database, and a failed migration can be
tried again from the choice page.

refs #69 #75

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 22:15:34 +01:00
Alby96andClaude Opus 5.5 81d6c5f667 Fix what the review of Phase 9 found in accounts, access, capital, health and publication
A position left out together with its stop kept the account prudent for good: the
stop was still asked for shares that no longer exist. The cover required now stops
at what the account holds, the stops are compared again after the choice, and where
one is still missing Align takes the excluded position up again. After the choice
the account waits for the stop with its own reason, so it returns to normal by
itself also past the 15 minutes; a new difference still gets its own 15 minutes.

A right password alone no longer clears the wrong second-factor codes: it takes
back only its own attempt.

Capital and shares are planned and written in one transaction, so overlapping
changes cannot apply twice and an interruption leaves nothing halfway; sending the
same figures again completes what an old one left. The cash that purchases under
way still hold is no longer given away, counted as the risk engine counts it.

/health said healthy when the trading engine had failed to start. It now says so at
once, or after ten minutes of a stalled start, and the host tries the start again
every minute; the guard still sees a start that does not move.

The image of the manual publication says its version and its commit, marked when
the tree is dirty, and publish.sh refuses before any login an image that does not
come from the commit of the tag.

refs #75

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 22:07:46 +01:00
Alby96andClaude Opus 5.5 24e20584d4 Write the manuals and fix what following them found
The manual, the runbook and the go-live list are written and checked claim by
claim against the code, and the installation is done from zero by following
them on both engines. That found real defects, now fixed:

- with SQLite a missing database file left no way to restore a backup: the
  choices appear, and the file is created only by the user's choice;
- an account whose difference vanished after the 15 minutes stayed prudent
  with no button, a missing stop could be left out for good, and a choice
  made while the broker was silent used old numbers;
- after "Ferma tutto" the positions could not be closed without restarting;
- a refused key looked like a silent broker: it has its own notice now;
- the split of the capital between the strategies of a broker (SPEC 13.5)
  could not be changed from the interface.

refs #72 #68

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 21:38:33 +01:00
Alby96andClaude Opus 5.5 2257c3e16c Review the base strategies every three months
Every quarter the base strategies are tried again on the longer history with
the slippage in force, compared with how they did live, and the report is
published in the laboratory with the base rates measured again and the balance
of the restrictions of 10.5. In observation the outcome replaces the old one and
a strategy that passed goes to simulation after its 90 days; with capital
nothing moves but the demotion condition of 12.3. A restart halfway goes on and
the review concludes once; the outcome of a review survives a restart with an
older build.

refs #74

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 20:59:20 +01:00
Alby96andClaude Opus 5.5 79bb194de0 Compute the improvements of 8.7 in shadow on the examples
Each improvement is measured on the signals the bot already collects, in its own
savepoint after the decision, so no order depends on it: the correlation filter,
the volatility cap, the sector cap, the market filter, the entry time and the
choice of the model. The laboratory shows how many cases each one has and how far
to trust it. Sectors come from the SEC only with a contact given by the user.

refs #74

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 20:31:15 +01:00
Alby96andClaude Opus 5.5 fb0ab223a5 Put the candidate strategies in observation without capital
Relative momentum among coins and all-time highs on stocks are now in the
code as candidates: they collect signals, have no share, no capital and no
order path, and every way forward refuses them. The crypto one ran the
protocol once and failed it (DSR 0.744, worst fall 35.3%), so it is archived
and decides nothing; the stock one waits for the Alpaca history.

refs #74

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 19:52:24 +01:00
Alby96andClaude Opus 5.5 9d1a4f2f69 Export the operations for the tax return
Every execution, dividend and correction of a world, with its value in euro
at the ECB rate of its own Italian day or the last one before it, and for
sales the cost of what was sold. Costs come from the executions of the whole
account, so the method (LIFO by default, or FIFO) can be changed at any
time. A missing rate leaves the cell empty and says so.

The ECB download no longer leaves holes after a pause, and each execution
keeps the reference rate in force when it happened (SPEC 6.8).

refs #73

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 19:33:10 +01:00
Alby96andClaude Opus 5.5 3cd214ae78 Publish the image on version tags and test what is delivered
A v* tag now builds, tries and publishes the image: the version must be the
one of Directory.Build.props, latest only moves forward and the registry
token is in one step, given to docker on its input. The same script works by
hand. The image says its version and commit, and its health check also
covers the engine loop and the live prices.

The Unraid template is final: a test compares it with appendix E and with
the variables the loader really reads, and another reads the workflow.

refs #70
refs #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 19:21:40 +01:00
Alby96andClaude Opus 5.5 4d92a39fef Close what the security review found
A session alone could change the password, switch the second factor on or
off, send the key of the language model to another address and remove the
rules that stop purchases. Each now needs the password and the code, with
one limit on wrong attempts that a restart of the services does not clear,
and the other sessions end when the password or the factor changes.

Requests to the brokers pass a list of allowed calls, never follow a
redirect with a key and are signed by one client only. Pages are closed by
default, nothing is cached, requests are limited to 1 MB, secrets are
masked in logs and notifications, exported tables cannot run as formulas,
archives carry no sessions and the container refuses to run as root.

refs #68

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 19:11:11 +01:00
Alby96andClaude Opus 5.5 4897594b87 Rebuild the state from the brokers after a restore and refuse an older copy
A restore, an import or an adopted database restarts protected: the engine
stays stopped, reads from the broker what the archive does not know (orders,
stops, executions, also from the OKX history up to 89 days), cancels orders
left working, protects what it finds and waits for the user. Strategies with
real money stay exit only until confirmed again. The database of before the
restore, put back by mistake, is refused by its fingerprint.

A failed migration leaves the engine off with one backup and a way to try
again; an archive is checked whole before the database is touched; a changed
secret key no longer crashes anything, and "anubis access reset" gives the
access back to whoever holds the computer. The image runs the db and access
commands without the guard.

refs #69

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:52:08 +01:00
Alby96andClaude Opus 5.5 e8b3500db6 Keep the test databases of the CI in memory
ci / test (postgres) (push) Successful in 6m54s
ci / test (sqlite) (push) Successful in 5m17s
ci / test (postgres) (pull_request) Successful in 6m51s
ci / test (sqlite) (pull_request) Successful in 7m17s
ci / image (push) Successful in 1m0s
ci / image (pull_request) Successful in 1m40s
The disk of the runner stops for seconds under load, and the health check of a
test rightly answered "unavailable" after five. PostgreSQL was already spared
the syncs (ADR 0015); the SQLite tests now use a temporary folder in memory, and
the health test looks at the answer it settles on (ADR 0019).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:31:13 +01:00
Alby96 3da9b00f44 Merge pull request 'Fase 8 — Apprendimento' (#109) from fase-8 into main
ci / test (postgres) (push) Successful in 5m53s
ci / test (sqlite) (push) Successful in 8m3s
ci / image (push) Successful in 47s
fase-8
2026-12-01 16:58:03 +01:00
Alby96andClaude Opus 5.5 3eabc7713e Let the tests ride out a busy server
ci / test (postgres) (push) Successful in 5m36s
ci / test (sqlite) (push) Successful in 7m14s
ci / test (postgres) (pull_request) Successful in 5m57s
ci / test (sqlite) (pull_request) Successful in 7m11s
ci / image (push) Successful in 1m21s
ci / image (pull_request) Successful in 59s
On a loaded runner a forced DROP DATABASE gave up on an autovacuum slow to
leave, and failed a test that had already passed: the cleanup is tried again, as
the creation already is. The feed test gets time for its slow reader on a
computer at full load.

refs #67

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 15:16:39 +01:00
Alby96andClaude Opus 5.5 c7e462b6f4 Fix what a second independent reading of the Phase 8 fixes found
ci / test (postgres) (push) Failing after 6m9s
ci / test (sqlite) (push) Successful in 7m6s
ci / image (push) Skipped
ci / test (postgres) (pull_request) Successful in 5m51s
ci / test (sqlite) (pull_request) Successful in 7m3s
ci / image (pull_request) Successful in 1m51s
One funded signal was enough to start the model for good, because the interval
of a few cases had no width: it now takes a hundred, weighed among themselves.
A computer always off at 03:00 never made the night of the model: a job to make
up for counts from the first start that knows it, and the night waits for the
bars of the absence. Stories are seen as they were when the decision was due, a
report already out does not close a label, an undone promotion starts the trial
again, and the trade card finds the estimate of an example born earlier.

ADR 0018 point 18 has the list; each defect has its test.

refs #67

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:27:03 +01:00
Alby96andClaude Opus 5.5 0b0f4a5e75 Fix what the independent review of Phase 8 found and close the phase
ci / test (postgres) (push) Successful in 6m37s
ci / test (sqlite) (push) Successful in 7m51s
ci / test (postgres) (pull_request) Successful in 5m40s
ci / test (sqlite) (pull_request) Successful in 7m31s
ci / image (push) Successful in 2m29s
ci / image (pull_request) Successful in 59s
Two reviewers with a clean context read the engine and the screens. The
isotonic calibration took its floor from the first step, even of two cases, so
with few winners it flattened every estimate: the first model is rebuilt with
the fix. Learning failures no longer forget the multiplier an operation was
born with, nor stop a decision or the nightly check; recovered decisions read
the outside world as it was when due; models estimate only the strategies they
studied; a newer history does not repeat what was lived. The screens count
examples instead of verifications, show the next threshold and never round an
alarm to 50%; two forms now check the antiforgery token.

Each defect has its test, on both engines. ADR 0018 point 17 has the list.

refs #67

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:36:26 +01:00
Alby96andClaude Opus 5.5 f69943f70a Show what the model knows on its own screen and let the user set it aside
The Apprendimento screen says in plain words whether the model counts, how
well its probabilities hold, which clues it weighs, how the challenger is
doing and what it has learned. Thresholds, set-aside and the undo of a
promotion live in Impostazioni; anything that shrinks less with real money
asks for the phrase. The new tests also caught a wrong column name that
broke the Panoramica as soon as the first model existed.

refs #66

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:44:37 +01:00
Alby96andClaude Opus 5.5 14e8a872dc Learn slippage from real executions and say discoveries in plain words
The monthly regression raises an estimate by itself and lowers one only on
real money and with the confirmation of the user in the Laboratorio. The
table of what news does to prices and the fixed list of questions on the
clues are informative only.

refs #65

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:15:20 +01:00
Alby96andClaude Opus 5.5 df21962da3 Let the model shrink entries once it has earned it and watch it every night
The multiplier is the last corrective and is fixed when an operation is
born. Until the criteria of SPEC 11.5 are met the estimates are only noted
beside each operation. Every night the outcomes are labelled and the model
is checked (precision, ADWIN on the error, clues never studied) and set
aside when it is wrong; every Sunday a challenger is trained or judged.

refs #64

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:02:55 +01:00
Alby96andClaude Opus 5.5 99ff2d9402 Train the learning model at home and ship the first one with its validation
Logistic regression, boosted trees and random forest, calibration, purged
validation and the choice by mean gain per proposed operation (refs #63).
The first model comes from the crypto history: nothing better than the base
rate, so it starts in observation as the report says.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:34:41 +01:00
Alby96andClaude Opus 5.5 9cd1357e9b Archive every entry intent as a learning example with its clues and label
One example for the first entry intent of a strategy, executed or not and also
in observation, saved in the transaction of the decision with the clues known at
that moment. The label is the operation simulated alone at full size, net of
costs, so it does not depend on what the bot did with the signal (ADR 0018).

refs #62

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:07:32 +01:00
Alby96 632252f95c Merge pull request 'Fase 7: correzioni della revisione indipendente e chiusura' (#108) from fase-7 into main
ci / test (postgres) (push) Successful in 4m9s
ci / test (sqlite) (push) Successful in 4m34s
ci / image (push) Successful in 1m26s
fase-7
2026-12-01 10:38:11 +01:00
Alby96andClaude Opus 5.5 a3ff8ea6b7 Fix what the independent review of Phase 7 found and close the phase (refs #61)
ci / test (postgres) (push) Successful in 4m14s
ci / test (sqlite) (push) Successful in 4m41s
ci / test (postgres) (pull_request) Successful in 4m22s
ci / test (sqlite) (pull_request) Successful in 4m33s
ci / image (push) Successful in 2m51s
ci / image (pull_request) Successful in 50s
Linking missed Italian elisions, "The" names and common aliases; keywords
missed words after an apostrophe; stories about two companies merged and
confirmed each other; a story that became serious late was measured from its
first article. The news round delayed the engine and the risk check, and the
classifier ran inside the database writer. The earnings row started and ended
on the wrong sessions, the one-step comparison ignored it, and a purchase was
said to be put off when it was not, or sent at the open. ADR 0017 records the
choices; what depends on the user is in #107 and #55.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:49:14 +01:00
Alby96andClaude Opus 5.5 61878c2023 Keep broken model answers and articles from stopping the news (refs #58, refs #61)
The independent review of phase 7 found that an answer with half a Unicode
character, or of an unexpected shape, escaped the validation as an exception:
its cost was lost, it was paid again every two minutes past the daily cap, and
the diary of the news stopped. The same happened to the whole round with an
article cut in the middle of an emoji.

Such answers are now refused like any other, the cost is written before the
request leaves and settled with what the service used, never clamped to the
estimate, and neither the analyst nor one source can stop the others. The
estimate counts every byte as a token, so it is a true worst case. Summaries
with bare domains or invisible characters are refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:24:36 +01:00
Alby96 ae4ae4ed92 Merge pull request 'Esercitazione della guardia: il motore della prova non esce più dal computer' (#103) from drill-offline into main
ci / test (postgres) (push) Successful in 3m42s
ci / test (sqlite) (push) Successful in 4m28s
ci / image (push) Successful in 2m0s
2026-11-28 18:45:34 +01:00
Alby96 a7ff173771 Merge pull request 'CI: l'esercitazione della guardia aspetta che la vendita sia partita' (#101) from guard-drill-sale into main
ci / test (postgres) (push) Successful in 3m36s
ci / test (sqlite) (push) Successful in 4m12s
ci / image (push) Successful in 1m32s
2026-11-28 18:45:25 +01:00
Alby96 974ebd863f Merge remote-tracking branch 'origin/main' into drill-offline
ci / test (postgres) (push) Successful in 4m15s
ci / test (sqlite) (push) Successful in 4m20s
ci / test (postgres) (pull_request) Successful in 4m1s
ci / test (sqlite) (pull_request) Successful in 4m28s
ci / image (push) Successful in 1m52s
ci / image (pull_request) Successful in 1m6s
# Conflicts:
#	src/Anubis/Data/MarketDataService.cs
2026-11-28 16:35:02 +01:00
Alby96 b49e3c2899 Merge remote-tracking branch 'origin/main' into guard-drill-sale
ci / test (postgres) (pull_request) Successful in 3m41s
ci / test (sqlite) (pull_request) Successful in 4m21s
ci / image (pull_request) Successful in 2m8s
ci / test (postgres) (push) Successful in 3m40s
ci / test (sqlite) (push) Successful in 4m1s
ci / image (push) Successful in 57s
2026-11-28 16:31:46 +01:00