Skip to content

Shared: update code comments explaining models-as-data format to include barriers and barrier guards#21584

Open
owen-mc wants to merge 7 commits intogithub:mainfrom
owen-mc:shared/update-mad-comments
Open

Shared: update code comments explaining models-as-data format to include barriers and barrier guards#21584
owen-mc wants to merge 7 commits intogithub:mainfrom
owen-mc:shared/update-mad-comments

Conversation

@owen-mc
Copy link
Contributor

@owen-mc owen-mc commented Mar 26, 2026

I have also copied some sections that were missing for some languages and corrected the explanation of neutral models. These changes have been done in separate commits.

@owen-mc owen-mc added the no-change-note-required This PR does not need a change note label Mar 26, 2026
@github-actions github-actions bot added C# JS C++ Java Python Go Ruby Rust Pull requests that update Rust code labels Mar 26, 2026
@owen-mc owen-mc marked this pull request as ready for review March 26, 2026 11:47
@owen-mc owen-mc requested review from a team as code owners March 26, 2026 11:47
Copilot AI review requested due to automatic review settings March 26, 2026 11:47
@owen-mc owen-mc requested review from a team as code owners March 26, 2026 11:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Models-as-Data / API-graph model documentation comments across several languages to describe barrier and barrier-guard model formats, and to refine the description of neutral models.

Changes:

  • Document Barriers and BarrierGuards row formats in multiple MaD / ApiGraph model comment blocks.
  • Add/expand documentation for barrier-guard condition columns (branch / acceptingvalue).
  • Adjust neutral-model description text in ExternalFlow docs.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll Updates MaD format comment to include barriers/guards and neutrals.
ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModels.qll Documents Barriers/BarrierGuards rows and branch meaning for API-graph models.
python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModels.qll Documents Barriers/BarrierGuards rows and branch meaning for API-graph models.
javascript/ql/lib/semmle/javascript/frameworks/data/internal/ApiGraphModels.qll Documents Barriers/BarrierGuards rows and branch meaning for API-graph models.
java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll Documents Barriers/BarrierGuards and adjusts neutral-model description.
go/ql/lib/semmle/go/dataflow/ExternalFlow.qll Documents Barriers/BarrierGuards and provenance; adjusts neutral-model description.
csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll Documents Barriers/BarrierGuards and adjusts neutral-model description.
cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll Documents Barriers/BarrierGuards, acceptingvalue, and provenance.
Comments suppressed due to low confidence (3)

cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll:96

  • Minor grammar: "In future" should be "In the future," (or similar) in this sentence.
 *    "false". In future "no-exception", "not-zero", "null", "not-null" may be
 *    supported.

rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll:18

  • The Neutrals row/description here doesn't match the rest of this module: the file defines neutralModel(string path, string kind, string provenance, ...) and later states kind can be source, sink, or summary. Please align the Neutrals row columns and the neutral explanation with the neutralModel predicate and its documented effect below.
 * - Neutrals:
 *   `package; type; name; signature; kind; provenance`
 *   A neutral is used to indicate that a callable is neutral with respect to flow (no summary).

rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll:46

  • This description says the barrier-guard branch column may support values like "no-exception"/"not-zero" in the future, but the barrierGuardModel documentation below states branch is either true or false (a branch selector). To avoid conflicting documentation, either keep branch restricted to true/false here or update the later barrierGuardModel docs to match the intended semantics.
 * 3. The `branch` column of barrier guard models specifies which branch of the
 *    guard is blocking flow. It can be "true" or "false". In future
 *    "no-exception", "not-zero", "null", "not-null" may be supported.

@owen-mc owen-mc force-pushed the shared/update-mad-comments branch from a782c0f to 1d0e402 Compare March 26, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C# C++ Go Java JS no-change-note-required This PR does not need a change note Python Ruby Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants