Skip to content

feat: P1: Run truthful opt-in Ruff lint and format checks#283

Merged
tomdps merged 1 commit into
devfrom
zeroshot/ruby-surge-41
Jul 24, 2026
Merged

feat: P1: Run truthful opt-in Ruff lint and format checks#283
tomdps merged 1 commit into
devfrom
zeroshot/ruby-surge-41

Conversation

@tomdps

@tomdps tomdps commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Closes #258.

Summary

Adds real, read-only, opt-in Ruff lint and format validation over the exact after-state, without relabeling python.source-hygiene or degrading users who did not enable Ruff.

  • New python.ruff-lint and python.ruff-format validation-python checks with defaultScopes: []. They activate only through explicit selection or .opcore/config validation.checks.defaults; checks.disabled wins. Unrequested → not_applicable, disabled → disabled; neither state probes, invokes, or degrades enforced coverage, and both emit non-execution capability receipts on skipped runs.
  • Execution reuses the P0 — Resolve Python projects, interpreters, environments, and tools canonically #246 canonical Python project context, the fix(python): share import resolution between validation and graph #209 graph import closure, and a shared P0 — Harden Python type checking and configuration semantics #245-style exact after-state workspace primitive with sanitized HOME/XDG/TMP/PATH runtime. Lint runs ruff check --output-format=json --no-fix --no-cache --force-exclude; format runs bounded ruff format --check --no-cache --force-exclude batches, refining exit-1 batches per file without parsing human prose. No fix/write/format-mutation mode is ever invoked.
  • Target-applicable .ruff.toml / ruff.toml / [tool.ruff] config plus its recursive extend closure require non-symlink realpath evidence and are materialized without mutating source, config, lockfiles, environments, or caches.
  • PythonValidationCapabilityRun gains a portable Ruff receipt variant (project key, context fingerprint, after-state manifest fingerprint, source/config paths, cwd, portable executable/argv, tool provenance, termination, duration, diagnostic counts) with runtime + JSON-schema state-machine invariants that reject contradictory or incomplete failure-state execution evidence.
  • Status, scan, doctor, metrics, and ASP reporting are activation-aware: missing Ruff degrades only while a Ruff check is active; python.ruff_lint_findings / python.ruff_format_findings derive only from executed receipts; ASP executes and reports only the selected check ids.

Verification

  • npm run build, npm run lint
  • node --test tests/validation-python.test.mjs tests/opcore-metrics.test.mjs tests/opcore-facade.test.mjs tests/validation-runner.test.mjs tests/validation-cli.test.mjs tests/asp-provider.test.mjs tests/contracts.test.mjs tests/schema-contracts.test.mjs tests/conformance.test.mjs tests/opcore-agent-gate.test.mjs tests/validation-overlays.test.mjs
  • node --test tests/installed-bins.test.mjs (packed public opcore with a pinned real Ruff 0.6.9, proving no source/config/lock/environment/cache mutation and after-state parity)
  • zeroshot cmdproof check opcore-ci

No Python readiness/parity, ASP authority, old-tool replacement, security/SAST, all-stack, automatic-fix, or blended-score claim is made.

🤖 Generated with Claude Code

Implements #258.

Adds `python.ruff-lint` and `python.ruff-format` as validation-python-owned
warning checks with `defaultScopes: []`. They activate only through explicit
selection or `.opcore/config` `validation.checks.defaults`; `checks.disabled`
wins. Unrequested and disabled checks emit non-execution capability receipts,
report skipped runs, never probe or invoke Ruff, and never degrade enforced
coverage. `python.source-hygiene` is unchanged.

Execution reuses the #246 canonical Python project context, the #209 graph
import closure, and a shared #245-style exact after-state workspace primitive
(`python-execution-workspace.ts`) with sanitized HOME/XDG/TMP/PATH runtime.
Lint runs `ruff check --output-format=json --no-fix --no-cache --force-exclude`
and consumes strict JSON; format runs bounded `ruff format --check --no-cache
--force-exclude` batches and refines exit-1 batches by file without parsing
human prose. Target-applicable `.ruff.toml`, `ruff.toml`, and `[tool.ruff]`
configuration plus its recursive `extend` closure require non-symlink realpath
evidence and are materialized without mutating source, config, lockfiles,
environments, or caches.

Extends `PythonValidationCapabilityRun` into a portable Ruff receipt variant
with project key, context fingerprint, after-state manifest fingerprint,
source/config paths, cwd, portable executable/argv, tool provenance,
termination, duration, and diagnostic counts, plus runtime and JSON-schema
state-machine invariants that reject contradictory or incomplete failure-state
execution evidence. Status, scan, doctor, metrics, and ASP reporting are
activation-aware: missing Ruff degrades only while a Ruff check is active, the
`python.ruff_lint_findings`/`python.ruff_format_findings` signals derive only
from executed receipts, and ASP executes and reports only selected check ids.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tomdps
tomdps force-pushed the zeroshot/ruby-surge-41 branch from 9270c2e to 333c1b8 Compare July 24, 2026 04:00
@tomdps
tomdps merged commit 83f9bce into dev Jul 24, 2026
10 checks passed
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.

1 participant