Skip to content

Issue — claude-code-chat-browser — Exclusion rule consolidation: residual _slugify divergence (**CCC8**) (3 pt) #30

@clean6378-max-it

Description

@clean6378-max-it

Issue — claude-code-chat-browser — Exclusion rule consolidation: residual _slugify divergence (CCC8) (3 pt)

Sprint: Wednesday, May 6 — Claude-code Refactor + Exclusion Consolidation (8 pt total; this item = 3 pt, task 2 of 2)
Repo: cppalliance/claude-code-chat-browser
Audit: claude-cursor.md CCC8 + claude-code-browser-eval.md §5.2 (incl. footnote 9 on _slugify). (Both audit docs are internal; not on GitHub.)
(After opening on GitHub, paste the issue URL here.)


Background — what CCC8 actually asks for

CCC8’s Fix column in claude-cursor.md consolidates two helpers plus the call-site duplication:

  1. Single _session_text_for_exclusion in utils/.
  2. Single _slugify in utils/ (currently two divergent implementations — eval §5.2 + footnote 9).
  3. Replace the ~6 repeated if rules: build_searchable_text(...) → is_excluded_by_rules(...) → skip blocks with one shared call.

Pieces (1) and (3) shipped in Issue #23 · PR #24. Piece (2)_slugify consolidation — was not part of that PR’s description and is the only remaining CCC8 work.

CCC8 piece Status Where
(1) _session_text_for_exclusion single source in utils/ Done PR #24
(3) Six API + CLI call sites unified through one helper Done PR #24
Whitespace-only inconsistency between helper vs inline sites Done (side-effect of (3)) PR #24
(2) _slugify consolidation Open This issue

Problem

Per eval §5.2 (footnote 9), _slugify is implemented differently in two files. Two implementations of the same function — used to derive on-disk and URL-safe identifiers — risks subtle export and path bugs (different normalization, different character class handling, drift over time).

PR #24 refactored exclusion plumbing but did not unify _slugify. That residual divergence is what closes CCC8.


Goal

One implementation of _slugify in utils/, imported by every former call site. Behavior chosen deliberately (one of the existing implementations, or a clearly documented merge of the two).


Scope (in)

  • Locate the two existing _slugify implementations in the repo (per eval §5.2 footnote 9).
  • Move the chosen implementation to a shared module — natural home is utils/exclusion_rules.py (already created by PR refactor(exclusion): consolidate duplicate session-text helper + 6 repeated call patterns (closes #23) #24) or a small utils/slugify.py if exclusion-rules is the wrong neighborhood.
  • Replace both call sites with the shared import; delete the old local copies.
  • If the two implementations differ in behavior on any input, document the choice in the PR (one-paragraph rationale + before/after table for the diverging cases).
  • Add a small regression test covering the inputs where the two old implementations diverged (so behavior cannot silently regress).

Verification (also in scope)

Scope (out)


Acceptance criteria

  • One _slugify (or public-named equivalent) in utils/; zero other definitions in the repo.
  • Every former call site imports from the shared module.
  • PR notes which legacy implementation’s behavior was chosen (or how they were merged) and lists any input where output changes.
  • Regression test covering at least the diverging inputs and one ASCII / one Unicode case.
  • pytest green; manual smoke check that exported filenames / URL slugs still resolve.
  • PR closes CCC8, references eval §5.2 (footnote 9) and PR #24.

Coverage map (CCC8 closure)

CCC8 piece Closed by
_session_text_for_exclusion single source PR #24
Six call sites unified PR #24
Whitespace-only inconsistency PR #24
_slugify single source (eval §5.2 footnote 9) This PR

After this PR ships, the Fix column of CCC8 is fully satisfied for claude-code-chat-browser. Sibling CCB3 (in cursor-chat-browser-python) remains a separate ticket.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions