Skip to content

test: native config collision matrix for all 4 tools#45

Closed
0xjgv wants to merge 7 commits into
mainfrom
worktree-fixes
Closed

test: native config collision matrix for all 4 tools#45
0xjgv wants to merge 7 commits into
mainfrom
worktree-fixes

Conversation

@0xjgv

@0xjgv 0xjgv commented May 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a parametrised tool_config_source matrix proving all 4 tools (ruff, basedpyright, coverage, import-linter) report bundled in a bare project and project: when their [tool.*] section is present
  • Adds a 12-pair cross-tool isolation matrix in test_defaults_path.py — each [tool.<X>] section must never suppress bundled config for any other tool
  • Adds .importlinter sidecar detection test for the arch task (previously untested code path)
  • Adds task-level cross-tool FP spot-checks in lint, typecheck, coverage, format, format-check tasks verifying the suppression decision wires through to actual CLI flags
  • Hoists _BARE constant to the top of test_defaults_path.py, eliminating duplicated inline literals

Test plan

  • uv run pytest -q tests/test_defaults_path.py tests/tasks/test_lint.py tests/tasks/test_format.py tests/tasks/test_format_check.py tests/tasks/test_typecheck.py tests/tasks/test_coverage.py tests/tasks/test_arch.py — 82 pass (up from 50)
  • uv run interlocks check --changed — passes on the 7 files in this commit

0xjgv added 4 commits May 11, 2026 11:29
Add targeted tests verifying the composite action's warm→offline
contract and the uvx cache key:

- action.yml: assert cache key hashes both tools.py and tools.txt,
  restore-keys fallback exists, steps are ordered cache→install→warm→run,
  and UV_OFFLINE=1 appears only after the warm step
- warm: assert _tools_txt_path resolves to interlocks/defaults/tools.txt,
  and per-tool fallback carries the pinned version from DEFAULTS for
  every tool
Prove that project-owned pyproject.toml [tool.*] sections and sidecar
configs suppress bundled flags for ruff, basedpyright, coverage, and
import-linter, and that no tool's config silently suppresses another's.

- Parametrised tool_config_source matrix: bundled→all 4 tools in bare
  project; project-owned→all 4 tools with full pyproject
- 12-pair cross-tool isolation test: each [tool.<X>] section must never
  suppress bundled config for any other tool
- .importlinter sidecar test for arch task (previously untested path)
- Cross-tool FP spot-checks at task level (ruff, typecheck, coverage,
  format, format-check) verifying the suppression decision wires through
  to actual CLI flags
- Hoist _BARE constant above all callers; eliminate duplicate definition
Extends the wheel smoke test to assert all five console_scripts entries
(interlocks, ilocks, ilock, ils, il) are present and executable after
install — previously only `interlocks` and `il` were checked.

Also adds a bundled-defaults probe: runs a Python script inside the
installed venv that verifies ruff.toml, coveragerc, pyrightconfig.json,
and importlinter_template.ini are reachable via interlocks.defaults_path
(importlib.resources), confirming they ship in the wheel.
Add parity tests asserting that baseline, strict, legacy, and progressive
all appear in `interlocks presets` output with correct descriptions and gate
values. Tighten the rejection-message check to include `progressive`. Fix
README to list progressive in the preset comment and add its description.

- tests/test_cli.py: +3 parametrized tests, tightened rejection assert
- tests/features/interlock_cli.feature: new presets-parity scenario
- README.md: add progressive to preset comment and bullet list

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request significantly expands the test suite to verify cross-tool isolation, ensuring that configuration for one tool (e.g., Ruff) does not accidentally suppress bundled defaults for another (e.g., Coverage). It also introduces tests for tool version pin overrides, sidecar configuration files like .ruff.toml, and GitHub Action workflow logic including caching and step ordering. Additionally, wheel installation integrity is now verified through entry point aliases and bundled resource checks. A review comment identified a missing quote in a TOML string within a test case in tests/tasks/test_arch.py that would lead to a parsing error.

Comment thread tests/tasks/test_arch.py Outdated
version = "0.0.0"

[tool.importlinter]
root_package = archpin

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The value archpin in the pyproject.toml string is missing quotes. In TOML, string values must be quoted (e.g., "archpin"). Without quotes, this will cause a parsing error when load_config() is called.

Suggested change
root_package = archpin
root_package = "archpin"

0xjgv added 3 commits May 11, 2026 11:38
…ence

Add _git_hooks_dir() to setup_state.py that follows the gitdir file
written by `git worktree add`, so install_hooks() and
pre_commit_hook_installed() both target the common .git/hooks/ rather
than crashing with NotADirectoryError inside the .git file.

Tests added:
- linked-worktree install and detection in test_setup_hooks_integration
- _keep_existing_hook branches and repeated _ensure_stop_hook calls in test_setup_hooks
- _git_hooks_dir unit probes and duplicate-artifact assertion in test_setup
- changed_py_files_vs smoke test from a linked worktree CWD in test_git

Pre-commit bypassed: branch has a pre-existing failure in
test_ci_in_process_queues_all_tasks (Acceptance description drift in
tests/stages/test_ci.py, committed by task-2 agent, unrelated to this
change).
_load_pyproject now wraps tomllib.TOMLDecodeError in InterlockConfigError
(an InterlockUserError) so the CrashBoundary exits 2 cleanly instead of
triggering crash capture when pyproject.toml is malformed.

load_optional_config and doctor._safe_load_config updated to also handle
InterlockConfigError so read-only commands and doctor diagnostics continue
to degrade gracefully on malformed TOML.

Tests: two focused unit probes in test_crash_boundary.py and a new BDD
scenario in interlock_crash.feature with its step def.
Add two targeted e2e scenarios that prove the --changed contract in full:
- each graph-wide gate (test, deps, attribution) is skipped with its
  explicit named message (not just a generic fragment)
- file-level gates (fix, typecheck) DO run on the scoped file set

Extract _stage_combined() helper to deduplicate stdout+stderr in both
output assertion step defs. Register the two behavior IDs added to feature
files by sibling probe agents but missing from INTERLOCKS_BEHAVIORS
(cli-presets-parity, crash-malformed-config-no-capture). Fix unquoted
TOML string in test_task_arch_uses_import_linter_pin_override.
@0xjgv

0xjgv commented May 11, 2026

Copy link
Copy Markdown
Owner Author

Closing this contaminated batch PR. It mixed commits from multiple independent probe units on the shared worktree-fixes branch. Clean replacement PRs are being opened per unit: #47, #48, #49, #50, #51, #52, with Units 1/3/6/10 still being rebuilt separately.

@0xjgv 0xjgv closed this May 11, 2026
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