feat(assets): a creature's picture is whichever action has one (Phase 6) #39
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/asset-bridge-p6"
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 & why
The website half of Asset Bridge phase 6 (
docs/link/v8.md§11.2, §12.1). Pairs with servuo-plugins#33.The shard can now catalogue a body at whichever action has art, so 73 bodies that were absent get a picture — body 820's is at action 23, and it is a horse. This side stores that action and stops assuming
a0.The atlas join is the part that mattered. It read
which would have silently dropped exactly the creatures this phase adds. It now reads the row's own action:
COALESCEbecause a row written before the column existed has NULL there, and a NULL insideCONCATmakes the whole comparison NULL — which would have taken every portrait off the site on upgrade, with the database perfectly correct and nothing in any log. It still matches at most one row per slug: a deeper key (body/820/a23/f4) does not equal the catalogue key, which is what §12.1 asked this join to keep being true.actionis stored rather than parsed back out of the key, because the join needs it in SQL and re-deriving it there would put a second, weaker parser of §5's key scheme in the schema.No routes, no
MODULE_APIbump, no client changes.How it was tested
npm test— 691 pass, including two new bridge tests (a row's action survives the manifest walk; an overlay older than phase 6 reads as action 0) and one new model test (a fallback key is fetched, written asuo-body-820-a23-<sha8>.pngand stored with its action).And the part no stub can check — the real
shardAssets.dbagainst a real MariaDB 11.8, in a throwaway database, using the module's ownschema.sqlstatements and the live shard's 1,095-row manifest:Checklist
AI-assisted contributions (required)
Claude Code (Opus 5). I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with aCo-Authored-Bytrailer.🤖 Generated with Claude Code
https://claude.ai/code/session_016wDDVXWMDz82WqE1i969r4
The shard's catalogue can now answer for 73 bodies it used to report absent — they have no art at action 0 and real art at a later one, and their key says which (`body/820/a23` is a horse). This side stores that action and stops assuming `a0` anywhere. The atlas join is the part that mattered. It read a.asset_key = CONCAT('body/', b.body, '/a0') which would have silently dropped exactly the creatures this phase adds. It now reads the row's own action, with COALESCE for rows written before the column existed — a NULL inside CONCAT makes the whole comparison NULL, which would have taken every portrait off the site on upgrade with the database perfectly correct and nothing in any log. It still matches at most one row per slug: a deeper key (`body/820/a23/f4`) does not equal the catalogue key. Verified against a real MariaDB with the live shard's own 1,095-row manifest: the ALTER applies to an installed-shape table and is idempotent, the horse joins to its a23 picture, a pre-phase-6 NULL-action row keeps its portrait, and a stored frame key does not become a second candidate. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016wDDVXWMDz82WqE1i969r4