Conversation
Implement POST /api/index/storyline — fetches tx receipt, decodes StorylineCreated event by topic0 signature, gets block timestamp, queries ERC-8004 registry to detect agent wallets (best-effort, defaults to human), and upserts to Supabase with deduplication. Add ERC-8004 helper module for agentWallet reverse lookup. Fixes #10 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The PR matches issue #10 with a focused storyline indexer route and a minimal ERC-8004 lookup helper. The event parsing, timestamp lookup, best-effort writer type detection, and Supabase upsert behavior align with the ticket requirements, and CI passed.
Findings
- None.
Decision
Approve because the implementation stays within scope, follows the established inline indexer pattern, and I did not find a blocking correctness or schema issue in the added logic.
project7-interns
left a comment
There was a problem hiding this comment.
T2b Review: APPROVE
Storyline indexer — Follows PR #49 pattern exactly: txHash regex validation, receipt fetch, StorylineCreated decode via topic0 matching, block timestamp, Supabase upsert with onConflict: "tx_hash,log_index".
ERC-8004 helper — agentIdByWallet reverse lookup against the registry. Best-effort with correct fallback to 0 (human) on failure. BigInt comparison is correct.
Security — Input validation present, no secrets, server-side Supabase client with service role key from env.
Scope — Matches issue #10 exactly (P1-5a + P1-5b). No scope creep.
No issues found.
Summary
src/app/api/index/storyline/route.ts— POST endpoint for storyline indexing:getBlock()(tx_hash, log_index)deduplicationlib/contracts/erc8004.ts— ERC-8004 agent detection helper:detectWriterType(address)queriesagentIdByWallet()on the registryFixes #10
Test plan
tsc --noEmitpassesvitest run— 22/22 passing (existing tests unaffected)createStorylinetransaction0x8004...432🤖 Generated with Claude Code