feat(data-access): GeoExperiment impact-measurement phases + insights/impactTaskId fields#1779
Conversation
…sights/impactTaskId fields
|
This PR will trigger a minor release when merged. |
…mpact-measurement
There was a problem hiding this comment.
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 namedExperimentInsightsinterface instead of bareobject, 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 existingmetadata/errorconvention, so optional. - suggestion: Add a test that sets
insightstonullto 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
impactTaskIdwith empty string to confirm thehasTextvalidator 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 👎.
…tadata, insightsLocation (S3) instead of insights column
dipratap
left a comment
There was a problem hiding this comment.
@ssilare-adobe Please also create DB migration PR in mysticat and validate on dev
…mpact-measurement # Conflicts: # package-lock.json
There was a problem hiding this comment.
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
impactTaskIdas a "first-class field like pre/postScheduleId" andinsightsas "the measurement output", but the code now stores the task ID in metadata (METADATA_KEYS.IMPACT_MEASUREMENT_TASK_ID) and usesinsightsLocation(an S3 pointer, mirroringpromptsLocation). The inline discussion makes this clear, but the description will confuse future readers landing via git blame. - nit:
insightsLocationvalidator(value) => !value || hasText(value)accepts empty string because!''is truthy - consistent withpromptsLocationand the rest of the codebase, so not a regression, but worth knowing if downstream consumers assume non-empty.
Previously flagged, now resolved
impactTaskIdmoved from schema attribute toMETADATA_KEYSconstant (per dipratap's request)insightsobject replaced withinsightsLocationS3 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 👎.
## [@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))
|
🎉 This PR is included in version @adobe/spacecat-shared-data-access-v4.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What
Adds the shared-model changes for the impact-measurement workflow (see the Impact Validation Engine | Impact Measurement Workflow wiki):
GeoExperiment.PHASES:impact_measurement_started,impact_measurement_done.insightsattribute — the measurement output (ExperimentInsights schema), stored besidemetadata.impactTaskIdattribute — the Mystique task handle, a first-class field likepre/postScheduleId, so the engine can resume polling across cron ticks.index.d.tstypes and unit tests.Why
The experimentation engine keeps an experiment
IN_PROGRESSafter 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
🤖 Generated with Claude Code