Context
cargo-impact v0.3.0-alpha.1 ships a --context flag that emits a newline-delimited list of files touched by the blast radius of a code change:
$ cargo impact --context
src/engine.rs
src/ffi.rs
tests/integration.rs
docs/architecture.md
The intended bidirectional workflow (documented in cargo-impact's README §7):
# Forward: generate a context pack scoped to only impact-affected files
cargo impact --context | cargo context --files-from -
# Reverse: consume a full cargo-impact JSON report and produce a
# context pack for the low-confidence findings so the AI can re-verify
cargo impact --format=json > .impact.json
cargo context --impact-scope=.impact.json --budget=8000
Neither of the two cargo-context flags this needs (--files-from and --impact-scope) exists today.
Ask
1. --files-from <PATH|-> (smaller, high-leverage)
Add a flag that reads a newline-delimited list of file paths (from a file, or - for stdin) and builds the context pack using exactly those files instead of (or in addition to) the git-diff-derived set. Paths are repo-relative.
This makes cargo impact --context | cargo context --files-from - work immediately — users get a context pack scoped to the blast radius of their change, not a whole-repo dump.
2. --impact-scope <PATH> (larger, richer)
Consume a cargo-impact --format=json envelope. The JSON shape is documented in cargo-impact README §8. Useful fields:
findings[].kind — which analyzer produced the finding
findings[].confidence and findings[].tier — let cargo-context prioritize or filter
findings[].primary_path (via impact_surface / the kind payload)
With this, cargo context could emit targeted packs per finding or per severity tier, keeping the pack small while maintaining coverage.
Suggested order
--files-from first — it's small, composable, and useful on its own. --impact-scope is a v0.4+ item since it needs schema tracking.
Reference
Happy to draft a PR for --files-from against this repo if it looks shaped how you'd want it.
Context
cargo-impactv0.3.0-alpha.1 ships a--contextflag that emits a newline-delimited list of files touched by the blast radius of a code change:The intended bidirectional workflow (documented in
cargo-impact's README §7):Neither of the two
cargo-contextflags this needs (--files-fromand--impact-scope) exists today.Ask
1.
--files-from <PATH|->(smaller, high-leverage)Add a flag that reads a newline-delimited list of file paths (from a file, or
-for stdin) and builds the context pack using exactly those files instead of (or in addition to) the git-diff-derived set. Paths are repo-relative.This makes
cargo impact --context | cargo context --files-from -work immediately — users get a context pack scoped to the blast radius of their change, not a whole-repo dump.2.
--impact-scope <PATH>(larger, richer)Consume a
cargo-impact --format=jsonenvelope. The JSON shape is documented incargo-impactREADME §8. Useful fields:findings[].kind— which analyzer produced the findingfindings[].confidenceandfindings[].tier— letcargo-contextprioritize or filterfindings[].primary_path(viaimpact_surface/ the kind payload)With this,
cargo contextcould emit targeted packs per finding or per severity tier, keeping the pack small while maintaining coverage.Suggested order
--files-fromfirst — it's small, composable, and useful on its own.--impact-scopeis a v0.4+ item since it needs schema tracking.Reference
cargo-impactsource: https://github.com/asmuelle/cargo-impact--contextflag implementation:src/lib.rsin the latest commitsrc/format.rs::Report/ README §8Happy to draft a PR for
--files-fromagainst this repo if it looks shaped how you'd want it.