Skip to content

fix(backend): drop the last two references to a file deleted in WS-G cleanup - #12748

Merged
undivisible merged 2 commits into
BasedHardware:mainfrom
aryanorastar:fix/wsg-stale-d-test-models-refs
Sep 5, 2026
Merged

undivisible merged 2 commits into
BasedHardware:mainfrom
aryanorastar:fix/wsg-stale-d-test-models-refs

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #12740.

What changed and why

a7bc5fd0c2 ("chore(backend): remove dead modules and orphaned WS-G promotion family") deleted backend/scripts/stt/d_test_models.py. #12740 swept the CI guardrail references to files that cleanup removed — the slow_guardrail_manifest.txt entry that was failing the Backend unit suite. Two references were left behind:

backend/pyrightconfig.json:62                      "scripts/stt/d_test_models.py",
backend/tests/.import_time_side_effects_legacy:34  backend/scripts/stt/d_test_models.py

The pyright one is the visible symptom. Every backend type check prints this before doing its work:

File or directory ".../backend/scripts/stt/d_test_models.py" does not exist.

It does not fail the run, and that is the reason to fix it rather than leave it: a config that always reports one missing include is a config where the next genuinely missing include reads as normal output. The same argument #12740 made for the manifest applies here, one layer down.

Scope

Audited both files rather than deleting only the entry that surfaced, since the point of a follow-up to a partial sweep is not to be partial again:

  • .import_time_side_effects_legacy — 29 non-comment entries, this is the only one whose path is absent from the tree.
  • pyrightconfig.json — every non-glob path checked. Besides this entry only .venv and pretrained_models are absent, and both are gitignored directories that are correctly excluded rather than stale.

So this is the complete remainder, not another instalment.

How it was verified

cd backend && PYRIGHT_PYTHON=.venv/bin/python bash scripts/typecheck.sh
0 errors, 5642 warnings, 0 informations

No missing-file line in the output. pyrightconfig.json still parses as valid JSON.

Two deletions, no behaviour change: d_test_models.py does not exist, so nothing was being type-checked or allow-listed through either entry.

Failure-Class: none

Review in cubic

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@Git-on-my-level

Copy link
Copy Markdown
Member

Verified both deletions against the head tree — this closes out the WS-G reference sweep cleanly.

  • backend/pyrightconfig.json — the "scripts/stt/d_test_models.py" include is gone, the file still parses as valid JSON, and every remaining non-glob include path resolves to a real file at head, so the config no longer trains people to ignore a permanent missing-file line before every backend type check.
  • backend/tests/.import_time_side_effects_legacy — the backend/scripts/stt/d_test_models.py allowlist entry is gone, and all 28 remaining entries resolve to files present at head.

Cross-checks: d_test_models.py is indeed absent from backend/scripts/stt/ on main (deleted in a7bc5fd0c2, the WS-G cleanup that #12740 followed up on), and a repo-wide search at this head finds zero remaining references — so the "complete remainder, not another instalment" claim in the description holds. Zero behavior change by construction, since both entries pointed at a file that no longer exists.

CI is green on this head, including Backend Hermetic Merge Gate, Backend unit suite, and Hygiene.

Thanks for auditing both files end-to-end instead of just deleting the entry that surfaced — that's exactly the right instinct for a follow-up to a partial sweep. Ready from my side.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution backend Backend Task (python) labels Sep 4, 2026

@undivisible undivisible left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: approve

Complete remainder of the #12740 / WS-G stale-ref sweep: drops the two leftover d_test_models.py entries from pyrightconfig.json and .import_time_side_effects_legacy. No behavior change (file already gone). CI green (Backend unit suite, hermetic e2e, OpenAPI, cubic).

Non-blocking

Update the legacy allowlist header Total: 29 entries → 28 so it matches the file (cubic P3). Happy to re-check if you push that one-liner.

@undivisible

Copy link
Copy Markdown
Collaborator

Follow-up on the approve: please still land the one-liner # Total: 29 entries. → 28 before merge so the allowlist header matches the file (same class of stale signal this PR is cleaning up).

@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Fixed on c0f06b186b — good catch, and it is the same defect class as the rest of the PR.

backend/tests/.import_time_side_effects_legacy carried # Total: 29 entries. in its own header while the list held 28 after the removal. A header nobody recomputes stops describing the file, which is exactly what the pyright include and the manifest entry were doing when they kept pointing at a script that had been deleted. Leaving it would have shipped a fresh stale signal inside a PR whose whole point is clearing them.

Verified rather than assumed:

$ grep -n "Total:" backend/tests/.import_time_side_effects_legacy
11:# Total: 28 entries.

$ grep -vc '^#\|^$' backend/tests/.import_time_side_effects_legacy
28

Header and content now agree. One line, no behaviour change.

@aryanorastar

Copy link
Copy Markdown
Collaborator Author

The red Backend unit suite on this head is not from this PR, and merging main will not clear it — main itself is red.

main commit Backend unit suite
7c0e4361 success
23156505 failure
09ff17e4 failure

Same error in both, and in this PR's run:

ModuleNotFoundError: No module named 'models.client_processing'
utils/conversations/projection_payload.py:19

ERROR tests/unit/test_batch_upload_storage.py
ERROR tests/unit/test_merge_validation.py

This PR's actual diff is two files:

$ git diff origin/main...HEAD --stat
 backend/pyrightconfig.json                     | 1 -
 backend/tests/.import_time_side_effects_legacy | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

Neither erroring suite is in it, and neither imports anything this PR touches.

I did check whether the allowlist edit could be implicated, since .import_time_side_effects_legacy governs import-time side-effect checking and that is adjacent to an import-isolation failure. It is not: the removed entry pointed at backend/scripts/stt/d_test_models.py, a file that no longer exists, so nothing was being allow-listed through it. The remaining 28 entries all resolve at head.

Tracked as #12779 with the evidence. Not something I can fix from this branch — it sits in the conversations/merge isolation harness, and I have offered there to bisect the 7c0e4361..23156505 window if nobody who owns that area is already on it.

No push here; nothing about this PR needs changing.

@aryanorastar

Copy link
Copy Markdown
Collaborator Author

The gate you are waiting on now has a fix in flight: #12546.

Root cause confirmed and reproduced. utils/conversations/projection_payload.py imported models.client_processing at module scope, and seven suites under tests/unit replace sys.modules['models'] with a bare stub. While one of those stubs is installed, merely collecting a later module that reaches it dies with the ModuleNotFoundError — which is why the error lands on test_batch_upload_storage / test_merge_validation rather than on whatever caused it.

#12546 defers that import to its only consumer, so no models stub anywhere can break collection. Every one of the seven polluters, paired with the two erroring suites, now collects and runs; the same pairings produce 40 collection errors before the change. The regression test is mutation-checked against the exact production error.

Nothing about this PR changes. Flagging it because the condition you named — unit green via "merge of a #12779 fix, or equivalent" — now has a candidate.

@aryanorastar

Copy link
Copy Markdown
Collaborator Author

CI has now confirmed the fix, so the blocker on this PR has a verified remedy rather than a candidate.

#12785's Backend unit suite is green — run 33961213829, 3m29s, with 1072 backend unit test files selected and zero occurrences of No module named 'models.client_processing'. The same required check is red with that exact error on every other open PR, including this one.

Root cause, for the record: utils/conversations/projection_payload.py imported models.client_processing at module scope, and seven suites under tests/unit replace sys.modules['models'] with a bare stub. While one of those stubs is installed, merely collecting a later module that reaches it dies — which is why the error surfaces on test_batch_upload_storage / test_merge_validation rather than on whatever caused it. #12785 defers that import to its only consumer, so no models stub anywhere can break collection.

Nothing changes on this PR. Once #12785 lands, a merge of main here should turn the check green.

aryanorastar and others added 2 commits September 5, 2026 19:40
…cleanup

a7bc5fd ("chore(backend): remove dead modules and orphaned WS-G promotion
family") deleted backend/scripts/stt/d_test_models.py. BasedHardware#12740 swept the CI
guardrail references to files that cleanup removed; two were left behind:

  backend/pyrightconfig.json:62                      "scripts/stt/d_test_models.py"
  backend/tests/.import_time_side_effects_legacy:34  backend/scripts/stt/d_test_models.py

The pyright one is the visible symptom. Every backend type check prints

    File or directory ".../backend/scripts/stt/d_test_models.py" does not exist.

before doing its work. It does not fail the run, which is the problem: a config
that always reports one missing include is a config where the next genuinely
missing include reads as normal output.

Audited both files rather than removing only the entry that surfaced. Of 29
non-comment entries in the legacy list and every non-glob path in
pyrightconfig.json, this is the only stale one -- .venv and pretrained_models
are gitignored directories, correctly excluded rather than missing.

Verified: bash scripts/typecheck.sh reports 0 errors with no missing-file line.

Failure-Class: none

Co-Authored-By: Claude Opus 5 <[email protected]>
The file's own header claimed 29 entries while the list now holds 28. That is
the same stale-signal class this PR exists to clear: a header nobody recomputes
is a header that quietly stops describing the file, exactly like the pyright
include and manifest entry pointing at a script that was deleted.

Caught in review.

Failure-Class: none

Co-Authored-By: Claude Opus 5 <[email protected]>
@undivisible
undivisible force-pushed the fix/wsg-stale-d-test-models-refs branch 2 times, most recently from 7b7a6e8 to 3f059f6 Compare September 5, 2026 11:44
@undivisible
undivisible merged commit 3f0ff85 into BasedHardware:main Sep 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend Task (python) positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants