No description
  • Scheme 97%
  • Makefile 2.3%
  • Common Lisp 0.7%
Find a file
2026-07-30 15:47:29 -06:00
.builds ci: set umask 022 in package/verify tasks too (jerbuild creates group-writable cache dirs during pkg operations) 2026-07-22 13:10:59 -06:00
ssd-recognizer Add Jerboa SSD recognizer 2026-07-15 08:32:39 -06:00
.gitignore Add Jerboa SSD recognizer 2026-07-15 08:32:39 -06:00
AGENTS.md docs: remove jerboa-emacs restriction 2026-07-30 15:47:29 -06:00
jpkg.sexp Add jpkg packaging 2026-07-21 15:09:27 -06:00
LICENSE Switch to MIT license 2026-07-21 13:42:20 -06:00
Makefile build: add missing security/lint targets 2026-07-21 12:27:02 -06:00
README.md Add Jerboa SSD recognizer 2026-07-15 08:32:39 -06:00
test-runner.ss Add Jerboa SSD recognizer 2026-07-15 08:32:39 -06:00

jerboa-ssd-recognizer

jerboa-ssd-recognizer is the Jerboa-owned recognizer for Star Fleet Battles SSD review data. It replaces the decision-making parts of the Python truth/OCR service with reusable .ss code.

The library does not implement an OCR engine. It consumes OCR words from a backend through jerboa-vision:

((text . "PH-1") (conf . 88) (bbox . (x1 y1 x2 y2)))

From there it owns the parts that must be identical on the server and APK:

  • box-type aliases and canonical labels
  • OCR text-to-box candidates
  • learned truth examples from approved groups
  • negative examples from deleted/suppressed groups
  • race gating, such as PA Panels for Andromedans only
  • feature scoring by count, position, size, aspect, and optional color
  • compact truth lookup and source/page/dpi matching

Build

make test

By default the Makefile expects ../jerboa-vision beside this checkout. Override with JERBOA_VISION=/path/to/jerboa-vision if needed.

API Shape

The main entry point is:

(ssd-recognize-groups payload)

Expected payload fields:

  • source: source metadata with name, path, optional source_key
  • image: rendered image width and height
  • groups: detected SSD groups with id, bbox, count, cell_ids
  • ocr_words: backend OCR words in rendered image coordinates
  • learned_examples: examples generated from approved truth files
  • box_types: SFBOL box type id/name list
  • inventory: optional ship inventory counts from SFBOL/SFC data

The result contains suggestions, each with group_id, label, box_type_id, confidence, reason, source, ocr_text, and candidate alternatives.

Truth service logic lives in ssd-recognizer/truth-store.ss. The important entry point is:

(ssd-matching-truth-entries entries params)

It implements the Python service behavior for exact source-key matches, source-name/page/dpi fallback matches, compact metadata, and sorting more complete truth files first.

Migration Target

The current Python service can be retired in stages:

  1. Keep Python only as an OCR backend that returns words.
  2. Move /api/recognize scoring to this library.
  3. Move truth load/save/dump to the Jerboa SSD web service.
  4. Generate Android/Kotlin or Jerboa-Android code from this same data model.
  5. Replace the OCR backend with Android ML Kit for fully offline APK use.