Skip to content

Commit fe7035c

Browse files
mikolalysenkoclaude
andcommitted
test(setup): add patch-missing ablation controls across all layouts
Adds a `patch_missing` ablation (new `patchset: none` — no `.socket/` fixture committed) to the single, workspace and monorepo scenario sets, complementing the existing setup-not-run controls. Together they are the controls that confirm `setup` is correct: each is identical to the corresponding `*_with_setup` case except for the single removed factor (the setup step, or the committed patch), and each must run UNPATCHED. So every "it applies" case is now flanked by both ablations, e.g. for single npm: baseline_with_setup -> applied (patch + setup) no_setup_control -> unpatched (setup ablated) patch_missing -> unpatched (patch ablated) `run-case.sh` skips the fixture entirely for `patchset: none` (so the hook's apply finds no manifest and no-ops — distinct from `empty`, where the manifest exists but lists zero patches). No orchestrator/Rust changes needed; the scenarios are data-driven and picked up automatically. Matrix grows to 114 cases. Verified in Docker (3.3.0): all 22 patch_missing cases pass (run unpatched) — single 16/16, workspace 5/5, monorepo 1/1; with_setup cases still apply; 0 regressions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 145f2db commit fe7035c

3 files changed

Lines changed: 42 additions & 6 deletions

File tree

tests/setup_matrix/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@ wrappers).
3737
hatch · cargo · bundler · go · mvn · composer · dotnet · deno.
3838
- **Scenarios (single-project):**
3939
- `baseline_with_setup` — setup + install ⇒ patch applied *(ideal)*.
40-
- `no_setup_control` — install only ⇒ NOT applied *(the hook is the cause)*.
41-
- `empty_patchset` — empty manifest ⇒ NOT applied.
40+
- `no_setup_control`**ablation (setup not run)**: install only ⇒ NOT applied *(the hook is the cause)*.
41+
- `patch_missing`**ablation (patch missing)**: setup runs and the hook fires, but no `.socket/` patch set is committed ⇒ runs UNPATCHED *(the committed patch is the cause)*.
42+
- `empty_patchset` — manifest present but with zero patches ⇒ NOT applied.
4243
- `wrong_target_patchset` — manifest targets a different package ⇒ NOT applied.
4344
- `alt_content_patchset` — a second patch set ⇒ its marker applied *(content tracks the manifest)*.
4445

46+
The two **ablations** are the controls that confirm `setup` is correct:
47+
each is identical to `baseline_with_setup` except for the single removed
48+
factor (the setup step, or the committed patch), and each must run
49+
unpatched. The workspace and monorepo layouts carry the same pair
50+
(`*_no_setup`, `*_patch_missing`).
51+
4552
## Layouts
4653

4754
The driver's `SM_LAYOUT` selects the project shape (each layout has its
@@ -57,15 +64,15 @@ own `*_targets` / `*_scenarios` sections in `matrix.json`):
5764
dependency hoists / lands in the pnpm store and is patched once) and
5865
**pip** (nested `requirements.txt` files) + **uv** (uv workspace, one
5966
shared `.venv`) as Python gaps. Scenarios: `workspace_with_setup`,
60-
`workspace_no_setup`.
67+
`workspace_no_setup`, `workspace_patch_missing`.
6168
- **`monorepo`** — a **polyglot all-ecosystem repo**: an npm workspace
6269
alongside python/rust/go/php/ruby/nuget/deno manifests. Confirms `setup`
6370
works in a mixed environment — it must configure the npm hooks and
6471
**not choke** on the foreign manifests; a root `npm install` then
6572
patches the npm slice. Runs in the npm image (the only one with the npm
6673
toolchain), so the foreign manifests are present to test setup's
6774
robustness, not installed. Scenarios: `monorepo_with_setup`,
68-
`monorepo_no_setup`.
75+
`monorepo_no_setup`, `monorepo_patch_missing`.
6976

7077
> Real-world wiring note surfaced by the workspace layout: the install
7178
> hook's `apply` must run with the package manager's per-script cwd (root

tests/setup_matrix/matrix.json

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@
5555
"patchset": "alt",
5656
"expect_applied": true,
5757
"description": "Different patch set: a second fixture whose blob carries the ALT marker. Proves the applied bytes track the active manifest (alt marker present, primary marker absent)."
58+
},
59+
{
60+
"id": "patch_missing",
61+
"run_setup": true,
62+
"patchset": "none",
63+
"expect_applied": false,
64+
"description": "Ablation: setup runs and the install hook fires, but NO patch set is committed (no .socket/). The install must run UNPATCHED — proving the committed patch is what changes the code, not setup/install alone."
5865
}
5966
],
6067

@@ -189,7 +196,14 @@
189196
"run_setup": false,
190197
"patchset": "primary",
191198
"expect_applied": false,
192-
"description": "Negative control: workspace install without setup must NOT apply."
199+
"description": "Ablation (setup not run): workspace install without setup must NOT apply — the hook is the cause."
200+
},
201+
{
202+
"id": "workspace_patch_missing",
203+
"run_setup": true,
204+
"patchset": "none",
205+
"expect_applied": false,
206+
"description": "Ablation (patch missing): workspace setup + install with NO committed patch set must run unpatched across the workspace."
193207
}
194208
],
195209
"workspace_targets": [
@@ -246,7 +260,14 @@
246260
"run_setup": false,
247261
"patchset": "primary",
248262
"expect_applied": false,
249-
"description": "Negative control: polyglot monorepo install without setup must NOT apply."
263+
"description": "Ablation (setup not run): polyglot monorepo install without setup must NOT apply."
264+
},
265+
{
266+
"id": "monorepo_patch_missing",
267+
"run_setup": true,
268+
"patchset": "none",
269+
"expect_applied": false,
270+
"description": "Ablation (patch missing): polyglot monorepo setup + install with NO committed patch set must run unpatched."
250271
}
251272
],
252273
"monorepo_targets": [

tests/setup_matrix/run-case.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ EOF
153153
}
154154

155155
build_fixture() {
156+
# Ablation: no patch set committed at all (no .socket/). Even with a
157+
# working install hook, apply finds no manifest and no-ops, so the
158+
# install must run unpatched. Distinct from `empty` (manifest present
159+
# but with zero patches).
160+
if [ "$SM_PATCHSET" = none ]; then
161+
note "no patch fixture committed (ablation: patch missing)"
162+
return
163+
fi
156164
mkdir -p .socket/blobs
157165
case "$SM_PATCHSET" in
158166
empty)

0 commit comments

Comments
 (0)