From a89aa571140bdba72e2e6b387afa1f940f303eb4 Mon Sep 17 00:00:00 2001 From: Jonathan Borduas Date: Fri, 21 Aug 2026 21:59:37 +0100 Subject: [PATCH] test_architect_sweeps: give doctrine-discriminability's SWEEP a caller -- the one of mine with no excuse I spent an afternoon routing "your sweep has no caller" to other roles, then pointed the audit at my own directory and found four instances. Three have the same mechanical barrier I granted population-leg: prior-art and list-truncation-probe reach the forge, known-negative mutates tools and runs them, and a sweep-caller for any of those would perform the action (#506). doctrine-discriminability has no such barrier. Measured: 1.40s, 0 forge references, 0 write operations. It was uncalled because nobody wired it, and it was mine. Every other check in this file drives a helper on constructed inputs, which unit-checks the predicate and leaves the sweep with no caller. This adds three checks that run dd.main() over the real tree. rc==2 is accepted rather than asserted against, because ESTABLISHED NOTHING is a legitimate outcome on a tree with no history for the subject. Asserting rc==0 would make the suite fail on a shallow clone, which is a caller that breaks on an environment rather than on a defect. The three checks were planted before being trusted, because reasoning about predicates is 0 for 6 in this session while planting is 4 for 4. A sweep returning an undocumented code 3 is caught; one returning 0 while printing nothing is caught; one returning VOID while printing a clean sweep is caught. All three plants failed at least one check. Gates: check-orientation 0, check-tools-index 0, check-goal-conformance 0, gate-selftests 0. Diff is 25 insertions, 0 deletions, read before the gates were run. Filed by ARCHITECT, session c83ecf77. Refs #89, #506, #164, #545. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01RTX4A8KkC9cRRrt17yzjWQ --- tools/test_architect_sweeps.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/test_architect_sweeps.py b/tools/test_architect_sweeps.py index 47130ef..a4b32fb 100644 --- a/tools/test_architect_sweeps.py +++ b/tools/test_architect_sweeps.py @@ -81,6 +81,31 @@ def main(): check("known-negative: and the refusal says so, not 'no finding'", "VOID" in buf2.getvalue() and "established nothing" in buf2.getvalue().lower(), True) + # --- doctrine-discriminability: THE SWEEP, over the real tree. + # ⛔ Every other check in this file drives a helper on constructed inputs. That unit-checks the + # PREDICATE and leaves the SWEEP with no caller -- #89's defect, which this file's author + # spent an afternoon routing to other roles before auditing his own directory and finding + # four instances of it, this one being the only one with no mechanical excuse. + # ⚠ Affordable and safe, measured: 1.40s, 0 forge references, 0 write operations. The other + # three sweeps here reach the forge or mutate tools, and a caller for those would PERFORM + # the action (#506) -- which is why only this one is wired. + import importlib.util as _ilu, io as _io, contextlib as _cl + _sp = _ilu.spec_from_file_location( + "dd", os.path.join(os.path.dirname(os.path.abspath(__file__)), + "architect-sweeps", "doctrine-discriminability.py")) + dd = _ilu.module_from_spec(_sp); _sp.loader.exec_module(dd) + _buf = _io.StringIO() + with _cl.redirect_stdout(_buf): + _rc = dd.main() + _out = _buf.getvalue() + check("discriminability: the sweep RUNS over the real tree", _rc in (0, 1, 2), True) + # ⚠ 2 is ESTABLISHED NOTHING and is a legitimate outcome here -- a tree with no history for the + # subject returns it. Asserting rc==0 would make this suite fail on a shallow clone, which is + # a caller that breaks on an environment rather than on a defect. + check("discriminability: it names the subject it read", "prompts/" in _out or _rc == 2, True) + check("discriminability: a VOID run says so rather than printing a clean sweep", + _rc != 2 or "VOID" in _out or "established nothing" in _out.lower(), True) + print(f"\n{'all checks passed' if not FAILED else f'{FAILED} FAILED'}") return 1 if FAILED else 0