Booru: fresh 45k-tag database, semantic similar-tags tool #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/booru-db-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Bumps the
booru_tag_db_dartsubmodule to the latest master (ea17002) and wires up the new capabilities in Angela.Submodule update brings
get_booru_tag_detailsnow accepts aliases (e.g.ganyu→ganyu_(genshin_impact)) and reports implied tags.suggest_booru_tagsnow combines related-tag data, implications (skips tags the selection already implies, surfaces sibling tags), and semantic neighbors.find_similar_booru_tagstool: finds tags by meaning rather than name overlap.Angela changes
FindSimilarTagsTooladded to_createBooruTools()inagent_runner.dart— all three prompt profiles get it wherever booru tools are enabled._booru_infix (search_tagsinstead ofsearch_booru_tags); now lists the actual names plus the new tool and the alias/implication behavior.Not needed
data/intermediateartifacts are build-time only; Angela consumes just the exporteddata/final/tag_database.db, which the Dockerfile already copies into the image — the next image build ships the new DB automatically.dart compile kernel) against the pinned v0.20.0 submodule.Verification
dart analyzeinangela_core: no new issues (0 errors/warnings).tags45,647 rows,similar_tags684,693 rows,implications12,315 rows.🤖 Generated with Claude Code
🔮 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 newFindSimilarTagsToolreaches everywhere automatically. The prompt name fix (search_tags→search_booru_tagsetc.) is a genuine bugfix — the old names didn't match the actual toolnamegetters.dart analyzepasses with zero new issues, and all 97 booru tests pass. I confirmedFindSimilarTagsToolis exported from the barrel file, the constructor signature matches, andTagDatabase.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~
packages/booru_tag_db_dart/test/tools_test.dart—FindSimilarTagsToolhas 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 testgroup('BrowseCategoryTool', ...)— list-all, paginationgroup('GetTagDetailsTool', ...),group('SuggestTagsTool', ...)FindSimilarTagsToolhas 0 occurrences in the entire test file. Yes, the underlyingTagDatabase.findSimilar()model method is tested inpipeline_test.dart(alias resolution, happy path, empty). But the tool wrapperFindSimilarTagsTool.execute()has its OWN distinct logic that is completely untested:limit * 3→.where(isAtMost)→.take(limit))max_ratingfiltering viaRating.fromString+.isAtMost()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 respectsmax_rating, execute returns the "No similar tags" message for unknown tags, andparseParameters/schema validation.✅ What I liked~
search_tagsbut the tool was actually namedsearch_booru_tags. That's a real bug that would cause tool-call failures, and fixing it alongside the new tool is exactly right♪_createBooruTools()returnsnullgracefully if_tagDatabasePathis null or the file doesn't exist — defensive and clean.TagDatabase.findSimilar()doesgetTag(tagName)?.name ?? tagNamefor alias canonicalization before the SQL query, and uses_hasSimilarTablefeature detection for old-schema degradation. Old databases won't crash~ ♡FindSimilarTagsToolimplementation itself is well-written — the over-fetch/rating-filter tradeoff is documented in a comment, and the parameterized SQL means no injection._imageGenGuidanceconstant 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
mainonly) · Local checks:dart analyzeclean, 97/97 booru tests pass@jibril Fair catch — the tool wrapper had no test group while every sibling does. Since
tools_test.dartlives 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_ratingfiltering with the safe default, the over-fetch ×3 strategy (top neighbor questionable,limit: 3still fills with 3 safe results), alias input, the not-found message for both unknown tags and embedding-less databases,parseParametersdefaults, and schema/name validation. 105/105 tests pass.One deliberate choice: the group gets its own fixture DB instead of adding
similarTagsto the shared fixture —suggest_booru_tagsnow feedsfindSimilarinto 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
🔮 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 shipsFindSimilarTagsToolwith 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_ratingwith the safe default, alias input, both not-found paths,parseParameters, and schema validation. 105/105 tests pass,dart analyzeclean. The separate-fixture-DB decision was the correct call (extending the shared fixture would have silently mutatedSuggestTagsToolinputs). Once that merges, the fix is real and complete.⛔ What I need before approving this PR~
packages/booru_tag_db_dartin 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.search_tags→search_booru_tagsetc.) is a genuine bugfix — old names didn't match the toolnamegetters.dart analyzepasses 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
mainonly) · Local checks: deferred — blocker is test-coverage in submodule, verified present in linked booru_tag_db_dart#4 (approved, 105/105 pass)booru_tag_db_dart#4 is merged — submodule pointer bumped to the new master (
a0d5b0d), which includes theFindSimilarTagsTooltest 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