Cal Jacobson (cj81499) has been competing in Advent of Code since 2015, accumulating over a decade of Python puzzle solutions in a single, well-maintained repository. What sets this repo apart from a typical solutions dump is its engineering rigour: every solved day is covered by a pytest test suite, all modern code passes strict mypy type checking, Ruff enforces consistent formatting and linting, and a sharedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/cj81499/advent-of-code/llms.txt
Use this file to discover all available pages before exploring further.
aoc_cj.util library prevents copy-pasting the same grid or parsing helpers across eleven years’ worth of puzzle files.
Repository Overview
Package layout, year subdirectories, and the
util subpackage at a glance.Key Features
Type checking, linting, CI matrix, and the test runner integration.
Utility Library
The
aoc_cj.util subpackage — shared helpers used across all years.Solutions by Year
2015 through 2025 — eleven consecutive years of puzzle solutions.
Repository Overview
The repository is structured as a single installable Python package namedaoc-cj, built with Hatchling and managed by uv. The source tree lives under src/ following the standard src-layout convention:
aoc{YEAR}/ subdirectory; each day is a self-contained module named day{DD}.py (zero-padded). This predictable naming is what lets the top-level solve() function dynamically import any year/day combination at runtime.
The package registers a adventofcode.user entry point in pyproject.toml:
aocd test runner. When aocd runs cj81499’s solutions, it calls aoc_cj.solve directly — no special wrappers required.
Key Features
11 Years of Solutions
Puzzle solutions spanning 2015 through 2025 — every AoC season cj81499 has competed in, all in one repository.
Shared Utility Library
aoc_cj.util exports helpers like adj_4, adj_8, ints, floats, is_prime, Point3D, PriorityQueue, and more — reused across all years.Full pytest Test Suite
Every solved puzzle has a corresponding test. Running
uv run pytest validates all solutions against real puzzle answers via aocd.Strict mypy Typing
The entire codebase (2021 onwards) runs under
mypy --strict with additional error codes enabled — no implicit Any, no untyped functions.Ruff Linting & Formatting
Ruff handles both formatting and linting in a single fast pass, enforcing import order, upgrade rules, and unused-import detection.
GitHub Actions CI
Every push is tested on Python 3.13 and 3.14 via a matrix build. The pipeline runs Ruff, Tombi (TOML linting), mypy, pytest with coverage, and Codecov upload.
The solve() Entry Point
The heart of the package is the top-level solve() function in src/aoc_cj/__init__.py. It provides the single interface that aocd calls when running solutions:
Answer = int | str | None.
The function works as follows:
- Constructs the module name from the year and zero-padded day number, e.g.
aoc_cj.aoc2024.day01. - Dynamically imports that module with
importlib.import_module. - Calls
part_1(data)andpart_2(data)on the imported module via the private_solve_parthelper, which gracefully handles missing functions andNotImplementedErrorfor unsolved parts. - Logs every result to
logs/aoc_cj.logregardless of success or failure. - Raises
NotImplementedErrorif the module doesn’t exist yet, soaocdcan report the puzzle as unsolved rather than crashing.
All individual day modules follow the same contract: they must expose a
part_1(txt: str) function and optionally a part_2(txt: str) function. The return value must be an int, str, or None.Dependencies
The runtime dependencies reflect the breadth of algorithms AoC puzzles demand over eleven years:| Package | Purpose |
|---|---|
advent-of-code-data | Fetches puzzle input and answers automatically using your session token (aocd). |
more-itertools | Extended iteration utilities beyond the standard itertools module. |
networkx | Graph algorithms — shortest paths, connected components, cycle detection. |
numpy | Numerical computing and array manipulation for grid-heavy puzzles. |
shapely | Computational geometry — polygon area, union, and intersection operations. |
z3-solver | SMT / constraint solver for puzzles that require satisfiability reasoning. |
lark | PEG/EBNF parser toolkit for puzzles with formal mini-language grammars. |
frozendict | Immutable dictionary — useful for hashable state in memoised searches. |
mypy, pytest, ruff, pre-commit, pytest-cov, pytest-watcher, tombi) are kept in the [dependency-groups] dev section and are never included in the installed package.