Repository navigation
refactor!: rename package loglens -> logscribe (PyPI name collision) - #5
Merged
Merged
Conversation
PyPI rejected `loglens` as too similar to an existing project (`log-lens` v0.7.1). PyPI's name-similarity guard collapses separators, so `loglens` and `log-lens` reduce to the same string. `logscribe` was verified clear on every form before adoption. Renames the import path (loglens -> logscribe), the CLI (loglens-check -> logscribe-check), the LOGLENS_* env var prefix (-> LOGSCRIBE_*), the Prometheus metric namespace (loglens_* -> logscribe_*, keeping the no-_total-suffix declaration convention), and the default AI-response logger name (loglens.ai_responses -> logscribe.ai_responses). All caplog logger-name string literals in tests are updated in lockstep with the runtime __name__-derived logger names. Public class names (AIHandler, LLMRouter, AILogger, AILoggingMetrics, JsonFormatter, CircuitBreaker, LLMProvider, and provider classes) are unchanged, as are the OPENAI_API_KEY and ANTHROPIC_API_KEY provider environment variables. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H6KTXfUn3o82CTMShHcw8J
Repo-wide grep after the package rename caught three mixed-case "LogLens" survivors that the lowercase/uppercase sed passes missed: a CLI startup log message, a health-check summary message, the argparse description in logscribe/cli/health_check.py, and package docstrings in logscribe/config/settings.py and logscribe/metrics/prometheus.py. All now read "LogScribe". Also found and removed an orphaned `loglens 0.1.0` install left over in the dev venv from before the editable-install reinstall. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H6KTXfUn3o82CTMShHcw8J
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renames the package from
loglenstologscribe, because PyPI rejected the old name.Why
PyPI returned "This project name is too similar to an existing project." The collision is
log-lensv0.7.1 — "Lightweight CLI for analyzing Apache/Nginx server logs". PyPI's name-similarity guard collapses separators, sologlensandlog-lensreduce to the same string.The rejection is correct on the merits, not a technicality: both are log-analysis tools, and users would genuinely confuse them.
How this was missed
Phase 2's availability check was
curl https://pypi.org/pypi/loglens/json→ 404, and the name was reported as available. A 404 only proves no exact normalized match — it does not test PyPI's stricter confusable-name rule. The correct check tests the bare form and every separator variant.logscribewas verified properly this time:logscribe,log-scribe,log_scribe,log.scribe,logscribes,logscriber— all 404. The same check also caught thatlog-sage(a candidate) would have been rejected, sincelogsageis taken.Because PyPI reservation had been deferred to Phase 5, nothing was ever published under the old name. This costs a rename rather than a yanked release.
What changed
Everything — 56 files across two commits. Import name, distribution name,
LOGSCRIBE_*env prefix, the Prometheus metric namespace, the default AI-response logger, thelogscribe-checkCLI,pyproject.toml(including the self-referentialall/devextras), both CI workflows, README, PRIVACY.md, CONTRIBUTING.md, CHANGELOG.md, issue templates, and all four examples. The GitHub repo is nownadeem4/logscribe.Deliberately unchanged:
OPENAI_API_KEYandANTHROPIC_API_KEY(standard provider variables, not ours), and every public class name —AIHandler,LLMRouter,AILogger,AILoggingMetrics,JsonFormatter,CircuitBreaker,LLMProvider.AILoggingMetricsandAI_LOGGER_DEFAULT_LEVELstill carry a pre-rename brand; that's a separate Phase 5 decision and was out of scope here.Verification
136 tests passing, 0 failed, 0 xfailed, coverage 96.16% — identical to baseline, as a pure rename should be.
The clean-venv wheel check from Phase 2's exit gate was re-run in full: the wheel installs pulling only the three core deps,
import logscribeworks,__version__is0.1.0,logscribe-checkruns without a traceback, andjinja_template.nameisdefault_log_prompt.jinja2— proving the packaged template still ships rather than silently falling back to the inline one. Import alone would not have shown that.Lazy imports confirmed intact:
import logscribeleavesopenai,anthropic, andprometheus_clientall absent fromsys.modules.Traps this rename had to avoid
This same operation was done once before (
ai_logging→loglens), and its scars shaped this one:_totalsuffix becauseprometheus_clientappends it —logscribe_ai_callsdeclared,logscribe_ai_calls_totalasserted. Declarations and assertions moved in lockstep, and the suffix was not "helpfully" added.caplog.at_level(..., logger=...)string literals must track the__name__-derived logger names. Miss one and the assertion passes vacuously rather than failing. All 18 sites were checked — includingtests/test_health_check.py, which used a hand-picked literal rather than a derived name and needed a source-side rename too.git mvbreaks the editable install, so the reinstall has to be immediate.One miss caught during verification: a case-sensitive pass silently skipped mixed-case
LogLensin three files (CLI startup/summary strings and two docstrings). A case-insensitive grep found them.Note
The
[Unreleased]CHANGELOG entries were rewritten to saylogscribe, since the package never shipped under the old name and those entries describe what 0.1.0 will contain. The one deliberate mention ofloglensis the new entry recording this rename and why.🤖 Generated with Claude Code
https://claude.ai/code/session_01H6KTXfUn3o82CTMShHcw8J