ci(sdk): make latest track the newest version, and add move-tag mode - #37
Conversation
Policy decision: `latest` should always point at the newest published version so a bare `npm install` gets current code. Publishes now default to dist_tag=latest, and the guard that REFUSED to publish a pre-release to `latest` is removed. That guard encoded the usual npm convention that `latest` means "newest stable". Every version here is a 0.1.0-dev.x, so the convention left `npm install` resolving to 0.1.0-dev.2 — a tarball carrying no deployment carrier at all. Being correct about the tag was worse for consumers than the thing the convention protects. The step stays as an informational note so nobody restores the guard as a "fix". Adds `mode: move-tag`, which repoints a dist-tag at a version already on the registry and builds/publishes nothing. Needed because a published version cannot be re-published, so `npm publish` can never correct a tag afterwards — and 0.1.0-dev.4 is already out, so this is the only CI route to fix `latest` now. It validates the inverse of the publish guard: the target version MUST exist, since tagging a nonexistent version would break `npm install` outright. move-tag is UNPROVEN. npm's Trusted Publishing is built around `npm publish`, and whether the OIDC exchange also authorises `npm dist-tag` is not settled by the docs. If it fails with ENEEDAUTH the exchange does not cover it, moving a tag stays a local `npm dist-tag add` by a maintainer with 2FA, and this mode should be deleted rather than left as a trap. The npmjs entry may also need a dist-tag action ticked under "Allowed actions". Flagged in the workflow itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
🤖 wrokin code reviewNo high-signal issues. The diff is a well-structured addition of a Model: deepseek/deepseek-v4-pro · your key, your model (BYOK) |
🤖 wrokin security audit
The new if ! npm view "${name}@${TARGET}" version >/dev/null 2>&1; thenBecause the variable is embedded inside a double‑quoted string but not sanitized, a specially crafted input (e.g., Remediation: Validate the version string against a strict semantic versioning regex (e.g., Model: deepseek/deepseek-v4-pro · your key, your model (BYOK) |
🛡️ wrokin security hunterNo vulnerabilities were proven in this pull request — the hunter found nothing it could exploit and prove by execution. Advisory only — this check never blocks your PR. |
Problem
latestpoints at0.1.0-dev.2— a tarball with no deployment carrier at all — so a barenpm install @bytesbrains/maktub-sdkstill hands people pre-#32 code even though0.1.0-dev.4is published.The workflow caused this. Its guard refused to publish a pre-release to
latest, on the usual npm convention thatlatestmeans "newest stable". Every version in this project is a0.1.0-dev.x, so that guard permanently pinnedlatestto an old build.Change summary
Policy:
latesttracks the newest published version, always.dist_tagnow defaults tolatest, and the pre-release guard is removed. The step remains as an informational note explaining why, so nobody restores the guard as a "fix". This is a deliberate departure from npm convention — being technically correct about the tag was worse for consumers than the thing the convention protects.mode: move-tagrepoints a dist-tag at a version already on the registry, building and publishing nothing. A published version can't be re-published, sonpm publishcan never correct a tag after the fact — and0.1.0-dev.4is already out, making this the only CI route to fixlatestnow.npm installoutright.Tests
YAML validated; step conditions confirmed to route correctly — the five publish-only steps and the three move-tag steps are mutually exclusive on
inputs.mode, andmove-tagskipsnpm cisince it builds nothing.move-tag is unproven and I want to be explicit about it. npm's Trusted Publishing is built around
npm publish; whether the OIDC exchange also authorisesnpm dist-tagisn't settled by the docs. Two outcomes:latestis fixable from CI from now on.ENEEDAUTH→ the exchange doesn't cover it, moving a tag stays a localnpm dist-tag addby a maintainer with 2FA, and this mode should be deleted rather than left as a trap.The npmjs entry may also need a dist-tag action ticked under "Allowed actions". Both caveats are recorded in the workflow itself, not just here.
Given the bring-up history, I'd rather ship this labelled honestly than assert it works.
Risk
Low. Publish-mode behaviour is unchanged apart from the default tag and the dropped guard. move-tag can only ever point a tag at a version that already exists, which is reversible by pointing it somewhere else. Nothing is built or published in that mode.
The real consequence to be aware of: after the tag moves,
npm installstarts serving a pre-release. That is the intent.Backwards-compat
Existing pins are unaffected — versions are immutable and
@devstill resolves to0.1.0-dev.4. Anyone on a floating install picks updev.4instead ofdev.2, which is the fix.Privacy copy
No user-facing privacy copy.
🤖 Generated with Claude Code