one_d4: motif_occurrences table, ORDER BY motif_count, sequence(), discovered_check#1050
Merged
one_d4: motif_occurrences table, ORDER BY motif_count, sequence(), discovered_check#1050
Conversation
…eries, discovered_check motif - Add normalized motif_occurrences table (ply, side, move_number, description per motif per game) with FK ON DELETE CASCADE and indexes on (game_url), (motif), (game_url, ply) - Pipe occurrence data through IndexWorker -> GameFeatureDao.insertOccurrences() - Expose occurrences in QueryController / GameFeatureRow API response - Add DISCOVERED_CHECK motif detector (discovered attack that also gives check) - ChessQL: add ORDER BY motif_count(X) [ASC|DESC] compiled to LEFT JOIN subquery - ChessQL: add sequence(A THEN B [THEN C...]) compiled to EXISTS with ply-gap self-JOINs - ChessQL: Parser.parse() now returns ParsedQuery(expr, orderBy); CompiledQuery now holds full SELECT SQL rather than a bare WHERE fragment - Fix MotifOccurrence.from() guard: use ply <= 0 instead of lastMove == null so unit tests that pass null lastMove still produce occurrences - DiscoveredCheckDetectorTest, roadmap motif accuracy + phase 9 dependencies tests: fill gaps for motif_occurrences and ChessQL features - GameFeatureDaoTest: insertOccurrences/queryOccurrences round-trip, empty list, unknown URL, ply-zero skip, query with CompiledQuery - QueryControllerTest: query returns games with occurrences, empty store, blank/null query validation - ParserTest: sequence(A THEN B) and ORDER BY motif_count(X) parsing - IndexWorkerTest: recording store, process_whenGameHasMotifs asserts insertOccurrences called with CHECK occurrences (Scholar's mate PGN) - IndexE2ETest: add CheckDetector and DiscoveredCheckDetector; e2e test createIndex then query returns games with occurrences - MigrationTest: motif_occurrences table and has_discovered_check column exist; insert/select motif_occurrences docs(one_d4): add architecture diagrams and discovered_check motif to README chore(one_d4): set HikariCP log level to INFO, add logback config to binary
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
1d4-web | 34136cd | Commit Preview URL Branch Preview URL |
Feb 24 2026, 10:27 PM |
- Remove motifs_json field from GameFeature DTO - Remove motifs_json column from game_features table schema - Add migration to drop motifs_json column for both H2 and PostgreSQL - Fix SQL INSERT statements to remove indexed_at from column list (using DEFAULT) - Remove ObjectMapper dependency from IndexWorker - Update all tests to use new GameFeature constructor without motifs_json
The previous commit dropped two ? placeholders from the H2 MERGE VALUES clause when removing motifs_json, but only one should have been removed. This caused a column count mismatch error on all H2 inserts.
- Rename the single job to format-check + add a new build-and-test job - format-check: drop fetch-depth, disk cache, disk cleanup, and resource bazelrc flags — none are needed for a lightweight format check - build-and-test: retains full history, disk cleanup, and disk cache needed for bazel-diff
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.
Adds normalized motif_occurrences table and ChessQL ORDER BY motif_count / sequence(); DiscoveredCheckDetector; tests and docs.