Verify Follow-ups Playground

Closing the /ork:verify findings from the PR #2374 audit (issue #2371: bare ork subagent_type fails at dispatch).

1 · Guard glob: before vs after

0files guarded 29files invisible to the guard 109bare spawns fixed by the sweep

  

The 29 listed reference/rule files carried bare subagent_type="<ork-agent>" spawns that the SKILL.md-only glob never saw. The sweep prefixed all 109 with ork:; the extended glob keeps them honest.

2 · Dispatcher registration test concept

// sync-task-dispatcher.test.ts — locks registration, not just the unit
vi.mock('../../lib/analytics-buffer.js', ...);          // intercept bufferWrite

syncTaskDispatcher({ tool_input: { subagent_type: 'Explore', ... } })
  → expect a write to subagent-spawns.jsonl with source:"pretool"

syncTaskDispatcher({ subagent_type: 'general-purpose',
                     description: 'Investigate the failure ... root cause' })
  → merged additionalContext contains ork:debug-investigator

Why: spawn-intent-logger was only unit-tested. Deleting it from TASK_HOOKS previously broke zero tests — telemetry would silently stop. Now the contract is asserted through the dispatcher, so unregistering either hook fails CI.

3 · New TASK_HOOKS order — log intent before consent can short-circuit

  1. 1unified-agent-safety-dispatchercan block
  2. 2team-size-gatecan block
  3. 3spawn-intent-logger ← moved upappend-only
  4. 4fable-spend-consentcan escalate: ask
  5. 5task-existence-gatecan block
  6. 6task-agent-advisoradvisory
  7. 7tool-invocation-linteradvisory
Press simulate to walk the chain.

Trade-off accepted: intents the user later declines at the consent prompt are logged too — better than losing every escalated spawn from the telemetry feed.