Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions ANALYSIS.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# CI Command Truth — Analysis

Date: 2026-11-10. Status: pushed — github.com/RakTikoo/ci-command-truth, v0.2 tagged at commit 1d9cbaa, CI green (run #115, 70 tests). (Corrected 2026-11-11: the original status line said "local build only (not pushed)", which went stale after the approved push; the H-1B gate still applies to promotion/monetisation.)
Date: 2026-11-17. This issue #5 fixture-only update is on branch `test/5-python-tooling-fixtures`; scanner behavior is unchanged.

## Fixture corpus score

Corpus first, tool second. 44 fixture repositories under `fixtures/`
(after the fix pass below):
Corpus first, tool second. 55 fixture repositories under `fixtures/`:

| Group | Count | Expectation | Result |
|---|---|---|---|
| Clean (`clean-*`) | 29 | 0 findings, exit 0 | **29/29 pass** |
| Planted missing (`missing-*`) | 6 | exactly 1 finding, correct kind, exit 1 | **6/6 found, 0 extra findings** |
| Clean (`clean-*`) | 35 | 0 findings, exit 0 | **35/35 pass** |
| Planted missing (`missing-*`) | 11 | exactly 1 finding, correct kind, exit 1 | **11/11 found, 0 extra findings** |
| Edge (`edge-*`) | 8 | see below | **8/8 pass** |
| Special (`special-downgrade`) | 1 | warning-severity findings only, exit 0 | **pass** |

(Pre-fix-pass corpus was 21 fixtures: 9 clean / 6 missing / 6 edge.)
(Before this Python tooling pack, the registered corpus contained 53 fixtures: 34 clean / 10 missing / 8 edge / 1 special.)

Planted misses, one per fixture: missing npm script, missing make
target, missing just recipe, missing `./script` file, missing Python
module (`python -m absentpkg.mod`), missing requirements file
(`pip install -r requirements-missing.txt`).
(`pip install -r requirements-missing.txt`), and missing repository-local
Python script (`python3 tests/test_ci.py`).

Edge cases: workflow with no run steps (exit 0, 0 checked), uses:-only
workflow (exit 0), empty workflow file (**listed as unscanned, exit 2 —
Expand All @@ -35,13 +35,14 @@ Clean fixtures cover: npm/pnpm/yarn forms, make (incl. `-C` and bare
`&&`/`||`/`;`/`|` chains, env-var prefixes, `sudo`, `${{ }}`
expressions, `$VAR` script names, multi-line `|` and `>` blocks,
step `working-directory:`, and runner wrappers (`uv run make test`,
`poetry run npm run test`).
`poetry run npm run test`), and a Makefile target wrapping pytest with
a direct repository-local Python script invoked by a workflow.

**Tests: `python3 run_tests.py` — 33 tests, all passing** (corpus
**Tests: `python3 run_tests.py` — 83 tests, all passing on Python 3.13** (corpus
subprocess tests, edge tests, parser/tokeniser unit tests, annotation
format, fix-pass regression units, and a static-safety test asserting
the tool source contains no `subprocess`/`eval`/`exec`/`os.system`).
Plus `python3 spotcheck_fp.py` — 10 fresh-sandbox false-positive
Plus `python3 spotcheck_fp.py` — 16 fresh-sandbox false-positive
headline cases, all passing (see Adversarial review).

### Bugs the corpus caught during the build
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Brief, factual entries for the shipped versions, newest first.

## Unreleased

- **Fixtures**: add clean and planted-missing Python tooling command shapes; registered corpus grows to 35 clean and 11 planted-missing fixtures.

- **Packaging**: new `pyproject.toml` —
`pip install git+https://github.com/RakTikoo/ci-command-truth` now
installs the single-file module plus a `ci-command-truth` console
Expand Down
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,14 @@ $ python3 run_tests.py # 83 tests, zero dependencies
$ python3 spotcheck_fp.py # 16 false-positive headline cases, fresh sandboxes
```

Fixture corpus in `fixtures/`: 32 clean repos that must produce zero
findings, 9 repos with exactly one planted missing reference each, 8
Fixture corpus in `fixtures/`: 35 clean repos must produce zero
findings, 11 repos exactly one planted missing reference each, 8
edge-case repos (no-run, uses-only, empty, malformed, CRLF, nested
workflow subdirectory, empty workflows dir, malformed package.json),
and 1 downgrade repo (warning-severity findings, exit 0). A further
3 cargo repos (2 clean, 1 planted-missing) sit alongside them with
documented expectations in their `EXPECTED.md` files; they join the
registered corpus when a cargo resolver lands, since cargo segments
are currently skipped as external tools. See
ANALYSIS.md for the score, including the v0.2 section.

and 1 downgrade repo (warning-severity findings, exit 0). Python
tooling fixtures cover a Makefile target wrapping pytest, a
repository-local script invoked from CI, and a missing script path.
See `ANALYSIS.md` for the fixture score and coverage details.
## License

MIT — see `LICENSE`.
Expand Down
8 changes: 8 additions & 0 deletions fixtures/clean-python-tooling/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Python tooling
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: make test-python
- run: python3 scripts/check_types.py
4 changes: 4 additions & 0 deletions fixtures/clean-python-tooling/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.PHONY: test-python

test-python:
python3 -m pytest tests/unit
9 changes: 9 additions & 0 deletions fixtures/clean-python-tooling/scripts/check_types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Repository-local type check entry point used by CI."""


def main():
return 0


if __name__ == "__main__":
raise SystemExit(main())
7 changes: 7 additions & 0 deletions fixtures/missing-python-tooling/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Python tooling
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: python3 tests/test_ci.py
1 change: 1 addition & 0 deletions fixtures/missing-python-tooling/tests/test_tooling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""The real test module is named differently from the workflow command."""
3 changes: 2 additions & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def run_tool(fixture):
"clean-working-dir", "clean-wrappers",
# Fix-pass regression fixtures (adversarial-review findings):
"clean-pnpm-yarn-bun", "clean-folded", "clean-per-job-defaults",
"clean-python-known", "clean-nested-run", "clean-matrix-steps",
"clean-python-known", "clean-python-tooling", "clean-nested-run", "clean-matrix-steps",
"clean-just-advanced", "clean-make-advanced", "clean-heredoc",
"clean-trailing-comment", "clean-if-false", "clean-workspaces",
"clean-backslash", "clean-created", "clean-shell-skip",
Expand All @@ -47,6 +47,7 @@ def run_tool(fixture):
"missing-just-recipe": "missing-just-recipe",
"missing-script-file": "missing-script-file",
"missing-python-module": "missing-python-module",
"missing-python-tooling": "missing-script-file",
"missing-requirements": "missing-requirements-file",
# v0.2: planted missing submodule in a repo-local package
"missing-python-submodule": "missing-python-module",
Expand Down