Repository navigation
Description
mcpx(affected-tests): untracked new files are listed as changed but their contents never reach the diff-text analysis — T2 name matching and T1b silently skip them pre-commit
Summary
pkgs/mcpx/scripts/affected-tests.py promises in its header (lines 26–29):
The diff is the working tree against the base (committed + uncommitted +
untracked), so the selector works before anything is committed:
git diff --name-only <base>+git ls-files --others
The changed-file list honours that (line 336–339: git diff --name-only ∪
git ls-files --others), so an untracked new file counts as changed, its
package gets T0/T1, and its registry area fires T3 guards. But the diff text
the rest of the analysis reads is built with a plain
git diff <base> -- <paths> (lines 396–400), which emits nothing for
untracked files. Everything derived from that text silently treats a new
untracked file as empty:
- T2 name matching (
names = diff_names(diff_text), line 448): quoted
names (setting paths, op names, flag/command names) that exist only in a
new untracked registry file are never extracted, so e2e tests mentioning
them are not selected. - T1b (
exported = changed_exported_idents(diff_text), line 403):
exported declarations in a new untracked file are never seen, so importer
packages are not added. - Harness detection (the e2e diff at line ~466):
newEnvdefined in a
new untracked e2e helper file is missed, so the rule-4 sample is not
selected.
Verified (laptop probe, script sha256 2b908c49… = current main a1aa07d)
Fixture repo with the real script; base commit contains a test-first e2e
test TestBrandNewSettingFlows mentioning "pool.brandnewsetting". The
change is one new file internal/settings/newreg.go defining that setting:
- Untracked (
git status:?? newreg.go;git diff origin/main -- newreg.gois empty): selector reports "1 changed file(s)", selects T1
forinternal/settingsand the T3 settings guards, but T2 selects only
the generic guardTestEveryDeclaredRouteAnswersOverTheSocket—
TestBrandNewSettingFlowsis not selected. - Same file staged (
git add): T2 selects
TestEveryDeclaredRouteAnswersOverTheSocket|TestBrandNewSettingFlows.
Probe: laptop ~/git/fleet/probe-2026-10-31-laneB-affected/probe2.sh.
Why it matters
The selector's whole purpose (#1966 / TESTING.md tiers) is choosing the
right tests before committing. Test-first work — a committed failing test
waiting on a brand-new implementation/registry file that is still
untracked — is exactly the shape this fleet produces, and in exactly that
moment the selector under-selects: the waiting e2e test does not run, and
nothing in the output says the file's contents were skipped (the header
count even claims the file was considered). CI still runs the full suite,
so this is a local-feedback correctness bug, not a merge-safety hole.
Acceptance criteria
- For an untracked new file under
pkgs/mcpx, its contents feed the same
diff-text analysis as a tracked change (e.g. viagit diff --no-index /dev/null <path>or by intent-to-add), so:- T2 selects e2e tests mentioning names introduced only in an untracked
registry file (the staged/untracked outputs match for the fixture
above); - exported declarations in an untracked file drive T1b importer
selection; newEnvin an untracked e2e file triggers the rule-4 harness sample.
- T2 selects e2e tests mentioning names introduced only in an untracked
- A regression test/fixture covers the untracked case (the staged and
untracked runs of the probe fixture select the same T2 set). - Tracked/staged behaviour is unchanged; deleted-file handling (paths that
no longer exist are excluded from reads) still works.
Activity
dezren39 commentedon Nov 1, 2026
🤖 Agent note · filed
git diff, which is empty for untracked files — pre-commit test-first changes under-select.~/git/fleet/probe-2026-10-31-laneB-affected/probe2.sh(script sha256 2b908c49…, main a1aa07d); queue packetpackets/packet-3320-triage.json18 remaining items
developing-today commentedon Nov 3, 2026
agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 30 (priority/low). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03
dezren39 commentedon Nov 3, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 3, 2026
🤖 Agent note · handed off
opencodedezren39 commentedon Nov 3, 2026
Launched queue task 8618 for execution in the bound OpenCode session
ses_e5e5cab7102ffed8WMSYMvDrAS.dezren39 commentedon Nov 3, 2026
🤖 Agent note — triaged, resolved on current main