Skip to content

[ci] Audit live CI inputs against policy - #3578

Open
joshlf wants to merge 1 commit into
Gt4itljw3xh6tci2mjqj4z245i6pwle2ifrom
Gocqawbn3p3zj7xyfo7etk6vo4633r3tn
Open

[ci] Audit live CI inputs against policy#3578
joshlf wants to merge 1 commit into
Gt4itljw3xh6tci2mjqj4z245i6pwle2ifrom
Gocqawbn3p3zj7xyfo7etk6vo4633r3tn

Conversation

@joshlf

@joshlf joshlf commented Aug 25, 2026

Copy link
Copy Markdown
Member

Collect repository packages, resolved dependencies, features, and Cargo
targets with locked, offline Cargo metadata, then validate every policy
reference against the live checkout before planning work. Disable
rustup's automatic toolchain installation separately because Cargo
cannot apply --offline until after the rustup proxy has selected a
toolchain. Pin Cargo's target directory so an ambient override cannot
move the generated-output exemption onto package source.

Retain Cargo's complete PackageId dependency graph instead of
collapsing packages by name. Validate semantic toolchains against every
reachable resolved package, including external transitive dependencies,
while retaining conservative declared workspace edges. Name external
packages as name@version in diagnostics so duplicate package names stay
distinct.

Derive the stable feature closure and its nightly-only complement from
Cargo's complete feature graph. Follow plain and strong optional-
dependency edges according to Cargo semantics while leaving dep: and
weak edges non-activating. Reject an all-features profile on a
non-nightly toolchain whenever the selected package has a nonempty
nightly complement. Future feature changes therefore fail the audit
instead of silently moving nightly-only coverage onto stable.

Require an explicit no-default profile if a future manifest introduces
default features. Accept Rust's two-component and dotted target names
without assuming every target is a three-part triple. Validate each
Cargo target's exact kind and crate-type pairing so representation drift
cannot silently change which artifact CI exercises. Tie each policy
execution mode to the current x86_64 Linux image, including the explicit
native i686 userspace and the one thumb-specific command exception.

Record the package edition and every target's effective edition. Derive
each package's compiler floor from both its exact rust-version and the
reviewed edition floors, then check every semantic toolchain against the
full resolved dependency closure. A target-level edition override or a
newly reachable dependency therefore cannot silently make a planned
cell impossible to run.

Read the checked-in Cargo.lock format before invoking Cargo. Require an
explicit, reviewed reader floor for V3 and V4, and reject the ambiguous
unmarked V1/V2 formats and unknown future formats. Check the Cargo
release paired with every semantic Rust toolchain against that floor.
Dated nightlies remain deliberately incomparable with stable release
numbers.

Store exact target-support evidence in ci/rust-target-support.toml for
every selected compiler version. Require equality with the union of
ordinary, Miri, and semver targets, rather than accepting a stale
superset. Policy, target-set, or toolchain changes therefore fail until
the evidence is updated. An ignored test can query rustup for every
exact compiler and verify the complete catalog when maintainers
intentionally change target coverage.

Teach the stable and nightly pin roller to capture the old typed pin and
run a typed refresh command after changing the manifest. The command
reconstructs and validates the pre-roll state, rejects unrelated drift,
queries the exact new toolchain, handles an old version retained by
another source and a new version already shared by another source, then
renders a canonical sorted catalog. Other policy changes use canonical
manual edits followed by the same all-toolchain verifier; checked-in
comments identify this coordination explicitly.

Replace the catalog through retained policy, manifest, and catalog
handles. Recheck all three identities immediately before an atomic
rename, preserve permissions, sync the replacement and parent
directory, and clean up unique temporary files on failure. Let Cargo
and rustc remain authoritative for custom targets and build-std
configuration; the ordinary wrapper does not impose a second incomplete
target model.

Preflight the supported .cargo/config.toml shape before invoking
Cargo. Reject unreviewed top-level mechanisms and the legacy
.cargo/config name, which Cargo gives precedence even when
config.toml is present. Require the exact reviewed environment map,
follow every declared source-replacement chain, and reject missing,
ambiguous, or cyclic endpoints. Require each terminal directory source
to use a local relative spelling and resolve to a directory inside the
checkout.

Canonicalize trusted manifests, Cargo targets, configured directory
sources, and baseline paths before using them. Reject symbolic links
which leave the checkout, require every resolved manifest and target to
remain inside it, and distinguish missing baseline inputs from other
file-system errors. Recursively inspect each resolved package tree so a
nested module or macro-input symlink absent from Cargo metadata cannot
escape the checkout.

Also validate the narrower line-oriented Cargo.toml grammar consumed by
build.rs. Fail when packages, target kinds, crate types, examples,
required features, baseline paths, or toolchain sources escape
classification. Keep all collected data deterministic and report
independent inventory errors together. Cargo metadata remains
authoritative; this layer checks coordination without copying its
package or feature lists into policy.

Tests: focused feature, target, graph, version, edition, lockfile,
configuration, path-containment, target-refresh, live-audit, and
mutation tests.

Authored by an agent, posting via joshlf's account


Latest Update: v29 — Compare vs v28

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v8 v7 v6 v5 v4 v3 v2 v1 Base
v7 v6 v5 v4 v3 v2 v1 Base
v6 v5 v4 v3 v2 v1 Base
v5 v4 v3 v2 v1 Base
v4 v3 v2 v1 Base
v3 v2 v1 Base
v2 v1 Base
v1 Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/Gocqawbn3p3zj7xyfo7etk6vo4633r3tn && git checkout -b pr-Gocqawbn3p3zj7xyfo7etk6vo4633r3tn FETCH_HEAD

Checkout

git fetch origin refs/heads/Gocqawbn3p3zj7xyfo7etk6vo4633r3tn && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/Gocqawbn3p3zj7xyfo7etk6vo4633r3tn && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/Gocqawbn3p3zj7xyfo7etk6vo4633r3tn

Stacked PRs enabled by GHerrit.

@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.85%. Comparing base (0adf985) to head (1e67168).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           Gt4itljw3xh6tci2mjqj4z245i6pwle2i    #3578   +/-   ##
==================================================================
  Coverage                              91.85%   91.85%           
==================================================================
  Files                                     20       20           
  Lines                                   6093     6093           
==================================================================
  Hits                                    5597     5597           
  Misses                                   496      496           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5070ce31b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/zc/src/inventory.rs Outdated
Comment thread tools/zc/src/inventory.rs
Comment thread tools/zc/src/inventory.rs Outdated
@joshlf
joshlf force-pushed the Gocqawbn3p3zj7xyfo7etk6vo4633r3tn branch from 5070ce3 to fac6e43 Compare August 25, 2026 18:32

joshlf commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

Authored by an agent, posting via joshlf's account

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: fac6e434ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@joshlf
joshlf force-pushed the Gocqawbn3p3zj7xyfo7etk6vo4633r3tn branch from 12e15aa to 1efd245 Compare August 26, 2026 15:46
@joshlf

joshlf commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

Authored by an agent, posting via joshlf's account

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1efd245312

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/zc/src/inventory.rs Outdated
@joshlf
joshlf force-pushed the Gt4itljw3xh6tci2mjqj4z245i6pwle2i branch from 5488531 to da7ad19 Compare August 26, 2026 17:40
@joshlf
joshlf force-pushed the Gocqawbn3p3zj7xyfo7etk6vo4633r3tn branch from 1efd245 to 205aa5e Compare August 26, 2026 17:40
@joshlf

joshlf commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

Authored by an agent, posting via joshlf's account

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 205aa5e0fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/zc/src/inventory.rs
Comment thread tools/zc/src/inventory.rs
Comment thread tools/zc/src/inventory.rs Outdated
Comment thread tools/zc/src/inventory.rs
Comment thread tools/zc/src/inventory.rs
@joshlf
joshlf force-pushed the Gt4itljw3xh6tci2mjqj4z245i6pwle2i branch from da7ad19 to d6bc5ea Compare August 26, 2026 18:55
@joshlf
joshlf force-pushed the Gocqawbn3p3zj7xyfo7etk6vo4633r3tn branch from 205aa5e to 467e8ab Compare August 26, 2026 18:55
@joshlf

joshlf commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

Authored by an agent, posting via joshlf's account

@codex review

Please review the current head, 467e8abfaecc0c3a9e2a25f416633570581d173b.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 467e8abfae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/zc/src/inventory.rs Outdated
Comment thread tools/zc/src/inventory.rs
Comment thread tools/zc/src/inventory.rs Outdated
@joshlf
joshlf force-pushed the Gocqawbn3p3zj7xyfo7etk6vo4633r3tn branch from 467e8ab to ce33423 Compare August 26, 2026 20:11
@joshlf
joshlf force-pushed the Gt4itljw3xh6tci2mjqj4z245i6pwle2i branch from d6bc5ea to 82ce4ba Compare August 26, 2026 20:11
@joshlf

joshlf commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

Authored by an agent, posting via joshlf's account

@codex review

Please review the current head, ce33423ce23791adeaf36f30c481eed8ccaf8197.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce33423ce2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/zc/src/inventory.rs Outdated
Comment thread tools/zc/src/inventory.rs
Comment thread tools/zc/src/inventory.rs
@joshlf
joshlf force-pushed the Gocqawbn3p3zj7xyfo7etk6vo4633r3tn branch 2 times, most recently from 6cc20d1 to b3a0666 Compare August 26, 2026 22:35
@joshlf
joshlf force-pushed the Gt4itljw3xh6tci2mjqj4z245i6pwle2i branch from 82ce4ba to c84c440 Compare August 26, 2026 22:35
@joshlf

joshlf commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

Authored by an agent, posting via joshlf's account

@codex review

Please review the current head, b3a0666196774174ff4808d0a73202f144495e22.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3a0666196

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/zc/src/inventory.rs Outdated
Comment thread tools/zc/src/inventory.rs
Comment thread tools/zc/src/inventory.rs Outdated
@joshlf
joshlf force-pushed the Gt4itljw3xh6tci2mjqj4z245i6pwle2i branch from c84c440 to fec9a20 Compare August 26, 2026 23:31
@joshlf
joshlf force-pushed the Gocqawbn3p3zj7xyfo7etk6vo4633r3tn branch from b3a0666 to 0128ac8 Compare August 26, 2026 23:31
@joshlf
joshlf force-pushed the Gt4itljw3xh6tci2mjqj4z245i6pwle2i branch from fec9a20 to 0adf985 Compare August 27, 2026 01:18
@joshlf
joshlf force-pushed the Gocqawbn3p3zj7xyfo7etk6vo4633r3tn branch from 0128ac8 to 1e67168 Compare August 27, 2026 01:18
Collect repository packages, resolved dependencies, features, and Cargo
targets with locked, offline Cargo metadata, then validate every policy
reference against the live checkout before planning work. Disable
rustup's automatic toolchain installation separately because Cargo
cannot apply `--offline` until after the rustup proxy has selected a
toolchain. Pin Cargo's target directory so an ambient override cannot
move the generated-output exemption onto package source.

Retain Cargo's complete PackageId dependency graph instead of
collapsing packages by name. Validate semantic toolchains against every
reachable resolved package, including external transitive dependencies,
while retaining conservative declared workspace edges. Name external
packages as name@version in diagnostics so duplicate package names stay
distinct.

Derive the stable feature closure and its nightly-only complement from
Cargo's complete feature graph. Follow plain and strong optional-
dependency edges according to Cargo semantics while leaving `dep:` and
weak edges non-activating. Reject an all-features profile on a
non-nightly toolchain whenever the selected package has a nonempty
nightly complement. Future feature changes therefore fail the audit
instead of silently moving nightly-only coverage onto stable.

Require an explicit no-default profile if a future manifest introduces
default features. Accept Rust's two-component and dotted target names
without assuming every target is a three-part triple. Validate each
Cargo target's exact kind and crate-type pairing so representation drift
cannot silently change which artifact CI exercises. Tie each policy
execution mode to the current x86_64 Linux image, including the explicit
native i686 userspace and the one thumb-specific command exception.

Record the package edition and every target's effective edition. Derive
each package's compiler floor from both its exact `rust-version` and the
reviewed edition floors, then check every semantic toolchain against the
full resolved dependency closure. A target-level edition override or a
newly reachable dependency therefore cannot silently make a planned
cell impossible to run.

Read the checked-in Cargo.lock format before invoking Cargo. Require an
explicit, reviewed reader floor for V3 and V4, and reject the ambiguous
unmarked V1/V2 formats and unknown future formats. Check the Cargo
release paired with every semantic Rust toolchain against that floor.
Dated nightlies remain deliberately incomparable with stable release
numbers.

Store exact target-support evidence in `ci/rust-target-support.toml` for
every selected compiler version. Require equality with the union of
ordinary, Miri, and semver targets, rather than accepting a stale
superset. Policy, target-set, or toolchain changes therefore fail until
the evidence is updated. An ignored test can query rustup for every
exact compiler and verify the complete catalog when maintainers
intentionally change target coverage.

Teach the stable and nightly pin roller to capture the old typed pin and
run a typed refresh command after changing the manifest. The command
reconstructs and validates the pre-roll state, rejects unrelated drift,
queries the exact new toolchain, handles an old version retained by
another source and a new version already shared by another source, then
renders a canonical sorted catalog. Other policy changes use canonical
manual edits followed by the same all-toolchain verifier; checked-in
comments identify this coordination explicitly.

Replace the catalog through retained policy, manifest, and catalog
handles. Recheck all three identities immediately before an atomic
rename, preserve permissions, sync the replacement and parent
directory, and clean up unique temporary files on failure. Let Cargo
and rustc remain authoritative for custom targets and build-std
configuration; the ordinary wrapper does not impose a second incomplete
target model.

Preflight the supported `.cargo/config.toml` shape before invoking
Cargo. Reject unreviewed top-level mechanisms and the legacy
`.cargo/config` name, which Cargo gives precedence even when
`config.toml` is present. Require the exact reviewed environment map,
follow every declared source-replacement chain, and reject missing,
ambiguous, or cyclic endpoints. Require each terminal directory source
to use a local relative spelling and resolve to a directory inside the
checkout.

Canonicalize trusted manifests, Cargo targets, configured directory
sources, and baseline paths before using them. Reject symbolic links
which leave the checkout, require every resolved manifest and target to
remain inside it, and distinguish missing baseline inputs from other
file-system errors. Recursively inspect each resolved package tree so a
nested module or macro-input symlink absent from Cargo metadata cannot
escape the checkout.

Also validate the narrower line-oriented Cargo.toml grammar consumed by
build.rs. Fail when packages, target kinds, crate types, examples,
required features, baseline paths, or toolchain sources escape
classification. Keep all collected data deterministic and report
independent inventory errors together. Cargo metadata remains
authoritative; this layer checks coordination without copying its
package or feature lists into policy.

Tests: focused feature, target, graph, version, edition, lockfile,
configuration, path-containment, target-refresh, live-audit, and
mutation tests.

*Authored by an agent, posting via joshlf's account*

gherrit-pr-id: Gocqawbn3p3zj7xyfo7etk6vo4633r3tn
@joshlf
joshlf force-pushed the Gocqawbn3p3zj7xyfo7etk6vo4633r3tn branch from 1e67168 to c87afd9 Compare August 27, 2026 10:15
@joshlf

joshlf commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

Authored by an agent, posting via joshlf's account

@codex review

Please review the current head, c87afd92a503934a08576039c695ac2007bc519f.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: c87afd92a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

2 participants