Skip to content

Stop agent scratch directories from breaking the boring-cyborg check - #72642

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:agent-dir-litter-guards
Sep 8, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:agent-dir-litter-guards

Conversation

@potiuk

@potiuk potiuk commented Sep 7, 2026

Copy link
Copy Markdown
Member

Coding agents (Claude Code, and anything else using the same write-tracking convention) create .claude/.cc-writes/ scratch directories next to whatever directory a tool call ran in, so they turn up anywhere in the tree — this checkout had 22 of them, under dev/, providers/, ts-sdk/docs/, and so on.

The failure this fixes. When one lands in the UI locales directory, boring_cyborg.py globs locales/* and treats every directory as a locale code, so it reports:

Found 1 problems:
Translation [.claude] is missing in [translation:.claude] section.
Please correct the above in .github/boring-cyborg.yml

The commit is blocked, and the message points at boring-cyborg.yml, which is not where the problem is. The directories are empty, so git status shows nothing and the real cause is invisible without ls -a.

Changes:

  • scripts/ci/prek/boring_cyborg.py — skip dot-directories when enumerating locales. Locale codes never start with a dot. This matches the guard check_shared_distributions_usage.py already uses.
  • .gitignore — add **/.claude/.cc-writes/. The existing .claude/* rule contains a slash, so git anchors it to the repo root; nested occurrences were only ignored for contributors who happen to have a matching pattern in their personal global ignore file.

Verified by recreating locales/.claude/.cc-writes and re-running the hook: exits 1 before, "No found problems" after. git -c core.excludesFile=/dev/null check-ignore confirms the new pattern catches nested dirs without relying on a global ignore.

Not changed: the other dir-iterating prek scripts don't need this — check_no_new_airflow_core_utils_modules.py and check_shared_distributions_usage.py already skip dot-names, and the two shared/ ones gate on a pyproject.toml marker. No unit test: boring_cyborg.py raises SystemExit when imported as a module, so it is deliberately outside the scripts/tests/ci/prek/ suite, and making a one-line guard testable would mean undoing that.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5)

Generated-by: Claude Code (Opus 5) following the guidelines

Coding agents create write-tracking scratch directories next to whatever
directory a tool call happened to run in, so they appear anywhere in the
tree rather than only at the repo root. When one lands in the UI locales
directory the boring-cyborg check reads it as a locale code and fails the
commit with a message that points at boring-cyborg.yml, which is not where
the problem is. The directories are empty, so git status gives no hint
either and the cause is invisible without listing hidden entries.

The repository's own ignore rule for them was anchored to the root, which
left contributors relying on a personal global ignore file for the rest of
the tree.

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, thanks.

@potiuk
potiuk merged commit 8850c32 into apache:main Sep 8, 2026
70 checks passed
@potiuk
potiuk deleted the agent-dir-litter-guards branch September 8, 2026 13:56
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-3-test PR Link

aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Sep 8, 2026
…yborg check (apache#72642)

Coding agents create write-tracking scratch directories next to whatever
directory a tool call happened to run in, so they appear anywhere in the
tree rather than only at the repo root. When one lands in the UI locales
directory the boring-cyborg check reads it as a locale code and fails the
commit with a message that points at boring-cyborg.yml, which is not where
the problem is. The directories are empty, so git status gives no hint
either and the cause is invisible without listing hidden entries.

The repository's own ignore rule for them was anchored to the root, which
left contributors relying on a personal global ignore file for the rest of
the tree.
(cherry picked from commit 8850c32)

Co-authored-by: Jarek Potiuk <[email protected]>
potiuk added a commit that referenced this pull request Sep 9, 2026
…yborg check (#72642) (#72712)

Coding agents create write-tracking scratch directories next to whatever
directory a tool call happened to run in, so they appear anywhere in the
tree rather than only at the repo root. When one lands in the UI locales
directory the boring-cyborg check reads it as a locale code and fails the
commit with a message that points at boring-cyborg.yml, which is not where
the problem is. The directories are empty, so git status gives no hint
either and the cause is invisible without listing hidden entries.

The repository's own ignore rule for them was anchored to the root, which
left contributors relying on a personal global ignore file for the rest of
the tree.
(cherry picked from commit 8850c32)

Co-authored-by: Jarek Potiuk <[email protected]>
regarmukesh3g pushed a commit to regarmukesh3g/airflow that referenced this pull request Sep 27, 2026
…pache#72642)

Coding agents create write-tracking scratch directories next to whatever
directory a tool call happened to run in, so they appear anywhere in the
tree rather than only at the repo root. When one lands in the UI locales
directory the boring-cyborg check reads it as a locale code and fails the
commit with a message that points at boring-cyborg.yml, which is not where
the problem is. The directories are empty, so git status gives no hint
either and the cause is invisible without listing hidden entries.

The repository's own ignore rule for them was anchored to the root, which
left contributors relying on a personal global ignore file for the rest of
the tree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants