feat(NO-TASK): Announce a new release at shell startup - #70
Merged
Conversation
The existing notifier only speaks after someone runs a command, so the person most likely to be out of date -- the one who has not opened the CLI in a fortnight -- is exactly the one it never reaches. Adds a snippet for the shell profile, emitted by `linchpin shell-init`, so a release is announced by opening a terminal instead. Two properties keep it safe to put in a profile. First, no Node runs on the startup path; the common case is `test` plus `cat` against a file rendered ahead of time, rather than starting the CLI to decide whether to say anything, which would put roughly 100ms in front of every new prompt to print nothing on all but a handful of them. Second, nothing runs in the foreground -- the refresh is detached and redirected to /dev/null, so a slow or unreachable registry cannot hold up a prompt. Nothing in it is terminal-specific. The notice file is kept in step after every command by syncNoticeFile, which skips a write that would not change the file, so the steady state is one small read. A copy that cannot update itself, such as a source checkout or an npx run, neither writes nor clears it; the notice on the machine was written by the global install, and a linked working tree wiping it would silence a release for a shell that had nothing to do with that checkout. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The existing notifier only speaks after someone runs a command, so the person most likely to be out of date — the one who has not opened the CLI in a fortnight — is exactly the one it never reaches. This emits a snippet for the shell profile via
linchpin shell-init, so a release is announced by opening a terminal instead.Why it is safe in a profile
testpluscatagainst a pre-rendered file. Starting the CLI to decide whether to say anything would put ~100ms in front of every new prompt, several times a day, to print nothing on all but a handful of them./dev/null, so a slow or unreachable registry cannot hold up a prompt.syncNoticeFilekeeps the notice in step after every command and skips a write that would not change the file, so the steady state is one small read. A copy that cannot update itself — a source checkout, annpxrun — neither writes nor clears it: the notice was written by the global install, and a linked working tree wiping it would silence a release for a shell that had nothing to do with that checkout.Provenance
This was in-flight work already in the working tree, separated out and committed as its own branch so it stays clear of the security review in #69. The code and its tests are unchanged from that working state — I authored the commit message from the code, so check it describes the intent correctly.
Verification
121/121 tests pass, typecheck clean, on this branch alone.
🤖 Generated with Claude Code