Skip to content

[Copilot Dreaming] Avoid misdiagnosed test results and Bazel build failures - #23273

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/dream-curate-memories-20261127050613
Open

Copilot wants to merge 4 commits into
mainfrom
copilot/dream-curate-memories-20261127050613

Conversation

@Copilot

Copilot AI commented Nov 27, 2026

Copy link
Copy Markdown

đź§  How this helps Copilot

Copilot can mistake an empty path-query failure table for a failed test and needlessly rework a valid query. Clearer result guidance helps avoid that detour. Matching the nightly toolchain used by QL-for-QL CI also helps agents reproduce its tests without an older compiler getting in the way.

Bazel troubleshooting can miss language-local generated targets or incorrectly rule out a legitimate standalone stub repair. Correcting those directions helps agents investigate the actual macro and distinguish shared-helper loading problems from targets that genuinely need internal libraries.

Review commit by commit for each change's rationale and evidence.

Note

Copilot Dreaming curates this repository's Copilot instructions and skills in the background, proposing updates to help agents work here. Learn more about Copilot Dreaming.

Automated details

Source: curate-memories Dream, analyzing main at 43fb30bb443c.

Discarded guidance: The manual Cargo-upgrade instructions remain unchanged because the proposed option lacks a witness in the analyzed checkout.

copilot-dreamer[bot] added 4 commits November 27, 2026 05:06
Copilot has mistaken an empty path-query failure table for a failing test,
leading to unnecessary changes to a valid query. Recognizing the adjacent
table headings makes that result unambiguous when regenerating expectations.
The existing ban on committing nonempty failure tables still applies here,
as does the instruction to generate rather than hand-edit expected files.

The tuple fixture records testFailures immediately followed by #select,
without an intervening failure row.
https://github.com/github/codeql/blob/43fb30bb443c04731009218f39cba97cd93dd6fe/csharp/ql/test/library-tests/dataflow/tuples/Tuples.expected#L697-L699

The test query uses the inline-expectation path graph and failure table.
https://github.com/github/codeql/blob/43fb30bb443c04731009218f39cba97cd93dd6fe/csharp/ql/test/library-tests/dataflow/tuples/Tuples.ql#L1-L12
Copilot could miss the macro that minted an unresolved helper target when
searching only shared helpers. Following the package's loaded files also
reaches language-local wrappers and makes that investigation useful for both
locations. The existing instruction to inspect the macro's visibility
behavior remains at the same entry point.

The Swift extractor loads its wrapper from the language-local rules file.
https://github.com/github/codeql/blob/43fb30bb443c04731009218f39cba97cd93dd6fe/swift/extractor/BUILD.bazel#L3-L5

That wrapper creates an internal-prefixed helper target.
https://github.com/github/codeql/blob/43fb30bb443c04731009218f39cba97cd93dd6fe/swift/rules.bzl#L119-L124
Copilot could reject a legitimate shared-helper loading repair because
unrelated standalone targets do not load that helper. Describing the affected
targets instead of every target keeps the narrow repair route usable. The
same paragraph still forbids stubbing internal-only targets into apparent
buildability, and the paired module overrides remain protected here.

The shared Rust wrapper unconditionally loads internal helpers, and the
Unified extractor consumes it.
https://github.com/github/codeql/blob/43fb30bb443c04731009218f39cba97cd93dd6fe/misc/bazel/rust.bzl#L1-L3
https://github.com/github/codeql/blob/43fb30bb443c04731009218f39cba97cd93dd6fe/unified/extractor/BUILD.bazel#L1-L8

The standalone formatting target loads a different rule without this wrapper,
so the Rust helper is not loaded by every standalone target.
https://github.com/github/codeql/blob/43fb30bb443c04731009218f39cba97cd93dd6fe/misc/bazel/buildifier/BUILD.bazel#L1-L10
Copilot encountered a QL compilation failure with an older toolchain that
cleared after switching to the nightly toolchain used by CI. Naming that
toolchain at the local testing entry point helps separate compiler mismatch
from query problems. Extractor setup and the existing test command remain
unchanged; nightly alone is not a promise that tests pass.

The Linux CI job installs nightly CodeQL before building the extractor and
running QL tests.
https://github.com/github/codeql/blob/43fb30bb443c04731009218f39cba97cd93dd6fe/.github/workflows/ql-for-ql-tests.yml#L28-L32
https://github.com/github/codeql/blob/43fb30bb443c04731009218f39cba97cd93dd6fe/.github/workflows/ql-for-ql-tests.yml#L44-L58

The other-platform job selects nightly too.
https://github.com/github/codeql/blob/43fb30bb443c04731009218f39cba97cd93dd6fe/.github/workflows/ql-for-ql-tests.yml#L73-L77
@Copilot
Copilot AI requested review from a team as code owners November 27, 2026 05:06
Copilot AI adaptive review requested due to automatic review settings November 27, 2026 05:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The change still contains an active instruction ambiguity that could cause agents to preserve or dismiss real path-query failures because it does not clearly distinguish a header-only empty table from tables containing result rows.

1 open issue
What changed in this PR

Updates repository guidance to help Copilot reproduce QL-for-QL tests accurately, troubleshoot standalone Bazel builds, and interpret generated path-query expectations.

Changes:

  • Documents use of the nightly CodeQL toolchain for QL-for-QL tests.
  • Improves Bazel guidance for locating macro-generated targets and handling standalone stubs.
  • Adds guidance for interpreting empty path-query failure tables.
File Description
ql/​README.md Documents use of the nightly CodeQL toolchain for local QL-for-QL test reproduction.
.github/​skills/​bazel/​SKILL.md Refines Bazel macro discovery and standalone stub troubleshooting guidance.
.github/​instructions/​expected-files.instructions.md Adds guidance for interpreting generated path-query expectations and empty failure tables.

Review effort: Lite (adaptive)

---
Do not edit these files directly. They are generated by running the tests. If a `.expected` file has a non-empty `testFailures `section it should not be committed - you may want to update the inline expectation comments in the corresponding test source file (e.g. marking expected results as `MISSING` / `SPURIOUS`) then re-run the test.

Treat `testFailures` immediately followed by `#select` as an empty failure table, and preserve that table when regenerating path-query expectations.

This branch has not been deployed

No deployments
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