Repository navigation
Building position belongs to sim-core, not the workplace (ADR 0008) - #17
Merged
Merged
Conversation
…e workplace (ADR 0008) Farm and tavern used to declare their own map position via env vars, and the gateway blindly copied it into sim-core — the same "second source of truth" shape ADR 0004 already fixed once for max_workers. A building's kind is the workplace service's business; where it stands on the map is not. - workplace/v1.DescribeResponse.position deprecated (buf breaking forbids removal); farm and tavern stop populating it - world-gateway now sources position from its own WORKPLACE_POSITIONS config and refuses to register a workplace it has no configured position for - Helm: xMilli/yMilli move out of the farm/tavern charts into world-gateway's workplacePositions - gen/ regenerated, buf lint/breaking clean
…rlapping registrations Closes the gap ADR 0008 left open: workplace_positions accepted whatever RegisterWorkplaceIntent sent, with no check that the position was on the map or clear of another building. - apply_intents rejects a RegisterWorkplace intent that is off the map or within WORKPLACE_MIN_SPACING_MILLI of another building's position, on both insert and update - rejection is a new WorkplaceRegistrationRejected DomainEvent — not a Kafka fact (rule 2: Kafka is for facts many independent consumers care about, this concerns only whoever misconfigured a position), so crates/server routes it to a tracing::warn! and a new pipsim.sim.workplace_registration_rejected OTel counter instead - 3 new tests in crates/sim covering off-map, overlap-on-insert and overlap-on-update
…nership # Conflicts: # infra/helm/world-gateway/templates/deployment.yaml # infra/helm/world-gateway/values.yaml # services/sim-core/crates/sim/src/lib.rs
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
max_workers.workplace/v1.DescribeResponse.positionis deprecated;world-gatewaynow supplies position from its ownWORKPLACE_POSITIONSconfig and refuses to register a building it has no configured position for.RegisterWorkplaceintents are rejected (no effect on the world) if the position is off the map or within one tile of another building — on both insert and update.WorkplaceRegistrationRejectedfact is turned into atracing::warn!and an OTel counter (pipsim.sim.workplace_registration_rejected) incrates/server, on the reasoning that this concerns whoever runs the cluster, not other services (rule 2 inCLAUDE.md).docs/adr/0008-sim-core-owns-building-position.mdfor the full writeup, including alternatives considered.Test plan
buf lint/buf breakingclean,gen/regenerated (Go, TS, Elixir)cargo test --workspaceinservices/sim-core(35/35 incrates/sim, workspace builds)cargo clippy --workspace -D warningsandcargo fmt --check --allcleango test ./...inservices/world-gateway,services/workplaces/farm,services/workplaces/conformance,services/bankmix testinservices/workplaces/tavern(32/32)helm templateonfarm,tavern,world-gatewaycharts to confirm rendered env vars🤖 Generated with Claude Code