From 8580aa7a1a4b994ef440bf628b45e44ef733f306 Mon Sep 17 00:00:00 2001 From: zoltan57 <40281233+zoltan57@users.noreply.github.com> Date: Tue, 18 Aug 2026 16:18:58 -0500 Subject: [PATCH] Phase 6 negative test: deliberate lint error to prove the CI gate blocks. This commit and its branch are scratch and will be deleted. --- .github/workflows/quality-gate.yml | 45 ++++++++++++++++++++++++++++++ ci_negative_probe.py | 7 +++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/quality-gate.yml create mode 100644 ci_negative_probe.py diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml new file mode 100644 index 0000000..642e5e4 --- /dev/null +++ b/.github/workflows/quality-gate.yml @@ -0,0 +1,45 @@ +name: Quality Gate + +# V4.7 Phase 6 / review log [40]. Before this, ruff, ty and pytest were enforced +# only by .pre-commit-config.yaml, and only for developers who had actually run +# `pre-commit install`. + +on: + push: + pull_request: + +jobs: + gate: + runs-on: ubuntu-latest + steps: + - name: Check out the commit under test + uses: actions/checkout@v4 + + - name: Install uv + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + + - name: Install dependencies from the lockfile + # --locked fails if uv.lock has drifted from pyproject.toml, so a stale + # lockfile is caught here rather than producing an untested dependency set. + run: uv sync --locked + + - name: Write placeholder configuration + # Settings requires openrouter_api_key and 115 tests cannot construct + # Settings without it. This is written to a .env file rather than exported + # as an environment variable on purpose: the external tests guard on + # os.getenv("OPENROUTER_API_KEY"), which reads the process environment and + # not the file, so writing the file reproduces the local result exactly - + # the 4 external tests skip instead of running against a fake key and + # failing. Exporting it instead produces 3 failures. + run: echo "OPENROUTER_API_KEY=ci-placeholder-not-a-real-key" > .env + + - name: Lint and type check + # Runs the hooks defined in .pre-commit-config.yaml instead of repeating + # "ruff check" and "ty check" here. The commands then have one definition, + # so the local and CI gates cannot drift apart. + run: uv run pre-commit run --all-files --show-diff-on-failure + + - name: Tests + run: uv run pytest diff --git a/ci_negative_probe.py b/ci_negative_probe.py new file mode 100644 index 0000000..9244087 --- /dev/null +++ b/ci_negative_probe.py @@ -0,0 +1,7 @@ +"""Scratch file for the Phase 6 CI negative test. Deleted with this branch.""" + +import os + + +def broken() -> int: + return undefined_name_that_does_not_exist