Goal
Keep local Rust build storage bounded across WrightKit repositories and agent worktrees without materially degrading normal interactive development or weakening CI verification.
Context
WrightKit development currently produces tens of gigabytes of target/ data across long-lived repositories and short-lived issue/PR worktrees. The dominant growth comes from incremental compilation state, stale dependency/test artifacts, duplicated builds across repositories/worktrees, and full dev-profile debug information.
Cargo does not currently garbage-collect workspace target/ build artifacts automatically, so this needs an explicit WrightKit development policy rather than relying on eventual Cargo cleanup.
The policy should distinguish long-lived developer checkouts from ephemeral agent worktrees: incremental compilation can be useful for the former, while retaining large incremental caches for short-lived worktrees provides little durable value.
Scope
- Define an org-wide Rust development profile policy that reduces unnecessary dev/test artifact size while preserving useful source-level diagnostics.
- Define the build-cache policy for ephemeral issue/PR worktrees, including whether incremental compilation is disabled there.
- Define ownership and lifecycle for ephemeral worktree build artifacts so they are removed when the worktree is retired rather than becoming persistent repository state.
- Preserve isolation between concurrently active worktrees; do not introduce a shared mutable Cargo target directory that makes parallel builds interfere with each other.
- Evaluate a shared compiler cache such as
sccache only as a way to reduce recompilation cost across isolated worktrees/repositories, not as a substitute for target lifecycle management.
- Apply the resulting policy consistently to the Rust repositories and agent/worktree workflow where applicable.
Non-goals
- Removing meaningful correctness, test, lint, or release verification to reduce disk usage.
- Disabling useful incremental compilation for all long-lived local development by default without evidence that the tradeoff is acceptable.
- Building a custom Cargo cache/GC system when Cargo configuration and simple worktree lifecycle management are sufficient.
- Sharing one writable
target/ directory across concurrent worktrees as the primary deduplication mechanism.
- Adding age-based artifact pruning or dependency-level cache bookkeeping unless the simpler lifecycle model proves insufficient.
Acceptance criteria
Ownership
Org-wide development/build policy and shared agent/worktree behavior belong in wrightkit/.github; repository-specific Cargo profile changes remain owned by the affected Rust repositories.
Goal
Keep local Rust build storage bounded across WrightKit repositories and agent worktrees without materially degrading normal interactive development or weakening CI verification.
Context
WrightKit development currently produces tens of gigabytes of
target/data across long-lived repositories and short-lived issue/PR worktrees. The dominant growth comes from incremental compilation state, stale dependency/test artifacts, duplicated builds across repositories/worktrees, and full dev-profile debug information.Cargo does not currently garbage-collect workspace
target/build artifacts automatically, so this needs an explicit WrightKit development policy rather than relying on eventual Cargo cleanup.The policy should distinguish long-lived developer checkouts from ephemeral agent worktrees: incremental compilation can be useful for the former, while retaining large incremental caches for short-lived worktrees provides little durable value.
Scope
sccacheonly as a way to reduce recompilation cost across isolated worktrees/repositories, not as a substitute for target lifecycle management.Non-goals
target/directory across concurrent worktrees as the primary deduplication mechanism.Acceptance criteria
Ownership
Org-wide development/build policy and shared agent/worktree behavior belong in
wrightkit/.github; repository-specific Cargo profile changes remain owned by the affected Rust repositories.