# Progress tracking and README export
This document describes the proposed scope for 0.1.0-alpha.4.
## Local progress
Track registered solvers and the latest execution outcome of each part for a project and language. A successful solver run records local execution only.
The shared calendar used by `aoc fetch` classifies days as unlocked, locked, or outside the edition. The progress view will use that same classification.
The core solver execution path emits each completed part as it finishes. The Rust runner retains and displays completed parts when a later part panics. The affected day is still reported as failed. The runner identifies the active part when it panics and reports panics outside part execution at the day level. Generated-project integration tests cover a panic in part two and a panic during input parsing.
The Rust runner can write an optional schema-versioned JSON report to a new file. It contains per-part outcomes and day-level error categories, including for runs that exit with a solver failure. The runner accepts the report path through an internal environment variable or an explicit flag, with the flag taking precedence. Generated-project tests cover the environment-only path and the flag override. The application can request and collect the report through the Rust adapter. An absent report is supported for older runners. The application validates the report schema and checks that the reported days and part outcomes match the execution plan and part selection. The local progress model can merge these outcomes in memory. It updates only parts that ran and preserves earlier outcomes when a run fails before executing any parts. Local snapshots have a versioned JSON format. The snapshot decoder rejects unsupported versions and duplicate part entries. The local store merges outcomes under a file lock and atomically replaces `.aoc-toolkit/progress/rust.json`. `aoc run` saves reported part outcomes even when a solver fails. If the snapshot cannot be saved, the CLI warns and preserves the runner's exit status. New Rust projects ignore `.aoc-toolkit/`. Generated-project tests cover a successful solver run with an invalid snapshot, including the warning and preservation of the snapshot contents. Progress records will contain no puzzle answers, puzzle inputs, or session tokens.
The local Rust runner can list registered puzzle days as sorted JSON pairs through its internal `registry` command. An empty registry returns an empty list, and listing does not execute solvers. The application can load the registry through the project's configured Rust adapter and rejects malformed, duplicate, or unsorted entries.
The edition model combines calendar availability, solver registration, and the last local outcome of each part. An unavailable registry yields unknown registration. Stored outcomes remain visible even if a solver is removed from the registry.
A macOS smoke test ran the development CLI with the runner from `v0.1.0-alpha.3` and synthetic cached input. Both solver parts completed successfully, and the CLI did not create a progress snapshot when the older runner produced no report.
## Verified stars
The project-independent star store persists a versioned snapshot per account and edition in the toolkit cache. Each snapshot stores the sync timestamp and verified star counts for the covered days. Days outside that coverage have unknown star status. The account-switch test verifies that each account retains its own snapshot.
The HTTP client has a shared authenticated HTML reader that validates status, content type, UTF-8, and a logout link. The settings endpoint uses it today. The edition calendar request also uses it and shares the input-download lock and cooldown. Mocked HTTP tests cover an authenticated calendar request and a logged-out page returned with HTTP 200. The calendar parser requires a signed-in page and a complete set of unlocked day links before accepting star counts. Synthetic fixtures cover zero stars, partial progress, logged-out pages, and malformed calendars.
The application can explicitly refresh verified stars for the effective account and selected edition. Calendar attempts are throttled per account and edition for 15 minutes, including after a failed attempt. A throttled refresh can return the previous snapshot, and a failed refresh preserves its last successful sync time. Use `aoc progress --year 2025 --sync` to request a refresh or `aoc progress --year 2025` to read the saved snapshot without HTTP. Both commands report the source and last successful sync time when a snapshot is available. If set, `AOC_TOOLKIT_CONTACT` adds the user's contact details to the sync client's User-Agent.
A macOS smoke test successfully refreshed the signed-in 2025 calendar, reused the snapshot on an immediate second sync, and read it offline. All three invocations reported the same successful sync timestamp. The live snapshot contained zero stars; synthetic tests cover nonzero star counts.
The edition report combines the local progress model with a matching verified star snapshot. It derives earned stars, possible stars, and completed days for use by both CLI and README renderers.
The CLI renders the combined edition report as one row per calendar day. The table shows availability, solver registration, local outcomes, and verified stars separately. Outside a project, cached star data remains available and solver registration is shown as unknown. The offline CLI test covers earned, missing, and unknown stars and verifies that a 12-day edition stops at day 12.
Without a year selector, `aoc progress` shows the current Advent of Code edition. `--all` shows editions newest first using saved data, and `--sync` refreshes a single edition.
## README export
The Markdown renderer uses the same edition report as the CLI. Its summary distinguishes an absent snapshot from a verified zero and marks partial coverage as a lower bound. Its daily matrix distinguishes unknown, locked, and out-of-edition days. The README writer requires opt-in through `progress.readme.enabled`, updates only the managed section, and atomically replaces an existing file inside the project. Use `aoc progress --year 2025 --readme` to write the section. The default destination is `README.md`; `progress.readme.path` selects an existing project-relative file. An identical export leaves the file untouched.
Set `update_on_run = true` under `[progress.readme]` to refresh the README after a run records part outcomes. This writes the all-editions view from saved progress and does not request a star refresh. A README error is reported as a warning without changing the runner's exit status.
```toml
[progress.readme]
enabled = true
path = "README.md"
update_on_run = true
```
Place these markers on separate lines around the section to manage:
```markdown
<!-- aoc-toolkit:progress:start -->
<!-- aoc-toolkit:progress:end -->
``` The managed section requires exactly one start marker followed by one end marker, each on its own line. Replacement preserves the marker lines and surrounding content, and uses the opening marker’s line ending for generated text.
Use `aoc progress --year 2025 --readme --dry-run` to print the generated Markdown without modifying a README. The preview also supports `--all`.