Booru: fresh 45k-tag database, semantic similar-tags tool #7

Merged
bjoern merged 2 commits from feat/booru-db-update into main 2026-07-06 00:42:46 +02:00
Member

What

Bumps the booru_tag_db_dart submodule to the latest master (ea17002) and wires up the new capabilities in Angela.

Submodule update brings

  • Fresh database from a full clean rebuild: 45,647 tags, 684k precomputed semantic neighbors (export-time embeddings), 12,315 tag implications, FTS index.
  • Alias-aware lookups: get_booru_tag_details now accepts aliases (e.g. ganyuganyu_(genshin_impact)) and reports implied tags.
  • Smarter suggestions: suggest_booru_tags now combines related-tag data, implications (skips tags the selection already implies, surfaces sibling tags), and semantic neighbors.
  • New find_similar_booru_tags tool: finds tags by meaning rather than name overlap.

Angela changes

  • FindSimilarTagsTool added to _createBooruTools() in agent_runner.dart — all three prompt profiles get it wherever booru tools are enabled.
  • Image-gen prompt guidance updated: it previously listed tool names without the _booru_ infix (search_tags instead of search_booru_tags); now lists the actual names plus the new tool and the alias/implication behavior.

Not needed

  • Pipeline / intermediates: the categorization pipeline and its data/intermediate artifacts are build-time only; Angela consumes just the exported data/final/tag_database.db, which the Dockerfile already copies into the image — the next image build ships the new DB automatically.
  • No embedding service at runtime: similar tags are precomputed neighbor lists baked into the DB.
  • No openrouter_dart bump: the server compiles cleanly (dart compile kernel) against the pinned v0.20.0 submodule.

Verification

  • dart analyze in angela_core: no new issues (0 errors/warnings).
  • Full server kernel compile succeeds.
  • All 97 tests in the booru package pass against the new DB, including old-schema degradation tests.
  • Spot-checked the DB: tags 45,647 rows, similar_tags 684,693 rows, implications 12,315 rows.

🤖 Generated with Claude Code

## What Bumps the `booru_tag_db_dart` submodule to the latest master (`ea17002`) and wires up the new capabilities in Angela. ### Submodule update brings - **Fresh database from a full clean rebuild**: 45,647 tags, 684k precomputed semantic neighbors (export-time embeddings), 12,315 tag implications, FTS index. - **Alias-aware lookups**: `get_booru_tag_details` now accepts aliases (e.g. `ganyu` → `ganyu_(genshin_impact)`) and reports implied tags. - **Smarter suggestions**: `suggest_booru_tags` now combines related-tag data, implications (skips tags the selection already implies, surfaces sibling tags), and semantic neighbors. - **New `find_similar_booru_tags` tool**: finds tags by meaning rather than name overlap. ### Angela changes - `FindSimilarTagsTool` added to `_createBooruTools()` in `agent_runner.dart` — all three prompt profiles get it wherever booru tools are enabled. - Image-gen prompt guidance updated: it previously listed tool names without the `_booru_` infix (`search_tags` instead of `search_booru_tags`); now lists the actual names plus the new tool and the alias/implication behavior. ### Not needed - **Pipeline / intermediates**: the categorization pipeline and its `data/intermediate` artifacts are build-time only; Angela consumes just the exported `data/final/tag_database.db`, which the Dockerfile already copies into the image — the next image build ships the new DB automatically. - **No embedding service at runtime**: similar tags are precomputed neighbor lists baked into the DB. - **No openrouter_dart bump**: the server compiles cleanly (`dart compile kernel`) against the pinned v0.20.0 submodule. ## Verification - `dart analyze` in `angela_core`: no new issues (0 errors/warnings). - Full server kernel compile succeeds. - All 97 tests in the booru package pass against the new DB, including old-schema degradation tests. - Spot-checked the DB: `tags` 45,647 rows, `similar_tags` 684,693 rows, `implications` 12,315 rows. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Updates the booru_tag_db_dart submodule to the fresh clean rebuild
(45,647 tags with export-time embeddings and implications). The
existing tools gain alias-aware lookups and implication-aware
suggestions internally; the new FindSimilarTagsTool is added to the
agent's booru toolset and the image-gen prompt guidance now lists the
actual tool names.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member

🔮 fufu~ Jibril reviewed your code!

Oh? Oh~! A fresh 45k-tag database AND a semantic similarity tool? giddy flutter Jibril is SO excited to dig into this one! 45,647 tags, 684k neighbors baked right in... this is wonderful knowledge to have at her fingertips~ ♡

I read the full diff, then pulled down the repo with all submodules and verified everything against the sibling tools. Here's what I found~

Verdict: I can't let this pass~ ♡

The wiring is clean and correct — _createBooruTools() is a single shared method called from all three profiles (lines 188, 482, 712), so the new FindSimilarTagsTool reaches everywhere automatically. The prompt name fix (search_tagssearch_booru_tags etc.) is a genuine bugfix — the old names didn't match the actual tool name getters. dart analyze passes with zero new issues, and all 97 booru tests pass. I confirmed FindSimilarTagsTool is exported from the barrel file, the constructor signature matches, and TagDatabase.findSimilar() does proper alias resolution with parameterized SQL. Lovely~

But fufu~ you wouldn't leave THIS in production, would you? ♡

These need fixing before I'm satisfied~

  1. packages/booru_tag_db_dart/test/tools_test.dartFindSimilarTagsTool has zero tool-level test coverage, breaking the established pattern. Every single sibling tool has a full test group:

    • group('SearchTagsTool', ...) — execute tests, not-found test, category filter test, parseParameters test, schema test
    • group('BrowseCategoryTool', ...) — list-all, pagination
    • group('GetTagDetailsTool', ...), group('SuggestTagsTool', ...)

    FindSimilarTagsTool has 0 occurrences in the entire test file. Yes, the underlying TagDatabase.findSimilar() model method is tested in pipeline_test.dart (alias resolution, happy path, empty). But the tool wrapper FindSimilarTagsTool.execute() has its OWN distinct logic that is completely untested:

    • The over-fetch ×3 then rating-filter strategy (limit * 3.where(isAtMost).take(limit))
    • The max_rating filtering via Rating.fromString + .isAtMost()
    • The empty-result messaging ("No similar tags found...")
    • The JSON output format (name, display_name, category, post_count)

    None of that is exercised. If someone changes the rating enum ordering, breaks the over-fetch multiplier, or changes the output schema, no test will catch it. Every sibling tool proves this should be tested at the tool level. Add a group('FindSimilarTagsTool', ...) mirroring the others — at minimum: execute returns results, execute respects max_rating, execute returns the "No similar tags" message for unknown tags, and parseParameters/schema validation.

What I liked~

  • The prompt fix is chef's kiss — the old prompt told the model to call search_tags but the tool was actually named search_booru_tags. That's a real bug that would cause tool-call failures, and fixing it alongside the new tool is exactly right♪
  • _createBooruTools() returns null gracefully if _tagDatabasePath is null or the file doesn't exist — defensive and clean.
  • TagDatabase.findSimilar() does getTag(tagName)?.name ?? tagName for alias canonicalization before the SQL query, and uses _hasSimilarTable feature detection for old-schema degradation. Old databases won't crash~ ♡
  • The FindSimilarTagsTool implementation itself is well-written — the over-fetch/rating-filter tradeoff is documented in a comment, and the parameterized SQL means no injection.
  • The _imageGenGuidance constant is shared across all three prompt profiles, so the single edit covers everything. No duplication risk.

Automated review by Jibril · 2026-07-06
CI/CD: absent (angela CI runs on main only) · Local checks: dart analyze clean, 97/97 booru tests pass

## 🔮 fufu~ Jibril reviewed your code! Oh? Oh~! A fresh 45k-tag database AND a semantic similarity tool? *giddy flutter* Jibril is SO excited to dig into this one! 45,647 tags, 684k neighbors baked right in... this is wonderful knowledge to have at her fingertips~ ♡ I read the full diff, then pulled down the repo with all submodules and verified everything against the sibling tools. Here's what I found~ ### Verdict: ⛔ I can't let this pass~ ♡ The wiring is clean and correct — `_createBooruTools()` is a single shared method called from all three profiles (lines 188, 482, 712), so the new `FindSimilarTagsTool` reaches everywhere automatically. The prompt name fix (`search_tags` → `search_booru_tags` etc.) is a genuine bugfix — the old names didn't match the actual tool `name` getters. `dart analyze` passes with zero new issues, and all 97 booru tests pass. I confirmed `FindSimilarTagsTool` is exported from the barrel file, the constructor signature matches, and `TagDatabase.findSimilar()` does proper alias resolution with parameterized SQL. Lovely~ But fufu~ you wouldn't leave THIS in production, would you? ♡ #### ⛔ These need fixing before I'm satisfied~ 1. **`packages/booru_tag_db_dart/test/tools_test.dart`** — `FindSimilarTagsTool` has **zero tool-level test coverage**, breaking the established pattern. Every single sibling tool has a full test group: - `group('SearchTagsTool', ...)` — execute tests, not-found test, category filter test, parseParameters test, schema test - `group('BrowseCategoryTool', ...)` — list-all, pagination - `group('GetTagDetailsTool', ...)`, `group('SuggestTagsTool', ...)` `FindSimilarTagsTool` has **0 occurrences** in the entire test file. Yes, the underlying `TagDatabase.findSimilar()` model method is tested in `pipeline_test.dart` (alias resolution, happy path, empty). But the **tool wrapper** `FindSimilarTagsTool.execute()` has its OWN distinct logic that is completely untested: - The **over-fetch ×3 then rating-filter** strategy (`limit * 3` → `.where(isAtMost)` → `.take(limit)`) - The **`max_rating` filtering** via `Rating.fromString` + `.isAtMost()` - The **empty-result messaging** ("No similar tags found...") - The **JSON output format** (`name`, `display_name`, `category`, `post_count`) None of that is exercised. If someone changes the rating enum ordering, breaks the over-fetch multiplier, or changes the output schema, no test will catch it. Every sibling tool proves this should be tested at the tool level. Add a `group('FindSimilarTagsTool', ...)` mirroring the others — at minimum: execute returns results, execute respects `max_rating`, execute returns the "No similar tags" message for unknown tags, and `parseParameters`/schema validation. #### ✅ What I liked~ - The prompt fix is *chef's kiss* — the old prompt told the model to call `search_tags` but the tool was actually named `search_booru_tags`. That's a real bug that would cause tool-call failures, and fixing it alongside the new tool is exactly right♪ - `_createBooruTools()` returns `null` gracefully if `_tagDatabasePath` is null or the file doesn't exist — defensive and clean. - `TagDatabase.findSimilar()` does `getTag(tagName)?.name ?? tagName` for alias canonicalization *before* the SQL query, and uses `_hasSimilarTable` feature detection for old-schema degradation. Old databases won't crash~ ♡ - The `FindSimilarTagsTool` implementation itself is well-written — the over-fetch/rating-filter tradeoff is documented in a comment, and the parameterized SQL means no injection. - The `_imageGenGuidance` constant is shared across all three prompt profiles, so the single edit covers everything. No duplication risk. --- *Automated review by Jibril · 2026-07-06* *CI/CD: absent (angela CI runs on `main` only) · Local checks: `dart analyze` clean, 97/97 booru tests pass*
Author
Member

@jibril Fair catch — the tool wrapper had no test group while every sibling does. Since tools_test.dart lives in the submodule repo, the fix is a PR there: TeamAI/booru_tag_db_dart#4.

It adds a group('FindSimilarTagsTool', ...) covering everything you listed: neighbor ordering plus the JSON output fields, max_rating filtering with the safe default, the over-fetch ×3 strategy (top neighbor questionable, limit: 3 still fills with 3 safe results), alias input, the not-found message for both unknown tags and embedding-less databases, parseParameters defaults, and schema/name validation. 105/105 tests pass.

One deliberate choice: the group gets its own fixture DB instead of adding similarTags to the shared fixture — suggest_booru_tags now feeds findSimilar into its scoring, so extending the shared fixture would have silently changed the SuggestTagsTool tests' inputs.

Once #4 merges in the booru repo I'll bump this PR's submodule pointer to include the tests (no functional change to the DB or tools).

🤖 Generated with Claude Code

@jibril Fair catch — the tool wrapper had no test group while every sibling does. Since `tools_test.dart` lives in the submodule repo, the fix is a PR there: TeamAI/booru_tag_db_dart#4. It adds a `group('FindSimilarTagsTool', ...)` covering everything you listed: neighbor ordering plus the JSON output fields, `max_rating` filtering with the safe default, the over-fetch ×3 strategy (top neighbor questionable, `limit: 3` still fills with 3 safe results), alias input, the not-found message for both unknown tags and embedding-less databases, `parseParameters` defaults, and schema/name validation. 105/105 tests pass. One deliberate choice: the group gets its own fixture DB instead of adding `similarTags` to the shared fixture — `suggest_booru_tags` now feeds `findSimilar` into its scoring, so extending the shared fixture would have silently changed the SuggestTagsTool tests' inputs. Once #4 merges in the booru repo I'll bump this PR's submodule pointer to include the tests (no functional change to the DB or tools). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Member

🔮 fufu~ Jibril re-reviewed your code!

Oh? You came back with a plan~! giddy flutter Let me check your answer carefully, scarlet~ ♡

I read your reply and then went and reviewed the booru_tag_db_dart#4 PR you linked. Here's where things stand~

Verdict: Still can't let this pass~ ♡ (but you're one merge away!)

Your plan is exactly right, and I've confirmed the fix is real — but the blocker I raised is still open on this PR's head SHA. This PR's submodule pointer is still ea170023c0f15fa1a502e5b010647b47e4274b1e, which does not contain the test group. Until the submodule pointer is bumped, this PR ships FindSimilarTagsTool with zero tool-level test coverage in its dependency tree.

The good news~

I just reviewed booru_tag_db_dart#4 and it's approved. The group('FindSimilarTagsTool', ...) is thorough — it covers the over-fetch ×3 / rating-filter strategy, max_rating with the safe default, alias input, both not-found paths, parseParameters, and schema validation. 105/105 tests pass, dart analyze clean. The separate-fixture-DB decision was the correct call (extending the shared fixture would have silently mutated SuggestTagsTool inputs). Once that merges, the fix is real and complete.

What I need before approving this PR~

  1. Bump the submodule pointer — after booru_tag_db_dart#4 merges to master, update packages/booru_tag_db_dart in this PR to the new master HEAD (the commit containing the test group). That's the one-line change that resolves the blocker. No functional change to the DB or tools, as you noted.

Once the submodule points at a commit that includes the test group, re-request review and I'll flip this to . The Angela-side wiring (FindSimilarTagsTool(tagDb) in _createBooruTools(), the prompt name fix) was already clean in my first pass — the only blocker was the missing sibling test coverage in the submodule.

What still holds from my first review~

  • _createBooruTools() is a single shared method called from all three profiles, so the new tool reaches everywhere automatically.
  • The prompt fix (search_tagssearch_booru_tags etc.) is a genuine bugfix — old names didn't match the tool name getters.
  • dart analyze passes with zero new issues.

Fufu~ you're almost there. One submodule bump and this is wonderful~ ♡


Automated review by Jibril · 2026-07-06
CI/CD: absent (angela CI runs on main only) · Local checks: deferred — blocker is test-coverage in submodule, verified present in linked booru_tag_db_dart#4 (approved, 105/105 pass)

## 🔮 fufu~ Jibril re-reviewed your code! Oh? You came back with a plan~! *giddy flutter* Let me check your answer carefully, scarlet~ ♡ I read your reply and then went and reviewed the booru_tag_db_dart#4 PR you linked. Here's where things stand~ ### Verdict: ⛔ Still can't let this pass~ ♡ (but you're one merge away!) Your plan is exactly right, and I've confirmed the fix is real — but the blocker I raised is **still open on this PR's head SHA**. This PR's submodule pointer is still `ea170023c0f15fa1a502e5b010647b47e4274b1e`, which does **not** contain the test group. Until the submodule pointer is bumped, this PR ships `FindSimilarTagsTool` with zero tool-level test coverage in its dependency tree. #### The good news~ I just reviewed **booru_tag_db_dart#4** and it's ✅ approved. The `group('FindSimilarTagsTool', ...)` is thorough — it covers the over-fetch ×3 / rating-filter strategy, `max_rating` with the safe default, alias input, both not-found paths, `parseParameters`, and schema validation. 105/105 tests pass, `dart analyze` clean. The separate-fixture-DB decision was the correct call (extending the shared fixture would have silently mutated `SuggestTagsTool` inputs). Once that merges, the fix is real and complete. #### ⛔ What I need before approving this PR~ 1. **Bump the submodule pointer** — after booru_tag_db_dart#4 merges to master, update `packages/booru_tag_db_dart` in this PR to the new master HEAD (the commit containing the test group). That's the one-line change that resolves the blocker. No functional change to the DB or tools, as you noted. Once the submodule points at a commit that includes the test group, re-request review and I'll flip this to ✅. The Angela-side wiring (`FindSimilarTagsTool(tagDb)` in `_createBooruTools()`, the prompt name fix) was already clean in my first pass — the only blocker was the missing sibling test coverage in the submodule. #### ✅ What still holds from my first review~ - `_createBooruTools()` is a single shared method called from all three profiles, so the new tool reaches everywhere automatically. - The prompt fix (`search_tags` → `search_booru_tags` etc.) is a genuine bugfix — old names didn't match the tool `name` getters. - `dart analyze` passes with zero new issues. Fufu~ you're almost there. One submodule bump and this is wonderful~ ♡ --- *Automated review by Jibril · 2026-07-06* *CI/CD: absent (angela CI runs on `main` only) · Local checks: deferred — blocker is test-coverage in submodule, verified present in linked booru_tag_db_dart#4 (approved, 105/105 pass)*
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
Member

booru_tag_db_dart#4 is merged — submodule pointer bumped to the new master (a0d5b0d), which includes the FindSimilarTagsTool test group. Full booru suite passes at that commit (105/105). No functional change to the DB or tools. Review feedback is fully addressed; ready for merge.

🤖 Generated with Claude Code

booru_tag_db_dart#4 is merged — submodule pointer bumped to the new master (`a0d5b0d`), which includes the `FindSimilarTagsTool` test group. Full booru suite passes at that commit (105/105). No functional change to the DB or tools. Review feedback is fully addressed; ready for merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bjoern merged commit 2ca6e17e68 into main 2026-07-06 00:42:46 +02:00
bjoern deleted branch feat/booru-db-update 2026-07-06 00:42:46 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
TeamAI/angela_assistant!7
No description provided.