Skip to content

Edit bldg chat command & prod-split#39

Closed
dibaunaumh wants to merge 129 commits into
WebWideMatrix:masterfrom
AliceAlifib:edit-bldg-chat-command
Closed

Edit bldg chat command & prod-split#39
dibaunaumh wants to merge 129 commits into
WebWideMatrix:masterfrom
AliceAlifib:edit-bldg-chat-command

Conversation

@dibaunaumh

Copy link
Copy Markdown
Contributor

No description provided.

…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 February 23, 2026 13:42
…ge (not the cleanest, but have to get this working). Also added an endpoint to get a bldg by the bldg_url
… how redis is used for transient data). Not sure it's the right approach though, because I want to keep the principle of , so not store data in a db hidden from the user, but rather store everything - including staging data - in bldgs, which the user can see
…staging-data

Expend usage of graph db for staging data
Container bldgs now have a visual_language jsonb column that maps semantic
entity types to 3d_object names and floor height metadata. This decouples
what a bldg represents (entity_type) from how it looks when rendered.

- New migration adding visual_language column to bldgs table
- Default visual language with all 40 built-in entity type mappings
- Refactored add_composite_bldg_metadata from 10+ hardcoded clauses to
  a single lookup against the visual language map
- BldgView returns visual_language as JSON-encoded string
- test.exs now reads DB_USER from env (consistent with dev.exs)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added Buildings.is_authorized_owner?/2 that walks up the container
chain to check if the given email owns the building or any of its
ancestors. This means if you own a building, you can create, move,
connect, and manage everything nested inside it.

Replaced all 6 inline Enum.find ownership checks in
BldgCommandExecutor with the new function.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The bldg_url hierarchy alternates between buildings and floors
(e.g., g/udi-bauman/l0/goal_name). When walking up to check
ancestor ownership, floor URLs like "g/udi-bauman/l0" aren't in
the bldgs table, so the lookup returned nil and stopped the walk.

Now continues walking up past floors until it reaches an actual
building or the root.

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