Skip to content

chore(cli): delete dead shared/auth layer and inline single-caller pass-throughs - #6953

Open
kanadgupta wants to merge 5 commits into
developfrom
kanad-claude/shallow-modules-deletion-37e6f6
Open

kanadgupta wants to merge 5 commits into
developfrom
kanad-claude/shallow-modules-deletion-37e6f6

Conversation

@kanadgupta

@kanadgupta kanadgupta commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

A shallow-module audit of apps/cli found two kinds of cleanup. Each candidate was checked with the deletion test: remove the module and paste its body into every caller. If the callers end up no longer, the module was only passing work through.

Dead code. Knip did not flag these because each file's only importer was its own colocated unit test.

  • The superseded auth layer under apps/cli/src/shared/auth/ (api, crypto, credentials, platform-api, token, errors). Live replacements are src/auth/command-*.ts and src/command-internal/login-*.layer.ts.
  • shared/config/cli-project-local-service-versions.{service,layer}.ts, plus the two matching die-placeholders in run.ts and the mock in tests/helpers/mocks.ts.
  • shared/output/table.ts and shared/output/time.ts.

Pass-throughs inlined or merged.

  • db-connection.layer.ts was a two-line alias; the sql-pg layer now exports dbConnectionLayer directly.
  • OutputFormatFlag moves into command-internal/global-flags.ts with the other globals.
  • The region display table is hoisted once to command-internal/region.format.ts and shared by backups and projects.
  • changedLinkedLocalFlags is called directly by seed and storage instead of through per-command aliases; its coverage moves to the db-target-flags unit test.
  • tracing.service.ts, db-bootstrap/messages.ts, standalone-analytics-config.layer.ts, supabaseHome(), output/bold.ts, go-string.ts, report.layers.ts, and prepare.options.ts are inlined at their single caller.
  • packages/cli-test-helpers exports harness.ts directly instead of through a barrel.

Follow-up cleanups in later commits.

  • The error-tag stability snapshot (src/shared/telemetry/__fixtures__/error-tags.txt) drops the four tags that belonged to the deleted modules: ApiError, InvalidLocalServiceVersionsStateError, InvalidTokenError, and PlatformAuthRequiredError. None of them reached production telemetry.
  • Docs that referenced the removed code are updated: the apps/cli/README.md architecture list now points at src/auth/ and describes what remains in src/shared/auth/; apps/cli/docs/tracing-monitoring.md no longer names a Tracing service; apps/cli/docs/code-structure.md uses live symbols in its naming examples; and the db start side-effects note points at start-database.ts for the startup messages.
  • docs/self-documenting-cli.md was an orphaned copy still describing the long-removed --usage and --skill flags and guide templates. It now covers only the generate-docs.ts script and the Fumadocs site that exist today.

No behaviour change. Span names and telemetry command paths are unchanged.

Linear: CLI-2606

🤖 Generated with Claude Code

…ss-throughs

Remove the superseded auth service/layer pairs under shared/auth, the unused
local-service-versions service, and the unused table/time output helpers, all
of which were kept alive only by their own unit tests. Inline the single-caller
wrappers found in the same audit: the db-connection alias, the tracing tag
alias, the split output-format global flag, the db-bootstrap message
constants, the completion analytics config layer, supabaseHome(), bold(),
trimGoSpace, the inspect report runtime layer, the prepare capability list,
the seed/storage flag-scanner aliases, and the duplicated region table.

Refs CLI-2606

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@kanadgupta kanadgupta added the run-ci Run full develop CI (tests) on drafts and non-develop PRs. label Oct 1, 2026
ApiError, InvalidLocalServiceVersionsStateError, InvalidTokenError, and
PlatformAuthRequiredError belonged to the dead shared/auth and
local-service-versions modules removed in the previous commit and never
reached production telemetry.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@kanadgupta
kanadgupta marked this pull request as ready for review October 1, 2026 22:41
@kanadgupta
kanadgupta requested a review from a team as a code owner October 1, 2026 22:41
github-actions[bot]

This comment was marked as resolved.

kanadgupta and others added 3 commits October 1, 2026 15:46
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ntials, and messages.ts

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…-cli.md

The --usage and --skill flags, guide templates, and agent skill writer were
removed with the CLI's early agents module, but this root copy of the page
kept describing them. Keep the parts that still exist: the generate-docs
script, the Fumadocs site layout, and how to run it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci Run full develop CI (tests) on drafts and non-develop PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant