Skip to content

Fix AgentKeys live ABI audit paths#43

Merged
YoshiyukiSakura merged 2 commits into
crossagentfrom
issue-42-agentkeys-op-kind-filter
May 27, 2026
Merged

Fix AgentKeys live ABI audit paths#43
YoshiyukiSakura merged 2 commits into
crossagentfrom
issue-42-agentkeys-op-kind-filter

Conversation

@crossagent-production-app
Copy link
Copy Markdown
Contributor

@crossagent-production-app crossagent-production-app Bot commented May 26, 2026

Summary

  • Fix current live AuditAppended(...) op_kind SQL filtering to match receipt data stored with or without a 0x prefix.
  • Add the deployed current root event path, AuditRootAppended(bytes32,bytes32,uint256,uint64), alongside the stale V2 root topic.
  • Return current root metadata with preceding current-ABI leaves as best-effort chain-only rows when the audit worker returns 404.
  • Add live Heima current-ABI regression coverage for decoding, op_kind=0 filtering, cursor-style pagination, worker-404 rows, and current root rows.

Verification

  • go test ./internal/agentkeys -run 'TestDecodeAuditRootRowsCurrent|TestDecodeAuditEventLogs|TestDecodeLiveHeimaCurrentAuditFixtureFilteringAndPagination' -count=1
  • go test ./internal/agentkeys -run 'TestCurrentAuditOpKindDataPrefix|TestDecodeTypedAuditRowsBestEffortKeepsLiveChainRowsWhenWorkerMissing|TestDecodeLiveHeimaCurrentAuditFixture' -count=1
  • go test ./internal/agentkeys -count=1
  • gh pr checks 43 --repo litentry/subscan-essentials --watch --interval 10
  • Live pre-deploy reproduction still shows production is unpatched until this PR is promoted: curl --http1.1 --tlsv1.2 -sS 'https://explorer-api.heima.network/agentkeys/audit/0x941cb1c3260518bbf40eac7d02663517fc7cff304d9b03e80d2cc54126c6bef2?limit=5&op_kind=0' returned events: [].
  • Live Heima RPC proof for the known root found topic 0x01eedbc2950386768c2fafec0f405e6f3857dd274023e1593d7cdb381918bdd1, which matches AuditRootAppended(bytes32,bytes32,uint256,uint64), with data words 0x1c and 2 at tx 0xf70fdefb211bebdfc19850f0bd071a109e8a1a3916f43a643c81c6861e732706.

Delivery Evidence Summary

Change:

  • Current live AuditAppended(...) op_kind=0 filtering now matches indexed receipt data stored without 0x while keeping prefixed compatibility.
  • /agentkeys/audit/root/<merkle_root> now recognizes the deployed current root topic and fetches associated current-ABI leaf rows best-effort.
  • Worker 404s remain chain-only rows with envelope_available=false, hash_verified=false, raw chain identity, op kind/name, sequence/index key, and block/log/tx fields.

Objective Evidence:

  • go test ./internal/agentkeys -run 'TestDecodeAuditRootRowsCurrent|TestDecodeAuditEventLogs|TestDecodeLiveHeimaCurrentAuditFixtureFilteringAndPagination' -count=1 passed.
  • go test ./internal/agentkeys -run 'TestCurrentAuditOpKindDataPrefix|TestDecodeTypedAuditRowsBestEffortKeepsLiveChainRowsWhenWorkerMissing|TestDecodeLiveHeimaCurrentAuditFixture' -count=1 passed.
  • go test ./internal/agentkeys -count=1 passed.
  • gh pr checks 43 --repo litentry/subscan-essentials --watch --interval 10 passed: Go build and stable tests, Vercel Preview Comments, Vercel - subscan-essentials, and Vercel - subscan-essentials-ui-react.
  • Live RPC root discovery command found the sample root event on Heima mainnet with current topic 0x01eedbc2950386768c2fafec0f405e6f3857dd274023e1593d7cdb381918bdd1, block 0x930382, and tx 0xf70fdefb211bebdfc19850f0bd071a109e8a1a3916f43a643c81c6861e732706.

Visual Evidence:

  • n.a.; backend/API-only change. No UI/browser behavior was modified.

Reviewer:

Risks / Not Covered:

  • Production https://explorer-api.heima.network still shows the pre-deploy behavior until this PR is promoted to that host.
  • The Vercel preview API URL is deployment-protected from this environment, so no protected-preview API response is claimed as passing evidence.

Refs #42

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
subscan-essentials Ready Ready Preview, Comment May 27, 2026 5:45am
subscan-essentials-ui-react Ready Ready Preview, Comment May 27, 2026 5:45am

Request Review

@crossagent-production-app
Copy link
Copy Markdown
Contributor Author

Delivery Evidence Summary

Change:

  • Fixed current live AuditAppended op_kind SQL filtering so op_kind=0 matches receipt data stored without a 0x prefix.
  • Kept compatibility for prefixed receipt data and added focused current-ABI regression coverage.

Objective Evidence:

  • go test ./internal/agentkeys -run 'TestCurrentAuditOpKindDataPrefix|TestDecodeTypedAuditRowsBestEffortKeepsLiveChainRowsWhenWorkerMissing|TestDecodeLiveHeimaCurrentAuditFixture' -count=1 exit code 0, passed: Focused AgentKeys current-ABI filtering and chain-only row regressions completed.
  • go test ./internal/agentkeys -count=1 exit code 0, passed: AgentKeys package regression suite completed.
  • curl -sS 'https://explorer-api.heima.network/agentkeys/audit/0x941cb1c3260518bbf40eac7d02663517fc7cff304d9b03e80d2cc54126c6bef2?limit=5&op_kind=0' exit code 0, completed: Production pre-deploy signal returned an empty events array, matching the original reported op_kind=0 behavior before PR Fix AgentKeys live ABI audit paths #43 is deployed.
  • Playwright rendered http://127.0.0.1:3014/contract/0x63c4545ac01c77cc74044f25b8edea3880224577 exit code 0, completed: Heima Explorer contract page rendered with the CredentialAudit contract address and no framework overlay.

Visual Evidence:

  • Heima Explorer CredentialAudit contract page
  • Real Heima Explorer browser surface from the repo Next.js UI, using NEXT_PUBLIC_API_HOST=https://explorer-api.heima.network and route /contract/0x63c4545ac01c77cc74044f25b8edea3880224577. Visible anchors: Heima Explorer, EVM Contract, Contract #0x63c4545ac01c77cc74044f25b8edea3880224577, Contract tab, Transactions tab, ERC-20 Transfers tab, ERC-721 Transfers tab.

Reviewer:

Risks / Not Covered:

  • PR Fix AgentKeys live ABI audit paths #43 covers the op_kind=0 live row filter gap only; root/batch event support needs protocol owner confirmation of the deployed root event signature and leaf association rule.
  • Production proof of the patched op_kind response requires deployment of PR Fix AgentKeys live ABI audit paths #43; current production still reflects the original pre-deploy behavior.

Generated at: 2026-05-26T13:51:19.849Z

@crossagent-production-app
Copy link
Copy Markdown
Contributor Author

crossagent-production-app Bot commented May 26, 2026

Delivery Evidence Summary

Change:

  • Fixed the current live AuditAppended op_kind=0 SQL filter path for receipt data stored with or without a 0x prefix.
  • Added the deployed current AuditRootAppended(bytes32,bytes32,uint256,uint64) root path alongside the V2 root topic.
  • Clarified current root metadata so rootIndex is returned as root_index and op_kind_bitmap_u256 is reserved for V2 bitmap roots.
  • Kept worker 404 live-hash behavior as explicit chain-only rows with envelope_available=false and hash_verified=false.

Objective Evidence:

  • go test ./internal/agentkeys -run 'TestDecodeAuditRootRowsCurrent|TestDecodeAuditEventLogs|TestDecodeLiveHeimaCurrentAuditFixtureFilteringAndPagination' -count=1 exit code 0: Passed: current root decoding, event decoding, live fixture filtering, and pagination coverage.
  • go test ./internal/agentkeys -run 'TestCurrentAuditOpKindDataPrefix|TestDecodeTypedAuditRowsBestEffortKeepsLiveChainRowsWhenWorkerMissing|TestDecodeLiveHeimaCurrentAuditFixture' -count=1 exit code 0: Passed: op_kind data-prefix matching, worker-404 chain-only rows, and live Heima fixture coverage.
  • go test ./internal/agentkeys -count=1 exit code 0: Passed: 20 AgentKeys package tests.
  • go test $(find internal/server/http -maxdepth 1 -name '*.go' ! -name '*_test.go') exit code 0: Passed compile check for the changed HTTP route code.
  • gh pr view 43 --repo litentry/subscan-essentials --json headRefOid,statusCheckRollup exit code 0: PR head 295470c shows Go build and stable tests plus Vercel statuses successful.

Visual Evidence:

Reviewer:

  • CrossAgent parent follow-up after Hanwen review note; code patch committed as 295470c and pushed to issue-42-agentkeys-op-kind-filter.

Risks / Not Covered:

  • Production https://explorer-api.heima.network still shows pre-deploy behavior until PR Fix AgentKeys live ABI audit paths #43 is merged/promoted: op_kind=0 returns events=[] and the known root path returns 404.
  • Live V1 AuditAppended payloadHash worker 404 is expected protocol behavior; row APIs must preserve chain-only event data rather than claiming V2 CBOR hash proof.
  • Post-deploy production evidence still needs exact curl/API output for unfiltered rows, op_kind=0, actor_omni, root path, and envelope 404/chain-only behavior.

Generated at: 2026-05-27T05:52:16.116Z

@YoshiyukiSakura YoshiyukiSakura merged commit c1c6bf6 into crossagent May 27, 2026
5 checks passed
YoshiyukiSakura added a commit that referenced this pull request May 27, 2026
Fix the test explorer deploy script so a CI-owned checkout with local changes is cleaned before switching to origin/crossagent.\n\nValidation: bash -n scripts/deploy-test-explorer-api.sh\n\nRelated: #42, #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants