Skip to content

agents: require user-visible docs prose and workaround comments - #4271

Merged
rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:learn_docs_and_workaround_rules
Oct 15, 2026
Merged

rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:learn_docs_and_workaround_rules

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Agents sometimes document internal workarounds in user-facing reference
docs or omit inline comments explaining why non-obvious code workarounds
are needed.

Update the documentation and Starlark rules and review prompts to keep
docs focused on user-visible behavior and require comments on
non-obvious workarounds stating the intent, why the direct approach
fails, and why the workaround works.

Agents sometimes document internal workarounds in user-facing reference
docs or omit inline comments explaining why non-obvious code workarounds
are needed.

Update the documentation and Starlark rules and review prompts to keep
docs focused on user-visible behavior and require comments on
non-obvious workarounds stating the intent, why the direct approach
fails, and why the workaround works.
@rickeylev
rickeylev requested a review from aignas as a code owner October 15, 2026 04:14
@rickeylev
rickeylev enabled auto-merge October 15, 2026 04:14
@rickeylev
rickeylev merged commit b7ec5bd into bazel-contrib:main Oct 15, 2026
5 checks passed
@rickeylev
rickeylev deleted the learn_docs_and_workaround_rules branch October 15, 2026 16:21
rickeylev pushed a commit to rickeylev/rules_python that referenced this pull request Oct 16, 2026
…rib#4272)

Replace the unmaintained `github.com/smacker/go-tree-sitter` dependency
with the official `github.com/tree-sitter/go-tree-sitter` and
`github.com/tree-sitter/tree-sitter-python` (v0.25.0) modules. This
updates the Python grammar so the Gazelle plugin can parse Python 3.14
PEP 758 unparenthesized multi-exception `except` clauses without errors.

Because the official bindings include C sources across parent and
subdirectory paths that standard `go_repository` Gazelle generation
cannot compile directly, fetch both modules via `http_archive` with
custom `cc_library` and `go_library` targets in both Bzlmod and
WORKSPACE modes.

We also remove unneeded go_repository items from `gazelle/deps.bzl`.

Generated by Gemini. Tested on our large-scale QuantumAI monorepo.

TAG=agy

### Timing

I ran the parent commit and this PR on our primary QuantumAI monorepo.
This PR might make things a little faster, but I didn't want to wait for
5 or more runs in hyperfine 😆.

Parent commit:

```
$ git -C ../../oss/bazel-contrib/rules_python rev-parse HEAD
b7ec5bd  # agents: require user-visible docs prose and workaround comments (bazel-contrib#4271)
$ hyperfine --warmup=1 --runs=3 'bazel run --bes_backend= //:gazelle'
Benchmark 1: bazel run --bes_backend= //:gazelle
  Time (mean ± σ):     93.052 s ± 18.023 s    [User: 99.884 s, System: 6.302 s]
  Range (min … max):   82.134 s … 113.855 s    3 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
```


This PR:

```
$ git -C ../../oss/bazel-contrib/rules_python rev-parse HEAD
bc5b12a
$ hyperfine --warmup=1 --runs=3 'bazel run --bes_backend= //:gazelle'
Benchmark 1: bazel run --bes_backend= //:gazelle
  Time (mean ± σ):     80.338 s ±  2.570 s    [User: 80.271 s, System: 3.808 s]
  Range (min … max):   78.292 s … 83.223 s    3 runs
```

Fixes bazel-contrib#3416
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