Skills 2026-09-18 14:02 UTC
open-scholar-skill
Committed by joshzyj. Update Category: Routine Updates & Maintenance. Commit details: setup.sh: harness-specific install for Claude Code, Codex and ZCode. This update performs routine maintenance and minor adjustments.
CommitRaw commit message
setup.sh: harness-specific install for Claude Code, Codex and ZCode
setup.sh installed for Claude Code only; Codex and ZCode hosts got nothing
from it. It now takes --harness claude|codex|zcode|all (or
SCHOLAR_SETUP_HARNESS). The default `auto` installs for every harness whose
config dir exists plus the one driving the session, else claude.
- claude: unchanged in effect. Skills + agents -> ~/.claude/; PreToolUse guard
+ PostToolUse redactor -> ~/.claude/settings.json.
- zcode: skills + agents -> ~/.zcode/; PreToolUse guard ->
~/.zcode/cli/config.json in ZCode's schema (.hooks.events.<Event>,
hooks.enabled, per-hook timeout, ZCode tool names incl. ApplyPatch).
- codex: skills -> ~/.codex/skills/. No global hook is written; the verified
path stays the per-project .codex/config.toml from /scholar-init, and the
summary says so rather than implying Codex is guarded.
The PostToolUse redactor is registered for Claude Code only, on purpose. It
can only redact via Claude's hookSpecificOutput.updatedToolOutput wire.
codex-cli 0.154.0 carries updatedMCPToolOutput but no updatedToolOutput; the
ZCode 3.10.2 bundle carries neither (string search of the shipped
binary/bundle, not an end-to-end run). Registered there it would fire and
redact nothing while reading as installed. SCHOLAR_SETUP_POSTTOOLUSE=force
registers it anyway and labels it inert; a later normal run removes it. Same
reasoning recorded in scripts/phases/setup-codex-hooks.sh.
Hook merge hardening: rewrite only when content changes, keep the prior
version as <file>.bak-<timestamp>, preserve a symlinked settings file, treat
a zero-byte config as {}, and call out (never remove) a guard registered by
another checkout. Summary reports protection per harness; exit is non-zero
only for a harness whose setup-time guard failed to register.
Known gap, not fixed here: pretooluse-data-guard.sh has no ApplyPatch branch,
so ZCode's edit tool passes the write-channel speed-bump. The read channel is
covered.
tests/smoke/test-setup-install.sh: 16 -> 41 assertions; tests 1-3 pinned to
--harness claude so they no longer depend on the host running the suite.
Full smoke suite green (46/46). Docs: README, USAGE (+ zh-CN), CLAUDE.md,
CHANGELOG [Unreleased].