Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agent-context/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ method-level behavior, data-shape history — so an agent doesn't have to re-der
| `context/testing.md` | `src/test/java/`, `.github/workflows/build.yml`, `.github/workflows/publish.yml` |

---
*Last updated: 2026-09-12 | Verified against: feature/tpwalke2/209-bluemapapiconnector (40f2273)*
*Last updated: 2026-09-12 | Verified against: feature/tpwalke2/209-signtransitionresolver (4d45867)*
60 changes: 33 additions & 27 deletions agent-context/context/core-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,17 @@ re-querying the cache once per sign.

`computeTransitionAction`'s logic (mirrors the table in the spec, generalized to a 4x4 grid of `POI`/`LINE`/`SHAPE`/
`EXTRUDE` alongside `NONE` — see `docs/adr/0002-shape-duplicates-line-pattern.md` for why each new multi-point type
duplicates the same pattern rather than generalizing it):
gets its own row/column and `MIN_MEMBERS` constant here rather than folding into `LINE`'s; the join/leave
*implementation* behind those cells is a single shared parameterized resolver, not duplicated per type — see
`multiPointJoinAction`/`multiPointLeaveAction` below):

| Old \ New | NONE | POI | LINE | SHAPE | EXTRUDE |
|---|---|---|---|---|---|
| **NONE** | no-op (`null`) | dispatch `createAddPOIAction` | `lineJoinAction` (recompute group *including* this sign; dispatch `SetMultiPointMarkerAction` if ≥2 members, else no-op) | `shapeJoinAction` (same shape, gated on `SHAPE_MIN_MEMBERS = 3` instead of 2) | `extrudeJoinAction` (same shape again, gated on `EXTRUDE_MIN_MEMBERS = 3`) |
| **POI** | dispatch `createRemovePOIAction` | same group (prefix unchanged): label/detail both unchanged is a no-op, either changed dispatches `createUpdatePOIAction`. Different group (prefix changed): leave-effect + join-effect, bundled | leave-effect (Remove POI) + join-effect (`lineJoinAction`) | leave-effect (Remove POI) + join-effect (`shapeJoinAction`) | leave-effect (Remove POI) + join-effect (`extrudeJoinAction`) |
| **LINE** | `lineLeaveAction` (recompute group *excluding* this sign; `SetMultiPointMarkerAction` if ≥2 remain, `RemoveMultiPointMarkerAction` if exactly 1 remains, no-op if 0) | leave-effect (as above) + join-effect (Add POI) | same group+label: `lineJoinAction` with `sameGroupRecompute=true` (refreshes detail/points — always dispatches `Set` since ≥2 members necessarily already existed); different group/label: leave-effect + join-effect | leave-effect (`lineLeaveAction`) + join-effect (`shapeJoinAction`) | leave-effect (`lineLeaveAction`) + join-effect (`extrudeJoinAction`) |
| **SHAPE** | `shapeLeaveAction` (mirrors `lineLeaveAction`, but `RemoveMultiPointMarkerAction` once membership drops below 3) | leave-effect (`shapeLeaveAction`) + join-effect (Add POI) | leave-effect (`shapeLeaveAction`) + join-effect (`lineJoinAction`) | same group+label: `shapeJoinAction` with `sameGroupRecompute=true` (mirrors `LINE`/`LINE`); different group/label: leave-effect + join-effect | leave-effect (`shapeLeaveAction`) + join-effect (`extrudeJoinAction`) |
| **EXTRUDE** | `extrudeLeaveAction` (mirrors `shapeLeaveAction`, `RemoveMultiPointMarkerAction` once membership drops below 3) | leave-effect (`extrudeLeaveAction`) + join-effect (Add POI) | leave-effect (`extrudeLeaveAction`) + join-effect (`lineJoinAction`) | leave-effect (`extrudeLeaveAction`) + join-effect (`shapeJoinAction`) | same group+label: `extrudeJoinAction` with `sameGroupRecompute=true` (mirrors `SHAPE`/`SHAPE`); different group/label: leave-effect + join-effect |
| **NONE** | no-op (`null`) | dispatch `createAddPOIAction` | `multiPointJoinAction` (recompute group *including* this sign; dispatch `SetMultiPointMarkerAction` if ≥2 members, else no-op) | `multiPointJoinAction` (same call, gated on `SHAPE_MIN_MEMBERS = 3` instead of 2) | `multiPointJoinAction` (same call again, gated on `EXTRUDE_MIN_MEMBERS = 3`) |
| **POI** | dispatch `createRemovePOIAction` | same group (prefix unchanged): label/detail both unchanged is a no-op, either changed dispatches `createUpdatePOIAction`. Different group (prefix changed): leave-effect + join-effect, bundled | leave-effect (Remove POI) + join-effect (`multiPointJoinAction`) | leave-effect (Remove POI) + join-effect (`multiPointJoinAction`) | leave-effect (Remove POI) + join-effect (`multiPointJoinAction`) |
| **LINE** | `multiPointLeaveAction` (recompute group *excluding* this sign; `SetMultiPointMarkerAction` if ≥2 remain, `RemoveMultiPointMarkerAction` if exactly 1 remains, no-op if 0) | leave-effect (as above) + join-effect (Add POI) | same group+label: `multiPointJoinAction` with `sameGroupRecompute=true` (refreshes detail/points — always dispatches `Set` since ≥2 members necessarily already existed); different group/label: leave-effect + join-effect | leave-effect (`multiPointLeaveAction`) + join-effect (`multiPointJoinAction`) | leave-effect (`multiPointLeaveAction`) + join-effect (`multiPointJoinAction`) |
| **SHAPE** | `multiPointLeaveAction` (mirrors the `LINE` row, but `RemoveMultiPointMarkerAction` once membership drops below 3) | leave-effect (`multiPointLeaveAction`) + join-effect (Add POI) | leave-effect (`multiPointLeaveAction`) + join-effect (`multiPointJoinAction`) | same group+label: `multiPointJoinAction` with `sameGroupRecompute=true` (mirrors `LINE`/`LINE`); different group/label: leave-effect + join-effect | leave-effect (`multiPointLeaveAction`) + join-effect (`multiPointJoinAction`) |
| **EXTRUDE** | `multiPointLeaveAction` (mirrors the `SHAPE` row, `RemoveMultiPointMarkerAction` once membership drops below 3) | leave-effect (`multiPointLeaveAction`) + join-effect (Add POI) | leave-effect (`multiPointLeaveAction`) + join-effect (`multiPointJoinAction`) | leave-effect (`multiPointLeaveAction`) + join-effect (`multiPointJoinAction`) | same group+label: `multiPointJoinAction` with `sameGroupRecompute=true` (mirrors `SHAPE`/`SHAPE`); different group/label: leave-effect + join-effect |

The POI/POI cell deliberately compares only `group().prefix()`, not label — a label-only edit on an unchanged group
used to fall through to the different-group (leave+join) branch, because the older check compared
Expand Down Expand Up @@ -188,26 +190,30 @@ zero effects → `null`, one effect → dispatch it directly, two → bundle int
`groupIdentityObsolete` (used by the config-reload path, below) is likewise type-agnostic, detecting a config-only
type flip or rename for any of the four types.

`lineJoinAction(allSigns, parentMap, rep, actionFactory, sameGroupRecompute)` and `lineLeaveAction(allSigns,
parentMap, rep, actionFactory)` both call `LineGroupResolver.members(allSigns, parentMap, rep.group().prefix(),
rep.label())` against the caller-supplied snapshot — because `signCache` is a full, live snapshot (never cleared
for a config reload, see below), a snapshot taken once per dispatch always scans every sign currently known, so a
`LINE` group recompute is always complete and order-independent regardless of which member triggered it.
`lineJoinAction`'s `isFirstAppearance` flag (`!sameGroupRecompute && members.size() == 2`) is log-only — see §6 —
not a distinct dispatch type. `shapeJoinAction`/`shapeLeaveAction` and `extrudeJoinAction`/`extrudeLeaveAction` are
the direct `SHAPE`/`EXTRUDE` counterparts: they call `ShapeGroupResolver.members(...)`/`ExtrudeGroupResolver.members(...)`,
both of which just delegate to `LineGroupResolver.members(...)` (identical filtering/ordering — the only real
difference between `LINE`, `SHAPE`, and `EXTRUDE` group resolution is the caller-side minimum-member count, `2` vs.
`SHAPE_MIN_MEMBERS = 3` vs. `EXTRUDE_MIN_MEMBERS = 3`), and dispatch via the single `actionFactory.createSetMultiPointAction`/
`createRemoveMultiPointAction` pair for all three types (§5) — `ActionFactory` derives which kind (and minimum-member
threshold) to build from `markerGroup.type()` itself, so `SignTransitionResolver` doesn't need per-type factory calls
here. Every join/leave-recompute call site calls `ColorResolver.resolve(members, rep.group())` (see below) immediately
before dispatching, and passes the resolved `lineColor`/`fillColor` into `createSetMultiPointAction` as explicit
parameters (`fillColor` is `null` for `LINE`, which has none) — `ActionFactory` no longer reads
`markerGroup.lineColor()`/`fillColor()` itself for this factory method, keeping it a dumb builder while
`SignTransitionResolver` owns colour resolution. These call sites also now pass `rep.detail()` (not `rep.label()`)
as the dispatched detail text — fixing a bug where a `LINE`/`SHAPE`/`EXTRUDE` marker's rendered detail was always
just its label repeated, since detail text on these signs was never actually threaded through.
`multiPointJoinAction(allSigns, parentMap, rep, actionFactory, sameGroupRecompute, resolver, minMembers, kind)` and
`multiPointLeaveAction(allSigns, parentMap, rep, actionFactory, currentPrefixGroupMap, resolver, minMembers, kind)`
are the single generic implementation behind all three `LINE`/`SHAPE`/`EXTRUDE` cells above — collapsed from three
near-identical `line*Action`/`shape*Action`/`extrude*Action` method pairs (GitHub issue #209) once it was clear they
differed only by which `GroupResolver` (`LineGroupResolver::members`/`ShapeGroupResolver::members`/
`ExtrudeGroupResolver::members`) they called, the minimum-member threshold (`LINE_MIN_MEMBERS = 2` vs.
`SHAPE_MIN_MEMBERS = 3` vs. `EXTRUDE_MIN_MEMBERS = 3`), and whether a fill colour applies (`hasFill(kind)` is
`false` only for `LINE`, which has no fill). Both call the caller-supplied `resolver` against the caller-supplied
`allSigns` snapshot — because `signCache` is a full, live snapshot (never cleared for a config reload, see below), a
snapshot taken once per dispatch always scans every sign currently known, so a recompute is always complete and
order-independent regardless of which member triggered it. `ShapeGroupResolver.members`/`ExtrudeGroupResolver.members`
just delegate to `LineGroupResolver.members(...)` (identical filtering/ordering — the only real difference between
`LINE`, `SHAPE`, and `EXTRUDE` group resolution is the caller-side minimum-member count). `isFirstAppearance`
(`!sameGroupRecompute && members.size() == minMembers`) is log-only — see §6 — not a distinct dispatch type. Both
dispatch via the single `actionFactory.createSetMultiPointAction`/`createRemoveMultiPointAction` pair for all three
types (§5) — `ActionFactory` derives which kind (and minimum-member threshold) to build from `markerGroup.type()`
itself, so `SignTransitionResolver` doesn't need per-type factory calls here. Every join/leave-recompute call site
calls `ColorResolver.resolve(members, rep.group())` (see below) immediately before dispatching, and passes the
resolved `lineColor`/`fillColor` into `createSetMultiPointAction` as explicit parameters (`fillColor` is `null` for
`LINE`, via `hasFill(kind)`) — `ActionFactory` no longer reads `markerGroup.lineColor()`/`fillColor()` itself for
this factory method, keeping it a dumb builder while `SignTransitionResolver` owns colour resolution. These call
sites also pass `rep.detail()` (not `rep.label()`) as the dispatched detail text — fixing a bug where a
`LINE`/`SHAPE`/`EXTRUDE` marker's rendered detail was always just its label repeated, since detail text on these
signs was never actually threaded through.

### Conflict resolution: `ColorResolver` (player-controlled marker colours, GitHub issue #198)

Expand Down Expand Up @@ -742,5 +748,5 @@ gating" section. This section covers the code-level mechanics.
themselves are otherwise unchanged — the fix is localized to `prepareGated`.

---
*Last updated: 2026-09-12 | Verified against: feature/tpwalke2/209-bluemapapiconnector (40f2273)*
*Last updated: 2026-09-12 | Verified against: feature/tpwalke2/209-signtransitionresolver (4d45867)*

5 changes: 3 additions & 2 deletions agent-context/context/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ As of `main` (`b2c5fa0`), `src/test/java/com/tpwalke2/bluemapsignmarkers/`:
reload-forced), and the full cross-type bundling matrix (POI↔SHAPE, LINE↔SHAPE) both for a live sign change and
for a config-reload-driven type flip/rename (`groupIdentityObsolete`). `EXTRUDE` coverage mirrors `SHAPE`'s
exactly (same `EXTRUDE_MIN_MEMBERS = 3` threshold, same no-op/first-appearance/recompute/cross-type-bundling
shape), confirming `extrudeJoinAction`/`extrudeLeaveAction` behave identically to their `SHAPE` counterparts. Every
shape), confirming the shared `multiPointJoinAction`/`multiPointLeaveAction` (§209 collapse, see `core-pipeline.md`
§3) behave identically for `EXTRUDE` as for `SHAPE`. Every
`LINE`/`SHAPE`/`EXTRUDE` dispatched-`Set` assertion now checks `set.getDetail()` against each member's *own*
detail text, not the group label — this test-suite-wide update caught the `rep.label()`-passed-as-detail bug
fixed alongside GitHub issue #198 (see `core-pipeline.md` §3's join/leave paragraph). Player-controlled colours
Expand Down Expand Up @@ -392,5 +393,5 @@ workflow jobs also now declare an explicit `permissions: contents: read` (least-
the repo's default token permissions), and `publish.yml`'s job runs under a `modrinth-publish` GitHub Environment.

---
*Last updated: 2026-09-12 | Verified against: feature/tpwalke2/209-bluemapapiconnector (40f2273)*
*Last updated: 2026-09-12 | Verified against: feature/tpwalke2/209-signtransitionresolver (4d45867)*

Loading