Documentation maintenance and releases
README is the project introduction and quickstart; HACKING is the contributor entry point. Detailed content lives in docs/ and is rendered directly by Docusaurus. Keep examples and links useful when reading Markdown on GitHub too.
The Scripts quality CI job separately enforces Python lint, formatting, types, and 100% production line/branch coverage, including child processes. See the development guide for the complete local gate. The documentation job still checks real tracer output and builds the site; external-tool stand-ins in the Python suite do not replace that integration check.
Local checks
Use Node.js 22 or later (CI uses 22) and a full JDK. Local Python commands use ./scripts/uv, which selects the managed interpreter and scripts project; that project requires Python 3.15 or later and pins 3.15. See scripts/AGENTS.md in the repository for wrapper behavior. The npm scripts invoke python3 from their inherited environment. CI runs Python checks and npm documentation builds through ./scripts/uv run --locked, selecting the managed interpreter and locked tooling. Use ./scripts/uv run npm ... locally too; invoking npm directly requires a compatible Python already on PATH. From the repository root:
./mvnw -B -ntp package -DskipTests
./scripts/uv run npm --prefix website ci
./scripts/uv run python scripts/check_docs.py
./scripts/uv run python scripts/docs_release.py check
./scripts/uv run python -m unittest discover -s scripts/tests -t scripts
./scripts/uv run npm --prefix website run build
./scripts/uv run python scripts/check_site.py
Preview with ./scripts/uv run npm --prefix website start, or serve the production build with ./scripts/uv run npm --prefix website run serve. Open the printed URL under /cs1302-tracer/. The build wrapper owns website/build; custom output directories, site roots, and configuration overrides are rejected before generation. start accepts --host, --port (or -p), and --no-open; both start and build accept --no-minify.
Both start and build generate Javadoc first; ./scripts/uv run npm --prefix website run api generates it separately. Fetch release tags with git fetch --tags before building. For a direct Maven invocation, run ./mvnw -B -ntp validate javadoc:javadoc. The wrapper includes validate so the build-helper execution sets currentYear before Javadoc resolves the copyright footer. The published API reference intentionally excludes cs1302.tracer.internal and its subpackages. When internal Javadoc changes, also generate a local reference that includes private declarations, then review the affected generated pages:
./mvnw -B -ntp package -DskipTests
javadoc -quiet -private --release 21 -Xdoclint:all,-missing \
-classpath target/code-tracer-jar-with-dependencies.jar \
-sourcepath src/main/java -subpackages cs1302.tracer \
-overview src/main/javadoc/overview.html \
-d target/internal-apidocs
This local reference is for contributor review; internal declarations remain outside the supported Java API. Both generation commands check Javadoc syntax and links, but claims about defaults, ownership, and behavior still need to be checked against the implementation and tests.
The API Reference navigation link follows the selected documentation version. Javadoc keeps its own navigation, search, and styling under api/next/ for development and api/<version>/ for releases, beneath the site's /cs1302-tracer/ base path.
Release API references are rebuilt from their exact Git tags on every deployment, including all previously published documentation versions. Missing tags, mismatched Maven versions, and Javadoc errors fail the build. Deployment selects the same published releases for guides and API references. Local builds preview all prepared snapshots; an untagged snapshot matching the current Maven version, or its target version after removing a trailing -SNAPSHOT, uses working source until release. Such a snapshot has an unreleased banner in preview mode. Published mode still requires a release tag whose Maven version exactly matches the stable snapshot; a -SNAPSHOT build cannot substitute for a published release. Generated HTML lives in ignored website/generated-api/ and is copied into the site build, rather than committed.
Build mode is explicit: start, build, and api default to --mode preview. A leftover published-versions.json never changes their behavior. To reproduce a published build, save the GitHub release records as a JSON array and run:
./scripts/uv run npm --prefix website run build -- --mode published --releases /path/to/releases.json
The Python documentation release module validates selection, tag provenance, and routes once. It generates ignored website/release-manifest.json for Javadoc, Docusaurus, and navigation. The completed build includes its own copy of the manifest so validation and local serving use the decisions belonging to that build. The legacy docs_release.py published command still exports a selected-version list for inspection; that file no longer selects the build mode.
check_docs.py compares CLI help to the executable, runs the marked quickstart blocks, checks Markdown file destinations, compares both JSON examples after normalizing heap identities, and runs the documented batch request. Refresh help using ./scripts/uv run python scripts/check_docs.py --update-cli; review the resulting diff. The CLI reference keeps generated help and budget links above <!-- cli-reference:manual -->. Maintain behavioral notes below that marker; help regeneration preserves those notes, and normal checks still require an exact match for the generated prefix. Link checks cover the entire document. Review authored notes against executable behavior whenever arguments change. When behavior changes, update JSON examples intentionally and review the contract. The site build and check_site.py check rendered internal links, fragments, and project-base-path handling. Prose accuracy still requires review.
The scheduled External documentation links workflow checks remote links and uploads a report. It is not a required PR check because remote availability is outside this repository's control. A newly configured site can return 404 until its first deployment.
Prepare a stable release
Versioned documentation begins with the first release using this workflow. The tracked snapshots start at 3.2.1; older software releases have no documentation snapshot. The preparation command rejects an already-tagged version.
- Fetch release tags with
git fetch --tags. Set the intended new, stablex.y.zversion inpom.xmland finish the docs. - Build the JAR, regenerate CLI help if necessary, and run documentation checks.
- Run
./scripts/uv run npm --prefix website run release:prepare. This snapshotsdocs/and the sidebar using the Maven version. Review and commitwebsite/versions.json,website/versioned_docs/, andwebsite/versioned_sidebars/with the release changes. - Merge the release preparation into
mainbefore tagging. Never remove earlier snapshots. If preparation changes, edit the pending snapshot to matchdocs/and run./scripts/uv run python scripts/docs_release.py check --tag vX.Y.Zagain. - Push a tag
vX.Y.Z(orX.Y.Z) at that merged commit. CI requires exact agreement among the tag, Maven version, current docs, snapshot, and sidebar before the JAR release job can run. This pipeline handles stable releases only.
Local builds show all prepared snapshots so reviewers can inspect them. Deployment obtains published, non-prerelease GitHub releases and filters snapshots against that list. A prepared but unpublished snapshot therefore never becomes the public default. The highest published semantic version becomes the default, even if an older release is published later. Each release keeps its version URL; development uses /next/.
Publishing and retrying
A development -SNAPSHOT build may retain a prepared stable documentation snapshot. Keep it synchronized with current docs, and run the ordinary metadata check while developing. The tag check intentionally rejects the Maven suffix. Restore the stable Maven version and rerun the exact tag/snapshot agreement check before tagging.
The Deploy documentation workflow runs after successful push runs of CI / Release, including tag releases, or through Run workflow on main. It checks out the latest main, verifies docs again, builds the complete site, uploads a Pages artifact, and deploys using the github-pages environment. The workflow is serialized with cancellation disabled. Every run rebuilds the latest state so a retry of an older release cannot replace newer docs with an old checkout.
GitHub releases created by the CI token do not need to trigger another release event: deployment uses workflow_run after CI / Release completes. The software release needs documentation validation, but does not depend on Pages deployment. For an outage, rerun Deploy documentation or dispatch it on main; do not recreate the tag or software release. Build artifacts are also downloadable from PR checks for local review; PRs do not deploy publicly.
Release snapshots are retained in Git. Correct an older release's documentation by editing its snapshot in a reviewed PR; do not describe unreleased behavior there. For a broken site deployment, revert the responsible docs/configuration change on main and dispatch deployment again. Deleting a published release removes it from the next public version selection, but does not delete its source snapshot.
Release rehearsal
Run ./scripts/uv run python scripts/rehearse_docs_release.py after installing site dependencies. It creates two artificial versions in a disposable tree, builds the site before and after publishing the second version, checks stable routing and retained archives, and verifies that retry selection is deterministic. It does not create GitHub releases, push tags, or modify real documentation snapshots.
Repository rollout
Required repository settings: Pages uses GitHub Actions as its source; main can deploy to the github-pages environment; and Documentation is a required GitHub Actions status check for main. These are configured in GitHub, not by the workflow YAML. Preserve other existing protection settings when recreating or modifying them. The check is defined in CI / Release and runs on every PR, including code-only PRs.
The workflow files define these checks and deployment triggers. After deployment, verify the landing page, version menu, Mermaid diagrams, and a nested page at the real GitHub Pages URL. Repository protection, Pages permissions, and live deployment state must be verified in GitHub; their presence cannot be inferred from tracked configuration or a successful local build.