Skip to content

I0911 — A source change does not rebuild the world, and the context stays small

Make the container build reuse dependency layers and caches so that a source-only change does not rebuild every dependency, and keep the build context to the inputs the deployment object declares.

BLOCKED wave 4 · p1 · implementation profile · parallel safe

Part of fly-deployment — A deployment is a projection of the repository model, and a reachable URL is its evidence.

Blocked. This issue cannot start until I0909 is done. The status is derived from that, not declared.

Objective

Make the container build reuse dependency layers and caches so that a source-only change does not rebuild every dependency, and keep the build context to the inputs the deployment object declares.

Why

A remote builder that receives the whole worktree uploads the history, the node modules and every worktree artifact, then rebuilds every crate for a one-line change. Both costs are avoidable and both are measurable.

Current state

No container build exists, so neither the context size nor the build duration has ever been measured.

Desired state

Clean and warm build durations and the context size are measured and bounded, and the ignore rules derive from the declared build inputs rather than from a second hand-kept list.

Scope

  • deploy/fly
  • apps/majordomus-cli/src/deploy/build.rs

Out of scope

  • A build system replacing Cargo
  • Any caching that changes what the produced binary contains

Dependencies

What waits on this

Acceptance criteria

  • A source-only change reuses the dependency layers and the measured warm build is materially faster than the clean one
  • A documentation-only change does not rebuild Rust dependencies where the layer order permits it
  • The ignore rules derive from the deployment object's declared build inputs, and excluding a file the workspace or the site generator needs is caught by a build rather than in production
  • The build context size is measured and bounded by a declared budget
  • Any additional build tool introduced for caching is pinned, builder-only, absent from the runtime image and justified by a measured improvement

Validation

  • majordomus deploy doctor
  • bash test/run.sh

Evidence required

  • cache_layers
  • warm_build_measured
  • context_budget

Evidence

None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.

Risk

An ignore file tuned for size can silently drop a workspace member and produce a build that fails only on the remote builder, where the feedback loop is slowest.

Timeline

started
verified
completed

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I0911.yaml. Read it back with majordomus plan show I0911.