ponytail/tests
Shane McCarron b9fa564429
feat: inject ponytail ruleset into subagents via SubagentStart hook (#254)
* feat: inject ponytail ruleset into subagents via SubagentStart hook

SessionStart additionalContext is parent-thread only, so every Task-spawned
agent ran ponytail-unaware. Add a SubagentStart hook that injects the active
ruleset into each subagent, reusing getPonytailInstructions. Native Claude
needs the hookSpecificOutput JSON form (not raw stdout), so writeHookOutput
grows a SubagentStart branch; readMode exposes the live flag.

Workflow- and team-spawned coverage is undocumented upstream; verify in a
fresh session once installed.

Closes #252

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H1dMag33yz1Kf1jS24Aira

* fix: address QA round 1 — make hook tests hermetic + cover Codex SubagentStart

QA round 1 (panel + deepseek-v4-pro) found two real test issues:
- The new subagent block (and the pre-existing claudeEnv block) used a no-op
  `delete env.PLUGIN_DATA`; run() spreads process.env, so a PLUGIN_DATA /
  COPILOT_PLUGIN_DATA leaked from the shell would steer writeHookOutput into the
  codex/copilot branch and silently mis-fire the native-Claude assertions.
  Fixed at the source: neutralize both vars once at the top, like CLAUDE_CONFIG_DIR.
- The Codex SubagentStart branch (claude-codex-hooks.json is shared by both plugin
  manifests) had zero coverage. Added a codex-path assertion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H1dMag33yz1Kf1jS24Aira

* fix: use PowerShell-safe command form for SubagentStart hook

Match the post-#265 'node ...; exit 0' form used by the sibling hooks. The old 'command -v node ... || exit 0' form fails tests/hooks-windows.test.js (POSIX-guard and non-blocking asserts) once this branch merges onto current main.

---------

Co-authored-by: Shane McCarron <shane.mccarron@corvexconnect.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Emeriko <dietrich.gebert@gmail.com>
2026-06-24 04:19:14 +02:00
..
behavior.test.js feat: refine ruleset from a full-project field review (#39) 2026-06-15 02:02:50 +02:00
commands.test.js fix: ship the missing /ponytail-help command on Claude Code and OpenCode (#62) 2026-06-15 16:32:02 +02:00
copilot-plugin.test.js Adding support for Copilot Marketplace plugin (#47) 2026-06-15 11:02:59 +02:00
correctness.test.js
gemini-extension.test.js Avoid Gemini loading Claude hook events (#139) 2026-06-19 00:24:43 +02:00
hooks-windows.test.js fix: make shared hooks parse in PowerShell (#265) 2026-06-24 01:42:40 +02:00
hooks.test.js feat: inject ponytail ruleset into subagents via SubagentStart hook (#254) 2026-06-24 04:19:14 +02:00
openclaw-skills.test.js feat: ship ponytail to OpenClaw (ClawHub skill package) (#102) 2026-06-16 13:35:35 +02:00
opencode-plugin.test.js feat: publish ponytail as an installable npm package for OpenCode and Pi (#197) 2026-06-24 02:09:40 +02:00
uninstall.test.js fix: add uninstall cleanup script for state outside plugin files (#226) (#228) 2026-06-23 23:38:06 +02:00