Commit Graph
3 Commits
Author SHA1 Message Date
Alby96andClaude Opus 5.5 a5a6918dae Keep the guard drill's engine off the internet (refs #102)
ci / test (postgres) (push) Successful in 3m38s
ci / test (sqlite) (push) Successful in 4m6s
ci / test (postgres) (pull_request) Failing after 4m7s
ci / test (sqlite) (pull_request) Successful in 4m24s
ci / image (pull_request) Skipped
ci / image (push) Successful in 1m25s
Since Phase 7 the drill's child engine read the real news feeds every two
minutes and downloaded the ONNX tone model, and it already asked the ECB,
the mood and calendar sources and the Binance archives. The drill is meant
to stay on the computer (ADR 0012 point 5) and that extra work loaded the
slow CI runner while the drill timed the engine.

Under a guard with the drill's loopback OKX, the market data now runs
offline: no news job, no model, and every request goes through a
loopback-only handler that answers anything else with a final 403, so no
source retries with back-off and the engine keeps its pace. No new
variable: the drill is recognised by the same conditions as its fake OKX.

The drill gains an eighth check (no news read, no model downloaded), and a
test runs every market data job, a history round and a news round as the
drill builds them and finds only loopback requests on the network. ADR 0016.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 09:41:45 +01:00
Alby96andClaude Opus 5.5 9ae107000b Ignore late messages from a replaced engine; list only moves in the morning summary (refs #48 #52)
The guard drill failed once under load. The pipe of the killed engine
delivered a late "running" beat after the restart. The drill took the new
engine as ready and stopped it before it had cancelled the half-done sale
and put the stop back.

The same late message could have made a crash of the new engine look like
a planned stop, which the guard never restarts. Each engine the guard starts
now has a number, and messages from a replaced one are ignored. The drill
also waits until the restart's work is in the database before it checks.

The morning Telegram summary listed every job due today, including the
background ones that run every minute. It now lists only the bot's moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 20:34:25 +01:00
Alby96andClaude Opus 5.5 d00dfbd32f Add the guard that watches the engine and protects positions (refs #48)
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>
2026-11-11 19:36:32 +01:00