Skip to content

[3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) - #3787

Merged
integry merged 5 commits into
3758-epic-runtime-abstraction-sc0from
3785/claude-opus-5-5-propr-deploy-fly-fit-the--20261124-1107-3vo
Nov 24, 2026
Merged

integry merged 5 commits into
3758-epic-runtime-abstraction-sc0from
3785/claude-opus-5-5-propr-deploy-fly-fit-the--20261124-1107-3vo

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3785

Branch: 3785/claude-opus-5-5-propr-deploy-fly-fit-the--20261124-1107-3vo
Commits: ✅ Changes committed (0b0ad16)


AI Processing Completed

Execution Details:

Summary:
I've implemented #3785: propr deploy fly --legacy-docker should now fit the Fly Free plan. The 112 deploy-fly tests pass and both typechecks are clean. Nothing has run against a real Fly org yet. That includes the Free-plan check, which could misread the plan (see below).

1. Docker images on a persistent root filesystem

  • In legacy mode the Machine gets rootfs: { size_gb, persist: true }. The size comes from a new --rootfs-size option: default 20 GB, minimum 10, and it only works with --legacy-docker. Both the Machines API path and the flyctl path send it.
  • The Docker disk image moves off the volume to /var/lib/propr-docker/docker.ext4 on the root filesystem. It is the root filesystem size minus 4 GB, left for the Machine's own container images. The loop mount (so the storage driver is overlay2) and the stale PID cleanup work as before.
  • The volume now defaults to 1 GB in legacy mode too, and the old "volume must be 10 GB or more" rule is gone.
  • Existing deployments: on its first boot after a redeploy, the new script deletes the old /usr/src/app/data/docker.ext4 from the volume. Agent images get downloaded again once, and the volume keeps its old size because Fly volumes can't shrink.
  • Memory change (not asked for in the issue): legacy mode now accepts --memory 1024, following the issue's note that 1 GB is enough. The default stays at 2048 MB, because agent containers need room on top of dockerd. Say if you'd rather keep the 2 GB minimum.

2. Free-plan volume check

  • If --volume-size is over 5 GB, the deploy asks Fly for the org's plan before creating anything. If the org is on the Free plan, it stops with "the Free plan caps volumes at 5 GB… Nothing was created. Rerun without --volume-size (default: 1 GB…)".
  • It reads the plan from Fly's GraphQL API (the paidPlan field on the organization). I'm assuming that field identifies the Free plan; it's worth checking against a Free-plan org.
  • With flyctl, it uses the token from fly auth token; without flyctl, it uses the Machines API token. If the plan can't be read, the deploy logs that and carries on.
  • --dry-run makes no call to Fly. If the volume is over 5 GB, it prints a note that a real run will check the plan.

3. Plan output, --dry-run included
I ran a real dry run. With --legacy-docker the summary now shows:

Machine:       shared-cpu-1x, 2048 MB, iad; volume propr_data (1 GB)
Root fs:       20 GB, persistent (Docker images; SQLite and Redis stay on the volume)
Root fs cost:  $3.00/month while the Machine is stopped ($0.15/GB-month)

4. Docs

  • deploy-fly.md has a new "Fly Free plan" section listing what fits: 1 GB Machine, 1 GB volume, Sprites agents, opt-in idle shutdown, and legacy Docker on the root filesystem. I also updated the legacy mode, cost, preflight, dry-run and options sections.
  • The changelog and propr-cli.md are updated, and so is the CLI help text.

Tests: new or updated unit tests cover:

  • the root filesystem fields in legacy Machine configs, and their absence otherwise
  • the 1 GB default volume and the --rootfs-size checks
  • Docker disk sizing taken from the root filesystem rather than the volume
  • the old-image cleanup
  • the cost line
  • the Free-plan check for both backends: free plan refused before anything is created, paid or unknown goes ahead, volumes of 5 GB or less skip the lookup

The new plan lookup lives in packages/cli/src/commands/deploy/flyOrgPlan.ts, with its tests in flyOrgPlan.test.ts.

This is a CLI-only change, so I didn't make any visual previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (7 files)
    • packages/cli/src/commands/deploy/flyDeployRunner.ts (+30/−2)
    • packages/cli/src/commands/deploy/flyLegacyDocker.ts (+37/−10)
    • packages/cli/src/commands/deploy/flyMachineConfig.ts (+26/−5)
    • packages/cli/src/commands/deploy/flyMachinesApi.ts (+7/−0)
    • packages/cli/src/commands/deploy/flyOrgPlan.ts (added, +64/−0)
    • packages/cli/src/commands/deploy/flyctlBackend.ts (+8/−0)
    • packages/cli/src/commands/deployFly.ts (+44/−9)
  • Low risk (9 files)
    • CHANGELOG.md (+11/−1)
    • docs/docs/features/propr-cli.md (+1/−1)
    • docs/docs/operations/deploy-fly.md (+23/−6)
    • packages/cli/src/commands/deploy/flyDeployRunner.test.ts (+60/−8)
    • packages/cli/src/commands/deploy/flyLegacyDocker.test.ts (+11/−4)
    • packages/cli/src/commands/deploy/flyMachineConfig.test.ts (+19/−0)
    • packages/cli/src/commands/deploy/flyOrgPlan.test.ts (added, +45/−0)
    • packages/cli/src/commands/deploy/flyRedeploy.test.ts (+1/−0)
    • packages/cli/src/commands/deployFly.test.ts (+21/−5)

Diff size: 16 files changed, +408/−51 lines

View task for the run's logs and conversation.


This PR was created automatically by ProPR after processing issue #3785.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

I've implemented #3785: `propr deploy fly --legacy-docker` should now fit the Fly Free plan. The 112 deploy-fly tests pass and both typechecks are clean. Nothing has run against a real Fly org yet. That includes the Free-plan check, which could misread the plan (see below).

1. Docker images on a persistent root filesystem
- In legacy mode the Machine gets `rootfs: { size_gb, persist: true }`. The size comes from a new `--rootfs-size` option: default 20 GB, minimum 10, and it only works with `--legacy-docker`. Both the Machines API path and the flyctl path send it.
- The Docker disk image moves off the volume to `/var/lib/propr-docker/docker.ext4` on the root filesystem. It is the root filesystem size minus 4 GB, left for the Machine's own container images. The loop mount (so the storage driver is overlay2) and the stale PID cleanup work as before.
- The volume now defaults to 1 GB in legacy mode too, and the old "volume must be 10 GB or more" rule is gone.
- Existing deployments: on its first boot after a redeploy, the new script deletes the old `/usr/src/app/data/docker.ext4` from the volume. Agent images get downloaded again once, and the volume keeps its old size because Fly volumes can't shrink.
- Memory change (not asked for in the issue): legacy mode now accepts `--memory 1024`, following the issue's note that 1 GB is enough. The default stays at 2048 MB, because agent containers need room on top of dockerd. Say if you'd rather keep the 2 GB minimum.

2. Free-plan volume check
- If `--volume-size` is over 5 GB, the deploy asks Fly for the org's plan before creating anything. If the org is on the Free plan, it stops with "the Free plan caps volumes at 5 GB… Nothing was created. Rerun without --volume-size (default: 1 GB…)".
- It reads the plan from Fly's GraphQL API (the `paidPlan` field on the organization). I'm assuming that field identifies the Free plan; it's worth checking against a Free-plan org.
- With flyctl, it uses the token from `fly auth token`; without flyctl, it uses the Machines API token. If the plan can't be read, the deploy logs that and carries on.
- `--dry-run` makes no call to Fly. If the volume is over 5 GB, it prints a note that a real run will check the plan.

3. Plan output, `--dry-run` included
I ran a real dry run. With `--legacy-docker` the summary now shows:
```
Machine:       shared-cpu-1x, 2048 MB, iad; volume propr_data (1 GB)
Root fs:       20 GB, persistent (Docker images; SQLite and Redis stay on the volume)
Root fs cost:  $3.00/month while the Machine is stopped ($0.15/GB-month)
```

4. Docs
- `deploy-fly.md` has a new "Fly Free plan" section listing what fits: 1 GB Machine, 1 GB volume, Sprites agents, opt-in idle shutdown, and legacy Docker on the root filesystem. I also updated the legacy mode, cost, preflight, dry-run and options sections.
- The changelog and `propr-cli.md` are updated, and so is the CLI help text.

Tests: new or updated unit tests cover:
- the root filesystem fields in legacy Machine configs, and their absence otherwise
- the 1 GB default volume and the `--rootfs-size` checks
- Docker disk sizing taken from the root filesystem rather than the volume
- the old-image cleanup
- the cost line
- the Free-plan check for both backends: free plan refused before anything is created, paid or unknown goes ahead, volumes of 5 GB or less skip the lookup

The new plan lookup lives in `packages/cli/src/commands/deploy/flyOrgPlan.ts`, with its tests in `flyOrgPlan.test.ts`.

This is a CLI-only change, so I didn't make any visual previews.

ProPR-Agent: claude/claude-opus-5-5

integry commented Nov 24, 2026

Copy link
Copy Markdown
Owner

/ultrafix goal=8 max=10

@propr-dev propr-dev Bot added the ultrafix label Nov 24, 2026
@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR moves legacy Docker storage off the Fly volume, adds root filesystem sizing, and introduces an early volume-plan check. It needs a localized correction before merge: redeploy validation can check the wrong organization.

✅ Consistent configuration — Both deployment backends receive the same persistent root filesystem settings through the shared configuration builder.

✅ Focused coverage — Added tests cover default volume sizing, root filesystem options, and refusal before resource creation when the selected organization is Free-plan.

This review used static analysis of the supplied code only; no commands were run. The authoritative checks report 30 passed, four pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Check the existing app’s organization

  • Category: correctness

  • Required behavior: The new preflight must validate the organization owning the deployment’s resources and preserve valid redeploys of existing apps.

  • Evidence: packages/cli/src/commands/deploy/flyDeployRunner.ts:preflightFlyPlan, runFlyDeploy, and both targets’ ensureApp

    1. A user has access to a Free-plan organization and an existing app in a paid organization. They redeploy that app with --volume-size 20, supplying the Free-plan organization through --org.
    2. runFlyDeploy calls preflightFlyPlan before checking whether the app exists. The preflight queries plan.org, receives "free", and rejects the deployment.
    3. The existing app’s volume belongs to the paid organization, so the refusal applies another organization’s restriction and prevents a valid redeploy. Previously, both ensureApp implementations reused the existing app without using org; the documented option describes the organization to create the app in.

    static trace: Both backend implementations share this ordering and neither resolves the existing app’s owning organization. Tests use a single organization and therefore do not exercise this mismatch. The scenario assumes access to both organizations and a successful Free-plan response; no live Fly lookup was executed.

  • Minimum fix: Resolve the owning organization for an existing app and check its plan; use the requested organization when the app does not exist. Keep that resolution read-only and before resource creation, with coverage for both backends.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Validate the external plan contract

The new tests supply boolean organization.paidPlan values themselves, while the implementation summary explicitly identifies that interpretation as unverified. Confirm the field’s meaning against Fly’s contract or a representative response, including paid organizations without subscription plans. This is a verification follow-up rather than a demonstrated defect in the supplied code.

S2: 🟢 Exercise persistence on Fly

A deployment smoke test covering initial boot, restart, and root filesystem growth would strengthen confidence in the storage move. Current tests verify generated configuration and filesystem operations, but do not establish Fly’s handling of persistence in this multi-container layout. No platform incompatibility is established by the supplied evidence.

Score

The implementation is focused and has useful unit coverage, but the organization-selection regression needs correction. Pending checks alone do not lower the score.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 50s
  • Tokens: 64,551 (63,589 in / 962 out)
  • Cost: $0.57

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 S1 S2

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 068b46c

Addressed 1 AI review comment (IDs: 7130294486)

Addressed finding F1

Summary of Changes

I fixed F1. When --volume-size is over 5 GB, the Free-plan check now reads the plan of the org that owns an existing app. --org is used only when the app doesn't exist yet. So redeploying an app that lives in a paid org is no longer refused because --org names a Free-plan org. The reverse case is caught too: an existing app in a Free-plan org is refused even when --org is paid, and the error names the org that owns it. All 117 deploy-fly tests pass and both typechecks are clean. As with the original change, nothing has run against a real Fly org.

How it works

  • Both targets have a new read-only appOwner(app) lookup. The preflight calls it before the plan lookup and before anything is created.
  • With flyctl, the owner comes from Organization.Slug in apps list --json, in either letter case. With the Machines API, it comes from organization.slug in GET /apps/{app}, and a 404 means the app doesn't exist.
  • If an app exists but Fly doesn't say which org owns it, the deploy logs that and goes on. It does not fall back to checking --org, which would bring the same bug back. This matches the existing rule that an unreadable plan never blocks a deploy.
  • I'm assuming the JSON field names above from the flyctl and Machines API response formats. They haven't been checked against a live account.
  • The lookup and ensureApp each check whether the app exists, so it is read twice, but only when the volume is over 5 GB. Another tool could create or delete the app in between, a gap common to all API-driven tools. It can't be closed from the client.

Tests and docs

  • New runner tests cover three cases with fake targets: an existing app in a paid org deploys, one in a Free-plan org is refused, and a new app is checked against --org. Another test covers an existing app whose owner can't be read.
  • End-to-end tests run both targets through runFlyDeploy and check which org's plan is read and that nothing is created before the refusal. There is also a parsing test for the Machines API lookup.
  • To make sure the tests catch the bug, I put the old behaviour back (always checking --org): the four new runner tests then fail.
  • I updated the preflight paragraph in deploy-fly.md and the CHANGELOG.md entry to say which org is checked.

The change is mainly in preflightFlyPlan in packages/cli/src/commands/deploy/flyDeployRunner.ts. I found nothing else outside F1 worth reporting. It's a CLI-only change, so there are no visual previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (3 files)
    • packages/cli/src/commands/deploy/flyDeployRunner.ts (+25/−5)
    • packages/cli/src/commands/deploy/flyMachinesApi.ts (+11/−0)
    • packages/cli/src/commands/deploy/flyctlBackend.ts (+13/−1)
  • Low risk (5 files)
    • CHANGELOG.md (+4/−3)
    • docs/docs/operations/deploy-fly.md (+1/−1)
    • packages/cli/src/commands/deploy/flyDeployRunner.test.ts (+132/−2)
    • packages/cli/src/commands/deploy/flyMachinesApi.test.ts (+13/−0)
    • packages/cli/src/commands/deploy/flyRedeploy.test.ts (+1/−0)

Diff size: 8 files changed, +200/−12 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 5m 28s
  • Tokens: 1,065,165 (1,052,626 in / 12,539 out)
  • Cost: $0.82

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

I fixed F1. When `--volume-size` is over 5 GB, the Free-plan check now reads the plan of the org that owns an existing app. `--org` is used only when the app doesn't exist yet. So redeploying an app that lives in a paid org is no longer refused because `--org` names a Free-plan org. The reverse case is caught too: an existing app in a Free-plan org is refused even when `--org` is paid, and the error names the org that owns it. All 117 deploy-fly tests pass and both typechecks are clean. As with the original change, nothing has run against a real Fly org.

**How it works**
- Both targets have a new read-only `appOwner(app)` lookup. The preflight calls it before the plan lookup and before anything is created.
- With flyctl, the owner comes from `Organization.Slug` in `apps list --json`, in either letter case. With the Machines API, it comes from `organization.slug` in `GET /apps/{app}`, and a 404 means the app doesn't exist.
- If an app exists but Fly doesn't say which org owns it, the deploy logs that and goes on. It does not fall back to checking `--org`, which would bring the same bug back. This matches the existing rule that an unreadable plan never blocks a deploy.
- I'm assuming the JSON field names above from the flyctl and Machines API response formats. They haven't been checked against a live account.
- The lookup and `ensureApp` each check whether the app exists, so it is read twice, but only when the volume is over 5 GB. Another tool could create or delete the app in between, a gap common to all API-driven tools. It can't be closed from the client.

**Tests and docs**
- New runner tests cover three cases with fake targets: an existing app in a paid org deploys, one in a Free-plan org is refused, and a new app is checked against `--org`. Another test covers an existing app whose owner can't be read.
- End-to-end tests run both targets through `runFlyDeploy` and check which org's plan is read and that nothing is created before the refusal. There is also a parsing test for the Machines API lookup.
- To make sure the tests catch the bug, I put the old behaviour back (always checking `--org`): the four new runner tests then fail.
- I updated the preflight paragraph in `deploy-fly.md` and the `CHANGELOG.md` entry to say which org is checked.

The change is mainly in `preflightFlyPlan` in `packages/cli/src/commands/deploy/flyDeployRunner.ts`. I found nothing else outside F1 worth reporting. It's a CLI-only change, so there are no visual previews.

PR: #3787
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR moves legacy Docker storage onto a persistent root filesystem, reduces the default data volume to 1 GB, and adds an organization-plan preflight. The implementation is coherent, but a material verification gap remains around the external Fly contracts.

✅ Correct organization selection — The preflight checks an existing app’s owning organization and uses --org only for new apps, with coverage for both backends.

✅ Consistent configuration — Both configuration builders emit the same persistent-rootfs fields, and Docker disk sizing is independent of the data volume.

✅ Focused regression coverage — Tests cover defaults, option validation, preflight ordering, unknown-plan fallback, and preservation of larger existing volumes.

This was a static review of the supplied code; no commands were run. The authoritative checks show 31 passed, three pending, and no failures.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S3: 🟢 Verify Fly contracts independently

The flyOrgPlan.ts tests supply Boolean organization.paidPlan responses themselves; they establish parsing behavior but do not establish that this field identifies the relevant Free-plan restrictions. Likewise, configuration assertions establish that rootfs.persist is emitted, rather than proving persistence through Fly lifecycle operations. Confirm these contracts with authoritative API documentation or a recorded integration run. No concrete API incompatibility is demonstrated here, so this is a verification follow-up rather than a code blocker.

S4: 🟢 Explain small-rootfs build limitations

The accepted --rootfs-size 10 produces a 6 GiB Docker filesystem, while the supplied image-build consumers require 12 GiB free before building. Consequently, custom runtime builds cannot succeed at that size, although pulling published images may work. Document the distinction and provide a suitable sizing recommendation. The prior minimum-volume configuration also allowed less than the build reserve, so this is an existing capacity limitation rather than a newly demonstrated regression.

Score

The changed paths and tests are consistent, with no verified code blocker. Independent verification of the Fly plan and persistence contracts remains a material gap before confidently calling the deployment behavior merge-ready.

Score: 7/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 51s
  • Tokens: 70,496 (69,600 in / 896 out)
  • Cost: $0.63

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S3 S4

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Ultrafix stopped before reaching its goal. Requested goal: 8/10. Last score: 7/10. Stopped in cycle 2 of 10. The review has no actionable blockers, so no fix was scheduled. Manual review and merge are now required.

@propr-dev propr-dev Bot removed the ultrafix label Nov 24, 2026
@propr-dev propr-dev Bot changed the title 🔨 [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) ⚠️❼ [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) Nov 24, 2026

integry commented Nov 24, 2026

Copy link
Copy Markdown
Owner

/ultrafix goal=8 max=6

I verified this PR live on a real Fly Free-plan org (flyctl v0.5.16, region ams, app propr-deploy-test). Results:

WORKS:

  • The Free-plan preflight works against the real API. With --volume-size 20 it printed "org personal is on the Fly Free plan, which caps volumes at 5 GB... Nothing was created", and the volume list was unchanged. That confirms organization.paidPlan (S3, first half).
  • The dry-run plan is right: 1 GB volume, rootfs {size_gb: 20}, and the cost line "$3.00/month while the Machine is stopped".

MERGE BLOCKERS (fix both and add tests):

  1. rootfs.persist must be a STRING, not a boolean. A real flyctl deploy rejects the config with: invalid machine config ".../propr-machine.json": json: cannot unmarshal bool into Go value of type string. flyctl machine run --help lists --rootfs-persist options as 'never', 'always' and 'restart'. Emit "persist": "always" in flyMachineConfig.ts, and check that the Machines API backend (flyMachinesApi.ts) sends the same string. Update the tests that currently assert persist: true.
  2. The legacy Docker sidecar crash-loops on a real Machine. The docker container exits 1 on every start with cannot stat /upper/dev/vdb/propr_shared: No such file or directory, so the app never becomes healthy and health checks on :4000 time out. The shared volume is declared as volumes: [{name: "propr_shared", temp_dir: {storage_type: "disk", size_mb: 8192}}] and mounted at /propr-shared in the docker and app containers. With persist "always" fixed by hand, it fails the same way. It also fails without rootfs.persist, and with temp_dir: {size_mb: 512} and no storage_type. So the shared temp_dir volume itself does not mount in this multi-container Machine. Note that the legacy layout from [3768 by Claude Opus 5.5] propr deploy fly: control plane on a Fly Machine #3775 was never run live, so this may predate this PR. Find a layout that works on real Fly, and check it against Fly's multi-container Machines docs for shared volumes or temp_dir. Options to consider:
    • Share the Docker socket over a TCP port on localhost. Containers in one Machine share the network namespace, so dockerd can listen on 127.0.0.1:2375 and the app can use DOCKER_HOST=tcp://127.0.0.1:2375.
    • Put the socket on the persistent rootfs or the data volume instead of a temp_dir.
      Whatever you choose, say clearly in the PR description what still needs live confirmation. I will redeploy on Fly to verify.
  3. Also address S4 in the docs: the smallest accepted rootfs leaves less than the 12 GiB build reserve, so give a sizing recommendation.

Keep changes scoped to legacy-docker deploy config, docs and tests.

@propr-dev propr-dev Bot added the ultrafix label Nov 24, 2026
@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 6)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev propr-dev Bot changed the title ⚠️❼ [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) 🔨 [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) Nov 24, 2026
@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

Not ready to merge: the new rootfs.persist value violates Fly’s configuration contract and prevents legacy deployments.

✅ Correct organization selection — The preflight checks an existing app’s owning organization, with coverage for both backends.

✅ Storage sizing separated — Both configuration builders size Docker storage from --rootfs-size, independently of the SQLite/Redis volume.

✅ Live preflight confirmation — Your reported Free-plan test confirms oversized volumes are refused before Fly resources change.

Current-head checks report 35 passed, none failed or pending, and 19 skipped/neutral. This review uses the supplied code and live results; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F2: 🔴 Emit the supported persistence string

  • Category: correctness

  • Required behavior: Legacy deployment configurations must satisfy Fly’s root filesystem schema through both deployment backends.

  • Evidence: packages/cli/src/commands/deploy/flyMachineConfig.ts, buildLegacyDockerMachineFields

    1. A user deploys with --legacy-docker.
    2. The new helper emits rootfs: { size_gb: ..., persist: true }. Both buildMachineConfig and renderFlyMachineConfigJson incorporate that object.
    3. The flyctl path writes the boolean into propr-machine.json; your live deployment rejects it with cannot unmarshal bool into Go value of type string, preventing deployment.
    4. The Machines API target also passes the same boolean-containing configuration to its create/update calls.

    static trace: Both builders share the invalid value. The flyctl rejection is established by your supplied live result, not an execution during this review. Existing tests explicitly assert persist: true, so they preserve the contract error rather than catch it. API rejection was not independently executed.

  • Minimum fix: Emit persist: "always" from the shared helper. Update both configuration tests and API payload assertions to require the string, and correct documentation describing rootfs.persist: true.

Suggestions

These are optional follow-ups and are not sent to /fix.

S5: 🟢 Resolve the existing shared-volume failure

Your live results establish that the propr_shared layout prevents the Docker sidecar from starting. However, the diff retains the same temp_dir declaration and mounts from the base implementation, and your reproduction also fails without persistence. This is a pre-existing deployment problem rather than a PR-introduced finding under this review’s boundary. Track its correction separately and explicitly retain the need for live confirmation. TCP daemon access already exists; replacing socket transport alone would not replace the shared worktree and egress-socket paths that agent bind mounts need.

S6: 🟢 Explain practical rootfs sizing

The documentation permits a 10 GB rootfs, which yields only 6 GiB for Docker through legacyDockerDiskSizeGb. Add the requested sizing guidance distinguishing that accepted minimum from capacity suitable for the cited 12 GiB build reserve, existing images, and build output. This improves operational guidance without establishing another demonstrated runtime regression.

Score

The implementation has useful coverage and passing checks, but the newly introduced configuration type error blocks real deployment. The correction is localized; the independently reported shared-volume failure also needs follow-up before claiming successful live operation.

Score: 5/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 39s
  • Tokens: 71,263 (70,409 in / 854 out)
  • Cost: $0.64

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F2 S5 S6

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit ed60eda

Addressed 1 AI review comment (IDs: 7131361171)

Addressed finding F2

Summary of Changes

I fixed F2: legacy Machine configs now send rootfs.persist as the string "always" instead of true. All 118 deploy-fly tests pass and both typechecks are clean. Nothing has been run against real Fly; your redeploy is the live check.

The fix

  • flyMachineConfig.ts now holds the value in one constant, LEGACY_DOCKER_ROOTFS_PERSIST = "always". A comment there notes Fly's three accepted strings (never, always, restart) and the flyctl error a boolean causes.
  • Both deploy paths build their config from this one helper, so both now send the string:
    • flyctl: the value is written into propr-machine.json.
    • Machines API: it goes into both the create and update calls. The client passes the config through unchanged.

Tests

  • The tests that asserted persist: true in flyMachineConfig.test.ts and flyDeployRunner.test.ts now require "always".
  • New: the flyctl deploy test reads the propr-machine.json it wrote and checks rootfs is { size_gb: 20, persist: "always" }.
  • New: a Machines API test updates an existing legacy Machine and checks that the update payload sends persist as a string. Until now only the create call was checked.

Docs

  • deploy-fly.md, CHANGELOG.md and the comments in flyLegacyDocker.ts now say rootfs.persist: "always".
  • The comment change in flyLegacyDocker.ts also lands in the generated startup script, as a shell comment only.

Not done in this run: this run was limited to F2, so your other two requests are untouched:

  • Item 2, the Docker sidecar crash-loop: the shared temp_dir volume still doesn't mount on a real multi-container Machine, so the app still won't become healthy. The PR still needs a working layout, either the localhost TCP socket or the socket on the persistent rootfs. It stays a merge blocker.
  • Item 3, the S4 sizing advice: the docs still don't say that the smallest accepted root filesystem leaves less than the 12 GiB build reserve.

Ask for those findings by ID and I'll do them next.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/cli/src/commands/deploy/flyLegacyDocker.ts (+2/−2)
    • packages/cli/src/commands/deploy/flyMachineConfig.ts (+9/−1)
  • Low risk (4 files)
    • CHANGELOG.md (+1/−1)
    • docs/docs/operations/deploy-fly.md (+1/−1)
    • packages/cli/src/commands/deploy/flyDeployRunner.test.ts (+27/−2)
    • packages/cli/src/commands/deploy/flyMachineConfig.test.ts (+3/−3)

Diff size: 6 files changed, +43/−10 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 4m 50s
  • Tokens: 825,418 (820,399 in / 5,019 out)
  • Cost: $0.54

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

I fixed F2: legacy Machine configs now send `rootfs.persist` as the string `"always"` instead of `true`. All 118 deploy-fly tests pass and both typechecks are clean. Nothing has been run against real Fly; your redeploy is the live check.

**The fix**
- `flyMachineConfig.ts` now holds the value in one constant, `LEGACY_DOCKER_ROOTFS_PERSIST = "always"`. A comment there notes Fly's three accepted strings (`never`, `always`, `restart`) and the flyctl error a boolean causes.
- Both deploy paths build their config from this one helper, so both now send the string:
  - **flyctl:** the value is written into `propr-machine.json`.
  - **Machines API:** it goes into both the create and update calls. The client passes the config through unchanged.

**Tests**
- The tests that asserted `persist: true` in `flyMachineConfig.test.ts` and `flyDeployRunner.test.ts` now require `"always"`.
- New: the flyctl deploy test reads the `propr-machine.json` it wrote and checks `rootfs` is `{ size_gb: 20, persist: "always" }`.
- New: a Machines API test updates an existing legacy Machine and checks that the update payload sends `persist` as a string. Until now only the create call was checked.

**Docs**
- `deploy-fly.md`, `CHANGELOG.md` and the comments in `flyLegacyDocker.ts` now say `rootfs.persist: "always"`.
- The comment change in `flyLegacyDocker.ts` also lands in the generated startup script, as a shell comment only.

**Not done in this run:** this run was limited to F2, so your other two requests are untouched:
- **Item 2, the Docker sidecar crash-loop:** the shared `temp_dir` volume still doesn't mount on a real multi-container Machine, so the app still won't become healthy. The PR still needs a working layout, either the localhost TCP socket or the socket on the persistent rootfs. It stays a merge blocker.
- **Item 3, the S4 sizing advice:** the docs still don't say that the smallest accepted root filesystem leaves less than the 12 GiB build reserve.

Ask for those findings by ID and I'll do them next.

PR: #3787
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR moves legacy Docker storage off the data volume and adds an organization-aware volume preflight. It needs changes before merge: the string persistence fix is complete, but the requested shared-volume correction and rootfs sizing guidance remain missing.

✅ Correct persistence encoding — Both configuration paths emit persist: "always", with coverage for Machines API creation, updates, and flyctl JSON.

✅ Correct organization selection — The preflight checks an existing app’s owning organization instead of blindly using --org, with tests covering both backends and unreadable ownership.

The supplied current-head status shows 30 passed checks, four pending, and no failures. This review uses the supplied code and live-test report; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F3: 🔴 Requested shared-volume fix remains undelivered

  • Category: requirement

  • Required behavior: The explicit follow-up requests a working legacy shared-filesystem layout, tests, and documentation of remaining live verification after reporting that the current temp_dir mount prevents startup.

  • Evidence: packages/cli/src/commands/deploy/flyMachineConfig.ts, buildLegacyDockerMachineFields; packages/cli/src/commands/deploy/flyLegacyDocker.ts, buildLegacyDockerContainer.

    1. A deployment with --legacy-docker enters the new buildLegacyDockerMachineFields helper.
    2. It still emits propr_shared as temp_dir: { storage_type: "disk", size_mb: 8192 }, and the Docker container still mounts that volume at /propr-shared.
    3. This is the exact layout the supplied live report identifies as failing with cannot stat /upper/dev/vdb/propr_shared, including after persistence was manually corrected to "always". The requested replacement is absent, leaving the reported startup failure unresolved.

    static trace: Both generated configuration paths use this helper. The changed tests explicitly assert the same volume declaration; they verify serialization rather than successful mounting. Runtime failure provenance is the user-supplied live report, not an execution during this review.

  • Minimum fix: Replace the reported failing shared mount with a supported layout that preserves shared worktree and egress paths between app and Docker containers. Add corresponding tests and state what still requires live confirmation. Localhost Docker TCP is already configured and does not itself replace shared filesystem access.

F4: 🔴 Rootfs sizing recommendation is missing

  • Category: requirement

  • Required behavior: Follow-up item 3 explicitly requires a sizing recommendation because the smallest accepted rootfs leaves less than the 12 GiB build reserve.

  • Evidence: docs/docs/operations/deploy-fly.md, “Legacy mode: Docker in the Machine” and options table; packages/cli/src/commands/deploy/flyLegacyDocker.ts, legacyDockerDiskSizeGb.

    1. The CLI accepts --rootfs-size 10.
    2. The sizing function subtracts 4 GiB, producing a 6 GiB Docker filesystem.
    3. The updated documentation lists the minimum and default but never explains the 12 GiB build reserve or recommends capacity accounting for that reserve plus stored images.

    static trace: The arithmetic and documentation gap are visible in the supplied changes. This is an unmet documentation requirement; no runtime build failure is asserted.

  • Minimum fix: Explain that the accepted minimum is insufficient for the stated build reserve, and recommend rootfs capacity covering the 4 GiB headroom, 12 GiB reserve, and expected retained images.

Suggestions

These are optional follow-ups and are not sent to /fix.

S7: 🟢 Refresh volume-sizing comments

Comments in flyDeployRunner.ts, including confirmVolumeCapacity and the construction of deployPlan, still describe sizing the Docker filesystem from the data volume. Updating them would clarify the new storage model. This is optional because the executable code correctly uses rootfs capacity.

Score

The persistence and preflight changes are well covered, but two explicit follow-up requirements remain unresolved, including the reported deployment startup failure.

Score: 5/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 42s
  • Tokens: 73,576 (72,496 in / 1,080 out)
  • Cost: $0.67

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F3 F4 S7

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 5086d37

Addressed 1 AI review comment (IDs: 7131880684)

Addressed findings F3, F4

Summary of Changes

I've moved the directory the app and Docker containers share off the temp_dir volume and onto the Fly volume, and added the rootfs sizing advice to the docs (F3 and F4). The 121 deploy-fly tests pass and the typecheck is clean, but none of this has run on real Fly yet. The persist: "always" fix was already on the branch from the previous commit, so I didn't touch it.

F3: shared directory

  • Why the Fly volume: Fly's multi-container guide doesn't describe sharing a temp_dir volume between containers. A Fly community thread from Oct 2025 reports that the Machine's own volume shows up at the same path in every container. Our Redis container already depends on that: it writes its append-only file to the volume without mounting it itself.
  • What changed:
    • Clones, worktrees and egress sockets now live under /usr/src/app/data/propr-shared on the volume (flyLegacyDocker.ts).
    • Both deploy paths drop the Machine volumes/temp_dir entry and the mounts on the app and docker containers.
    • The app keeps reaching dockerd at tcp://127.0.0.1:2375. That gives it the socket, but agent containers bind-mount worktrees by path, so the files must be visible to both containers too.
  • New boot check: if the volume isn't mounted in the docker container, it exits with "the Fly volume is not mounted at /usr/src/app/data in the docker container". Without this, it would create the folders on its own disk and agents would silently get empty folders.
  • Cost of this layout: clones and worktrees now take space on the volume, which defaults to 1 GB. The docs suggest raising --volume-size (up to 5 GB fits the Free plan) for larger repositories or several tasks at once.
  • Tests:
    • Neither deploy path emits volumes or any container mounts.
    • Every shared path sits under the volume mount, and the worker and the daemon see the egress folder at the same path.
    • The boot check really runs and exits 1 when the volume is missing.

F4: rootfs sizing
deploy-fly.md now has a sizing table, and the options table and changelog repeat the advice. The Docker filesystem gets the root filesystem minus 4 GB, and an agent image build needs 12 GiB free on it:

--rootfs-size Room left for kept images
10 (the minimum) none, so agent image builds are refused
20 (the default) about 4 GB, roughly one agent image
30 about 14 GB, several agent images

The recommendation is 20 GB or more, sized as 4 GB headroom + 12 GB build reserve + about 4 GB for each agent image you want to keep.

What your redeploy needs to confirm:

  1. The docker container sees the volume at /usr/src/app/data, so the boot check passes and dockerd turns healthy. If the check fails, that error means the volume isn't visible in that container, which would rule out this layout.
  2. An agent container can bind-mount a worktree from /usr/src/app/data/propr-shared/git-processor/worktrees/... and see its files.
  3. Agents in restricted network mode can reach the egress socket under /usr/src/app/data/propr-shared/egress.
  4. With rootfs.persist: "always" and size_gb set, the ext4 image mounts and docker info reports overlay2.
  5. A Machine deployed with the old propr_shared layout gets updated cleanly, since the new config no longer includes volumes.

A guess I couldn't check: the /upper/dev/vdb path in the error hints that temp_dir breaks when a rootfs size is set. You saw it fail without persist too; I'm not sure whether that test also dropped size_gb.

Sources:

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/cli/src/commands/deploy/flyLegacyDocker.ts (+25/−7)
    • packages/cli/src/commands/deploy/flyMachineConfig.ts (+6/−7)
  • Low risk (4 files)
    • CHANGELOG.md (+7/−1)
    • docs/docs/operations/deploy-fly.md (+15/−5)
    • packages/cli/src/commands/deploy/flyLegacyDocker.test.ts (+39/−0)
    • packages/cli/src/commands/deploy/flyMachineConfig.test.ts (+28/−7)

Diff size: 6 files changed, +120/−27 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 9m 9s
  • Tokens: 2,770,472 (2,752,980 in / 17,492 out)
  • Cost: $1.35

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

I've moved the directory the app and Docker containers share off the `temp_dir` volume and onto the Fly volume, and added the rootfs sizing advice to the docs (F3 and F4). The 121 deploy-fly tests pass and the typecheck is clean, but none of this has run on real Fly yet. The `persist: "always"` fix was already on the branch from the previous commit, so I didn't touch it.

**F3: shared directory**
- **Why the Fly volume:** Fly's multi-container guide doesn't describe sharing a `temp_dir` volume between containers. A Fly community thread from Oct 2025 reports that the Machine's own volume shows up at the same path in every container. Our Redis container already depends on that: it writes its append-only file to the volume without mounting it itself.
- **What changed:**
  - Clones, worktrees and egress sockets now live under `/usr/src/app/data/propr-shared` on the volume (`flyLegacyDocker.ts`).
  - Both deploy paths drop the Machine `volumes`/`temp_dir` entry and the mounts on the `app` and `docker` containers.
  - The app keeps reaching `dockerd` at `tcp://127.0.0.1:2375`. That gives it the socket, but agent containers bind-mount worktrees by path, so the files must be visible to both containers too.
- **New boot check:** if the volume isn't mounted in the `docker` container, it exits with "the Fly volume is not mounted at /usr/src/app/data in the docker container". Without this, it would create the folders on its own disk and agents would silently get empty folders.
- **Cost of this layout:** clones and worktrees now take space on the volume, which defaults to 1 GB. The docs suggest raising `--volume-size` (up to 5 GB fits the Free plan) for larger repositories or several tasks at once.
- **Tests:**
  - Neither deploy path emits `volumes` or any container mounts.
  - Every shared path sits under the volume mount, and the worker and the daemon see the egress folder at the same path.
  - The boot check really runs and exits 1 when the volume is missing.

**F4: rootfs sizing**
`deploy-fly.md` now has a sizing table, and the options table and changelog repeat the advice. The Docker filesystem gets the root filesystem minus 4 GB, and an agent image build needs 12 GiB free on it:

| `--rootfs-size` | Room left for kept images |
| --- | --- |
| 10 (the minimum) | none, so agent image builds are refused |
| 20 (the default) | about 4 GB, roughly one agent image |
| 30 | about 14 GB, several agent images |

The recommendation is 20 GB or more, sized as 4 GB headroom + 12 GB build reserve + about 4 GB for each agent image you want to keep.

**What your redeploy needs to confirm:**
1. The `docker` container sees the volume at `/usr/src/app/data`, so the boot check passes and `dockerd` turns healthy. If the check fails, that error means the volume isn't visible in that container, which would rule out this layout.
2. An agent container can bind-mount a worktree from `/usr/src/app/data/propr-shared/git-processor/worktrees/...` and see its files.
3. Agents in restricted network mode can reach the egress socket under `/usr/src/app/data/propr-shared/egress`.
4. With `rootfs.persist: "always"` and `size_gb` set, the ext4 image mounts and `docker info` reports `overlay2`.
5. A Machine deployed with the old `propr_shared` layout gets updated cleanly, since the new config no longer includes `volumes`.

A guess I couldn't check: the `/upper/dev/vdb` path in the error hints that `temp_dir` breaks when a rootfs size is set. You saw it fail without `persist` too; I'm not sure whether that test also dropped `size_gb`.

Sources:
- [Fly multi-container Machines docs](https://docs.fly.io/machines/guides-examples/multi-container-machines)
- [Fly community: Multi-Container Machine Mounts](https://community.fly.io/t/multi-container-machine-mounts/25838) and [page 2](https://community.fly.io/t/multi-container-machine-mounts/25838?page=2)

PR: #3787
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR addresses the reported configuration failures and documents rootfs sizing. No verified code blocker remains in the supplied diff, but the replacement shared-directory layout needs live confirmation before I would call it merge-ready.

✅ Consistent persistence configuration — Both configuration builders emit persist: "always", with tests covering flyctl output and Machines API creation and updates.

✅ Correct organization selection — Volume preflight checks an existing app’s owning organization, with coverage for both backends and unknown ownership.

✅ Explicit sizing guidance — Documentation explains why the accepted 10 GB rootfs cannot satisfy the 12 GiB build reserve and recommends 20 GB or more.

This was a static review of the supplied code; no commands were run. Current checks report 30 passed, four pending, and no failures.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S8: 🟢 Confirm shared paths on Fly

The new layout in flyLegacyDocker.ts removes the failing temp_dir mount and checks that the data volume is mounted. The tests verify generated configuration and stubbed mount detection, but do not demonstrate that app-created worktrees and egress sockets are accessible through Docker bind mounts on Fly. The planned live redeploy should exercise an agent task and a restart, and the PR description should clearly identify this remaining verification. This is a verification follow-up, not a demonstrated defect.

S9: 🟢 Update stale storage comments

Comments in flyDeployRunner.ts still describe sizing the legacy Docker filesystem from confirmed volume capacity, and flyLegacyDocker.ts says the volume holds only SQLite and Redis despite now storing clones and worktrees there. Updating these comments would make future maintenance easier; the executable paths already use rootfs sizing correctly.

Score

The implementation addresses the reported failures with focused regression coverage and no verified remaining code defect. Live verification of the replacement sharing layout remains a material gap; pending checks alone do not lower the score.

Score: 7/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 31s
  • Tokens: 73,430 (72,822 in / 608 out)
  • Cost: $0.65

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S8 S9

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Ultrafix stopped before reaching its goal. Requested goal: 8/10. Last score: 7/10. Stopped in cycle 3 of 6. The review has no actionable blockers, so no fix was scheduled. Manual review and merge are now required.

@propr-dev propr-dev Bot removed the ultrafix label Nov 24, 2026
@propr-dev propr-dev Bot changed the title 🔨 [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) ⚠️❼ [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) Nov 24, 2026
@integry

integry commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Live verification on the Fly Free plan at 5086d37 (flyctl v0.5.16, ams)

This addresses the remaining verification gap (S3 and S8). All items were tested against real Fly:

Check Result
Free-plan preflight (--volume-size 20) ✅ refused before anything was created; volume list unchanged
Plan ✅ 2 GB shared-cpu-1x, 1 GB volume, 20 GB rootfs, persist: "always", cost line $3.00/month while stopped
Fresh deploy ✅ Machine created; docker container healthy; app /health 200
dockerd ✅ storage-driver=overlay2, API listen on 127.0.0.1:2375; app has DOCKER_HOST=tcp://127.0.0.1:2375
Agent-style bind mount (S8) ✅ the app wrote data/worktrees/e2e/probe.txt; docker run -v …/worktrees/e2e:/w alpine read it and wrote back.txt; the app read that back
Rootfs persistence across stop and start (S3) ✅ Machine events: stopped exit_code=0 requested_stop=true, then start by proxy (HTTP wake). After the restart, alpine:3.20 and uv:0.8.17 were still in docker images, the driver was still overlay2, and back.txt was still present

Remaining finding: redeploy keeps keys removed from machine_config (follow-up, not blocking)

Redeploying this layout over a Machine created with the earlier temp_dir layout left the old top-level volumes: [{name: propr_shared, temp_dir…}] and the per-container mounts on the Machine. flyctl deploy merges machine_config into the existing config and does not drop keys that are missing. So the sidecar kept crash-looping with cannot stat /upper/dev/vdb/propr_shared. A fresh Machine works.

No real deployment has the old layout (it never ran on Fly), so this does not block this PR. But the next layout change will hit the same problem. Proposed follow-up: on redeploy, compare the live Machine config with the plan and explicitly clear stale volumes and container mounts. If flyctl will not clear them, replace the Machine, keeping the volume. Cover this with a redeploy test.

integry commented Nov 24, 2026

Copy link
Copy Markdown
Owner

/review

Re-review with the live Fly verification taken into account. It is posted in #3787 (comment): the preflight, rootfs persist "always", overlay2 on 127.0.0.1:2375, an agent bind mount of an app-created worktree, and images surviving a real stop and proxy wake all passed on a Free-plan org. The redeploy stale-key issue is tracked as a follow-up and does not block this PR.

@propr-dev propr-dev Bot changed the title ⚠️❼ [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) 🔨 [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) Nov 24, 2026
@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit d5948e3

Summary of Changes

A flyctl redeploy now removes the volumes and container mounts that the temp_dir layout left on the Machine. If any survive, it replaces the Machine and keeps the data volume. This is tested only against a fake flyctl so far, not real Fly.

Why the keys stayed. I read the flyctl v0.5.16 source. fly deploy reads propr-machine.json into a copy of the live Machine config. Keys the file leaves out keep their old values. Each container in the file is merged into the live container at the same position, which is why the old mounts survived. An explicit [] in the file does clear a key.

What changed

  • Explicit clearing: propr-machine.json now sends "volumes": [] and "mounts": [] on every container. On a fresh Machine these empty lists change nothing.

  • Check before deploying: the deploy reads the control-plane Machine with fly machine list --json. It compares that with the plan (flyStaleMachineConfig.ts) and logs any stale keys it is about to clear.

  • Check after deploying: it reads the Machine again. If stale keys remain, it:

    1. runs fly machine destroy <id> --force.
    2. polls fly volumes list for up to 2 minutes until the data volume is no longer attached to that Machine.
    3. runs fly deploy again, so flyctl attaches the existing volume to the new Machine instead of creating an empty one.

    If the volume never detaches, it stops before a second deploy. If stale keys are still there after replacement, it stops with an error.

  • Machines API backend: unchanged. It already sends the whole config on update, not a merge.

  • Docs: a changelog entry and a new troubleshooting item in deploy-fly.md.

Tests: the new redeploy test is flyStaleMachineConfig.test.ts. Its fake flyctl merges config the way flyctl does, starting from a Machine with the exact temp_dir layout. It covers:

  • clearing the stale keys in place.
  • a flyctl that ignores [], which leads to destroy, waiting for the volume, and redeploying on the same volume.
  • a volume that never detaches.
  • no replacement for a fresh Machine or one already on the current layout.
  • a negative check that the merge without [] does leave all three stale keys.

I updated one existing test because the flyctl file now contains [] where it used to leave the keys out. All 128 deploy tests pass and both typechecks are clean.

To confirm on Fly, redeploy over a Machine created with the temp_dir layout. Then check that fly machine status <id> --display-config no longer shows volumes or container mounts, and that the docker container starts.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (4 files)
    • packages/cli/src/commands/deploy/flyDeployRunner.ts (+91/−10)
    • packages/cli/src/commands/deploy/flyMachineConfig.ts (+9/−2)
    • packages/cli/src/commands/deploy/flyStaleMachineConfig.ts (added, +55/−0)
    • packages/cli/src/commands/deploy/flyctlBackend.ts (+41/−8)
  • Low risk (4 files)
    • CHANGELOG.md (+8/−0)
    • docs/docs/operations/deploy-fly.md (+1/−0)
    • packages/cli/src/commands/deploy/flyMachineConfig.test.ts (+5/−3)
    • packages/cli/src/commands/deploy/flyStaleMachineConfig.test.ts (added, +204/−0)

Diff size: 8 files changed, +414/−23 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 9m 16s
  • Tokens: 3,420,494 (3,393,654 in / 26,840 out)
  • Cost: $1.73

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 7132656603✓

A flyctl redeploy now removes the `volumes` and container `mounts` that the temp_dir layout left on the Machine. If any survive, it replaces the Machine and keeps the data volume. This is tested only against a fake flyctl so far, not real Fly.

**Why the keys stayed.** I read the flyctl v0.5.16 source. `fly deploy` reads `propr-machine.json` into a copy of the live Machine config. Keys the file leaves out keep their old values. Each container in the file is merged into the live container at the same position, which is why the old `mounts` survived. An explicit `[]` in the file does clear a key.

**What changed**
- **Explicit clearing:** `propr-machine.json` now sends `"volumes": []` and `"mounts": []` on every container. On a fresh Machine these empty lists change nothing.
- **Check before deploying:** the deploy reads the control-plane Machine with `fly machine list --json`. It compares that with the plan (`flyStaleMachineConfig.ts`) and logs any stale keys it is about to clear.
- **Check after deploying:** it reads the Machine again. If stale keys remain, it:
  1. runs `fly machine destroy <id> --force`.
  2. polls `fly volumes list` for up to 2 minutes until the data volume is no longer attached to that Machine.
  3. runs `fly deploy` again, so flyctl attaches the existing volume to the new Machine instead of creating an empty one.

  If the volume never detaches, it stops before a second deploy. If stale keys are still there after replacement, it stops with an error.
- **Machines API backend:** unchanged. It already sends the whole config on update, not a merge.
- **Docs:** a changelog entry and a new troubleshooting item in `deploy-fly.md`.

**Tests:** the new redeploy test is `flyStaleMachineConfig.test.ts`. Its fake flyctl merges config the way flyctl does, starting from a Machine with the exact temp_dir layout. It covers:
- clearing the stale keys in place.
- a flyctl that ignores `[]`, which leads to destroy, waiting for the volume, and redeploying on the same volume.
- a volume that never detaches.
- no replacement for a fresh Machine or one already on the current layout.
- a negative check that the merge without `[]` does leave all three stale keys.

I updated one existing test because the flyctl file now contains `[]` where it used to leave the keys out. All 128 deploy tests pass and both typechecks are clean.

To confirm on Fly, redeploy over a Machine created with the temp_dir layout. Then check that `fly machine status <id> --display-config` no longer shows `volumes` or container `mounts`, and that the `docker` container starts.

PR: #3787
Comment by: @integry (ID: 7132656603)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements the Free-plan storage change coherently. It is merge-ready within the reviewed scope, conditional on pending checks completing successfully.

✅ Live deployment evidence — The supplied verification confirms Free-plan refusal before resource creation, persist: "always", overlay2, shared worktree bind mounts, and image persistence across stop and proxy wake.

✅ Consistent backend configuration — Both deployment paths receive the persistent rootfs configuration, with tests covering creation and Machines API updates.

✅ Correct organization selection — Oversized-volume preflight checks an existing app’s owning organization rather than blindly using --org, with coverage for both backends.

This review is based on the supplied diff, surrounding code, and reported live results; I ran no commands. Current checks show zero failures, 21 pending, five passed, and ten neutral/skipped.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S10: 🟢 Exercise failed redeploy recovery

Keep the stale-key issue in the explicitly deferred follow-up. In flyDeployRunner.ts, deployFlyctlWithoutStaleKeys inspects the resulting config only after run() returns successfully. Add a regression where deployment fails while stale mounts remain: the current fake always returns success for an existing Machine. This would clarify recovery behavior for the reported crash-loop scenario without reopening it as a blocker for this PR.

S11: 🟢 Warn about undersized rootfs

Consider a CLI warning when the accepted --rootfs-size leaves less than the worker’s 12 GiB build reserve. The documentation correctly explains that the accepted 10 GB minimum produces a 6 GB Docker filesystem and cannot build agent images. Surfacing that limitation in the plan would help users who do not read the sizing documentation. This is optional because the requested minimum is preserved and the default is larger.

Score

The supplied live verification closes the central deployment and persistence gaps, and the changed paths have substantial regression coverage. Pending checks should complete before merge; the deferred redeploy follow-up does not block this assessment.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 27s
  • Tokens: 82,151 (81,643 in / 508 out)
  • Cost: $0.73

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S10 S11

🤖 Review by ProPR

@propr-dev propr-dev Bot changed the title 🔨 [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) ✅❽ [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) Nov 24, 2026
@integry

integry commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Live check of d5948e3 (stale-config cleanup): I put the old temp_dir layout back on the existing Machine: top-level volumes: [propr_shared temp_dir], with mounts on the docker and app containers. Then I redeployed with this head's CLI. It printed Machine e82dd640ce3958 has config the new layout drops: volumes (propr_shared); mounts of container docker; mounts of container app. Clearing it. The live config afterwards had no volumes and no container mounts. The docker sidecar came up healthy (API listen on 127.0.0.1:2375) and /health returned 200. The upgrade path works. Merging into the epic.

@integry
integry merged commit db844c0 into 3758-epic-runtime-abstraction-sc0 Nov 24, 2026
47 checks passed
@propr-dev propr-dev Bot changed the title ✅❽ [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) [3785 by Claude Opus 5.5] propr deploy fly: fit the Fly Free plan (legacy Docker on a persistent rootfs, 5 GB volume preflight) Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant