Skip to content

Commit 7bf129e

Browse files
freddyDOTCMSclaude
andcommitted
spec(37659): address reviewer findings — terminology, contradictions, scope notes
- Replace _abort with _cancel throughout (FR-002); implementation note mapping retained - Add _end to US2 blocked list and SC-001 (was missing despite FR-001/Contract Changes) - Clarify _end is gated by FEATURE_FLAG_EXPERIMENTS only — App config has no effect - Reword FEATURE_FLAG_CONTENT_ANALYTICS in Key Entities to "removed from new gate logic" - Add Legacy Considerations note: flag deleted when AnalyticsTrackWebInterceptor is removed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 10eaec2 commit 7bf129e

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

  • specs/37659-analytics-experiment-flag-gates

‎specs/37659-analytics-experiment-flag-gates/spec.md‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ analytics or experiments.
3535
experiment has ever been activated for this instance (the free slot is available). The
3636
operator can run exactly one experiment with a maximum duration of 10 days; event collection
3737
works normally because the App is configured. Scheduling, canceling a scheduled experiment,
38-
and archiving are blocked. Once the experiment completes, the free slot is consumed and no
38+
stopping, and archiving are blocked. Once the experiment completes, the free slot is consumed and no
3939
further experiments can be started without upgrading.
4040

4141
**Why this priority**: This is the primary evaluation path for new customers — they must be
@@ -131,7 +131,9 @@ Affected: `POST /api/v1/experiments/{id}/_start` (immediate and future-dated),
131131
*When the Analytics App is not configured (any flag state):*
132132
- All activation endpoints → `503 Service Unavailable`. Activation is blocked because there
133133
is no backend to track events.
134-
- CRUD, health, `_end`, and `isUserIncluded` remain accessible; results are not available.
134+
- CRUD, health, and `isUserIncluded` remain accessible; results are not available.
135+
- `_end` accessibility is governed solely by `FEATURE_FLAG_EXPERIMENTS` (see below) — App
136+
configuration has no effect on it because `_end` does not interact with CAEM.
135137

136138
*When `FEATURE_FLAG_EXPERIMENTS=false` and the free slot is already used:*
137139
- `_start` (immediate), future-dated `_start`, `_cancel`, `archive`, and `_end` → `403 FEATURE_DISABLED`.
@@ -205,7 +207,9 @@ configure the Analytics App regardless of flag state.
205207
ARCHIVED ones. Allowing archive would let a user run their free experiment, archive it
206208
once finished, and recover the free slot to run another, bypassing the one-experiment
207209
limit entirely.
208-
- **`_end`** — MUST return `403 FEATURE_DISABLED` in limited mode. Rationale: stopping a
210+
- **`_end`** — MUST return `403 FEATURE_DISABLED` when `FEATURE_FLAG_EXPERIMENTS=false`,
211+
regardless of Analytics App configuration. This endpoint does not interact with CAEM, so
212+
App state is irrelevant — only the flag governs it. Rationale: stopping a
209213
RUNNING experiment moves it back to DRAFT state, which is not counted by the free slot
210214
check (`{RUNNING, SCHEDULED, ENDED}`). A user could exploit this to recover the free
211215
slot mid-experiment and start a new one, bypassing the one-experiment limit. This is
@@ -231,7 +235,7 @@ configure the Analytics App regardless of flag state.
231235
- **FR-002**: When `FEATURE_FLAG_EXPERIMENTS=true` **and** the Analytics App is configured for
232236
the site, all experiment endpoints MUST continue to function as they do today with no
233237
behavioral change, including start and scheduling operations. If the Analytics App is not
234-
configured, activation operations (`_start`, `_schedule`, `_abort`, `archive`) return `503`
238+
configured, activation operations (`_start`, `_schedule`, `_cancel`, `archive`) return `503`
235239
per FR-001.
236240
- **Test**: Unit — verify no gate fires and no `403`/`503` is returned when both conditions
237241
are met. No Postman or integration tests required — this is a regression guard only.
@@ -477,8 +481,9 @@ configure the Analytics App regardless of flag state.
477481
changes without a restart; this live-toggle capability MUST be removed system-wide as part
478482
of this feature (FR-010). After this change, the value is read once at server startup and
479483
held for the lifetime of the instance — a restart is required for changes to take effect.
480-
`FEATURE_FLAG_CONTENT_ANALYTICS` is removed; analytics availability is now determined by
481-
whether the Analytics App is configured for the site.
484+
`FEATURE_FLAG_CONTENT_ANALYTICS` is removed from the new gate logic; analytics availability
485+
is now determined by whether the Analytics App is configured for the site (see Legacy
486+
Considerations for full disposition).
482487
- **Analytics App**: The site-level App configuration that provides credentials (site auth,
483488
bearer token, URL) for connecting to the CAEM analytics backend. When the App is configured
484489
for a site, analytics is enabled for that site. When it is absent or incomplete, analytics
@@ -498,7 +503,7 @@ configure the Analytics App regardless of flag state.
498503
### Measurable Outcomes
499504

500505
- **SC-001**: When `FEATURE_FLAG_EXPERIMENTS=false` and the Analytics App is configured
501-
(limited experiment mode): `_schedule`, `_cancel`, and `archive` return `403 FEATURE_DISABLED`;
506+
(limited experiment mode): `_schedule`, `_cancel`, `archive`, and `_end` return `403 FEATURE_DISABLED`;
502507
`_start` succeeds once (free slot, max 10-day duration enforced with `400` if exceeded) and
503508
returns `403 FEATURE_DISABLED` thereafter; all other experiment operations remain accessible;
504509
event ingest forwards to CAEM as-is. The experiments health endpoint returns `tier: "limited"`
@@ -532,6 +537,10 @@ configure the Analytics App regardless of flag state.
532537
— the interceptor continues to use this flag to gate page-view event tracking as it does
533538
today. Migrating or removing `AnalyticsTrackWebInterceptor` is deferred to a future cleanup
534539
task. The new code introduced by this feature MUST NOT reference or depend on this flag.
540+
**"Removed" scope**: "removed from the new gate logic" means the new code introduced by
541+
this feature does not use this flag. The constant itself and all existing usages remain
542+
untouched. The flag will be fully deleted from the codebase when `AnalyticsTrackWebInterceptor`
543+
is removed as part of that future cleanup.
535544
- **Backward-compatibility expectations**: When `FEATURE_FLAG_EXPERIMENTS=true` and the
536545
Analytics App is configured (the fully-enabled state that existing customers have), behavior
537546
must be identical to today — no requests that currently succeed may be broken. The gate

0 commit comments

Comments
 (0)