sip-protocol / sip-protocol/sipher
test(agent): add growth-hook coverage for claim/drip/splitSend event slugs
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Background
Final holistic review of PR-E (#269) flagged that growth-hook.test.ts only exercises the send and swap tool paths. The remaining three slugs from TOOL_EVENT_MAP have no test coverage:
sipher_private_claim_completed(mapped fromclaim)sipher_recurring_send_tick(mapped fromdrip)sipher_batch_send_completed(mapped fromsplitSend)
If any of these mapping keys ever get a typo (e.g., splitSend → split_send), no test catches it. The fix is mechanical — 3 lines of it.each parametric coverage.
Why it wasn't fixed in PR-E
Two reasons:
- Scope discipline. PR-E was the canonical-contract rewrite, not a test-coverage expansion.
- Practical impact gated by sipher#262.
claim/drip/splitSend(andsend/swap) currently return{status: 'awaiting_signature'}with notx_signature, so the growth-hook silently no-ops for all of them. Onlyclaimactually emits events today (it forwards its input deposit-tx-signature). The other 4 slugs are dead-on-arrival until sipher#262 is resolved.
So the coverage gap is real but the practical risk is low until #262 ships.
Suggested fix
Inside packages/agent/tests/integrations/torque/growth-hook.test.ts, add a parametric block:
```typescript
describe.each([
{ tool: 'claim', slug: 'sipher_private_claim_completed' },
{ tool: 'drip', slug: 'sipher_recurring_send_tick' },
{ tool: 'splitSend', slug: 'sipher_batch_send_completed' },
])('emits $slug for $tool tool', ({ tool, slug }) => {
it('builds correct event shape', async () => {
baseExecutor.mockResolvedValue({ action: tool, status: 'confirmed', signature: TX_SIG })
const wrapped = wrapExecutorWithGrowthHook(baseExecutor, opts)
await wrapped(tool, { wallet: WALLET, amount: 1, token: 'SOL', recipient: 'rector.sol' })
await new Promise((resolve) => setTimeout(resolve, 0))
expect(emitEventMock).toHaveBeenCalledWith(
expect.objectContaining({ eventName: slug })
)
})
})
```
Three tests, locks the slug mapping.
Priority
Low. Defer until either:
- sipher#262 ships (then these tools actually emit and coverage matters more)
- A general test-hygiene sweep happens
Context
PR-E #269 final holistic review, Minor issue #3.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open packages/agent/tests/integrations/torque/growth-hook.test.ts and review the existing send and swap coverage alongside TOOL_EVENT_MAP. Add the three parameterized cases for claim, drip, and splitSend using the slugs listed in the issue, then run the growth-hook test file. Done means each case confirms emitEvent receives the expected eventName.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100