Skip to content

Asset library: two entries, and scope library repos to the game that installed them - #45

Merged
duolahypercho merged 1 commit into
mainfrom
assets-library-scoping
Aug 18, 2026
Merged

Asset library: two entries, and scope library repos to the game that installed them#45
duolahypercho merged 1 commit into
mainfrom
assets-library-scoping

Conversation

@duolahypercho

Copy link
Copy Markdown
Owner

What

Adds two entries to the asset registry and scopes library repos per-project, the way Unity and Unreal do.

The entries

Repo License Why
dimforge/rapier Apache-2.0 Standalone WASM physics engine. Framework-agnostic, so it drives plain three.js meshes.
pmndrs/three-stdlib MIT Typed stand-alone builds of the three.js example modules — controls, loaders, postprocessing.

pmndrs/use-cannon was the original suggestion and is rejected: it is React-Three-Fiber-only with no non-R3F entry point (this editor is raw three.js — grep -rl "@react-three" client/src is empty), it has no LICENSE file at all (gh api repos/pmndrs/use-cannon/contents/LICENSE → 404, .license → null), and it was last pushed Feb 2024.

Browse globally, use locally

search_library was the one source taking no slug while its sibling search_local correctly branched on it, so every game saw every repo as equally usable. That is the one place CaliCode diverged from the Unity/Unreal model:

Layer Unity Unreal CaliCode
Storefront (browse all) Package Manager Fab asset_catalog
Add to this project manifest.json Content/ asset_pick
Consumer sees only installed compiler Content Browser ✗ → fixed here

Now:

  • hits carry installed, read from this project's settings.assetRepos
  • detail.url only once installed. Repos are metadata-only pointers, so the url is the actionable payload — handing it out for an uninstalled repo let the agent build against something the project never took on.
  • detail.currentSettings reports the game's tuned values. It previously returned catalogue defaults, so a game that set gravity to 0 still read -9.81. That was an outright bug.
  • uninstalled hits carry a hint pointing at asset_pick, which already was the "Add to Project" step and is unchanged.

Driven against a real core on a scratch port, two projects:

1. Game A, before install
   rapier-physics   installed=False  url=(withheld)  + hint
2. asset_pick → {attached: True, settings: {gravityY: -9.81}}
   then tuned gravityY → 0
3. Game A again
   rapier-physics   installed=True   url=https://github.com/dimforge/rapier
                    currentSettings={"gravityY": 0}
4. Game B (never installed)
   rapier-physics   installed=False  url=(withheld)

Card layout fix

three-stdlib is the first entry with enough tags to wrap, which exposed this: the grid card is a <button>, and a bare button centres its content box. Content taller than the grid-stretched row overflowed top and bottom into overflow-hidden, so the gradient header bled over the rounded corner.

        card top  visual top
card 1     137       148
card 2     137       148
three-stdlib 137     138     ← 10px up-shift

flex flex-col on the card plus shrink-0 on RepoVisual — all three now measure identically.

Verification

  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, 888 Rust tests (+2 new) — run in a scratch worktree containing only this commit's changes, not the full working tree
  • npx tsc -b --noEmit, 903 client tests
  • Driven headlessly in light and dark across grid / detail / installed / attached-with-settings / narrow / empty, no console or page errors
  • Confirmed in the packaged app after pnpm desktop:build

Known issue — not fixed here

With more than one registry entry, workflow.spec.ts:312 fails intermittently: 7 of 12 runs with this change, 0 of 7 at baseline.

I instrumented the two obvious suspects and disproved both: the editor_bridge broadcast never lags (Lagged count 0 across failing runs) and core-side editor tool calls never time out. Evidence points at a page.evaluate / page.reload() race inside the spec itself rather than a product defect — but that is not proven, and the spec is deliberately left untouched rather than edited until it passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_014YTKbJdRjJtAHEuLxkeFkm

…installed them

Adds Rapier (Apache-2.0) and three-stdlib (MIT) to the registry. Both are
framework-agnostic and drop into plain three.js; use-cannon was rejected for
the same reason it was proposed — it is React-Three-Fiber-only, has no LICENSE
file at all, and was last pushed Feb 2024.

Scopes the library the way Unity and Unreal do: browse globally, use locally.
search_library was the one source taking no slug while search_local branched on
it, so every game saw every repo as equally usable. Now:

- hits carry `installed`, from this project's settings.assetRepos
- `detail.url` appears only once the game has installed the repo. Repos are
  metadata-only pointers, so the url is the actionable payload — handing it out
  for an uninstalled repo let the agent build against something the project
  never took on
- `detail.currentSettings` reports the game's tuned values. It previously
  returned catalogue defaults, so a game that set gravity to 0 still read -9.81
- uninstalled hits carry a hint pointing at asset_pick, which already was the
  "Add to Project" step and is unchanged

Also fixes a card layout bug the new entries were the first to trigger: the
grid card is a <button>, which centres its content box, so a card whose tags
wrap to a second row overflowed top and bottom into overflow-hidden and its
gradient header bled over the rounded corner. Measured 10px up-shift; flex
column plus shrink-0 on the visual makes all cards align again.

Known issue, not fixed here: with more than one registry entry,
workflow.spec.ts:312 fails intermittently (7 of 12 runs; 0 of 7 at baseline).
I instrumented the two obvious suspects and disproved both — the editor_bridge
broadcast never lags and core-side editor tool calls never time out. Evidence
points at a page.evaluate/page.reload race inside the spec itself rather than a
product defect, but that is not proven and the spec is left untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014YTKbJdRjJtAHEuLxkeFkm
@duolahypercho
duolahypercho force-pushed the assets-library-scoping branch from 35a3e0c to a49b09b Compare August 18, 2026 01:09
@duolahypercho
duolahypercho merged commit 42e5e3a into main Aug 18, 2026
6 of 7 checks passed
@duolahypercho
duolahypercho deleted the assets-library-scoping branch August 18, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant