Skip to content

Validate that bazel_args holds flags, not a command - #37

Open
anakanemison wants to merge 1 commit into
mschaller/u01-configure-file-case-insensitivefrom
mschaller/u02-validate-bazel-args
Open

anakanemison wants to merge 1 commit into
mschaller/u01-configure-file-case-insensitivefrom
mschaller/u02-validate-bazel-args

Conversation

@anakanemison

Copy link
Copy Markdown

Part 2 of 23 of a stacked series (tracking issue: #35). Based on U01-configure-file-case-insensitive, the previous part: review and merge that first.

Kind: fix. Lab proposal: P22.

What the migration runs showed

A qgis migration put a whole bazel aquery ... command in bazel_args, which silently disabled the comparison of the default invocation. In a later run with this change (run 089), every entry was a valid flag.

The change

bazel_args is meant for the flags that make aquery mirror the real build
(--config=release, -c opt). Anything that consumes it splices it into a
bazel command line, but nothing checked its shape, and the SKILL.md text
sits next to a literal bazel aquery ... line that is easy to paste in.

Measured in any2bazel-lab: on a QGIS migration the agent recorded the whole
aquery command as bazel_args. Its own diff never read the field, so the
migration looked converged, while a consumer that spliced the field into
bazel aquery failed on a second query expression and produced no parity
result.

config.load now validates the list and raises ValueError naming the first
bad entry; diff.py turns that into a one-line error. An entry must be a
flag, or the value of the flag just before it when that flag has no '='.
So the well-formed ["-c", "opt"] is accepted, which a simpler "every entry
starts with -" rule would reject. SKILL.md shows one right and one wrong
example.

In the lab's later QGIS run with this change, every bazel_args entry was a
valid flag.

Testing

pytest tests/ at this commit: 136 passed (130 on main).

🤖 Generated with Claude Code

bazel_args is meant for the flags that make aquery mirror the real build
(--config=release, -c opt). Anything that consumes it splices it into a
bazel command line, but nothing checked its shape, and the SKILL.md text
sits next to a literal `bazel aquery ...` line that is easy to paste in.

Measured in any2bazel-lab: on a QGIS migration the agent recorded the whole
aquery command as bazel_args. Its own diff never read the field, so the
migration looked converged, while a consumer that spliced the field into
`bazel aquery` failed on a second query expression and produced no parity
result.

config.load now validates the list and raises ValueError naming the first
bad entry; diff.py turns that into a one-line error. An entry must be a
flag, or the value of the flag just before it when that flag has no '='.
So the well-formed ["-c", "opt"] is accepted, which a simpler "every entry
starts with -" rule would reject. SKILL.md shows one right and one wrong
example.

In the lab's later QGIS run with this change, every bazel_args entry was a
valid flag.

Lab-Proposal: P22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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