Repository navigation
Commit b96c3ad
authored
feat(ci-lint): scan fixes + runtime commands (units, tests size, wheel, gate, local mode) (#11)
* fix(ci-lint): scan file scope, comment/string stripping, PKG-003 tables, CACHE-004 pre-prune
Fixes five round-1A defects found by running precheck against the
restructured template:
1. Every text/AST scan (LAYOUT-001, GEN-005's tracked-script scan,
TOOL-001's Python AST scan, RUST-011's cfg(feature) scan, PKG-005) now
iterates git-tracked files via the new ci_lint.repo_files.list_repo_files
(git ls-files -co --exclude-standard) when --repo is a git work tree,
falling back to a filesystem walk (skipping .git/target/.venv*/
.cargo/registry/node_modules/dist/__pycache__) only for a non-git
fixture dir. Previously a plain filesystem walk scanned gitignored
.cargo/registry/** unconditionally (1,750 bogus findings on the
template).
2. New ci_lint.rust_lexer and ci_lint.py_lexer strip comment and
string-literal content (preserving line numbers) before LAYOUT-001 and
RUST-011's cfg(feature) scans run, so a doc comment merely mentioning a
selector is no longer flagged as real code.
3. PKG-003 now accepts soldr's documented list-of-tables `bundle-bins`
shape ([{ bin = "...", package = "..." }]) in addition to plain
strings.
4. CACHE-004: `pre-prune = true` on every writer flow now removes only the
lockfile-change-peak term from the worst-case sum (worst = steady +
pr.budget) instead of waiving the whole budget proof; the arithmetic
output states which formula applied.
5. examples/rust-pypi-app/ci.toml: dylint-out max lowered to 150MB and
pre-prune = true added to flow.main/flow.nightly, which CACHE-004 (with
the fixed formula) now requires to fit the example under its declared
9GB budget.
Each defect has RED (pre-fix behavior, captured by running round-1A's
original module code against the new fixtures) -> GREEN (fixed code)
evidence and a permanent regression test.
* feat(ci-lint): runtime commands (units, tests size, wheel, gate, local mode, selftest)
Implements round-2A part 2: the runtime commands that read a real cargo
build's --message-format=json output, a built wheel, or an installed venv
-- replacing round-1A's stubs for `units`/`tests`, and adding `wheel`,
`gate` and `selftest`.
- ci_lint.cargo_messages: typed parser for cargo's compiler-artifact JSON
Lines output (ignores non-artifact/non-JSON lines).
- `ci_lint units --repo <path> --artifacts <file.jsonl>`: counts distinct
(features, profile, target kind, target triple) combinations per
workspace crate; RUST-011 if a private crate compiled with >1 feature
set in one profile, or the public crate compiled outside [rust].ship.
Target triple is read from the build output path against declared
[platforms].*.target, never guessed from a generic regex.
- `ci_lint tests size --repo <path> --artifacts <file.jsonl>`: maps
profile.test executables to the <crate>:lib/:bin:<name>/:test:<name>
naming scheme and checks them against [rust.tests] (RUST-012):
undeclared, declared-but-missing, over max-binary, or sum over
max-total.
- `ci_lint wheel check --repo <path> --wheel <path.whl> [--sdist ...]`:
stdlib zipfile only. PKG-003 (bundled CLI present, no shebang, magic
bytes match the wheel's platform tag via ELF/PE/Mach-O header parsing,
no console_scripts shadow), PKG-004 (WHEEL Generator reported as
needs_review if it doesn't mention soldr; abi3 tag check; optional sdist
backend check), PKG-005 (_native extension present).
- `ci_lint wheel installed --repo <path> --venv <dir>`: same magic check
against the host, `<cli> --version` exits 0, and the venv python can
import `<pkg>._native` as a compiled extension.
- `ci_lint gate --repo <path> --plan <plan.json> --needs <needs.json>`:
the CI OK aggregator. Every plan.required_jobs entry must be
needs[job].result == "success" (a skip is TEST-001; a job absent from
needs is needs_review, never a silent pass). plan.mergeable == false
always fails with "not mergeable: tag(s) ... remove required coverage".
- `ci_lint precheck --local` (or env ACT=true) is now wired through (it
was previously parsed and ignored): explicitly reports each
not-yet-implemented live-GitHub-API check (CACHE-005/006/008, ACT-001)
as needs_review "skipped (local): ...", never silently passing them.
- `ci_lint selftest` runs the package's own unittest suite (stdlib only;
zccache#1760 -- agents must be able to run it directly).
- ci_lint.plan.Plan gained `required_jobs` (the job-id convention ci-lint
gate expects; documented in _required_job_ids) and
`needs_platform_lanes`; `dylint_targets` now correctly lists every
declared platform when [lint.dylint].targets = "all-platforms",
decoupled from the tag-selected build platforms (it was previously
narrowed to the selected subset, which undercounted Dylint's coverage
for an untagged PR). `--github-output` gained dylint_targets_json and
needs_platform_lanes.
Tests use small recorded --message-format=json / wheel / plan+needs
fixtures under ci_lint/tests/fixtures/runtime/, never a real cargo/soldr
invocation.
* fix(ci-lint): amend gate job-id convention, per enum, needs_platform_lanes
Orchestrator amendments to round-2A:
1. Job-id convention for `ci-lint gate`/`Plan.required_jobs` is now:
precheck, fast (default linux-x64 build+unit+smoke lane), dylint
(when dylint_targets is non-empty), and -- only when
needs_platform_lanes -- platform-build/platform-run (matrix jobs;
GitHub aggregates every leg into one needs.<id>.result). Drops the
previous build-<platform-id>-per-platform convention. "ci-ok" (the
gate job itself) is never in required_jobs. Updated
ci_lint.plan._required_job_ids, gate/plan fixtures, docs/ci-toml.md,
and added a test that feeds a needs.json with exactly the
platform-lanes id set.
2. [cache.family.<id>].per is now a strict enum
(CACHE_FAMILY_PER_VALUES = none/platform/cross-platform/os) validated
in ci_lint.schema; any other value (e.g. the template's former
"target") is CT-002 with a fix message listing the allowed values,
never a silent fallback to cardinality 1 in CACHE-004's arithmetic.
RED/GREEN fixtures: CT-002/red-cache-per (per = "target") and
CT-002/green-cache-per (per = "platform").
3. needs_platform_lanes is now true exactly when the plan selects any
platform other than [flow.pr]'s own default fast-lane platform(s),
not merely "more than one platform" -- release/nightly's
platforms = "all" base is itself already beyond that fixed baseline,
so they still need the platform matrix even though no tag added
anything. Added ci_lint.plan._default_fast_lane_platforms and tests
for flow.pr (false), [ci-windows] (true), release and nightly (true,
even with zero tags), and push:main (false, inherits pr's base).
126 tests pass with and without PyYAML (was 119); `ci_lint selftest`
confirms both ways too.1 parent 913eeee commit b96c3ad
67 files changed
Lines changed: 3800 additions & 139 deletions
File tree
- ci_lint
- rules
- runtime
- tests
- fixtures
- CT-002
- green-cache-per
- red-cache-per
- PKG-003
- green-bundle-table
- red-bundle-table-mismatch
- RUST-011/green-doc-comment
- crates/private/demo-core
- src
- runtime
- gate
- tests-size
- bin
- units
- workspace
- crates
- demo
- src
- private/demo-core
- src
- docs
- examples/rust-pypi-app
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
241 | 244 | | |
242 | 245 | | |
243 | 246 | | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
249 | 258 | | |
250 | | - | |
| 259 | + | |
251 | 260 | | |
252 | 261 | | |
253 | | - | |
| 262 | + | |
| 263 | + | |
254 | 264 | | |
255 | 265 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
19 | 34 | | |
20 | | - | |
| 35 | + | |
| 36 | + | |
21 | 37 | | |
22 | 38 | | |
23 | 39 | | |
| |||
50 | 66 | | |
51 | 67 | | |
52 | 68 | | |
53 | | - | |
| 69 | + | |
54 | 70 | | |
55 | 71 | | |
56 | 72 | | |
| |||
118 | 134 | | |
119 | 135 | | |
120 | 136 | | |
| 137 | + | |
121 | 138 | | |
122 | 139 | | |
123 | 140 | | |
124 | 141 | | |
125 | 142 | | |
| 143 | + | |
| 144 | + | |
126 | 145 | | |
127 | 146 | | |
128 | 147 | | |
129 | 148 | | |
130 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
131 | 235 | | |
132 | 236 | | |
133 | 237 | | |
| |||
153 | 257 | | |
154 | 258 | | |
155 | 259 | | |
156 | | - | |
157 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
158 | 303 | | |
159 | 304 | | |
160 | 305 | | |
| |||
0 commit comments