Take three review findings that outlived the branch they were raised on

Merged
JA
2mo ago
+9-6

Three findings from cubic's review of #201, raised while that PR was still stacked and carrying other slices' files. Those files have since merged to main and left #201's diff, so the threads read as outdated — which is how they came to sit unaddressed. Each was checked against main before being fixed here, rather than taken on the thread's word.

Feedback-driven rather than issue-driven, which is why it opens as a draft with no triage plan: the findings are already stated on #201's threads, and the fixes are three lines of substance between them.

1. A test named for a path it never takes

test/models/security/classification_defaults_test.rb

"a provider-matched security still gets one" is a plain Security.create! with offline: false. There is no provider match and no Security::Resolver anywhere in it — it exercises the offline? guard in apply_default_region and nothing more. The name, and its pairing with the offline test beside it, implied the provider-matched path was covered when it is not, which is how missing coverage stays missing.

Renamed to "an online security gets a region from its country", with the reason recorded above it.

2. A private helper shadowing the framework

test/models/security/look_through_test.rb

A private assert_not_in_delta reimplemented Rails' own assertion of the same name, hiding the framework method and its message format.

Verified rather than argued: deleting the helper leaves all 9 tests in the file passing, so it was only ever the override.

3. "The mirror" used twice and never named

CLAUDE.md

The pre-flight rule tells a contributor a PR "rots against a mirror that resets daily", and to say when one is "a cherry-pick onto the mirror" — while the term appears nowhere else in the file. The last clause is the rule's actionable instruction and this file is executed literally.

Named at first use: mirror/upstream-main, this fork's branch holding an exact copy of we-promise/sure's main, force-reset daily by a workflow, so anything built on it moves underneath you.

Verification

Full suite 10,007 runs, 42,479 assertions, 0 failures, 0 errors, 33 skips. bin/rubocop clean. No behaviour changes: two test-file edits and one documentation edit.

Not in this PR

The other two findings from the same review are not stale and are handled where they belong: "production syncs never opt into constituent fetching" is what #203 does, and the classification negative-result cache is the same class of gap as #212 and is recorded there.