Repository navigation
jot and doctor: read the plugin entry the sessions use - #103
Merged
Merged
Conversation
Installed from the marketplace and loaded from no folder, a session reads pluginConfigs.ostrakon@ostrakon; loaded from a folder, ostrakon then ostrakon@inline. CLAUDE_CODE_PLUGIN_DIRS comes from the settings' env over the shell's. An empty CLAUDE_CONFIG_DIR means settings.json in the working directory, as Claude Code reads it, and settings that parse but aren't an object are reported as such.
doctor reads pluginConfigs.ostrakon@ostrakon only when the mod is installed from the marketplace and loaded from no folder, else ostrakon then ostrakon@inline. With both set up it says sessions use the folder's copy and names the entries it read. CLAUDE_CODE_PLUGIN_DIRS comes from the settings' env over the shell's, an empty CLAUDE_CONFIG_DIR means settings.json in the working directory, and settings that parse but aren't an object are flagged. Its settings reading now has tests.
…_DIR is empty Claude Code keeps an empty CLAUDE_CONFIG_DIR as it is, so its folder is the working directory; the mod read /themes/ instead.
…CLAUDE_CONFIG_DIR
…s, unreadable settings - The mod reads a custom theme from $.session.cwd() when CLAUDE_CONFIG_DIR is set but empty, instead of leaving a relative path to the engine. - jot and doctor read a leading ~ in CLAUDE_CODE_PLUGIN_DIRS as home and skip a relative entry, as Claude Code does. - doctor reports a settings.json it can't open (a folder, no permission). - install.sh treats an empty CLAUDE_CONFIG_DIR as Claude Code does. - DESIGN 5.0.1: the custom theme row covers the empty CLAUDE_CONFIG_DIR.
Run every helper-based case through the stubbed claude and curl.
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.
ostrakon jotandostrakon doctornow read the plugin's options from the settings entry that Claude Code sessions actually read. Before, they took the first ofostrakon,ostrakon@inlineandostrakon@ostrakonthat had a value. So with a marketplace install, anostrakonentry left over frominstall.shwon: jot saved to that entry's folder and posted to that entry's hub, and doctor checked them too.What changed
Which entry is read (
server/jot.ts,bin/doctor)pluginConfigs["ostrakon@ostrakon"]only, whenenabledPlugins["ostrakon@ostrakon"]is set and no folder copy of the mod is loaded.ostrakon, thenostrakon@inline.CLAUDE_CODE_PLUGIN_DIRSnames a folder that holds the mod. It is read as Claude Code 2.1.310 reads it::;envvalue wins over the shell's, even when it is empty;~means the home folder;Plugin "ostrakon" from --plugin-dir overrides installed version). Doctor now says that, and names the entries it read. Before, it said the mod loads twice.An empty
CLAUDE_CONFIG_DIRsettings.jsonandthemes/from the working directory.install.shnow do the same; before, they treated an empty value as unset.$.session.cwd(); before, it read/themes/<name>.json.Settings that can't be used
[1],null) are reported as such. Before, they were read as empty, so doctor said "no hubUrl set".settings.jsonit can't open (a folder, or no permission).Docs: SPEC §2.1 records the Claude Code behaviour above, and §9.5 the entry rule. The CHANGELOG has the doctor, mod and install changes.
Acceptance criteria
ostrakon@ostrakon.server/jot.test.ts"installed from the marketplace and loaded from no folder, reads only ostrakon@ostrakon"server/doctor.test.ts"installed from the marketplace and loaded from no folder, checks only what ostrakon@ostrakon says"ostrakon, thenostrakon@inline, and neverostrakon@ostrakon.server/doctor.test.ts"loaded from a folder, checks ostrakon then ostrakon@inline, and says when the mod is also installed". What a session does in this case was checked against Claude Code 2.1.310 and is recorded in SPEC §2.1 and §9.5.server/doctor.test.tsrunsbin/doctorwith stubclaude,curlandsystemctl. It covers the entry choice, the hub URL and token taken as a pair from one entry,CLAUDE_CONFIG_DIR(unset, set, set but empty), a missing settings file, and invalid or unreadable settings.CLAUDE_CONFIG_DIRbehaves the same in jot, doctor and the mod, as in Claude Code:plugin/tests/hooks.test.ts"with CLAUDE_CONFIG_DIR set but empty, a custom theme is read from the working directory, as Claude Code reads it"Changes made during review
install.shuses the same rule for an emptyCLAUDE_CONFIG_DIR.~and relative entries inCLAUDE_CODE_PLUGIN_DIRSthe way Claude Code does.CLAUDE_CODE_PLUGIN_DIRSfrom the shell. An earlier commit on this branch had stopped doing that. The new test "with no settings file, takes the plugin folders from the shell" covers it.Checks
tools/check.shpasses at the head: plugin validate, design check, the type-checks, 401 mod tests, 72 hub and jot tests, the phone tests and lint.Failing test: server/jot.test.ts installed from the marketplace and loaded from no folder, reads only ostrakon@ostrakon
Failing test: server/jot.test.ts reads a ~ in the plugin folders as home, and a relative folder as none, as Claude Code does
Failing test: server/jot.test.ts the settings' plugin folders go over the shell's, an empty list included
Failing test: server/jot.test.ts with CLAUDE_CONFIG_DIR set but empty, reads settings.json in the working directory, as Claude Code does
Failing test: server/jot.test.ts says the settings aren't a JSON object when they parse as something else
Failing test: server/doctor.test.ts installed from the marketplace and loaded from no folder, checks only what ostrakon@ostrakon says
Failing test: server/doctor.test.ts loaded from a folder, checks ostrakon then ostrakon@inline, and says when the mod is also installed
Failing test: server/doctor.test.ts reads a ~ in the plugin folders as home, and a relative folder as none
Failing test: server/doctor.test.ts the settings' plugin folders go over the shell's, an empty list included
Failing test: server/doctor.test.ts reads the settings from CLAUDE_CONFIG_DIR when set, and from the working directory when it is set but empty
Failing test: server/doctor.test.ts says the settings aren't valid when they aren't JSON, or are JSON but not an object
Failing test: plugin/tests/hooks.test.ts -t "with CLAUDE_CONFIG_DIR set but empty, a custom theme is read from the working directory, as Claude Code reads it"
Closes #99