No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
zevaryx c51198edf6
All checks were successful
CI / precommit (push) Successful in 39s
CI / test (3.14) (push) Successful in 57s
CI / test (3.15) (push) Successful in 57s
CI / test (3.12) (push) Successful in 1m32s
CI / test (3.13) (push) Successful in 1m37s
CI / release (push) Successful in 5s
build: bump the version to 3.2.0
2026-11-06 00:58:03 -07:00
.forgejo/workflows ci: publish with a PACKAGE_USER secret, and say so when the secrets are missing 2026-11-05 21:08:41 -07:00
.vscode [feat] Heavy testing of core 2024-03-19 16:21:17 -06:00
jarvis_core feat(stats): read the value from the top level of a Stat record, not from meta 2026-11-06 00:22:33 -07:00
tests feat(stats): read the value from the top level of a Stat record, not from meta 2026-11-06 00:22:33 -07:00
.flake8 v0.18.0, match ipy5 branch of JARVIS 2023-08-27 14:08:30 -06:00
.gitattributes chore: normalise line endings to LF 2026-11-03 10:23:48 -07:00
.gitignore Add database models, configuration management 2022-02-06 21:33:15 -07:00
.pre-commit-config.yaml build(pre-commit): update hooks to their latest releases 2026-11-02 14:00:26 -07:00
LICENSE chore: normalise line endings to LF 2026-11-03 10:23:48 -07:00
PRIVACY.md docs: say operators can see which accounts are signed in to the website 2026-11-04 10:48:15 -07:00
pyproject.toml build: bump the version to 3.2.0 2026-11-06 00:58:03 -07:00
README.md chore(release): 3.0.0 2026-11-02 23:25:34 -07:00
requirements.precommit.txt build(pre-commit): update hooks to their latest releases 2026-11-02 14:00:26 -07:00
TERMS.md chore: normalise line endings to LF 2026-11-03 10:23:48 -07:00
uv.lock build: bump the version to 3.2.0 2026-11-06 00:58:03 -07:00

jarvis-core

Core functionality of JARVIS, shared by jarvis-bot and jarvis-tasks.

Versions

jarvis-bot, jarvis-tasks and jarvis-core are released together and share a version number: 3.x of each work with 3.x of the others. A change that needs matching releases of the other two bumps the major version of all three.

Modules

jarvis_core.db

Database connection (connect(), built on Beanie and PyMongo's async client) and the Beanie document models. Discord IDs are stored as BSON int64.

jarvis_core.db.migrations

One-off migration for databases written by jarvis-core 1.x (see below).

jarvis_core.filters

Regex filters for various functions

jarvis_core.log

Pre-configured Rich logger

jarvis_core.util

Quality of life utilities. jarvis_core.util.http provides public_session() and fetch(), which refuse to connect to non-public addresses; use them for any request made on behalf of a user.

Development

Requires Python 3.11+ and uv.

uv sync
uv run pytest

Database tests need a real MongoDB and are skipped otherwise. Every collection in the test database is dropped before and after each test, so point it at a scratch database:

export JARVIS_TEST_MONGO_URI="mongodb://user:pass@localhost:27017/?authSource=admin"
export JARVIS_TEST_MONGO_DB="jarvis_test"
uv run pytest

Upgrading from 1.x

jarvis-core 1.x stored Discord IDs as strings, which no query could match. 2.0 stores them as integers, so existing data must be migrated once, before deploying a bot or tasks build that depends on 2.0. Back up the database first.

uv run jarvis-migrate --uri "mongodb://user:pass@host:27017/?authSource=admin" --database jarvis --dry-run
uv run jarvis-migrate --uri "mongodb://user:pass@host:27017/?authSource=admin" --database jarvis

The migration is idempotent. Besides the ID conversion it rewrites the legacy "perma" ban type, normalizes ban discriminators, and backfills Ban.expires_at for temporary bans. Locks created before Lock.guild existed keep guild unset.