diff --git a/.superpowers/sdd/task-2-report.md b/.superpowers/sdd/task-2-report.md index 3b270a2..e878ce2 100644 --- a/.superpowers/sdd/task-2-report.md +++ b/.superpowers/sdd/task-2-report.md @@ -1,10 +1,10 @@ # Task 2 Report -Status: DONE_WITH_CONCERNS +Status: DONE Files changed: - `src/data/adapters/sgsSdkGuideAdapter.ts` -- `src/domain/museum.ts` +- `.superpowers/sdd/task-2-report.md` Commands run: - `node scripts/check-sgs-hall-poi-adapter.mjs` @@ -12,16 +12,12 @@ Commands run: - `pnpm type-check` - Output summary: `vue-tsc --noEmit` completed successfully. -Commits created: -- `08a6bcb` in implementer worktree: `feat: expand SGS hall POI adaptation` -- Main workspace integrated manually because cherry-pick was blocked by existing local changes to the same files. +Commit: +- Pending in current worktree at report update time. -Self-review notes: -- Adapter now includes public exhibition-space whitelist and keyword checks. -- `toMuseumHallPoisFromSgs` now supports entrance anchors, space-center fallback, standalone space fallback, and diagnostics helper. -- Main integration preserves stronger Task 1 semantics approved by user: `backend-sgs-sdk-hall-entrance` requires both entrance coordinates and route node, and later real entrance anchors can upgrade a space-center POI. -- `src/domain/museum.ts` already had/keeps typed hall fields (`MuseumPoiKind`, `MuseumPoiEntrance`, hall/source fields, preview fields) required by adapter output. +Notes: +- POI-level `sourcePlaceId` now remains unset for space-center fallback halls; entrance-specific `sourcePlaceId`/`routeNodeId` stay on `entrances` until a route-capable entrance upgrades the POI. +- Space-center fallback halls now use matched-space floor metadata; route-capable entrance upgrades replace POI floor metadata with entrance floor metadata and set `sourceConfidence` to `backend-sgs-sdk-hall-entrance`. Concerns: -- Manual integration was required because the main workspace already had overlapping uncommitted changes in adapter/domain files. -- Task 3 will add repository diagnostics consumption of `createSgsHallPoiDiagnostics`. +- The targeted smoke script is a lightweight regression harness, not a full test runner. diff --git a/src/data/adapters/sgsSdkGuideAdapter.ts b/src/data/adapters/sgsSdkGuideAdapter.ts index 7067326..080ce7d 100644 --- a/src/data/adapters/sgsSdkGuideAdapter.ts +++ b/src/data/adapters/sgsSdkGuideAdapter.ts @@ -393,6 +393,7 @@ const createHallEntrance = ( ) => { const floorId = stringifyId(place.floorId) || fallbackFloorId const placeId = stringifyId(place.id || place.nodeId) + const routeNodeId = stringifyId(place.nodeId) || undefined return { id: placeId ? `hall-entrance-${placeId}` : `hall-entrance-${floorId}-${normalizedHallName(place.name)}`, @@ -400,9 +401,9 @@ const createHallEntrance = ( floorId, floorLabel: floorLabelForSgs(floorId, floors, place.floorCode, place.floorName), positionGltf: normalizePlacePosition(place), - sourceObjectName: stringifyId(place.nodeId) || undefined, - sourcePlaceId: placeId || undefined, - routeNodeId: stringifyId(place.nodeId) || undefined + sourceObjectName: routeNodeId || undefined, + sourcePlaceId: routeNodeId ? placeId || undefined : undefined, + routeNodeId } } @@ -469,7 +470,13 @@ export const toMuseumHallPoisFromSgs = ( const entrance = createHallEntrance(place, floors, fallbackFloorId) const entranceHasRouteAnchor = Boolean(entrance.positionGltf && entrance.routeNodeId) const fallbackPosition = matchedSpace ? normalizeSpaceCenter(matchedSpace) : undefined - const floorId = entrance.floorId || stringifyId(matchedSpace?.floorId) || fallbackFloorId + const fallbackFloorIdForPoi = stringifyId(matchedSpace?.floorId) || entrance.floorId || fallbackFloorId + const fallbackFloorLabel = floorLabelForSgs( + fallbackFloorIdForPoi, + floors, + matchedSpace?.floorCode, + matchedSpace?.floorName || matchedSpace?.name + ) const hallId = stringifyId(matchedSpace?.id) || undefined const poiId = createHallPoiId(matchedSpace, place, index) const hallName = normalizedText(matchedSpace?.name) || placeHallName(place) || entrance.name @@ -482,7 +489,7 @@ export const toMuseumHallPoisFromSgs = ( ] if (entranceHasRouteAnchor) { existing.positionGltf = entrance.positionGltf - existing.floorId = floorId + existing.floorId = entrance.floorId existing.floorLabel = entrance.floorLabel existing.sourceObjectName = entrance.sourceObjectName existing.sourcePlaceId = entrance.sourcePlaceId @@ -492,10 +499,9 @@ export const toMuseumHallPoisFromSgs = ( if (!existing.positionGltf && fallbackPosition) { existing.positionGltf = fallbackPosition - existing.floorId = floorId - existing.floorLabel = entrance.floorLabel + existing.floorId = fallbackFloorIdForPoi + existing.floorLabel = fallbackFloorLabel existing.sourceObjectName = matchedSpace?.sourceNodeName || undefined - existing.sourcePlaceId = entrance.sourcePlaceId existing.sourceConfidence = 'backend-sgs-sdk-space-center' } return @@ -507,8 +513,8 @@ export const toMuseumHallPoisFromSgs = ( halls.set(poiId, { id: poiId, name: hallName, - floorId, - floorLabel: entrance.floorLabel, + floorId: entranceHasRouteAnchor ? entrance.floorId : fallbackFloorIdForPoi, + floorLabel: entranceHasRouteAnchor ? entrance.floorLabel : fallbackFloorLabel, primaryCategory: hallCategory, categories: [ hallCategory, @@ -527,7 +533,7 @@ export const toMuseumHallPoisFromSgs = ( hallId, hallName, spaceId: hallId, - sourcePlaceId: entrance.sourcePlaceId, + sourcePlaceId: entranceHasRouteAnchor ? entrance.sourcePlaceId : undefined, sourceSpaceId: hallId, entrances: [entrance] })