Follow a renamed notebook, and case session names as the product is written - #8
Merged
Conversation
Three changes on top of the naming work. Renaming a notebook turns out to be more than a stale label. A notebook's URI is both its session key and its namespace key, so a rename stranded the old session -- logged in, spending one of ten, owned by a URI nothing would ask for again -- and handed the notebook an empty namespace, which reads as "my variables disappeared". renameOwner moves the scope entry inside the session, re-keys the map, and re-publishes the cache name; wired to onDidRenameFiles, which is explicit renames only. The extension's own session is now GemDB Code, after the extension, and the shell is GemDB Shell <pid> rather than an abbreviation -- a shell's suffix is a fixed-width pid, so spelling out the tag costs nothing. nb stays short deliberately: a notebook's suffix is a filename, and every character the tag takes is one the title loses (22 against 16). Capitalisation follows the product: CLAUDE.md already says to write "GemDB Shell" wherever a user can see it, and an administrator reading a session list is a user. Common nouns (nb, run) stay lowercase. It also sits better beside GemStone's own PascalCase names in that column -- GcReclaim, SymbolGem, ShrPcMonitor, TopazR (measured: an unnamed RPC gem is TopazR, as a linked one is TopazL). The single lowercase entry there is the stone's slot, which carries the stone's configured name rather than a product's. 109 unit tests, 46 integration. The new integration test renames a notebook that has a session and a variable, then checks the session count did not grow, the sessionId is the same one, the variable survived, and the shared cache now reports the new name. Co-Authored-By: Claude Fable 5 <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.
Follows #7. Three changes, one of which turned out to be a real bug rather than a cosmetic one.
Renaming a notebook was losing its session and its variables
A notebook's URI is both its session key and its namespace key. So renaming the file did two things nobody wanted: the old session stayed in the map — logged in, spending one of ten, owned by a URI nothing would ever ask for again — and the notebook started over with an empty namespace, which reads as my variables disappeared.
renameOwnermoves the scope entry inside the session, re-keys the map, and re-publishes the cache name (a stale one points an administrator at a file that is not there). Wired toonDidRenameFiles, which is explicit renames only — saving under a new name makes a second document and correctly gets a session of its own.The names
gemdb nb analysisGemDB nb analysisgemdb sh 41234GemDB Shell 41234gemdb extGemDB Codegemdb run backfillGemDB run backfillShellspelled out,nbnot, and the asymmetry is deliberate: a shell's suffix is a fixed-width pid, so the longer tag costs nothing, while a notebook's suffix is a filename and every character the tag takes is one the title loses — 22 against 16 if it wereGemDB notebook. Ordinary notebook names exceed 16.On capitalisation
CLAUDE.md already answers most of it: write "GemDB Shell" wherever a user can see it, and an administrator reading a session list is a user. So product names are capitalised as the product is written and common nouns (
nb,run) are not — which is just English, and happens to make the rows self-describing.It also fits the column. GemStone's own names there are PascalCase:
GcReclaim,SymbolGem,ShrPcMonitor,TopazL, and — newly measured for this PR —TopazR, the default for an unnamed RPC gem, which is precisely what a GemDB session would otherwise show as. The one lowercase entry is the stone's own slot, and that carries the stone's configured name rather than a product's, so it isn't a counter-example. An all-lowercasegemdb nb …would have been the only thing of its kind in the list.The notebook's own title is left exactly as the user wrote it — the tag is ours to style, the filename is theirs, and re-casing it would make the label harder to match against the file in the explorer.
Verification
🤖 Generated with Claude Code