Skip to content

fix(collection): validate unique task signatures - #932

Merged
tobiasraabe merged 9 commits into
mainfrom
codex/validate-unique-task-signatures
Sep 6, 2026
Merged

tobiasraabe merged 9 commits into
mainfrom
codex/validate-unique-task-signatures

Conversation

@tobiasraabe

Copy link
Copy Markdown
Member

Summary

  • validate task-signature uniqueness after collection hooks and during collection modification
  • defend DAG construction against duplicate task identities
  • report every collision group with task names, callables, and source locations
  • add regression tests for programmatic tasks, diagnostics, and direct DAG construction

Root cause

The DAG stores tasks by signature and silently replaces node data when the same signature is inserted twice. Programmatic PTask objects and plugin-modified task lists could therefore collect two tasks but execute only one while the build exited successfully.

Impact

Duplicate task identities now fail collection before execution. DAG construction also enforces the invariant defensively, so alternate callers cannot silently discard tasks.

Validation

  • uv run --group test pytest --snapshot-warn-unused: 936 passed, 39 skipped, 4 xfailed
  • uv run --group typing --group test --isolated ty check --python-platform linux: passed
  • changed-file ty check: passed on Windows
  • project-locked uv run ruff check .: passed
  • project-locked ruff format --check for changed files: passed
  • all non-Ruff pre-commit hooks: passed

The repository's just recipes cannot locate their configured shell on this Windows checkout. In addition, the pre-commit Ruff 0.16 hook reports new baseline rules across untouched main, while the project lock currently provides Ruff 0.15.16. The PR was checked with the project-locked Ruff version and does not alter lint configuration.

@tobiasraabe tobiasraabe changed the title Validate unique task signatures fix(collection): validate unique task signatures Aug 2, 2026
@tobiasraabe
tobiasraabe marked this pull request as ready for review August 2, 2026 18:45
@tobiasraabe
tobiasraabe force-pushed the codex/validate-unique-task-signatures branch from 684c1f2 to 860044c Compare September 6, 2026 16:32
@tobiasraabe
tobiasraabe added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit 74e151f Sep 6, 2026
23 checks passed
@tobiasraabe
tobiasraabe deleted the codex/validate-unique-task-signatures branch September 6, 2026 16:58
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