Repository navigation
feat(map-checker): add baseline mode for CI - #37
Merged
Merged
Conversation
--write-baseline records the current findings and --baseline fails a headless scan only on findings the baseline doesn't cover, so content CI can block new problems without first fixing every existing one. Both modes purge the scan cache to keep runs complete and repeatable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BPTYArGhoPqP7UdeUuUC5j
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
zoeyrose
added a commit
to atrinik/content
that referenced
this pull request
Nov 26, 2026
<!-- claude-projects-attribution: {"github_login":"zoeyrose"} -->
_Requested by **Zoey** · [project
thread](https://claude.ai/code/project/chan_01GqFGRfVxfKgHRxSgL4g4qr?thread=cmsg_01GqFGRfVxfKgHRxSgL4g4qr38thrxw4CAaXppYJEuqoHr)_
## Summary
Adds a `Map checker` job to `check.yml` so content PRs can't introduce
new map-checker problems:
1. Build the classic runtime with `tools/build_runtime.py --target
classic` into `build/map-checker-runtime`. No LFS checkout is needed.
2. Check out the Qt map checker from `atrinik/tools` at the revision
pinned in `MAP_CHECKER_REF`, then sync and verify its checksum-pinned
catalog.
3. Run a full scan with `--baseline tools/map-checker-baseline.json`.
The job fails on any finding the baseline doesn't cover.
`tools/map-checker-baseline.json` records the **5,416** findings that
exist on `main` today, so the gate starts green. Keys are
runtime-relative paths plus severity and description, without
coordinates, so moving objects doesn't trip it. Adding a new no-loot
NPC, or any other new problem, does. `AGENTS.md` now says to fix new
findings rather than baselining them, and how to regenerate the baseline
after fixing old ones.
The map checker is GPL-2.0-or-later and only runs as an external tool in
CI. Nothing from it is copied here.
## Dependencies
Pinned to `atrinik/tools@e36a878` (main, with
atrinik/tools#37 merged).
## Validation
- Local run of the exact job commands against a runtime built from this
branch: `No new map checker findings.`, exit 0. Two consecutive baseline
writes were byte-identical.
- `tools.tests.test_release_guidance`, `test_pr_metadata`,
`test_content_contracts` and `test_content_catalog` pass.
- `git diff --check`
---
_Generated by [Claude Code](https://claude.ai/code)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Zoey · project thread
Summary
The map checker's per-object checks don't run in any CI today, and a full headless scan exits 0 whatever it finds. Current content has about 5,400 findings, so a strict gate would fail immediately. This adds a baseline mode so content CI can block only new findings:
--write-baseline FILEwrites the current findings to a JSON baseline, as counts per key.--baseline FILEprints only the findings the baseline doesn't cover and exits 1 if there are any. It exits 2 when the baseline can't be read.--baseline-root DIRsets the root for relative paths in keys. It defaults to--directory.A key is the relative file path, severity and description with the X/Y coordinates removed. Moving an object therefore doesn't create a new finding, while adding another copy of an existing problem to the same file does.
fixedresults are ignored. Catalog diagnostics are never baselined, and the catalog gate stays strict.Both modes purge
map-checker.dbbefore scanning. Without that, the cache replays findings for unmodified files, and definition findings pile up across runs: my repeated local scans grew from 16k to 27k findings. With the purge, two consecutive scans write byte-identical baselines.The next step is a content CI job that builds the classic runtime, runs this checker at a pinned release, and compares against a committed baseline.
Validation
python3 -m unittest discover -s map-checker-qt/tests: 42 tests, including 6 new ones intests/test_baseline.py.python3 -W error -m compileall -q -f map-checker-qtatrinik/content@main:--write-baselinerecorded 5,416 findings twice, with identical output, and--baselineagainst it printedNo new map checker findings.and exited 0.git diff --checkGenerated by Claude Code