fix(platform): tolerate older VPS bundles without Symphony#230
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Greptile SummaryThis PR makes
Confidence Score: 5/5Safe to merge — the change is narrowly scoped to making one optional service truly optional, with no impact on core service startup. The shell logic is correct: unquoted empty $optional_services is silently discarded by word splitting, so systemctl enable and systemctl start receive only the intended arguments whether or not Symphony is present. The binary+unit existence guard fires after the install and daemon-reload steps, so the check accurately reflects what's on disk. Core services remain unconditionally fail-closed. Tests are updated to cover the new variable-based pattern. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[cloud-init runcmd starts] --> B[Install systemd units from bundle\n/opt/matrix/systemd/*.service]
B --> C[chmod required_bin loop\nmatrixctl, matrix-gateway, matrix-shell,\nmatrix-code, matrix-sync-agent,\nmatrix-install-hermes]
C --> D[chmod optional_bin loop\nmatrix-symphony, linux-tools,\nmessaging binaries]
D --> E{binary exists?}
E -->|exists| F[chmod 0750]
E -->|missing| G[skip silently]
F --> H[systemctl daemon-reload]
G --> H
H --> I[base_services=\nmatrix-restore, gateway,\nshell, code, sync-agent]
I --> J{binary -x AND unit -f?}
J -->|YES| K[optional_services= matrix-symphony.service]
J -->|NO| L[optional_services=empty, log skip]
K --> M[systemctl enable base+optional+linux-tools+db-backup+nginx]
L --> M
M --> N[systemctl start base+optional]
N --> O[Core platform running\nSymphony only if bundle includes it]
Reviews (2): Last reviewed commit: "test(platform): update optional Symphony..." | Re-trigger Greptile |
| expect(cloudInit).toContain("matrix-symphony"); | ||
| expect(cloudInit).toContain("systemctl enable matrix-restore.service matrix-gateway.service matrix-shell.service matrix-code.service matrix-sync-agent.service matrix-symphony.service"); | ||
| expect(cloudInit).toContain("systemctl start matrix-restore.service matrix-gateway.service matrix-shell.service matrix-code.service matrix-sync-agent.service matrix-symphony.service"); | ||
| expect(cloudInit).not.toContain("required_bin in matrixctl matrix-db-backup.sh matrix-restore.sh matrix-gateway matrix-shell matrix-code matrix-sync-agent matrix-symphony"); |
There was a problem hiding this comment.
Negative assertion is a partial-match guard
The not.toContain check uses a substring that stops at matrix-sync-agent matrix-symphony (omitting matrix-install-hermes). It correctly prevents matrix-symphony from re-appearing in the required list because any required-list string ending in ...matrix-sync-agent matrix-symphony would match. However, if matrix-symphony were accidentally re-inserted after matrix-install-hermes (e.g., ...matrix-install-hermes matrix-symphony), this assertion would still pass silently since the checked fragment isn't present. A toContain asserting the exact current required_bin string would catch both directions of regression.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/deploy/customer-vps/symphony-systemd.test.ts
Line: 43
Comment:
**Negative assertion is a partial-match guard**
The `not.toContain` check uses a substring that stops at `matrix-sync-agent matrix-symphony` (omitting `matrix-install-hermes`). It correctly prevents `matrix-symphony` from re-appearing in the required list because any required-list string ending in `...matrix-sync-agent matrix-symphony` would match. However, if `matrix-symphony` were accidentally re-inserted *after* `matrix-install-hermes` (e.g., `...matrix-install-hermes matrix-symphony`), this assertion would still pass silently since the checked fragment isn't present. A `toContain` asserting the exact current required_bin string would catch both directions of regression.
How can I resolve this? If you propose a fix, please make it concise.
Summary
matrix-symphony.serviceonly when both the binary and unit exist in the extracted host bundle.Incident Context
Nima's recovery VM booted an older bundle (
v2026.05.24-082-staging-ff593047) that did not include/opt/matrix/bin/matrix-symphony. Current cloud-init treated that binary as required, so setup aborted before gateway startup and platform registration.Invariants
user_machinesremains canonical for VPS state; this only changes bootstrap service selection.Verification
bun run test tests/deploy/customer-vps/symphony-systemd.test.ts