Skip to content

[auto-maintainer] refactor(facet): remove duplicate "gets" entries from SUBJECT_TERMINATORS - #702

Open
NickFlach wants to merge 1 commit into
masterfrom
auto-maintainer/refactor-dedup-subject-terminators-202608021415
Open

[auto-maintainer] refactor(facet): remove duplicate "gets" entries from SUBJECT_TERMINATORS#702
NickFlach wants to merge 1 commit into
masterfrom
auto-maintainer/refactor-dedup-subject-terminators-202608021415

Conversation

@NickFlach

Copy link
Copy Markdown
Owner

What changed

Removed two duplicate "gets" entries from the SUBJECT_TERMINATORS constant in src/facet.rs.

Before:

    "gives", "takes", "gets", "gave", "gone", "gets",

After:

    "gives", "takes", "gave", "gone",

The entry "gets" already appeared earlier on the same block's preceding line ("became", "made", "gets", ...). The two trailing copies on the "gives"/"takes" line were dead: slice::contains short-circuits on the first match, so they contributed nothing to the matching logic.

1 line changed, 1 file.

Why it's safe

SUBJECT_TERMINATORS is a const &[&str]. The only use site is:

if SUBJECT_TERMINATORS.contains(&lower.as_str()) {
    break;
}

Removing two entries that already match before they're reached produces identical runtime behaviour. The set of words that cause leading_subject to stop accumulating tokens is unchanged.

Verification

Local cargo check / cargo clippy --no-deps could not be run: this environment is missing the sibling path dependency consciousness-core required by Cargo.toml. The change is restricted to removing two duplicate string literals from a const slice — it cannot produce a compilation error and carries no semantic risk.

Python sanity check (runs without Rust toolchain):

python3 -c "
import re
txt = open('src/facet.rs').read()
m = re.search(r'const SUBJECT_TERMINATORS.*?\];', txt, re.DOTALL)
entries = re.findall(r'\"(\w+)\"', m.group())
from collections import Counter
c = Counter(entries)
print('Duplicates:', {k:v for k,v in c.items() if v>1} or 'none')
"
# Output: Duplicates: none

Runtime

~8 minutes wall-clock including startup jitter and repo selection.


Generated by Claude Code

…MINATORS

SUBJECT_TERMINATORS in src/facet.rs listed "gets" three times — once on
the "became/made/gets/got" line and twice more on the
"gives/takes/gets/gave/gone/gets" line. Vec/slice::contains short-circuits
on the first match, so the two trailing copies were dead weight: they
contributed nothing to the matching logic and created a subtle maintenance
hazard (editing one copy might leave the others stale).

Removed the two duplicate entries, leaving the single canonical "gets" on
the "became/made" line intact.

No behaviour change: the set of matched subject-terminator tokens is
identical before and after.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra7BE1aADqvr5H9r48EhmG
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.

2 participants