Skip to content

fix(mcpx): affected-tests changed_test_names still diff-only — untracked e2e tests lose changed-test prioritization at the T2 budget (PR #4398 residual of #3320) #10874

Closed

Description

@dezren39

Finding

PR #4398 (merge 545be40ba6f4, closes #3320) taught pkgs/mcpx/scripts/affected-tests.py to render untracked files as added diff lines for the T1b exported-identifier scan, the T2 registry-name scan, and the e2e newEnv harness check. One diff consumer was left unpatched: changed_test_names still derives its changed-line ranges solely from git diff, which is silent about untracked files — so tests in an untracked e2e file never receive the changed-test prioritization the function exists to provide.

Evidence (verified on current main b337e1ac8b41f4c3b48e9ef47acf9e5c4d06bf0f)

  • pkgs/mcpx/scripts/affected-tests.py:266 — changed_test_names(mcpx, e2e_rel_paths, root, base); at :280 it runs git diff --unified=0 <base> -- pkgs/mcpx/<path> per e2e file and builds test line ranges from the hunks. For an untracked file git diff prints nothing, the range list is empty, and the function continues past the file.
  • pkgs/mcpx/scripts/affected-tests.py:550 — the call site passes edited_e2e_all, which includes untracked e2e files (they are in the change set via git ls-files --others), so untracked files reach the function and are silently dropped by it.
  • pkgs/mcpx/scripts/affected-tests.py:584 — prioritized = [t for t in changed_e2e_tests ...] is placed ahead of ranked name matches and the alphabetical fill precisely so changed tests are not truncated away at the 15-test T2 budget (see the comment block above it). Untracked-file tests miss that protection.
  • The untracked render added by fix(mcpx): include untracked contents in affected-tests (#3320) #4398 is applied at :467 (T1b/T2 diff text) and :547 (e2e newEnv diff) — never to changed_test_names.
  • Partial mitigation already present: the edited_e2e all-names path adds every test of an edited e2e file (untracked included) to e2e_selected, but only in the final alphabetical segment of the ordering. Selection parity therefore holds in small runs — the PR's own parity tests in pkgs/mcpx/scripts/tests/test_affected_untracked.py pass — and breaks exactly when the T2 budget truncates: a staged new e2e file's tests are prioritized, the identical untracked file's tests can be cut. (CI runs the full suite either way; this is local-selector fidelity, the same contract mcpx(affected-tests): untracked new files are counted as changed but their contents never reach the diff-text analysis — T2 name matching, T1b and harness detection silently skip them pre-commit #3320 fixed for the other three consumers.)
  • The parity tests added by fix(mcpx): include untracked contents in affected-tests (#3320) #4398 assert the T1b importer command, the T2 registry run-set, and the harness sample for staged vs untracked — none asserts changed-test prioritization for an untracked e2e file under a full T2 budget.

Why it matters

#3320's contract is staged/untracked parity for the selector's content-derived decisions. The one remaining consumer silently treats an untracked e2e file's tests as unedited, so the exact regression test a developer just wrote in a new file is the one the local selector may drop when the budget is tight — the failure mode the prioritization code was added to prevent.

Acceptance criteria

  • changed_test_names (or its call site) accounts for untracked e2e files — e.g. an untracked file's tests are treated as changed (whole-file added ranges), matching the staged-new-file result.
  • A parity regression in pkgs/mcpx/scripts/tests/test_affected_untracked.py: identical e2e content staged vs untracked yields the same prioritized ordering, including a scenario where the T2 selection exceeds the 15-test budget.
  • Existing selector tests keep passing (python3 -m unittest discover -s pkgs/mcpx/scripts/tests).

Filed by pr-diff-review-b from the review of PR #4398. Dedupe: gh search issues for changed_test_names returned nothing; affected-tests untracked returned only the closed parent #3320, whose fix this residual survives.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/lowNice to have; do when convenient
    on Nov 16, 2026
  2. developing-today commented on Nov 16, 2026

    @developing-today
    Contributor
  3. added
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    on Nov 16, 2026
  4. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    Agent: pr-diff-review-b
    State: filed
    Repo: developing-today/code
    Source PR: #4398 (MERGED, head 66f8109, merge 545be40, ancestor-verified on main, compare behind) — closes #3320 (CLOSED, verified)
    Finding: PR #4398 rendered untracked files as added diff lines for the T1b, T2 registry-name and newEnv harness scans, but changed_test_names (affected-tests.py:266, git diff --unified=0 at :280) still sees no hunks for untracked e2e files, so their tests never enter the prioritized segment (:584) and can be truncated away at the 15-test T2 budget while a staged identical file's tests are protected.
    Verified against main: b337e1a (contents-API read of pkgs/mcpx/scripts/affected-tests.py; dedupe: "changed_test_names" -> nothing; "affected-tests untracked" -> only closed #3320)
    Evidence: hidden_files/pr-review-2026-11-16-1718-code-b/issue-4398-changed-test-names-body.md + pr-4398.diff + pr-4398-view.json

    kind/bug,task/triage,status/needs-triage,source/pr-diff-review,priority/low,queue/queued,app/mcpx

  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    effort/sSmall: expected under 2 hours of work
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 16, 2026
  6. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  7. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged

  8. added a commit that references this issue on Nov 16, 2026
  9. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

  10. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: done (already_done — duplicate follow-on)
    task: 17562 (queue repo-health-code-pilot, lane any-a, worker repo-worker-code)
    issue: #10874

    This follow-on packet (enqueued from task 17555's triage at 2026-11-16T23:43:17Z) duplicates work task 17555 itself completed in the same session: the changed_test_names untracked fix was implemented, regression-tested, and merged as PR #10876 (MERGED 2026-11-16T23:41:42Z, merge commit 5c64e99 — gh-verified by this lane), and issue #10874 is CLOSED with status:done. No further work exists for this packet; task 17562 completes as already_done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions