|
| 1 | +# Review: `v0.2.0-rc11..v0.2.0-rc19` |
| 2 | + |
| 3 | +## CRITICAL |
| 4 | + |
| 5 | +No critical findings in this range. |
| 6 | + |
| 7 | +## HIGH |
| 8 | + |
| 9 | +### 1. `enable_satellite_services` is now effectively hard-disabled for all Terraform installs |
| 10 | + |
| 11 | +Files: |
| 12 | +- `deploy/terraform/variables.tf:206` |
| 13 | +- `tools/loki-installer/src/adapters/terraform.rs:444` |
| 14 | +- `methods/terraform.yaml:12` |
| 15 | +- `packs/openclaw/manifest.yaml:19` |
| 16 | + |
| 17 | +What changed: |
| 18 | +- `enable_satellite_services` now defaults to `false` in Terraform. |
| 19 | +- The adapter can only pass `-var=enable_satellite_services=...` if `adapter_options` contains that key. |
| 20 | +- Nothing in the Terraform method manifest or pack manifests exposes `enable_satellite_services` as a user-selectable or defaulted option. |
| 21 | + |
| 22 | +Impact: |
| 23 | +- Fresh Terraform installs will now skip the entire satellite-services path by default, including the Bedrock form Lambda, security enablement Lambda, and builder admin-user setup. |
| 24 | +- The description in `variables.tf` says this should be disabled only for reinstalls or existing-VPC cases, but the current wiring makes `false` the only reachable value. |
| 25 | + |
| 26 | +Why this is a bug: |
| 27 | +- This is not just a safer default. It is a behavioral regression that silently removes resources from every Terraform deployment. |
| 28 | + |
| 29 | +Recommended fix: |
| 30 | +- Keep the Terraform variable default aligned with the intended default behavior for first installs. |
| 31 | +- If you want reinstall-specific behavior, derive it in the installer and pass it explicitly, instead of changing the Terraform default to an unreachable value. |
| 32 | + |
| 33 | +### 2. The environment-name persistence fix is repo-global and does not actually solve reinstall/state continuity safely |
| 34 | + |
| 35 | +Files: |
| 36 | +- `tools/loki-installer/src/adapters/terraform.rs:196` |
| 37 | + |
| 38 | +What changed: |
| 39 | +- When `resolved_stack_name` is absent, Terraform now reads `deploy/terraform/.loki-env` and reuses `ENVIRONMENT_NAME`. |
| 40 | +- If the file does not exist, it generates a random suffix and immediately writes it back. |
| 41 | + |
| 42 | +Impact: |
| 43 | +- All future Terraform installs from the same checkout share one repo-local environment name, regardless of pack, profile, region, AWS account, or workspace. |
| 44 | +- A second install from the same repo can unintentionally target the first install’s naming namespace. |
| 45 | +- A reinstall from a fresh checkout still generates a new name, so the original “destroy old resources on reinstall” problem is not actually solved across machines or clones. |
| 46 | + |
| 47 | +Why this is a bug: |
| 48 | +- The fix stores identity in an unscoped local sidecar file rather than in deployment state. |
| 49 | +- That avoids churn only in the narrow “same checkout, same repo dir” case, and creates cross-install collisions in the broader case. |
| 50 | + |
| 51 | +Recommended fix: |
| 52 | +- Prefer existing Terraform state first, not a random local file. |
| 53 | +- Practical order: |
| 54 | + 1. If the user supplied `stack_name`, use it. |
| 55 | + 2. If Terraform state already exists for the selected workspace, read the prior `environment_name` from state before planning. |
| 56 | + 3. Only if no state exists, generate a name once and persist it. |
| 57 | +- If you keep a local file fallback, key it by at least workspace + pack + profile + region + AWS account, not a single repo-wide `.loki-env`. |
| 58 | + |
| 59 | +### 3. Deploy log truncation is not safe and likely does not fix the reported garbling reliably |
| 60 | + |
| 61 | +Files: |
| 62 | +- `tools/loki-installer/src/tui/screens/deploy.rs:15` |
| 63 | +- `tools/loki-installer/src/tui/runtime.rs:334` |
| 64 | + |
| 65 | +What changed: |
| 66 | +- The deploy screen now truncates log lines using `content_with_width`. |
| 67 | +- Truncation is done with `line.len()` and `&line[..max_line]`. |
| 68 | + |
| 69 | +Impact: |
| 70 | +- `len()` is byte length, not terminal display width. |
| 71 | +- `&line[..max_line]` can panic if `max_line` lands inside a multibyte UTF-8 character. |
| 72 | +- This code uses the outer widget width (`body[1].width`) rather than the inner content width after borders, so even ASCII truncation is off by the block chrome. |
| 73 | + |
| 74 | +Why this is a bug: |
| 75 | +- The current implementation is not width-aware and is not UTF-8 safe. |
| 76 | +- That means it can still wrap badly, and with the wrong input it can crash instead of merely truncating. |
| 77 | + |
| 78 | +Recommended fix: |
| 79 | +- Measure display width with `unicode-width`. |
| 80 | +- Truncate by `chars()` or grapheme boundaries, not raw byte slicing. |
| 81 | +- Use the inner paragraph width, not the block width, when computing available columns. |
| 82 | + |
| 83 | +## MEDIUM |
| 84 | + |
| 85 | +### 4. Simple mode still does not let the user see or change the preselected pack/profile before the plan is built |
| 86 | + |
| 87 | +Files: |
| 88 | +- `tools/loki-installer/src/tui/update.rs:280` |
| 89 | +- `tools/loki-installer/src/tui/update.rs:307` |
| 90 | +- `tools/loki-installer/src/tui/runtime.rs:93` |
| 91 | + |
| 92 | +What happens: |
| 93 | +- In simple mode, `DoctorPreflight -> LoadPacks`. |
| 94 | +- `PacksLoaded` auto-selects `openclaw` and returns `LoadProfiles`. |
| 95 | +- `ProfilesLoaded` auto-selects `builder` and returns `LoadMethods`. |
| 96 | +- In `ProfileSelection`, simple mode immediately returns `BuildPlan`. |
| 97 | +- `run_actions()` drains this queue synchronously in one pass. |
| 98 | + |
| 99 | +Impact: |
| 100 | +- The user does not get an interactive stop on pack or profile selection. |
| 101 | +- They jump straight from doctor to review. |
| 102 | +- The only way to change pack/profile is later, from review, by pressing `A` to switch modes and restart selection. |
| 103 | + |
| 104 | +Answer to the question: |
| 105 | +- No, not in the current simple-mode runtime flow. |
| 106 | + |
| 107 | +Recommended fix: |
| 108 | +- Decide which behavior you want: |
| 109 | + - If simple mode should still be editable, stop the queue on the pack/profile screens and wait for input. |
| 110 | + - If simple mode should be non-editable, make that explicit in the UX and present the chosen defaults only on review. |
| 111 | + |
| 112 | +### 5. The new post-install summary will often show `Stack: <environment_name>` for Terraform installs |
| 113 | + |
| 114 | +Files: |
| 115 | +- `tools/loki-installer/src/tui/screens/post_install.rs:25` |
| 116 | +- `methods/terraform.yaml:5` |
| 117 | +- `tools/loki-installer/src/adapters/terraform.rs:380` |
| 118 | + |
| 119 | +What changed: |
| 120 | +- The post-install screen now tries `resolved_stack_name`, then `artifacts["stack_name"]`, then `request.stack_name`. |
| 121 | +- For Terraform, `requires_stack_name` is `false`, so `resolved_stack_name` is normally `None`. |
| 122 | +- The Terraform adapter records outputs like `instance_id`/`public_ip`, but it does not record the chosen `environment_name` as an artifact. |
| 123 | + |
| 124 | +Impact: |
| 125 | +- Successful Terraform installs can land on the new completion screen with a placeholder instead of the actual deployed environment name. |
| 126 | + |
| 127 | +Recommended fix: |
| 128 | +- Record the final `environment_name` into session artifacts during Terraform apply/output capture, and have post-install read that artifact explicitly. |
| 129 | + |
| 130 | +## LOW |
| 131 | + |
| 132 | +### 6. The `admin_setup_basic` count mismatch was fixed correctly |
| 133 | + |
| 134 | +Files: |
| 135 | +- `deploy/terraform/main.tf:638` |
| 136 | + |
| 137 | +Assessment: |
| 138 | +- The new `count = var.enable_satellite_services && var.profile_name == "builder" ? 1 : 0` now matches the producer resource `aws_iam_role.admin_setup_lambda[0]`. |
| 139 | +- I did not find a remaining count/index mismatch in this specific block after the change. |
0 commit comments