Skip to content

Map metric entity_type to new metricDisplay 3D object#40

Closed
dibaunaumh wants to merge 138 commits into
WebWideMatrix:masterfrom
AliceAlifib:dibaunaumh/metrics-visual-language
Closed

Map metric entity_type to new metricDisplay 3D object#40
dibaunaumh wants to merge 138 commits into
WebWideMatrix:masterfrom
AliceAlifib:dibaunaumh/metrics-visual-language

Conversation

@dibaunaumh

Copy link
Copy Markdown
Contributor

Summary

  • Update default_visual_language so "metric" maps to the new client-side metricDisplay 3D object (was "car").
  • Add migration 20260519090000_update_metric_visual_mapping to backfill existing bldgs whose stored visual_language already has a metric key (containers seeded with the default map).
  • Add the standard Phoenix release overlay scripts (bin/migrate, bin/server, plus .bat counterparts) under rel/overlays/bin/ so clean checkouts build a release image with /app/bin/migrate — required by release_command in fly.dev.toml / fly.prod.toml. These were previously untracked on a local machine, which broke deploys from fresh clones (e.g. Conductor feature-branch workspaces).

Test plan

  • cd bldg_server && mix ecto.migrate applies cleanly; rollback restores the prior "car" mapping.
  • SELECT visual_language->'metric' FROM bldgs WHERE visual_language ? 'metric' returns the new metricDisplay payload.
  • fly deploy -c bldg_server/fly.dev.toml from this branch — release_command resolves /app/bin/migrate and the runtime starts via /app/bin/server.
  • In the client, newly-created metric bldgs render with the metricDisplay 3D object.

🤖 Generated with Claude Code

…address. Also reduced distance from speaker 10->2
…ootprint. this is tech-debt - proper solution is to remove chat to its own storage & pull just the latest
dibaunaumh and others added 29 commits April 10, 2026 10:56
Replace non-semantic entity_types (blue-lot, green-lot, problem) with
semantic names (milestone, enabler, goal) while preserving the same 3D
visual objects. Migration updates existing DB records and adds new keys
to stored visual_language maps on containers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace 20-second HTTP polling with real-time Phoenix Channel push.

Server:
- Add FloorChannel (floor:* topics) with join, request_scan, and
  serialization helpers matching existing view JSON shapes
- Register channel in UserSocket
- Broadcast bldg_created/updated/deleted, resident_created/updated/deleted,
  road_created/updated/deleted after mutations in all three contexts
- Broadcast to floor and all ancestor floors so recursive-scan clients
  receive nested changes
- Add delete notifications to delete_bldg (previously had none)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…claw

- Add delete_bldg_cascade/1: deletes nested children (deepest first),
  their roads, then the target bldg. Each deletion broadcasts bldg_deleted.
  Residents inside deleted bldgs are left untouched.
- Add /delete bldg {name} chat command with is_authorized_owner? check
- REST DELETE /v1/bldgs/:address now uses cascade delete

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Stream changes to client & delete bldg support
Adds POST /v1/bldgs/:address/favorite_view_points plus schema and view
support for a list of named poses (address, direction, size_delta,
camera_vertical_angle) stored on each bldg.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds /edit <bldg_name> <field> <value> so agents and users can update
scalar fields on existing bldgs from chat, matching the style of
/delete bldg, /move bldg, etc. Editable fields are whitelisted to
state, summary, category, picture_url, web_url, data, tags — identity,
location, hierarchy and ownership fields stay off-limits. Value tokens
are joined with spaces; tags are split on commas into a list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Chat `/create` trusted the caller's `say_flr` verbatim, so an agent sending
coordinate tuples that didn't match the parent's real address stranded the
child with a `flr` pointing to a nonexistent parent. Always derive `flr`
from the container loaded via `bldg_url` (the name-based, stable identifier)
instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add bldg_server/fly.dev.toml and fly.prod.toml (secrets-free; use
  fly secrets set for DB_PASSWORD, REDIS_PWD, SENDGRID_API_KEY etc.)
- Add bldg_server/deploy.sh accepting dev|prod
- Add .github/workflows/deploy.yml for auto-dev / manual-prod deploys
  (requires FLY_API_TOKEN_DEV and FLY_API_TOKEN_PROD repo secrets)
- Add release tasks seed_ground/3, seed_batteries/0, seed_battery/1 for
  bootstrapping fresh envs (root ground bldg, org container, battery
  catalog)

Run seed_ground("https://alicein.app", "G") on a fresh prod env after
the first deploy to unblock figure_out_flr/1 and notify_bldg_created/4,
then seed_batteries to populate the ground-floor battery catalog.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Roads cached `from_address`/`to_address` and `from_x`/`from_y`/`to_x`/`to_y`
at creation; relocating a bldg left those stale so roads hung at the old
position. `Buildings.update_bldg/2` now diffs `address` and, on change,
calls `Relations.cascade_bldg_relocation/3` to rewrite matching endpoints
(and follow the flr if the road lived on the bldg's prior floor), which
also re-broadcasts `road_updated` through existing channels.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Default visual_language now maps the 'metric' entity_type to the 'car'
  3D object so newly-created composite bldgs carry the mapping.
- Migration backfills the metric->car entry into every existing bldg's
  visual_language JSONB so bldgs created before metrics-battery shipped
  (including the home and goal containers in pre-existing user offices)
  also resolve the new entity_type.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
add metric -> car visual-language mapping + backfill migration
- Migration adds nullable `color` and `road_class` (default "road",
  NOT NULL) to the `roads` table; existing rows render unchanged.
- Road schema casts both fields and validates `road_class` against
  highway|road|lane|path.
- Road view + floor_channel serialize_road emit both fields so REST
  scan/look and channel road_created/updated events carry them.
- /connect between A and B now accepts an optional
  `with color X and class Y` tail (either order, both optional);
  bare /connect remains backwards-compatible.

Drives bldg-client styling: classes scale the road's perpendicular
width and stagger y-elevation so a "lane" overlays a regular "road"
without z-fighting. metrics-battery uses this to draw colored
overlay roads from the Start milestone to each metric car.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…te/category)

Adds nullable color/size/variant columns to bldgs (mirroring the
roads color + class precedent). Batteries can now express per-instance
visual styling without overloading state and category, which were
leaking into agent semantic reads. Backfill migration moves recognized
color tokens out of state and t-shirt sizes out of category, leaving
real semantic values intact. Chat /create and /edit commands accept
the new fields.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Updates default_visual_language and backfills existing bldgs whose
stored visual_language has a "metric" key (containers seeded with the
default map). Also adds the standard Phoenix release overlay scripts
(bin/migrate, bin/server, plus .bat counterparts) so clean checkouts
build a release image with /app/bin/migrate — required by the
release_command in fly.dev.toml / fly.prod.toml. Previously these
were untracked on a local machine, which broke deploys from fresh
clones (e.g. Conductor feature-branch workspaces).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dibaunaumh dibaunaumh closed this May 19, 2026
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