Skip to content

refactor: migrate every test-file-name detector to autobot_shared.testfile_names (#21078) - #21162

Merged
mrveiss merged 17 commits into
mainfrom
issue-21078-test-filenames
Nov 10, 2026
Merged

mrveiss merged 17 commits into
mainfrom
issue-21078-test-filenames

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Refs #21078

Thinking Path

#21078 asks for one answer to "is this file name a test file?". The canonical predicate landed from #21065 as autobot_shared/testfile_names.py (is_test_filename(name, *, include_js=True)); the issue and the task name it test_file_names, but a module called test_file_names.py would itself match the test-name rule, so it is testfile_names. Each site keeps its directory rule and passes include_js=False where JS specs never counted; the helper needed no new variant. Where the helper is stricter or wider than the old rule it is the issue's intent: the old copies had drifted (some missed conftest.py or tests.py, one used a substring match that skipped latest_x.py).

What Changed

Migrated to is_test_filename (file:symbol):

  • Production: autobot-backend/api/codebase_analytics/api_endpoint_scanner.py (_is_test_file, and the inline .test./.spec. skip in the frontend call scan); autobot-backend/api/codebase_analytics/config_duplication_detector.py (_is_test_or_archive); autobot-backend/code_intelligence/testing_pattern_analyzer.py (is_test_file; caller-supplied test_file_patterns still win, omitted means canonical); autobot-backend/code_analysis/src/testing_coverage_analyzer.py (_is_test_file); autobot-backend/api/analytics_architecture.py (_should_skip_python_file); autobot-backend/services/autoresearch/meta_agent.py (_validate_target); autobot_shared/symbol_forks.py (fork_is_test_file); autobot_shared/api_routing/mount_graph.py (build_graph); autobot_shared/plugin_sdk/loader.py (is_non_production_module).
  • Lint and scripts: tools/lint/check_no_blocking_io_in_async.py, check_no_src_mock_path.py, check_route_deadlines.py, check_getenv_ssot_drift.py, check_git_toplevel_env_scrubbed.py, check_no_local_schemas.py, check_git_write_env_scrubbed.py, check_ci_system_package_provisioning.py, _env_fork_scan.py; tools/lint/canonical/rules/py_banned_route_path.py, py_duplicate_concept.py, py_hardcoded_url.py, py_banned_suffix_filename.py; scripts/audit_api_wiring.py (both sites).
  • Tests and test helpers: the autobot-backend, autobot-slm-backend, autobot_shared and repo_tests guards that carried a copy (_isolated_git_detect, _mocked_config_import, _reach_roots, _audit_action_vocabulary_scope, _import_hermeticity_scope, _registry_catalogue, and the guards named in the issue plus the ones the guard found). _reach_roots_record.py is regenerated.

New guard: repo_tests/test_name_predicate_single_home_21078_test.py (AST detector for endswith("_test.py"), == "conftest.py", ".test." in x), with planted controls (a hand-written predicate is flagged, the canonical module and a call to it are not) and a shrink-only baseline repo_tests/test_name_predicate_baseline_21078.py. Its scope is declared in repo_tests/_reach_declared_scopes.py, split out of reach_scope_claim_17844_test.py because one more entry took that file past 600 lines.

Deferred and left, each in the baseline with its reason:

  • Not edited, per the instruction: none of the listed in-flight files (code_intelligence/python_files.py, problem_dedup.py, problem_query.py, endpoints/stats.py, endpoints/report.py, client_disconnect.py, error_boundaries/, the 21004 test) holds a detector on main.
  • tools/lint/check_no_direct_redis.py: its hook runs on the system interpreter, which the autobot_shared import floor refuses.
  • pipeline-scripts/audit_unwired_trackers.py:82,125: deliberately not canonical (TEST_PATH_FRAGMENTS matches _test./.test. anywhere in a path and excludes /test_ for pytest tmp_path); touching the file trips its flake8 hook (bug(scripts): audit_unwired_trackers.py fails the repo's own hooks (print() and line length), blocking any edit #21164), so the reason is recorded in the baseline header instead.
  • tools/lint/prepush_selection.py:137: matches pytest python_files globs, a different question.
  • tools/lint/canonical/rules/py_celery_private_event_loop.py: the rule scans conftest.py today and migrating would silently exempt it; nothing in its own test requires that, so the baseline reason says so.
  • 5 files whose literal answers another question (test-function name, stem to module mapping, identity of one conftest.py) and about 120 further hand-written copies the guard found outside the issue's list (100-file ceiling): tracked in refactor: migrate the remaining hand-written test-file-name rules the #21078 guard found #21161.

Floor change: none. The floor=329 pin was removed; slm_login_needs_no_users_db_19406_test.py keeps conftest.py in scope, so its floor stays 330.

conftest.py scope, per tool

is_test_filename(name, include_js=..., include_conftest=True) gained a keyword. include_conftest=False keeps conftest.py out of the test class. Every site whose old rule did not name conftest passes it, so no population, floor or census moves. Decision per tool: conftest.py stays checked (real code: hooks, fixtures, env handling) for check_no_blocking_io_in_async, check_getenv_ssot_drift, _env_fork_scan, check_git_toplevel_env_scrubbed, check_git_write_env_scrubbed, check_no_src_mock_path, check_route_deadlines, check_no_local_schemas, check_ci_system_package_provisioning, canonical rules py_hardcoded_url, py_banned_route_path, py_duplicate_concept, py_banned_suffix_filename, scripts/audit_api_wiring.py (both sites), repo_tests/_reach_roots.py, _registry_catalogue, _audit_action_vocabulary_scope, _import_hermeticity_scope, and the guards analytics_metadata_contract_17651, docstring_restatement_17165, embedding_override_19379, enum_hand_copy, no_simulated_command_output_19807, regex_concept_fork_18093, secret_access_check_16982, slm_login_19406, source_scoping_17758, tls_cert_dir_19317, node_roles_declared_producers. Sites whose old rule already exempted conftest.py keep the default (symbol_forks, _isolated_git_detect, _mocked_config_import, loader.is_non_production_module, the a2a / chat_workflow / llm_spend / raw_client_session / slm_agent_deploys / import_under_mocked_config / redis_db / api_key_scopes / chunk_identity / fastapi_validation / inline_lazy / kb_construction / one_fake_* / raw_aiohttp / store_authority / upload_routes / stdlib_logging / service_upsert guards). meta_agent._validate_target also keeps the default: refusing conftest.py as an edit target is the safe direction.

Behaviour changes

  • testfile_names: test_.+ / .+_test became test_.* / .*_test, so test_.py and _test.py are tests again everywhere (the meta-agent target refusal, the plugin loader, mount_graph, api_endpoint_scanner, config_duplication_detector, symbol_forks). Pinned in testfile_names_test.py.
  • plugin_sdk.loader.is_non_production_module also skips a submodule named tests and ignores case; pinned in plugin_sdk/non_production_module_21078_test.py (no tests submodule exists today).
  • analytics_architecture._should_skip_python_file: the old "test_" in name substring match skipped latest_x.py, contest.py, attestation_x.py and similar; only the test_ prefix and _test.py/tests.py names are skipped now, so those production files enter the architecture analysis and its file and pattern totals can rise. No test pins those totals (the only test touching the module, analytics_architecture_regex_19566_test.py, passed).
  • testing_coverage_analyzer._is_test_file: the old re.search on the full path let test_ anywhere in a directory name mark a file as a test; the new rule reads the base name plus tests/ in the path. Files under directories such as latest_results/ or test_dir/ that are not test files are no longer counted as tests. self.test_patterns was removed with no other reader. No test pins its totals (analyzer_construction_15914_test.py passed).
  • testing_pattern_analyzer: with no caller patterns the default is now the canonical rule instead of a list: tests.py was already matched, case-insensitive matching is added; conftest.py is not a test here. self.test_file_patterns is now None by default (no reader found).
  • Frontend .test./.spec. checks (api_endpoint_scanner, the repo_tests frontend scans): now *.test|spec.(js,jsx,ts,tsx,mjs,cjs,vue). git ls-files | grep -E '\.(test|spec)\.' lists 687 files, none outside that extension list, so the list was not widened. Behaviour change: names the old any-extension substring skipped (x.test.mts, .cts, .test.json, a.test.mock.ts) would now be scanned; none is tracked. The one \.(test|spec)\.ts$ site now also skips js, tsx and vue specs.
  • Baseline test: MAX_ENTRIES = 135 and MAX_SITES = 169 pins; the startswith("test_")-only shape is a documented limit with a pinned control (it also tests test-function names across the tree); the remaining drift is tracked in refactor: migrate the remaining hand-written test-file-name rules the #21078 guard found #21161.

Verification

  • Touched guard tests run one file at a time with ~/.venv-python-suite/bin/python -m pytest: all passed (a2a, chat_workflow, services, SLM backend, the repo_tests guards, plugin_load_visibility_test, testfile_names_test, tools/lint tests).
  • repo_tests/test_name_predicate_single_home_21078_test.py, reach_declarations_test.py, reach_scope_claim_17844_test.py: 1304 passed.
  • repo_tests/lint/canonical/rules/test_py_celery_private_event_loop.py and reach_roots_record_18808_test.py: 19 passed.
  • Pre-commit hooks (black, isort, flake8, size guard, hardcoded values) passed on every commit; pre-push fast gate passed. 70 changed files.
  • Full suites are left to CI.

Model Used

Claude Sonnet 5.5

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 990a5a8 and 39e1e6d.

Files ignored due to path filters: 1

  • scripts/python_file_size_known_large.py is excluded by !scripts/python_file_size_known_large.py
Files selected for processing: 75

  • autobot-backend/a2a/capability_enforcement_guard_test.py
  • autobot-backend/api/analytics_architecture.py
  • autobot-backend/api/codebase_analytics/api_endpoint_scanner.py
  • autobot-backend/api/codebase_analytics/config_duplication_detector.py
  • autobot-backend/chat_workflow/governed_identity_producer_test.py
  • autobot-backend/code_analysis/src/testing_coverage_analyzer.py
  • autobot-backend/code_intelligence/analyzer_discovery_one_home_21004_test.py
  • autobot-backend/code_intelligence/testing_pattern_analyzer.py
  • autobot-backend/services/approval_execution_proposer_test.py
  • autobot-backend/services/autoresearch/meta_agent.py
  • autobot-backend/services/llm_spend_call_sites_test.py
  • autobot-backend/tests/test_raw_client_session_ceiling_12992.py
  • autobot-slm-backend/ansible/tests/slm_agent_deploys_source_tree_18548_test.py
  • autobot-slm-backend/services/node_roles_declared_producers_test.py
  • autobot-slm-backend/services/service_upsert_single_home_19021_test.py
  • autobot-slm-backend/tests/stdlib_logging_ratchet_19288_test.py
  • autobot_shared/api_routing/mount_graph.py
  • autobot_shared/import_under_mocked_config_19288_test.py
  • autobot_shared/plugin_sdk/loader.py
  • autobot_shared/plugin_sdk/non_production_module_21078_test.py
  • autobot_shared/redis_management/redis_db_single_table_19232_test.py
  • autobot_shared/symbol_forks.py
  • autobot_shared/testfile_names.py
  • autobot_shared/testfile_names_test.py
  • repo_tests/_audit_action_vocabulary_scope.py
  • repo_tests/_import_hermeticity_scope.py
  • repo_tests/_isolated_git_detect.py
  • repo_tests/_mocked_config_import.py
  • repo_tests/_reach_declared_scopes.py
  • repo_tests/_reach_roots.py
  • repo_tests/_reach_roots_record.py
  • repo_tests/_registry_catalogue.py
  • repo_tests/analytics_metadata_contract_17651_test.py
  • repo_tests/api_key_scopes_are_enforced_16040_test.py
  • repo_tests/chunk_identity_single_home_18142_test.py
  • repo_tests/credential_field_name_only_17336_test.py
  • repo_tests/docstring_restatement_guard_17165_test.py
  • repo_tests/embedding_override_single_writer_19379_test.py
  • repo_tests/enum_hand_copy_guard_test.py
  • repo_tests/fastapi_validation_handler_guard_test.py
  • repo_tests/frontend_api_contract_ratchet_test.py
  • repo_tests/frontend_auth_token_single_reader_17856_test.py
  • repo_tests/frontend_fragmentation_ratchet_test.py
  • repo_tests/inline_lazy_singleton_20889_test.py
  • repo_tests/kb_construction_baseline_18122_test.py
  • repo_tests/no_simulated_command_output_19807_test.py
  • repo_tests/one_fake_async_session_18883_test.py
  • repo_tests/one_fake_redis_pipeline_18991_test.py
  • repo_tests/raw_aiohttp_session_inventory_12979_test.py
  • repo_tests/reach_scope_claim_17844_test.py
  • repo_tests/regex_concept_fork_guard_18093_test.py
  • repo_tests/secret_access_check_is_wired_16982_test.py
  • repo_tests/single_constant_time_compare_20761_test.py
  • repo_tests/slm_login_needs_no_users_db_19406_test.py
  • repo_tests/source_scoping_guard_17758_test.py
  • repo_tests/store_authority_test.py
  • repo_tests/test_name_predicate_baseline_21078.py
  • repo_tests/test_name_predicate_single_home_21078_test.py
  • repo_tests/tls_cert_dir_one_home_19317_test.py
  • repo_tests/upload_routes_call_is_safe_file_guard_19088_test.py
  • scripts/audit_api_wiring.py
  • tools/lint/_env_fork_scan.py
  • tools/lint/canonical/rules/py_banned_route_path.py
  • tools/lint/canonical/rules/py_banned_suffix_filename.py
  • tools/lint/canonical/rules/py_client_disconnect_one_home.py
  • tools/lint/canonical/rules/py_duplicate_concept.py
  • tools/lint/canonical/rules/py_hardcoded_url.py
  • tools/lint/check_ci_system_package_provisioning.py
  • tools/lint/check_getenv_ssot_drift.py
  • tools/lint/check_git_toplevel_env_scrubbed.py
  • tools/lint/check_git_write_env_scrubbed.py
  • tools/lint/check_no_blocking_io_in_async.py
  • tools/lint/check_no_local_schemas.py
  • tools/lint/check_no_src_mock_path.py
  • tools/lint/check_route_deadlines.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) at aa259fd

Read-only review against origin/main...aa259fd0. Nothing was checked out or run. The _reach_declared_scopes.py split and the reach-roots record were compared by AST: no entry was lost and none changed. DECLARED_SCOPES has 139 entries before and 140 after, the one addition being the new guard. REACH_ROOTS has 131 before and 132 after, with the same addition.

Severity file:line Finding Fix
MEDIUM (security-relevant, 1 of 2) autobot_shared/testfile_names.py (_PY_TEST_RE) used by autobot-backend/services/autoresearch/meta_agent.py _validate_target The canonical regex is ^(test_.+|.+_test|tests|conftest)\.py$. The old meta-agent rule was stem.startswith("test_") or stem.endswith("_test"). The regex needs at least one character after test_ and before _test, so test_.py and _test.py used to be refused as meta-agent targets and now pass. The other direction widens, which is the safe side: conftest.py, tests.py and any case variant are now refused as well. The same two degenerate names also narrow plugin_sdk.loader.is_non_production_module (old: name.startswith("test_") or endswith("_test"), so the module names test_ and _test) and the mount_graph, api_endpoint_scanner, config_duplication_detector and symbol_forks filters. No real file has these names today, so there is no live exposure. The change is real and unrecorded. Change test_.+ to test_.* and .+_test to .*_test in the canonical regex. That restores exact parity for every caller in one place, and a degenerate-name control can go in testfile_names tests.
MEDIUM autobot_shared/plugin_sdk/loader.py:124 is_non_production_module now also skips a submodule named tests, and matches case-insensitively. This is only the plugin_sdk alias-canonicalisation loop over the package's own submodules, not plugin code loading. No tests module exists there, and the widening is the safe direction. The docstring says "the canonical rule decides" without stating that the set changed. Add "tests" to the parametrised cases in plugin_load_visibility_test.py so the widening is pinned.
MEDIUM about 12 lint tools and guards: tools/lint/check_no_blocking_io_in_async.py, check_getenv_ssot_drift.py, check_no_src_mock_path.py, check_route_deadlines.py, check_git_toplevel_env_scrubbed.py, check_git_write_env_scrubbed.py, canonical/rules/py_hardcoded_url.py, py_banned_route_path.py, py_banned_suffix_filename.py, py_duplicate_concept.py, repo_tests/_reach_roots.py, and others These tools never treated conftest.py as a test (they matched only _test.py and/or test_ prefix). The canonical rule does, so about 40 tracked conftest.py files silently leave their population. They are no longer checked for blocking IO in async, hardcoded URLs, getenv drift, unscrubbed git env and so on. The PR body says only the slm_login floor (330 to 329) moved, but this is a population change in every one of those tools, hidden because they use min_fraction or have no floor. State the conftest.py exemption per tool in the PR body. For tools where conftest should stay in scope, e.g. check_getenv_ssot_drift, check_no_blocking_io_in_async and py_hardcoded_url, add or name == "conftest.py" back, or run them once on the conftest files and record the result.
MEDIUM autobot-backend/api/analytics_architecture.py:~463 The old rule was "test_" in py_file.name, a substring match. It skipped latest_x.py, attestation_x.py, contest.py and similar. The new rule matches only the test_ prefix. Production files with test_ mid-name are now analysed, so the architecture analytics numbers move. This is a bug fix, but it is a behaviour change and include_js=False hides it. Say so in the PR body and confirm the endpoint's expected totals are not pinned by a test.
MEDIUM autobot-backend/code_analysis/src/testing_coverage_analyzer.py:~222 The old patterns used re.search on the full path. test_.*\.py$ matched .../latest_results/foo.py or /x/test_dir/foo.py, because test_ anywhere in the path counted. The new rule matches the base name, plus "tests/" in path_str. The set narrows (directories containing test_) and conftest.py is added. self.test_patterns is deleted, and no other reader exists (grep on the head ref). Note the narrowing in the PR body. The base-name behaviour is the correct one.
LOW autobot-backend/code_intelligence/testing_pattern_analyzer.py:350 Caller patterns still win, and [] falls through to canonical exactly as before. The default now also treats conftest.py as a test, and matching is case-insensitive. self.test_file_patterns is now None by default instead of the list; the grep found no reader. None needed beyond the PR-body note.
LOW api_endpoint_scanner.py:~1009, repo_tests/* frontend scans ".test." in name and ".spec." in name (any extension) become *.test|spec.(js,jsx,ts,tsx,mjs,cjs,vue). Names such as x.test.mts, .cts or .test.json, or a.test.mock.ts, used to be skipped and are now scanned. The one that used \.(test|spec)\.ts$ widens the skip set (it now covers js, tsx and vue). Check that no tracked frontend file matches the old but not the new form (git ls-files '*.test.*' '*.spec.*' against the extension list).
LOW repo_tests/test_name_predicate_baseline_21078.py Per-file and countable (135 entries, each with a count). Shrink-only is enforced in one direction: test_the_baseline_only_shrinks fails when a file holds fewer sites than listed, and a new file or a higher count fails the first test. Nothing pins the entry total, so a human edit can add an entry without any test noticing. The NOT_YET_MIGRATED group has one blanket reason for about 128 files. Add assert len(BASELINE) <= <N> and assert sum(BASELINE.values()) <= <M> with the current values, so adding or raising an entry fails. Say "tracked in #21161" in the file.
LOW repo_tests/test_name_predicate_single_home_21078_test.py:~95 The detector is non-vacuous: it has planted controls for endswith, tuple, conftest, .test./.spec., the full copy, a canonical call, a docstring mention and a directory rule, plus an independent reference=_swept_count with min_fraction=0.98. The reach scope holds: its 11 roots match the REACH_ROOTS record and DECLARED_SCOPES exactly. The blind spot is the rule shapes it cannot see: startswith("test_")-only copies, regexes such as test_.*\.py, and endswith("test.py"). About 120 left is therefore an undercount of the drift, and a new startswith("test_") rule still passes. Add startswith("test_") on a name-like variable (or on .name/.stem) as a flagged shape with a control, or state the limit in the docstring.
LOW repo_tests/test_name_predicate_baseline_21078.py:31 (celery entry) The reason says the rule's own test "requires that file [tasks/conftest.py] to be scanned". The rule test (test_py_celery_private_event_loop.py) never mentions conftest or tasks/. Its whole-tree test builds its own exclusion (_test.py, tests/, test_), so a rule that skipped conftest.py would still pass it. The deliberate difference is true (the rule currently scans conftest.py), but nothing requires it. Reword to "the rule scans conftest.py today; migrating would silently exempt it (#21078)".
LOW pipeline-scripts/audit_unwired_trackers.py:82,125 The stated reason is true: TEST_PATH_FRAGMENTS has _test. and .test. anywhere in any extension, and /test_ is deliberately excluded because pytest tmp_path dirs embed test_<name>/. The canonical rule would change that. The detector cannot see this site, so it is in no baseline and the reason lives only in the PR text. Add a one-line comment in the file pointing at testfile_names and the reason.
OK tools/lint/check_no_direct_redis.py, autobot-infrastructure/shared/scripts/hooks/pre-commit-no-direct-redis The reason is true. The hook is language: script and runs python3 -m tools.lint.check_no_direct_redis. autobot_shared/__init__ calls require_supported_python() against the .python-version floor (3.14), and the system python3 here is 3.10.12. The tool also deliberately scans test_* scripts (header lines 40-41). The other migrated tools are language: python under default_language_version: python3.14, so the new autobot_shared import is safe there. None.
OK slm_login floor 330 to 329 Explained by the root autobot-slm-backend/conftest.py now being classed as a test. I did not find a second floor or census that moved without a pin, but the unpinned moves are the conftest population changes above. None.
OK Refs #21078 Correct. About 120 sites are left and tracked in #21161, so Closes would be wrong. None.

Verdict: CHANGES. The restoring fix for the degenerate names is one character each in the canonical regex. The rest is documentation of behaviour changes (conftest exemptions, analytics_architecture substring, testing_coverage_analyzer path matching), a total pin on the baseline, and one reason wording.

@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) at be23b6a
Verdict: CHANGES NEEDED (0 blocking)

Read-only, against origin/main...be23b6a87b, covering the commit since my last pass (657be662e1) and the main merge. Nothing was checked out or run.

Fixed since the last pass, verified in code:

  • Degenerate names: testfile_names.py regex is now ^(test_.*|.*_test|tests|conftest)\.py$, with testfile_names_test.py::test_degenerate_names_are_tests (test_.py, _test.py). Exact parity for meta_agent, plugin_sdk.loader, mount_graph and the others.
  • conftest.py population: new include_conftest=False keyword, passed at 34 call sites across the lint tools and guards that never treated conftest.py as a test, including check_getenv_ssot_drift, check_no_blocking_io_in_async, py_hardcoded_url, analytics_architecture. The floor=329 pin in slm_login_needs_no_users_db_19406_test.py is gone because the population is back to 330.
  • plugin_sdk: non_production_module_21078_test.py pins the tests and case-insensitive widening.
  • Baseline: test_the_baseline_itself_cannot_grow (MAX_ENTRIES=135, MAX_SITES=169); the detector blind spot is documented and pinned by test_a_startswith_only_rule_is_the_documented_blind_spot; the celery reason is reworded; the audit_unwired_trackers reason is recorded in the baseline header.
# Severity File:line Issue Fix
1 MED PR body, "Floor change" paragraph The body still says slm_login_needs_no_users_db_19406_test.py pins floor=329. The pin was removed in 657be662e1, so the body states something the code no longer does. Delete that paragraph, replace it with the include_conftest rule.
2 MED PR body, deferred list The celery bullet still says the rule's own test "requires a conftest.py under tasks/ to be scanned"; the code and baseline now say that is not required. The body also does not mention the stricter analytics_architecture change (old "test_" in name substring, so latest_x.py and contest.py were skipped and are now analysed), the testing_coverage_analyzer narrowing (old regex matched test_ anywhere in the path), or the widened JS skip set (.test.mts, .test.json). Requested in the previous review; not done. Add one line each; confirm no endpoint total is pinned by a test for analytics_architecture.
3 LOW autobot_shared/testfile_names.py docstring, "Callers that stay separate" Stale. The three listed callers (_is_test_file, _is_test_or_archive, is_test_file) are migrated in this PR. Replace with the real remaining set: the baseline's deliberate entries and #21161.
4 info tools/lint/check_no_direct_redis.py Still deliberately unmigrated (system-interpreter floor). Reason holds. None.

CodeRabbit threads: 0 inline review threads; only the summary comment. Nothing needs an answer.
AC coverage (Closes PRs only): not applicable, the PR says Refs #21078; about 120 sites remain and are tracked in #21161.
Main-merge commits: clean. be23b6a87b resolves one conflict, scripts/python_file_size_known_large.py (audit_api_wiring.py ceiling 894/883 to 882), and combines the frontend_call_paths import from main with the testfile_names import in scripts/audit_api_wiring.py; nothing else.

@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Review findings addressed in be23b6a (fix commit 657be66, then merged with current main).

Row Finding Resolution
1 MED test_.+ / .+_test Regex is test_.* / .*_test in autobot_shared/testfile_names.py; test_degenerate_names_are_tests in autobot_shared/testfile_names_test.py
2 MED tests submodule skip Pinned, with test_, _test and case variants, in new autobot_shared/plugin_sdk/non_production_module_21078_test.py (plugin_load_visibility_test.py is at its 750-line ceiling); loader docstring states the change
3 MED conftest.py scope is_test_filename(..., include_conftest=False) added to the one helper; every site whose old rule lacked conftest passes it, so conftest stays checked in all of them (blocking-io, getenv-drift, hardcoded-url, git-env-scrub, route-deadlines, no-src-mock-path, _reach_roots, the rest listed in the PR body). The slm_login floor=329 pin is removed (floor stays 330). No floor or census moves. test_include_conftest_false_keeps_conftest_in_a_tools_population pins the keyword
4 MED analytics_architecture, testing_coverage_analyzer Both behaviour changes documented in the PR body; no test pins the totals (analytics_architecture_regex_19566_test.py and analyzer_construction_15914_test.py pass)
5a LOW testing_pattern_analyzer default Documented in the PR body
5b LOW frontend extension list 687 tracked .test./.spec. files, 0 outside js,jsx,ts,tsx,mjs,cjs,vue; list not widened
5c LOW baseline totals MAX_ENTRIES = 135, MAX_SITES = 169 and test_the_baseline_itself_cannot_grow in the guard; baseline header points at #21161
5d LOW startswith("test_") shape Limit stated in the guard header and pinned by test_a_startswith_only_rule_is_the_documented_blind_spot (flagging it by shape would count test-function names across the tree)
5e LOW celery baseline reason Reworded: the rule scans conftest.py today, migrating would silently exempt it
5f LOW audit_unwired_trackers.py:82,125 Not touched: the file fails its flake8 hook (#21164). The reason is in the baseline header instead

Also: scripts/python_file_size_known_large.py conflict with main resolved (audit_api_wiring.py 882).

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Second review (comment 6720217071) folded in at 4baf994.

# Finding Resolution
1 MED Stale floor=329 claim in the PR body Body corrected: no floor moves, the pin was removed and the slm_login floor stays 330
2 MED Behaviour changes undocumented, celery bullet stale Body now lists the analytics_architecture substring change, the testing_coverage_analyzer narrowing, the widened JS skip set, the testing_pattern_analyzer default, and the corrected celery reason; no endpoint total is pinned by a test
3 LOW Stale "Callers that stay separate" docstring in testfile_names.py Replaced with the baseline's deliberate entries and #21161

@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) at 59a946c
Verdict: APPROVE (0 blocking)

Delta review from the previous verdict (reviewed head be23b6a) to 59a946c. Read-only; nothing was checked out or run.

# Severity File:line Issue Fix
1 MED (prior) PR body, "Floor change" FIXED. Body now reads: "Floor change: none. The floor=329 pin was removed; slm_login_needs_no_users_db_19406_test.py keeps conftest.py in scope, so its floor stays 330." none
2 MED (prior) PR body, celery bullet FIXED. Now: "the rule scans conftest.py today and migrating would silently exempt it; nothing in its own test requires that, so the baseline reason says so." none
2b MED (prior) PR body, behaviour changes FIXED. The "Behaviour changes" section now covers the analytics_architecture substring change (latest_x.py, contest.py, "No test pins those totals"), the testing_coverage_analyzer narrowing, testing_pattern_analyzer, the loader widening, and the .test.mts/.cts/.test.json names that would now be scanned (none tracked). none
3 LOW (prior) autobot_shared/testfile_names.py:21-24 FIXED in 4baf994. The stale list is replaced by the baseline entries (repo_tests/test_name_predicate_baseline_21078.py, which exists and names audit_unwired_trackers and check_no_direct_redis) plus #21161. none
4 info tools/lint/check_no_direct_redis.py Still deliberately unmigrated; reason holds. none

New problems in the delta: none. The only author commit is 4baf994 (docstring only, 4 lines in one file). The rest is the main merge bringing in #15738 content.

CodeRabbit threads: 0 inline review threads. The only CodeRabbit comment is a rate-limit notice, so there is nothing to answer.
AC coverage (Closes PRs only): not applicable. The PR says Refs #21078, and about 120 sites remain, tracked in #21161.
Main-merge commits: clean. git show --cc 59a946c2fd is empty, so the merge adds nothing beyond main's own content. ecdcdeda79 is main's merge of #15738.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Auto-sync: merging main into issue-21078-test-filenames conflicts

The sync aborted the merge and pushed nothing. Conflicts are information, so it never resolves one itself. Below, for each conflicted file, are the commits that touched it on each side since the merge base bc9cd5f2f8. Merge main in yourself and push; the label clears on the first run that finds this branch 0 behind.

repo_tests/reach_scope_claim_17844_test.py

side commit subject issue refs
main eb0ccc38fc Merge main into issue-20761-api-key-compare (auto-sync) [skip ci] none
main 1fd6964fd3 fix(auth): the constant-time compare guard declares its reach floor, scope and roots (#20761) #20761
this branch 5d6c08c7eb refactor: move the reach scope record to its own module and register the test-name guard (#21078) #21078

@mrveiss

mrveiss commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

Delta review at 3d154ec after the main merge: APPROVE. The merge commit has no combined hunks, so every file came cleanly from one side. The own commit routes main's two new test-name rules (analyzer_discovery_one_home_21004_test.py, py_client_disconnect_one_home.py) through the canonical testfile_names helper, so the canonical home grows, not a second detector.

@github-actions github-actions Bot added the sync-conflict Set by the branch sync (#19548) label Nov 9, 2026
@mrveiss

mrveiss commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

Merge check at 9ac080a (merges fe97219 and 9ac080a): MERGE-OK.

  • The one textual conflict, reach_scope_claim_17844_test.py, was resolved by moving DECLARED_SCOPES into the new _reach_declared_scopes.py, the size split. A key-by-key comparison shows all 139 of main's entries present (including single-constant-time-compare) plus this PR's test-name-predicate-single-home-21078, and none dropped.
  • _reach_roots_record, the size baseline and analyzer_discovery auto-merged with both sides kept, and no number was hand-edited. The second merge has no combined hunks.
  • Main's hand-written test-name rule in single_constant_time_compare_20761_test now goes through the canonical is_test_filename(..., include_js=False, include_conftest=False). Its population now also includes tests.py, which is the canonical definition.

@mrveiss

mrveiss commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

Delta review at 39e1e6d (T103 ejection fix): APPROVE. check_ci_system_package_provisioning.py loads autobot_shared/testfile_names.py from its path with importlib.util, so the autobot_shared package __init__ and its non-stdlib imports never run, and the checker stays stdlib-only, as test_the_checker_needs_no_third_party_import requires. The helper itself imports only re. There is still exactly one test-name predicate, with no inlined copy.

mrveiss added a commit that referenced this pull request Nov 10, 2026
@mrveiss
mrveiss merged commit ea2e231 into main Nov 10, 2026
52 of 75 checks passed
@mrveiss
mrveiss deleted the issue-21078-test-filenames branch November 10, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:M4.9 One definition per concept refactor sync-conflict Set by the branch sync (#19548)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant