Skip to content

chore(#5721): scope ty pre-commit hook to changed files - #5728

Merged
rh-hemartin merged 1 commit into
mainfrom
agent/5721-ty-hook-pass-filenames
Jul 29, 2026
Merged

chore(#5721): scope ty pre-commit hook to changed files#5728
rh-hemartin merged 1 commit into
mainfrom
agent/5721-ty-hook-pass-filenames

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

  • Remove . positional argument from the ty pre-commit hook entry so it no longer checks the entire project tree
  • Drop pass_filenames: false so pre-commit appends only the staged Python files to ty check

Why

The hook was configured to run ty check . on every commit regardless of which files changed. This made commits slower and surfaced diagnostics unrelated to the staged files. Since ty check accepts individual file paths, letting pre-commit pass filenames is the correct behavior.

Testing

  • Verified YAML syntax is valid after the change
  • The fix is a two-line config change with well-defined behavior per the pre-commit framework and ty CLI documentation

Closes #5721

Post-script verification

  • Branch is not main/master (agent/5721-ty-hook-pass-filenames)
  • Secret scan passed (gitleaks — 8ac8468aeabcc94dc3be41d911c7fa97508211db..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

The ty hook was configured with `pass_filenames: false` and a `.`
positional argument, causing it to check the entire project on
every commit. Remove `.` from the entry command and drop
`pass_filenames: false` so pre-commit passes only staged Python
files to ty, matching the standard hook behavior.

Note: pre-commit hooks could not run in sandbox (network
blocked). The post-script runs pre-commit authoritatively.

Closes #5721
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 29, 2026 15:05
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Jul 29, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 29, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:07 PM UTC · Completed 3:16 PM UTC
Commit: f580f56 · View workflow run →

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] .pre-commit-config.yaml — This PR modifies .pre-commit-config.yaml, which is a protected governance/infrastructure file. The change is authorized by linked issue pre-commit: ty hook checks entire project instead of changed files #5721 and the PR description explains the rationale. Human approval is always required for protected-path changes, regardless of context.

Labels: PR modifies pre-commit config (CI infrastructure)

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment component/ci CI pipelines and checks type/chore Maintenance and housekeeping tasks labels Jul 29, 2026
@rh-hemartin
rh-hemartin added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 7d04190 Jul 29, 2026
31 of 32 checks passed
@rh-hemartin
rh-hemartin deleted the agent/5721-ty-hook-pass-filenames branch July 29, 2026 15:28
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jul 29, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 3:32 PM UTC · Completed 3:46 PM UTC
Commit: f580f56 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #5728 — scope ty pre-commit hook to changed files

Verdict: Clean workflow, no new proposals warranted.

This was a well-executed end-to-end pipeline for a simple 2-line config change to .pre-commit-config.yaml (removing . from the ty check entry and dropping pass_filenames: false).

Timeline

Stage Run ID Duration Cost Outcome
Triage 30463237700 ~5 min $0.45 Classified as ready-to-code (clarity 0.985)
Code 30463662911 ~4.5 min $1.24 Correct fix on first attempt, 28 tool calls
Review 30464182781 ~9.5 min $1.77 Protected-path finding (correct), comment verdict
Human ~8 min Approved by rh-hemartin

Total: ~34 min issue-to-merge, ~$3.46, zero rework iterations.

Agents repo: fullsend-ai/agents at commit 8b9e25e.

What went well

  • Code agent efficiency: 28 tool calls, single Edit call with the exact correct fix. No scope creep, graceful recovery from sandbox constraints (HTTP 403 on git fetch, network-blocked pre-commit run).
  • Triage accuracy: Correctly classified a well-written issue as ready-to-code with appropriate labels (type/chore, component/ci, priority/low, good-fullsend-issue).
  • Review correctness: The protected-path finding was well-calibrated — medium severity, non-actionable, correctly noting issue pre-commit: ty hook checks entire project instead of changed files #5721 authorization. The requires-manual-review label ensured human oversight for governance infrastructure.
  • Pipeline velocity: Handoffs were fast — 5s triage→code, 12s code→review. Human approved 8 minutes after review posted.

Evidence supporting existing issues (not filing new proposals)

Review proportionality (agents#301, agents#439, agents#497): This run is another data point — $1.77 and 46 tool calls across 4 sub-agents for a 2-line YAML change that produced zero code findings. Only the orchestrator's structural protected-path flag was meaningful. The review sub-agents spent effort on tangential exploration: correctness globbed **/*.py to understand the Python file landscape (unnecessary for evaluating a config change), intent-coherence read ADR-0056 about the tools registry (irrelevant to hook configuration), and style-conventions made 7 reads/greps of .pre-commit-config.yaml at different offsets. A trivial-change fast path (agents#301) would have eliminated ~$1.50 of this cost.

Sub-agent redundant reads (agents#140, agents#252): Despite PR #172 (merged Jul 17) reportedly fixing cross-agent file duplication, the style-conventions sub-agent still made 7 tool calls reading the same file at different offsets. This may be intra-agent fragmentation rather than inter-agent duplication — a distinct pattern from what #140 addressed — but it contributes to the same cost overhead.

Triage output directory (fullsend#3012): The triage agent needed 4 attempts to write its output (directory didn't exist, then tried unavailable Write tool). Pre-creating FULLSEND_OUTPUT_DIR would save 2 tool calls per triage run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/ci CI pipelines and checks ready-for-review Triggers review agent dispatch requires-manual-review Review requires human judgment type/chore Maintenance and housekeeping tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pre-commit: ty hook checks entire project instead of changed files

1 participant