Skip to content

refactor!: rename package loglens -> logscribe (PyPI name collision) - #5

Merged
nadeem4 merged 2 commits into
mainfrom
nkhan/rename-logscribe
Aug 28, 2026
Merged

nadeem4 merged 2 commits into
mainfrom
nkhan/rename-logscribe

Conversation

@nadeem4

@nadeem4 nadeem4 commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Renames the package from loglens to logscribe, because PyPI rejected the old name.

Why

PyPI returned "This project name is too similar to an existing project." The collision is log-lens v0.7.1 — "Lightweight CLI for analyzing Apache/Nginx server logs". PyPI's name-similarity guard collapses separators, so loglens and log-lens reduce 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.

logscribe was verified properly this time: logscribe, log-scribe, log_scribe, log.scribe, logscribes, logscriber — all 404. The same check also caught that log-sage (a candidate) would have been rejected, since logsage is 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, the logscribe-check CLI, pyproject.toml (including the self-referential all/dev extras), both CI workflows, README, PRIVACY.md, CONTRIBUTING.md, CHANGELOG.md, issue templates, and all four examples. The GitHub repo is now nadeem4/logscribe.

Deliberately unchanged: OPENAI_API_KEY and ANTHROPIC_API_KEY (standard provider variables, not ours), and every public class name — AIHandler, LLMRouter, AILogger, AILoggingMetrics, JsonFormatter, CircuitBreaker, LLMProvider. AILoggingMetrics and AI_LOGGER_DEFAULT_LEVEL still 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 logscribe works, __version__ is 0.1.0, logscribe-check runs without a traceback, and jinja_template.name is default_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 logscribe leaves openai, anthropic, and prometheus_client all absent from sys.modules.

Traps this rename had to avoid

This same operation was done once before (ai_logging → loglens), and its scars shaped this one:

  • The metrics namespace rename is a behaviour change, not a string swap. Counters are deliberately declared without a _total suffix because prometheus_client appends it — logscribe_ai_calls declared, logscribe_ai_calls_total asserted. 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 — including tests/test_health_check.py, which used a hand-picked literal rather than a derived name and needed a source-side rename too.
  • git mv breaks the editable install, so the reinstall has to be immediate.

One miss caught during verification: a case-sensitive pass silently skipped mixed-case LogLens in three files (CLI startup/summary strings and two docstrings). A case-insensitive grep found them.

Note

The [Unreleased] CHANGELOG entries were rewritten to say logscribe, since the package never shipped under the old name and those entries describe what 0.1.0 will contain. The one deliberate mention of loglens is the new entry recording this rename and why.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H6KTXfUn3o82CTMShHcw8J

nadeem4 and others added 2 commits August 28, 2026 13:46
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
@nadeem4
nadeem4 merged commit 01f6b8f into main Aug 28, 2026
14 checks passed
@nadeem4
nadeem4 deleted the nkhan/rename-logscribe branch August 28, 2026 18:58
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.

1 participant