ThePredictdocs v0.0.1 RC

Administration

Storage & records

What ThePredict writes to your disk, where it goes, how long it stays and how to read it.

Everything on this page stays on your machine. ThePredict writes it from background threads, so a slow disk never delays a fight, and nothing here is ever sent to Jev.

Where things live

WhatWhere
Your configurationplugins/MythicMobs/AIConfig/config.yml and AIConfig/Profiles/ (see Install & requirements)
Fight records (JSONL)plugins/ThePredict/records/events/<UTC day>/events-<run>-<n>.jsonl, gzipped to .jsonl.gz once closed
Request bodies, when keptbodies-<run>-<n>.jsonl in the same day folder
Backups, exports and the lockrecords/backups/, records/exports/, records/.lock
Evaluation verdictsrecords/eval/verdicts/<fingerprint>-<stage>.json
Aggregates databaseplugins/ThePredict/aggregates.db, beside records/, not inside it
Scenario recordingsplugins/ThePredict/scenarios/
Duel recordingsplugins/ThePredict/duels/
Migration proposalsplugins/ThePredict/migration/
Learning artifactsplugins/ThePredict/learn/
Profile overlaysplugins/ThePredict/autoconfig/
Example bossplugins/ThePredict/examples/

The records folder is records.directory (relative to plugins/ThePredict/) and the database file is storage.file. If config.yml is invalid, ThePredict stays inactive and opens neither: no records/ and no aggregates.db are created.

Fight records

The records are append-only JSONL: one JSON object per line, without spaces, written by one background thread (ThePredict-Storage). Every line carries v, type, run, t_ms, t_nanos, tick and tag, then its own fields.

records.levelWhat is written
offNo records.
decisions (default)Decisions (planned, result, acceptance, local), outcome windows, tells and the other fight summaries.
fullAlso casts, threat changes, reactions, micro-movements and stances.

records.bodies decides what happens to the request bodies: none, hash (default, only a hash), dedup (each distinct body once) or all.

  • Rotation. A file rotates at 64 MiB or after 60 minutes. A closed file is gzipped, and the original is deleted only once the .gz closed correctly.
  • Retention. 14 days and 2048 MiB by default. The current day is never deleted; if today alone passes the size cap, events pause and the aggregates keep working.
  • Runs. Each start with records begins with a run_start line: plugin version, model, question detail, config_sha256, records level, body policy and answer cache. A clean stop writes run_stop with clean: true. After a crash the storage state shows the cause DIRTY_SHUTDOWN; run /thepredict records verify.
  • Tags. /thepredict records tag <tag> writes a label into every following line, handy to mark a test session; tag clear stops.

Note Size

A planning estimate, not measured on a server: about 47 MB per hour before compression with five bosses fighting, at decisions level with hashed bodies. full writes much more.

Aggregates database

aggregates.db is a SQLite database of running statistics (outcomes per profile, tactic and level, and the data the other features keep). With storage.aggregates off, only the JSONL is written.

  • Driver. ThePredict uses the sqlite-jdbc driver that Paper already ships and does not bundle its own. It needs SQLite 3.45 or newer. Without a usable driver, aggregates turn off (DRIVER_MISSING) and the JSONL records continue.
  • MySQL. mysql is reserved: writing it is a configuration error.
  • Backups. Every 24 hours a copy goes to records/backups/, keeping the newest 7. /thepredict records backup makes one now.
  • Recovery. At startup the database is checked with SQLite's quick_check. A broken file is renamed, never deleted, and the newest backup that passes the check takes its place; without one, aggregates stay FAILED.
  • Flushes. Pending statistics are written every 100 ticks; /thepredict records flush forces one.

Important Keep it off network drives

SQLite's write-ahead log is not safe on NFS, CIFS/SMB or sshfs. When the records folder looks like one, the Store line of /thepredict status ends with network. Put plugins/ThePredict/ on a local disk.

Status and commands

When storage is running, /thepredict status adds a Storage block:

Console
State: READY records decisions dropped 0 inFlight 0 failed 0
Store: sqlite 3.49.1 synchronous 1 journal wal

State shows the aggregates state (READY, STARTING, DISABLED, READ_ONLY, DEGRADED or FAILED) and its cause, the records level, dropped events, batches in flight and failed batches. Store shows the SQLite version and the settings read back from the database (synchronous 1 is normal, 2 is full), plus paused when events are paused for size, network for a network drive and failure … when the records failed. /thepredict records stats prints the same in one line with only thepredict.admin. The other records commands (export, prune, verify, backup, flush, cache, tag) need thepredict.records; see Commands & permissions.

Reading the data offline

Stop the server first, then use any JSON or SQLite tool. For example:

Shell
# every outcome window of the kept days (closed files are gzipped)
gzip -dcf plugins/ThePredict/records/events/*/events-*.jsonl* | jq -c 'select(.type == "outcome")'

# the best and worst tactics per profile
sqlite3 plugins/ThePredict/aggregates.db \
  "SELECT profile, tactic, level, windows, effect_mean FROM outcome_stats ORDER BY profile, effect_mean DESC LIMIT 20"

/thepredict records export outcomes writes the same statistics as CSV into records/exports/ while the server runs.

What stays private

  • Local files may contain the UUIDs of mobs and worlds, and the duel files contain the UUIDs of the duellists. They help debugging and never leave the machine.
  • Jev only ever receives aliases: player_1, entity_1 and so on, plus an entity's species. Never names, Display names, MythicMobs IDs, factions, UUIDs or coordinates.
  • No file ever holds the key or an Authorization header. config_sha256 is computed without jev.apiKey.

Scenario recording

debug.recordScenarios saves every decision Jev answered as an anonymized scenario, for calibration work. Keep it off on a live server; it is read at startup like the rest of config.yml.

  • One file per decision: plugins/ThePredict/scenarios/scenario-<UTC start>-<nonce>-<nnnn>.json, with the exact body sent (aliases only), the questions, the answer, the tokens and empty labels. Never the key.
  • At most 1 000 files per start. At the limit, one line: Scenario recording reached its limit of 1000 files; later decisions are not recorded.
  • Its own thread with a queue of 64. When the queue is full the decision is dropped, counted and reported once: Scenario recording dropped a decision: its queue of 64 is full.
  • About 4.5 KB per file in a one-against-one fight and 51 KB in the worst case (16 mobs against 16 players): up to about 51 MB per start.
  • With recording on, closing the plugin can take about 2 seconds while the queue drains; whatever is left is dropped and counted.

Duel recorder

/thepredict duel records everything two factions of mobs decide and do, in real time (see Commands & permissions for the command). It is off until you start it and costs nothing while idle.

  • What it follows. Up to 8 living duellists of the two factions inside the radius, sampled every 5 ticks. A round starts when each side has a duellist and ends when one side has none: a death gives the round to the other side; a removal (a timeout skill, /mm mobs kill) is a draw. A side is tp when its mobs have a bound profile and classic otherwise.
  • Where. plugins/ThePredict/duels/<label>-<UTC yyyyMMdd-HHmmss>/.
  • Files. decisions.jsonl (planned, body, result, acceptance and local lines, joined by encounter and sequence; local uses sequence −1), samples.csv, casts.csv, damage.csv, intents.csv, defense.csv, retreats.csv, threat.csv, outcomes.csv, rounds.csv and summary.md (wins with a confidence interval, time to kill, damage, hits and misses per skill, retreats, guards, time per control level, effect per tactic, requests, tokens and cost).
  • Limits. 4 hours, 500 rounds, 128 MB per file and 512 MB per recording. At a limit the recording stops itself, writes summary.md with stopped_by: <limit>, tells the player who started it if they are online and logs Duel recording '<label>' stopped: <limit> reached.
  • Writer. One thread, ThePredict-DuelWriter, alive only while recording, with a queue of 8 192 rows. A full queue drops rows and counts them (rows dropped in duel status and in summary.md). At shutdown the recording stops, waiting 2 seconds at most.
  • Cost. With a key, duel status shows the requests and input tokens the recording spent.

To set up a fair, player-safe duel arena, see Targets, participants & threat.

ThePredict 0.0.1 · release candidate. These pages describe this build, checked against its source code; it has not been verified on a live server yet.

ThePredict is an independent MythicMobs addon. Jev is TypeSafe's decision model; naming it does not imply endorsement. Fonts: Pixelify Sans, Inter and JetBrains Mono, under the SIL Open Font License.