This is the practical loop for aggressively optimizing dependencies in flow
while keeping Cargo correctness and upstream sync reliability.
- find and fix vendoring rough edges early,
- rank high-impact dependency offenders,
- track compile-iteration speed improvements over time.
f update-deps --dry-run
f vendor-trims
f vendor-rough-audit
f vendor-offenders
f vendor-bench-iter -- --mode incremental --samples 3One-command loop:
f vendor-optimize-loopStrict mode (warnings fail):
f vendor-optimize-loop -- --strictvendor-rough-audit (scripts/vendor/rough_edges_audit.py) checks:
- lock/manifests/materialized crate path consistency,
- Cargo patch wiring vs
vendor.lock.toml, - vendored crate resolution in
Cargo.lock(no registry source), - provenance fields in manifests (
history_head,upstream_repository), - stale code index detection (
.vendor/typesense/sources.jsonfreshness), - extra drift artifacts (
lib/vendor/*or patch entries not in lock). - warning-hygiene regressions in vendored crates that would reintroduce noisy release-build warnings.
vendor-offenders (scripts/vendor/offenders.sh) shows:
- direct dependencies ranked by transitive tree size,
- duplicate version pressure (
cargo tree -d), - proc-macro footprint.
vendor-bench-iter (scripts/vendor/bench_iteration.py) provides:
- repeated timing samples for a compile command (default
cargo check -q), - rolling comparison against prior runs from
out/vendor/iteration_bench.jsonl, - optional fail threshold for gating regressions.
out/vendor/rough_edges_audit.txtout/vendor/offenders_latest.txtout/vendor/iteration_bench.jsonl
These files make optimization work reviewable and repeatable across sessions.
f vendor-optimize-loop -- --strict --samples 2- Pick top 1-2 offender crates.
- Apply trim/rewrite changes.
- Re-run loop.
- Confirm no new rough-edge findings.
- Confirm compile iteration trend improves or stays flat.
- Confirm upstream sync remains clean (
scripts/vendor/sync-all.sh --important --dry-run).