Skip to content

Changed modules hop to their importers, with a drift set and a smoke set, in the selector (batch B3b of #1968) - #2025

Merged
seangalliher merged 7 commits into
mainfrom
feat/ad-1391-b3b-20261202
Dec 2, 2026
Merged

seangalliher merged 7 commits into
mainfrom
feat/ad-1391-b3b-20261202

Conversation

@seangalliher

@seangalliher seangalliher commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Refs #1968

Refs #1967

Batch B3b of the faster-gates work (#1968, part 1): slice S1c1 of the test selector, in its own batch after B3a (#2023) merged. Its first build was blocked in review round 1 (five ordinary-reach findings in the import graph and the body-only classification), its repair in round 2 (three findings in how the graph decides that a call loads a module), its second repair in round 3 (two findings in how a wildcard import was read) and its third repair in round 4 (one finding in how a dotted name the graph cannot place was handled), so this is the four-times-repaired slice. Two brake consults judged the design suspect and allowed one more round each, with a narrow scope and a stop rule; round 5 reviewed the delta only and found one wrong sentence in the build prompt, and a third brake judged the design sound and ruled that the sentence be corrected in a prompt-only commit, with no sixth round. The selector stays shadow-only: no gate, receipt or standing order reads it, and the AD-1270f promotion stays the Captain's decision. Only scripts/select_tests.py and tests/test_ad1270f_impact_selector.py change in code; the rest is the amended build prompt, the trackers and the regenerated ledger pair.

  • Slice S1c1, changed modules and test-side files hop once to their importers; the drift set and the smoke set. Every added or modified .py file under src/probos/ or tests/ keeps its own evidence (the map's contexts for a measured module, a test file's own nodes) and adds one hop of importers: the test files that import it, every test under a conftest.py that imports it, the map's tests of a measured module that imports it; a tests/ helper is followed to its own importers, and one that only leads to other helpers cannot be related. An importer that cannot be related to tests (a script, an unmeasured module), or a tracked .py file that cannot be read, parsed or followed, makes the run fail-broad with unknown-module. The import graph follows import, from (relative names followed as Python follows them) and calls of the two dynamic loaders with a constant name (name=, a relative name with a constant package, a constant fromlist). A call is a loader call by an explicit list of spellings (importlib.import_module, and the builtin loader as __import__, builtins.__import__ or importlib.__import__), read through every binding its name has in any scope (imports, assignments of a loader), so a binding in a function that never runs cannot hide a loader. A wildcard import (static, relative, or a "*" in a constant fromlist) and a constant name it cannot follow make their file doubt. A dotted name that two tracked files claim, or that sits under a tracked regular module, is ambiguous: it is not a target, the graph lists the files that have it (ImportGraph.ambiguous), and while any tracked file is ambiguous every hop is doubt (unknown-module), whatever evidence a path has. The drift set (test files changed since the map's base) is always selected and never counted as unaccounted; a stale context is dropped only when exactly one test file owns it and that file is in the drift set (more than 150 drift files, or a failed listing, is map-stale). tests/test_config.py and tests/test_events.py join every selected run (about 4 s serial; tests/test_runtime.py stays out because it builds a real runtime per test and took about 200 s). The hub patterns, wide-reach and the narrowed deletion and rename rules (S1c2) are not built; each only keeps runs fuller.
  • What review round 1 changed. The first build narrowed a function-body-only edit to the map's contexts. Round 1 showed that this is unsound (a module may call its own function at import, and the capture drops import-time lines), so the narrowing is removed and recorded as the deferred item S1c1-D1 on AD-1391: faster gates: impact-selected Windows tests per change, a nightly full Windows run on main that rebuilds the coverage map and bisects failures, after BF-1030 removes the flakes (fast-tracked) #1968. The round's other four ordinary-reach findings are repaired: constant dynamic-import forms the graph dropped, a drift file's dotted name matching the start of another module's stale context, cycles of test helpers read as relatable, and names Python can import that module_name rejected. One injected-only finding is recorded, not repaired (S1c1-R1: the smoke-set test pins that each smoke file exists, not that git tracks it).
  • What review round 2 changed. Three ordinary-reach findings in the graph's recognition of loader calls, each reproduced in real Python: a "*" in a fromlist (and the static from pkg import *) dropped the submodules that a package's __all__ can name; the builtin loader under its other spellings was not seen; and a flat alias table let a binding in another scope hide a loader. The repair gave the graph its own explicit list and a may-analysis over every scope; the shared helpers and the probe are untouched, and the real-tree graph is identical before and after. A parameter that the change had left unused is deleted. One pre-existing defect outside this slice, found by the same review, is recorded on AD-1391: faster gates: impact-selected Windows tests per change, a nightly full Windows run on main that rebuilds the coverage map and bisects failures, after BF-1030 removes the flakes (fast-tracked) #1968 for the capture slice (S1c1-F4: on Windows the map capture queries coverage by a normalised file name, so a native capture records no contexts).
  • What review round 3 changed. Round 3 showed that round 2's answer for a wildcard (an edge to every direct submodule of its package) was false in two ways, both reproduced in real Python: the target need not be a package (a module file beside a same-named directory loads no child), and __all__ may hold a dotted name that a wildcard call itself loads. A false edge is not safe, because the selector reads any importer as evidence: it turned a fail-broad run into a narrow one that left out a failing test. The brake's decision: a wildcard is doubt and the edge expansion is deleted; ambiguous dotted names are left out of the graph's targets; two false statements (the identity of importlib.__import__ with the builtin loader, and "only adds edges") are corrected; and every statement about Python's import system in the prompt or in a code comment now has a row with a command run in real Python.
  • What review round 4 changed. Round 4 found one ordinary-reach finding in round 3's rule for an ambiguous name: the file was left out of the targets, and the claim that a change to it fails broad rested on the selector's no-evidence rule, which fires only when a path has no evidence at all. A measured file keeps its map contexts, so its change read selected and left out a test that imports its constant (reproduced end to end; the layout is valid, since a package wins over a module of the same name). A missing edge is not doubt. The second brake's decision: the graph lists every file with an ambiguous name, the targets still exclude them, and select treats every hop as doubt while any tracked file is ambiguous. The tree holds no such file (3168 tracked .py files, 3168 distinct names, 0 ambiguous, 0 without a name), so no real hop changes. Seven sentences that said otherwise are rewritten, the blind spot that covered an ambiguous file's relative imports is retired, and two more rows run in real Python (a package beside a module of the same name, and a file whose name holds a dot).
  • What review round 5 changed. No code. The round settled the previous finding (the reviewer re-ran the measured-child scenario: fail-broad, 5 of 5 nodes) and found one wrong sentence in the build prompt: it said that a file whose path has a part holding a dot can only be loaded by path, which holds for a dotted file name (the row that backs it) but not for a dotted directory. A prompt-only commit narrows the sentence, adds a row that runs in real Python for the directory case, and records it as a blind spot with its count (0 of 3,168 tracked files).
  • Left as it is, recorded in the build prompt: a dynamic import whose module name is computed at run time is not followed (22 call sites in the tree; counting them as importers of every module would make every hop the whole suite); a loader passed around as a value (partial, map, getattr, a tuple target, a parameter) is not followed (five references in the tree, all save-and-wrap in tests); module names in strings passed to other APIs (patch targets and the like) are not followed; a name bound to a loader in one scope and to another callable in another, called with a string that names a tracked module, adds a false edge; a package that binds a name without importing its own submodule of that name does the same for from pkg import name; a file under a directory whose name holds a dot is no target in the graph although Python can import it by name when that directory is a source root (the selector treats it as the parent did). Each has a control test or a real-tree count (0 for the last three), and the nightly is the backstop. The guarantee, as the build prompt now states it: one hop where the graph can place and read every name; every known incompleteness is a named blind spot, and the nightly is the backstop.
  • The build prompt prompts/ad-1391-s1c1-module-level-edits.md in its own six commits (the revisions after rounds 1 to 5, and a one-sentence narrowing of the guarantee after the code commit), the PROGRESS.md and DECISIONS.md entries and the regenerated ledger pair.

The probe's output stays byte-identical

The probe (scripts/selection_probe.py, unchanged by this slice) on the pinned window (tip 53fb5cfd, 79 merges since 2026-11-10), rerun on the gated head 0b11025f: exit 0, sha256 769d55c6509a6b2d56b9c3de2ea2ea7ad3479973d2f9cf113f22ce321bb70348, equal to S2a's recorded value, to the Builder's rebuild and to the orchestrator's reproductions on every candidate of this slice.

unparsed .py files at tip: 0
reasons ad1270f: blast-radius=30 change-deleted=1 unknown-module=79
reasons conservative: blast-radius=29 change-deleted=1 data-read-by-code=13 dynamic-import=6 hub=17 process-code=22 storage-code=15 unknown-module=24
reasons optimistic: blast-radius=29 change-deleted=1 dynamic-import=6 process-code=22 storage-code=15 unknown-module=8
reasons s2: blast-radius=29 change-deleted=1 dynamic-import=6 hub=17 process-code=22 storage-code=15 unknown-module=24
AD-1270f rules: full 79/79
S1 conservative (hubs full): full 59/79 (74.7%)
S1 optimistic (hubs measured): full 47/79 (59.5%)
S2 projection (open tracking with children): full 51/79 (64.6%)
DECISION-GATE threshold 70%: INDETERMINATE
S2-GATE threshold 70%: PROCEED

The S2 projection still reads 51 of 79 merges full (64.6%): PROCEED. This slice changes no function the probe calls.

Review

Every review ran on gpt-6.1-sol, passed explicitly on each call and checked against the session's usage records (isAuto false, firstDispatchedModel equal). A round is one completed pass over a frozen candidate. This slice took five rounds, all BLOCKED, and three brake consults (the Architect, read-only, with the design check). Every mutation row of every campaign was killed; the last three repaired candidates were each rebuilt from the contract's pairs by a Builder and equal an independent oracle's blobs.

  • Round 1: BLOCKED. Six findings. Five repaired: the body-only narrowing was unsound and is removed (recorded as the deferred item S1c1-D1); constant dynamic-import forms the graph dropped; a drift file's dotted name matching the start of another module's stale context; cycles of test helpers read as relatable; names Python can import that module_name rejected. One injected-only P3 recorded, not repaired (S1c1-R1).
  • Round 2: BLOCKED. F1 to F3 (P2, ordinary reach, regressions of the parent): a "*" in a fromlist and the static from pkg import * dropped what __all__ can name; the builtin loader under its other spellings was not seen; a flat alias table let a binding in another scope hide a loader. Repaired (an explicit loader list and a may-analysis of bindings). F4 (P2, pre-existing, not a regression): on Windows the map capture queries coverage by a normalised name, so a native capture records no contexts; recorded for the capture slice (S1c1-F4). F5 (P3, size): a parameter the change left unused, deleted.
  • Round 3: BLOCKED. R3-F1 and R3-F2 (P2, ordinary reach): a wildcard import of a module file was credited as an import of the files in a same-named directory beside it (a false importer edge), and __all__ may hold a dotted name that the wildcard call loads itself; R3-F3 and R3-F4 (P3): two false statements. The first brake (Design: suspect: a false edge is false evidence, because the selector reads any importer as evidence) decided: a wildcard is doubt, the edge expansion is deleted, an ambiguous dotted name is not a target, and every statement about Python's import system must have a row run in real Python. All repaired.
  • Round 4: BLOCKED. R4-F1 (P2, ordinary reach, a regression of round 3, not worse than the parent): an ambiguous file was left out of the targets without signalling doubt, and the claim that its change fails broad rested on the no-evidence rule, which fires only when a path has no evidence; a measured file keeps its map contexts, so its change read selected and left out a test that imports its constant (reproduced end to end). The second brake (Design: suspect: a missing edge is not doubt) decided: the graph lists every ambiguous file and select treats every hop as doubt while any exists. Repaired; the round-5 reviewer re-ran the scenario (5 of 5 nodes, fail-broad, unknown-module; round 4: 3 of 5), 12 ambiguity and hop combinations fail broad and 8 unambiguous controls match round 4.
  • Round 5: BLOCKED (a delta review, 18 minutes). One finding, R5-F1 (P3, ordinary reach, a wording regression against round 4): two sentences of the build prompt said that a file whose path has a part holding a dot can only be loaded by path, which is false for a dotted directory part (the row behind it tests a dotted base name). Census on the tree: 0 of 3,168 tracked files; not worse than the parent (the same changed file through the parent selector and this one: unmeasured, both fail broad; measured, both select the same test). The third brake (Design: holds) decided to rescope with the sentences corrected and no sixth round: a prompt-only commit narrows the two sentences to what the row shows, adds a row that runs in real Python for the dotted-directory case (PY-18), records the case as blind spot 13 and states the guarantee: one hop where the graph can place and read every name; every known incompleteness is a named blind spot; the nightly is the backstop. (The brake's wording added "with a census"; five of the thirteen blind spots state no count, so one more prompt-only commit drops those words.) The code, the tests, the trackers and the ledger are exactly what round 5 reviewed.
  • Mutation campaigns. Round 1: M0 and 25 rows. Round 2: M0 and 38 rows. Round 3: M0 and 28 rows. Round 4: 29 runs. Round 5: M0 (287 passed, 2 skipped) and 10 rows, 11 of 11 killed; the other rows stand by a recorded proof (the changed definitions are exactly ImportGraph, import_graph and select; every function and constant a standing row mutates is AST-identical; no test that kills a standing row holds an ambiguous name).
  • Open items, recorded on AD-1391: faster gates: impact-selected Windows tests per change, a nightly full Windows run on main that rebuilds the coverage map and bisects failures, after BF-1030 removes the flakes (fast-tracked) #1968 and not repaired here: S1c1-R1 (the smoke-set test pins that a file exists, not that git tracks it; P3, injected-only); S1c1-R2 (blind spots 10, 11 and 13, each with a real-tree census of 0, plus the wording of module_name's docstring, which holds for the two source roots the graph models); S1c1-D1 (body-only narrowing waits for a capture that keeps import-time lines); S1c1-F4 (for the capture slice). Blind spot 12 is settled by the global doubt.
  • Size findings: 1 in total (round 2, F5, the unused parameter, deleted in the same round); rounds 1, 3, 4 and 5: 0.

Gate

The canonical full gate ran once on the head 0b11025f (tree 598cc774), through scripts/run_test_gate.py with --receipt (label ad-1391-b3b), the interpreter D:\ProbOS\.venv (Python 3.12.13), TEMP on G:, at 8 workers instead of the wrapper's default of 12: the commit charge read 51.0% when the loop started the run, just over the 51% line of the Architect's rule, which gives 8 workers from 51% to 60%.

  • Run 1, 09:07:11Z to 09:49:39Z (commit charge 51.0% at the start and 79.6% at the peak, sampled every 11 seconds): green, exit 0, 57,916 passed and 187 skipped (58,103 tests collected, the receipt's collection total), 0 failed, 0 errors, 8 workers, 0 lost, TEMP volume G:, 42.5 minutes (the pytest run 41.3). Its receipt logs/gates/ad-1391-b3b.receipt.json validates two ways (validate_gate_receipt.py and check_bf1006_receipt.py), its manifest lists no failed test (failed_nodeids is empty) and its tested tree is the head's tree.
  • The slice's own tests, read in that gate's JUnit report: tests/test_ad1270f_impact_selector.py 287 passed and 2 skipped (289 collected; the two skips are the tests that need shipped gate artifacts, which the host does not hold, as in the focused runs), tests/test_ad1391_selection_probe.py 33 of 33, tests/test_ad1391_gate_balance_serial.py 10 of 10 and tests/test_ad1184_ad_ledger.py 33 of 33.
  • The watch of BF-1030: flaky timing and process tests fail about 1 full gate in 9 on an unchanged tree, each costing a 25-minute rerun: make them deterministic or isolate them, and keep a flake record #1967: this head descends from 481c182d, the commit that opened the watch's new window, so the gate is run 2 of 20 of that window (run 1 was batch B3a's); no failure and no same-tree pair so far; the manifests are banked.
  • The interpreter against the lock: of the 156 packages that uv.lock pins and the environment holds, 153 are at the locked version; greenlet is 3.5.0 (locked 3.5.1), playwright 1.59.0 (locked 1.60.0) and onnxruntime 1.25.1 (locked 1.20.1). None of the three is named in a file this change touches.
  • The vessel's data directory listing (55,059 files) is identical before and after the run.
  • The start: the wrapper refuses to start while any other pytest process runs. Another session on this host ran back-to-back test runs (a mutation campaign, about one second between runs) from 08:24Z until about 09:07Z. The loop that starts the gate made 13 attempts from 08:39Z, each started when it saw no pytest process running, and the wrapper's own check about two seconds later decided: 12 were refused and the 13th was admitted at 09:07Z, minutes after those runs ended.

Integration

origin/main is still 8e8a2ee8 (the merge of #2023, batch B3a), the base of this branch, so no merge commit is needed and the gated head is the pushed head. After the real-tip rerun on the gated head (above) nothing else reads the selector: it stays shadow-only.

Size findings: 1

seangalliher and others added 7 commits December 1, 2026 21:27
Round 1 of the review of the module-level-edits slice was blocked by five
ordinary-reach findings in the selector's import graph and its body-only
classification, and it recorded one injected-only test gap. The prompt now
drops the body-only narrowing (every changed module and test-side file hops
once to its importers, because the capture discards import-time lines and no
syntax rule can tell which function bodies run at import), follows the constant
dynamic import forms the graph used to drop (a keyword name, a relative name
with a package, a from-list of submodules) and treats a constant name it cannot
follow as doubt, attributes a stale context only to the one test file that owns
it, counts helpers that only import each other as unrelatable, and accepts any
module path part without a dot. The base is main after the first batch of the
slice pair; the mutation campaign reruns in full; the tracker lines follow the
new behaviour. No code in this commit.

Refs #1968.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Round 2 of the review of the changed-modules slice was blocked by three
findings in how the import graph decides that a call loads a module (a
wildcard in a from-list, the builtin loader under its other spellings, and a
flat alias table that a binding in another scope overwrote), by a leftover
parameter, and by one finding in the map capture that belongs to a later
slice. The prompt now gives the graph its own explicit list of loader
spellings and binding forms, read as a may-analysis over every scope, makes a
wildcard an edge to every direct submodule of its package, removes the unused
parameter, records the loader references the list leaves out (blind spots 8
and 9) and the capture finding for the slice that owns the capture, and adds
five tests and sixteen mutation rows. The rows the repair does not touch
stand on a recorded proof. The base is unchanged. No code in this commit.

Refs #1968.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Round 3 of the review of the changed-modules slice was blocked by two findings
that came from one choice of the second repair: a wildcard import was turned
into an edge to every direct submodule of its package, which is false when the
target is a regular module beside a directory and when a package's list of
exported names holds a dotted name, and a false edge counts as evidence. The
round-three brake judged the design suspect and allowed one more round. The
prompt now makes a wildcard doubt and deletes the edge expansion, leaves a
dotted name that two files claim, or that sits under a regular module, out of
the graph's targets, corrects two statements that were false (the loader
identity and "only adds edges"), gives every statement about Python's import
system a row with a command run in real Python, records further
over-approximations as blind spots with real-tree counts, and replaces the
wildcard tests and mutation rows. The rows the repair leaves alone stand on a
recorded proof. The base is unchanged. No code in this commit.

Refs #1968.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Round 4 of the review of the changed-modules slice was blocked by one finding:
the second repair left a file whose dotted name the graph cannot place out of
the graph's targets, and rested the claim that a change to it runs full on the
rule that a changed path with no evidence runs full. A measured file keeps its
map contexts, so its change read as a narrow run and left out a test that
imports its constant. The second brake judged the design suspect and allowed
one last round. The prompt now gives the graph a field that lists every file
with such a name and makes the selector treat every hop as doubt while any is
listed, keeps the exclusion from the targets, rewrites the sentences that said
otherwise, adds two rows that run real Python (a package beside a module of the
same name, and a file whose name holds a dot), adds three tests, retires blind
spot 12, and states which mutation rows stand, which rerun and which are new.
The last round has its own stop rule. The base is unchanged. No code in this
commit.

Refs #1968.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… 5 (Refs #1968)

Round 5 of the review of the changed-modules slice was blocked by one finding:
a sentence that the last amendment added said that a file whose path has a part
holding a dot can only be loaded by path. That holds for a dotted file name,
which the amendment tested, but not for a dotted directory name: with that
directory as the source root, Python imports the file by an ordinary name. The
tree holds no such path (3168 tracked python files, none with a dotted part),
and the selector treats such a file as the parent did. The third brake judged
the design sound and ruled that the claim be corrected without a sixth round.
The prompt now says only what its row shows, adds a row that runs in real
Python for the dotted-directory case, records that case as a named blind spot
with its count, states the guarantee as one hop where the graph can place and
read every name, with every known incompleteness named and counted and the
nightly as the backstop, and extends the range statements to the new row. No
code, test or tracker changes in this commit.

Refs #1968.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…set, in the selector (Refs #1968)

Slice S1c1 of batch B3 of the faster-gates work, shadow-only. Every added or
modified python file under src/probos or tests now selects its own evidence
and one hop of importers: the test files that import it, every test under a
conftest that imports it, and the map's tests of a measured module that
imports it, following a tests helper on to its own importers. The import graph
comes from every tracked python file. It follows imports and the constant
forms of the two dynamic loaders (a keyword name, a relative name with a
package, a from-list of submodules); a call is a loader call by an explicit
list of spellings, read through every binding its name has in any scope. A
wildcard import, a constant name it cannot follow, and a tracked file it
cannot parse make their file doubt. A dotted name that two files claim, or
that sits under a regular module, is not a target, and while any tracked file
has such a name every hop is doubt: the graph lists those files, and the
selector does not decide what Python loads for them. An importer it cannot
relate to tests (a script, an unmeasured module, or helpers that only import
each other) also makes the run full; a computed name, and a loader passed
around as a value, are recorded blind spots. The test files changed since the
map's capture are always selected and never counted as unaccounted, a stale
context is blamed only on the one test file that owns it, and more than 150
changed test files make the map stale. The config and event tests join every
selected run; the runtime test file stays out because it builds a real runtime
per test and took about 200 seconds. The probe's output on the pinned window
is byte-identical. The trackers and the AD ledger pair follow.

Refs #1968.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ind spots show (Refs #1968)

The last amendment of the build prompt stated the guarantee as one hop where
the graph can place and read every name, with every known incompleteness a
named blind spot with a census. Five of the thirteen blind spots (two hops, a
wide hop, a helper that is both imported and run by path, untracked files, and
the deferred body-only narrowing) state no count, so the sentence claimed more
than section 16 shows. It now says that every known incompleteness is a named
blind spot and that the nightly is the backstop. No code, test or tracker
changes in this commit.

Refs #1968.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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