docs: tidy up documentation and fix scan behavior bugs#533
Merged
wizzomafizzo merged 8 commits intomainfrom Feb 9, 2026
Merged
docs: tidy up documentation and fix scan behavior bugs#533wizzomafizzo merged 8 commits intomainfrom
wizzomafizzo merged 8 commits intomainfrom
Conversation
Cut ~35% (500 → 324 lines) by eliminating duplicate guidance stated in multiple places, removing prose that restates linter rules, and merging fragmented sections. Promotes Safety & Permissions to position 2, folds Good Examples and Testing Quick Reference into their parent sections, and trims commit guidelines. All high-value content preserved.
- Add zapScript field to media search and active media objects
- Fix media.active to return single object or null, not array
- Fix media.generate to document background indexing behavior
- Add readerId to token object and tokens.added notification
- Add readerId param to readers.write and readers.write.cancel
- Add readerId and driver fields to reader info object
- Fix mappings.new result from {id} to empty object {}
- Fix settings example readersScanMode from "insert" to "tap"
- Add health, inbox, inbox.delete, inbox.clear to method table
- Update launch endpoint to document /run/ (preferred) and /l/ (deprecated)
- Remove unused "running" notification, add inbox.added
- Update method count from 26 to 33
- Fix import paths to include /v2 module prefix - Fix matcher functions attributed to fixtures instead of helpers - Remove reference to non-existent fixtures.SampleSystems() - Remove reference to non-existent ProcessTokenWorkflow function - Update directory tree to match actual file layout - Expand fuzz test file list from 5 to all 7 files - Expand property test file list from 5 to all 11 files - Replace overstated clockwork claim with specific file references - Remove non-existent TDD Guard section from pkg/testing/README.md
- Replace pass-through description for Movie/Music parsers with actual step-by-step summaries matching current implementations - Fix title extraction pipeline from 10 steps to 8 (year extract/re-append never existed in code) - Fix complete example: SplitAndStripArticles preserves "Legend of", only strips leading "The" - Align ParseGame with code: width normalization as pre-step, 9 numbered steps - Expand TV show section from 2 bullets to 9 steps covering all supported episode formats - List all 8 media types including pass-through types - Add 2 undocumented special patterns (bracketless versions, edition/version word detection) - Expand variant exclusion list to match code (all unfinished, unlicensed, and dump categories) - Fix tag output values to match code (leading zeros stripped, periods normalized to dashes)
- Fix system ID examples to use canonical casing (SNES, Genesis, PSX) - Remove unnecessary "ask before" items (task test, task build, govulncheck) - Update Go version requirement from 1.23 to 1.25 - Fix Dockerfile path from scripts/linux_amd64/ to scripts/zigcc/ - Clarify deploy tasks are platform-specific
Automate the manual scan-behavior.md checklist as integration tests that run the real pipeline (readerManager + processTokenQueue) with only the platform boundary mocked. Production fixes in readers.go: - Fix timer duration truncation (float32 exit_delay now preserves sub-second values via float64 multiplication) - Fix reinsert detection comparing against software token instead of active card (was checking wrong state) - Fix timedExit goroutine leak (now exits via context cancellation) - Fix log message printing state object instead of software token Test infrastructure: - Add clock injection (clockwork.FakeClock) to readerManager for deterministic timer testing - Add syncutil.Mutex to MockPlatform for thread-safe tracking slices
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ests
filepath.IsAbs("/mock/roms/...") returns false on Windows because
there's no drive letter. Use filepath.Join(t.TempDir(), ...) to
construct paths that are absolute on all platforms.
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.
Summary
pkg/service/readers.godiscovered while writing scan behavior testsdocs/scan-behavior.mdmanual checklistMockPlatformviasyncutil.MutexScan behavior fixes (readers.go)
float32exit_delay now preserves sub-second values viafloat64multiplication instead of truncating throughtime.DurationcasttimedExitgoroutine now exits via context cancellation instead of blocking forever on a stopped timer channelScan behavior tests (scan_behavior_test.go)
Runs the real pipeline (
readerManager+processTokenQueue) end-to-end with only the platform boundary mocked. Usesclockwork.FakeClockfor deterministic timer testing.Tap mode (7 tests): removal doesn't close game, duplicate suppression, different card launches directly (no stop between), same card reloads after removal, command doesn't interrupt, manual exit resets state, manual exit with card doesn't relaunch
Hold immediate (3 tests): removal closes game, manual exit no relaunch, manual exit then remove no reload
Hold delayed (7 tests): removal closes after delay, reinsert cancels exit, different card launches immediately, command cards repeatedly reset countdown, manual exit no relaunch, manual exit then remove no reload, manual exit during countdown cancels