mirror of
https://github.com/OthmanAdi/planning-with-files.git
synced 2026-09-14 16:09:40 +08:00
be867c65d3
Eleven of the thirteen hook bearing SKILL.md files still carried the v2.43 hook body inlined in their YAML scalars. The v3 refactor moved that logic into scripts/inject-plan.sh so it would be versioned and testable instead of duplicated, but only the canonical and .agents files were converted. The reporter of #212 installed one of the eleven. Those inline bodies never received: the PLANNING_DISABLED opt-out from #195, which is why the documented workaround was inoperative on that route; the symlink containment guard; the SHA cache key fix; nonce delimiters; the v3 attestation refusal; the ledger summary; and PWF_INJECT=smart. They also still wrote the SHA cache to the world writable /tmp path that moved to XDG_CACHE_HOME for security in v3.0.0. The Stop scalar in those eleven probed only CLAUDE_SKILL_DIR and two $HOME/.claude paths, none of which exists on Codex, Cursor, Factory, CodeBuddy, Mastra or OpenCode, so completion checking there could never find its script and silently did nothing. Discovery is now a first match wins loop. The previous ls a b c | head -1 returns the alphabetically first hit, so a stale marketplace copy outranked the host native one regardless of the order the candidates were written in. Candidates are PWF_SCRIPT_DIR, then CLAUDE_SKILL_DIR, then the host's own skill directory, then the two Claude paths. Repo relative candidates stay banned: a cloned repository must not be able to plant a script the hook then executes. PWF_SCRIPT_DIR exists for workspace installs, which are the recommended method on several hosts and which no user level path can reach. When nothing resolves, the once per turn hook says so rather than exiting silently; the per tool call and precompact hooks stay quiet. The scalars are generated from one template so the eleven cannot drift apart again, the sync manifest ships inject-plan.sh, ledger-summary.sh and resolve-plan-dir.sh to every variant that dispatches (without the resolver, ledger-summary reported a false 0/0 complete), and a new test fails the build if any hook bearing SKILL.md drifts back to an inlined body.