Map metric entity_type to new metricDisplay 3D object#40
Closed
dibaunaumh wants to merge 138 commits into
Closed
Conversation
…address. Also reduced distance from speaker 10->2
… dev using downloaded image
…ootprint. this is tech-debt - proper solution is to remove chat to its own storage & pull just the latest
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>
Visual language
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>
Viewpoints
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>
Edit bldg chat command & more
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>
Metrics tracking
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
default_visual_languageso"metric"maps to the new client-sidemetricDisplay3D object (was"car").20260519090000_update_metric_visual_mappingto backfill existing bldgs whose storedvisual_languagealready has ametrickey (containers seeded with the default map).bin/migrate,bin/server, plus.batcounterparts) underrel/overlays/bin/so clean checkouts build a release image with/app/bin/migrate— required byrelease_commandinfly.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.migrateapplies cleanly; rollback restores the prior"car"mapping.SELECT visual_language->'metric' FROM bldgs WHERE visual_language ? 'metric'returns the newmetricDisplaypayload.fly deploy -c bldg_server/fly.dev.tomlfrom this branch —release_commandresolves/app/bin/migrateand the runtime starts via/app/bin/server.metricDisplay3D object.🤖 Generated with Claude Code