Skip to content

feat: adopt batch MCP tools and enrich migration telemetry#53

Merged
vahidlazio merged 2 commits into
mainfrom
feat/batch-migration-tools-and-telemetry
Jul 16, 2026
Merged

feat: adopt batch MCP tools and enrich migration telemetry#53
vahidlazio merged 2 commits into
mainfrom
feat/batch-migration-tools-and-telemetry

Conversation

@vahidlazio

@vahidlazio vahidlazio commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Updates the migrate-optimizely skill based on a real 946-flag Nike migration across 24 projects.

Batch execution flow

  • Per-project processing: create batch → rules batch → update plan → spot-check. Don't create all flags first then all rules — interleave per project for resumability.
  • batchCreateFlags — up to 20 flags per call (parallel, 10 threads), stamps migration-started label
  • batchAddTargetingRules — up to 20 rules per call (parallel across flags, sequential within), stamps migration-completed label on success
  • Plan file updates after each batch for session resume

Quota awareness (discovered during migration)

  • Flags quota: hit at 100, documented with detection strategy
  • Segments quota: 200 limit — each targeting rule with audience conditions creates a segment internally. Catch-all rules (no payload) don't consume a segment.
  • Strategy: check capacity before large migrations, request quota increases

Variant name safety

  • ALWAYS pass explicit variants from the export data — never rely on defaults
  • Without custom variants, flags get disabled/enabled but rules reference on-flag/off-flag → rule creation fails with "variant not found"
  • Documented the onon-flag, offoff-flag transform (Confidence 4-char minimum)

Enriched telemetry

  • New fields: flags_created, flags_remaining, flags_failed, current_project, project_progress, batch_size, errors
  • Send after every batch, not just "significant steps"
  • Honest sentiment — must reflect actual conversation tone

Depends on

Test plan

  • Tested in real migration: 251 iOS flags created via 8 batch calls
  • Targeting rules: 54/304 rules added before segment quota hit
  • Run full migration after quota increase
  • Verify plan file updates work for session resume

🤖 Generated with Claude Code

vahidlazio and others added 2 commits July 16, 2026 13:21
Updates the migrate-optimizely skill to use the new batch MCP tools
from konfidens-mcp#362 and enriches telemetry reporting:

Batch execution:
- batchCreateFlags: creates all flags for a project in one call with
  parallel execution (10 threads), stamps migration-started label
- batchAddTargetingRules: adds all rules in one call, preserves
  per-flag order, stamps migration-completed label on success
- Spot-check verification instead of per-flag resolveFlag

Telemetry enrichment:
- New fields: flags_created, flags_remaining, flags_failed,
  current_project, project_progress, batch_size, errors
- Send after EVERY batch, not just "significant steps"
- Sentiment must honestly reflect conversation tone — static
  "positive" on every event is explicitly called out as wrong

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vahidlazio
vahidlazio merged commit c96d060 into main Jul 16, 2026
1 check passed
@vahidlazio
vahidlazio deleted the feat/batch-migration-tools-and-telemetry branch July 16, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants