Skip to content

feat(data-access): GeoExperiment impact-measurement phases + insights/impactTaskId fields#1779

Merged
ssilare-adobe merged 5 commits into
mainfrom
feat/geo-experiment-impact-measurement
Jul 7, 2026
Merged

feat(data-access): GeoExperiment impact-measurement phases + insights/impactTaskId fields#1779
ssilare-adobe merged 5 commits into
mainfrom
feat/geo-experiment-impact-measurement

Conversation

@ssilare-adobe

Copy link
Copy Markdown
Contributor

What

Adds the shared-model changes for the impact-measurement workflow (see the Impact Validation Engine | Impact Measurement Workflow wiki):

  • Two new GeoExperiment.PHASES: impact_measurement_started, impact_measurement_done.
  • New nullable insights attribute — the measurement output (ExperimentInsights schema), stored beside metadata.
  • New nullable impactTaskId attribute — the Mystique task handle, a first-class field like pre/postScheduleId, so the engine can resume polling across cron ticks.
  • Updated index.d.ts types and unit tests.

Why

The experimentation engine keeps an experiment IN_PROGRESS after post-analysis, triggers a Mystique analysis, polls it, and writes the resulting insights back onto the experiment. These fields/phases are the data-model foundation for that.

Notes

  • DynamoDB/electrodb — no SQL migration in this repo.
  • Unit tests: 2370 passing; 100% coverage on the changed geo-experiment files; lint clean.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

This PR will trigger a minor release when merged.

@ssilare-adobe ssilare-adobe requested a review from MysticatBot July 6, 2026 09:25

@MysticatBot MysticatBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ssilare-adobe,

⚠ Degraded review - no spec document was found for this change (searched the PR links, the touched repos' docs, the architecture/guidelines docs, and linked Jira). This review covers code-level quality but could not validate the change against an agreed design, so confidence is reduced. Add a spec link (PR template section 4) and re-request review for a full-confidence pass.

Verdict: Approve - clean additive change following established entity patterns exactly.
Complexity: LOW - small diff, single service.
Changes: Adds impact-measurement lifecycle phases and two new nullable fields (impactTaskId, insights) to the GeoExperiment data model (4 files).

Non-blocking (3): minor issues and suggestions
  • suggestion: getInsights() return type could use a named ExperimentInsights interface instead of bare object, since the PR description documents a known schema shape (version, generatedAt, analyses) - packages/spacecat-shared-data-access/src/models/geo-experiment/index.d.ts:38. Matches existing metadata/error convention, so optional.
  • suggestion: Add a test that sets insights to null to confirm the nullable path works through the model layer - packages/spacecat-shared-data-access/test/unit/models/geo-experiment/geo-experiment.model.test.js:178
  • suggestion: Add a negative validation test for impactTaskId with empty string to confirm the hasText validator rejects it - packages/spacecat-shared-data-access/test/unit/models/geo-experiment/geo-experiment.model.test.js:71

Skill: pr-review | Model: us.anthropic.claude-opus-4-6-v1[1m] | Duration: 1m 8s | Cost: $4.00 | Commit: e8ed764f95c6fd77795015cafeabb3f171b4f398
If this code review was useful, please react with 👍. Otherwise, react with 👎.

@MysticatBot MysticatBot added ai-reviewed Reviewed by AI complexity:low AI-assessed PR complexity: LOW labels Jul 6, 2026
@ssilare-adobe ssilare-adobe requested a review from dipratap July 6, 2026 09:38
@dipratap dipratap self-requested a review July 6, 2026 10:34
…tadata, insightsLocation (S3) instead of insights column
@ssilare-adobe ssilare-adobe requested a review from dipratap July 6, 2026 11:51

@dipratap dipratap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ssilare-adobe Please also create DB migration PR in mysticat and validate on dev

…mpact-measurement

# Conflicts:
#	package-lock.json
@ssilare-adobe ssilare-adobe requested a review from MysticatBot July 7, 2026 10:43

@MysticatBot MysticatBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ssilare-adobe,

⚠ Degraded review - no spec document was found for this change (searched the PR links, the touched repos' docs, the architecture/guidelines docs, and linked Jira). This review covers code-level quality but could not validate the change against an agreed design, so confidence is reduced. Add a spec link (PR template section 4) and re-request review for a full-confidence pass.

Verdict: Approve - clean additive change addressing all reviewer feedback, following established patterns.
Complexity: LOW - small diff, single service.
Changes: Adds impact-measurement lifecycle phases, a metadata key for the task ID, and an insightsLocation string field to the GeoExperiment data model (4 files).

Non-blocking (2): minor issues and suggestions
  • suggestion: Update the PR description to match the final implementation - it still references impactTaskId as a "first-class field like pre/postScheduleId" and insights as "the measurement output", but the code now stores the task ID in metadata (METADATA_KEYS.IMPACT_MEASUREMENT_TASK_ID) and uses insightsLocation (an S3 pointer, mirroring promptsLocation). The inline discussion makes this clear, but the description will confuse future readers landing via git blame.
  • nit: insightsLocation validator (value) => !value || hasText(value) accepts empty string because !'' is truthy - consistent with promptsLocation and the rest of the codebase, so not a regression, but worth knowing if downstream consumers assume non-empty.

Previously flagged, now resolved

  • impactTaskId moved from schema attribute to METADATA_KEYS constant (per dipratap's request)
  • insights object replaced with insightsLocation S3 pointer string (per dipratap's request)
  • TypeScript declarations updated to match

Skill: pr-review | Model: us.anthropic.claude-opus-4-6-v1[1m] | Duration: 1m 11s | Cost: $2.50 | Commit: dfc8ec7842ca169a567b02066f3a84a847eee636
If this code review was useful, please react with 👍. Otherwise, react with 👎.

@ssilare-adobe ssilare-adobe merged commit f56ae3d into main Jul 7, 2026
6 checks passed
@ssilare-adobe ssilare-adobe deleted the feat/geo-experiment-impact-measurement branch July 7, 2026 10:51
solaris007 pushed a commit that referenced this pull request Jul 7, 2026
## [@adobe/spacecat-shared-data-access-v4.2.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v4.1.1...@adobe/spacecat-shared-data-access-v4.2.0) (2026-07-07)

### Features

* **data-access:** GeoExperiment impact-measurement phases + insights/impactTaskId fields ([#1779](#1779)) ([f56ae3d](f56ae3d))
@solaris007

Copy link
Copy Markdown
Member

🎉 This PR is included in version @adobe/spacecat-shared-data-access-v4.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-reviewed Reviewed by AI complexity:low AI-assessed PR complexity: LOW released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants