describe_garden: list each plop's position, so a move can keep the layout
Build image / build-and-push (push) Successful in 6s
Gadfly review (reusable) / review (pull_request) Successful in 4m29s
Adversarial Review (Gadfly) / review (pull_request) Successful in 4m29s

Asked to move four tomatoes planted in a column "keeping the same spacing",
the live assistant re-laid them as two pairs: the per-plop listing said
"north" and "south" and nothing else. Each listed plop (and list_plantings)
now carries xCm/yCm in the object's local frame.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
2026-08-23 00:37:23 -04:00
co-authored by Claude Fable 5
parent d884f62762
commit 8b161c5f6d
3 changed files with 21 additions and 9 deletions
+10 -4
View File
@@ -610,15 +610,20 @@ type DescribeGroup struct {
Each []DescribePlanting `json:"each,omitempty"`
}
// DescribePlanting is one plop with a rough compass location. ID + Version let
// an agent address a single plop — remove it or move it — the same way
// DescribeObject.Version lets it edit an object.
// DescribePlanting is one plop with its position and a rough compass location.
// ID + Version let an agent address a single plop — remove it or move it — the
// same way DescribeObject.Version lets it edit an object; XCM/YCM (the object's
// local frame) let a move keep the layout the plops had, which "north, south"
// alone cannot: asked to move four tomatoes in a column "keeping the same
// spacing", the live assistant re-laid them as two pairs for want of these.
type DescribePlanting struct {
ID int64 `json:"id"`
Version int64 `json:"version"`
PlantID int64 `json:"plantId"`
Plant string `json:"plant"`
Count int `json:"count"`
XCM float64 `json:"xCm"`
YCM float64 `json:"yCm"`
Location string `json:"location"`
RadiusCM float64 `json:"radiusCm"`
PlantedAt string `json:"plantedAt,omitempty"`
@@ -736,7 +741,8 @@ func describeGroups(o *domain.GardenObject, plops []domain.Planting, plantByID m
func describePlanting(pl domain.Planting, plantName string) DescribePlanting {
d := DescribePlanting{
ID: pl.ID, Version: pl.Version, PlantID: pl.PlantID, Plant: plantName,
Count: effectiveCount(pl), Location: describeLocation(pl.XCM, pl.YCM), RadiusCM: pl.RadiusCM,
Count: effectiveCount(pl), XCM: pl.XCM, YCM: pl.YCM,
Location: describeLocation(pl.XCM, pl.YCM), RadiusCM: pl.RadiusCM,
}
if pl.PlantedAt != nil {
d.PlantedAt = *pl.PlantedAt