Skip to content

feat(task): explain affected task selection - #11591

Merged
jdx merged 1 commit into
agent/run-affected-tasksfrom
agent/explain-affected-tasks
Aug 1, 2026
Merged

jdx merged 1 commit into
agent/run-affected-tasksfrom
agent/explain-affected-tasks

Conversation

@jdx

@jdx jdx commented Aug 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add --affected-explain to show why workspace projects and task-pattern matches were selected
  • retain structured, deterministic causes for changed paths, workspace-global paths, provider-attributed lockfiles, and reverse dependents
  • document affected task execution and revision precedence
  • complete the affected-explanation milestone in the task parity tracker

Testing

  • target/debug/mise run lint-fix
  • cargo clippy --quiet --workspace --all-features --all-targets -- -D warnings
  • target/debug/mise run test:e2e e2e/tasks/test_task_affected
  • cargo test --quiet task::workspace::tests::affected_project_reasons_distinguish_changes_and_dependents
  • shellcheck -x e2e/tasks/test_task_affected
  • shfmt -d e2e/tasks/test_task_affected
  • target/debug/mise run render:usage

Stacked on #11590.

AI-assisted — Tool: Codex; model: unavailable/unavailable; version: unavailable.


Note

Low Risk
Diagnostics-only CLI and graph API extension; affected selection behavior is unchanged aside from richer internal reasoning and explain output.

Overview
Adds --affected-explain to mise run (requires --affected) so runs print why workspace projects and matching task patterns were selected, without changing which tasks execute.

Affected analysis now keeps structured reasons per project via AffectedProjectReason and AffectedProjects, with affected_projects_for_changes recording changed paths, workspace-global paths, provider-attributed lockfiles, and reverse dependents (including multiple dependency causes). Human-readable output lists revisions, each project’s causes, and affected tasks; paths and labels use escape_debug for safer terminal output.

Docs, usage/man pages, the parity tracker milestone, unit tests, and e2e coverage for path/lockfile explanations are updated accordingly.

Reviewed by Cursor Bugbot for commit b6bb872. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 39c257d6-1236-4710-a0c6-02dc32821621

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds deterministic explanations for affected project and task selection while preserving the existing selection behavior.

  • Adds --affected-explain and generated CLI documentation.
  • Records changed-path, global-path, lockfile, and reverse-dependency causes.
  • Escapes repository-controlled paths and task names in terminal output.
  • Retains all dependency causes when a project is reachable through multiple affected dependencies.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported output-escaping and dependency-cause completeness issues are fixed in the current code.

Important Files Changed

Filename Overview
src/cli/run.rs Adds explanation rendering and safely escapes the repository-controlled path and task-name fields identified in previous review threads.
src/task/workspace.rs Introduces structured affected-project reasons and correctly retains every reverse-dependency cause without changing project-selection reachability.
e2e/tasks/test_task_affected Extends affected-task coverage to verify changed-path, lockfile, dependent-project, and task explanation output.
mise.usage.kdl Registers the new affected-explanation flag for both run command surfaces.
docs/tasks/monorepo.md Documents affected-task selection, explanation causes, dependency expansion, and revision precedence.

Reviews (7): Last reviewed commit: "feat(task): explain affected task select..." | Re-trigger Greptile

Comment thread src/cli/run.rs Resolved
Comment thread src/task/workspace.rs Resolved
@github-actions

github-actions Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
env ▂▁▁▁▄▄▃▃▆▆▅▅▃▄▅▅█ 84,800,951 → 84,905,844 +0.12% 20.13 → 19.05ms -5.38%
hook-env ▄▁▆▅▆▆▅▄▇█▇▇▅▆▆▆█ 87,123,100 → 87,182,963 +0.07% 20.55 → 19.11ms -7.03%
ls ▂▁▄▆▇▆▃▄█▇▇▇▆▇▆▆▇ 76,712,060 → 76,730,749 +0.02% 17.17 → 17.02ms -0.90%
registry ▁█▄▂▃▃▆▅▄▄██▇███▄ 50,433,521 → 50,297,837 -0.27% 12.34 → 11.15ms -9.61%
startup ▁▁▇▆▇▇█▇█▇████▇█▇ 16,102,016 → 16,095,311 -0.04% 8.81 → 8.41ms -4.52%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

b6bb87214872 vs 4bd4185b65ce · measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the agent/explain-affected-tasks branch from 9abfedf to 3555061 Compare August 1, 2026 19:26
@jdx
jdx force-pushed the agent/explain-affected-tasks branch from 3555061 to d6efd44 Compare August 1, 2026 19:40
@jdx
jdx force-pushed the agent/explain-affected-tasks branch from d6efd44 to a57b773 Compare August 1, 2026 19:41
@jdx
jdx force-pushed the agent/explain-affected-tasks branch from a57b773 to 2827e25 Compare August 1, 2026 19:48
Comment thread src/cli/run.rs Resolved
@jdx
jdx force-pushed the agent/explain-affected-tasks branch from 2827e25 to 0e54aa2 Compare August 1, 2026 19:57
@jdx
jdx force-pushed the agent/explain-affected-tasks branch from 0e54aa2 to ba3988e Compare August 1, 2026 20:03
@jdx
jdx force-pushed the agent/explain-affected-tasks branch from ba3988e to b6bb872 Compare August 1, 2026 20:16
@jdx
jdx merged commit 59d2fef into main Aug 1, 2026
31 checks passed
@jdx
jdx deleted the agent/explain-affected-tasks branch August 1, 2026 20:42
This was referenced Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant