# Feedback Trace Builder Builds an anonymized telemetry trace from migration artifacts in `$MIGRATION_DIR/`. The trace never includes resource names, file paths, account IDs, IPs, variable values, or secrets. **Execute ALL steps in order. Do not skip or deviate.** ## Step 1: Initialize Trace Object Create an empty `trace` object with `migration_id` from `.phase-status.json`. ## Step 2: Extract Phase Metadata Read `$MIGRATION_DIR/.phase-status.json` and add to `trace`: ```json { "migration_id": "", "phases_completed": [""] } ``` Only include phases with value `"completed"`. ## Step 3: Extract Discovery Summary IF `$MIGRATION_DIR/gcp-resource-inventory.json` exists, add: ```json { "discovery": { "total_resources": "", "primary_resources": "", "secondary_resources": "", "resource_type_counts": { "": "" }, "has_ai_workload": "" } } ``` For `resource_type_counts`: group `resources[]` by `type` and count each. Do NOT include resource names or addresses. ## Step 4: Extract Cluster Count IF `$MIGRATION_DIR/gcp-resource-clusters.json` exists, add: ```json { "cluster_count": "" } ``` ## Step 5: Extract AI Profile Summary IF `$MIGRATION_DIR/ai-workload-profile.json` exists, add: ```json { "ai_profile": { "ai_source": "", "total_models_detected": "", "languages_found": "", "integration_pattern": "", "gateway_type": "", "capabilities_summary": "" } } ``` ## Step 6: Extract Billing Summary IF `$MIGRATION_DIR/billing-profile.json` exists, add: ```json { "billing": { "total_monthly_spend": "", "service_count": "" } } ``` ## Step 7: Extract Preferences Metadata IF `$MIGRATION_DIR/preferences.json` exists, add: ```json { "preferences": { "questions_asked_count": "", "questions_defaulted_count": "", "questions_skipped_count": "", "category_e_enabled": "", "constraint_values": "" } } ``` Include only the `value` field from each constraint. Do NOT include `chosen_by` or any free-text fields. ## Step 8: Extract Design Summary IF `$MIGRATION_DIR/aws-design.json` exists, add each resource mapping as: ```json { "design_mappings": [ { "gcp_type": "", "aws_service": "", "confidence": "" } ], "unmapped_count": "" } ``` IF `$MIGRATION_DIR/aws-design-ai.json` exists, add: ```json { "design_ai": { "honest_assessment": "", "bedrock_model_count": "" } } ``` ## Step 9: Extract Estimation Summary For each `estimation-*.json` file that exists in `$MIGRATION_DIR/`, add: ```json { "estimation_": { "pricing_source": "", "accuracy_confidence": "", "monthly_cost": "" } } ``` Where `` is `infra`, `ai`, or `billing` based on the filename. ## Step 10: Extract Generation Summary For each `generation-*.json` file that exists in `$MIGRATION_DIR/`, add: ```json { "generation_": { "generation_source": "", "total_weeks": "", "risk_count": "" } } ``` ## Step 11: Count Generated Artifacts Count files in generated artifact directories (if they exist): ```json { "artifacts": { "terraform_file_count": "", "scripts_file_count": "", "ai_migration_file_count": "" } } ``` Only include keys for directories that exist. Use 0 if directory exists but is empty. ## Step 12: Write Trace Write the assembled `trace` object to `$MIGRATION_DIR/trace.json`. Output: "Trace built. Extracted anonymized data from N artifacts."