fix(cli): publish under a scope we actually own - #253
Conversation
Review — approve, with one change pushedThe registry evidence is the part that matters and it holds up: the leaf name being 404 is exactly what makes a scope you do not own look available, and npm rejects the publish either way. Checking I grepped for stragglers. Everything still naming an old package is either a historical snapshot ( Pushed: the guard scanned by allowlist
Neither is on the list. A third rename would have left both behind in precisely the way the first two left strings behind — which is the failure the test exists to prevent, reproduced inside the test. An allowlist has to be extended by whoever adds the next document and stays silent when they forget. Inverted it: every Added a second test pinning the walker itself. A skip rule that accidentally swallowed Verified by pointing Note, not a requestThe 0.3.0 CHANGELOG entry still says the CLI "is published as |
0.3.0 renamed the CLI away from `deepcode-cli` because that name belongs to an unrelated project. `@deepcode/cli` was not ours either. The leaf name is unpublished — which is exactly what made it look free. But the `@deepcode` scope holds `@deepcode/tsc` and `@deepcode/dcignore`, and npm rejects a publish into a scope you do not own regardless of whether the individual name is available. A scope is not claimable by publishing into it, so `pnpm publish` would have returned the same 403 the rename was meant to fix. `publish-cli` needs both build jobs to succeed first, so it has still never run — the second wrong name would have surfaced exactly the way the first did. The new name is the repository owner's personal scope, which needs no organisation to exist first. Nothing was ever published under either old name, so no installed package changes and the binary is still `deepcode`. Guard added: every `npm i -g …` in a current document or in CLI source must name the package `apps/cli/package.json` publishes, and the published name may not be either of the two that belong to somebody else. Both renames so far moved some install strings and left others behind. Also rewrites `apps/cli/README.md`, which ships in the package `files` list and is therefore the npm landing page. It described the CLI as an "M0 骨架,命令 入口存在但不能用" and pointed at milestone numbers for when features would arrive. Historical snapshots keep the names that were true when they were written. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The guard listed nine files to check. That list has to be extended by whoever adds the next document, and it says nothing when they forget — the same silent-drift shape the check exists to catch. Not hypothetical: this rename hand-edited install strings in packages/core/src/config/claude-compat.test.ts and apps/cli/src/parity-commands.test.ts, and neither was on the list. A third rename would have left both behind exactly as the first two did. Now every .md/.ts/.tsx/.mjs/.sh in the repository is scanned except an explicit set of historical snapshots — the same set scripts/check-docs.mjs already marks as such, plus CHANGELOG entries for shipped releases. A second test pins the walker itself, so a skip rule that swallowed docs/ or apps/ cannot leave the check passing over nothing. Verified by pointing claude-compat.test.ts at the old name: the check names the file and fails. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The widened guard caught this the moment #251 landed on main: §7.1 of the delivery report tells readers to run `npm i -g @deepcode/cli`, which would 403 for the same reason the name it replaced did. The report is a dated snapshot and §7.1 is a record of what was decided at the time, so the decision stays on the page and the correction is appended to it rather than rewritten over it. The file joins the historical set for the same reason the other snapshots are in it. That the check found this by itself, on a document nobody would have thought to add to an allowlist, is the argument for scanning by exclusion. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
da7f50b to
f0c9832
Compare
Follow-up after rebase onto
|
The problem 0.3.0 did not actually fix
0.3.0 renamed the CLI from
deepcode-clito@deepcode/clibecausedeepcode-clion npm belongs to an unrelated Doubao-based project.@deepcode/cliis not ours either.The leaf name is unpublished — which is exactly what made it look free:
@deepcode/tscis "Typescript consumer of Deepcode public API" — Snyk's DeepCode, unrelated to this project. npm rejects a publish into a scope you do not own regardless of whether the individual name is available; a scope is not claimable by publishing into it.pnpm publishwould have returned the same 403 the rename was meant to fix.publish-clineeds: [validate, build-vscode, build-mac], andbuild-macis skipped without Apple credentials — so the job has still never run. The second wrong name would have surfaced exactly the way the first did: at the moment someone finally configured enough secrets to reach it.Change
@oratis/deepcode— the repository owner's personal npm scope, which needs no organisation to exist first. Binary unchanged (deepcode). Nothing was ever published under either old name, so no installed package changes and nobody'snpm ibreaks.Every other workspace package is
private: true; onlyapps/clipublishes, so nothing else moves.Guard
scripts/package-name-consistency.test.ts:npm i -g …in a current document or in CLI source names the packageapps/cli/package.jsonpublishes — both renames so far moved some install strings and left others behind;deepcode.Also
apps/cli/README.mdis in the packagefileslist, so it is the npm landing page. It said:for a CLI that has shipped for several versions. Rewritten to describe what the package does, including the 0.3.0 governance commands.
Historical snapshots (
MORNING_REPORT,DEVELOPMENT_PLAN,HANDOFF,BEHAVIOR_PARITY) keep the names that were true when they were written, per the existing conventionscripts/check-docs.mjsenforces.Verification
pnpm typecheck,pnpm lint,pnpm format:check,pnpm docs:checkclean; full suite passes through the pre-commit hook. Lockfile unaffected — pnpm keys workspace importers by path, not by name.Still yours to do
NPM_TOKENmust be an automation token from theoratisaccount. Nothing else about the release graph changes.🤖 Generated with Claude Code