Skip to content

Select explicit Python function targets with supplied diff context - #38

Merged
Jacob-Met merged 2 commits into
mainfrom
estate-a219f250962c/testpilot-explicit-targets
Oct 8, 2026
Merged

Jacob-Met merged 2 commits into
mainfrom
estate-a219f250962c/testpilot-explicit-targets

Conversation

@Jacob-Met

@Jacob-Met Jacob-Met commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Why

A module constant or default binding can change a function's behavior without changing its body. The existing automatic selector then returns no functions and run reports no_changes. Developers can now deliberately choose the functions they want tests for:

python -m testpilot targets --repo . --diff change.diff --target settings.py::accepts --json
python -m testpilot run --repo . --diff change.diff --target settings.py::accepts --script responses --out out/selected

Closes #30.

What changes

  • Repeated --target path.py::qualname on targets and run selects exactly the requested functions in caller order, deduplicating a resolved source/function identity at its first occurrence.
  • The resolver reuses current containment, Python source decoding and AST discovery. Missing, ambiguous, test, outside and non-Python targets refuse before tests or model calls. Selection does not import source.
  • Every explicit-mode planner, editor and repair request receives the exact loaded diff and current selected source. Explicit-only selection metadata records caller intent and diff context; Markdown/HTML identify caller-selected functions.
  • Without the option, automatic selection, prompts and output schema remain unchanged. The existing changed_functions records retain genuine added-line lists; selecting an unchanged body does not manufacture changed-line coverage.

The workflow makes no dependency-completeness or live-model-quality claim. Usage and limitations include the Python API and saved-report contract. The additive metadata contract was posted to #26 before editing.

Validation and receiving

All 12 new tests pass on existing Python 3.12.8. Independent receiving on Python 3.13.7 accepts all six groups, with 23 real CLI/Git/pytest commands, three actual ScriptedModel calls including repair and exact context in each, 10 refusals before calls/output, Unicode/Latin-1 read-only preview, default JSON parity, and a generated patch that applies and runs three tests successfully.

The 63-file receiving packet retains the original unsupported-option/no_changes controls, exact source history, actual messages and outputs, independent ACCEPT, and paired native baseline limitations. The broader selected e228 run passed 126 tests and 18 subtests; two untouched non-UTF-8 filename fixtures hit macOS errno 92 and reproduce on the untouched baseline. The current 631 composition passed 58 tests and 18 subtests with one existing skip; one untouched recheck expected-count assertion also reproduces on its exact parent. These raw failures remain included. This is not a claim that the full native canonical suite is green; hosted complete-tree CI is reported separately.

Current composition

Ready head is 34d647d0921964c9336d10d365b59b772b667caa, tree dbceed21458db38797185b34c83ff2dd8abc3d07. Its ordered parents preserve the first publication e971f4490e9a6c8c23d9e645e47232632cd015e3 and current canonical 7f44c4f134f4d56d37dd14c7c2d2aaa3c8c8749e.

Six author leaves remain byte-identical to accepted native 00b63c8e03cc515160da1202331224167d12d253. The two shared files retain both owners' exact changes: the loop carries PR #34's imports and complete 2,001-byte write_outputs implementation verbatim; README retains both sections. Reversing only those owner additions recovers our accepted source exactly. Current recheck, raw loader, sandbox, model/client, fence/patch, allocation, coverage and module-identity code remain intact.

The current source map and qualification distinguish this composition from the native 631 receiving. No new native execution of the combined current source is claimed. Hosted complete-tree CI and independent public receiving are separate gates.

The complete 1,132-leaf tree was read back by Git blob SHA, mode and type. All 1,059 unrelated current-parent leaves and all 63 original receiving files remain byte-for-byte preserved. Scoped native history is retained as evidence; it is not merged as canonical repository ancestry.

Allow repeated --target path.py::qualname on targets and run, selecting only the caller's requested functions. Preserve automatic selection and default outputs, use native containment/encoding/discovery, retain genuine added-line coverage, and provide the exact loaded diff plus selected source to planning, generation and repair.

Publish the eight independently received source/test/doc paths on current full parent f3b2135, preserving all 1037 unrelated parent leaves. Retain the 63-file receiving packet, original negative controls, paired native baseline limitations, complete scoped source history, actual model messages and independent native acceptance.

Native accepted source: 00b63c8e03cc515160da1202331224167d12d253. The current parent's module-identity correction remains intact. Hosted full-tree CI is separate from the pinned native receiving.
Preserve the accepted target resolver, prompt and selection changes while carrying the current owner's imports and complete write_outputs implementation byte-for-byte. Preserve both README additions, all unrelated current-parent leaves, and every original source/receiving artifact. Retain e971 publication ancestry and the current 7f44 parent; add a compact exact source mapping for separate combined-tree receiving.
@Jacob-Met
Jacob-Met merged commit eacb990 into main Oct 8, 2026
1 check passed
@Jacob-Met
Jacob-Met deleted the estate-a219f250962c/testpilot-explicit-targets branch October 19, 2026 02:58
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.

[claim] Choose explicit Python function targets for test generation

1 participant